PDA

View Full Version : Multitexture Formulas



11-08-2003, 09:37 PM
Hi, I'm trying to blend two textures together using multitexturing. The GL_ADD and GL_MODULATE formulas aren't what I want.

GL_ADD is Cv = Cf + Cs
GL_MODULATE is Cv = Cf*Cs...

Is there a way to get
Cv = Cf + Cs*Z, where Z is some constant? Perhaps by using the GL_ARB_texture_env_combine extension?

Thanks,
DE

cwc36
11-09-2003, 05:37 PM
Hi,

Try on this site to download the multitexturing demo. http://myopendemo.hypermart.net/opengl3.htm

Thanks.

11-10-2003, 12:21 AM
thanks, but that sample on that site is just a barebones multitexture sample, which i can already do. also, in that code, he never sets his texture environments (glTextEnv)... so it's only using the defaults (GL_MODULATE). it goes into nothing about how the textures are mixed.

i think i've found what i wanted by searching these forums though :D. an old ATI MulText program that uses the texture_combine extension....

i know you can change the primary colors using glColor3ub b4 your vertices, but how do you change the "Texture Constant Color" in code?

Thanks,
DE

yakuza
11-10-2003, 09:36 AM
I've found the spec to be a good place to start for info like this.
http://oss.sgi.com/projects/ogl-sample/registry/index.html

To answer your latest question, check out the GL_TEXTURE_ENV_COLOR parameter to glTexEnv*.
http://www.3dlabs.com/support/developer/GLmanpages/gltexenv.htm

Hope that helps.

11-10-2003, 10:58 AM
cool, thanks alot yakuza, that helped http://www.opengl.org/discussion_boards/ubb/smile.gif. somehow that constant passed me by when reading the standard. and in in the ATI MulTex program, when it spits out the code, doesn't add that line of code for you.