This topic is now archived and is closed to further replies.


Good use for SW Vertex shaders?

Recommended Posts

My terrain engine uses a compressed vertex format, which currently I expand to fill a normal FVF with. What actually happens is: 1)WORD x,y & z get multiplied by a scaling floats Space & ZSpace to get real x,y,z coords (actually I think that might be incorporated in the matrices) 2)A rgb color constant for the lighting is multiplied by a BYTE value for each vertex as a kind of lightmap. 3)u&v texcoords are generated soley from the x/y coords, with scaling factors so I can set a aXb size texture to have cXd dimensions. I''ve got as much of this done by texture stages as possible, which is fast with Hardware T&L cards but shows no advantage over my own version otherwise. Obviously this is very CPU-dependant for framerate and on lower-specced GPUs that''s unavoidable. However I wondered if it would be quicker to do these simple multiplications etc (I probably need some way to keep texcoords within the maximum range allowed too) using vertex shaders. Obviously this is preferable on cards which support HW shaders; I wondered if the SIMD optimisations in the SW shader code would be quicker than my software version? In case you wondered, the CPU hit of generating these vertices IS very substantial (may even be some min() or max() calls there to restrict rgb values to 0-255). And using an uncompressed format makes the map take up 4-6X more memory (my nice 32Mb file which would run on most PCs is now at least 128Mb which is way over what the minimum spec should be). Thanks for any help.
Read about my game, project #1 NEW (9th September)diaries for week #5 Also I''m selling a few programming books very useful to games coders. Titles on my site.
John 3:16

Share this post

Link to post
Share on other sites