View Full Version : color interpolation

07-13-2010, 12:11 AM
I need to do something with the old fixed pipeline. I was wondering what happens if I set RGBA values at the vertices of a triangle and then apply a texture to the triangle. Are the interpolated RGBA values added to filtered texel values?

07-13-2010, 03:19 AM
It is a rather simple question, on which you can answer if you try to implement what you have asked. Here is just a hint from "higher authority":

A texture can be applied to a surface in different ways. It can be painted on directly (like a decal placed on a surface), used to modulate the color the surface would have been painted otherwise, or used to blend a texture color with the surface color. You choose texturing functions by supplying the appropriate arguments to glTexEnv*().

In short, try to use GL_MODULATE mode.

07-13-2010, 11:26 PM
OOh, were at 7th edition already, thanks for mentioning. My problem is actually a bit more complex than it seems. The texture has no alpha channel, but the triangles have it at the vertices. So I'll have to use the triangle alpha, not the texture alpha to blend somehow.