I got a problem with flickering in my Babylon.js application. I made an example in https://playground.babylonjs.com/indexStable.html#B7Q62A#1. It contains of four meshes created from “.positions” and “.indices”.
The “Red T” (one of the meshes) and the “Black T-like” mesh will flicker when moving the camera, Both of them intersect the third “Plate” mesh, but the coordinates of the red and black meshes are clearly, but very few, on top of the top edge of the Plate-mesh. The fourth mesh amplifies the problem, Without it, the problem will not occur (sometimes) or will occur at greater distances (sometimes) or does not have any effect at all (sometimes).
These mesh’s data came from a foreign tool: original the model was an fbx file which was converted to json-data using the autodesk fbx sdk. So I do not have any influence to the coordinates in “.positions”
If I move the camera close to the model, everything looks fine - no flicker. When moving away, at some point flickering starts. I think, it’s a kind of z-order fighting due to numerical inaccuracy. But i do not have any idea, how i can fix the issue.
I’m sorry, if this question was answered before, but I did not find anything that solved my problem.
- use logarithmic depth buffer
- played around with camera.min?/max?
So I kindly want to ask you for some help…
Thank you in advance.