When I give a model a green material and apply a texture to it, only the green pixels are shown.
Model with white material
Model with green material
- Are textures always blended with materials this way?
- Can textures completely overwrite materials?
TIA
- The default being GL_MODULATE, yes, unless you ask differently with a different texenv mode :
glTexEnv (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL); /* or GL_REPLACE */
Read this for details : http://www.opengl.org/sdk/docs/man/xhtml/glTexEnv.xml
- yes, with GL_REPLACE. With GL_DECAL however any transparent part of the texture will let through the original material.
BTW, why using green material if you want white ?
Thanks for the info, enlightening, I can’t wait to try it out.
I used a green material as a place-holder for development before adding a texture.
I used a white material for debugging.
Since I’m using a texture, I’d rather not use any material, but if the texture were to over-write it, it wouldn’t matter which material I was using.
Just playing around with it, seems to work but now the lighting has no effect.
For lighting I think you have to use GL_Modulate.
That’s why using shaders is sooooo much better!