Combining textures in a fly

Started by
1 comment, last by saeZ 22 years, 3 months ago
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
Advertisement
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

http://uk.geocities.com/sloppyturds/gotterdammerung.html
Take a look at this short doc:
http://www.cbloom.com/3d/techdocs/splatting.txt

-Lev

This topic is closed to new replies.

Advertisement