I’m writing a basic planet viewer OpenGL application, just for fun. I have the basics working, with the glorious planet, implemented through a gluSphere(), rotating with the classic earth texture map applied.
Now, what if I want to apply a second texture map through OpenGL (say, the “earth clouds”)?
The earth texture is a color image and the cloud texture is a grey-level image. I want the final result to be like cloud floating above the earth.
I tried use different texture environment, but the earth texture is always hidden by the cloud. Which environment parameter should I choose?
Here’s a useful page on some ways of combining textures… http://www.opengl.org/wiki/Texture_Combiners
An example in GLSL is underneath the FF pipeline commands, which might tempt you to look into shaders…
Alternatively send two spheres, the second slightly larger than the first, and have the clouds on the second one.
In the end this is how I do my clouds as I then have some parallax between the clouds and the ground, and can blend cloud shadows onto the ‘earthtex’ sphere…
Also, if you happen to have a copy of the orange book, chapter 10 has some great examples of using multitexturing for rendering the earth: night lights on the dark side of the globe, gloss maps for the ocean, etc. Their examples use shaders but are still straightforward.
I tried this approach but did not succeed. I am very new to OPenGL. If I set the second sphere translucent, it seems to me the first sphere is not shown, while the back sides of the second sphere shows when the sphere rotates.
Should I use the some culling method to get ride of the back side when the ball is rotating? Is there any there easy implementation that solves the problem? Or can you give more details on your approach of using two spheres? Thank you.