Jump to content
  • Advertisement

Archived

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

jaba

Multitexture blend

This topic is 5701 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
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

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
Yes, the object has two textures, but both textures are full visible

Share this post


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

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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!