fix: clamp PBR roughness at 0.089 - #69
Conversation
- Add Daily, bake, and release self-contract coverage for the PBR and Hybrid 0.089 roughness floor. - Verify old-floor behavior produces the intended RED signals while existing brightness controls remain GREEN.
- Route PBR and Hybrid direct, GI, reflection, and Meta paths through one perceptual roughness floor. - Verify focused Unity contracts, a disposable one-bake integration test, Pester, and consumer compilation.
- Document the shared PBR and Hybrid 0.089 perceptual roughness contract and existing-material behavior. - Verify Daily, baseline, bake, Pester, and transient D3D11/Linear direct and reflection stability.
There was a problem hiding this comment.
Pull request overview
Adjusts the PBR-family perceptual roughness minimum to 0.089 and ensures that direct BRDF construction, Unity Standard GI/reflection smoothness, and Meta/lightmapping all share a single runtime clamp path, with expanded release/daily/regeneration contract coverage and updated documentation.
Changes:
- Raise PBR/Hybrid public
_Roughnessmetadata floor to0.089(byte-identical between both shaders). - Route PBR roughness usage through a shared runtime clamp helper used by BRDF creation and Unity Standard GI setup.
- Add/extend release-runner, consumer, GPU (direct/reflection), Meta, and real lightmap bake tests; update English/Japanese docs and shader contract docs.
Reviewed changes
Copilot reviewed 18 out of 22 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| Tests/Release/Run-PureBaseReleaseValidation.Tests.ps1 | Adds required source-fragment assertions. |
| Tests/Release/Run-PureBaseReleaseValidation.ps1 | Updates product contract required fragments. |
| Tests/Release/ConsumerProject/Assets/Editor/PureBaseConsumerReleaseTests.cs | Verifies imported roughness metadata. |
| Tests/Regeneration/Editor/PureBaseRoughnessLightmapBakeTests.cs | Adds disposable real-bake roughness-floor test. |
| Tests/Regeneration/Editor/PureBaseRoughnessLightmapBakeTests.cs.meta | Unity meta for new bake test. |
| Tests/Daily/Editor/PureBaseValidationSceneRegressionTests.cs | Makes validation regression tests class partial. |
| Tests/Daily/Editor/PureBaseValidationSceneRegressionTests.PbrRoughness.cs | Adds Meta roughness-floor capture contracts. |
| Tests/Daily/Editor/PureBaseValidationSceneRegressionTests.PbrRoughness.cs.meta | Unity meta for new partial test file. |
| Tests/Daily/Editor/PureBaseToonLightingContractTests.PbrRoughnessRuntime.cs | Adds runtime capture helpers for roughness tests. |
| Tests/Daily/Editor/PureBaseToonLightingContractTests.PbrRoughnessRuntime.cs.meta | Unity meta for new runtime partial file. |
| Tests/Daily/Editor/PureBaseToonLightingContractTests.PbrRoughness.cs | Adds GPU direct/reflection roughness-floor contracts. |
| Tests/Daily/Editor/PureBaseToonLightingContractTests.PbrRoughness.cs.meta | Unity meta for new GPU contract file. |
| Tests/Daily/Editor/PureBaseRenderingModeRenderingTests.SourceContracts.cs | Adds source-level ownership checks for clamp usage. |
| Tests/Daily/Editor/PureBaseRenderingModeRenderingTests.OpenLitSourceContracts.cs | Wires roughness-floor ownership assertion into suite. |
| Tests/Daily/Editor/PureBaseRenderingModeContractTests.ProductContracts.cs | Adds ABI checks for roughness property and mirroring. |
| Shaders/PureBasePBR_properties.hlsl | Raises _Roughness SCRange floor to 0.089. |
| Shaders/PureBaseHybrid_properties.hlsl | Keeps property declaration byte-identical to PBR. |
| Shaders/Models/pbr.hlsl | Uses shared clamp for Standard GI smoothness. |
| Shaders/Common/pbr_brdf.hlsl | Introduces shared clamp helper/constant for BRDF. |
| Docs/technical-information.md | Documents new floor rationale and behavior. |
| Docs/technical-information.ja.md | Japanese doc parity for new floor rationale. |
| Docs/pure-base-shader-contract.md | Updates public contract and compatibility notes. |
Files not reviewed (4)
- Tests/Daily/Editor/PureBaseToonLightingContractTests.PbrRoughness.cs.meta: Generated file
- Tests/Daily/Editor/PureBaseToonLightingContractTests.PbrRoughnessRuntime.cs.meta: Generated file
- Tests/Daily/Editor/PureBaseValidationSceneRegressionTests.PbrRoughness.cs.meta: Generated file
- Tests/Regeneration/Editor/PureBaseRoughnessLightmapBakeTests.cs.meta: Generated file
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Up to standards ✅🟢 Issues
|
| Category | Results |
|---|---|
| CodeStyle | 4 minor |
🟢 Metrics 70 complexity · 0 duplication
Metric Results Complexity 70 Duplication 0
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
- Assert the named PBR perceptual-roughness runtime constant and its exact 0.0890 value. - Verify the focused ownership contract passes without weakening adjacent source checks.
Summary
0.089and keep their property metadata byte-identical.Validation
96 passed / 0 failed / 0 skipped, including the canonical baseline comparison.1 passed / 0 failed.3 passed / 0 failed.0 errors.2022.3.22f1Built-in/D3D11/Linear direct and reflection-probe observation: stored0and0.089were stable and visually equivalent;0.25remained distinct.Notes