Hi,
I made a playground with two ground planes, both having different materials and one has a zOffset. I see the material in red, but as soon as I move with the camera to top position, it turns blue. And when I zoom in to a radius of around 60, the red material is visible again. (I had to adjust the ArcRotateCamera lowerBetaLimit
, since the default value did not allow a perpendicular view.)
https://playground.babylonjs.com/#ZGIX5J
I saw that the new zOffsetUnits
property on a material can help, but since I am using an older version currently, I was wondering, if there is another option to deal with this issue? In my case I am experiencing z-fighting already with a beta value < 0.1
Using different minZ values helps, but mostly only at a specific distance. If one zooms out then the minZ value can be larger, zoomed in it can be smaller.
It is a bit tricky problem, since it mostly happens for perpendicular view and changing parameters only for this view can influence the experience of other viewing angles, too.