Repository navigation
Shaders: Fix iridescence IBL multiscattering and transposed XYZ_TO_REC709. - #33984
Merged
Merged
Conversation
π¦ Bundle sizeFull ESM build, minified and gzipped.
π³ Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
β¦iscattering. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
mrdoob
force-pushed
the
webgl-iridescence-fix
branch
from
July 7, 2026 23:51
59c4ea9 to
0cd0f34
Compare
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
πΌοΈ E2E screenshot testsβ All examples render correctly again (run). |
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Aug 2, 2026
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
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: #32309 #26489
Description
Two iridescence fixes that make the WebGL and WebGPU backends match:
The WebGL renderer passed the view-angle iridescence Fresnel into
computeMultiscatteringIridescence(), which expects a normal-incidence F0. The DFG LUT already models the angular falloff, so Fresnel was double-counted, over-brightening grazing environment reflections on iridescent materials. Now converts viaSchlick_to_F0()like the WebGPU renderer. (Regression from Fix iridescence energy conservation for mixed materialsΒ #32309.)The WebGPU renderer's
XYZ_TO_REC709matrix inevalIridescencewas transposed, shifting all iridescence hues (visible when comparingwebgpu_loader_gltf_iridescenceagainst the WebGL version): GLSLmat3()takes its values column-major, while TSL's all-numericmat3()builds a row-majorMatrix3, so GLSL literals must be transposed when ported.Includes cleanup on both sides: the split Fresnels are now locals instead of struct members, and the unused
iridescenceF0is removed.Verified byte-identical against a reference implementation across view angles and both metalness paths; with both fixes the two backends render iridescence pixel-identically. Direct lighting unaffected.