-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Apply an epsilon offset to layers #44
Comments
Ah z-fighting, old friend. I've never been happy with the way this is resolved in Tangram using depth offsets, I'm inclined to think about different approaches for Unity. The projected-depth-offset trick we use in Tangram won't actually work here because we aren't touching the rendering pipeline for these (we don't want to force users to render with a particular shader). We could offset layers in world-space z by some epsilon. This would work for certain scenarios, but requires tuning for different uses. If epsilon is too small then the polygons will resolve to the same depth at large distances, if epsilon is too large then it will be visible up close or in depth-based shader passes. We can try more exotic solutions as well:
I'll keep thinking on this. A world-space z offset may be a good enough solution for now. |
I was thinking of this, but directly using something coming from a raster tile service, though styling might be more complex to generate (something paparrazzi could be helpful with), then use the raster as a texture on the quad geometry. |
Applying an epsilon offset based on numerical integer values assigned to a layer from the editor interface gives some promising results. The only blocker for now concerning this is #51 , since the epsilon value should be relative to the scaling used to generate the mesh, e.g. a mesh using a larger scale should have a larger epsilon offset in order to solve the z-fighting. |
To solve z-fighting issues, each layer that uses different materials and lay on the same plane or have the same extrusion height should be applied an epsilon offset:
The text was updated successfully, but these errors were encountered: