Hi,
I have a Z fighting problem with a large scene in unity :
I create a scene dynamically with geographic informations (heightmap and textures) from a server (like a Google Earth application).
I use kilometers as unit in Unity.
My scene is about 30km x 30km, so it’s about 30 x 30 units in Unity.
Because of data georeferencing, it is centered on (300, 6000) point in Unity.
My camera is configured with near plane 0.01 (10 meters) and far plane 50 (50 km).
Everything is ok, but when I display the sea on top of the ground, I have a lot of Z fighting between sea and ground, specialy :
- near the coast, where there is about 50 cm or less between sea height and ground height (it’s about 0.0005 units delta between sea and ground)
- when the camera is near to the ground
How can I avoid this ?
- should I change the units (switch to meters or Mega-meters) ?
- move the center of the scene to (0, 0) point ?
- dynamically adapt near and far planes of the camera ?
- use a shader with offset -1, -1 to render the sea over the ground ?
Regards,
Aurélien