-
Notifications
You must be signed in to change notification settings - Fork 10
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
Noisy Z-fighting in WebGL #26
Comments
The above screenshot was produced with an Nvidia card on Linux, but the problem did not occur when testing with Intel HD Graphics. The source of the noise appears to be interpolating between the depth values at different vertices. Although they should be the same in flat mode, this will add numerical error which can apparently exceed the depth offset. With 613e1dd, I have changed the way flat mode is implemented again to always set the depth in the fragment shader. This should be ensure that depth values are bit-for-bit identical across the plane, so a depth offset isn't even needed for the stencil. I was originally worried about the performance of this, but I think I was overthinking it. The fragment shader is trivial so the benefits of early Z testing should be minimal. In any case, the other approach does not seem to be reliably portable so it's the best option. I will release 0.5.1 soon. |
Released 0.5.1. |
Also back-ported to 0.4.3. |
pulls in fix for komadori/bevy_mod_outline#26
AFAICR, WebGL support was tested and working fine at the time 0.5.0 was released, but that same release exhibits noisy Z-fighting between the volume and stencil meshes now. I don't have a Cargo.lock file, so it could be related to minor version upgrades of dependencies. It could also be related to the version of my browser or 3D drivers having changed.
See also the previous issue #19 concerning Z-fighting with WebGL.
The text was updated successfully, but these errors were encountered: