Skip to content

fix(IBL): glowing metals in shadow#2088

Draft
davo0411 wants to merge 1 commit into
community-shaders:devfrom
davo0411:glowing-pbr-metal-fix
Draft

fix(IBL): glowing metals in shadow#2088
davo0411 wants to merge 1 commit into
community-shaders:devfrom
davo0411:glowing-pbr-metal-fix

Conversation

@davo0411
Copy link
Copy Markdown
Collaborator

@davo0411 davo0411 commented Apr 10, 2026

adds a envspecular mult to the skylighting calculations with ibl. previously this was missing causing glowing metals.
SkyrimSE 2026-04-11 09-34-56_694
SkyrimSE 2026-04-11 09-34-15_211
SkyrimSE 2026-04-11 09-34-18_301

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Fixed inconsistent skylighting application to environment reflections in dynamic cubemap rendering across different IBL modes, ensuring uniform visual quality.

@davo0411 davo0411 requested review from Copilot and jiayev April 10, 2026 23:44
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 10, 2026

📝 Walkthrough

Walkthrough

This PR applies the computed skylightingSpecular factor to environment specular contributions in dynamic cubemap and deferred composite shaders. The changes are made in both DALCMode paths within the skylighting-enabled IBL pipeline to scale envSpecular values in finalIrradiance calculations.

Changes

Cohort / File(s) Summary
Dynamic Cubemap Specular Scaling
features/Dynamic Cubemaps/Shaders/DynamicCubemaps/DynamicCubemaps.hlsli
Applies skylightingSpecular factor to envSpecular in GetDynamicCubemapSpecularIrradiance() and GetDynamicCubemap() for both DALCMode 2 and ratio-based modes when SKYLIGHTING is defined.
Deferred Composite IBL Scaling
package/Shaders/DeferredCompositeCS.hlsl
Applies skylightingSpecular factor to envSpecular in SampleSSGISpecular() call path for both DALCMode 2 and ratio-based IBL branches within the IBL + DYNAMIC_CUBEMAPS + SKYLIGHTING configuration.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • jiayev
  • doodlum

Poem

🐰✨ The skylighting dances bright,
Kissing specular with prismatic light—
Cubemaps now glow with balanced might,
Environment and sky in harmony's sight! 🌟

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly addresses the main fix: applying envSpecular multiplier to skylighting calculations in IBL to prevent glowing metals in shadows.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

No actionable suggestions for changed features.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adjusts IBL + skylighting specular composition so the environment-specular contribution is attenuated by skylighting, preventing overly bright (“glowing”) metallic reflections in shadowed areas.

Changes:

  • Apply skylightingSpecular multiplier to envSpecular in the IBL path (in addition to skySpecular).
  • Mirror the same fix in both the deferred composite shader and the dynamic cubemap shader include to keep behavior consistent across paths.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
package/Shaders/DeferredCompositeCS.hlsl Multiplies IBL envSpecular by skylightingSpecular in both DALC mode 2 and ratio-based modes under SKYLIGHTING.
features/Dynamic Cubemaps/Shaders/DynamicCubemaps/DynamicCubemaps.hlsli Applies the same envSpecular *= skylightingSpecular correction in the dynamic cubemap IBL calculations (both relevant code paths).

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
features/Dynamic Cubemaps/Shaders/DynamicCubemaps/DynamicCubemaps.hlsli (1)

76-76: PR metadata follow-up: use a stricter Conventional Commit title + issue keyword.

Suggested title: fix(ibl): apply skylighting to env specular
If there’s a tracked bug, add: Closes #<issue_number> in the PR description.

As per coding guidelines, PRs should include Conventional Commit titles and issue references when applicable.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@features/Dynamic` Cubemaps/Shaders/DynamicCubemaps/DynamicCubemaps.hlsli at
line 76, Update the PR title to follow Conventional Commits by using a stricter
title like "fix(ibl): apply skylighting to env specular" (referencing the change
to envSpecular *= skylightingSpecular;) and, if this change addresses a tracked
bug, add "Closes #<issue_number>" to the PR description so the issue is
automatically linked and closed.
🤖 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/Dynamic` Cubemaps/Shaders/DynamicCubemaps/DynamicCubemaps.hlsli:
- Line 76: Update the PR title to follow Conventional Commits by using a
stricter title like "fix(ibl): apply skylighting to env specular" (referencing
the change to envSpecular *= skylightingSpecular;) and, if this change addresses
a tracked bug, add "Closes #<issue_number>" to the PR description so the issue
is automatically linked and closed.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: aae4340b-ffde-495e-9817-cdf5f05d9bcf

📥 Commits

Reviewing files that changed from the base of the PR and between f0a752f and 8c27071.

📒 Files selected for processing (2)
  • features/Dynamic Cubemaps/Shaders/DynamicCubemaps/DynamicCubemaps.hlsli
  • package/Shaders/DeferredCompositeCS.hlsl

@github-actions
Copy link
Copy Markdown

✅ A pre-release build is available for this PR:
Download

@davo0411 davo0411 marked this pull request as draft April 11, 2026 00:14
@alandtse
Copy link
Copy Markdown
Collaborator

Wow if we needed DRY this is definitely one of those parts.

@coderabbitai identify a minimal change to DRY this code in a maintainable way.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 11, 2026

Tip

For best results, initiate chat on the files or code changes.

The PR description images show:

  • Image 1: In‑game HDR scene without the CS menu. A dark wooden workbench with stacked metal ingots; HDR analysis overlay at top‑left and a luminance waveform at bottom‑right with notable high‑right peaks from specular highlights.
  • Image 2: Community Shaders menu open with Image Based Lighting v1.1.0 enabled. Sliders for Env/Sky IBL Scale and Saturation at 1.00. The scene speculars are more controlled and the waveform shows compressed peaks.
  • Image 3: Same menu with IBL disabled. Speculars brighten again; waveform shows stronger right‑side peaks.

@alandtse
Minimal, maintainable DRY suggestion

What’s duplicated

  • The SKYLIGHTING path multiplies both skySpecular and envSpecular by the same skylightingSpecular factor in 6 places: four in DynamicCubemaps.hlsli and two in DeferredCompositeCS.hlsl. (github.com)
  • Both files already include Skylighting/Skylighting.hlsli under SKYLIGHTING, which is the ideal place for a tiny utility. (github.com)

Minimal change

  • Add one small helper in Skylighting.hlsli and replace the 2‑line blocks with a single call.
  • Keep the existing INTERIOR branch in DeferredCompositeCS.hlsl exactly as‑is.
  • This doesn’t touch the non‑IBL fallback logic (which we’ve learned is intentionally weighted), only the IBL path.

Proposed code

  1. features/Skylighting/Shaders/Skylighting/Skylighting.hlsli
    Add near mixSpecular (outside PSHADER guard) inside namespace Skylighting:
// Utility: apply skylighting visibility uniformly to IBL specular terms.
void applySkylightingSpecular(inout float3 envSpecular, inout float3 skySpecular, float skylightingSpecular)
{
    envSpecular *= skylightingSpecular;
    skySpecular *= skylightingSpecular;
}
  1. features/Dynamic Cubemaps/Shaders/DynamicCubemaps/DynamicCubemaps.hlsli
    Replace each pair:
`#if` defined(SKYLIGHTING)
skySpecular *= skylightingSpecular;
envSpecular  *= skylightingSpecular;
`#endif`

with:

`#if` defined(SKYLIGHTING)
Skylighting::applySkylightingSpecular(envSpecular, skySpecular, skylightingSpecular);
`#endif`

(Do this in both DALCMode branches of GetDynamicCubemapSpecularIrradiance(...) and GetDynamicCubemap(...).) (github.com)

  1. package/Shaders/DeferredCompositeCS.hlsl
    Replace the SKYLIGHTING pair the same way, preserving the existing INTERIOR clause:
`#if` defined(SKYLIGHTING)
Skylighting::applySkylightingSpecular(envSpecular, skySpecular, skylightingSpecular);
`#elif` defined(INTERIOR)
skySpecular = 0;
`#endif`

(Apply in both branches where it appears.) (github.com)

Why this is minimal and safe

  • One new helper, six single‑line call sites. No behavior changes: it’s a straight refactor.
  • Lives in a header both files already include only when SKYLIGHTING is enabled, so it doesn’t affect other permutations.
  • Leaves the intentional non‑IBL skylighting weighting untouched per prior maintainer guidance from earlier PRs (noted in my learnings).

If you want, I can prep a tiny follow‑up PR with these edits.


🧠 Learnings used
Learnt from: jiayev
Repo: doodlum/skyrim-community-shaders PR: 1947
File: package/Shaders/DeferredCompositeCS.hlsl:234-243
Timestamp: 2026-03-14T08:35:42.651Z
Learning: In `package/Shaders/DeferredCompositeCS.hlsl` (doodlum/skyrim-community-shaders), the fallback non-IBL SKYLIGHTING specular path intentionally double-weights with `skylightingSpecular`: `dalcScaled` is computed as `IrradianceToGamma(IrradianceToLinear(directionalAmbientColorSpecular) * skylightingSpecular)`, and the final `finalIrradiance` is then `lerp(specularIrradiance, specularIrradianceReflections, skylightingSpecular)`. This is original engine logic preserved from before PR `#1947` and should not be flagged as a double-attenuation bug.

Learnt from: jiayev
Repo: doodlum/skyrim-community-shaders PR: 1947
File: features/Dynamic Cubemaps/Shaders/DynamicCubemaps/DynamicCubemaps.hlsli:107-115
Timestamp: 2026-03-14T08:35:02.326Z
Learning: In `features/Dynamic Cubemaps/Shaders/DynamicCubemaps/DynamicCubemaps.hlsli`, the pattern of scaling `directionalAmbientColorSpecular` by `skylightingSpecular` (via `dalcScaled`) before the final `lerp(specularIrradiance, specularIrradianceReflections, skylightingSpecular)` is intentional pre-existing behavior preserved from the original implementation. Do not flag this as double-attenuation; the combined attenuation is by design.

Learnt from: jiayev
Repo: doodlum/skyrim-community-shaders PR: 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.

Learnt from: Dlizzio
Repo: doodlum/skyrim-community-shaders PR: 1950
File: package/Shaders/Lighting.hlsl:2008-2012
Timestamp: 2026-03-07T00:53:21.267Z
Learning: In doodlum/skyrim-community-shaders PR `#1950`, the maintainer (Dlizzio) confirmed that per-axis normal reorientation for triplanar-projected normals/detail in package/Shaders/Lighting.hlsl is not required for their use case; the current approach intentionally mixes samples without axis-specific swizzle/sign correction.

Learnt from: Dlizzio
Repo: doodlum/skyrim-community-shaders PR: 1966
File: package/Shaders/ISVolumetricLightingGenerateCS.hlsl:0-0
Timestamp: 2026-03-11T08:05:10.801Z
Learning: In doodlum/skyrim-community-shaders, the `sqrt()` applied to `CloudShadows::GetCloudShadowMult()` in `package/Shaders/ISVolumetricLightingGenerateCS.hlsl` is intentional. The maintainer (Dlizzio) confirmed it is used to increase cloud shadow strength at harsh angles for volumetric lighting, and should not be removed or replaced with a direct linear multiply.

Learnt from: Dlizzio
Repo: doodlum/skyrim-community-shaders PR: 2000
File: src/WeatherEditor/EditorWindow.cpp:1271-1274
Timestamp: 2026-03-22T18:40:49.633Z
Learning: Repo: doodlum/skyrim-community-shaders — Maintainer preference (PR `#2000` on 2026-03-22): In src/WeatherEditor/EditorWindow.cpp within EditorWindow::RenderUI, keep `resetLayout = false;` at the end of the frame (after PaletteWindow::Draw). The reset is intentionally one-shot for windows rendered that frame; closed windows are allowed to reopen with their previous geometry. Do not move the clear later or broadcast resets to closed windows.

Learnt from: alandtse
Repo: doodlum/skyrim-community-shaders PR: 2084
File: src/ShaderCache.cpp:1646-1649
Timestamp: 2026-04-10T07:34:24.381Z
Learning: In `src/ShaderCache.cpp` (doodlum/skyrim-community-shaders PR `#2084`), `GetImagespaceShaderDescriptor` intentionally returns `false` for VR when a shader is not reverse-engineered. Returning `false` causes `ResolveImageSpaceDescriptor` to return `false`, which makes all callers (GetVertexShader, GetPixelShader, GetComputeShader, CompileShader) skip custom shader handling and defer to the vanilla shader. This is the correct pattern for un-RE'd imagespace shaders on VR — do not flag it as "skipping all custom VR handling" or suggest gating on HDR feature state.

Learnt from: alandtse
Repo: doodlum/skyrim-community-shaders PR: 1941
File: package/Shaders/Common/ShadowSampling.hlsli:160-163
Timestamp: 2026-04-03T01:48:34.867Z
Learning: In `package/Shaders/Common/ShadowSampling.hlsli` (doodlum/skyrim-community-shaders PR `#1941`), the directional shadow fade in `GetLightingShadow` is intentionally computed as `fadeStart = shadow.EndSplitDistances.y * (1.0 - FadeWindow)` where `FadeWindow = 0.1`. This anchors the fade to the last 10% of the absolute far-cascade distance (`EndSplitDistances.y`), not to the cascade span. The narrow window is deliberate so shadows dissolve only at the hard far-cutoff without prematurely fading across the whole cascade range. Do not suggest using `lerp(StartSplitDistances.y, EndSplitDistances.y, 1.0 - FadeWindow)` as a fix.

Learnt from: alandtse
Repo: doodlum/skyrim-community-shaders PR: 0
File: :0-0
Timestamp: 2025-06-24T07:17:36.604Z
Learning: When reviewing PRs, always clarify the scope if there are multiple related features or dependencies. WeatherPicker was a separate PR that was already merged, while this PR focuses specifically on WetnessEffects climate preset system enhancements.

Learnt from: Dlizzio
Repo: doodlum/skyrim-community-shaders PR: 2000
File: src/WeatherEditor/EditorWindow.cpp:1239-1244
Timestamp: 2026-03-22T18:32:22.461Z
Learning: In doodlum/skyrim-community-shaders (PR `#2000`, 2026-03-22), maintainer preference: keep the default browser width logic in src/WeatherEditor/EditorWindow.cpp within EditorWindow::RenderUI — browserWidth = min(availableWidth * 0.5f, 960.0f * Util::GetUIScale()) is applied unconditionally (before checking settings.showViewport) to preserve a consistent left-rail width on first-use/reset. Do not change this to fill full width when the viewport is hidden.

@alandtse
Copy link
Copy Markdown
Collaborator

@coderabbitai if we allow a slightly larger refactor, is there a better way to handle this then the helper you proposed? We want to support maintainability in a sensible way.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 11, 2026

Tip

For best results, initiate chat on the files or code changes.

The PR description images show:

  • PR description image 1: A dim interior scene with a wooden workbench and stacks of pale metal ingots. HDR Analysis (HDR10) readouts are at top‑left; a luminance waveform sits bottom‑right with distinct right‑side peaks from bright speculars.
  • PR description image 2: Same scene with the Community Shaders 1.4.11 panel open (Image Based Lighting v1.1.0 enabled). Sliders for Env/Sky IBL Scale/Saturation at 1.00. The image is darker with compressed waveform highlights, showing reduced blown speculars.
  • PR description image 3: Same panel but Enable IBL is off; speculars on the ingots are brighter again and the waveform shows stronger right‑side peaks.

@alandtse Great question. If we allow a slightly larger refactor than a tiny helper, I’d centralize the entire “IBL env/sky specular composition” into one inline function that both DynamicCubemaps and DeferredComposite call. This keeps all DALC vs ratio logic, skylighting visibility, and the interior sky overlay rule in one place, while leaving per-file sampling (different samplers) untouched.

Why this shape

  • Single source of truth for composing env/sky specular terms across DALC modes with skylighting/interior gating. The duplicated block is near-identical in both files today. (github.com)
  • Keeps sampling local to each file (SampColorSampler vs LinearSampler), passing the sampled values into the helper. (github.com)
  • Lives under IBL because it’s not just a skylighting multiply; it chooses between DALC-normalized and ratio-based IBL and produces both terms. Both files already include IBL/IBL.hlsli. (github.com)
  • Preserves the intentional non‑IBL fallback weighting; helper is only used inside the IBL path. (Using my saved learnings from PR #1947.)

Proposed code

  1. New: features/IBL/Shaders/IBL/SpecularCompose.hlsli
    hlsl
    #ifndef IBL_SPECULAR_COMPOSE_HLSLI
    #define IBL_SPECULAR_COMPOSE_HLSLI

namespace IBL
{
struct SpecularPair {
float3 env;
float3 sky;
};

// Compose env/sky specular terms for IBL.
// Inputs are pre-sampled to avoid sampler-state coupling.
inline SpecularPair ComposeSpecular(
    float3 envSample,
    float3 fullSample,
    float  envLum,                           // RGBToLuminance(EnvTexture.SampleLevel(..., 15))
    float  directionalAmbientColorSpecular,  // DALC
    float  skylightingSpecular               // pass 1.0f if SKYLIGHTING not compiled
)
{
    SpecularPair sp;

    if (SharedData::iblSettings.DALCMode == 2)
    {
        // DALC-normalized env + sky overlay
        sp.env = Color::IrradianceToLinear((envSample / max(envLum, 0.001)) * directionalAmbientColorSpecular)
               * SharedData::iblSettings.DALCAmount;

        sp.sky = Color::IrradianceToLinear(max(0, fullSample - envSample))
               * SharedData::iblSettings.SkyIBLScale;
    }
    else
    {
        // Ratio-based env + sky overlay
        float3 ratio = ImageBasedLighting::GetIBLRatio();
        sp.env = Color::IrradianceToLinear(envSample * ratio)
               * SharedData::iblSettings.EnvIBLScale;

        sp.sky = Color::IrradianceToLinear(max(0, fullSample - envSample))
               * SharedData::iblSettings.SkyIBLScale;
    }

    `#if` defined(SKYLIGHTING)
        sp.env *= skylightingSpecular;
        sp.sky *= skylightingSpecular;
    `#elif` defined(INTERIOR)
        // When compiling an interior variant without skylighting, skip sky overlay.
        sp.sky = 0;
    `#endif`

    return sp;
}

inline float3 Sum(SpecularPair sp) { return sp.env + sp.sky; }

}

#endif // IBL_SPECULAR_COMPOSE_HLSLI

  1. Call sites
  • features/Dynamic Cubemaps/Shaders/DynamicCubemaps/DynamicCubemaps.hlsli
    Add include near the IBL include:
    hlsl

include "IBL/IBL.hlsli"

include "IBL/SpecularCompose.hlsli"

Then replace each duplicated composition block with:
hlsl
float envLum = Color::RGBToLuminance(EnvTexture.SampleLevel(SampColorSampler, R, 15));
float skyVis = 1.0f;
#if defined(SKYLIGHTING)
skyVis = skylightingSpecular;
#endif
IBL::SpecularPair sp = IBL::ComposeSpecular(envSample, fullSample, envLum, directionalAmbientColorSpecular, skyVis);
finalIrradiance = IBL::Sum(sp);

(Apply in both DALCMode branches inside GetDynamicCubemapSpecularIrradiance(...) and GetDynamicCubemap(...).) (github.com)

  • package/Shaders/DeferredCompositeCS.hlsl
    Add include after IBL.hlsli:
    hlsl

include "IBL/IBL.hlsli"

include "IBL/SpecularCompose.hlsli"

Replace both composition blocks with:
hlsl
float envLum = Color::RGBToLuminance(EnvTexture.SampleLevel(LinearSampler, R, 15));
float skyVis = 1.0f;
#if defined(SKYLIGHTING)
skyVis = skylightingSpecular;
#endif
IBL::SpecularPair sp = IBL::ComposeSpecular(envSample, fullSample, envLum, directionalAmbientColorSpecular, skyVis);
finalIrradiance = IBL::Sum(sp);

This preserves the existing INTERIOR sky=0 behavior through the helper’s macro guard. (github.com)

Optional extra DRY (same file)

  • In DynamicCubemaps.hlsli, have GetDynamicCubemap(...) call GetDynamicCubemapSpecularIrradiance(...) and then apply the BRDF term, removing most duplication within that file. Behavior stays identical, including the static IBL early‑return. (github.com)

Why this is a sensible step up from a tiny helper

  • Centralizes the full composition policy once; future changes to DALC scaling, ratio handling, or interior/sky logic are one‑touch.
  • Keeps compile‑time permutations intact; no runtime branches added beyond what already exists.
  • Minimal churn at call sites: 5–7 lines each instead of 15–20 duplicated lines.
  • Does not touch the non‑IBL skylighting fallback which is intentionally double‑weighted per prior maintainer guidance (noted in my learnings).

If you like this direction, I can sketch a tiny follow‑up patch with these exact edits. (github.com)

Learnings referenced - Non‑IBL skylighting fallback double‑weighting is intentional; the refactor leaves that path untouched. (Saved learnings from PR `#1947`.)

🧠 Learnings used
Learnt from: jiayev
Repo: doodlum/skyrim-community-shaders PR: 1947
File: package/Shaders/DeferredCompositeCS.hlsl:234-243
Timestamp: 2026-03-14T08:35:42.651Z
Learning: In `package/Shaders/DeferredCompositeCS.hlsl` (doodlum/skyrim-community-shaders), the fallback non-IBL SKYLIGHTING specular path intentionally double-weights with `skylightingSpecular`: `dalcScaled` is computed as `IrradianceToGamma(IrradianceToLinear(directionalAmbientColorSpecular) * skylightingSpecular)`, and the final `finalIrradiance` is then `lerp(specularIrradiance, specularIrradianceReflections, skylightingSpecular)`. This is original engine logic preserved from before PR `#1947` and should not be flagged as a double-attenuation bug.

Learnt from: jiayev
Repo: doodlum/skyrim-community-shaders PR: 1947
File: features/Dynamic Cubemaps/Shaders/DynamicCubemaps/DynamicCubemaps.hlsli:107-115
Timestamp: 2026-03-14T08:35:02.326Z
Learning: In `features/Dynamic Cubemaps/Shaders/DynamicCubemaps/DynamicCubemaps.hlsli`, the pattern of scaling `directionalAmbientColorSpecular` by `skylightingSpecular` (via `dalcScaled`) before the final `lerp(specularIrradiance, specularIrradianceReflections, skylightingSpecular)` is intentional pre-existing behavior preserved from the original implementation. Do not flag this as double-attenuation; the combined attenuation is by design.

Learnt from: Dlizzio
Repo: doodlum/skyrim-community-shaders PR: 2000
File: src/WeatherEditor/EditorWindow.cpp:1239-1244
Timestamp: 2026-03-22T18:32:22.461Z
Learning: In doodlum/skyrim-community-shaders (PR `#2000`, 2026-03-22), maintainer preference: keep the default browser width logic in src/WeatherEditor/EditorWindow.cpp within EditorWindow::RenderUI — browserWidth = min(availableWidth * 0.5f, 960.0f * Util::GetUIScale()) is applied unconditionally (before checking settings.showViewport) to preserve a consistent left-rail width on first-use/reset. Do not change this to fill full width when the viewport is hidden.

Learnt from: Dlizzio
Repo: doodlum/skyrim-community-shaders PR: 2000
File: src/WeatherEditor/EditorWindow.cpp:1271-1274
Timestamp: 2026-03-22T18:40:49.633Z
Learning: Repo: doodlum/skyrim-community-shaders — Maintainer preference (PR `#2000` on 2026-03-22): In src/WeatherEditor/EditorWindow.cpp within EditorWindow::RenderUI, keep `resetLayout = false;` at the end of the frame (after PaletteWindow::Draw). The reset is intentionally one-shot for windows rendered that frame; closed windows are allowed to reopen with their previous geometry. Do not move the clear later or broadcast resets to closed windows.

Learnt from: Dlizzio
Repo: doodlum/skyrim-community-shaders PR: 1966
File: package/Shaders/ISVolumetricLightingGenerateCS.hlsl:0-0
Timestamp: 2026-03-11T08:05:10.801Z
Learning: In doodlum/skyrim-community-shaders, the `sqrt()` applied to `CloudShadows::GetCloudShadowMult()` in `package/Shaders/ISVolumetricLightingGenerateCS.hlsl` is intentional. The maintainer (Dlizzio) confirmed it is used to increase cloud shadow strength at harsh angles for volumetric lighting, and should not be removed or replaced with a direct linear multiply.

Learnt from: jiayev
Repo: doodlum/skyrim-community-shaders PR: 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.

Learnt from: Dlizzio
Repo: doodlum/skyrim-community-shaders PR: 1950
File: package/Shaders/Lighting.hlsl:2008-2012
Timestamp: 2026-03-07T00:53:21.267Z
Learning: In doodlum/skyrim-community-shaders PR `#1950`, the maintainer (Dlizzio) confirmed that per-axis normal reorientation for triplanar-projected normals/detail in package/Shaders/Lighting.hlsl is not required for their use case; the current approach intentionally mixes samples without axis-specific swizzle/sign correction.

Learnt from: alandtse
Repo: doodlum/skyrim-community-shaders PR: 1941
File: package/Shaders/Common/ShadowSampling.hlsli:160-163
Timestamp: 2026-04-03T01:48:34.867Z
Learning: In `package/Shaders/Common/ShadowSampling.hlsli` (doodlum/skyrim-community-shaders PR `#1941`), the directional shadow fade in `GetLightingShadow` is intentionally computed as `fadeStart = shadow.EndSplitDistances.y * (1.0 - FadeWindow)` where `FadeWindow = 0.1`. This anchors the fade to the last 10% of the absolute far-cascade distance (`EndSplitDistances.y`), not to the cascade span. The narrow window is deliberate so shadows dissolve only at the hard far-cutoff without prematurely fading across the whole cascade range. Do not suggest using `lerp(StartSplitDistances.y, EndSplitDistances.y, 1.0 - FadeWindow)` as a fix.

Learnt from: alandtse
Repo: doodlum/skyrim-community-shaders PR: 2084
File: src/ShaderCache.cpp:1646-1649
Timestamp: 2026-04-10T07:34:24.381Z
Learning: In `src/ShaderCache.cpp` (doodlum/skyrim-community-shaders PR `#2084`), `GetImagespaceShaderDescriptor` intentionally returns `false` for VR when a shader is not reverse-engineered. Returning `false` causes `ResolveImageSpaceDescriptor` to return `false`, which makes all callers (GetVertexShader, GetPixelShader, GetComputeShader, CompileShader) skip custom shader handling and defer to the vanilla shader. This is the correct pattern for un-RE'd imagespace shaders on VR — do not flag it as "skipping all custom VR handling" or suggest gating on HDR feature state.

Learnt from: vrnord
Repo: doodlum/skyrim-community-shaders PR: 1982
File: package/Shaders/Lighting.hlsl:3089-3095
Timestamp: 2026-03-16T13:13:11.490Z
Learning: In `package/Shaders/Lighting.hlsl` (doodlum/skyrim-community-shaders), the `TREE_ANIM` alpha test path intentionally uses a hardcoded `0.1` floor check (`if (alpha < 0.1) discard;`) and `AlphaTestRefRS` rather than `SharedData::VRAlphaTestThreshold`. `VRAlphaTestThreshold` is wired into `DistantTree.hlsl` and `RunGrass.hlsl` only. The threshold wiring for `Lighting.hlsl`'s `TREE_ANIM` path is deferred to a separate VR foliage PR.

Learnt from: alandtse
Repo: doodlum/skyrim-community-shaders PR: 0
File: :0-0
Timestamp: 2025-06-24T07:17:36.604Z
Learning: When reviewing PRs, always clarify the scope if there are multiple related features or dependencies. WeatherPicker was a separate PR that was already merged, while this PR focuses specifically on WetnessEffects climate preset system enhancements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants