Skip to content

feat(weather-editor): full screen background blur#2009

Merged
alandtse merged 8 commits into
community-shaders:devfrom
Dlizzio:full-screen-background-blur
Mar 29, 2026
Merged

feat(weather-editor): full screen background blur#2009
alandtse merged 8 commits into
community-shaders:devfrom
Dlizzio:full-screen-background-blur

Conversation

@Dlizzio
Copy link
Copy Markdown
Contributor

@Dlizzio Dlizzio commented Mar 24, 2026

Adds fullscreen background blur to the weather editor when background blur is enabled. Works with framegen disabled and upscaling disabled.
Skyrim Special Edition 3_24_2026 12_20_49 AM

Summary by CodeRabbit

  • New Features

    • Background blur supports a single fullscreen mode when the Weather Editor is active, preserving full opacity for fullscreen compositing.
    • Weather Editor now reliably hides game HUD/menus on open and restores them on close.
  • Bug Fixes

    • More consistent open/close gating and auto-close behavior for the Weather Editor.
    • Hotkey and toolbar button reliably toggle the editor without depending on transient player/cell state.
    • Viewport toggle now synchronizes with background blur state.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 24, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Refactors Weather Editor open/close gating and lifecycle handling, adds game-menu visibility control, introduces a weather-editor fullscreen blur mode (toggled via BackgroundBlur API), and updates the blur shader to skip SDF rounded-rect masking when fullscreen blur mode is active.

Changes

Cohort / File(s) Summary
Shader Masking
package/Shaders/Menu/BackgroundBlurComposite.hlsl
Changed WindowParams.w semantics; wrapped SDF/AA/discard logic in if (WindowParams.w < 0.5f) so SDF masking is skipped when fullscreen blur mode is active.
Background Blur API & Mode
src/Menu/BackgroundBlur.cpp, src/Menu/BackgroundBlur.h
Added weatherEditorActive state and public SetWeatherEditorActive / IsWeatherEditorActive; switch to single fullscreen blur (cornerRadius = 0) and early-exit when active.
Editor Window Lifecycle
src/WeatherEditor/EditorWindow.cpp, src/WeatherEditor/EditorWindow.h
Moved open/close transition logic into UpdateOpenState(), added CanBeOpen(), HideGameMenus(), ShowGameMenus(), track gameMenusHidden, call ShowGameMenus() in destructor, and wire blur toggling on open/close.
UI/Input Wiring
src/Menu.cpp, src/Features/WeatherEditor.cpp, src/Menu/OverlayRenderer.cpp
Replaced ad-hoc player/parentCell checks with EditorWindow::CanBeOpen() for hotkey, settings UI, and overlay auto-close; simplified button label/enable and toggle behavior.
Blur Rendering Path
src/Menu/BackgroundBlur.cpp (internal functions)
Bypassed per-ImGui-window blur loop when weather-editor active and perform single fullscreen blur; ensured PerformBlur respects fullscreen mode.
Globals
src/Globals.cpp, src/Globals.h
Added exported global globals::game::player and initialize it from RE::PlayerCharacter::GetSingleton() on data load.

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant Menu as Menu / Hotkey
    participant Editor as EditorWindow
    participant UI as UI System
    participant Blur as BackgroundBlur
    participant Shader as BackgroundBlurComposite.hlsl

    User->>Menu: Press editor hotkey
    Menu->>Editor: Call CanBeOpen()
    Editor->>Editor: Validate player & cell + menus
    alt CanBeOpen == true
        Menu->>Editor: Set open = true
        Editor->>Editor: UpdateOpenState()
        Editor->>UI: HideGameMenus()
        Editor->>Blur: SetWeatherEditorActive(true)
        Blur->>Shader: Set WindowParams.w = 1.0
        Shader->>Shader: Skip SDF masking
    else CanBeOpen == false
        Menu-->>User: Ignore open request
    end

    User->>Editor: Close editor
    Editor->>Editor: Set open = false
    Editor->>Editor: UpdateOpenState()
    Editor->>UI: ShowGameMenus()
    Editor->>Blur: SetWeatherEditorActive(false)
    Blur->>Shader: Set WindowParams.w = 0.0
    Shader->>Shader: Resume SDF masking
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • alandtse
  • doodlum
  • davo0411

Poem

🐰 I hopped in code where corners hide,

Fullscreen waves let the SDF slide,
Menus tucked in a gentle sweep,
The blur now dreams while the editor peeks,
A rabbit cheers — the render's neat.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 8.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 fullscreen background blur to the weather editor, which is the central feature across all modified files.

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

🧹 Nitpick comments (1)
src/WeatherEditor/EditorWindow.h (1)

107-114: Consider hiding open behind this lifecycle API.

Now that open/close side effects live in UpdateOpenState(), every caller that writes open has to remember to schedule that sync separately. A small SetOpen(bool) / ToggleOpen() entry point would keep the blur/menu/camera bookkeeping local and make this much harder to regress.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/WeatherEditor/EditorWindow.h` around lines 107 - 114, Add a small
lifecycle API that encapsulates the open state: introduce SetOpen(bool) and
ToggleOpen() on the EditorWindow and make the raw `open` flag private (or stop
writing it directly). Implement SetOpen to update the internal `open` flag and
perform the existing side-effects now in UpdateOpenState (call
DisableVanityCamera/RestoreVanityCamera/HideGameMenus/ShowGameMenus or schedule
the same sync), and have ToggleOpen call SetOpen(!open). Update callers to use
SetOpen/ToggleOpen instead of writing `open` directly so all blur/menu/camera
bookkeeping remains local to EditorWindow and UpdateOpenState no longer requires
external syncs.
🤖 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/Menu/OverlayRenderer.cpp`:
- Around line 56-58: Move the editor lifecycle sync so it runs before the
early-return gate in ShouldSkipRendering(): ensure you call the block that
checks and sets editorWindow->open (including the EditorWindow::CanBeOpen()
check) and then editorWindow->UpdateOpenState() prior to invoking
ShouldSkipRendering() or returning early; this guarantees that any changes from
ProcessInputEventQueue() or the previous frame's close button are applied and
the close transition runs (preventing the D3D12 path from leaving
menu/hiding/camera/blur/session state latched).

---

Nitpick comments:
In `@src/WeatherEditor/EditorWindow.h`:
- Around line 107-114: Add a small lifecycle API that encapsulates the open
state: introduce SetOpen(bool) and ToggleOpen() on the EditorWindow and make the
raw `open` flag private (or stop writing it directly). Implement SetOpen to
update the internal `open` flag and perform the existing side-effects now in
UpdateOpenState (call
DisableVanityCamera/RestoreVanityCamera/HideGameMenus/ShowGameMenus or schedule
the same sync), and have ToggleOpen call SetOpen(!open). Update callers to use
SetOpen/ToggleOpen instead of writing `open` directly so all blur/menu/camera
bookkeeping remains local to EditorWindow and UpdateOpenState no longer requires
external syncs.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d1f230f5-c24d-4676-8e84-5e57b6261875

📥 Commits

Reviewing files that changed from the base of the PR and between 1ecfe2a and 2ba3c3e.

📒 Files selected for processing (8)
  • package/Shaders/Menu/BackgroundBlurComposite.hlsl
  • src/Features/WeatherEditor.cpp
  • src/Menu.cpp
  • src/Menu/BackgroundBlur.cpp
  • src/Menu/BackgroundBlur.h
  • src/Menu/OverlayRenderer.cpp
  • src/WeatherEditor/EditorWindow.cpp
  • src/WeatherEditor/EditorWindow.h

Comment thread src/Menu/OverlayRenderer.cpp Outdated
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 24, 2026

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

Copy link
Copy Markdown
Collaborator

@alandtse alandtse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just the one comment; otherwise good.

Comment thread src/WeatherEditor/EditorWindow.cpp Outdated

bool EditorWindow::CanBeOpen()
{
auto player = RE::PlayerCharacter::GetSingleton();
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we not have this as a global?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's not a global yet

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add it then.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

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.

🧹 Nitpick comments (1)
src/WeatherEditor/EditorWindow.cpp (1)

478-479: Consider using globals::game::player for consistency.

These lines still use RE::PlayerCharacter::GetSingleton() directly, while the new CanBeOpen() at line 1926 uses globals::game::player. For consistency across the file, consider replacing these direct singleton calls with the cached global.

♻️ Example change for line 478
-auto player = RE::PlayerCharacter::GetSingleton();
+auto player = globals::game::player;

Also applies to: 563-564, 963-964

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/WeatherEditor/EditorWindow.cpp` around lines 478 - 479, Replace direct
singleton calls to RE::PlayerCharacter::GetSingleton() with the cached global
globals::game::player for consistency with CanBeOpen(); specifically, where code
checks "auto player = RE::PlayerCharacter::GetSingleton();" and then uses
player->parentCell, change to use "auto player = globals::game::player" (or
null-check globals::game::player) and keep the existing parentCell check and
logic intact; apply the same replacement pattern in the other occurrences
mentioned so all player access in this file uses globals::game::player.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/WeatherEditor/EditorWindow.cpp`:
- Around line 478-479: Replace direct singleton calls to
RE::PlayerCharacter::GetSingleton() with the cached global globals::game::player
for consistency with CanBeOpen(); specifically, where code checks "auto player =
RE::PlayerCharacter::GetSingleton();" and then uses player->parentCell, change
to use "auto player = globals::game::player" (or null-check
globals::game::player) and keep the existing parentCell check and logic intact;
apply the same replacement pattern in the other occurrences mentioned so all
player access in this file uses globals::game::player.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ccaf0c99-0b85-4fb8-ac3e-d8303463e5da

📥 Commits

Reviewing files that changed from the base of the PR and between ab73d3c and 0f63acc.

📒 Files selected for processing (3)
  • src/Globals.cpp
  • src/Globals.h
  • src/WeatherEditor/EditorWindow.cpp

@alandtse
Copy link
Copy Markdown
Collaborator

Oh wait. You're doing at data loaded vs load game. Is it available then? You'd know because it'd break immediately. Just remembered the issue fixed with UW.

@Dlizzio
Copy link
Copy Markdown
Contributor Author

Dlizzio commented Mar 28, 2026

Oh wait. You're doing at data loaded vs load game. Is it available then? You'd know because it'd break immediately. Just remembered the issue fixed with UW.

Current implementation works the same as before, checked UW and saw nothing for a singleton timing fix.

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.

🧹 Nitpick comments (1)
src/Globals.h (1)

224-224: Add issue linkage in the PR description (if tracked).

Since this is a feature PR, consider adding Implements #... or Addresses #... for traceability.

As per coding guidelines: "Issue References (if PR fixes bugs or implements features): Suggest adding appropriate GitHub keywords."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/Globals.h` at line 224, The PR lacks an issue reference for traceability;
update the PR description to include a GitHub keyword linking to the tracked
issue (e.g., "Implements `#123`", "Addresses `#456`" or similar) and ensure it
mentions the feature tied to the Globals symbol RE::PlayerCharacter* player so
reviewers can map the change back to the issue; add the appropriate keyword line
to the PR description and, if applicable, note any related commit hashes or
milestone.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/Globals.h`:
- Line 224: The PR lacks an issue reference for traceability; update the PR
description to include a GitHub keyword linking to the tracked issue (e.g.,
"Implements `#123`", "Addresses `#456`" or similar) and ensure it mentions the
feature tied to the Globals symbol RE::PlayerCharacter* player so reviewers can
map the change back to the issue; add the appropriate keyword line to the PR
description and, if applicable, note any related commit hashes or milestone.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f575f7f3-b6ee-4c65-a8c0-f217a75c57b5

📥 Commits

Reviewing files that changed from the base of the PR and between 58bc3c7 and 151dd5f.

📒 Files selected for processing (2)
  • src/Globals.cpp
  • src/Globals.h

@alandtse alandtse merged commit d3b20bc into community-shaders:dev Mar 29, 2026
17 checks passed
@Dlizzio Dlizzio deleted the full-screen-background-blur branch March 31, 2026 05:07
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