Skip to content
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

WebGLClipping: Project global clipping planes per camera #25272

Merged
merged 1 commit into from
Jan 12, 2023

Conversation

mrxz
Copy link
Contributor

@mrxz mrxz commented Jan 11, 2023

Fixed #25267

Description

The global clipping planes were projected during the clipping.init invocation using the (main) camera. This would result in incorrect clipping planes when using an ArrayCamera. This PR moves the projecting out of the init method and into a dedicated setGlobalState method (analogous to setState). This is then called in renderScene ensuring it's called exactly once per (sub) camera. Note that for shadow map rendering the global clipping planes aren't used, so it's no problem for them to not be computed at that point.

This contribution is funded by Fern Solutions

@Mugen87 Mugen87 added this to the r149 milestone Jan 11, 2023
@Mugen87 Mugen87 merged commit b33620b into mrdoob:dev Jan 12, 2023
0b5vr added a commit to 0b5vr/three-ts-types that referenced this pull request Jan 30, 2023
- Remove the third argument of `init` (`camera`)
- Add `setGlobalState(plane, camera): void`

See: mrdoob/three.js#25272
@0b5vr 0b5vr mentioned this pull request Jan 30, 2023
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clipping planes are projected using the wrong camera in case of XR and ArrayCamera
2 participants