problem with shader

HAHA! me likey! great! done!
but… just one more thing :stuck_out_tongue: … I have another texture, representing the clouds, a black and white one. In FFP I would use GL_LUMINANCE, how can I achieve the same effect in glsl?
sorry for so many questions, but this is really not my area, and I’m just trying to learn :smiley:

thx again

Originally posted by pedrosl:
I have another texture, representing the clouds, a black and white one. In FFP I would use GL_LUMINANCE, how can I achieve the same effect in glsl?
In the same way. The glsl does not care about the internal format of the texture. The sampling from the GL_LUMINANCE texture will return the same values as in the FFP.

ok, so I would do something like:

mix(texture2D(nightTexture, gl_TexCoord[0].st).rgba, texture2D(mainTexture, gl_TexCoord[0].st).rgba * texture2D(cloudsTexture, gl_TexCoord[0].st).rgba * color, NdotL);

however, this results in the oposite: the white part (the clouds) is totally blended and the black part appears over the main texture:

thx

The clouds should be added with the day texture, not multiplied.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.