Jump to content
  • Advertisement
Sign in to follow this  
zXynK

OpenGL Blending textures

This topic is 3969 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 trying to blend 2 textures together using: glBindTexture(GL_TEXTURE_2D, texture[TEX_ID].texID); I've seen this done in D3D but cant find an OpenGL example. Basically I'm trying to texture a polygon depending on its height value. EG: At min height, 1st texture will have a blend factor of 100% and the 2nd texture will have 0%. At mid height, 1st texture will have 50% and 2nd 50% at max height, 1st texture will have 0% and 2nd 100% Thanks for any help

Share this post


Link to post
Share on other sites
Advertisement
You can do this a couple of ways. You can use OpenGL's texture combining capability or you can use a pixel shader. I would recommend using a pixel shader since it is much easier to setup IMHO and you have more control. Either way, check out the tutorials on multi-texturing at www.codesampler.com (http://www.codesampler.com/oglsrc/oglsrc_4.htm#ogl_multitexture_blending and http://www.codesampler.com/oglsrc/oglsrc_9.htm#ogl_arb_shader_simple_vs2ps).

Cheers,

Bob

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!