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

WebGPURenderer: global clipping planes applied to color space and tone mapping pass. #28838

Closed
aardgoose opened this issue Jul 9, 2024 · 4 comments · Fixed by #28237
Closed
Labels
Milestone

Comments

@aardgoose
Copy link
Contributor

Description

Now tone mapping and color space conversion are applied as a separate pass, the global clipping planes are applied to the rendered Quad.

I don't see a simple solution to this, and the problem will also apply to other post processing passes etc.

Q: Is attaching global clipping plains to the renderer the correct API. Should they be properties of the Scene, or be replaced with something like clipping groups.

@sunag @mrdoob @Mugen87 @RenaudRohlinger

Reproduction steps

  1. View the webgpu_clipping example.
  2. Enable global clipping

The canvas is vertically clipped with no connection to scene rotation.

Code

see example

Live example

Screenshots

No response

Version

166

Device

No response

Browser

No response

OS

No response

@Mugen87
Copy link
Collaborator

Mugen87 commented Jul 9, 2024

The local per-material clipping does also not look correct when comparing with the WebGL example: https://threejs.org/examples/webgl_clipping

Is attaching global clipping plains to the renderer the correct API.

I would say no since the current API isn't suitable for multi-pass rendering. Moving the properties to the scene sounds like an obvious solution but having separate clipping groups could be a more clean approach. Do you already have in mind how a basic API would look like?

@Mugen87 Mugen87 added the Bug label Jul 9, 2024
@WestLangley
Copy link
Collaborator

The canvas is vertically clipped with no connection to scene rotation.

In other words, to be consistent with WebGLRenderer, all clipping planes are defined in world space and clip in world space.

@aardgoose
Copy link
Contributor Author

@WestLangley

The global clipping is applied twice, once correctly in the scene world space, and again on the built in post processing pass effectively in screen space.

@Mugen87

I implemented ClippingGroups in #28237 (before this problem existed, so it wasn't intended as a fix). Issues around handling intersection vs union clipping planes interact would need to be worked out, and even if clipping planes should be associated with materials.

@Mugen87
Copy link
Collaborator

Mugen87 commented Jul 9, 2024

Sorry I have overlooked #28237. After looking at the API and how it affects the example code I really like this kind of clipping concept. I guess more than material or renderer properties.

I would suggest to revisit #28237 and see it as a replacement for the former API that I would not support in WebGPURenderer. We have the chance now to adapt new, better concepts in the renderer and clipping groups sound interesting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants