engine icon indicating copy to clipboard operation
engine copied to clipboard

Depth texture is not working correctly on some Macs

Open yaustar opened this issue 2 years ago • 2 comments

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

yaustar avatar May 23 '22 10:05 yaustar

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.

mvaligursky avatar Jun 14 '22 13:06 mvaligursky

For now, the priority for has been lowered, as it seems some fixes are coming for Chrome at least.

mvaligursky avatar Jun 21 '22 08:06 mvaligursky

Is this still an issue?

yaustar avatar Nov 05 '22 12:11 yaustar

Is this still an issue?

Yes still an issue in Chrome Version 107.0.5304.110 (Official Build) (x86_64) on my iMac.

Kulodo avatar Nov 10 '22 11:11 Kulodo