Add support for KHR_materials_retroreflection - #50
Open
mklefrancois wants to merge 1 commit into
Open
Conversation
Implements the Minimal Retroreflective Microfacet (MRM) model: substitutes the view direction with its reflection about the normal before evaluating the metallic and dielectric BRDFs, then linearly blends the result with the regular BRDF by retroreflectionFactor. Applied to both the IBL and punctual light paths.
2 tasks
Member
|
For UX3D: The PBR TSG is requesting that you fully check the PBR shader math and check how well it matches the draft spec provided in KhronosGroup/glTF#2610 (because the author is the same between both). Thanks! |
jim-ec
self-requested a review
August 24, 2026 17:09
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.
Summary
Implements
KHR_materials_retroreflection, based on the Minimal Retroreflective Microfacet (MRM) model (Portsmouth et al., JCGT 15(1), 2026).V_retro = reflect(-V, N)) before evaluating the metallic and dielectric BRDFs, then linearly blends the result with the regular BRDF byretroreflectionFactor.getIBLRadianceGGXRetroreflectioninibl.glsl) and the punctual-light path (pbr.frag).KHR_materials_retroreflectionmaterial extension parsing (retroreflectionFactor,retroreflectionTexture), theMATERIAL_RETROREFLECTIONshader define, and aRetroreflection Strengthdebug output channel.A companion PR to glTF-Sample-Viewer adds the corresponding "Retroreflection" UI toggle and bumps this submodule pointer, and references glTF-Sample-Viewer#664.
Test plan
npm run buildsucceeds with no shader compile errorsretroreflectionFactor: 1.0, masked byretroreflectionTexture) — the retroreflective stripe reads noticeably brighter than the plain reflective stripe when camera and light are closely aligned, matching the extension's reference behavior