Multitexture blend

Started by
7 comments, last by jaba 20 years, 11 months ago
Hello, I''m applying multitexture to an object, this is my code: glActiveTextureARB(GL_TEXTURE0_ARB); glBindTexture(GL_TEXTURE_2D,Texture[0]); glActiveTextureARB(GL_TEXTURE1_ARB); glBindTexture(GL_TEXTURE_2D,Texture[1]); DrawObject(); I don''t know how to regulate the blend of the textures, I want to make the second texture be less visible.
============================== Videoman Library Project
Advertisement
For example, This image made with 3DS Max
http://www.geocities.com/opengladiator/pic.jpg
left:Two textures, main texture is a photo of bricks and the second is a photo of a lake, reflection with spherical mapping. Both textures are full visible.
right: the reflection texture is less visible, this is what I want

============================== Videoman Library Project
I think there is something called GL_RGB_SCALE_ARB... Look it up.

Sorry have to go now, help you more when I get back..
GL_RGB_SCALE_ARB is only when using GL_ARB_texture_env_combine. To set the blending level of a texture unit in standard multitexturing, use:


glActiveTextureARB(..)

...

setup stage..

...


float colour[4]={...};
glTexEnvfv(GL_TEXTURE_ENV,GL_TEXTURE_ENV_COLOR,colour);

| - Project-X - my mega project.. close... - | - adDeath - | - email me - |
I have tried this but the result is the same
============================== Videoman Library Project
Have you enabled GL_TEXTURE_2D on each texture unit?
If not, you''ll have to do that, like this:

glActiveTextureArb(GL_TEXTURE0_ARB);
glEnable(GL_TEXTURE_2D);
glBindTexture(Texture[0]);

glActiveTextureArb(GL_TEXTURE1_ARB);
glEnable(GL_TEXTURE_2D);
glBindTexture(Texture[1]);
Yes, the object has two textures, but both textures are full visible
============================== Videoman Library Project
Sorry ''bout that, I didn''t read your question properly.
I don''t know the answer exactly but I think you should look into glTexEnv*() functions.
You should try the following env modes: GL_MODULATE or GL_ADD
you know glTexEnvf(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,...);

or .tga image with alpha channel, and GL_COMBINE_EXT

(sorry for my english)

This topic is closed to new replies.

Advertisement