• Advertisement
Sign in to follow this  

multitexture blending/masking

This topic is 3532 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

I am having a problem with blending when using multi texturing. the following works perfectly using GL_BLEND, and 2 render passes: /***********************************************************/ glEnable GL_BLEND glEnable GL_TEXTURE_2D // first pass glBlendFunc GL_ONE, GL_ZERO glBindTexture GL_TEXTURE_2D Texture0 Render // second pass glBlendFunc GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA glBindTexture GL_TEXTURE_2D Texture1 Render glDisable GL_TEXTURE_2D glDisable GL_BLEND /***********************************************************/ but I am unable to blend the 2 textures together correctly using multi texturing with a single render pass. I have been playing around with the texture combiners, but have not understood how it works nor if it is the correct solution. /***********************************************************/ // first pass glActiveTexture GL_TEXTURE0 glEnable GL_TEXTURE_2D glBindTexture GL_TEXTURE_2D Texture0 glTexEnvf GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_REPLACE // second pass glActiveTexture GL_TEXTURE1 glEnable GL_TEXTURE_2D glBindTexture GL_TEXTURE_2D Texture1 glTexEnvf ??? Render glActiveTexture GL_TEXTURE1 glDisable GL_TEXTURE_2D glActiveTexture GL_TEXTURE0 glDisable GL_TEXTURE_2D /***********************************************************/ Please let me know if you have an ideas?

Share this post


Link to post
Share on other sites
Advertisement
Have a look at the manpage.

There it says: Cv = (1 - At) Cf + At Ct (t = texture0 and f = texture1) with GL_RGBA textures and GL_TEXTURE_ENV_MODE = GL_BLEND.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement