it is not understand at all.....
Hi,
I read a lot of tutorials without success, it makes me feel those tutorials are not written for a good understanding of this technology or for people that really don't understand the problem.
I want to put a texture over a previous one making use of third one for the alpha channel. Impossible to get it!
I try to render first texture in a pass, and then the second texture in a second pass, but using the third texture as alpha channel for the second pass.
Would any guru here give me any clue how to do it?
Thank you,
Saiz
Why don''t you combine the textures into one image before rendering? It''ll give you the effect you wanted, and you don''t have to bother with extensions and stuff...
Because the possibities are high and if in theory it will done very fast for any graphic card (if I knew how to do it).
Saiz
Saiz
Are you using DirectX or OpenGL? On most modern hardware you don''t need to do multiple passes to do what you want, you can do it all in one pass. You just need to set each of your textures to a different texture stage (DX terminology, don''t know if it''s the same for OpenGL) and then set your texture stage states to the appropriate blending modes to achieve the effect you want. Alternatively, if your target hardware supports it, you could write a pixel shader to do what you want.
Without knowing exactly what you want to do this for I can''t say if it''s the best way of achieving your aim but here''s how you could do it with DX:
Render your first texture in the first pass normally.
In the second pass, set your second texture as the texture for texture stage 0 and your third (alpha channel) texture as the texture for texture stage 1. Then set your texture stage states to:
ColorOp[0] = MODULATE;
ColorArg1[0] = TEXTURE;
ColorArg2[0] = DIFFUSE;
AlphaOp[0] = MODULATE;
AlphaArg1[0] = TEXTURE;
AlphaArg1[0] = DIFFUSE;
ColorOp[1] = SELECTARG2;
ColorArg1[1] = TEXTURE;
ColorArg2[1] = CURRENT;
AlphaOp[1] = SELECTARG1;
AlphaArg1[1] = TEXTURE;
AlphaArg2[1] = CURRENT;
That should do what you want if I''ve understood you correctly.
Without knowing exactly what you want to do this for I can''t say if it''s the best way of achieving your aim but here''s how you could do it with DX:
Render your first texture in the first pass normally.
In the second pass, set your second texture as the texture for texture stage 0 and your third (alpha channel) texture as the texture for texture stage 1. Then set your texture stage states to:
ColorOp[0] = MODULATE;
ColorArg1[0] = TEXTURE;
ColorArg2[0] = DIFFUSE;
AlphaOp[0] = MODULATE;
AlphaArg1[0] = TEXTURE;
AlphaArg1[0] = DIFFUSE;
ColorOp[1] = SELECTARG2;
ColorArg1[1] = TEXTURE;
ColorArg2[1] = CURRENT;
AlphaOp[1] = SELECTARG1;
AlphaArg1[1] = TEXTURE;
AlphaArg2[1] = CURRENT;
That should do what you want if I''ve understood you correctly.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement