Open Ludmilafantaniella opened 4 weeks ago
Can we render the floor of the satellite map in a different layer so it does not ever collide with the LODs or scene geometry?
This z-fighting issue occurs due to a lack of precision in the values stored in the Depth buffer (which are used to determine whether pixels should be occluded or not). Values are not stored linearly so those produced by geometry that are closer to the near plane of the frustum are more precise. When the engine renders the geometry of objects that are too far from the camera and too close to each other (like the road and the satellite view plane, in this case), the depth values of both geometries are almost equal so comparison among them to know which should appear in front of the other fail. The solution @olavra proposes may be the cheapest and most appropiate.
Another option could be rendering the satellite view plane the first without writing to the Depth buffer (or writing the max value), which has the same effect (everything drawn later will appear above the plane without conflicts).
In both situations we will be using more GPU of course (not a big deal), as pixels rendered by the satellite view plane will not be discarded when other triangles occlude them, they are written always. If we are using early depth testing (I don't know) then that means that the fragment shader of the so far occluded pixels will execute now.
Here is a video that helps to understand the issue (it shows the depth buffer in a place where the z-fighting is happening due to both planes are too close and produce the same depth value): https://drive.google.com/file/d/1fpy-G74yAt-an8NIEa1ffJy1o-S-WLYm/view?usp=drive_link
In the end, after exploring the mentioned proposals and studying how the rendering systems work, we came to the decision of just offsetting the satellite view planes.
Explorer Alpha build versions:
Issue Description:
There is a clipping issue affecting roads and certain scenes when viewed from a distance. This issue causes visual artifacts where parts of the scene or roads do not render correctly.
STR:
Current behaviour:
https://drive.google.com/file/d/1GFwakV7U5-NuwTumJ3bYZIZ1w7Q8rGT0/view