-
-
Notifications
You must be signed in to change notification settings - Fork 36.1k
Core: Introduce Coordinate System #26140
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.
|
| export const _SRGBAFormat = 1035; // fallback for WebGL 1 | ||
|
|
||
| export const WebGLCoordinateSystem = 2000; | ||
| export const WebGPUCoordinateSystem = 2001; |
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.
I think these should be called GLCoordinateSystem and NDCCoordinateSystem?
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.
If we assume this, I think we would imply that WebGL does not have an NDC when it's just different. I was inclined to use the term NDC but after implementing CubeCamera I had other issues with the coordinate system. For these reasons I believe that using the name WebGPUCoordinateSystem for example would be easier to create any future path.
|
I think this is the most cleanest solution to this problem indeed! |
|
|
||
| camera.coordinateSystem = coordinateSystem; | ||
|
|
||
| camera.updateProjectionMatrix(); |
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.
@mrdoob I fixed ( #23372 (comment) ) issue here. If the camera has updated the projectionMatrix using the WebGL coordinate system, it will now update again with the WebGPU coordinate system.
|
Looks good to me! 👍👍 |
Fixed #23372
Description
I mixed @Mugen87 and @CodyJasonBennett work into this PR, and I prepared it for
WebGPURendererby removing the hack. I think the idea that @Mugen87 is the best one about Coordinate System, because modifying a little we have access to theRenderer.coordinateSystemandCamera.coordinateSystemcan facilitate some necessary paths, like in my recent case I had to change theCubeCamerato theWebGPUCoordinateSystem.