PDA

View Full Version : About GlColorxx();



FlemTeam
11-04-2002, 06:37 AM
Hello !

Using a GlColor3f(); to set the color of a vertex allow to multiply the texture color by the argument given in GlColor3f();

Is there any way to specify the operation ? ( substract / add ) ?

Thank you.

nexusone
11-04-2002, 07:45 AM
No, I don't think you can do it directly.

But you can apply a texture to it and then texture when applied can be combined with the base color in a various operations, like add/sub with the glBlendFunc.

also could use two vertex and the blend function would also allow you to mix the two.

glBlendFunc
glColorxx(Color1)
vertex1
glColerxx(Color2)
vertex2


There maybe also another way, but this is the first thing that came to mind.


Originally posted by FlemTeam:
Hello !

Using a GlColor3f(); to set the color of a vertex allow to multiply the texture color by the argument given in GlColor3f();

Is there any way to specify the operation ? ( substract / add ) ?

Thank you.



[This message has been edited by nexusone (edited 11-04-2002).]

roffe
11-04-2002, 11:15 PM
As previous post, check out glBlendFunc but also glBlendEquationEXT and glBlendColorEXT.

They might have the features you're looking for.

The last two requires some gl extensions though.

You might also look at
GL_ARB_texture_env_combine with CONSTANT_ARB
and modulation.

Extension registry: http://oss.sgi.com/projects/ogl-sample/registry/

Opengl API: http://wwws.sun.com/software/graphics/OpenGL/manpages/man3glindex.html

Mazy
11-05-2002, 03:45 AM
I think you are erfering to the texture environment.. there you have Modulate (default), Decal, Blend and dome other mode.. and then you have extensions that adds more operations, as ADD, ADD_SIGNED and so on..


Look at glTexEnv