PDA

View Full Version : Blending textures



07-22-2002, 12:43 PM
Is there an easy was to blend one texture into another on just one quad?
I could do it with 2 quads, by just adding transparency to one side and putting that quad on top of the full textured quad, but that just doens't seem to be the most effective way, considering I have to find a way to cut that Z-Fighting out.
I asked this question in another forum, and was pointed to an article about a terrain engine. There, the texture for the heightmap is pre-calculated. The program takes 4 textures and blends them according to the height of the specified point. That way, I end up with one big texture for the whole height map.
However, in games like Populous3, the texture changes dynamically, as the height of the map changes.
Is there a simple way to do it in OpenGL?

Mezz
07-22-2002, 01:19 PM
Hmm... you could multitexture with some funky modulation against a monochrome map to sort out how much each texture contributed to the final image. You could also actually make "transition" textures yourself and use these where you want the height to change the texture in use. There are also texture synthesis algorithms that can produce nice results, there was a paper on this but I've forgotton the link... Try a google search for "Texture synthesis".

-Mezz

07-23-2002, 03:02 AM
I'll look into this, though the texture synthesis may be a bit complex to implement for a simple terrain engine. I just did a quick google search, and didn't dig that deep into this technique, but AFAICT now, it looks as if it's still not researched through and through, and new ways to compute that are still searched.
However, it gave me some ideas, maybe I can make something up with your advice. Thanks!