Use alpha channel to store the depth value
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!
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).
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement