Transparency Again
OK ... here''s the problem
I''m trying to make a solar system simulator, and i want to use specular highlights on the oceans of the Earth, but not on the land.
So ... I needs to draw a blue sphere with lighting (incl. specular), then overdraw another textured (and normally lit) sphere with the land showing, but the oceans invisible ... how the hell do i do it? (BTW i''m using a skybox for the background stars)
So far, i''ve created a 32 bit .tga with the oceans as black in the alpha, and the rest in white. but no matter what i try the textured sphere is always semi transparent ... i''m not even bothering with the blue sphere yet - the starry background is always partially visible! what am i doing wrong???
Regards!
What color is the ocean in your texture map? I''m assuming black. You should set your blending functions to GL_ONE, GL_ONE_MINUS_SRC_ALPHA. Draw your blue sphere first, then your landmass sphere.
I wish there was a way to turn mapping on/off for the different lighting computations (specular, emit, diffuse, etc.) but I''ve been able to find no such technique...
You could make a texture map of both land and water and put that on a diffuse sphere, then draw sphere with only the spec lighting values (diffuse, ambient, etc. set to 0) and a LUMINANCE (8-bit) texture map (white where there''s water). Use GL_ONE, GL_ONE in this case to add the spec values to the diffuse globe.
Dunno which is faster, but at least with version 2 you can get textured water -- darker for deeper, perhaps...
I wish there was a way to turn mapping on/off for the different lighting computations (specular, emit, diffuse, etc.) but I''ve been able to find no such technique...
You could make a texture map of both land and water and put that on a diffuse sphere, then draw sphere with only the spec lighting values (diffuse, ambient, etc. set to 0) and a LUMINANCE (8-bit) texture map (white where there''s water). Use GL_ONE, GL_ONE in this case to add the spec values to the diffuse globe.
Dunno which is faster, but at least with version 2 you can get textured water -- darker for deeper, perhaps...
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement