Use alpha channel to store the depth value

Started by
1 comment, last by Shawn1984 17 years, 10 months ago
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!
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).
Dustin Franklin ( circlesoft :: KBase :: Mystic GD :: ApolloNL )
I use D3DFMT_A8R8G8B8

This topic is closed to new replies.

Advertisement