Use Qualitative Oren-Nayar to match Standard Surface spec - #61
Merged
ppenenko merged 2 commits intoAug 25, 2026
Conversation
Update Metashade SS to set energy_compensation=false on the diffuse BSDF, aligning with the stock Standard Surface nodegraph. Remove masonry from the test exclusion list now that the FLIP threshold failure is resolved.
There was a problem hiding this comment.
Pull request overview
Aligns Metashade Standard Surface diffuse rendering with Qualitative Oren–Nayar.
Changes:
- Disables Oren–Nayar energy compensation.
- Re-enables the masonry render test.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
contrib/tests/test_render_metashade.py |
Removes masonry from exclusions. |
mx_metashade_standard_surface_bsdf_genglsl_impl.glsl |
Uses uncompensated Oren–Nayar diffuse. |
Suppressed comments (1)
contrib/tests/metashade_ref/libraries/standard_surface/mx_metashade_standard_surface_bsdf_genglsl_impl.glsl:54
- This implementation change is embedded into every generated Standard Surface fragment shader, but all 63 committed baselines under
contrib/tests/metashade_ref/renders/standard_surfacestill call this function withtrue. In CI,test_render.py:608-609compares generated shaders byte-for-byte and_RefDifferfails on missing or differing baselines, so CI cannot regenerate these automatically and the affected tests will fail. Commit the regenerated shader baselines, including the newly enabled masonry shaders, with this change.
mx_oren_nayar_diffuse_bsdf(closureData, base, coat_affected_diffuse_color, diffuse_roughness, normal, false, diffuse_bsdf);
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| diffuse_bsdf.response = vec3(0.0, 0.0, 0.0); | ||
| diffuse_bsdf.throughput = vec3(1.0, 1.0, 1.0); | ||
| mx_oren_nayar_diffuse_bsdf(closureData, base, coat_affected_diffuse_color, diffuse_roughness, normal, true, diffuse_bsdf); | ||
| mx_oren_nayar_diffuse_bsdf(closureData, base, coat_affected_diffuse_color, diffuse_roughness, normal, false, diffuse_bsdf); |
Update all rendered shader baselines to reflect the Qualitative Oren-Nayar change (energy_compensation=false). Bump metashade submodule to metashade/metashade#229 (merged on main). Signed-off-by: Pavlo Penenko <pavlo.penenko@autodesk.com>
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
energy_compensation=false(Qualitative Oren-Nayar) matching the stock Standard Surface nodegraphNote: Rendered shader baselines under
metashade_ref/renders/are not included in this PR to keep the diff reviewable. They will be regenerated by CI or a follow-up commit.Context
The Metashade Standard Surface was using
energy_compensation=true(EON model) on the Oren-Nayar diffuse BSDF. While more physically correct, this deviates from the stock Standard Surface spec which intentionally uses the uncompensated Qualitative Oren-Nayar model (energy_compensation=false). OpenPBR adopts EON, but Standard Surface does not — itsdiffuse_roughnessdocstring explicitly states "higher values cause the surface to appear flatter and darker."The difference only manifests with non-zero
diffuse_roughness. Masonry (diffuse_roughness=0.5) was the only affected Adsk material, producing FLIP 0.073 > 0.05 threshold.Test plan