Original Post
Hey all, I am working on an effect using HLSL that requires a z-prepass (also, my understanding is that every frame in Doom III starts with a z-prepass so I want to understand how to do this). However, I am pretty new to HLSL so I have a couple of questions. 1) I am rendering to a texture, so will there be a z-buffer and will it be retained until I either switch render targets or clear the buffer? 2) As I mentioned, I need to do a z-prepass and then start doing actual color writes onto the texture. How can I write only to the z-buffer so that the first pass is quick? 3) Do I need to write a different z-prepass shader for every model that uses a different vertex buffer type. Or, should I create a second vertex buffer for each model that contains only position data so that I am not sending as much vertex data during the z-prepass step? Thanks for the help. Todd