zbuffer switch

Started by
5 comments, last by Erik Rufelt 14 years, 6 months ago
Hi, In my deferred engine, when I render lights, I exploit the device zbuffer to avoid rendering invisible pixel. But now I need to render for each light its shadow map, endind up overwriting the zbuffer (this pass uses the zbuffer). I was wondering, how do you resolve this ? Is there any way to switch zbuffer, or to use a 'secondary' zbuffer ? THANKS!
Advertisement
Yes there should be. What API/language are you using?
Quote:Original post by Erik Rufelt
Yes there should be. What API/language are you using?


DX9
You can use the CreateDepthStencilSurface and SetDepthStencilSurface methods of your device.
Quote:Original post by Erik Rufelt
You can use the CreateDepthStencilSurface and SetDepthStencilSurface methods of your device.


I was just searching for the method you've writen here.
Thank you man !
One last question: how do I set the 'device' zbuffer ? I mean, the zbuffer normaly used.

THANKS !
GetDepthStencilSurface should let you obtain a reference to the auto-depth-stencil surface.

This topic is closed to new replies.

Advertisement