Jump to content
  • Advertisement
Sign in to follow this  
Shawn1984

Use alpha channel to store the depth value

This topic is 4423 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

I read an article talking about toon shaing. The article uses a vertex shader to fill in alpha channel with the depth value of the pixel for later edge detection. But I tried it myself and I found that my alpha channel is alway 0 even I have set the clear value to (0,0,0,1). I do not know why. And one thing I'm confused is that the articel uses alpha channel to store depth ,but will the alpha channel value get interpolated when the final image is produced? Thanks a lot in advance!

Share this post


Link to post
Share on other sites
Advertisement
What is the format of the surface that you are rendering to? Formats such as D3DFMT_X8R8G8B8 (common for default back-buffer) default to 0 for all alpha. You should use a format such as D3DFMT_A8R8G8B8 (or any of the higher-precision ones).

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!