skyrim-community-shaders icon indicating copy to clipboard operation
skyrim-community-shaders copied to clipboard

feat: add raindrop ripples on water

Open TheRiverwoodModder opened this issue 1 year ago β€’ 2 comments

Added the raindrop ripple effect to water:

  • Expanded the range of the effect on water by 3 which did not have a noticable impact on performance
  • Added rippleStrengthModifyer which is used for skylighting-based occlusion and distance-based fade out
  • Added a transparent waterrainripples.dds to remove the vanilla water raindrop effect
  • Removed the (defined(FLOWMAP) && !defined(BLEND_NORMALS)) check which was breaking vanilla and did not appear to have a benefit in my testing

TheRiverwoodModder avatar Sep 30 '24 02:09 TheRiverwoodModder

What's the source of the dds file?

It is just a blank 32x32 image that I created. It overwrites the one vanilla uses to show the default rain ripple effect.

TheRiverwoodModder avatar Sep 30 '24 04:09 TheRiverwoodModder

I feel that this needs more work

doodlum avatar Sep 30 '24 12:09 doodlum

Walkthrough

The wetness effects shader function GetRainDrops was extended with optional parameters for ripple strength modification and flow-aware ripple offset, including per-ripple size variation. Debug visualization functions were added. The WetnessEffectsSettings struct gained new members for vanilla ripple control. The WetnessEffects feature added settings, UI controls, runtime hooking for vanilla ripples, and compatibility checks for the "Splashes of Storms" mod.

Changes

File(s) Change Summary
features/Wetness Effects/Shaders/WetnessEffects/WetnessEffects.hlsli Modified GetRainDrops signature; added ripple size variation and flow-aware offset; added debug visualization functions; refined preprocessor condition in GetWetnessAmbientSpecular.
package/Shaders/Common/SharedData.hlsli Added EnableVanillaRipples (uint) and RaindropFxRange (float) to WetnessEffectsSettings; changed pad0 from float3 to float.
src/Features/WetnessEffects.cpp Added vanilla ripple toggle settings, UI controls, cached ripple state, thunk hook for splash toggling, and compatibility check for "Splashes of Storms" mod.
src/Features/WetnessEffects.h Extended WetnessEffects::Settings with ripple-related members; increased default RippleLifetime; added virtual methods (PostPostLoad(), GetFeatureModLink(), DrawUnloadedUI()); added private mod detection flag; reduced padding in PerFrame struct.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant WetnessEffectsFeature
    participant WaterSystem

    User->>WetnessEffectsFeature: Toggle EnableVanillaRipples checkbox
    WetnessEffectsFeature->>WetnessEffectsFeature: UpdateSettings() caches ripple states
    WetnessEffectsFeature->>WaterSystem: ToggleWaterSplashes thunk intercepts splash toggling
    WaterSystem-->>WetnessEffectsFeature: Splash toggle modified based on cached settings

Poem

Raindrops ripple with strength anew,
A modifier now in shaders grew.
Wetness gleams, but only when
Water’s not defined, my friend!
Vanilla ripples toggle with care,
Compatibility checks are there.
A bunny’s touch on rain and splash,
Code flows forward, smooth and rash.
πŸ‡πŸ’§


πŸ“œ Recent review details

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

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between c8407daa1dbec5fa58098940f2d4b9fea74a742a and 6f21811d7508c764f6de3e55d77a605952ccb7dc.

β›” Files ignored due to path filters (1)
  • package/Shaders/Water.hlsl is excluded by !**/*.hlsl
πŸ“’ Files selected for processing (1)
  • features/Wetness Effects/Shaders/WetnessEffects/WetnessEffects.hlsli (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • features/Wetness Effects/Shaders/WetnessEffects/WetnessEffects.hlsli
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Validate shader compilation (VR, .github/configs/shader-validation-vr.yaml)
  • GitHub Check: Validate shader compilation (Flatrim, .github/configs/shader-validation.yaml)
  • GitHub Check: Build plugin and addons

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 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.

coderabbitai[bot] avatar May 24 '25 22:05 coderabbitai[bot]

Ok current status:

  • Vanilla ripples start disabled and can be toggled on. But they're not toggling back off.
  • I can't see the actual effect from ripples. It may have been broken by #744 or other changes
  • Removed dds since we're disabling in engine.

Not ready to merge yet, but much closer.

alandtse avatar Jun 08 '25 11:06 alandtse

βœ… A pre-release build is available for this PR: Download

github-actions[bot] avatar Jun 08 '25 11:06 github-actions[bot]

βœ… A pre-release build is available for this PR: Download

github-actions[bot] avatar Jun 08 '25 11:06 github-actions[bot]

βœ… A pre-release build is available for this PR: Download

github-actions[bot] avatar Jun 08 '25 11:06 github-actions[bot]

βœ… A pre-release build is available for this PR: Download

github-actions[bot] avatar Jun 08 '25 11:06 github-actions[bot]

@doodlum Ok, confirmed vanilla rain ripples can be disabled by the setting. Enabling is like instant and depends on the water. Disabling may take a change of location/weather to see.

I also tweaked the lifetime. The .15 looked really unrealistic to me, but .5 secs seems better. May want to based it off a vanilla weather setting though.

alandtse avatar Jun 08 '25 23:06 alandtse

βœ… A pre-release build is available for this PR: Download

github-actions[bot] avatar Jun 08 '25 23:06 github-actions[bot]

You also have a weird setting. Did you default your settings for ripple lifetime? They don't happen that fast now.

alandtse avatar Jun 11 '25 00:06 alandtse

βœ… A pre-release build is available for this PR: Download

github-actions[bot] avatar Jun 13 '25 22:06 github-actions[bot]

@doodlum Flowmap works from my testing, take a look and see if you think it should be disabled by default. That would require some additional work as there's no setting for water ripples yet. DEBUG_WETNESS_EFFECTS to see the flow easier.

alandtse avatar Jun 16 '25 20:06 alandtse

I'm going to look at whether we can extend ripples/splashes longer on water since you're right they don't last long enough and can seem weird.

alandtse avatar Jun 17 '25 09:06 alandtse