Is there anyway to use a webgl2 shader with Logarithmic Depth Buffer support?
By now I have been using a workaround setting the near and far camera settings depending on the camera position, but it is not enough. My scene is very complex and many times I face the superposition issue.
Could anybody show me an example using Logarithmic Depth Buffer in a webgl2 context?
There is no issue with using logarithmic depth buffer and WebGL2.
This probably isn’t related to the depth buffer, you can only get depth fighting issues there, depending on what you mean with superposition. WebGL highest precision is 32 bit, on mobile it can be even just 16, if you use high values or too large distances from the origin there will be precision issues like jumping vertices, or flickering textures with huge uv coordinates, regardless using the logarithmic depth buffer. Same goes for using too small decimal numbers.