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

Changes to d_scan.c


Changes to d_scan.c

Postby Phantom » Feb 22, 2001 @ 7:00am

I'll just post this bit of info then:<br><br>I've removed the 'perspective correctness' from D_DrawSpans8, and made it 100% fixed point. Some background info: This function is passed a 'span' struct, wich contains only an u/v and a length. This struct represents a single horizontal line of a polygon on screen. This is weird: u/v are normally used to represent coordinates in a texture map, but in Quake, they are SCREEN coordinates. So, this struct actually contains only enough info to know where to draw a span, and how long it should be. U and V, in turn, are called S and T in Quake. Keep this in mind, it makes life easier. :)<br><br>So, the span struct doesn't contain enough info. 'Enough info' is therefore obtained from a globally declared set of vars that form a matrix, wich is used to transform 2D screen coordinates into a position on a texture map. These vars are floats, so I convert them to fixed point each time they change. This is at most once per polygon, but usually not that often (since multiple polygons use the same texture mapping).<br><br>If anyone wants to test the new code, let me know. I have no idea how much speed I have gained. :)<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: Changes to d_scan.c

Postby Dan East » Feb 22, 2001 @ 8:06am

Yeah, ID uses a ton of global vars. Not the best practice, and it makes following the code much harder. If you want to email me the modified files I'll build and try them, or send me the exe or whatever. Is perspective correctness anything like political correctness? Quake has never been politically correct, so I guess it need not be the other either. ;)<br><br>Dan East
User avatar
Dan East
Site Admin
 
Posts: 5264
Joined: Jan 25, 2001 @ 5:19pm
Location: Virginia, USA


Re: Changes to d_scan.c

Postby Phantom » Feb 22, 2001 @ 9:31am

Do we need shaded monsters and particle effects by the way? :) I removed some of those, to see if the speed goes up.<br>Don't panic, I can put them back at any time. :)<br>Dan: I'll send you the modified stuff right away.
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: Changes to d_scan.c

Postby Dan East » Feb 22, 2001 @ 11:23am

It would be nice to perhaps add in Quake console variables to allow runtime selection of which effects to provide. I can do that part if you put in some decent comments (unlike ID, I think there's like 5 comments in the entire Quake source). :) I removed the sky / water / lava surface animations, and it made absolutely no change in performance. I guess that further indicates that the actual 3D rendering is taking 95% of the work. I tried a build with no textures at all, and still a very insignificant improvement was realized (like .5 fps).<br><br>Dan East
User avatar
Dan East
Site Admin
 
Posts: 5264
Joined: Jan 25, 2001 @ 5:19pm
Location: Virginia, USA


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