-
-
Notifications
You must be signed in to change notification settings - Fork 36k
Closed
Description
There are certain cases where post-processing is necessary with stereoscopic rendering, e.g.:
- cardboard distortion effect when it's not supported natively by the browser in Web VR
- SSAO
Here's what currently happens in these cases, for each eye:
- Set the render target to the buffer that will be post-processed
- Set the scissor and viewport to half the screen (either left or right)
- When
WebGLShadowMap.render
gets called, sets its own render target and viewport, but it stores the previously set viewport - When
WebGLShadowMap.render
is done, it sets the viewport back to half screen. - When
WebGLRenderer.render
continues, it sets the render target again, butsetRenderTarget
sets the viewport to the full size of the render target. WebGLRenderer
renders the scene at full size, across both eyes, breaking the output.
Somewhere at or after step 5, we need to be able to set the viewport back to the half screen values set in step 2.
While we're at it, as a bonus, it'd be nice to have a way to only render the shadow map one time. Repeating for the second eye is redundant.
(cc @borismus)
Metadata
Metadata
Assignees
Labels
No labels