Skip to content

fix(weather-editor): corrected slider behaviour for the lighting template widget#2136

Merged
davo0411 merged 2 commits into
community-shaders:devfrom
SkrubbySkrubInAShrub:WE-LT-Sliders
Apr 16, 2026
Merged

fix(weather-editor): corrected slider behaviour for the lighting template widget#2136
davo0411 merged 2 commits into
community-shaders:devfrom
SkrubbySkrubInAShrub:WE-LT-Sliders

Conversation

@SkrubbySkrubInAShrub
Copy link
Copy Markdown
Collaborator

@SkrubbySkrubInAShrub SkrubbySkrubInAShrub commented Apr 16, 2026

added proper bounds to sliders, now should match what xedit allows or what kreate allows. based on feedback from lamin.

Summary by CodeRabbit

  • Bug Fixes
    • Refined slider ranges in the weather & lighting editors to enforce sensible limits: directional angles and fade, light fade start/end and clip distance, expanded fog distances and fog power/clamp, and DALC Fresnel power—preventing out-of-range values and improving control precision.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 16, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1ceadbdd-74eb-4ea9-adb0-f19573603b76

📥 Commits

Reviewing files that changed from the base of the PR and between d7508d2 and 26e2e32.

📒 Files selected for processing (2)
  • src/WeatherEditor/Weather/CellLightingWidget.cpp
  • src/WeatherEditor/Weather/LightingTemplateWidget.cpp
✅ Files skipped from review due to trivial changes (1)
  • src/WeatherEditor/Weather/CellLightingWidget.cpp

📝 Walkthrough

Walkthrough

UI slider ranges were made explicit in lighting-related widgets: directional angles, fades, fog, clip/light distances, and DALC Fresnel power now use defined min/max bounds; no control flow or public APIs were changed.

Changes

Cohort / File(s) Summary
Lighting Template widget
src/WeatherEditor/Weather/LightingTemplateWidget.cpp
Replaced unbounded/overloaded WeatherUtils::DrawSliderFloat calls with explicit min/max ranges: Directional XY/Z (0.0–360.0), Directional Fade (0.0–10.0), Light Fade Start/End (0.0–163840.0), Clip Distance (0.0–163840.0), Fog Near/Far (0.0–163840.0), Fog Power (0.0–10.0), Fog Clamp (0.0–1.0), DALC Fresnel Power (0.0–10.0). No logic/state changes beyond slider ranges.
Cell Lighting widget
src/WeatherEditor/Weather/CellLightingWidget.cpp
Expanded fog and distance slider maxima: fogNear/fogFar max -> 163840.0, lightFadeStart/lightFadeEnd/clipDist max -> 163840.0. Lower bounds remain 0.0; change-flag behavior unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • davo0411
  • alandtse

Poem

🐰 I nudged the sliders, one by one,
Angles set and distances spun,
Fog and fade all lined in rows,
Hop, hop—now every limit knows!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding proper slider bounds to the lighting template widget with correct ranges.

✏️ 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

@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 the current code and only fix it if needed.

Inline comments:
In `@src/WeatherEditor/Weather/LightingTemplateWidget.cpp`:
- Around line 134-139: The Fog Near/Far slider ranges in
LightingTemplateWidget.cpp currently use 0–16384 for both (via
WeatherUtils::DrawSliderFloat on settings.fogNear/settings.fogFar) which
diverges from CellLightingWidget.cpp and risks clamping existing templates; make
the ranges consistent across widgets: either change these calls to use Fog Near
0–10000 and Fog Far 0–50000 (matching the historical CellLightingWidget bounds)
or update CellLightingWidget to the new 0–16384 policy—ensure both widgets call
WeatherUtils::DrawSliderFloat with identical min/max values for settings.fogNear
and settings.fogFar so no existing values are unexpectedly clamped.
🪄 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

Run ID: fc759d2b-373d-4caa-9bcc-9382d6e65ace

📥 Commits

Reviewing files that changed from the base of the PR and between a26b4be and d7508d2.

📒 Files selected for processing (1)
  • src/WeatherEditor/Weather/LightingTemplateWidget.cpp

Comment thread src/WeatherEditor/Weather/LightingTemplateWidget.cpp Outdated
@davo0411 davo0411 merged commit f157d81 into community-shaders:dev Apr 16, 2026
15 checks passed
@github-actions
Copy link
Copy Markdown

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

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.

2 participants