Mesh Z-fighting

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
JellyDude
Posts: 9
Joined: Tue Dec 11, 2007 6:35 am
Location: Australia

Mesh Z-fighting

Post by JellyDude »

Hi all,

I'm getting z-fighting between a terrain mesh and a water mesh, particularly at some distance. I was exploring the library by adding a pond/lake to a terrain. Does irrlicht support the OpenGL glPolygonOffset function? Any other ideas?

Regards,
omaremad
Competition winner
Posts: 1027
Joined: Fri Jul 15, 2005 11:30 pm
Location: Cairo,Egypt

Post by omaremad »

No irrlicht doesnt suppourt polygon offset,anyway if its major enough to spot from a large distance and its a terrain water interface that means the z buffer percision is very low at that range (polygon offset if too high can cause other problems, its mainly for decals and overlay polygons) The poly offset will not work if its a water hill interface since the offset would need to be greater than the hill height :shock:.

To increase percision at long ranges:
1-scale down meshes.
2-increase near value for cam.
3-decrease far value.
4-use custom z buffer function(eeasy but needs shaders on everything).
"Irrlicht is obese"

If you want modern rendering techniques learn how to make them or go to the engine next door =p
Post Reply