-
-
Notifications
You must be signed in to change notification settings - Fork 35.3k
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
WebGLMultisampleRenderTarget: Enable toScreen rendering. #21573
Conversation
@arpu @aardgoose @vanruesc Would be great if you have a look at this PR, too. 😇 |
if ( params.autoRotate ) group.rotation.y += clock.getDelta() * 0.1; | ||
|
||
renderer.setRenderTarget( renderTarget ); | ||
renderer.render( scene, camera ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This API usage is actually a bit unusual since applying a render target via setRenderTarget()
will still render to screen (and not into the render target).
I though about applying the render target as new a context parameter when creating the renderer. However, this means an enhancement of WebGLRenderer
will be required since it has to manage an additional render target.
That's a cool feature! The implementation looks solid; I've poked at it here https://codesandbox.io/s/competent-poitras-782vg?runonclick=1&file=/src/App.js This might seem obvious, but I think it's worth mentioning that the
If the settings or dimensions don't match, or if
As for the API, I think |
We are aware that people want to have multisample but it requires many changes in the graphics stack to be reliable. |
anything more needed to get out of the Draft state? |
We know what needs to be done. I just need to find the time to get it implemented. |
tested this with threejs r128 and works just fine |
some problems on Oculus Browser @cabanier any known Problem for this? ( i use this.renderTarget.samples = Math.min(8, context.getParameter(context.MAX_SAMPLES));, on Android Oculus Browser -> this.renderTarget.samples is 4) |
@mrdoob realistic to get this in this release cycle? |
@Mugen87 Is there any way this logic could sit in the post-processing code instead? |
If the eyes are not in sync, something else must be going on. Do you have an example? |
@mrdoob my understanding is this is the only way to allow Hardware MSAA > 4 without post-processing using context.MAX_SAMPLES @cabanier would be good to have a uptodate example, last working example is https://codesandbox.io/s/competent-poitras-782vg?runonclick=1&file=/src/App.js i hope @Mugen87 can solve the merge conflicts |
I'll file a new PR based on latest |
Related issue: see #16895
Description
With this PR, it is possible that
WebGLMultisampleRenderTarget
resolves the multisampling to the default framebuffer (screen) instead of a custom framebuffer. It's just required to set the newtoScreen
flag totrue
.This makes the usage of
WebGLMultisampleRenderTarget
more flexibel since you safe an additional render pass if you want to output the result on screen. I've created a new examplewebgl2_msaa
that demonstrates this approach.webgl2_multisampled_renderbuffers
has been renamed towebgl2_postprocessing_msaa
and a simple sepia effect was added.