🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

New Golem3D terrain blending scheme

Published June 06, 2005
Advertisement
I finally got around to re-vamping the Golem3D tile blending scheme. Initially, it used the same sort of tile blending scheme that the Accidental Engine currently uses, ie separate alpha mask textures are combined with a terrain texture using multi-texturing in order to create the terrain blends. This results in the cruddy blocky textured look you can see in these screen shots:


Old Golem3D blending style (featured in the G3D editor, here)


The same blending scheme applied to the strictly 2D Accidental Engine

The new scheme eliminates this squarish blockiness. The tiled approach blending has been replaced with a vertex-by-vertex approach (as I should have done initially). In this new method, each vertex is assigned an alpha value for each of the terrain layers. This alpha value is stored in 8 separate arrays or VBOs, and is passed to the terrain-rendering shader as a vertex attribute. The shader replaces the alpha for the final color with this attribute. (This lets me upload vertex and normal data to a VBO once, then never touch it again, and I can change the alpha map just by switching buffer sources.) The end result is terrain transitions that are vastly more pleasing to the eye, smoother, and not restricted to large tilish blocks. I can also manipulate the alpha values to sharpen or blur terrain transitions as desired. All in all, it's a large improvement, and it only took a few very minor modifications to the code.

Here is an example of the final result. Note that this shot does not manipulate the alphas to smooth the blend between types; each vertex is assigned either a 1 or a 0 for a given layer's alpha. Much smoother transitions are possible. In this first shot, the terrain is flattened, in the second it is elevated to see how it would look in-game.




A very trivial change, but I think the result is well worth it. I have in mind as well a few ideas to further optimize it, even though it already runs pretty fast.
Previous Entry libnoise
Next Entry Terrain blending
0 likes 4 comments

Comments

jollyjeffers
Quote: A very trivial change, but I think the result is well worth it.

Definitely[attention] - Looks awesome.

That's some good work there. Care to add a journal entry about how exactly (within reason!) you designed the algorithm? We get a load of these sorts of questions in the DX forum, would be cool to have a "case study" to point at [smile]

Good entry

Cheers,
Jack
June 06, 2005 05:40 PM
JTippetts
Will do. Give me a little bit and I'll write something up. [grin]
June 06, 2005 06:35 PM
choffstein
Yeah, I would love to read about how you did this texturing!

Great entry.
June 06, 2005 07:12 PM
Rob Loach
Wow!
June 07, 2005 12:53 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement