-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
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
Overlaying scenes with postprocessing in r167 is broken #29087
Comments
tl;dr; It seems clear operations after In the fiddle, I just call |
So if you call For the same reason, subsequent three.js/src/renderers/common/Renderer.js Lines 1004 to 1020 in e6edc5c
You can verify the root cause by forcing |
It will require some refactoring to make this setup work so can you use the following approach in the meanwhile? https://jsfiddle.net/raojn721/ The idea is to render your UI as a second scene pass and then mix both passes based on the alpha value. postProcessing = new THREE.PostProcessing(renderer);
const scenePass = pass(scene, camera);
const scenePassUI = pass(uiscene, uicamera);
postProcessing.outputNode = mix( scenePass, scenePassUI, scenePassUI.a ); |
This issue is indeed tricky. Basically the renderer assumes So the current combination of the OPs code is invalid. When |
I don't have any pressure and I don't want to be the cause of it for others. The point seems to be well known and will therefore be solved over time. Nevertheless, thank you for your effort @Mugen87 with the alternative way. |
I'm not marking this as a regression since the state in |
Then the fact that it worked until r166 was a happy coincidence? |
It was intended to support this use case but assumptions were made which were too simplified. Besides, we don't have a single example that uses the code setup from this issue. So I would say we have not thought about the use case when somebody wants to call |
Also notice that even your original codepen works if you exchange the output color space from |
It feels like I'm still pretty much alone in the community with my massive use of WebGPU and the node system. Thinking through all the options in advance is not possible or would take an unnecessary amount of time and energy. It works very well the way it is handled 👍 |
#29087 (comment) This approach is more powerful, you can mix your GUI with different blending modes and create different effects. |
I was curious because instead of the scenePass I use a shader
With |
I would suggest we close the issue for now and see how other develoeprs approach the API. We can reopen the issue if the solution outlined in #29087 (comment) is not acceptable for certain use cases. |
Description
I create two scenes and two cameras. The first camera is a perspective camera and the second is an orthographic camera for the second scene. The second scene is rendered with the orthographic camera and should be rendered over the first scene. In this way, UI elements can be easily used in an app. Until r166 it worked like in the codePen example.
footnote:
I try to create issues here as rarely as possible because I have an idea of how much work all the issues are. I often spend days trying to figure out what could be wrong when it doesn't work.
I'm excited about the three.js project. I have completely switched to webgpu and only work with the webgpu world in three.js. The elegance with which it all works makes me realize how much energy and passion there is from all the developers who work on it.
Reproduction steps
I think the code examples on jsfiddle from you Mugen and mine from codePen are small enough, so I refer to the links here
Code
Try to use
postProcessing.render();
instead ofrenderer.render(scene, camera);
in the codePen example.It shouldn't make any difference in the display on the screen. But then you only see the uiscene and no longer both scenes.
render function from the codePen example:
Live example
From @Mugen87
https://jsfiddle.net/21gfet07/1/
From me
https://codepen.io/Spiri0/pen/bGPrdzE
Screenshots
No response
Version
167
Device
No response
Browser
No response
OS
No response
The text was updated successfully, but these errors were encountered: