Archived

This topic is now archived and is closed to further replies.

jaba

Multitexture blend

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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 - |

Share this post


Link to post
Share on other sites
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]);

Share this post


Link to post
Share on other sites
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)

Share this post


Link to post
Share on other sites