Archived

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

Alpha splatting on terrain

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

Question: I am having a problem when I blend the terrain layers. Since they are coplanar, I disable the depth test. This causes problems when a single geometry array folds and the transparent texture is overlayed on top of two distinct triangles. It is being written to the "far" triangle, but is actually being overlayed on top of the "near" triangle because the depth buffer test is disabled. Any thoughts on how to draw the blends in multiple passes (not in stacked texture units) but solve this peoblem? I certainly dont want to sort my terrain triangles since I am using an adaptive quadtree with texture paging, but I use the vertex buffers until I recalc the terrain vertices for sufficient view movement. Thanks!

Share this post


Link to post
Share on other sites
You could probably use glPolygonOffset or the dx equivalent for that. It alters the z-value by a slight amount when drawing so that geometry that would otherwise be identical doesn''t z-fight. Draw the base pass first, then the other two with a small offset...

Share this post


Link to post
Share on other sites
if both passes use the saem geometry but differ in textures bound + blending enabled in one + not the other.
u shouldnt need to disable depthtest, use glDepthFunc( GL_LEQUAL ).
if something is majorly different in both passes eg clipping is enable in one pass u will need to use as zppz suggests polygon offset

http://uk.geocities.com/sloppyturds/gotterdammerung.html

Share this post


Link to post
Share on other sites