How to enable renderer.logarithmicDepthBuffer?

Having zfighting in webxr viewer and hoping that this will fix it, but not sure where to set it.

Or is there a better way to battle zdepth issues?

Original Post on Discord

by user 943936853348855838

Currently youre only choice is to replace the renderer on the context I believe (you can just set the renderer on this.context.renderer)

It would be good to have a way to make that configureable before creating the initial renderer and we have discussed that internally before but not added a feature like that yet

Let me know if you find a workaround / if replacing the renderer works for you and the case of zfighting or if you need something else

Are there any defaults you are setting that I need to include?

by user 943936853348855838

Just have a look at the source where the renderer is created by going to the implementation of this.context - maybe just copy that chunk for now to see if changing the depth buffer helps

yep found the engine_setup.ts, copied the setup section from there.

by user 943936853348855838

Yeah no luck. I put this on my SceneRoot gameobject. Still getting a lot of zfighting on my model, but only effects iOS/WebXR Viewer

by user 943936853348855838

But this doesnt set the renderer of the scene

You need to set it to this.context.renderer = this.renderer too


by user 943936853348855838

Right now you create a renderer but its not used

well that turned everything black, can only see START AR button. Also, if you press START AR it is black with no passthrough. Not seeing any errors on desktop inspector.

by user 943936853348855838

I sent you the URLs in a DM.

by user 943936853348855838