Archived

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

Question/Problem

This topic is 5654 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

For a demo I''m trying to make a planet with two textures. the ground which spins with the planet, and then a cloud texture that spins independently of the ground, but blends with it where there are clouds, (much like the earth looks from above). When I use multitexturing, openGL just blends the two together and the ground just gets a little lighter. I tried setting it to decal mode, but of course that totally obscures the ground texture. Unfortunately I don''t have a program that will let me generate TGA files (so I could have an alpha part to help with the transparency). SO, is there a (fairly) simple way to add an alpha component to a (the cloud) texture so that i can overlay it on top of the ground texture without totally obscuring it? (I know this is my third question today, if posting too many questions too quickly is against the mores here just let me know and i''ll stop). Thanks!

Share this post


Link to post
Share on other sites
First of all, I dont think this is a perfect place for multitexture.. the clouds should be a bit over the ground.. so i should create a second sphere, just a bit bigger than the first and have the clouds on that one instead..

Second, the blending between the texures in multitexture mode sets just like between the polygon color and the first texture, but set the glTexEnv when the second unit is active.. But in this case i dont know if there are a good envmode among the standard ones, maybe GL_BLEND and some tweaking, but you should look for the ENV_COMBINE extention, that allows you to do much better blending between the texture-units.

Share this post


Link to post
Share on other sites
you can add alpha chanel to texture very easy. Let's say you have 2 textures of same size :
1) RGB texture with your colors (24bit)
2) A with your alpha values (8bit)

create a new texture of size width*height*4 and fill it like this:
for (i=0;i< width*height) copy 3 bytes from 1) and 1 byte from 2). this will give you RGBA texture. Now just upload it to opengl and remember to set format to GL_RGBA.

edit : stupid html tags

You should never let your fears become the boundaries of your dreams.

[edited by - _DarkWIng_ on June 26, 2002 4:28:29 AM]

Share this post


Link to post
Share on other sites