-
-
Notifications
You must be signed in to change notification settings - Fork 36.2k
WebGLRenderer: Add outputBufferType and setEffects() #32461
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
Conversation
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
8fdcd27 to
9b43f9b
Compare
|
One downside of this approach is that we can no longer render specific materials (like Edit: |
|
To clarify, this PR would align I suspect this change will produce quite some rejection in the community since there are still serious concerns about the performance of I suggest you make this optional for /cc @donmccurdy |
|
This is only a test PR to see how the renders are supposed to look like. |
|
BTW: An optional setup with |
Ah I understand. I'm all in for aligning the renderers. But given the deep character of this change, we should make clear to retain the inline approach in Here is a latest issue about that topic: #32273 |
02c224e to
cb037ab
Compare
|
Refactored the PR:
@gkjohnson Changing |
|
@sunag I think |
|
Having both
|
|
I think we could remove term buffer to define screen output associated with the hardware? I was thinking about the table below.
It also occurred to me to use |
|
Thanks! Now that you frame it that way it makes more sense to me. I think either of those suggestions could work, yes. |
I managed to get bloom working inside VR 😱
I don't have a headset to try it with at the moment... Can anyone try it on Quest, GalaxyXR, Vision Pro, etc? |
|
Ops, looks like |
|
Passthrough doesn't work either. |
Quest 2 VR.test.mp4 |
|
Thank you mrdoob! Forgot to tell you that we had postprocessing with stereo depth in WebXR here: https://xrblocks.github.io/docs/samples/DepthMap/ Glad that you fixed threejs Effect!! |
I think I need to clarify, this definition was OK with me assuming that Neither of these describes the screen/hardware capabilities, we can't do that within a browser environment, we only configure the canvas and declare its content characteristics (e.g. color space). |
Oh, I currently con't have a headset and this is what I'm getting with Meta's emulator:
|
eefb94e to
7ddae1a
Compare
7ddae1a to
fa3f336
Compare
fa3f336 to
8b91e82
Compare
8b91e82 to
b430c9f
Compare
outputType's original behavior was to manage I'm not yet comfortable with the outputType/outputBufferType division of responsibilities, but we're still discussing it at #32508. I'm inclined to say |
Yes, and this distinction is also made at the WebGPU level. three.js/src/renderers/webgpu/WebGPUBackend.js Lines 267 to 269 in f41b94a
https://developer.mozilla.org/en-US/docs/Web/API/GPUCanvasContext/configure#mode In my mind, the term target screen output range seems clearer than the imaginary HDR range because of the canvas configuration definition, although I perfectly understand what you meant and agree, because we don't have a capabilities API and that wouldn't be the intention. If we were to strictly follow the definition of WebGPU as seen in the code above for WebGPURenderer, it would be something like: renderer.toneMappingMode = THREE.EXTENDED;I think this doesn't quite fit with what we use, since we could use three.js in HDR screen output without defining any Defining I think So we will have 3 distinct properties for this proposals in #32508:
If const renderer = new THREE.WebGPURenderer( {
outputType: THREE.HalfFloatType
} );And now allowing configurations such as: const renderer = new THREE.WebGPURenderer( {
outputType: THREE.UnsignedByteType,
outputBufferType: THREE.HalfFloatType
} );or const renderer = new THREE.WebGPURenderer( {
outputType: THREE.HalfFloatType,
outputBufferType: THREE.HalfFloatType,
workingBufferType: THREE.UnsignedByteType
} ); |
Agreed that it's probably not a great fit. The other issue is that the "extended" tone mapping basically means "clip to the display limit" which is not much use when we don't know that limit and can't tonemap or color grade to it. So there's work to do on the WebGPU side there, and TBD what that will look like, but possibly gpuweb/gpuweb#5294. It seems we are a bit stuck on the outputType/outputBufferType question, though, I don't agree that an option defined in terms of "half float" can safely be interpreted to enable HDR output. One more related comment in #32508 (comment). |


Related issue: #15840 #18322 #18846 #32433 #32449
Description
Adds internal HDR rendering and simplified post-processing API.
Changes
outputBufferTypeoption for HalfFloatType renderingsetEffects()method for post-processing without EffectComposerisRenderPassflag for TAARenderPass/SSAARenderPass supportThe watch glass HDR is fixed but the text becomes less sharp. I still don't understand why...
For testing:
https://raw.githack.com/mrdoob/three.js/733f7abc2378874b0c386010b675b7a43f5c6aa5/examples/index.html