How to render a depth/stencil texture to a surface

Started by
1 comment, last by wswqwps 15 years, 6 months ago
Hi, I have a texture whose format is D24S8. How do I render the texture to another surface?( After that I would set the surface to a depth/stencil surface ). I use a quad and the DrawPrimitiveUP() function to do this, but I do not know how to write the pixel shader. Any tip is welcomed, thanks.
Advertisement
Why do you want to render the texture to a surface, if you only plan on setting it as the depth-stencil surface? A texture is just a set of surfaces, you can use the surface inside the texture (effectively using the texture) as a depth-stencil surface. Is that what you want to do?
Sirob Yes.» - status: Work-O-Rama.
Quote:Original post by sirob
Why do you want to render the texture to a surface, if you only plan on setting it as the depth-stencil surface? A texture is just a set of surfaces, you can use the surface inside the texture (effectively using the texture) as a depth-stencil surface. Is that what you want to do?


Thanks. I know that I could use GetSurfaceLevel() function to get the level-0 of the texture and then set it to be the depth/stencil render-target directly.
But because of special purpose I have to do as I have described.

This topic is closed to new replies.

Advertisement