Multipass texturing question...

Started by
1 comment, last by Jason Z 19 years, 7 months ago
I am trying to figure out how to do multipass texturing as opposed to multitexture in a single pass. Currently I blend three textures according to two blend weights, one stored in the vertex diffuse alpha and the other in the vertex diffuse rgb. This way works fine, but I am trying to allow for more passes in the future. So I tried to switch it over to single texture passes that get alpha blended onto the frame buffer. But if I am outputing the texture color as the pixel output to be blended, how do I specify the blending weight? I can't use the color anymore because it contains the texture color. Surely I am missing something. I can't believe that it would be this difficult to do multipass rendering. Can anyone give me any insight into how to do this?? Thanks in advance, Jason Z
Advertisement
Hi jason Z,

set AlphaBlenEnable to true.
set SourceBlend to SourceAlpha.
set DestinationBlend to InvSourceAlpha.

now the previous render target image from pass 1 is blended with the output of the current pass. The blend factor is the alpha channel of the current pass.

regards,

atem
Wouldn't the alpha channel of the current pass be the alpha of the texture on the current pass? It seems that this is the case because my first and second passes seem to produce a fairly even mix of the first two textures. Is there another state to set so that the vertex alpha gets passed through to the final output?

Thanks again,

Jason Z

This topic is closed to new replies.

Advertisement