Can you project onto a texture and then apply the texture to the geometry?
Either in a modeling package or algorithmically by rendering to a texture
and then project that texture onto the terrain by planar uv mapping?

 

 Jason

 

 

 

 

From: [email protected]
[mailto:[email protected]] On Behalf Of James
Adkison ARA/CFD
Sent: Wednesday, October 21, 2009 10:25 AM
To: [email protected]
Subject: [osg-users] z-fighting issue with coplanar polygons

 

I'm using an Heightfield to represent my terrain and parts of the terrain
could have a surface feature (e.g. a lake).  The lake is being drawn as a
polygon directly on the surface of the terrain.  This, of course, is causing
z-fighting to occur between the terrain and the surface feature.  I have
been trying to solve this problem and have run across a couple solutions but
they aren't working for me.

 

I have tried using polygon offset with the GL_OFFSET_POLYGON_FILL mode,
which works when zoomed out far but up close z-fighting still occurs.

 

I have tried using a stencil buffer approach but I can't get it to work
properly.  I can get the surface feature to stencil out the area of terrain
but if you rotate the scene so that the surface feature is behind a mountain
the stencil is still in place and the feature is rendered through the
mountain.  Hopefully, I am doing something wrong and someone can explain how
I can make this work.

 

James

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to