-
-
Notifications
You must be signed in to change notification settings - Fork 267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SDF generation demo causes pink flashing in multiple screen regions on MacBookPro M1 (Chrome) #720
Comments
I have difficulty taking screenshots, as the screenshot apps seem to be unable to see the pink flashes. This is the best I can do, showing broken browser bar in gray: Another one, showing it affects another browser tab with some WebGL on it, the WebGL canvas is also flashing, but shows black in the screenshot: Some more observations:
|
Thanks - I can reproduce it on my machine, as well. It seems to only happen when the 3d texture is above a certain size? Or a moderately complex model (it wasn't happening with another triangular test model)? And it happens with array textures, as well. I've removed the newly-added raycasting logic from the shader to determine containment for now since that addresses the problem. But it's hard to see this as anything other than a browser issue related to 3d textures (See #497, too). If you'd like to submit a bug report to chrome that would be appreciated. cc @zalo I'm thinking the WebGPU compute shader approach would be better if we want to generate SDF textures quickly. |
Yeah; it probably is… I can’t wait until browsers actually have WebGPU enabled! 🫠 |
It's already enabled in Chromium-based browsers, including mobile, and it can be enabled via flags in Firefox and Safari. As far as I can tell the WebGPU API is stable so I'd say it's a fine time to build something with it: Three.js development on a WebGPURenderer with a WebGL fallback is already well underway and a number of projects out there are already using it. I've been wanting to get something going with compute shaders in this project I just have too many other things I need to work on 😅 Happy to collaborate on a contribution if it's something you're interested in starting. The WebGPU buffer can be read back to the CPU and used in WebGL. An alternative workaround might be to render the 3d z-layers to a grid on a 2D texture but this will limit the dimensions of the SDF and make sampling more complicated. I just checked and this doesn't cause any of the corruption issues. |
Chrome issue submitted as https://issues.chromium.org/issues/370153438 . |
But then I realized that the page now is fixed by working around it, anyway I can provide a link that still reproduces the issue? |
I've added a condition that includes the lines that break the shader when https://gkjohnson.github.io/three-mesh-bvh/example/bundle/sdfGeneration.html#USE_SHADER_RAYCAST You can use that link to repro the issue. Thanks for submitting! |
FWIW WebGPU specification is not a living draft yet and will be subject to breaking changes until then.
A workaround to the DirectX issue is rendering each slice to a 2D texture and doing a GPU -> GPU copy to a 3D layer. Perhaps, that would solve both issues? |
Thanks - I didn't know this. I figured since it was no longer behind a flag it was considered stable. All the same any work done now I think will still be worthwhile start even if things change a bit.
Interesting - didn't know this. Do you have an example of how this is done? Do you mean basically doing a render with a pass-through shader of the 2d texture to the 3d texture layer? Or a different block-copying method similar to WebGLRenderer's copyTextureToTexture (but with something like binding the 3d layer to a 2d texture using framebufferTextureLayer before copy)? |
mrdoob/three.js#29710 will allow for copying data to and from layers of a 3d texture which will enable us to work around this 3d target rendering issue in the next release - assuming this kind of copying doesn't cause problems, as well. |
Describe the bug
SDF generation demo causes pink flashing in multiple screen regions on MacBookPro M1, even after I close the browser tab, quit Chrome, the issues persists.
It doesn't happen to my iPhone 12 Pro (Chrome).
To Reproduce
Expected behavior
Normal render, and if the render fails, it doesn't cause issues outside the browser tab.
Screenshots
[will provide if I manage to take one]
Platform:
** Additional comments: **
It's amazing work, including the path tracer, thanks for creating them! This is issue is likely triggering some bug in Chrome or even metal, but I have no clue about why this would happen. I've read the source and the demo seems to be using special extensions which could be less stable. I've searched for this issue, but it doesn't seem to happen to other Mac users, "pink screen" leads to issues causing full screen pink and kernel panic, unrelated to this issue.
I've also looked it up in the issues if this repo, #497 and #717 seem to be related, and the solution seems to require identifying under what condition this would happen and use an alternative (possibly downgraded) rendering technique to keep it normal.
The text was updated successfully, but these errors were encountered: