engine
engine copied to clipboard
Depth texture is not working correctly on some Macs
Forum issue: https://forum.playcanvas.com/t/engine-post-effect-example-doesnt-draw-depth-texture-for-mac-chrome-and-firefox/25815
From a similar thread: https://forum.playcanvas.com/t/depth-buffer-in-macos/19897/26 three.js doesn't seem to have this problem on the same Mac
Investigations / conclusions:
- threejs is re-rendering the scene to get the depth, which is what we use in WebGl1 mode, which works for us as well.
- on webgl2 we blit the depth out to a texture, but this seems to be failing on some of those Macs.
- we have a different solution in the viewer where we attach the depth buffer as a texture a copy out the content using fragment shader - even this does not work on those Macs.
- it seems the situation is improved / fixed when forcing Metal backend in Chrome (which should be enabled by default in the future, its in the testing stage).
- this works correctly in Safari on those Machines, but Chrome (OpenGl) and Firefox both have the problem.
- We considered exposing some private API to allows user to switch this to WebGl1 path (re-render the scene), but few other things would need to change. Even converting depth to linear space depends on GL2 flag, we'd need to introduce some new define for this, users would need to update their code to pass it in in some cases .. it's more complex than worth it for now.
For now, the priority for has been lowered, as it seems some fixes are coming for Chrome at least.
Is this still an issue?
Is this still an issue?
Yes still an issue in Chrome Version 107.0.5304.110 (Official Build) (x86_64) on my iMac.