Jump to content
  • Advertisement
Sign in to follow this  
gamebasic

multitexture blending/masking

This topic is 3770 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
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!