Skip to content

fix: fix bloom intensity#1458

Merged
doodlum merged 1 commit into
devfrom
bloom-intensity-fix
Sep 9, 2025
Merged

fix: fix bloom intensity#1458
doodlum merged 1 commit into
devfrom
bloom-intensity-fix

Conversation

@doodlum
Copy link
Copy Markdown
Collaborator

@doodlum doodlum commented Sep 9, 2025

Summary by CodeRabbit

  • Improvements
    • Refined bloom rendering with non-linear intensity compression, producing more natural highlights and reducing over-brightening.
    • Smoother transitions in bright areas for a cleaner, less harsh glow.
    • More consistent HDR appearance across varied scenes and displays.
    • Visual quality improved without impacting performance or controls.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Sep 9, 2025

Walkthrough

Replaces the bloom accumulation term in package/Shaders/ISHDR.hlsl to apply DisplayMapping::RangeCompress to the clamped difference (max(0, Param.x - hdrColor)) before multiplying by bloomColor. No other logic or control flow changes.

Changes

Cohort / File(s) Summary
HDR Bloom Mapping
package/Shaders/ISHDR.hlsl
Modified bloom add: hdrColor += max(0, Param.x - hdrColor) * bloomColor;hdrColor += DisplayMapping::RangeCompress(max(0, Param.x - hdrColor)) * bloomColor;

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • jiayev

Pre-merge checks (2 passed, 1 inconclusive)

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description Check ❓ Inconclusive There is no pull request description provided beyond the AI-generated summary, so it is unclear whether the author has supplied any meaningful context or rationale alongside the code changes. Without a visible description field, it is impossible to determine if it relates appropriately to the modifications in the shader. Please ensure a clear description is added to the pull request that outlines the reason for adjusting the bloom intensity and how the change affects rendering behavior.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title succinctly identifies that the primary change is fixing bloom intensity and relates directly to the modification in the shader logic. It is concise, clearly conveys the main purpose of the pull request, and is framed as a single meaningful statement.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

Poem

A hop, a skip—compress the light,
Bloom tamed softly, still feels right.
Range wrapped snug in pixel night,
Stars nibble edges, not too bright.
I twitch my ears—code’s in sight. ✨🐇

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bloom-intensity-fix

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

github-actions Bot commented Sep 9, 2025

Using provided base ref: 6e5b9f1
Using base ref: 6e5b9f1
Base commit date: 2025-09-09T18:38:55+01:00 (Tuesday, September 09, 2025 06:38 PM)
No actionable suggestions for changed features.

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.

Actionable comments posted: 0

🧹 Nitpick comments (1)
package/Shaders/ISHDR.hlsl (1)

117-117: Consider luminance-based gate to avoid hue shifts.

Per-channel gating can tint bloom. If desired, gate on luminance and apply a scalar weight.

-    hdrColor += DisplayMapping::RangeCompress(max(0, Param.x - hdrColor)) * bloomColor;
+    const float l = Color::RGBToLuminance(hdrColor);
+    const float w = DisplayMapping::RangeCompress(max(0, l - Param.x));
+    hdrColor += w * bloomColor;
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6e5b9f1 and bf84486.

📒 Files selected for processing (1)
  • package/Shaders/ISHDR.hlsl (1 hunks)
🧰 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)

Do not include TODO/FIXME placeholders; provide complete, working solutions

Files:

  • package/Shaders/ISHDR.hlsl
🧠 Learnings (2)
📓 Common learnings
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/ISHDR.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 (2)
package/Shaders/ISHDR.hlsl (2)

117-117: Good call on using RangeCompress to tame overbloom.

Compressing the gate before scaling bloomColor is a sensible way to reduce runaway bloom intensity while preserving highlight roll-off.


117-117: Confirm bloom threshold polarity (invert subtraction)
If Param.x is intended as the bloom threshold, the current max(0, Param.x - hdrColor) will boost darker regions rather than highlights. Swap the operands to extract bright areas:

- hdrColor += DisplayMapping::RangeCompress(max(0, Param.x - hdrColor)) * bloomColor;
+ hdrColor += DisplayMapping::RangeCompress(max(0, hdrColor - Param.x)) * bloomColor;

Verify that Param.x indeed maps to the bloom threshold in your engine setup.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Sep 9, 2025

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

@doodlum doodlum merged commit 99a5edc into dev Sep 9, 2025
17 checks passed
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.

1 participant