Texture blending...
Hello...I've been trying to blend some textures but I'm having no success!!lol...So, I'm coming here to ask for your help...huh
Well, this is what I wanna do:
1)I have this Tex1:
2),This Tex2:
3)and this Mask:
4)And I wanna blend them and get this result:
How do I do it?!?
One more!huh....this is about alpha blending:
1)I have this Tex1:
2)and this Mask:
3)and I wanna get this result:
Resuming, I want that the black in the mask make the grass be trasparent and the white make the grass appears normally.How do I do it?!?
obs.:these images were generated by 3dsmax...
Thank you all very much much much :)
[Edited by - xissburg on September 8, 2005 11:32:06 PM]
hmm?!?Why my images doesn't appear?!?the tags are correctly set....wow...damn...please copy and paste the urls to your browser address...I'm really needing to know how to do that....
Thanks...
Thanks...
For the first one im not that sure..maybe on google, you find something usefull
For the second question.. try to read Texture Splatting in Directc3D Its a good article..
For the second question.. try to read Texture Splatting in Directc3D Its a good article..
For one texture only, you can create an image with 32 bits (TGA, DDS etc) in order to use the RGB channels (24 bits) for the colored image and the alpha channel (8 bits) for the alpha map. This task is made in an image editor, like PhotoShop. SDK DX also has a texture editor to create DDS images.
So, in the code, you must to set the following:
device->SetTextureStageState( 0 , D3DTSS_ALPHAARG1, D3DTA_TEXTURE );
device->SetTextureStageState( 0 , D3DTSS_ALPHAOP, D3DTOP_SELECTARG1 );
device->SetRenderState( D3DRS_SRCBLEND, D3DBLEND_SRCALPHA );
device->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA );
device->SetRenderState( D3DRS_ALPHABLENDENABLE, true);
// render the textured object...
device->SetRenderState( D3DRS_ALPHABLENDENABLE, false);
For multitexturing, you can use pixel shaders. Search for multitexturing tutorials.
So, in the code, you must to set the following:
device->SetTextureStageState( 0 , D3DTSS_ALPHAARG1, D3DTA_TEXTURE );
device->SetTextureStageState( 0 , D3DTSS_ALPHAOP, D3DTOP_SELECTARG1 );
device->SetRenderState( D3DRS_SRCBLEND, D3DBLEND_SRCALPHA );
device->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA );
device->SetRenderState( D3DRS_ALPHABLENDENABLE, true);
// render the textured object...
device->SetRenderState( D3DRS_ALPHABLENDENABLE, false);
For multitexturing, you can use pixel shaders. Search for multitexturing tutorials.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement