Usually it is done using something along the lines of the texdepth command in a Pixel shader. I have heard of some success using vertex shaders though and that should be a bit more efficient too. I'll poke around tonight and see what I can dig up on the depth test technique in terms of online documentation. I think I first learned of it in ShaderX though. Needs PS 1.4 to work - and it is pretty efficient too (solves the nasty z-buffer sorting error as well). The culled data when using texdepth (or more correctly data that is not culled) gets passed to the r5(have to double check?) registry and can be passed on to additional shaders and passes as needed.

The lights were my bad. I went back and took a look at the technique I am using and it is one ASM pass per light. According to my notes the ASM versus HLSL freed up about 15 FPS. Also using the initial pass to set the z-buffer made it so that I do not need to deal with a lot of extra pixels which will not be seen anyway (exact numbers will vary depending on scene complexity but it appears to have been almost a 25-35% improvement).

Like I said though I will look for the documentation on that culling technique tonight. I have too much junk covering my desk now to find it quickly and my bookmarks have become almost worthless (too many damned sites bookmarked). It will likely need some tweaking to work with 3DGS, but it is a pretty simple shader to set up (might even solve Orange Brat's depth problem for prerendered back grounds...at least it should be able to in theory).


Virtual Worlds - Rebuilding the Universe one Pixel at a Time. Take a look - daily news and weekly content updates.