Sign in to follow this  
wswqwps

How to render a depth/stencil texture to a surface

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this