-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Fix the transformation of plane's normal #9135
Conversation
Thanks for the pull request @baothientran!
Reviewers, don't forget to make sure that:
|
@@ -1155,7 +1155,7 @@ describe( | |||
tileset.clippingPlanes = new ClippingPlaneCollection({ | |||
planes: [ | |||
new ClippingPlane(Cartesian3.UNIT_Z, -10.0), | |||
new ClippingPlane(Cartesian3.UNIT_X, 0.0), | |||
new ClippingPlane(Cartesian3.UNIT_X, 1.0), |
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.
This test have the clipping plane close to the center. It can generate a different color. I move it off a little bit. This is the sandcastle example for the test
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.
Hm, not sure I understand what to look out for here
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.
The test fails on my machine if the distance is 0.0. I tried on Sandcastle and it seems to work the same.
… ibl matrix to not have scale
@baothientran I made a few changes. Some are based on your changes, and some are completely new.
Let me know if these changes seem good to you. |
@IanLilleyT The change looks good to me. This will make it less confusing about why using clipping plane matrix for IBL as before |
@IanLilleyT and I did a final pass on the code and added more documentation and some code cleanup. We tested this using @IanLilleyT's sandcastle above and all the other clipping plane sandcastles. During testing we noticed a bug with |
Merged. Thanks @baothientran ! |
Fixes #9109
This PR will convert the transformation matrix to a normal matrix before multiplying with the plane as vec4. Most of the fix happens in glsl czm_transformPlane() function and Cesium.Plane.transform().
I also see gltf_clippingPlanesMatrix is used for IBL as it assumes the matrix stores the reference frame components. This may no longer be true, so I change it to a different uniform
@IanLilleyT Can you please take a look at it? Please let me know if I should fix anything.