Jump to content
  • Advertisement
Sign in to follow this  
wswqwps

How to render a depth/stencil texture to a surface

This topic is 3558 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
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?

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!