Fix specular_weight not removing base reflection under a coat - #29
Open
peterkutz wants to merge 1 commit into
Open
Fix specular_weight not removing base reflection under a coat#29peterkutz wants to merge 1 commit into
peterkutz wants to merge 1 commit into
Conversation
dictoon
approved these changes
Jul 24, 2026
MiiBond
approved these changes
Jul 27, 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.
Description
This PR contains a minimal surgical fix to ensure that the relative IOR goes to one as the
specular_weightgoes to zero.The fix modulates the base IOR relative to that surrounding medium (coat or exterior) and keeps it as an absolute IOR, so reflection, refraction, and thin film all stay consistent. Default (weight 1) behavior is unchanged, as is uncoated behavior when the exterior medium is air (the common case). If the renderer tracks nested dielectrics (
exterior_ior!= 1), weight zero now index-matches the base to the exterior/ambient IOR instead of to air, which is what the spec calls for.Related Issue
#28
Motivation and Context
The original code assumed that the
specular_weightwas supposed to be applied to the absolute IOR of the base surface, which is why the coat–base interface was reflective when thespecular_weightwas zero. However, the OpenPBR spec says weight zero should match the base to its surrounding medium: the coat, not air.How Has This Been Tested?
Calculating the results for a few scenarios and running the minimal C++ example.
Screenshots (if appropriate):
Types of changes
Checklist: