This site is no longer active and is available for archival purposes only. Registration and login is disabled.

PocketQuake Fixed Point Modifications


PocketQuake Fixed Point Modifications

Postby Phantom » Feb 21, 2001 @ 8:14am

People,<br><br>I have talked a bit with Dan about this fixed point stuff. Let me introduce myself: My name is Jacco Bikker, I am 27 years old, and I have been working with 3D graphics since I was 12. I wrote about 6 3D engines, of wich 5 where software-only, and 2 where for my boss. :) Right now, I'm working on some voxel graphics on the iPaq.<br>Before everyone gets too excited: I can spend some time on PocketQuake, but I have no idea how much, since I have *lots* of other projects, not to mention my job (currently, PS2 developer) and family. I intend to do some quick fixes to gain a couple of frames, just to get the other coders going. I think this HAS to be a joint effort.<br>On the technical side of things: Quake is using A LOT of floating point calculus. To get this 'fixed' ;) I suggest we don't try some kind of a generic solution (Dan already tried that) but instead focus on the end of the pipeline, i.e., the actual polygon rasterization. There are two reasons for this:<br>1. This is probably where PocketQuake spends most of it's time (Dan, can you confirm this? How much slower does Quake run at full-screen landscape mode?)<br>2. There is no code that relies on the result of these calculations. Wich means that errors are not propagated to other parts of the engine, causing unexplainable errors.<br>After that, we can work our way up: First, modify the code that supplies the polygon rasterizers with data, and so on.<br>Some other ideas that might gain a couple of frames:<br>- The texture cache is also a loose end. It is used to store mixed texture/lightmap combo's; if we loose precision there, this will show up on the screen, but it won't cause havoc elsewhere.<br>- The size of the texture cache is currently 600Kb. We might want to increase this amount; mixing is expensive.<br><br>I think we can double the frame rate by making the polygon code fixed point. That's a small amount of code; this should be quite possible. By tweaking the texture cache we should be able to gain another 2 fps or so, making Quake VERY playable on the iPaq.<br><br>I'll start tonight. Who wants to join? How is this SourceForge stuff doing? Who is who? :)<br>If you need to talk to me, please try ICQ. I'm online all day (but I live in Europe).<br><br>Greets<br>Jacco.
Give me some good data and
I will give you the world
User avatar
Phantom
pm Insider
 
Posts: 913
Joined: Feb 21, 2001 @ 8:14am
Location: Houten, Netherlands


Re: PocketQuake Fixed Point Modifications

Postby Dan East » Feb 21, 2001 @ 9:17am

240x180: 3.97 fps<br>320x240: 2.74 fps<br><br>The ratio of pixels between the two modes is 1.78. The ratio of fps is 1.45, which shows a very strong correlation between the number of pixels rendered and the fps.<br><br>In case anyone wonders how I am getting these fps values, I do a soft reset of the device, and start Quake with a new single player game. Once the starting room opens I don't move the character at all. I then execute the console command TIMEREFRESH. Because the surroundings are exactly the same each time this provides a relatively accurate method of generating a base framerate.<br><br>Dan East
User avatar
Dan East
Site Admin
 
Posts: 5264
Joined: Jan 25, 2001 @ 5:19pm
Location: Virginia, USA


Re: PocketQuake Fixed Point Modifications

Postby Phantom » Feb 21, 2001 @ 9:21am

Dan,<br><br>How are you displaying the buffer on the iPaq? Do you rotate the buffer into place? I mean, this could give landscape mode a slight advantage, because this rotation wouldn't be neccessary.<br><br>- Jacco.
Give me some good data and
I will give you the world
User avatar
Phantom
pm Insider
 
Posts: 913
Joined: Feb 21, 2001 @ 8:14am
Location: Houten, Netherlands


Re: PocketQuake Fixed Point Modifications

Postby Dan East » Feb 21, 2001 @ 9:35am

In vid_ppc.c::VID_Update() I blit Quake's palette-based bitmap to the video buffer pixel by pixel, looking up each pixel in the palette. There would be no performance difference between landscape and portrait, except for the fact that 1.78 times as many pixels must be copied in landscape. Technically the iPaq's video buffer is landscape, but since each pixel must be looked up in the palette, and blitted individually, this makes no difference. The rotation is performed during the blitting process no performance loss results.<br><br>I convert palette entries to the iPaq's RGB 565 scheme when the palette is set, so blitting involves copying the palette value (a short) directly to the video buffer.<br><br>Dan East
User avatar
Dan East
Site Admin
 
Posts: 5264
Joined: Jan 25, 2001 @ 5:19pm
Location: Virginia, USA


Re: PocketQuake Fixed Point Modifications

Postby Phantom » Feb 21, 2001 @ 9:41am

OK, thanks for the info.<br>I'll try to replace the span rasterizers with some affine rasterizing code tonight, to see what the theoretical achievable gain is in that part of the code. Should be quite a bit, based on your data.
Give me some good data and
I will give you the world
User avatar
Phantom
pm Insider
 
Posts: 913
Joined: Feb 21, 2001 @ 8:14am
Location: Houten, Netherlands


Re: PocketQuake Fixed Point Modifications

Postby Phantom » Feb 21, 2001 @ 11:27am

Dan,<br><br>I have been looking around a bit:<br><br>In source d_edge.c there is some code that calls the span rasterizers in d_scan.c. Each polygon is stored as a linked list of spans, each span is on a single scanline (originally I thought these where the 8 or 16 pixel perspective corrected subspans). <br><br>The span rasterizers come in a couple of flavours: One for the sky, one for actors, one for scenery and one for 'turbulence' (for submerged scenery). Apparently, actors are always drawn without turbulence, even under water. Is this true?<br><br>The scenery rasterizer is perspective correct, I will remove this functionality for the moment, because those calculations are very expensive and the result probably hard to notice on such a small display.<br><br>These span rasterizers take only a single structure (espan_t) and use quite a lot of floating point code internally. <br><br>Interesting enough, the espan_t structure contains u/v coordinates in fixed point. :) <br><br>The span rasterizers are about 50 lines of code each, so this is going to be an easy start. I'll let you know if the conversion is easy, and if it pays of. :) It should, by the way. A lot. :)<br><br>The code that constructs the span lists is not too hard either, so it should be relatively easy to have fixed point polies soon.<br><br>There is some very nasty code further up the pipeline though; that's gonna be a rough task.<br><br>- Jacco.
Give me some good data and
I will give you the world
User avatar
Phantom
pm Insider
 
Posts: 913
Joined: Feb 21, 2001 @ 8:14am
Location: Houten, Netherlands


Re: PocketQuake Fixed Point Modifications

Postby Moose or Chuck » Feb 21, 2001 @ 4:12pm

I'm glad to know that someone professional cares about us and is working on the project =). Keep us informed, but work on PQ more often than informing.
Moose or Chuck
 


PocketQuake Fixed Point Modifications

Postby Dr. Phat » Feb 22, 2001 @ 2:18pm

Thats Right!  Professionals rule.  
Mike Greene
"Quanti est illa perna?" (How much is that ham)
User avatar
Dr. Phat
the <i>phattest</i>
 
Posts: 834
Joined: Jan 24, 2001 @ 4:46pm
Location: Vienna, VA


Re: PocketQuake Fixed Point Modifications

Postby Matt Keys » Feb 22, 2001 @ 3:23pm

You know, you guys elude to the idea that Dan is not a "professional." Keep in mind, before Dan came along Quake was thought to be impossible to port.
Matt Keys
Co-Founder
PocketMatrix.com
User avatar
Matt Keys
Site Co-Founder
 
Posts: 3243
Joined: Jan 24, 2001 @ 7:29pm
Location: Michigan, USA


Re: PocketQuake Fixed Point Modifications

Postby 999 » Feb 22, 2001 @ 3:33pm

Thanks for pointing that out Matt.<br><br>When I read Moose's original post it didn't really sit well, but I thought it was in how I read it.<br><br>Now, let me just clarify a little something:<br><br>Dan is the [/b]Man[/b]!!!<br><br>'nuff said.<br><br>
Image
999
pm Member
 
Posts: 1227
Joined: Jan 24, 2001 @ 11:48pm


Re: PocketQuake Fixed Point Modifications

Postby Moose or Chuck » Feb 22, 2001 @ 5:53pm

Ya, I didn't mean any disrespect to Dan East. He started this, he's already a legend. But Jacco comes along with his experience and tells us ways to easily optimize the game. Jacco is the person that, I believe, will make it possible to play on Casio's, and even better for Ipaqs. Since i own a Casio, Jacco's plans mean the difference to me.
Moose or Chuck
 


Re: PocketQuake Fixed Point Modifications

Postby Chris Edwards » Feb 22, 2001 @ 9:12pm

Chris Edwards
Founder
User avatar
Chris Edwards
Site Co-Founder
 
Posts: 4048
Joined: Jan 24, 2001 @ 7:14pm
Location: Vancouver, BC


Re: PocketQuake Fixed Point Modifications

Postby Phantom » Feb 23, 2001 @ 4:28am

Give me some good data and
I will give you the world
User avatar
Phantom
pm Insider
 
Posts: 913
Joined: Feb 21, 2001 @ 8:14am
Location: Houten, Netherlands


Re: PocketQuake Fixed Point Modifications

Postby Phantom » Feb 23, 2001 @ 4:31am

Give me some good data and
I will give you the world
User avatar
Phantom
pm Insider
 
Posts: 913
Joined: Feb 21, 2001 @ 8:14am
Location: Houten, Netherlands


Re: PocketQuake Fixed Point Modifications

Postby Dr. Phat » Feb 23, 2001 @ 10:19am

As Mr. Moose said, it has already been established that Danis the man.  Therefore, we were just ushering Jacco into a relatively similar position.  We meant no harm to Dan's rep.  That is all-
Mike Greene
"Quanti est illa perna?" (How much is that ham)
User avatar
Dr. Phat
the <i>phattest</i>
 
Posts: 834
Joined: Jan 24, 2001 @ 4:46pm
Location: Vienna, VA


Return to Pocket Quake 1 and 2


Sort


Forum Description

Discuss Pocket Quake 1 and 2 by Dan East

Moderators:

Dan East, sponge, James S

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron