I want to blend several textures together using
the alpha channel of the textures.
I have to render an water surface with an oil slick on it.
I want the water (1. texture) to be partial transparent. (like real water is…)
Second texture is that of an oil slick, which
has an alpha value of 0.0f where no oil is and 1.0f when there’s oil.
(This means the oil texture should replace the
water texture at this locations)
After that I want to apply one or more textures
which show where currents are. They have an alpha
value of 0.0f where no current is and an alpha
value of 0.5f where a current is.
(This means that the color of the water should
change for example to red where the current is.)
How do I have to set my multitexturing and/or
blending and/or alpha test up ?
glBlendFunc (GL_ONE_MINUS_DST_ALPHA, GL_DST_ALPHA); glAlphaFunc (GL_GREATER, 0.0f );
would be sufficient, but it doesn’t work.