modulated with different colors (defined by glColor3f) according to different distances from the viewer.
From what I see, it is impossible to do so because the texture is already modulated with the material colors used for lighting.
I can do either modulation with current RGB with no lighting OR render the model with lighting but without modulating with current RGB, but not both.
Is my assumption correct?
whatever lighting-related settings you made with fixed functionality aren’t taken into account in the fragment shader.
if you have a fragment shader, you can/have to redefine every lighting equation you want to perform.
In your case, it’ll be something such as:
gl_fragColor = texture2d(textureId, texCoord1) * texture2d(illuminationTexture, texCoord2) * color;
If you set your color with glColor3f, it will be available in your vertex shader (and only in your vertex shader i think), so you’ll have to pass it to your frag shader through a varying vec3
Originally posted by wizzo:
[b]
In your case, it’ll be something such as:
gl_fragColor = texture2d(textureId, texCoord1) * texture2d(illuminationTexture, texCoord2) * color;
If you set your color with glColor3f, it will be available in your vertex shader (and only in your vertex shader i think), so you’ll have to pass it to your frag shader through a varying vec3
hope i didn’t misunderstood your question,
wizzo[/b]
In the vertex shader, you can assign color with