fix(pbr): use GTSO, remove ao^2 mult with direct lighting#1973
fix(pbr): use GTSO, remove ao^2 mult with direct lighting#1973soda3000 wants to merge 2 commits into
Conversation
📝 WalkthroughWalkthroughThis change introduces a new specular occlusion function Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Automated formatting by clang-format, prettier, and other hooks. See https://pre-commit.ci for details.
|
No actionable suggestions for changed features. |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
package/Shaders/Common/Shading.hlsli (2)
13-18: PR title and issue linkage can be tightened to match repo conventions.Consider shortening/lowercasing the title and adding a tracker reference in the PR description.
Suggested title:fix(pbr): use gtso, drop ao2 direct-light mult
If applicable, add:Fixes #<issue>/Closes #<issue>.As per coding guidelines, use
type(scope): descriptionwith lowercase style and include GitHub issue keywords when the PR fixes a bug/feature.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@package/Shaders/Common/Shading.hlsli` around lines 13 - 18, Update the PR title and description to follow repo convention: change the title to the suggested lowercase typed form (e.g., "fix(pbr): use gtso, drop ao2 direct-light mult") and add an issue tracker reference in the body using GitHub keywords like "Fixes #<issue>" or "Closes #<issue>" if this change to SpecularOcclusionGTSO (function SpecularOcclusionGTSO in Shading.hlsli) resolves a tracked bug; ensure the PR description includes the scope "pbr", the concise description, and the issue reference.
13-18: Add shader test coverage forSpecularOcclusionGTSO.Current provided test context (
package/Shaders/Tests/TestShading.hlsl:74-109) validates only the legacy alpha-basedSpecularOcclusion(...)behavior. Please add direct assertions for the new GTSO path to prevent regressions.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@package/Shaders/Common/Shading.hlsli` around lines 13 - 18, The tests only cover the legacy SpecularOcclusion path and are missing direct assertions for the new GTSO implementation; add explicit unit-style test cases in TestShading.hlsl that call SpecularOcclusionGTSO with representative NdotV and ao inputs (including edge cases like 0, 1, mid-range and combinations that exercise the saturate and quadratic behavior) and assert expected outputs (or delta within epsilon) to prevent regressions; locate the test additions alongside the existing SpecularOcclusion checks in TestShading.hlsl and use the same test harness/assert macros so failures surface consistently.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@package/Shaders/Common/Shading.hlsli`:
- Around line 13-18: Update the PR title and description to follow repo
convention: change the title to the suggested lowercase typed form (e.g.,
"fix(pbr): use gtso, drop ao2 direct-light mult") and add an issue tracker
reference in the body using GitHub keywords like "Fixes #<issue>" or "Closes
#<issue>" if this change to SpecularOcclusionGTSO (function
SpecularOcclusionGTSO in Shading.hlsli) resolves a tracked bug; ensure the PR
description includes the scope "pbr", the concise description, and the issue
reference.
- Around line 13-18: The tests only cover the legacy SpecularOcclusion path and
are missing direct assertions for the new GTSO implementation; add explicit
unit-style test cases in TestShading.hlsl that call SpecularOcclusionGTSO with
representative NdotV and ao inputs (including edge cases like 0, 1, mid-range
and combinations that exercise the saturate and quadratic behavior) and assert
expected outputs (or delta within epsilon) to prevent regressions; locate the
test additions alongside the existing SpecularOcclusion checks in
TestShading.hlsl and use the same test harness/assert macros so failures surface
consistently.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: dfa9e1ab-9e52-4ebe-b9df-427373ab748c
📒 Files selected for processing (3)
package/Shaders/Common/PBR.hlslipackage/Shaders/Common/Shading.hlslipackage/Shaders/DeferredCompositeCS.hlsl
|
✅ A pre-release build is available for this PR: |
Summary by CodeRabbit