Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Christoph

Blending Textures

This topic is 5274 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi there, how can I gradually blend two textures? I don''t mean a static effect such as detail mapping; my aim is to slowly switch between two cloud-textures to make the user believe the sky is changing. Greetz, Chris

Share this post


Link to post
Share on other sites
Advertisement
set the first texture, and then the second, and slowsly set the alpha for the second texture higher and higher...

Share this post


Link to post
Share on other sites
Thank you, but isn''t that to slow, direct manipulation at the textures? After all, how do I set the alpha-value? I couldn''t find an according function...

Share this post


Link to post
Share on other sites
One way is to use the diffuse color on the vertices and change the alpha components of SkyMesh1 from 100% -> 0% while at the same time changing alpha of SkyMesh2 from 0% -> 100%

Sky1::Update()
{
DWORD dwColor = D3DCOLOR_ARGB( CurrentAlpha, 255, 255, 255 );
for all vertices
{
vertex[x].diffuse = dwColor;
}
CurrentAlpha--;
}


quote:
Original post by Christoph
Thank you, but isn't that to slow, direct manipulation at the textures? After all, how do I set the alpha-value? I couldn't find an according function...




[edited by - Rhapsodus on May 8, 2004 3:49:37 PM]

Share this post


Link to post
Share on other sites
hmm, I don''t plan to use vertex blending because perrmanently locking vertex buffers costs performance... is there a way to directly manipulate the texture alpha components?

Share this post


Link to post
Share on other sites

You could do it per pixel, but I think this is a slower method and its a pain accounting for all pixel formats...

http://www.drunkenhyena.com/docs/d3d8/dhGrayScale.phtml

quote:
Original post by Christoph
hmm, I don''t plan to use vertex blending because perrmanently locking vertex buffers costs performance... is there a way to directly manipulate the texture alpha components?



Share this post


Link to post
Share on other sites
There are loads of options that doesn''t involve locking resources. E.g. you can write whatever alpha you want in a vertex shader, you can check for TFACTOR support, dest alpha, add another texture stage, draw the second texture lit with the alpha in the ambient, etc...

-Morten-

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!