Skip to content

feat(wetness): add wetness overriding for debug and screen archery#1339

Merged
alandtse merged 2 commits into
community-shaders:devfrom
jiayev:wetnessoverride
Jul 31, 2025
Merged

feat(wetness): add wetness overriding for debug and screen archery#1339
alandtse merged 2 commits into
community-shaders:devfrom
jiayev:wetnessoverride

Conversation

@jiayev
Copy link
Copy Markdown
Collaborator

@jiayev jiayev commented Jul 30, 2025

This pull request introduces a new DebugSettings feature to the WetnessEffects system, allowing developers to override and customize wetness, puddle, and rain effects for debugging purposes. Key changes include the addition of the DebugSettings structure, integration into the settings system, and updates to the rendering logic to respect these overrides.

Addition of DebugSettings:

  • src/Features/WetnessEffects.h: Added a DebugSettings struct with boolean flags for enabling overrides and float2 values for specifying wetness, puddle wetness, and rain overrides. Integrated this struct into the WetnessEffects class.

Integration into settings system:

UI updates for debugging:

  • src/Features/WetnessEffects.cpp: Enhanced the DrawSettings method to include a new "Debug" section in the UI, allowing users to toggle overrides and adjust their values interactively.

Rendering logic adjustments:

  • src/Features/WetnessEffects.cpp: Modified the GetCommonBufferData method to apply DebugSettings overrides to wetness, puddle wetness, and rain values, with support for interior/exterior differentiation.

Serialization support:

  • src/Features/WetnessEffects.cpp: Added a NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_WITH_DEFAULT macro for DebugSettings to enable JSON serialization and deserialization.

Summary by CodeRabbit

  • New Features
    • Introduced debug override controls for wetness, puddle wetness, and rain intensity, allowing manual adjustment of these effects for both interior and exterior environments through the settings UI.
  • User Interface
    • Added a new "Debug" section in the settings with checkboxes and sliders for enabling and customizing override values for wetness-related parameters.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jul 30, 2025

Walkthrough

A new DebugSettings struct was introduced within the wetness effects system to allow manual override of wetness, puddle wetness, and rain intensity parameters for debugging. The settings UI, serialization, and buffer data logic were updated to support these overrides, including separate controls for interior and exterior conditions.

Changes

Cohort / File(s) Change Summary
Debug Override Struct & Member
src/Features/WetnessEffects.h
Added nested DebugSettings struct with override flags and values; added debugSettings member to WetnessEffects.
Debug Logic & UI Integration
src/Features/WetnessEffects.cpp
Implemented serialization, UI controls, and buffer logic for DebugSettings; updated load/save and data retrieval methods accordingly.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15 minutes

Poem

A rabbit with paws both clever and neat
Hopped into code with a debugging treat—
Now puddles and rain, with a slider or two,
Can be set just so, for testing anew.
Wetness and storms, both inside and out,
Debugging made easy—no need to pout!
🐇💧🌧️

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Automated formatting by clang-format, prettier, and other hooks.
See https://pre-commit.ci for details.
@github-actions
Copy link
Copy Markdown

Using provided base ref: 3d4e996
Using base ref: 3d4e996
Base commit date: 2025-07-30T14:31:29+08:00 (Wednesday, July 30, 2025 02:31 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)
src/Features/WetnessEffects.h (1)

73-82: Well-designed debug settings structure.

The DebugSettings struct is well-structured with clear boolean flags and efficient float2 usage for interior/exterior value pairs. The naming convention is consistent and descriptive.

Consider renaming EnableIntExOverride to EnableInteriorExteriorOverride for improved clarity:

-		bool EnableIntExOverride = false;
+		bool EnableInteriorExteriorOverride = false;
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3d4e996 and d37dc39.

📒 Files selected for processing (2)
  • src/Features/WetnessEffects.cpp (4 hunks)
  • src/Features/WetnessEffects.h (1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: alandtse
PR: doodlum/skyrim-community-shaders#0
File: :0-0
Timestamp: 2025-06-24T07:17:36.604Z
Learning: When reviewing PRs, always clarify the scope if there are multiple related features or dependencies. WeatherPicker was a separate PR that was already merged, while this PR focuses specifically on WetnessEffects climate preset system enhancements.
src/Features/WetnessEffects.h (1)

Learnt from: alandtse
PR: doodlum/skyrim-community-shaders#0
File: :0-0
Timestamp: 2025-06-24T07:17:36.604Z
Learning: When reviewing PRs, always clarify the scope if there are multiple related features or dependencies. WeatherPicker was a separate PR that was already merged, while this PR focuses specifically on WetnessEffects climate preset system enhancements.

src/Features/WetnessEffects.cpp (1)

Learnt from: alandtse
PR: doodlum/skyrim-community-shaders#0
File: :0-0
Timestamp: 2025-06-24T07:17:36.604Z
Learning: When reviewing PRs, always clarify the scope if there are multiple related features or dependencies. WeatherPicker was a separate PR that was already merged, while this PR focuses specifically on WetnessEffects climate preset system enhancements.

🔇 Additional comments (5)
src/Features/WetnessEffects.cpp (5)

35-43: LGTM! Complete and consistent serialization.

The JSON serialization for DebugSettings includes all struct members and follows the established pattern used elsewhere in the codebase.


491-513: Excellent debug UI implementation.

The debug settings UI is well-designed with proper conditional rendering, appropriate value ranges, and helpful tooltips. The use of SliderFloat2 for interior/exterior pairs is intuitive and efficient.


749-767: Correct debug override implementation.

The override logic properly handles interior/exterior conditions and correctly applies debug values after normal calculations. The fallback behavior when EnableIntExOverride is false (using exterior values for interior) is appropriate.


806-808: Safe and backward-compatible settings loading.

The conditional loading of debug settings prevents issues with older configuration files while properly deserializing the new debug settings when present.


815-815: Simple and correct settings persistence.

The debug settings are properly saved to the JSON configuration, ensuring persistence across application sessions.

@github-actions
Copy link
Copy Markdown

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

@alandtse alandtse merged commit 58ab563 into community-shaders:dev Jul 31, 2025
15 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.

2 participants