Skip to content

fix(ll): adjust default and fix non hdr gamma#2325

Merged
alandtse merged 2 commits into
devfrom
ll-fix-2
May 12, 2026
Merged

fix(ll): adjust default and fix non hdr gamma#2325
alandtse merged 2 commits into
devfrom
ll-fix-2

Conversation

@jiayev
Copy link
Copy Markdown
Collaborator

@jiayev jiayev commented May 12, 2026

This pull request introduces adjustments to the Linear Lighting feature's multipliers and corrects color space conversion handling in the shader pipeline. These changes aim to improve lighting accuracy and ensure proper color output when linear lighting is enabled.

Linear Lighting configuration adjustments:

  • Set vanillaDiffuseColorMult to 1.0 (was 1.5), reducing diffuse color intensity for more accurate lighting.
  • Set ambientMult to 1.0 (was 0.67), increasing ambient light contribution.
  • Set glowmapMult to 0.66 (was 0.5), increasing the glowmap effect.

Shader pipeline improvements:

  • In PS_OUTPUT main(PS_INPUT input) in ISHDR.hlsl, added a conditional step to apply Color::LinearToGammaSafe conversion when ENABLE_LL is enabled, ensuring correct gamma correction for linear lighting.

Summary by CodeRabbit

  • Bug Fixes

    • Corrected color conversion behavior in HDR rendering output to properly apply gamma correction based on lighting settings status.
  • Improvements

    • Fine-tuned linear lighting system multiplier values affecting diffuse color, ambient brightness, and glow contributions to enhance overall visual rendering quality and lighting accuracy.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 12, 2026

📝 Walkthrough

Walkthrough

This PR inverts the conditional gamma conversion in the HDR shader path and tunes default lighting multiplier values in the Linear Lighting settings struct. The changes affect HDR color output when ENABLE_LL is active and adjust baseline diffuse, ambient, and glow lighting constants.

Changes

Linear Lighting Adjustments

Layer / File(s) Summary
HDR gamma conversion with linear lighting
package/Shaders/ISHDR.hlsl
The LinearToGammaSafe(outputColor) conversion in the isHDR output path is now executed when ENABLE_LL is true, inverting the prior conditional from !ENABLE_LL.
Linear lighting settings defaults tuning
src/Features/LinearLighting.h
LinearLighting::Settings default multipliers are adjusted: vanillaDiffuseColorMult reduced to 1.0f, ambientMult increased to 1.0f, and glowmapMult adjusted to 0.66f.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • doodlum
  • davo0411
  • alandtse

Poem

🐰 A rabbit's ode to gamma light
When ENABLE_LL shines so bright,
We flip the conditions, colors true,
Tune the multipliers—one, one, two-point-six,
Linear lighting now fixed with a twist! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and directly refers to the main changes: adjusting Linear Lighting defaults and fixing gamma correction in the non-HDR path.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ll-fix-2

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 OpenGrep (1.20.0)

OpenGrep fatal error (exit code 2): [00.25][ERROR]: Error: exception Unix_error: No such file or directory stat src/Features/LinearLighting.h
Raised by primitive operation at UTmp.replace_named_pipe_by_regular_file_if_needed in file "libs/commons/UTmp.ml", line 145, characters 8-27
Called from Scan_CLI.replace_target_roots_by_regular_files_where_needed.(fun) in file "src/osemgrep/cli_scan/Scan_CLI.ml", lines 1086-1087, characters 19-65
Called from List_.fast_map in file "libs/commons/List_.ml", line 81, characters 17-20
Called fro

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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

@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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@package/Shaders/ISHDR.hlsl`:
- Around line 219-221: The current SDR path may gamma-encode twice because when
ENABLE_LL is true you call Color::LinearToGammaSafe(outputColor) then
FrameBuffer::ToSRGBColor(outputColor) which uses FrameParams.x ("inverse
fGamma"); verify and fix by ensuring only one transfer is applied: either remove
the LinearToGammaSafe call when FrameBuffer::ToSRGBColor already performs the
SDR gamma (or change ToSRGBColor to be a no-op for already-encoded input), or
gate ToSRGBColor behind !ENABLE_LL. Update the logic around outputColor,
referencing ENABLE_LL, Color::LinearToGammaSafe, FrameBuffer::ToSRGBColor and
FrameParams.x to ensure SDR path applies a single gamma conversion consistent
with the HDR (!ENABLE_LL) logic.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 57f0bba5-ecec-42b0-ad8e-0554fd052aee

📥 Commits

Reviewing files that changed from the base of the PR and between 9a3e7b5 and 60cb4c9.

📒 Files selected for processing (2)
  • package/Shaders/ISHDR.hlsl
  • src/Features/LinearLighting.h

Comment thread package/Shaders/ISHDR.hlsl
@github-actions
Copy link
Copy Markdown

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

@alandtse alandtse merged commit 88a5358 into dev May 12, 2026
14 checks passed
ParticleTroned pushed a commit to ParticleTroned/skyrim-community-shaders that referenced this pull request May 15, 2026
ParticleTroned pushed a commit to ParticleTroned/skyrim-community-shaders that referenced this pull request May 16, 2026
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.

3 participants