Original Post
Ok before I render my scene I first draw to the depth buffer. Here is how I do this: - disable color buffer writes - enable writes to the depth buffer - set a vertex shader that only transforms vertices (ie. no dealing with lights) - set the pixel shader to NULL - draw the render primitive then - enable writes to color buffer - disable writes to depth buffer - set vertex\pixel shaders for object and draw for total number of lights affecting the object. Now I've seen some examples where when people draw to the depth buffer in the Z prepass they set a pixel shader that only renders an ambient pass. Why would you need to do that? You've disabled writes to the color buffer so isn't setting a pixel shader irrelevant in this case? Thanks for anyones help.