perf(ssgi): optimize #1499
Conversation
WalkthroughRemoves the AmbientComposite compute shader and its Deferred pipeline usage; consolidates SSGI sampling and VR eye‑blending into DeferredCompositeCS; makes directional ambient unconditional across multiple shaders; exposes PS_OUTPUT.Albedo unconditionally; raises default SSGI strength; removes Deferred ambient API/fields; and adds Skylighting::applySkylighting. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant G as G-Buffer
participant S as SSGI Textures
participant D as DeferredCompositeCS
participant O as Output RTs
Note over G,D: New flow (AmbientCompositeCS removed)
G->>D: Albedo, Normal, Depth, Masks, Specular...
S->>D: AO, IL (via SampleSSGI)
rect rgb(230,245,255)
Note right of D: If VR: compute per-eye UVs, sample other-eye, blend AO/IL
end
D->>D: Build linDiffuseColor, apply directional ambient, apply Skylighting::applySkylighting, apply AO/IL, integrate specular
D->>O: Write final color (diffuse + specular + irradiance)
sequenceDiagram
autonumber
participant G as G-Buffer
participant A as AmbientCompositeCS
participant D as DeferredCompositeCS
participant O as Output RTs
Note over G,D: Old flow (for comparison)
G->>A: Albedo, Normal, Depth...
A->>A: Combine ambient/skylight/SSGI/IBL
A-->>D: Ambient result (texture)
G->>D: G-Buffer inputs
D->>D: Combine ambient + lighting
D->>O: Write final color
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used📓 Path-based instructions (1)**/*.{cpp,cxx,cc,c,h,hpp,hxx,hlsl,hlsli,fx,fxh,py}📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
🧠 Learnings (3)📓 Common learnings📚 Learning: 2025-08-03T18:37:19.690ZApplied to files:
📚 Learning: 2025-08-17T18:37:35.839ZApplied to files:
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
🔇 Additional comments (14)
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.
|
✅ A pre-release build is available for this PR: |
Automated formatting by clang-format, prettier, and other hooks. See https://pre-commit.ci for details.
Automated formatting by clang-format, prettier, and other hooks. See https://pre-commit.ci for details.
There was a problem hiding this comment.
Actionable comments posted: 6
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
package/Shaders/Lighting.hlsl (1)
2753-2759: Critical: deferred+SSGI — hair ambient mismatch (fix required)DeferredCompositeCS subtracts directionalAmbientColor and re-adds it under SSGI (package/Shaders/DeferredCompositeCS.hlsl lines ~133–152). Lighting.hlsl currently skips adding directionalAmbientColor for HAIR+CS_HAIR when SharedData::hairSpecularSettings.Enabled is true (package/Shaders/Lighting.hlsl lines 2753–2759); with SSGI enabled that subtraction will remove ambient that wasn't added, causing underlit hair. Ensure the G-buffer always contains directionalAmbientColor for hair in DEFERRED/SSGI builds or make the DeferredCompositeCS subtraction follow the same hair/hairSpecularSettings condition.
src/Deferred.cpp (1)
442-458: Always bind DepthTexture; current conditional can pass null and break position/motion vectors.
DepthTextureis read unconditionally in the shader. If neither VR nor dynamic cubemaps are enabled, slot t4 becomes null.Apply this diff:
- dynamicCubemaps.loaded || REL::Module::IsVR() ? (terrainBlending.loaded ? terrainBlending.blendedDepthTexture16->srv.get() : depth.depthSRV) : nullptr, + (terrainBlending.loaded ? terrainBlending.blendedDepthTexture16->srv.get() : depth.depthSRV),
🧹 Nitpick comments (4)
src/Features/ScreenSpaceGI.h (1)
144-153: Potential ring‑buffer mismatch: texGiSpecular uses AO index.
texGiSpecular[outputAoIdx]may need to track IL’s ring (outputIlIdx) like Y/CoCg. If specular GI is double‑buffered with IL, this can read the wrong frame.If it should align with IL, apply:
- texGiSpecular[outputAoIdx]->srv.get()) : + texGiSpecular[outputIlIdx]->srv.get()) :If specular intentionally follows AO, add a brief comment explaining the rationale to avoid future regressions.
package/Shaders/Lighting.hlsl (2)
3355-3356: Potential issue with stochastic blend calculationThe stochastic blend logic has been simplified but the removed line
stochasticBlend = lerp(stochasticBlend, 0.1, blendFactorTerrain)might have been providing important smoothing. Without this lerp, the blend could be too harsh (binary 0 or 1 based on noise threshold).Consider whether the removed lerp operation was providing necessary blend smoothing. The current binary decision might cause visible transitions at terrain blend boundaries.
float stochasticBlend = (screenNoise * screenNoise) < blendFactorTerrain ? 1.0 : 0.0; +// Consider adding back smoothing if harsh transitions are visible: +// stochasticBlend = lerp(stochasticBlend, 0.1, blendFactorTerrain);
2742-2742: Performance optimization: skylighting multiplicationThe change from indirect gamma conversions to direct multiplication with
Color::LinearToGamma(skylightingDiffuse)should provide a measurable performance improvement in the ambient lighting calculation path, especially for interior scenes.Consider adding a comment explaining why gamma-space multiplication is appropriate here:
- directionalAmbientColor *= Color::LinearToGamma(skylightingDiffuse); + // Multiply in gamma space for correct perceptual blending with skylighting + directionalAmbientColor *= Color::LinearToGamma(skylightingDiffuse);package/Shaders/RunGrass.hlsl (1)
459-462: Complex-grass heuristic widened (0.02 → 0.03); verify visual/perf impact; consider sqrt-free check.The looser epsilon will classify more assets as “complex” (extra normal/spec work). Confirm perf on heavy grass scenes. Optionally avoid
length()’s sqrt:- float3 complexTest = TexBaseSampler.Load(int3(0, int(y) - 1, 0)).xyz * 2.0 - 1.0; - float complexLength = length(complexTest); - bool complex = abs(complexLength - 1.0) < 0.03; + float3 complexTest = TexBaseSampler.Load(int3(0, int(y) - 1, 0)).xyz * 2.0 - 1.0; + float len2 = dot(complexTest, complexTest); + bool complex = abs(len2 - 1.0) < 0.06; // ~2*0.03 to match prior behavior without sqrtIf you prefer to keep the original
length()path, at least gate the new 0.03 via a tuning define to ease A/B testing.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (9)
package/Shaders/AmbientCompositeCS.hlsl(0 hunks)package/Shaders/DeferredCompositeCS.hlsl(2 hunks)package/Shaders/DistantTree.hlsl(0 hunks)package/Shaders/Effect.hlsl(1 hunks)package/Shaders/Lighting.hlsl(4 hunks)package/Shaders/RunGrass.hlsl(3 hunks)src/Deferred.cpp(1 hunks)src/Deferred.h(1 hunks)src/Features/ScreenSpaceGI.h(1 hunks)
💤 Files with no reviewable changes (2)
- package/Shaders/AmbientCompositeCS.hlsl
- package/Shaders/DistantTree.hlsl
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{cpp,cxx,cc,c,h,hpp,hxx,hlsl,hlsli,fx,fxh,py}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Do not include TODO/FIXME placeholders; provide complete, working solutions
Files:
src/Features/ScreenSpaceGI.hpackage/Shaders/Effect.hlslsrc/Deferred.cpppackage/Shaders/Lighting.hlslpackage/Shaders/DeferredCompositeCS.hlslpackage/Shaders/RunGrass.hlslsrc/Deferred.h
src/**/*.{cpp,cxx,cc,h,hpp,hxx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
src/**/*.{cpp,cxx,cc,h,hpp,hxx}: Ensure SE/AE/VR runtime compatibility; use runtime detection patterns (e.g., REL::RelocateMember())
Include robust error handling and resource management with graceful degradation in the plugin code
Files:
src/Features/ScreenSpaceGI.hsrc/Deferred.cppsrc/Deferred.h
🧠 Learnings (2)
📓 Common learnings
Learnt from: alandtse
PR: doodlum/skyrim-community-shaders#0
File: :0-0
Timestamp: 2025-07-05T05:20:45.823Z
Learning: In the skyrim-community-shaders repository, file deletion error handling improvements that replace existence checks and try-catch blocks with std::filesystem::remove error-code-based approaches are considered bug fixes rather than refactoring, as they address inadequate error handling and misleading log messages.
Learnt from: jiayev
PR: doodlum/skyrim-community-shaders#0
File: :0-0
Timestamp: 2025-08-03T18:37:19.690Z
Learning: ISReflectionsRayTracing.hlsl and ISWorldMap.hlsl in the skyrim-community-shaders repository are image-space post-processing shaders that perform color sampling and blending operations that need proper linear color space handling for the linear lighting system. ISReflectionsRayTracing handles screen-space reflections and should use conditional Color::IrradianceToLinear/Gamma conversions similar to ISCompositeLensFlareVolumetricLighting.hlsl. ISWorldMap performs 7x7 color accumulation that should be done in linear space similar to the pattern used in ISSAOComposite.hlsl.
📚 Learning: 2025-08-03T18:37:19.690Z
Learnt from: jiayev
PR: doodlum/skyrim-community-shaders#0
File: :0-0
Timestamp: 2025-08-03T18:37:19.690Z
Learning: ISReflectionsRayTracing.hlsl and ISWorldMap.hlsl in the skyrim-community-shaders repository are image-space post-processing shaders that perform color sampling and blending operations that need proper linear color space handling for the linear lighting system. ISReflectionsRayTracing handles screen-space reflections and should use conditional Color::IrradianceToLinear/Gamma conversions similar to ISCompositeLensFlareVolumetricLighting.hlsl. ISWorldMap performs 7x7 color accumulation that should be done in linear space similar to the pattern used in ISSAOComposite.hlsl.
Applied to files:
package/Shaders/Lighting.hlslpackage/Shaders/DeferredCompositeCS.hlslpackage/Shaders/RunGrass.hlsl
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Validate shader compilation (VR, .github/configs/shader-validation-vr.yaml)
- GitHub Check: Validate shader compilation (Flatrim, .github/configs/shader-validation.yaml)
- GitHub Check: Build plugin and addons
🔇 Additional comments (7)
src/Features/ScreenSpaceGI.h (1)
78-78: Default GI strength bumped to 1.5 — verify visual balance and config migration.
- Confirm deferred composite + tonemapper won’t over‑brighten high‑albedo scenes — shaders scale radiance by GIStrength (see features/Screen Space GI/Shaders/ScreenSpaceGI/radianceDisocc.cs.hlsl:
radiance = Color::GammaToLinear(... .rgb * GIStrength);) — verify later-stage ordering/clamping.- Ensure existing users’ saved configs aren’t silently overridden — apply 1.5 only when no prior value exists or add a settings-version gate; repo search did not locate Load/Save handling for GIStrength, so manual verification required.
package/Shaders/Effect.hlsl (1)
862-862: Use pre-light baseColor for psout.Albedo
- Replace
psout.Albedo = float4(psout.Diffuse.xyz, finalColor.w);
with
psout.Albedo = float4(baseColor.xyz, finalColor.w);
(or, if your composite/SSGI passes expect linear-space albedo,
psout.Albedo = float4(Color::GammaToLinear(baseColor.xyz), finalColor.w);)- No GammaToLinear/LinearToGamma calls were found around Albedo sampling in composite/SSGI shaders—verify those passes expect linear-space albedo.
package/Shaders/Lighting.hlsl (3)
2742-2742: LGTM! More efficient ambient color handlingDirectly multiplying by the gamma-corrected skylighting value here eliminates the unnecessary gamma/linear conversion roundtrip that was likely present before. This is a good optimization for the interior lighting path.
3349-3351: LGTM! Consistent YCoCg encoding for ambient dataConverting directionalAmbientColor to YCoCg and storing only the Y component in Masks.z is a clever optimization. This provides consistent ambient data encoding regardless of SSS/SKIN state.
3293-3296: Verify wetness normal update timing
- screenSpaceNormal is computed from worldNormal at package/Shaders/Lighting.hlsl:2089 and packed/written to psout.ScreenSpaceNormals at 3257–3260.
- wetnessNormal is initialized at 2220 and reoriented at 2295; screenSpaceNormal is overwritten from wetnessNormal at 3294 and then encoded into psout.NormalGlossiness at 3300–3303.
Confirm whether ScreenSpaceNormals are expected to include wetness; if so, move or duplicate the FrameBuffer::WorldToView(wetnessNormal)+packing/clamp earlier so both outputs use the wetness normal.src/Deferred.h (1)
33-33: API cleanup looks good.Getter remains; ordering only. No concerns.
package/Shaders/DeferredCompositeCS.hlsl (1)
161-167: Confirm SpecularTexture is linear before adding to linDiffuseColorcolor = linDiffuseColor + specularColor; assumes SpecularTexture is linear (R11G11B10_FLOAT). Verify the code that writes SpecularTexture; if it is gamma-encoded, convert to linear here before the add.
Location: package/Shaders/DeferredCompositeCS.hlsl lines 161-167
Suggested (if needed):
float3 specularColor = SpecularTexture[dispatchID.xy];
// if gamma-encoded:
specularColor = GammaToLinear(specularColor);
float3 color = linDiffuseColor + specularColor;
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Automated formatting by clang-format, prettier, and other hooks. See https://pre-commit.ci for details.
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
src/Deferred.cpp (2)
160-180: Dead code: descriptors prepared but no resource is created/used.This block builds descs, then exits without Create* calls or any binding. It’s either an accidental leftover or an incomplete change.
Options:
- Remove the block entirely if not needed, or
- Wire it to SetupRenderTarget(...) for the intended target.
Minimal cleanup:
- { - D3D11_TEXTURE2D_DESC texDesc; - auto mainTex = renderer->GetRuntimeData().renderTargets[RE::RENDER_TARGETS::kMAIN]; - mainTex.texture->GetDesc(&texDesc); - texDesc.Format = DXGI_FORMAT_R11G11B10_FLOAT; - texDesc.BindFlags = D3D11_BIND_RENDER_TARGET | D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_UNORDERED_ACCESS; - D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc = { .Format = texDesc.Format, .ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D, .Texture2D = { .MostDetailedMip = 0, .MipLevels = 1 } }; - D3D11_UNORDERED_ACCESS_VIEW_DESC uavDesc = { .Format = texDesc.Format, .ViewDimension = D3D11_UAV_DIMENSION_TEXTURE2D, .Texture2D = { .MipSlice = 0 } }; - } + // removed: unused descriptors with no resource creation
193-209: Critical: COM leak — PSGetConstantBuffers overwrites buffers[1] and returned interfaces are never Released (src/Deferred.cpp:193-209)
- PSGetConstantBuffers increments the returned interfaces' reference counts; the second call (PSGetConstantBuffers(12, 1, buffers + 1)) overwrites buffers[1], leaking the original slot-1 pointer — release all returned buffers after use and avoid overwriting without saving the original. (learn.microsoft.com)
- ID3D11Buffer* buffers[3]; - context->PSGetConstantBuffers(0, 3, buffers); - context->PSGetConstantBuffers(12, 1, buffers + 1); + ID3D11Buffer* buffers[3]{}; + context->PSGetConstantBuffers(0, 3, buffers); + ID3D11Buffer* psCB1_orig = buffers[1]; + context->PSGetConstantBuffers(12, 1, buffers + 1); @@ - std::fill(buffers, buffers + ARRAYSIZE(buffers), nullptr); - context->CSSetConstantBuffers(0, 3, buffers); + // Release COM refs acquired via PSGetConstantBuffers + for (UINT i = 0; i < ARRAYSIZE(buffers); ++i) { + if (buffers[i]) { buffers[i]->Release(); buffers[i] = nullptr; } + } + if (psCB1_orig) { psCB1_orig->Release(); psCB1_orig = nullptr; } + context->CSSetConstantBuffers(0, 3, buffers);package/Shaders/DeferredCompositeCS.hlsl (1)
213-218: Repeat the OOB clamp for specular VR path.Same issue as the diffuse path.
Apply:
- uint2 pixCoord2 = (uint2)(uv2.xy / SharedData::BufferDim.zw - 0.5); + float2 pix2 = uv2.xy * SharedData::BufferDim.xy - 0.5; + uint2 pixCoord2 = (uint2) clamp(pix2, 0.0, SharedData::BufferDim.xy - 1.0);
🧹 Nitpick comments (1)
package/Shaders/DeferredCompositeCS.hlsl (1)
42-49: SSGI sampling fix looks good.
.x/.xyaccessors added; conversions are coherent. Consider clamping AO to [0,1] to avoid numeric drift.Optional:
- ao = 1 - SsgiAoTexture[pixCoord].x; + ao = saturate(1 - SsgiAoTexture[pixCoord].x);
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
package/Shaders/DeferredCompositeCS.hlsl(2 hunks)src/Deferred.cpp(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{cpp,cxx,cc,c,h,hpp,hxx,hlsl,hlsli,fx,fxh,py}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Do not include TODO/FIXME placeholders; provide complete, working solutions
Files:
package/Shaders/DeferredCompositeCS.hlslsrc/Deferred.cpp
src/**/*.{cpp,cxx,cc,h,hpp,hxx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
src/**/*.{cpp,cxx,cc,h,hpp,hxx}: Ensure SE/AE/VR runtime compatibility; use runtime detection patterns (e.g., REL::RelocateMember())
Include robust error handling and resource management with graceful degradation in the plugin code
Files:
src/Deferred.cpp
🧠 Learnings (3)
📓 Common learnings
Learnt from: alandtse
PR: doodlum/skyrim-community-shaders#0
File: :0-0
Timestamp: 2025-07-05T05:20:45.823Z
Learning: In the skyrim-community-shaders repository, file deletion error handling improvements that replace existence checks and try-catch blocks with std::filesystem::remove error-code-based approaches are considered bug fixes rather than refactoring, as they address inadequate error handling and misleading log messages.
📚 Learning: 2025-08-03T18:37:19.690Z
Learnt from: jiayev
PR: doodlum/skyrim-community-shaders#0
File: :0-0
Timestamp: 2025-08-03T18:37:19.690Z
Learning: ISReflectionsRayTracing.hlsl and ISWorldMap.hlsl in the skyrim-community-shaders repository are image-space post-processing shaders that perform color sampling and blending operations that need proper linear color space handling for the linear lighting system. ISReflectionsRayTracing handles screen-space reflections and should use conditional Color::IrradianceToLinear/Gamma conversions similar to ISCompositeLensFlareVolumetricLighting.hlsl. ISWorldMap performs 7x7 color accumulation that should be done in linear space similar to the pattern used in ISSAOComposite.hlsl.
Applied to files:
package/Shaders/DeferredCompositeCS.hlsl
📚 Learning: 2025-08-17T18:37:35.839Z
Learnt from: CR
PR: doodlum/skyrim-community-shaders#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-17T18:37:35.839Z
Learning: Applies to features/*/Shaders/**/*.{hlsl,hlsli,fx,fxh} : Avoid GPU register/buffer conflicts in HLSL; verify register usage (e.g., with hlslkit buffer scanning)
Applied to files:
package/Shaders/DeferredCompositeCS.hlslsrc/Deferred.cpp
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Validate shader compilation (VR, .github/configs/shader-validation-vr.yaml)
- GitHub Check: Validate shader compilation (Flatrim, .github/configs/shader-validation.yaml)
- GitHub Check: Build plugin and addons
🔇 Additional comments (6)
package/Shaders/DeferredCompositeCS.hlsl (4)
10-14: Typed resource mismatch for MasksTexture (FLOAT RT vs UNORM SRV).The RT is switching to R11G11B10_FLOAT; keep the shader typed as
float3. Usingunorm float3will cause a typed UAV/SRV mismatch at runtime.Apply:
-Texture2D<unorm float3> MasksTexture : register(t3); +Texture2D<float3> MasksTexture : register(t3);#!/bin/bash rg -nP 'Texture2D<\s*unorm\s*float3\s*>\s*MasksTexture|register\\(t3\\)' package/Shaders -C2
159-162: Final color composition is coherent.Adds specular in linear and converts once to gamma later; good.
110-117: VR other-eye coordinate can go OOB; clamp pixCoord2.Unclamped
pixCoord2risks out-of-bounds loads on all SSGI textures.Apply:
- uint2 pixCoord2 = (uint2)(uv2.xy / SharedData::BufferDim.zw - 0.5); + float2 pix2 = uv2.xy * SharedData::BufferDim.xy - 0.5; + uint2 pixCoord2 = (uint2) clamp(pix2, 0.0, SharedData::BufferDim.xy - 1.0);
133-158: Do ambient/diffuse math in linear space to avoid artifacts.Current code mixes gamma-space
diffuseColor/albedowith linear operations (division, subtraction, scaling). Move the whole block to linear.Apply:
- float3 directionalAmbientColor = max(0, mul(SharedData::DirectionalAmbient, float4(normalWS, 1.0))); - directionalAmbientColor = Color::RGBToYCoCg(directionalAmbientColor); - directionalAmbientColor.x = MasksTexture[dispatchID.xy].z; - directionalAmbientColor = Color::YCoCgToRGB(directionalAmbientColor); - directionalAmbientColor = max(0, directionalAmbientColor); - directionalAmbientColor *= albedo; - float maxScale = 1.0; - if (directionalAmbientColor.x > 0.0) - maxScale = min(maxScale, diffuseColor.x / directionalAmbientColor.x); - if (directionalAmbientColor.y > 0.0) - maxScale = min(maxScale, diffuseColor.y / directionalAmbientColor.y); - if (directionalAmbientColor.z > 0.0) - maxScale = min(maxScale, diffuseColor.z / directionalAmbientColor.z); - directionalAmbientColor *= maxScale; - diffuseColor = diffuseColor - directionalAmbientColor; - diffuseColor += Color::LinearToGamma(Color::GammaToLinear(directionalAmbientColor) * ssgiAo); - linDiffuseColor = Color::GammaToLinear(diffuseColor); + float3 linDirectionalAmbient = max(0, mul(SharedData::DirectionalAmbient, float4(normalWS, 1.0))); + linDirectionalAmbient = Color::RGBToYCoCg(linDirectionalAmbient); + linDirectionalAmbient.x = MasksTexture[dispatchID.xy].z; + linDirectionalAmbient = max(0, Color::YCoCgToRGB(linDirectionalAmbient)); + float3 albedoLin = Color::GammaToLinear(albedo); + linDirectionalAmbient *= albedoLin; + float maxScale = 1.0; + if (linDirectionalAmbient.x > 0.0) + maxScale = min(maxScale, linDiffuseColor.x / linDirectionalAmbient.x); + if (linDirectionalAmbient.y > 0.0) + maxScale = min(maxScale, linDiffuseColor.y / linDirectionalAmbient.y); + if (linDirectionalAmbient.z > 0.0) + maxScale = min(maxScale, linDiffuseColor.z / linDirectionalAmbient.z); + linDirectionalAmbient *= maxScale; + linDiffuseColor = max(0, linDiffuseColor - linDirectionalAmbient); + linDiffuseColor += linDirectionalAmbient * ssgiAo; @@ - linDiffuseColor *= lerp(1.0, ssgiAo, 0.5); - linDiffuseColor += ssgiIl * Color::GammaToLinear(albedo); + linDiffuseColor *= lerp(1.0, ssgiAo, 0.5); + linDiffuseColor += ssgiIl * albedoLin;src/Deferred.cpp (2)
442-458: Runtime hazard: masks.SRV may be null when bound as SRV[3].package/Shaders/DeferredCompositeCS.hlsl declares MasksTexture : register(t3) and reads MasksTexture[dispatchID.xy].z (lines ~13,136); src/Deferred.cpp binds masks.SRV into SRVs[3] (lines 442–458). If the MASKS render target wasn't created earlier, masks.SRV will be null and the bind will fault. Ensure SetupResources creates the MASKS RT (or that the SetupResources fix landed); otherwise assert/guard and skip binding when masks.SRV is null.
109-109: Incorrect: HLSL declaration is in the shader, not in C++
- MasksTexture is declared in package/Shaders/DeferredCompositeCS.hlsl (line 13); src/Deferred.cpp does not exist in this repo.
- No occurrences found for masks.SRV, SetupRenderTarget(MASKS) or a 'MASKS' symbol — if a MASKS render target is required, state where it should be created.
Likely an incorrect or invalid review comment.
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/Deferred.cpp (1)
442-458: Fix SRV register mismatch: C++ binds 15 SRVs but DeferredCompositeCS.hlsl declares only t0–t13.src/Deferred.cpp (lines 442–458) builds srvs[15]; the final entry (ibl.diffuseIBLTexture) would bind to t14, but DeferredCompositeCS.hlsl only registers t0..t13 (SsgiSpecularTexture). Add the missing t14 in the HLSL or remove/guard/reorder the extra C++ binding so SRV order is contiguous across DYNAMIC_CUBEMAPS/SKYLIGHTING/SSGI/IBL variants.
🧹 Nitpick comments (3)
src/Deferred.cpp (3)
160-180: Remove or complete this no-op texture/SRV/UAV descriptor block.Descriptors are prepared but never used to create resources. Either wire them into a resource creation path or remove to avoid confusion.
Apply this removal:
- { - D3D11_TEXTURE2D_DESC texDesc; - - auto mainTex = renderer->GetRuntimeData().renderTargets[RE::RENDER_TARGETS::kMAIN]; - mainTex.texture->GetDesc(&texDesc); - - texDesc.Format = DXGI_FORMAT_R11G11B10_FLOAT; - texDesc.BindFlags = D3D11_BIND_RENDER_TARGET | D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_UNORDERED_ACCESS; - - D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc = { - .Format = texDesc.Format, - .ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D, - .Texture2D = { .MostDetailedMip = 0, .MipLevels = 1 } - }; - D3D11_UNORDERED_ACCESS_VIEW_DESC uavDesc = { - .Format = texDesc.Format, - .ViewDimension = D3D11_UAV_DIMENSION_TEXTURE2D, - .Texture2D = { .MipSlice = 0 } - }; - }
482-486: Also clear CS constant buffer slot 13 (VR) during teardown.Slot 12 is cleared; if VR set slot 13 earlier, it remains bound. Clear both for hygiene/debug-layer silence.
Apply:
- ID3D11Buffer* buffers[1] = { nullptr }; - context->CSSetConstantBuffers(12, 1, buffers); + ID3D11Buffer* nullCBs[2] = { nullptr, nullptr }; + context->CSSetConstantBuffers(12, 2, nullCBs);
615-623: Consider releasing CopyShadowDataCS in ClearShaderCache.If shader hot-reload is expected, also release
copyShadowCSto avoid stale bytecode and potential leaks after device resets.Apply:
if (mainCompositeInteriorCS) { mainCompositeInteriorCS->Release(); mainCompositeInteriorCS = nullptr; } + if (copyShadowCS) { + copyShadowCS->Release(); + copyShadowCS = nullptr; + }
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/Deferred.cpp(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{cpp,cxx,cc,c,h,hpp,hxx,hlsl,hlsli,fx,fxh,py}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Do not include TODO/FIXME placeholders; provide complete, working solutions
Files:
src/Deferred.cpp
src/**/*.{cpp,cxx,cc,h,hpp,hxx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
src/**/*.{cpp,cxx,cc,h,hpp,hxx}: Ensure SE/AE/VR runtime compatibility; use runtime detection patterns (e.g., REL::RelocateMember())
Include robust error handling and resource management with graceful degradation in the plugin code
Files:
src/Deferred.cpp
🧠 Learnings (2)
📓 Common learnings
Learnt from: alandtse
PR: doodlum/skyrim-community-shaders#0
File: :0-0
Timestamp: 2025-07-05T05:20:45.823Z
Learning: In the skyrim-community-shaders repository, file deletion error handling improvements that replace existence checks and try-catch blocks with std::filesystem::remove error-code-based approaches are considered bug fixes rather than refactoring, as they address inadequate error handling and misleading log messages.
📚 Learning: 2025-08-17T18:37:35.839Z
Learnt from: CR
PR: doodlum/skyrim-community-shaders#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-17T18:37:35.839Z
Learning: Applies to features/*/Shaders/**/*.{hlsl,hlsli,fx,fxh} : Avoid GPU register/buffer conflicts in HLSL; verify register usage (e.g., with hlslkit buffer scanning)
Applied to files:
src/Deferred.cpp
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Validate shader compilation (VR, .github/configs/shader-validation-vr.yaml)
- GitHub Check: Build plugin and addons
- GitHub Check: Validate shader compilation (Flatrim, .github/configs/shader-validation.yaml)
🔇 Additional comments (1)
src/Deferred.cpp (1)
109-109: MASKS format switch requires matching shader SRV type (typed UAV/SRV mismatch).MASKS moved to DXGI_FORMAT_R11G11B10_FLOAT, but if DeferredCompositeCS.hlsl still declares
Texture2D<unorm float3> MasksTextureat t3, validation will fail (UNORM vs FLOAT). Update the shader tofloat3.Apply this HLSL diff:
-Texture2D<unorm float3> MasksTexture : register(t3); +Texture2D<float3> MasksTexture : register(t3);Run to verify:
#!/bin/bash set -euo pipefail file="$(fd -a DeferredCompositeCS.hlsl | head -n1)" echo "Shader: $file" rg -nP 'MasksTexture\s*:\s*register\s*\(\s*t3\s*\)' "$file" -n -C2 rg -nP '^\s*Texture2D<\s*(unorm\s+)?float3\s*>\s*MasksTexture\b' "$file" -n
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (6)
package/Shaders/RunGrass.hlsl (4)
461-462: Complex-material detection threshold loosened; confirm false-positive rate.Changing 0.02 → 0.03 increases “complex” classification. Validate this doesn’t spuriously route simple grass into the complex path on common textures.
You can histogram complexLength from a representative scene and check classification counts before/after.
735-737: Pass linear albedo into applySkylighting.Non‑PBR grass uses gamma albedo (baseColor*vertexColor). Convert to linear at the call site to match the function’s linear‑albedo requirement.
- Skylighting::applySkylighting(diffuseColor, directionalAmbientColor, skylightingDiffuse, albedo); + Skylighting::applySkylighting(diffuseColor, directionalAmbientColor, skylightingDiffuse, Color::GammaToLinear(albedo));
771-773: Compute YCoCg from linear ambient.Y (luma) should be derived from linear RGB; using gamma skews weights.
- psout.Masks = float4(0, 0, Color::RGBToYCoCg(directionalAmbientColor).x, 0); + psout.Masks = float4(0, 0, Color::RGBToYCoCg(Color::GammaToLinear(directionalAmbientColor)).x, 0);
918-923: Pass linear albedo into applySkylighting (interior PS path as well).Mirror the fix from the main grass path.
- Skylighting::applySkylighting(diffuseColor, directionalAmbientColor, skylightingDiffuse, albedo); + Skylighting::applySkylighting(diffuseColor, directionalAmbientColor, skylightingDiffuse, Color::GammaToLinear(albedo));package/Shaders/Lighting.hlsl (2)
3078-3091: Ensure applySkylighting receives linear albedo across all material paths.
- Non‑PBR: baseColor*vertexColor is gamma → convert to linear.
- TRUE_PBR and Hair (with CS_HAIR): indirect weights are already linear.
- float3 outputAlbedo = baseColor.xyz * vertexColor; + float3 outputAlbedo = baseColor.xyz * vertexColor; #if defined(TRUE_PBR) - outputAlbedo = indirectDiffuseLobeWeight; + outputAlbedo = indirectDiffuseLobeWeight; // already linear #endif #if defined(HAIR) && defined(CS_HAIR) if (SharedData::hairSpecularSettings.Enabled) { - outputAlbedo = indirectDiffuseLobeWeight; + outputAlbedo = indirectDiffuseLobeWeight; // already linear } #endif -# if defined(SKYLIGHTING) - Skylighting::applySkylighting(color.xyz, directionalAmbientColor, skylightingDiffuse, outputAlbedo); -# endif +# if defined(SKYLIGHTING) +# if defined(TRUE_PBR) || (defined(HAIR) && defined(CS_HAIR) && 1) + const float3 skylightAlbedoLinear = outputAlbedo; +# else + const float3 skylightAlbedoLinear = Color::GammaToLinear(outputAlbedo); +# endif + Skylighting::applySkylighting(color.xyz, directionalAmbientColor, skylightingDiffuse, skylightAlbedoLinear); +# endif
3339-3346: Derive mask Y from linear ambient.As with grass, compute YCoCg on linear RGB to avoid bias.
- psout.Masks = float4(saturate(baseColor.a), !(Permutation::ExtraShaderDescriptor & Permutation::ExtraFlags::IsBeastRace), Color::RGBToYCoCg(directionalAmbientColor).x, psout.Diffuse.w); + psout.Masks = float4(saturate(baseColor.a), !(Permutation::ExtraShaderDescriptor & Permutation::ExtraFlags::IsBeastRace), Color::RGBToYCoCg(Color::GammaToLinear(directionalAmbientColor)).x, psout.Diffuse.w); @@ - psout.Masks = float4(0, 0, Color::RGBToYCoCg(directionalAmbientColor).x, psout.Diffuse.w); + psout.Masks = float4(0, 0, Color::RGBToYCoCg(Color::GammaToLinear(directionalAmbientColor)).x, psout.Diffuse.w);
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
features/Skylighting/Shaders/Skylighting/Skylighting.hlsli(1 hunks)package/Shaders/Lighting.hlsl(6 hunks)package/Shaders/RunGrass.hlsl(5 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{cpp,cxx,cc,c,h,hpp,hxx,hlsl,hlsli,fx,fxh,py}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Do not include TODO/FIXME placeholders; provide complete, working solutions
Files:
features/Skylighting/Shaders/Skylighting/Skylighting.hlslipackage/Shaders/Lighting.hlslpackage/Shaders/RunGrass.hlsl
features/*/Shaders/**/*.{hlsl,hlsli,fx,fxh}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
features/*/Shaders/**/*.{hlsl,hlsli,fx,fxh}: Place all feature shaders under features/YourFeature/Shaders/
Avoid GPU register/buffer conflicts in HLSL; verify register usage (e.g., with hlslkit buffer scanning)
Files:
features/Skylighting/Shaders/Skylighting/Skylighting.hlsli
🧠 Learnings (2)
📓 Common learnings
Learnt from: alandtse
PR: doodlum/skyrim-community-shaders#0
File: :0-0
Timestamp: 2025-07-05T05:20:45.823Z
Learning: In the skyrim-community-shaders repository, file deletion error handling improvements that replace existence checks and try-catch blocks with std::filesystem::remove error-code-based approaches are considered bug fixes rather than refactoring, as they address inadequate error handling and misleading log messages.
Learnt from: jiayev
PR: doodlum/skyrim-community-shaders#0
File: :0-0
Timestamp: 2025-08-03T18:37:19.690Z
Learning: ISReflectionsRayTracing.hlsl and ISWorldMap.hlsl in the skyrim-community-shaders repository are image-space post-processing shaders that perform color sampling and blending operations that need proper linear color space handling for the linear lighting system. ISReflectionsRayTracing handles screen-space reflections and should use conditional Color::IrradianceToLinear/Gamma conversions similar to ISCompositeLensFlareVolumetricLighting.hlsl. ISWorldMap performs 7x7 color accumulation that should be done in linear space similar to the pattern used in ISSAOComposite.hlsl.
📚 Learning: 2025-08-03T18:37:19.690Z
Learnt from: jiayev
PR: doodlum/skyrim-community-shaders#0
File: :0-0
Timestamp: 2025-08-03T18:37:19.690Z
Learning: ISReflectionsRayTracing.hlsl and ISWorldMap.hlsl in the skyrim-community-shaders repository are image-space post-processing shaders that perform color sampling and blending operations that need proper linear color space handling for the linear lighting system. ISReflectionsRayTracing handles screen-space reflections and should use conditional Color::IrradianceToLinear/Gamma conversions similar to ISCompositeLensFlareVolumetricLighting.hlsl. ISWorldMap performs 7x7 color accumulation that should be done in linear space similar to the pattern used in ISSAOComposite.hlsl.
Applied to files:
features/Skylighting/Shaders/Skylighting/Skylighting.hlslipackage/Shaders/Lighting.hlslpackage/Shaders/RunGrass.hlsl
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Validate shader compilation (Flatrim, .github/configs/shader-validation.yaml)
- GitHub Check: Validate shader compilation (VR, .github/configs/shader-validation-vr.yaml)
- GitHub Check: Build plugin and addons
🔇 Additional comments (7)
package/Shaders/RunGrass.hlsl (3)
714-727: Skylight SH cosine-lobe integral looks correct.Dividing by PI and fade-out mixing are consistent with a cosine-weighted irradiance integral.
898-911: Skylight SH evaluation in non‑GRASS path: LGTM.The cosine‑lobe product and clamping mirror the main path.
932-934: Compute mask Y from linear ambient (duplicate of earlier suggestion).Same rationale as Lines 771–773.
- psout.Masks = float4(0, 0, Color::RGBToYCoCg(directionalAmbientColor).x, 0); + psout.Masks = float4(0, 0, Color::RGBToYCoCg(Color::GammaToLinear(directionalAmbientColor)).x, 0);package/Shaders/Lighting.hlsl (3)
2731-2735: Cosine-lobe SH integral and normalization: good.Using FuncProductIntegral(E, cosineLobe)/PI with fade-out and visibility mixing is correct.
3285-3287: Wetness normal export: LGTM.Using wetnessNormal for GBuffer normal when wetness is active matches expected visual behavior.
3345-3347: Stochastic alpha flag export: LGTM.Binary dither via screenNoise<alpha into NormalGlossiness.w is consistent and cheap.
features/Skylighting/Shaders/Skylighting/Skylighting.hlsli (1)
38-56: Do skylighting’s albedo/modulation and replace-injection in linear space (fix color-space bias).Multiply and clamp ambient in linear space; treat albedo as linear; re-encode outputs.
Apply this diff:
- void applySkylighting(inout float3 diffuseColor, inout float3 directionalAmbientColor, float skylightingDiffuse, float3 albedo) + // albedo must be linear (call sites: pass linear albedo) + void applySkylighting(inout float3 diffuseColor, inout float3 directionalAmbientColor, float skylightingDiffuse, float3 albedo) { - directionalAmbientColor *= albedo; - - float maxScale = 1.0; - if (directionalAmbientColor.x > 0.0) - maxScale = min(maxScale, diffuseColor.x / directionalAmbientColor.x); - if (directionalAmbientColor.y > 0.0) - maxScale = min(maxScale, diffuseColor.y / directionalAmbientColor.y); - if (directionalAmbientColor.z > 0.0) - maxScale = min(maxScale, diffuseColor.z / directionalAmbientColor.z); - directionalAmbientColor *= maxScale; - - diffuseColor = max(0.0, diffuseColor - directionalAmbientColor); - - directionalAmbientColor = Color::LinearToGamma(Color::GammaToLinear(directionalAmbientColor) * skylightingDiffuse); - - diffuseColor += directionalAmbientColor; + // Work in linear for energy‑correct math. + float3 diffuseLin = Color::GammaToLinear(max(0, diffuseColor)); + float3 ambLin = Color::GammaToLinear(max(0, directionalAmbientColor)); + ambLin *= saturate(albedo); + + // Clamp so subtraction cannot go negative per channel. + float maxScale = 1.0; + if (ambLin.x > 0.0) maxScale = min(maxScale, diffuseLin.x / ambLin.x); + if (ambLin.y > 0.0) maxScale = min(maxScale, diffuseLin.y / ambLin.y); + if (ambLin.z > 0.0) maxScale = min(maxScale, diffuseLin.z / ambLin.z); + ambLin *= maxScale; + + // Replace ambient with skylight‑modulated ambient (linear). + diffuseLin = max(0.0, diffuseLin - ambLin); + ambLin *= skylightingDiffuse; + + // Re-encode outputs. + directionalAmbientColor = Color::LinearToGamma(ambLin); + diffuseColor = Color::LinearToGamma(diffuseLin + ambLin); }Could not locate features/Skylighting/Shaders/Skylighting/Skylighting.hlsli in the repository during automated checks; unable to verify register(t50/t51) collisions. Run the provided rg scan locally or provide the file path so I can re-run verification.
* chore(ui): update discord banner (community-shaders#1493) * fix: use proper filename settingsuser.json (community-shaders#1491) * chore(upscaling): increase fsr sharpness * chore: rename d3d12interop to d3d12SwapChainActive (community-shaders#1494) * feat(llf): remove particle lights (community-shaders#1495) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * feat(llf): move llf to core (community-shaders#1496) * fix: remove water clamp (community-shaders#1497) * fix(upscaling): more upscaling fixes (community-shaders#1498) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * fix: fix some internal errors when debugging (community-shaders#1500) * fix(ui): fix save settings conflicts & welcome screen (community-shaders#1501) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * fix(ui): add constraints for discord banner size (community-shaders#1463) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: doodlum <15017472+doodlum@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fix(VR): fix exiting menu using controllers (community-shaders#1502) * build: fix warnings (community-shaders#1505) * feat(UI): allow tooltips for disabled elements (community-shaders#1503) * feat(upscaling): add downscale percentages (community-shaders#1506) * perf(ssgi): optimize (community-shaders#1499) 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> * feat(ui): font size and perf overlay improvements (community-shaders#1511) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * chore: remove unused hooks (community-shaders#1510) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * fix: adjust IsInterior to consider kNoSky or kFixedDimensions flags (community-shaders#1512) * fix(hair): correct hair indirect normal, marschner by default (community-shaders#1515) Co-authored-by: doodlum <15017472+doodlum@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * chore: mostly revert ISHDR to 1.3.6 (community-shaders#1516) * chore(upscaling): simplify interop and upscale methods (community-shaders#1514) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * fix(hair): typo in code (community-shaders#1517) * feat(ibl): lerp sky ibl using skylighting (community-shaders#1519) * fix(sss): burley artifacts with effect blend (community-shaders#1518) * fix(upscaling): fix screenshots when upscaling enabled (community-shaders#1520) * fix(upscaling): fix mipbias sometimes being wrong (community-shaders#1521) * fix: fix compile error if snow shader on (community-shaders#1522) * chore(upscaling): revert fsr to typical settings (community-shaders#1523) * fix: fix minor ui issues (community-shaders#1524) * chore(grass collision): simpler grass collision (community-shaders#1525) * fix: update skylighting and version * fix(pbr): fix inconsistencies (community-shaders#1526) 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> * feat(upscaling): sharpening slider (community-shaders#1527) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * chore: bump versions * fix(ibl): add ibl to reflection normalization (community-shaders#1528) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * fix(hair): remove pbr lighting mult for hair (community-shaders#1531) * chore(upscaling): add back upscale multiplier (community-shaders#1532) * fix(upscaling): fix minor upscaling issues (community-shaders#1536) * chore: gamma space normalisation (community-shaders#1535) 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> * feat(grass collision): implement with texture and history (community-shaders#1539) 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> * chore(grass collision): less aggressive (community-shaders#1546) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * fix(skylighting): fix cell id casting (community-shaders#1544) * chore(emat): auto detect terrain parallax (community-shaders#1545) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * chore: update versions * feat(VR): enable upscaling (community-shaders#1507) * fix(terrain shadows): fix brightened lods (community-shaders#1547) * chore(upscaling): reduce ghosting near camera (community-shaders#1548) * fix: fix grass not animating (community-shaders#1549) Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fix(grass collision): fix non-standard timescales (community-shaders#1550) * build: deploy only updated files (community-shaders#1556) * feat: add Clear Shader Cache to Advanced (community-shaders#1555) * chore(featureissues): default collapse testing menu (community-shaders#1554) * fix(VR): use only supported shaders from cache (community-shaders#1553) Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * build: use gersemi cmake formatter (community-shaders#1557) * fix(terrain): vanilla diffuse in pbr terrain cell too bright due to wrong color space (community-shaders#1558) * docs: add new feature development template guide (community-shaders#1529) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * docs(UI): remove duplicate GPL license statement (community-shaders#1561) * feat: add renderdoc for debugging (community-shaders#1560) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: alandtse <7086117+alandtse@users.noreply.github.com> Co-authored-by: Alan Tse <alandtse@gmail.com> * fix(ui): welcome popup size issues (community-shaders#1573) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * chore(grass collision): minor tweaks (community-shaders#1568) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * fix(terrain helper): fix conflicting bit (community-shaders#1566) Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * feat(UI): separate theme settings, UI refactor, font support (community-shaders#1571) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * chore: bump versions * build: fix zipping aio (community-shaders#1579) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * fix(grass collision): clamp maximum depth of grass (community-shaders#1578) * feat(UI): enhance shader blocking (community-shaders#1564) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: alandtse <7086117+alandtse@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@gmail.com> * fix: remove duplicate buffer setup (community-shaders#1586) * feat: update shader compile elapsed time every second (community-shaders#1587) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * build: add cmake install commands (community-shaders#1372) * feat(perf-overlay): add size controls (community-shaders#1591) * fix(perf-overlay): fix infinite draw calls table height (community-shaders#1590) * refactor(perf-overlay): remove collapsible headers (community-shaders#1572) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * fix(perf-overlay): removed ImGuiTableFlags_ScrollX/Y for scroll bar issues (community-shaders#1594) * build: fix shader copying to relative paths (community-shaders#1603) * fix(ibl): apply ibl to cubemap normalisation for non deferred (community-shaders#1604) * fix(grass): use correct light direction (community-shaders#1602) * fix(welcome-popup): adjust font size & window spacing (community-shaders#1592) * feat(lod): add gamma sliders (community-shaders#1588) * build: correct CodeRabbit schema syntax (community-shaders#1608) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: alandtse <7086117+alandtse@users.noreply.github.com> * build: add compile-time validation of GPU buffers (community-shaders#1427) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: alandtse <7086117+alandtse@users.noreply.github.com> * ci: run shader validation on CMake and CI config changes (community-shaders#1606) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: alandtse <7086117+alandtse@users.noreply.github.com> * feat: procedural sun * limb darkening * another darkening * build(deps): remove orphaned Intel XeSS dependency (community-shaders#1611) Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> * fix: accumulate sunlight color in pixel shader output * fix(ui): enter key now behaves properly when first time popup is open (community-shaders#1615) * feat(ui): add tabs to advanced settings & PBR search (community-shaders#1599) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * build: add HLSL intellisense (community-shaders#1614) * refactor(UI): move light limit visualization into debug (community-shaders#1619) * refactor(ui): add settings for shader block hotkeys (community-shaders#1624) Co-authored-by: Bruce <44987693+brucenguyen@users.noreply.github.com> * fix(ui): anchor reset settings button position (community-shaders#1621) Co-authored-by: Giovanni Correia <Gistix@users.noreply.github.com> * fix(hair): use indirect normal for deferred marschner hair (community-shaders#1626) * build: fix Package-AIO-Manual for fresh pulls (community-shaders#1625) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * fix(snow): use world space vectors (community-shaders#1618) * feat(UI): add gaussian blur shader core files (community-shaders#1595) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * feat(ui): add test conditions button (community-shaders#1637) * fix(ui): blocked shader info overflow in Shader Debug tab (community-shaders#1632) * fix(upscaling): replace NIS with RCAS for DLSS (community-shaders#1620) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * fix(dynamic cubemaps): add a check for timeskip (community-shaders#1639) * refactor: restructure lighting (community-shaders#1633) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * feat(ui): add themes & fonts (community-shaders#1596) 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> * feat(water): add flowmap parallax (community-shaders#1636) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * fix cloud shadow setting saving --------- Co-authored-by: zxcvbn <66063766+zndxcvbn@users.noreply.github.com> Co-authored-by: davo0411 <davidkehoe0411@outlook.com> Co-authored-by: doodlum <15017472+doodlum@users.noreply.github.com> 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: Alan Tse <alandtse@users.noreply.github.com> Co-authored-by: soda <130315225+soda3000@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: ThePagi <32794457+ThePagi@users.noreply.github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: alandtse <7086117+alandtse@users.noreply.github.com> Co-authored-by: Alan Tse <alandtse@gmail.com> Co-authored-by: Yupeng Zhang <ArcEarth@outlook.com> Co-authored-by: kuplion <kuplion@hotmail.com> Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> Co-authored-by: Giovanni Correia <Gistix@users.noreply.github.com> Co-authored-by: Bruce <44987693+brucenguyen@users.noreply.github.com> Co-authored-by: Midona <106106405+midona-rhel@users.noreply.github.com>
Summary by CodeRabbit
New Features
Improvements
Performance
Chores