react-three-arjs
react-three-arjs copied to clipboard
For custom .gltf files logarithicDepthBuffer needed
Should be nice to put in the README.md that for some custom assets you need to enable logarithmicDepthBuffer in the ARCanvas gl properties or the model can show meshes overlaping each other
<ARCanvas className="AR" shadows camera={{ position: [0, 0, 2], near: 0.01, far: 1000 }} onCreated={({ gl }) => { gl.setSize(window.innerWidth, window.innerHeight); }} gl={{ alpha: true, antialias: true, precision: "highp", logarithmicDepthBuffer: true }} >
Like this
Would be nice to put in the references too the pmds documentation and gl properties
Can second this, took me way too long to figure out why my scene looked so bad with all the z fighting going on.
@rafelis1997 Thank you so much for sharing your piece of code!