Skip to content

chore(rendering): remove the Clamp Lighting setting - #5370

Open
soloturn wants to merge 1 commit into
developfrom
soloturn-remove-clamp-lighting
Open

chore(rendering): remove the Clamp Lighting setting#5370
soloturn wants to merge 1 commit into
developfrom
soloturn-remove-clamp-lighting

Conversation

@soloturn

Copy link
Copy Markdown
Contributor

Fixes #5152 (the "Clamp Lighting" part of it - see below for the rest).

Why removal, not a fix

Clamp Lighting was reported to visibly do nothing. The maintainer who investigated confirmed it and asked for outright removal, not a fix: "remove clamplightning in both ui and Rendering Config" / "remove clamp lightning from UI, rendering config and any related code you can find." That's a still-open TODO from the issue thread - unimplemented.

It clamps the deferred lighting pass's output color to [0.0, 1.0] before it reaches later HDR-aware post-processing (bloom, eye adaptation, tone mapping). Most framebuffer formats already clamp on write regardless, so the setting only has a visible effect in specific HDR configurations - which is why toggling it does nothing for most players. Not a bug, a setting whose effect never showed up where a player looking for it would see it.

What's removed

  • RenderingConfig: the clampLighting field, isClampLighting()/setClampLighting(), and the CLAMP_LIGHTING property-change constant
  • GLSLShader: the #define CLAMP_LIGHTING emission
  • videoMenuScreen.ui: the checkbox and its label
  • VideoSettingsScreen: the checkbox binding
  • default.cfg: the persisted entry
  • menu_en.lang: the base i18n string

Other locale .lang files keep the now-orphaned key - that's the normal state for a retired translation string; Weblate stops requesting it going forward rather than needing 25 files hand-edited here.

Companion PR

The shader side (the actual #if defined(CLAMP_LIGHTING) branch) lives in a separate repo: Terasology/CoreRendering#85

Verification

:engine:compileJava and :engine-tests:compileTestJava both clean. default.cfg, videoMenuScreen.ui, and menu_en.lang still parse as valid JSON after the edits (verified with python3 -m json.tool, not just by eye). Couldn't launch the actual settings screen to confirm the UI renders without the removed rows - no display in this environment.

What's still open on #5152

The issue's other item - separating the flickering-light offset per block instead of per chunk - is explicitly not addressed here. The maintainer thread flagged it as performance-sensitive ("we need to be considerate of the performance impact here... we probably don't want to merge that until we improved performance a bunch first") and it needs shader-level profiling I can't do in this environment, so I left it out rather than guess at a fix. Eye-adaptation, bloom, and vignette were already fixed in earlier, already-merged CoreRendering PRs (#77, #78, #80).

#5152: Clamp Lighting was reported to visibly do nothing. The maintainer
who investigated confirmed why and asked for it to be removed outright,
not just fixed or hidden: "remove clamplightning in both ui and Rendering
Config" / "remove clamp lightning from UI, rendering config and any
related code you can find."

It clamps the deferred lighting pass's output color to [0.0, 1.0] before
it reaches later HDR-aware post-processing (bloom, eye adaptation, tone
mapping) - see the paired CoreRendering PR. Most framebuffer formats
already clamp on write, so the setting only has a visible effect in
specific HDR configurations, which is why toggling it does nothing for
most players - not a bug to fix, a setting whose value never showed up
where a player would look for it.

Removed the RenderingConfig field, getter/setter and property-change
constant, the GLSLShader #define, the checkbox and its label from
videoMenuScreen.ui, the VideoSettingsScreen binding, the default.cfg
entry, and the base i18n string. Other locale .lang files keep the now-
orphaned key; that is the normal, harmless state for a translation string
whose base entry has been retired, and Weblate's own sync will stop
requesting it going forward rather than needing 25 files hand-edited here.

Compiles clean (:engine:compileJava, :engine-tests:compileTestJava).
default.cfg, videoMenuScreen.ui and menu_en.lang all still parse as valid
JSON after the edits.

Fixes #5152

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions github-actions Bot added the Type: Chore Request for or implementation of maintenance changes label Aug 19, 2026
@coderabbitai

coderabbitai Bot commented Aug 19, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c48a491a-a6b5-4353-b339-1e882bae31d4

📥 Commits

Reviewing files that changed from the base of the PR and between 338d7dd and c7fde3b.

📒 Files selected for processing (6)
  • engine/src/main/java/org/terasology/engine/config/RenderingConfig.java
  • engine/src/main/java/org/terasology/engine/rendering/nui/layers/mainMenu/videoSettings/VideoSettingsScreen.java
  • engine/src/main/java/org/terasology/engine/rendering/opengl/GLSLShader.java
  • engine/src/main/resources/default.cfg
  • engine/src/main/resources/org/terasology/engine/assets/i18n/menu_en.lang
  • engine/src/main/resources/org/terasology/engine/assets/ui/menu/videoMenuScreen.ui
💤 Files with no reviewable changes (6)
  • engine/src/main/java/org/terasology/engine/rendering/nui/layers/mainMenu/videoSettings/VideoSettingsScreen.java
  • engine/src/main/resources/default.cfg
  • engine/src/main/java/org/terasology/engine/rendering/opengl/GLSLShader.java
  • engine/src/main/resources/org/terasology/engine/assets/ui/menu/videoMenuScreen.ui
  • engine/src/main/resources/org/terasology/engine/assets/i18n/menu_en.lang
  • engine/src/main/java/org/terasology/engine/config/RenderingConfig.java

Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review.


📝 Walkthrough

Summary by CodeRabbit

  • Changes
    • Removed the “Clamp Lighting” option from the video settings menu.
    • Removed the corresponding rendering configuration and default setting.
    • Removed related shader processing and localization text.
    • Other video and rendering settings remain unchanged.

Walkthrough

The change removes the clamp lighting option from rendering configuration, shader source assembly, default settings, localization, and video settings UI.

Changes

Clamp lighting removal

Layer / File(s) Summary
Remove configuration and UI option
engine/src/main/java/org/terasology/engine/config/RenderingConfig.java, engine/src/main/java/org/terasology/engine/rendering/nui/layers/mainMenu/videoSettings/VideoSettingsScreen.java, engine/src/main/resources/default.cfg, engine/src/main/resources/org/terasology/engine/assets/i18n/menu_en.lang, engine/src/main/resources/org/terasology/engine/assets/ui/menu/videoMenuScreen.ui
Removes the clampLighting configuration API, default property, localization entry, checkbox binding, and video settings checkbox.
Remove shader define
engine/src/main/java/org/terasology/engine/rendering/opengl/GLSLShader.java
Removes conditional CLAMP_LIGHTING define generation from shader source assembly.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to c7fde

This PR removes the unused Clamp Lighting setting and its related configuration and UI entries. No actionable merge-blocking risk remains beyond normal checks and review.

Poem

A rabbit hops where clamp lights shone,
The checkbox and setting are gone.
No label, define, or field remains,
The shader path runs simpler lanes.
Thump-thump! Clean configs greet the dawn.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the removal of the Clamp Lighting setting.
Description check ✅ Passed The description accurately explains the setting removal, affected files, verification, and excluded scope.
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.
✨ 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 soloturn-remove-clamp-lighting

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.

@soloturn

Copy link
Copy Markdown
Contributor Author

Ran a visual/log test with this change (plus the rest of a larger merge-train batch) using the full Omega module set, then compared its CoreRendering render-graph (DAG) log output against an unmerged develop baseline built the same way.

Both runs produce the exact same 231 RenderGraph/AbstractNode warnings and errors (node-connection wiring messages like "trying to disconnect two nodes that aren't connected," "input connection returned null," "overwrites data of existing connection") - identical set of messages, same node names (backdropNode, ambientOcclusionNode, opaqueBlocksNode, deferredMainLightNode, etc.), only differing in interleaving order between the two runs (normal HashMap/iteration-order variance, not a content difference).

So this DAG noise is pre-existing in develop, not introduced by this clamp-lighting removal. Flagging it here since it was a plausible suspect (this PR removes a pipeline stage's shader/config wiring) but the baseline comparison clears it.

@soloturn

Copy link
Copy Markdown
Contributor Author

Split out into its own ticket: #5371 (Flickering lights flicker in unison per chunk instead of independently per block) - still open, tracked separately from this PR.

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

Labels

Type: Chore Request for or implementation of maintenance changes

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Defunct graphics settings

2 participants