feat(ibl): revamp ibl and dalc sh#1947
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughReplaces directional-ambient math with SH-based ambient (SharedData::GetAmbient), adds Spherical Harmonics utilities and DALC→SH conversion, splits IBL into Env/Sky sources with new IBL APIs and DALCMode-driven composition, renames/expands IBL settings and texture bindings, and updates many shaders/C++ paths to use the new model. Changes
Sequence Diagram(s)sequenceDiagram
participant CPU as State (CPU)
participant CB as SharedData CB
participant GPU as Shader
participant SRVs as Env/Sky IBL SRVs
CPU->>CB: DALC colors -> DALCToSH -> write AmbientSHR/G/B
Note right of CB: SharedData::GetAmbient(normal) available
GPU->>CB: call GetAmbient(normal)
GPU->>SRVs: sample EnvIBL / SkyIBL (GetEnvIBL/GetSkyIBL)
SRVs-->>GPU: envSample, skySample
GPU->>GPU: compute IBL ratio (GetIBLRatio) / DALCMode branch
GPU->>GPU: build envSpecular + skySpecular -> finalIrradiance
GPU->>CB: apply finalIrradiance with other shading terms
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 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 |
|
No actionable suggestions for changed features. |
There was a problem hiding this comment.
Actionable comments posted: 7
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/Features/IBL.cpp (1)
12-23:⚠️ Potential issue | 🟡 MinorClamp newly deserialized IBL settings before they reach runtime/shader state.
These new fields are user-editable via JSON, but
LoadSettings()still trusts raw values. Invalid ranges forDALCMode, scales, saturation, or fog mix should be clamped after deserialization.🔧 Proposed hardening
+#include <algorithm> ... void IBL::LoadSettings(json& o_json) { settings = o_json; + settings.DALCAmount = std::clamp(settings.DALCAmount, 0.0f, 1.0f); + settings.EnvIBLScale = std::clamp(settings.EnvIBLScale, 0.0f, 10.0f); + settings.SkyIBLScale = std::clamp(settings.SkyIBLScale, 0.0f, 10.0f); + settings.EnvIBLSaturation = std::clamp(settings.EnvIBLSaturation, 0.0f, 2.0f); + settings.SkyIBLSaturation = std::clamp(settings.SkyIBLSaturation, 0.0f, 2.0f); + settings.FogAmount = std::clamp(settings.FogAmount, 0.0f, 1.0f); + settings.DALCMode = std::min<uint>(settings.DALCMode, 2u); }As per coding guidelines "Include proper resource management and graceful degradation for DirectX 11 resources and user input validation to prevent crashes from malformed configurations".
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/Features/IBL.cpp` around lines 12 - 23, After deserializing IBL::Settings via NLOHMANN_DEFINE_TYPE... ensure LoadSettings() (or the function that applies deserialized IBL::Settings) clamps all user-editable fields before they are stored to runtime/shader state: enforce valid enums for DALCMode, clamp EnvIBLScale and SkyIBLScale to sensible positive ranges, clamp EnvIBLSaturation and SkyIBLSaturation to [0,1] (or project conventions), clamp FogAmount and DALCAmount to [0,1], and ensure PreserveFogLuminance and EnableDiffuseIBL/UseStaticIBL are interpreted as booleans; update the code path that moves IBL::Settings into runtime (the loader/applier function called LoadSettings or similar) to validate and coerce these values so malformed JSON cannot reach shader/resource setup.
🧹 Nitpick comments (3)
features/IBL/Shaders/IBL/IBL.hlsli (1)
23-107: Consider consolidating SH texture fetches to reduce per-pixel overhead.
GetEnvIBL,GetSkyIBL, andGetIBLRatioeach fetch the same SH texels repeatedly. A small helper that loads SH once and reuses it in the composition path would cut redundant texture reads.As per coding guidelines "Consider GPU workload and performance impact when implementing graphics features, with special attention to shader compilation and runtime performance".
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@features/IBL/Shaders/IBL/IBL.hlsli` around lines 23 - 107, Multiple functions (GetEnvIBL, GetSkyIBL, GetIBLRatio) repeatedly call DiffuseIBLTexture.Load / DiffuseSkyIBLTexture.Load for the same SH texels; create a small helper (e.g., LoadDiffuseSH or LoadSHTriplet) that takes a Texture2DArray (or implicit texture) and returns/outputs the three sh2 components (shR, shG, shB) so callers reuse those values instead of re-loading; update GetEnvIBL, GetSkyIBL, and GetIBLRatio to call this helper once per texture (DiffuseIBLTexture and DiffuseSkyIBLTexture) and then pass the loaded sh2 values into SphericalHarmonics::SHHallucinateZH3Irradiance and subsequent math to eliminate redundant texture reads while preserving existing logic and names.package/Shaders/Water.hlsl (1)
1270-1270: Consider linking this feature PR to a tracking issue.If there is a related GitHub issue, add
Implements #...orAddresses #...in the PR description for traceability.As per coding guidelines: "Issue References ... Suggest adding appropriate GitHub keywords."
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@package/Shaders/Water.hlsl` at line 1270, The PR should include a GitHub issue reference for traceability: update the PR description to add a keyworded reference like "Implements `#1234`" or "Addresses `#1234`" pointing to the related issue for the new diffuse IBL feature (the change enabling SharedData::iblSettings.EnableDiffuseIBL in Water.hlsl) so reviewers and tracking tools can link the code change to the issue.src/Utils/SphericalHarmonics.h (1)
1-54: Optional PR metadata polishCurrent title is valid, but a clearer alternative could be:
feat(ibl): split env/sky ibl with dalc sh blending.
If this maps to a tracked issue, consider addingAddresses #<id>in the PR description.As per coding guidelines "
**/*: When reviewing PRs, please provide suggestions for Conventional Commit Titles ... and Issue References ...".🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/Utils/SphericalHarmonics.h` around lines 1 - 54, Update the PR title and description to follow Conventional Commits and include issue references: change the PR title to a clearer form such as "feat(ibl): split env/sky ibl with dalc sh blending" and, if this work maps to a tracked issue, add "Addresses #<id>" in the PR description; mention the relevant feature (e.g., DALCToSH in SphericalHarmonics) in the description for context.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@features/Dynamic` Cubemaps/Shaders/DynamicCubemaps/DynamicCubemaps.hlsli:
- Around line 114-122: The env-side DALC scaling is being multiplied by
skylightingSpecular before the final lerp, causing double attenuation of the
fallback; update the specular fallback calculation in the blocks that compute
specularIrradiance and specularIrradianceReflections to remove the additional
multiplication by skylightingSpecular (i.e., compute dalcScaled via
Color::IrradianceToGamma(...) *without* multiplying by skylightingSpecular) so
that the final blend lerp(specularIrradiance, specularIrradianceReflections,
skylightingSpecular) alone controls the mix; adjust both occurrences that
reference skylightingSpecular in those calculations.
In `@package/Shaders/Common/SharedData.hlsli`:
- Around line 27-30: The three boolean fields InInterior, InMapMenu, and HideSky
in the SharedData cbuffer are declared as HLSL bools but must be 32-bit uints to
match the CPU-side SharedDataCB (src/State.h) and preserve 4-byte sizing and
16-byte constant-buffer alignment; change the types of InInterior, InMapMenu,
and HideSky from bool to uint in SharedData.hlsli so their layout and sizes
match the CPU struct.
In `@package/Shaders/DeferredCompositeCS.hlsl`:
- Around line 236-245: The fallback path double-scales the environment term:
dalcScaled multiplies directionalAmbientColorSpecular by skylightingSpecular and
then finalIrradiance is lerped by skylightingSpecular again, effectively zeroing
the env fallback when skylightingSpecular is low. Fix by computing dalcScaled
from directionalAmbientColorSpecular without multiplying by skylightingSpecular
(i.e., remove the extra * skylightingSpecular when computing dalcScaled) so
EnvTexture.SampleLevel/ specularIrradiance normalization remains correct and the
final lerp(specularIrradiance, specularIrradianceReflections,
skylightingSpecular) preserves the intended blend between fallback and
reflections.
In `@src/Utils/SphericalHarmonics.cpp`:
- Around line 161-170: HanningConvolution computes invW = 1.0f / w without
validating w, which can produce Inf/NaN and corrupt SH coefficients; update the
function (SphericalHarmonics::HanningConvolution) to validate the convolution
width w before using it: if w <= 0 (or nearly zero) either return the original
SH2 unchanged or clamp w to a small positive epsilon, then compute invW and
factorBand1 and apply them; ensure any early-return or clamping avoids division
by zero and prevents propagating NaNs into result.c0 and result.c1.
- Around line 234-240: In SHHallucinateZH3Irradiance, guard the division by
sh.c0 before computing ratio: check fabs(sh.c0) against a small epsilon (e.g.
1e-6) and if it's below that threshold set ratio to 0 (or otherwise handle the
degenerate case) instead of performing ratio /= sh.c0; continue computing
zonalL2Coeff with the safe ratio so zonalL2Coeff = sh.c0 * (0.08f * ratio + 0.6f
* ratio * ratio) remains stable for near-zero sh.c0.
- Around line 208-211: The normalize(const T& v) function can divide by zero for
zero-length vectors and other code computes sqrt(1 - roughness) without
validating roughness; fix both by guarding against invalid inputs: in normalize,
compute length = sqrtf(v.Dot(v)), if length is <= FLT_EPSILON (or a small
epsilon) return a safe default (e.g., zero vector or v) instead of dividing,
otherwise multiply by 1.0f/length; for the roughness usage clamp the roughness
value into [0.0f, 1.0f] before computing sqrt(1.0f - roughness) (or use
max(0.0f, 1.0f - roughness)) to avoid negative arguments, and prefer using an
epsilon guard when taking sqrt to prevent NaNs; apply the same guards to all
related functions in this file that compute vector normalization or sqrt(1 -
roughness) (lines around the normalize function and the block referenced as
215-223).
- Around line 141-149: In SphericalHarmonics::Product the assignment to
result.c1[2] mistakenly duplicates shL.c1[2]*shR.c1[2]; replace that duplicated
term so c1 components follow the pairwise pattern: set result.c1[2] = factor *
(shL.c1[0] * shR.c1[0] + shL.c1[1] * shR.c1[1]) to correct the math and restore
consistent SH multiplication.
---
Outside diff comments:
In `@src/Features/IBL.cpp`:
- Around line 12-23: After deserializing IBL::Settings via
NLOHMANN_DEFINE_TYPE... ensure LoadSettings() (or the function that applies
deserialized IBL::Settings) clamps all user-editable fields before they are
stored to runtime/shader state: enforce valid enums for DALCMode, clamp
EnvIBLScale and SkyIBLScale to sensible positive ranges, clamp EnvIBLSaturation
and SkyIBLSaturation to [0,1] (or project conventions), clamp FogAmount and
DALCAmount to [0,1], and ensure PreserveFogLuminance and
EnableDiffuseIBL/UseStaticIBL are interpreted as booleans; update the code path
that moves IBL::Settings into runtime (the loader/applier function called
LoadSettings or similar) to validate and coerce these values so malformed JSON
cannot reach shader/resource setup.
---
Nitpick comments:
In `@features/IBL/Shaders/IBL/IBL.hlsli`:
- Around line 23-107: Multiple functions (GetEnvIBL, GetSkyIBL, GetIBLRatio)
repeatedly call DiffuseIBLTexture.Load / DiffuseSkyIBLTexture.Load for the same
SH texels; create a small helper (e.g., LoadDiffuseSH or LoadSHTriplet) that
takes a Texture2DArray (or implicit texture) and returns/outputs the three sh2
components (shR, shG, shB) so callers reuse those values instead of re-loading;
update GetEnvIBL, GetSkyIBL, and GetIBLRatio to call this helper once per
texture (DiffuseIBLTexture and DiffuseSkyIBLTexture) and then pass the loaded
sh2 values into SphericalHarmonics::SHHallucinateZH3Irradiance and subsequent
math to eliminate redundant texture reads while preserving existing logic and
names.
In `@package/Shaders/Water.hlsl`:
- Line 1270: The PR should include a GitHub issue reference for traceability:
update the PR description to add a keyworded reference like "Implements `#1234`"
or "Addresses `#1234`" pointing to the related issue for the new diffuse IBL
feature (the change enabling SharedData::iblSettings.EnableDiffuseIBL in
Water.hlsl) so reviewers and tracking tools can link the code change to the
issue.
In `@src/Utils/SphericalHarmonics.h`:
- Around line 1-54: Update the PR title and description to follow Conventional
Commits and include issue references: change the PR title to a clearer form such
as "feat(ibl): split env/sky ibl with dalc sh blending" and, if this work maps
to a tracked issue, add "Addresses #<id>" in the PR description; mention the
relevant feature (e.g., DALCToSH in SphericalHarmonics) in the description for
context.
ℹ️ Review info
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (18)
features/Dynamic Cubemaps/Shaders/DynamicCubemaps/DynamicCubemaps.hlslifeatures/IBL/Shaders/IBL/IBL.hlslipackage/Shaders/Common/ShadowSampling.hlslipackage/Shaders/Common/SharedData.hlslipackage/Shaders/DeferredCompositeCS.hlslpackage/Shaders/DistantTree.hlslpackage/Shaders/Effect.hlslpackage/Shaders/ISSAOComposite.hlslpackage/Shaders/Lighting.hlslpackage/Shaders/Particle.hlslpackage/Shaders/RunGrass.hlslpackage/Shaders/Water.hlslsrc/Features/IBL.cppsrc/Features/IBL.hsrc/State.cppsrc/State.hsrc/Utils/SphericalHarmonics.cppsrc/Utils/SphericalHarmonics.h
|
✅ A pre-release build is available for this PR: |
There was a problem hiding this comment.
🧹 Nitpick comments (3)
src/Utils/SphericalHarmonics.h (1)
1-3: Consider explicit DirectX header dependencyLine 2 uses
DirectX::XMFLOAT3X3without an explicit include. This works if a precompiled header provides DirectX types, but adding#include <DirectXMath.h>would make the dependency explicit and prevent compilation failures if include order changes.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/Utils/SphericalHarmonics.h` around lines 1 - 3, Add an explicit include for the DirectXMath header so the DirectX::XMFLOAT3X3 type is always available: update SphericalHarmonics.h by adding `#include` <DirectXMath.h> before the alias declaration (the line defining using float3x3 = DirectX::XMFLOAT3X3) to make the dependency explicit and avoid relying on precompiled/header include order.features/IBL/Shaders/IBL/IBL.hlsli (1)
22-44: Asymmetric clamping between GetEnvIBL and GetSkyIBL
GetSkyIBL(line 43) appliesmax(0, ...)to prevent negative irradiance values, butGetEnvIBL(line 31) does not. If this is intentional (e.g., EnvIBL is guaranteed non-negative from source data), consider adding a brief comment. Otherwise, add the same guard for consistency:Proposed fix
float colorR = SphericalHarmonics::SHHallucinateZH3Irradiance(shR, rayDir); float colorG = SphericalHarmonics::SHHallucinateZH3Irradiance(shG, rayDir); float colorB = SphericalHarmonics::SHHallucinateZH3Irradiance(shB, rayDir); - return float3(colorR, colorG, colorB) / Math::PI; + return max(0, float3(colorR, colorG, colorB) / Math::PI); }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@features/IBL/Shaders/IBL/IBL.hlsli` around lines 22 - 44, GetEnvIBL lacks the non-negative clamp that GetSkyIBL applies; either apply the same guard to GetEnvIBL by wrapping its returned float3 in max(0, ...) (matching GetSkyIBL) or add a concise comment in GetEnvIBL explaining why negative values cannot occur (source guarantees) so the asymmetry is intentional; update the GetEnvIBL function (and its return expression) or add the comment directly above GetEnvIBL to make the behavior explicit.package/Shaders/DistantTree.hlsl (1)
247-260: Minor: Asymmetric clamping between deferred and non-deferred pathsThe deferred path (line 247) applies
max(0, ...)todirectionalAmbientColorwhile the non-deferred path (line 288) does not. If this is intentional (e.g., deferred compositing requires non-negative ambient), consider adding a brief comment. Otherwise, consider making them consistent:Option: Add clamping to non-deferred path
- float3 directionalAmbientColor = Color::Ambient(SharedData::GetAmbient(normal)); + float3 directionalAmbientColor = max(0, Color::Ambient(SharedData::GetAmbient(normal)));Also applies to: 288-301
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@package/Shaders/DistantTree.hlsl` around lines 247 - 260, The deferred path clamps directionalAmbientColor with max(0, Color::Ambient(SharedData::GetAmbient(normal))) but the non-deferred/IBL branch computes directionalAmbientColor without that clamp, producing asymmetric behavior; either apply the same non-negative clamp when assigning directionalAmbientColor in the non-deferred/IBL branch (use max(0, ...) around the computed envIBLColor/skyIBLColor combination or around Color::Ambient(...) if reusing that call) or, if the asymmetry is intentional, add a concise comment next to the non-deferred branch mentioning why non-negative clamping is omitted (reference variable directionalAmbientColor, Color::Ambient, SharedData::GetAmbient(normal), and the IBL branch using ImageBasedLighting::GetEnvIBLColor / GetSkyIBLColor).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@features/IBL/Shaders/IBL/IBL.hlsli`:
- Around line 22-44: GetEnvIBL lacks the non-negative clamp that GetSkyIBL
applies; either apply the same guard to GetEnvIBL by wrapping its returned
float3 in max(0, ...) (matching GetSkyIBL) or add a concise comment in GetEnvIBL
explaining why negative values cannot occur (source guarantees) so the asymmetry
is intentional; update the GetEnvIBL function (and its return expression) or add
the comment directly above GetEnvIBL to make the behavior explicit.
In `@package/Shaders/DistantTree.hlsl`:
- Around line 247-260: The deferred path clamps directionalAmbientColor with
max(0, Color::Ambient(SharedData::GetAmbient(normal))) but the non-deferred/IBL
branch computes directionalAmbientColor without that clamp, producing asymmetric
behavior; either apply the same non-negative clamp when assigning
directionalAmbientColor in the non-deferred/IBL branch (use max(0, ...) around
the computed envIBLColor/skyIBLColor combination or around Color::Ambient(...)
if reusing that call) or, if the asymmetry is intentional, add a concise comment
next to the non-deferred branch mentioning why non-negative clamping is omitted
(reference variable directionalAmbientColor, Color::Ambient,
SharedData::GetAmbient(normal), and the IBL branch using
ImageBasedLighting::GetEnvIBLColor / GetSkyIBLColor).
In `@src/Utils/SphericalHarmonics.h`:
- Around line 1-3: Add an explicit include for the DirectXMath header so the
DirectX::XMFLOAT3X3 type is always available: update SphericalHarmonics.h by
adding `#include` <DirectXMath.h> before the alias declaration (the line defining
using float3x3 = DirectX::XMFLOAT3X3) to make the dependency explicit and avoid
relying on precompiled/header include order.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 37376c33-e40b-4493-ae7d-e53523679934
📒 Files selected for processing (19)
features/Dynamic Cubemaps/Shaders/DynamicCubemaps/DynamicCubemaps.hlslifeatures/IBL/Shaders/IBL/IBL.hlslipackage/Shaders/Common/ShadowSampling.hlslipackage/Shaders/Common/SharedData.hlslipackage/Shaders/DeferredCompositeCS.hlslpackage/Shaders/DistantTree.hlslpackage/Shaders/Effect.hlslpackage/Shaders/ISSAOComposite.hlslpackage/Shaders/Lighting.hlslpackage/Shaders/Particle.hlslpackage/Shaders/RunGrass.hlslpackage/Shaders/Water.hlslsrc/Deferred.cppsrc/Features/IBL.cppsrc/Features/IBL.hsrc/State.cppsrc/State.hsrc/Utils/SphericalHarmonics.cppsrc/Utils/SphericalHarmonics.h
🚧 Files skipped from review as they are similar to previous changes (5)
- package/Shaders/ISSAOComposite.hlsl
- package/Shaders/Particle.hlsl
- src/State.cpp
- package/Shaders/Common/SharedData.hlsli
- package/Shaders/Common/ShadowSampling.hlsli
There was a problem hiding this comment.
♻️ Duplicate comments (3)
src/Utils/SphericalHarmonics.cpp (3)
209-223:⚠️ Potential issue | 🟠 MajorGuard normalization and roughness domain to avoid NaN propagation.
Line 212 can divide by zero for zero-length vectors, and Line 221 can evaluate
sqrt(1 - roughness)with invalid input when roughness is outside[0,1].Proposed fix
template <typename T> static T normalize(const T& v) { - return v * (1.0f / sqrtf(v.Dot(v))); + const float len2 = v.Dot(v); + if (len2 <= 1e-8f) { + return v; + } + return v * (1.0f / sqrtf(len2)); } @@ SH2 SphericalHarmonics::FauxSpecularLobe(float3 N, float3 V, float roughness) { + roughness = std::clamp(roughness, 0.0f, 1.0f); // https://www.gdcvault.com/play/1026701/Fast-Denoising-With-Self-Stabilizing // get dominant ggx reflection direction float f = (1 - roughness) * (sqrt(1 - roughness) + roughness);As per coding guidelines "Include proper resource management and graceful degradation for DirectX 11 resources and user input validation to prevent crashes from malformed configurations".
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/Utils/SphericalHarmonics.cpp` around lines 209 - 223, The normalize function and SphericalHarmonics::FauxSpecularLobe need defensive checks: in normalize(const T& v) check v.Dot(v) (or v.LengthSq()) and if it is <= epsilon return a safe fallback (e.g. zero vector or unit-axis) instead of dividing by zero, and in FauxSpecularLobe clamp the roughness input to [0,1] before computing f (use max(min(roughness,1.0f),0.0f)) and guard the sqrt(1 - roughness) call with that clamped value; additionally, after computing D or using normalize(R*... + N*...), ensure the vector passed to normalize is not zero and handle that case (early return a sensible SH2 default or use N) to prevent NaN propagation.
236-242:⚠️ Potential issue | 🟠 MajorAdd an epsilon guard before dividing by
sh.c0.Line 241 can blow up
ratiofor dark/degenerate SH inputs and destabilize irradiance output.Proposed fix
float SphericalHarmonics::SHHallucinateZH3Irradiance(SH2 sh, float3 direction) { + if (std::abs(sh.c0) <= 1e-8f) { + return 0.0f; + } float3 zonalAxis = normalize(float3(sh.c1[2], sh.c1[0], sh.c1[1])); float ratio = 0.0; ratio = abs(zonalAxis.Dot(float3(-sh.c1[2], -sh.c1[0], sh.c1[1]))); ratio /= sh.c0;As per coding guidelines "Include proper resource management and graceful degradation for DirectX 11 resources and user input validation to prevent crashes from malformed configurations".
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/Utils/SphericalHarmonics.cpp` around lines 236 - 242, In SphericalHarmonics::SHHallucinateZH3Irradiance, guard the division by sh.c0 when computing ratio: before doing ratio /= sh.c0, test fabs(sh.c0) against a small epsilon (e.g. 1e-6) and if it's below the threshold treat sh.c0 as degenerate (set ratio = 0 or use a safe fallback) so zonalL2Coeff is computed stably; apply the same epsilon check anywhere sh.c0 is used as a divisor to avoid blowups for dark/degenerate SH inputs.
141-149:⚠️ Potential issue | 🟠 MajorFix the duplicated term in
Productoutput.Line 148 repeats the same term twice, which breaks the component pattern used by Line 146–147 and can skew SH multiplication results.
Proposed fix
SH2 SphericalHarmonics::Product(SH2 shL, SH2 shR) { const float factor = 1.0f / (2.0f * sqrt(3.14159265358979323846f)); SH2 result; result.c0 = factor * Dot(shL, shR); result.c1[0] = factor * (shL.c1[0] * shR.c1[2] + shL.c1[2] * shR.c1[0]); result.c1[1] = factor * (shL.c1[1] * shR.c1[2] + shL.c1[2] * shR.c1[1]); - result.c1[2] = factor * (shL.c1[2] * shR.c1[2] + shL.c1[2] * shR.c1[2]); + result.c1[2] = factor * (shL.c1[0] * shR.c1[1] + shL.c1[1] * shR.c1[0]); return result; }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/Utils/SphericalHarmonics.cpp` around lines 141 - 149, SphericalHarmonics::Product currently assigns result.c1[2] using the same term twice (shL.c1[2] * shR.c1[2]), which is a copy/paste bug; update result.c1[2] in the SH2 Product function to use the correct cross-pairing expression: factor * (shL.c1[0] * shR.c1[1] + shL.c1[1] * shR.c1[0]) so the three c1 components follow the same pairing pattern as result.c1[0] and result.c1[1].
🧹 Nitpick comments (1)
src/Utils/SphericalHarmonics.cpp (1)
1-1: Consider adding an issue reference in the PR description.Since this is a feature PR, linking the tracked issue (for example,
Implements #<id>orAddresses #<id>) improves traceability.As per coding guidelines "Issue References (if PR fixes bugs or implements features): Suggest adding appropriate GitHub keywords".
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/Utils/SphericalHarmonics.cpp` at line 1, Add a GitHub issue reference to the PR description for traceability by including a keyword such as "Implements #<id>" or "Addresses #<id>" that links this feature change touching SphericalHarmonics (see src/Utils/SphericalHarmonics.cpp and SphericalHarmonics.h) to the tracked issue; update the PR title/body to include the appropriate keyword and issue number so the merge will auto-close or reference the issue per project guidelines.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@src/Utils/SphericalHarmonics.cpp`:
- Around line 209-223: The normalize function and
SphericalHarmonics::FauxSpecularLobe need defensive checks: in normalize(const
T& v) check v.Dot(v) (or v.LengthSq()) and if it is <= epsilon return a safe
fallback (e.g. zero vector or unit-axis) instead of dividing by zero, and in
FauxSpecularLobe clamp the roughness input to [0,1] before computing f (use
max(min(roughness,1.0f),0.0f)) and guard the sqrt(1 - roughness) call with that
clamped value; additionally, after computing D or using normalize(R*... +
N*...), ensure the vector passed to normalize is not zero and handle that case
(early return a sensible SH2 default or use N) to prevent NaN propagation.
- Around line 236-242: In SphericalHarmonics::SHHallucinateZH3Irradiance, guard
the division by sh.c0 when computing ratio: before doing ratio /= sh.c0, test
fabs(sh.c0) against a small epsilon (e.g. 1e-6) and if it's below the threshold
treat sh.c0 as degenerate (set ratio = 0 or use a safe fallback) so zonalL2Coeff
is computed stably; apply the same epsilon check anywhere sh.c0 is used as a
divisor to avoid blowups for dark/degenerate SH inputs.
- Around line 141-149: SphericalHarmonics::Product currently assigns
result.c1[2] using the same term twice (shL.c1[2] * shR.c1[2]), which is a
copy/paste bug; update result.c1[2] in the SH2 Product function to use the
correct cross-pairing expression: factor * (shL.c1[0] * shR.c1[1] + shL.c1[1] *
shR.c1[0]) so the three c1 components follow the same pairing pattern as
result.c1[0] and result.c1[1].
---
Nitpick comments:
In `@src/Utils/SphericalHarmonics.cpp`:
- Line 1: Add a GitHub issue reference to the PR description for traceability by
including a keyword such as "Implements #<id>" or "Addresses #<id>" that links
this feature change touching SphericalHarmonics (see
src/Utils/SphericalHarmonics.cpp and SphericalHarmonics.h) to the tracked issue;
update the PR title/body to include the appropriate keyword and issue number so
the merge will auto-close or reference the issue per project guidelines.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: f66af0d3-1d03-49c8-897a-32a699ab354d
📒 Files selected for processing (1)
src/Utils/SphericalHarmonics.cpp
* fix(weather overrides): ensure json format for features (community-shaders#1748) Co-authored-by: SkrubbySkrubInAShrub <skrubbyskrubinashrub@gmail.com> * perf(terrain blending): tweak defaults (community-shaders#1771) * fix(lighting): vanilla envcolor mult the correct value (community-shaders#1775) * fix(water): remove final colour saturate (community-shaders#1778) * fix(unified-water): LOD water cache mismatch (community-shaders#1779) * fix(weather editor): override desync with weather transitions (community-shaders#1782) * fix(weather editor): no-override weather file deletion (community-shaders#1777) * fix(weather editor): apply weather settings post-load (community-shaders#1776) * fix(weather editor): handling of weathers without overrides (community-shaders#1773) * feat(UI): feature headings (community-shaders#1786) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * feat(VR): add wand pointing (community-shaders#1790) * chore(UI): theme consistency (community-shaders#1787) * fix(upscaling): warn about max nvidia resolution (community-shaders#1795) Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * chore(linear lighting): UI settings changes (community-shaders#1785) Co-authored-by: Jiaye <l936249247@hotmail.com> * fix(grass-lighting) better basic grass brightness default (community-shaders#1780) * chore(UI): remove settings and about tabs (community-shaders#1794) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * fix(terrain shadows): fix compiler warnings (community-shaders#1798) * fix: fix flickering particles (community-shaders#1791) * fix(terrain blending): disable vr support (community-shaders#1799) * refactor(upscaling): standardize behavior and tune settings (community-shaders#1783) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * feat(UI): add auto-hide featurelist option (community-shaders#1793) * fix: match grass brightness of vanilla (community-shaders#1801) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * refactor(perfoverlay): remove color from "Other" and "Total" (community-shaders#1806) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * fix(unified water): fix for mesh water jitter (community-shaders#1809) * fix: clear shader cache on plugin version change (community-shaders#1739) * feat(filewatcher): add hlsli tracking (community-shaders#1796) * feat(linear lighting): add ambient multiplier (community-shaders#1805) * fix(unified-water): underwater fog flicker (community-shaders#1807) * fix(UI): conflicting esc key on welcome hotkey dialogue (community-shaders#1811) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * chore(UI): add subtext font to tooltips (community-shaders#1810) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * build: bump streamline to 2.10.3 (community-shaders#1813) * build: resolve shader warnings (community-shaders#1818) * feat(ui): add combo hotkey support (community-shaders#1808) * feat: add feature constraints (community-shaders#1804) * build: update version to 1.4.8 (community-shaders#1802) * fix(VR): apply per eye upscaling (community-shaders#1819) - Split upscaling across each eye for correctness and to avoid DLSS failing over 8k x 8k limit - Changes HMD mask color to black to hide artifacts with fast movement * build: bump common lib to 4.2.0 (community-shaders#1821) Co-authored-by: doodlum <15017472+doodlum@users.noreply.github.com> * fix(grass collision): catch trashed actor pointers (community-shaders#1765) * fix(weather editor): desynced override transitions (community-shaders#1820) * fix(upscaling): fix preset and allocation handling (community-shaders#1824) Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * build: remove linear lighting from core whilst in development (community-shaders#1826) * chore: bump version to 1.4.9 (community-shaders#1827) * fix: add back LLF core file and remove LL core file (community-shaders#1828) * fix: dont save shader debug toggles (community-shaders#1831) * fix: remove IBL from core, unfinished (community-shaders#1830) * chore: update version to 1.4.10 (community-shaders#1832) * chore(dynamic cubemaps): lessen normalisation darkening (community-shaders#1833) * chore(llf): remove LightsVisualisationMode settings loading (community-shaders#1834) * revert: "fix: dont save shader debug toggles (community-shaders#1831)" This reverts commit f55f195. * revert: "chore(llf): remove LightsVisualisationMode settings loading (community-shaders#1834)" This reverts commit b3db5a7. * fix: default enabledClasses true * build: bump version * feat(upscaling): custom DLSS preset (community-shaders#1837) * fix(weather editor): sync UI for full transition (community-shaders#1822) * fix(linearlighting): return correct buffer when ll feature off (community-shaders#1838) * fix(PBR): skip IrradianceToLinear on specular in vanilla (community-shaders#1839) * feat(weather editor): adjust slider ranges (community-shaders#1847) Co-authored-by: SkrubbySkrubInAShrub <skrubbyskrubinashrub@gmail.com> * feat(weather editor): replace volumetric Lighting RGB sliders with color picker (community-shaders#1846) Co-authored-by: SkrubbySkrubInAShrub <skrubbyskrubinashrub@gmail.com> * fix(grass collision): collision radius math (community-shaders#1849) * chore: move new feature information into docs (community-shaders#1848) Co-authored-by: doodlum <15017472+doodlum@users.noreply.github.com> * fix(ui): background blur with upscaling (community-shaders#1815) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * refactor: move some features to core (community-shaders#1852) * fix: fix blown out water specular (community-shaders#1853) * feat(weather editor): toggle hotkey (community-shaders#1856) Co-authored-by: SkrubbySkrubInAShrub <skrubbyskrubinashrub@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * feat(color picker): add an original color reference to all color pickers (community-shaders#1857) Co-authored-by: SkrubbySkrubInAShrub <skrubbyskrubinashrub@gmail.com> * perf(emat): alternate tweaks (community-shaders#1850) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * feat(weather-editor): merge weather picker and editor (community-shaders#1845) Co-authored-by: SkrubbySkrubInAShrub <skrubbyskrubinashrub@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * chore(llf): remove LLF settings loading (community-shaders#1859) * feat: exponential height fog (community-shaders#1708) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * feat(weather editor): block editor access in loading screens (community-shaders#1871) Co-authored-by: SkrubbySkrubInAShrub <skrubbyskrubinashrub@gmail.com> * feat(weather editor): improve weather picker UI and functionality (community-shaders#1863) Co-authored-by: SkrubbySkrubInAShrub <skrubbyskrubinashrub@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * feat(weather editor): repurpose unsaved changes tracking (community-shaders#1860) Co-authored-by: SkrubbySkrubInAShrub <skrubbyskrubinashrub@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * fix: sync grass lighting defaults to match ENB (community-shaders#1844) * fix: stop shader compilation on game exit (community-shaders#1867) closes community-shaders#1130 * fix(weather editor): prevent inputs when editor is open (community-shaders#1872) * fix(weather editor): add ctd guards (community-shaders#1864) * feat(weather editor): remove WorldSpace widget and associated code (community-shaders#1878) Co-authored-by: SkrubbySkrubInAShrub <skrubbyskrubinashrub@gmail.com> * feat(vr): add OpenComposite menu support (community-shaders#1880) * revert: "feat(vr): add OpenComposite VR menu" (community-shaders#1881) * revert: "fix: stop shader compilation on game exit" (community-shaders#1882) * feat(vr): add OpenComposite menu support (community-shaders#1883) * feat(weather editor): add time controls (community-shaders#1877) * feat: add shadowmap rasterizer override (community-shaders#1690) * fix(weather editor): clear feature overrides with revert (community-shaders#1884) * feat(UI): Interior Only (community-shaders#1854) * fix(VR): fix Shadowmap Cascade Rasterizer (community-shaders#1888) * fix(unified water): distance calculation for raindrops & LOD fade (community-shaders#1890) * refactor: clarify core feature version mismatch text (community-shaders#1886) * fix: stop shader compilation on game exit (community-shaders#1885) * build: exclude hlsl tests from packaging (community-shaders#1894) * chore: disable feature constraints in dev mode (community-shaders#1893) * fix(vr): improve stereo UV handling (community-shaders#1899) * fix(weather editor): move esc key to native input system (community-shaders#1897) Co-authored-by: SkrubbySkrubInAShrub <skrubbyskrubinashrub@gmail.com> * fix: move ResolveMonoUVForEye outside VR guard (community-shaders#1906) * fix(grass collision): validate actor (community-shaders#1905) Co-authored-by: doodlum <15017472+doodlum@users.noreply.github.com> * fix(terrain shadows): height map regression (community-shaders#1911) * fix: util vertical fov math (community-shaders#1904) Co-authored-by: doodlum <15017472+doodlum@users.noreply.github.com> * test: add float4 overload test (community-shaders#1902) * refactor: move all features to globals::game::calendar (community-shaders#1909) Co-authored-by: SkrubbySkrubInAShrub <skrubbyskrubinashrub@gmail.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fix(UI): resolution based font (community-shaders#1907) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * feat(weather editor): make objects window be independently scrollable (community-shaders#1908) Co-authored-by: SkrubbySkrubInAShrub <skrubbyskrubinashrub@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * feat(UI): consolidate searchbar to util and add to weather editor (community-shaders#1898) Co-authored-by: SkrubbySkrubInAShrub <skrubbyskrubinashrub@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * feat(weather editor): add filled star for favourites. (community-shaders#1913) Co-authored-by: SkrubbySkrubInAShrub <skrubbyskrubinashrub@gmail.com> * feat(weather editor): add delete json button to objects window (community-shaders#1914) Co-authored-by: SkrubbySkrubInAShrub <skrubbyskrubinashrub@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * fix(VR): resolution-based font (community-shaders#1923) * refactor: use depthbuffer helper (community-shaders#1925) * refactor: move TurboColormap into Color.hlsli (community-shaders#1924) * fix(weather editor): expand clickable area of feature override (community-shaders#1921) * feat(weather editor): enable snapping to viewport (community-shaders#1917) * feat(weather editor): highlight enabled cloud layers (community-shaders#1916) * fix(VR): SSGI discrepancies (community-shaders#1926) * feat: volumetric shadows (community-shaders#1874) * ci: enhance feature version audit (community-shaders#1927) * feat(weather editor): add filter options for objects window (community-shaders#1922) * feat(weather editor): sticky headers and scrollable content (community-shaders#1930) * fix(UI): ImGui scaling for borderless mode (community-shaders#1929) * ci: don't fail on feature audits (community-shaders#1934) * fix(pbr): use scrap heap allocation (community-shaders#1928) * chore(UI): add subsurface scattering to Interior Only (community-shaders#1932) * fix(weather editor): align highlights, fix tooltip (community-shaders#1918) * fix(ssgi): guard VR only compilation (community-shaders#1938) * build: update template to avoid extra directory (community-shaders#1812) * style: fix hlsl formatting (community-shaders#1939) * fix(UI): improve theme management UI flow (community-shaders#1933) closes community-shaders#1919 * build(deps): update pre-commit hooks (community-shaders#1768) * feat(UI): delete theme button (community-shaders#1940) * feat(UI): open log file button (community-shaders#1942) * fix(hair): marschner volumetric shadow tint (community-shaders#1944) * fix(VR): screen space shadows desync (community-shaders#1946) closes community-shaders#1840 * fix(VR): depth culling during upscaling/Terrain Blending (community-shaders#1858) * feat(VR): add edge detection for stereo blending (community-shaders#1948) * refactor: allocate trampoline once (community-shaders#1951) * fix(UI): PBR MATO color scale RGB settings corrected (community-shaders#1957) * fix(weather editor): guard against loadorder changes (community-shaders#1953) Co-authored-by: SkrubbySkrubInAShrub <skrubbyskrubinashrub@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: davo0411 <davidkehoe0411@outlook.com> * fix(UI): feature description text wrapping (community-shaders#1960) * fix(VR): exponential height fog stereo mismatch (community-shaders#1961) * chore: pbr consistency changes (community-shaders#1841) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: jiayev <l936249247@hotmail.com> * fix(skylighting): remove PBR lighting scale (community-shaders#1963) * fix(skysync): effect mesh blackout during shadow caster transitions (community-shaders#1965) * ci: fix wiki deletion with buffer update (community-shaders#1967) * feat(weather-editor): option to hide viewport (community-shaders#1970) Co-authored-by: SkrubbySkrubInAShrub <skrubbyskrubinashrub@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * test(shader): fallback to warp on invalidarg (community-shaders#1956) Co-authored-by: LukeFrankio <loren@example.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * feat: triplanar projected materials (community-shaders#1950) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * fix(ao): better ao calculations (community-shaders#1968) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * fix(pbr): fix improper kD terms (community-shaders#1971) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * perf(emat): tweak fade and shadow intensity (community-shaders#1892) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * feat(ibl): revamp ibl and dalc sh (community-shaders#1947) * build: bump commonlib to 4.7.1 (community-shaders#1977) * fix: upscaling monitor detection fixes (community-shaders#1978) * fix(weather editor): prevent overrides resetting settings (community-shaders#1980) * fix(VR): bad llf offset (community-shaders#1984) * perf: cache frequent ui checks (community-shaders#1985) * fix: preserve vanilla water TAA when no upscaler is active (community-shaders#1986) Co-authored-by: jturnley <jturnley@users.noreply.github.com> * fix(UI): first-time dialog fade affects all overlays (community-shaders#1976) * fix(skysync): remove sunlight fade and volumetric lighting overrides (community-shaders#1966) * refactor(HLSL): standardize epsilon constants (community-shaders#1992) closes community-shaders#1227 * feat(UI): require Shift to dock windows (community-shaders#1989) * fix(UI): input spam after alt-tab (community-shaders#1993) * fix(sky sync): early return for invalid cells (community-shaders#1991) Co-authored-by: SkrubbySkrubInAShrub <skrubbyskrubinashrub@gmail.com> Co-authored-by: jiayev <l936249247@hotmail.com> * fix(sky sync): remove undeclared variable (community-shaders#1994) * refactor(pbr): clear up semantics (community-shaders#1995) * fix(UI): scale layout values for high-DPI (community-shaders#1987) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * fix(water): hdr water taa blend (community-shaders#1988) * refactor(color): clarify gamma conversion functions (community-shaders#1996) * feat(ISL-editor): add light counters and fix filtering (community-shaders#1997) * fix(UI): DPI-aware window layouts (community-shaders#2000) * fix(weather-editor): save color palette window (community-shaders#2001) * refactor: centralize feature category names (community-shaders#2007) closes community-shaders#1265 Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> * chore: bump versions (community-shaders#2010) * fix(water): sample history mask from current mask (community-shaders#2011) * chore(wetness-effects): set default MaxPuddleWetness to 1.5 (community-shaders#1981) Co-authored-by: SkrubbySkrubInAShrub <skrubbyskrubinashrub@gmail.com> * feat(weather-editor): add free camera and play mode (community-shaders#2008) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * build: bump versions and reduce false positives (community-shaders#2013) * fix(VR): LLF cluster building and culling (community-shaders#2012) * build: update to VS 2026 (community-shaders#1990) * ci: fix preset in vs2022 mode (community-shaders#2015) * ci: remove v2022 from shader jobs (community-shaders#2016) * feat(upscaling): integrate Streamline Reflex controls (community-shaders#1958) * fix(unified-water): BSWaterShaderProperty.plane (community-shaders#1998) --------- Co-authored-by: Skrubby Skrub In A Shrub <87662196+SkrubbySkrubInAShrub@users.noreply.github.com> Co-authored-by: SkrubbySkrubInAShrub <skrubbyskrubinashrub@gmail.com> Co-authored-by: doodlum <15017472+doodlum@users.noreply.github.com> Co-authored-by: jiayev <l936249247@hotmail.com> Co-authored-by: Dlizzio <77717521+Dlizzio@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Alan Tse <alandtse@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Bruce <44987693+brucenguyen@users.noreply.github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: Dawntic <197450198+Dawntic@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Alan Tse <alandtse@gmail.com> Co-authored-by: Vanni Giachin <vanni.giachin@qlik.com> Co-authored-by: zxcvbn <66063766+zndxcvbn@users.noreply.github.com> Co-authored-by: ParticleTroned <248299730+ParticleTroned@users.noreply.github.com> Co-authored-by: soda <130315225+soda3000@users.noreply.github.com> Co-authored-by: YtzyFvra <59631290+YtzyFvra@users.noreply.github.com> Co-authored-by: LukeFrankio <lorenzogrutzmann@gmail.com> Co-authored-by: LukeFrankio <loren@example.com> Co-authored-by: jturnley <32892261+jturnley@users.noreply.github.com> Co-authored-by: jturnley <jturnley@users.noreply.github.com> Co-authored-by: Igor Alan Albuquerque de Sousa <50077829+IgorAlanAlbuquerque@users.noreply.github.com> Co-authored-by: Matt Van Horn <mvanhorn@users.noreply.github.com> Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
* fix(weather overrides): ensure json format for features (community-shaders#1748) Co-authored-by: SkrubbySkrubInAShrub <skrubbyskrubinashrub@gmail.com> * perf(terrain blending): tweak defaults (community-shaders#1771) * fix(lighting): vanilla envcolor mult the correct value (community-shaders#1775) * fix(water): remove final colour saturate (community-shaders#1778) * fix(unified-water): LOD water cache mismatch (community-shaders#1779) * fix(weather editor): override desync with weather transitions (community-shaders#1782) * fix(weather editor): no-override weather file deletion (community-shaders#1777) * fix(weather editor): apply weather settings post-load (community-shaders#1776) * fix(weather editor): handling of weathers without overrides (community-shaders#1773) * feat(UI): feature headings (community-shaders#1786) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * feat(VR): add wand pointing (community-shaders#1790) * chore(UI): theme consistency (community-shaders#1787) * fix(upscaling): warn about max nvidia resolution (community-shaders#1795) Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * chore(linear lighting): UI settings changes (community-shaders#1785) Co-authored-by: Jiaye <l936249247@hotmail.com> * fix(grass-lighting) better basic grass brightness default (community-shaders#1780) * chore(UI): remove settings and about tabs (community-shaders#1794) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * fix(terrain shadows): fix compiler warnings (community-shaders#1798) * fix: fix flickering particles (community-shaders#1791) * fix(terrain blending): disable vr support (community-shaders#1799) * refactor(upscaling): standardize behavior and tune settings (community-shaders#1783) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * feat(UI): add auto-hide featurelist option (community-shaders#1793) * fix: match grass brightness of vanilla (community-shaders#1801) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * refactor(perfoverlay): remove color from "Other" and "Total" (community-shaders#1806) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * fix(unified water): fix for mesh water jitter (community-shaders#1809) * fix: clear shader cache on plugin version change (community-shaders#1739) * feat(filewatcher): add hlsli tracking (community-shaders#1796) * feat(linear lighting): add ambient multiplier (community-shaders#1805) * fix(unified-water): underwater fog flicker (community-shaders#1807) * fix(UI): conflicting esc key on welcome hotkey dialogue (community-shaders#1811) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * chore(UI): add subtext font to tooltips (community-shaders#1810) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * build: bump streamline to 2.10.3 (community-shaders#1813) * build: resolve shader warnings (community-shaders#1818) * feat(ui): add combo hotkey support (community-shaders#1808) * feat: add feature constraints (community-shaders#1804) * build: update version to 1.4.8 (community-shaders#1802) * fix(VR): apply per eye upscaling (community-shaders#1819) - Split upscaling across each eye for correctness and to avoid DLSS failing over 8k x 8k limit - Changes HMD mask color to black to hide artifacts with fast movement * build: bump common lib to 4.2.0 (community-shaders#1821) Co-authored-by: doodlum <15017472+doodlum@users.noreply.github.com> * fix(grass collision): catch trashed actor pointers (community-shaders#1765) * fix(weather editor): desynced override transitions (community-shaders#1820) * fix(upscaling): fix preset and allocation handling (community-shaders#1824) Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * build: remove linear lighting from core whilst in development (community-shaders#1826) * chore: bump version to 1.4.9 (community-shaders#1827) * fix: add back LLF core file and remove LL core file (community-shaders#1828) * fix: dont save shader debug toggles (community-shaders#1831) * fix: remove IBL from core, unfinished (community-shaders#1830) * chore: update version to 1.4.10 (community-shaders#1832) * chore(dynamic cubemaps): lessen normalisation darkening (community-shaders#1833) * chore(llf): remove LightsVisualisationMode settings loading (community-shaders#1834) * revert: "fix: dont save shader debug toggles (community-shaders#1831)" This reverts commit f55f195. * revert: "chore(llf): remove LightsVisualisationMode settings loading (community-shaders#1834)" This reverts commit b3db5a7. * fix: default enabledClasses true * build: bump version * feat(upscaling): custom DLSS preset (community-shaders#1837) * fix(weather editor): sync UI for full transition (community-shaders#1822) * fix(linearlighting): return correct buffer when ll feature off (community-shaders#1838) * fix(PBR): skip IrradianceToLinear on specular in vanilla (community-shaders#1839) * feat(weather editor): adjust slider ranges (community-shaders#1847) Co-authored-by: SkrubbySkrubInAShrub <skrubbyskrubinashrub@gmail.com> * feat(weather editor): replace volumetric Lighting RGB sliders with color picker (community-shaders#1846) Co-authored-by: SkrubbySkrubInAShrub <skrubbyskrubinashrub@gmail.com> * fix(grass collision): collision radius math (community-shaders#1849) * chore: move new feature information into docs (community-shaders#1848) Co-authored-by: doodlum <15017472+doodlum@users.noreply.github.com> * fix(ui): background blur with upscaling (community-shaders#1815) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * refactor: move some features to core (community-shaders#1852) * fix: fix blown out water specular (community-shaders#1853) * feat(weather editor): toggle hotkey (community-shaders#1856) Co-authored-by: SkrubbySkrubInAShrub <skrubbyskrubinashrub@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * feat(color picker): add an original color reference to all color pickers (community-shaders#1857) Co-authored-by: SkrubbySkrubInAShrub <skrubbyskrubinashrub@gmail.com> * perf(emat): alternate tweaks (community-shaders#1850) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * feat(weather-editor): merge weather picker and editor (community-shaders#1845) Co-authored-by: SkrubbySkrubInAShrub <skrubbyskrubinashrub@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * chore(llf): remove LLF settings loading (community-shaders#1859) * feat: exponential height fog (community-shaders#1708) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * feat(weather editor): block editor access in loading screens (community-shaders#1871) Co-authored-by: SkrubbySkrubInAShrub <skrubbyskrubinashrub@gmail.com> * feat(weather editor): improve weather picker UI and functionality (community-shaders#1863) Co-authored-by: SkrubbySkrubInAShrub <skrubbyskrubinashrub@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * feat(weather editor): repurpose unsaved changes tracking (community-shaders#1860) Co-authored-by: SkrubbySkrubInAShrub <skrubbyskrubinashrub@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * fix: sync grass lighting defaults to match ENB (community-shaders#1844) * fix: stop shader compilation on game exit (community-shaders#1867) closes community-shaders#1130 * fix(weather editor): prevent inputs when editor is open (community-shaders#1872) * fix(weather editor): add ctd guards (community-shaders#1864) * feat(weather editor): remove WorldSpace widget and associated code (community-shaders#1878) Co-authored-by: SkrubbySkrubInAShrub <skrubbyskrubinashrub@gmail.com> * feat(vr): add OpenComposite menu support (community-shaders#1880) * revert: "feat(vr): add OpenComposite VR menu" (community-shaders#1881) * revert: "fix: stop shader compilation on game exit" (community-shaders#1882) * feat(vr): add OpenComposite menu support (community-shaders#1883) * feat(weather editor): add time controls (community-shaders#1877) * feat: add shadowmap rasterizer override (community-shaders#1690) * fix(weather editor): clear feature overrides with revert (community-shaders#1884) * feat(UI): Interior Only (community-shaders#1854) * fix(VR): fix Shadowmap Cascade Rasterizer (community-shaders#1888) * fix(unified water): distance calculation for raindrops & LOD fade (community-shaders#1890) * refactor: clarify core feature version mismatch text (community-shaders#1886) * fix: stop shader compilation on game exit (community-shaders#1885) * build: exclude hlsl tests from packaging (community-shaders#1894) * chore: disable feature constraints in dev mode (community-shaders#1893) * fix(vr): improve stereo UV handling (community-shaders#1899) * fix(weather editor): move esc key to native input system (community-shaders#1897) Co-authored-by: SkrubbySkrubInAShrub <skrubbyskrubinashrub@gmail.com> * fix: move ResolveMonoUVForEye outside VR guard (community-shaders#1906) * fix(grass collision): validate actor (community-shaders#1905) Co-authored-by: doodlum <15017472+doodlum@users.noreply.github.com> * fix(terrain shadows): height map regression (community-shaders#1911) * fix: util vertical fov math (community-shaders#1904) Co-authored-by: doodlum <15017472+doodlum@users.noreply.github.com> * test: add float4 overload test (community-shaders#1902) * refactor: move all features to globals::game::calendar (community-shaders#1909) Co-authored-by: SkrubbySkrubInAShrub <skrubbyskrubinashrub@gmail.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fix(UI): resolution based font (community-shaders#1907) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * feat(weather editor): make objects window be independently scrollable (community-shaders#1908) Co-authored-by: SkrubbySkrubInAShrub <skrubbyskrubinashrub@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * feat(UI): consolidate searchbar to util and add to weather editor (community-shaders#1898) Co-authored-by: SkrubbySkrubInAShrub <skrubbyskrubinashrub@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * feat(weather editor): add filled star for favourites. (community-shaders#1913) Co-authored-by: SkrubbySkrubInAShrub <skrubbyskrubinashrub@gmail.com> * feat(weather editor): add delete json button to objects window (community-shaders#1914) Co-authored-by: SkrubbySkrubInAShrub <skrubbyskrubinashrub@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * fix(VR): resolution-based font (community-shaders#1923) * refactor: use depthbuffer helper (community-shaders#1925) * refactor: move TurboColormap into Color.hlsli (community-shaders#1924) * fix(weather editor): expand clickable area of feature override (community-shaders#1921) * feat(weather editor): enable snapping to viewport (community-shaders#1917) * feat(weather editor): highlight enabled cloud layers (community-shaders#1916) * fix(VR): SSGI discrepancies (community-shaders#1926) * feat: volumetric shadows (community-shaders#1874) * ci: enhance feature version audit (community-shaders#1927) * feat(weather editor): add filter options for objects window (community-shaders#1922) * feat(weather editor): sticky headers and scrollable content (community-shaders#1930) * fix(UI): ImGui scaling for borderless mode (community-shaders#1929) * ci: don't fail on feature audits (community-shaders#1934) * fix(pbr): use scrap heap allocation (community-shaders#1928) * chore(UI): add subsurface scattering to Interior Only (community-shaders#1932) * fix(weather editor): align highlights, fix tooltip (community-shaders#1918) * fix(ssgi): guard VR only compilation (community-shaders#1938) * build: update template to avoid extra directory (community-shaders#1812) * style: fix hlsl formatting (community-shaders#1939) * fix(UI): improve theme management UI flow (community-shaders#1933) closes community-shaders#1919 * build(deps): update pre-commit hooks (community-shaders#1768) * feat(UI): delete theme button (community-shaders#1940) * feat(UI): open log file button (community-shaders#1942) * fix(hair): marschner volumetric shadow tint (community-shaders#1944) * fix(VR): screen space shadows desync (community-shaders#1946) closes community-shaders#1840 * fix(VR): depth culling during upscaling/Terrain Blending (community-shaders#1858) * feat(VR): add edge detection for stereo blending (community-shaders#1948) * refactor: allocate trampoline once (community-shaders#1951) * fix(UI): PBR MATO color scale RGB settings corrected (community-shaders#1957) * fix(weather editor): guard against loadorder changes (community-shaders#1953) Co-authored-by: SkrubbySkrubInAShrub <skrubbyskrubinashrub@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: davo0411 <davidkehoe0411@outlook.com> * fix(UI): feature description text wrapping (community-shaders#1960) * fix(VR): exponential height fog stereo mismatch (community-shaders#1961) * chore: pbr consistency changes (community-shaders#1841) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: jiayev <l936249247@hotmail.com> * fix(skylighting): remove PBR lighting scale (community-shaders#1963) * fix(skysync): effect mesh blackout during shadow caster transitions (community-shaders#1965) * ci: fix wiki deletion with buffer update (community-shaders#1967) * feat(weather-editor): option to hide viewport (community-shaders#1970) Co-authored-by: SkrubbySkrubInAShrub <skrubbyskrubinashrub@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * test(shader): fallback to warp on invalidarg (community-shaders#1956) Co-authored-by: LukeFrankio <loren@example.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * feat: triplanar projected materials (community-shaders#1950) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * fix(ao): better ao calculations (community-shaders#1968) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * fix(pbr): fix improper kD terms (community-shaders#1971) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * perf(emat): tweak fade and shadow intensity (community-shaders#1892) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * feat(ibl): revamp ibl and dalc sh (community-shaders#1947) * build: bump commonlib to 4.7.1 (community-shaders#1977) * fix: upscaling monitor detection fixes (community-shaders#1978) * fix(weather editor): prevent overrides resetting settings (community-shaders#1980) * fix(VR): bad llf offset (community-shaders#1984) * perf: cache frequent ui checks (community-shaders#1985) * fix: preserve vanilla water TAA when no upscaler is active (community-shaders#1986) Co-authored-by: jturnley <jturnley@users.noreply.github.com> * fix(UI): first-time dialog fade affects all overlays (community-shaders#1976) * fix(skysync): remove sunlight fade and volumetric lighting overrides (community-shaders#1966) * refactor(HLSL): standardize epsilon constants (community-shaders#1992) closes community-shaders#1227 * feat(UI): require Shift to dock windows (community-shaders#1989) * fix(UI): input spam after alt-tab (community-shaders#1993) * fix(sky sync): early return for invalid cells (community-shaders#1991) Co-authored-by: SkrubbySkrubInAShrub <skrubbyskrubinashrub@gmail.com> Co-authored-by: jiayev <l936249247@hotmail.com> * fix(sky sync): remove undeclared variable (community-shaders#1994) * refactor(pbr): clear up semantics (community-shaders#1995) * fix(UI): scale layout values for high-DPI (community-shaders#1987) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * fix(water): hdr water taa blend (community-shaders#1988) * refactor(color): clarify gamma conversion functions (community-shaders#1996) * feat(ISL-editor): add light counters and fix filtering (community-shaders#1997) * fix(UI): DPI-aware window layouts (community-shaders#2000) * fix(weather-editor): save color palette window (community-shaders#2001) * refactor: centralize feature category names (community-shaders#2007) closes community-shaders#1265 Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> * chore: bump versions (community-shaders#2010) * fix(water): sample history mask from current mask (community-shaders#2011) * chore(wetness-effects): set default MaxPuddleWetness to 1.5 (community-shaders#1981) Co-authored-by: SkrubbySkrubInAShrub <skrubbyskrubinashrub@gmail.com> * feat(weather-editor): add free camera and play mode (community-shaders#2008) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * build: bump versions and reduce false positives (community-shaders#2013) * fix(VR): LLF cluster building and culling (community-shaders#2012) * build: update to VS 2026 (community-shaders#1990) * ci: fix preset in vs2022 mode (community-shaders#2015) * ci: remove v2022 from shader jobs (community-shaders#2016) * feat(upscaling): integrate Streamline Reflex controls (community-shaders#1958) * fix(unified-water): BSWaterShaderProperty.plane (community-shaders#1998) --------- Co-authored-by: Skrubby Skrub In A Shrub <87662196+SkrubbySkrubInAShrub@users.noreply.github.com> Co-authored-by: SkrubbySkrubInAShrub <skrubbyskrubinashrub@gmail.com> Co-authored-by: doodlum <15017472+doodlum@users.noreply.github.com> Co-authored-by: jiayev <l936249247@hotmail.com> Co-authored-by: Dlizzio <77717521+Dlizzio@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Alan Tse <alandtse@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Bruce <44987693+brucenguyen@users.noreply.github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: Dawntic <197450198+Dawntic@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Alan Tse <alandtse@gmail.com> Co-authored-by: Vanni Giachin <vanni.giachin@qlik.com> Co-authored-by: zxcvbn <66063766+zndxcvbn@users.noreply.github.com> Co-authored-by: ParticleTroned <248299730+ParticleTroned@users.noreply.github.com> Co-authored-by: soda <130315225+soda3000@users.noreply.github.com> Co-authored-by: YtzyFvra <59631290+YtzyFvra@users.noreply.github.com> Co-authored-by: LukeFrankio <lorenzogrutzmann@gmail.com> Co-authored-by: LukeFrankio <loren@example.com> Co-authored-by: jturnley <32892261+jturnley@users.noreply.github.com> Co-authored-by: jturnley <jturnley@users.noreply.github.com> Co-authored-by: Igor Alan Albuquerque de Sousa <50077829+IgorAlanAlbuquerque@users.noreply.github.com> Co-authored-by: Matt Van Horn <mvanhorn@users.noreply.github.com> Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
(cherry picked from commit 4f1df36)
This pull request refactors and extends the environment and sky lighting system, focusing on improving the integration of image-based lighting (IBL), directional ambient lighting color (DALC), and spherical harmonics (SH) for both interiors and exteriors. The changes introduce new methods for separating and combining environment and sky lighting, add more flexible controls for IBL/DALC blending, and update shader parameters and logic for greater accuracy and configurability.
Lighting Model Refactoring and Extension:
ImageBasedLightingfor separating environment (GetEnvIBL) and sky (GetSkyIBL) lighting using spherical harmonics, and for computing their ratio for DALC/IBL matching (GetIBLRatio). Also added settings-aware color methods (GetEnvIBLColor,GetSkyIBLColor, and updatedGetIBLColor). [1] [2]DynamicCubemaps.hlsli) to use the new ambient SH projection (SharedData::GetAmbient), and updated the logic for combining DALC and IBL, supporting new modes for blending and normalization. [1] [2] [3] [4]Shader Parameter and Data Structure Updates:
SharedData::IBLSettingsfor separate environment and sky IBL scales and saturations, DALC blending mode, and padding.AmbientSHR,AmbientSHG,AmbientSHB) and a newGetAmbientmethod toSharedDatafor projecting ambient color using spherical harmonics. [1] [2]SharedData.hlslito support ambient SH projection.[1] [2] [3] [4] [5]
Summary by CodeRabbit
New Features
Improvements