-
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 transform for IBL environment maps #12091
Conversation
Thank you for the pull request, @jjhembd! ✅ We can confirm we have a CLA on file for you. |
Thanks @jjhembd, looks good! Can we add a unit test? |
@ggetz OK, I added a spec checking the value of the IBL transform. |
Thanks @jjhembd. The spec seems to be timing out in CI? |
@ggetz Yes, and I can't explain why. The spec passes locally, and similar specs (loading the same environment map) run through on CI. |
@jjhembd My guess would be the KTX2 loading. I would make sure the URL is correct in both environments and that the environment supports the needed features with |
@ggetz it's the same URL as the other specs. But the other IBL specs had this check: if (!scene.highDynamicRangeSupported) {
return;
} This condition fails on the WebGL stub, so the spec is skipped. I added the same check to the new spec. |
Great, thanks @jjhembd! |
Description
This PR flips the X-axis of the transform applied to IBL environment maps.
Prior to this PR, a mirror ball shows the environment map image in its original orientation, rather than in the expected mirrored view.
The environment used in our test Sandcastles is the Kiara 6 Afternoon image from polyhaven.com. Notice how the sun is to the left of the shadowed peak in the distance. A rocky outcrop in the foreground angles from the sun towards the right of the image.
Before this PR, a mirror ball shows the same orientation in the reflection. Again, the sun is to the left of the shadowy peak, with the outcrop angling toward the right.
After this PR, the orientation of the environment is flipped from left to right, as expected for a mirror ball reflection.
This new orientation matches the glTF Sample Viewer.
Issue number and link
Addresses part of #12028.
Testing plan
Load this local Sandcastle and view the "Mirror Ball" model with "Environment Map Lighting".
Author checklist
CONTRIBUTORS.md
CHANGES.md
with a short summary of my change