Skip to content

feat(grass lighting): add complex grass detection threshold slider#1750

Merged
alandtse merged 2 commits into
community-shaders:devfrom
SkrubbySkrubInAShrub:complex-grass-detection-slider
Jan 25, 2026
Merged

feat(grass lighting): add complex grass detection threshold slider#1750
alandtse merged 2 commits into
community-shaders:devfrom
SkrubbySkrubInAShrub:complex-grass-detection-slider

Conversation

@SkrubbySkrubInAShrub
Copy link
Copy Markdown
Collaborator

@SkrubbySkrubInAShrub SkrubbySkrubInAShrub commented Jan 23, 2026

adds a complex grass detection slider.

Summary by CodeRabbit

  • New Features
    • Made complex grass detection threshold configurable through UI slider, replacing the previously hardcoded default value.
    • Added labeled control with tooltip explaining the threshold's role in detecting complex grass textures.

✏️ Tip: You can customize this high-level summary in your review settings.

SkrubbySkrubInAShrub added 2 commits January 23, 2026 23:47
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 23, 2026

📝 Walkthrough

Walkthrough

This PR makes the complex grass detection threshold configurable instead of hardcoded. A previously fixed value of 0.03 in the shader is replaced with a user-adjustable setting, exposed through the settings struct and UI.

Changes

Cohort / File(s) Summary
Shader struct definition
package/Shaders/Common/SharedData.hlsli
Added ComplexGrassThreshold float field to GrassLightingSettings struct and consolidated padding from float2 to float.
Shader implementation
package/Shaders/RunGrass.hlsl
Replaced hardcoded threshold value 0.03 with SharedData::grassLightingSettings.ComplexGrassThreshold in complex grass detection logic.
Settings header and implementation
src/Features/GrassLighting.h, src/Features/GrassLighting.cpp
Added ComplexGrassThreshold field (default 0.03f) to GrassLighting::Settings struct; added serialization support via NLOHMANN macro; introduced UI slider with label and tooltip under "Complex Grass" section for runtime threshold adjustment.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested reviewers

  • doodlum
  • jiayev

Poem

🐰 A threshold once set in stone,
Now blooms with choices of its own!
From hardcoded chains, the shader breaks free,
Configurable grass for all to see! ✨🌾

🚥 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: exposing a configurable complex grass detection threshold through a UI slider, which is the primary objective across all modified files.

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

✨ Finishing touches
  • 📝 Generate docstrings

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

Using provided base ref: 44eb788
Using base ref: 44eb788
Base commit date: 2026-01-19T23:55:15Z (Monday, January 19, 2026 11:55 PM)
No actionable suggestions for changed features.

@github-actions
Copy link
Copy Markdown

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

@alandtse alandtse changed the title feat(grass lighting): expose complex grass detection threshold slider feat(grass lighting): add complex grass detection threshold slider Jan 25, 2026
@alandtse alandtse merged commit 86335f6 into community-shaders:dev Jan 25, 2026
18 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request May 9, 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