Jump to content
  • Advertisement


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


Combining textures in a fly

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

Hi yall, Without any crap talking, here''s my noodle scratcher: I want to blend two (or more) textures together in a fly. I need this for my isometric engine so that I can ''smooth'' terrain edges when the terrain tile type changes, e.g. snow -> grass. grass -> layer[0] + snow -> layer[1] Should be vertice based. I figured this could be done easily... shouldn''t be much different from coloring vertices, right? Here is how I draw a tile: ----snip---- glBindTexture(GL_TEXTURE_2D, tiletexture[Id]); glBegin(GL_TRIANGLE_STRIP); /* I would add something here? */ glTexCoord2f(0.0f, 0.0f); /* ...or here? */ SetVertexColor(...); // very basic light effect /* What about here? */ glVertex2f(float(x), float(y)); ... ---snip--- So, any suggestions? Thanks. saeZ

Share this post

Link to post
Share on other sites
unless u want to use some less supported extensions u will need to encode the blending alpha in one of the textures + then u can use
A/ (2 passes)
draw texA, enable blend (src_alpha, one-src_alpha) draw texB
B/ (1 pass but impossible to do lighting on both textures)
use the combine extension(in opengl1.3) + use the interpolate part


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.

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!