-
-
Notifications
You must be signed in to change notification settings - Fork 36k
Fixes #31739: Add consistent culling for mirrored transforms #31740
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
Open
kwafok
wants to merge
8
commits into
mrdoob:dev
Choose a base branch
from
kwafok:bugfix-mirrored-camera-inside-out-webgpu
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Fixes #31739: Add consistent culling for mirrored transforms #31740
kwafok
wants to merge
8
commits into
mrdoob:dev
from
kwafok:bugfix-mirrored-camera-inside-out-webgpu
+707
−20
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…or improved clarity and consistency. Introduced a computeFrontFaceCW function to encapsulate determinant checks for object, view, and projection matrices.
- Introduced `mirrored_camera_culling.html` for WebGL rendering. - Added `mirrored_camera_culling_webgpu.html` for WebGPU rendering. - Created `MirroredCullingApp.js` to handle mirrored camera logic and GUI controls for both rendering contexts.
- Remove unused helpers: syncCameras, resetMirrored, flipProjectionAxis, flipViewAxis - Use local `group` in setupScene instead of temporary `testGroup` - Simplify updateDebug by removing unused string accumulator - No functional changes; lints pass
…tils - Introduced computeFrontFaceCW function to determine front-face orientation based on object, view, and projection matrix determinants. - Updated setPipelineAndBindings and draw functions to accept frontFaceCW parameter for pipeline selection. - Modified _getPrimitiveState and _buildRenderPipelineDescriptor to support front-face orientation configuration. - Added getRenderPipelineVariant method to retrieve or create a pipeline based on front-face orientation.
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
e9109c3
to
b77201a
Compare
- Introduced camera parameters for type, FOV, and orthographic size in the UI. - Added functions to create and resize cameras based on user selection. - Updated camera controls to reflect changes in camera type and properties. - Improved responsiveness to window resizing by consolidating camera update logic. - No functional changes; maintains existing behavior while enhancing configurability.
…dling - Added TSL imports (color, select, frontFacing, float) to enable advanced material configurations. - Refactored setupScene to inline primitive creation and incorporate open geometry functionality. - Implemented openUpGeometry function to modify geometry - Enhanced material application logic to differentiate between WebGPU and WebGL rendering contexts.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related issue: #31739
Description
This PR fixes an inconsistency where mirroring a camera's projection or view matrix caused incorrect face culling, while mirroring an object's scale worked as expected.
The solution extends the culling logic in both
WebGLRenderer
andWebGPURenderer
to account for the entire transformation chain (Model, View, and Projection). It now correctly determines the final winding order by checking for an odd number of reflections across all relevant matrices, ensuring rendering is predictable and correct in all mirroring scenarios.To demonstrate the fix, two new examples (
mirrored_camera_culling.html
andmirrored_camera_culling_webgpu.html
) has been added for both WebGL and WebGPU, which allows for interactive testing of the corrected behavior.