Advertisement Jump to content
Sign in to follow this  
gamebasic

multitexture blending/masking

This topic is 3861 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.

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!