-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
WebGLRenderer: Create WebGL context with alpha: true. #23230
Conversation
a9a82a7
to
23c34ae
Compare
On the bright side... many of the examples that used to run at 40-50fps on my laptop, now run at 60fps 🥲 |
The PR has the following line: state.buffers.color.setClear( color.r, color.g, color.b, useAlpha ? alpha : 1.0, premultipliedAlpha ); I'm afraid this could introduce side effects when doing post processing. When How about using something like this: Mugen87@db825d2 The idea is to change the default of So if users want to blend the canvas with the HTML background, they need this line: renderer.setClearAlpha( 0 ); Granted, the approach requires a migration task compared to this PR since users have to add the above line.
Yeah, it seems no solution can support all blending scenarios demonstrated in the BTW: Both blending examples fail in the PR. Not sure why the E2E test did not catch the failure in |
Some fiddles for testing subtractive blending: (1) I think I understand what happens in (2) and (3) but can somebody explain why test case 1 and 4 look identical? |
Hmm... We could also set I think that should solve post processing and, migration wise, people would just have to set |
Sounds good! Working with |
Seems like it also breaks code that used |
Hmm... It also breaks |
When Does this sound okay for you? What are your plans for The engine has to provide a way to define the clear alpha value. If this should not happen via |
@Mugen87 Yeah, I think I'm going to give Mugen87@db825d2 a try. Seems easier indeed 🤞 |
One more try... 😅 |
One "solution" would be to remove Does WebGPU have these things too? |
Yes^^. three.js/examples/jsm/renderers/webgpu/WebGPURenderPipeline.js Lines 60 to 70 in fed9e42
The blending is part of the render pipeline and thus of the respective descriptor (see https://gpuweb.github.io/gpuweb/#blend-state for details). |
I'm not sure it's necessary to remove any blending setups. I'm sure we can update |
In the long term, I would recommend to remove the Maybe we can introduce at some point a solution over |
Alright. I'll merge this for now then. I don't think I'll be able to investigate |
Alpha should be disabled (shown in imgui-js sources). Might be an issue - mrdoob/three.js#23230 - mrdoob/three.js#22418
Related issue: #22418