Skip to content

fix(dynamic cubemap): blend native cubemap fallback#2328

Merged
alandtse merged 5 commits into
community-shaders:devfrom
Dlizzio:fix-dynamic-cubemap
May 15, 2026
Merged

fix(dynamic cubemap): blend native cubemap fallback#2328
alandtse merged 5 commits into
community-shaders:devfrom
Dlizzio:fix-dynamic-cubemap

Conversation

@Dlizzio
Copy link
Copy Markdown
Contributor

@Dlizzio Dlizzio commented May 12, 2026

Blends native cubemap fallback in dynamic cubemap reflections %50 and adds a slider in the UI.

Before (player is under shaded area):
Skyrim Special Edition 5_11_2026 9_36_47 PM

After (player is under shaded area):
Skyrim Special Edition 5_11_2026 11_33_48 PM

Summary by CodeRabbit

  • New Features

    • Added a "Native Cubemap Fallback" slider (with tooltip) to control blending of inferred and sampled reflections; value is clamped and applied at runtime.
    • Added an option to enable/disable screen-space reflections (SSR) in the Dynamic Cubemaps settings.
  • Chores

    • Bumped shader feature version.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 12, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c9ad3ba7-c4f4-49a0-a9c0-65e4a9cdc727

📥 Commits

Reviewing files that changed from the base of the PR and between efb0995 and 94f36d8.

📒 Files selected for processing (1)
  • src/Features/DynamicCubemaps.cpp
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/Features/DynamicCubemaps.cpp

📝 Walkthrough

Walkthrough

Adds a user-configurable ReflectionFallbackAmount to Dynamic Cubemaps: defined in C++ headers, persisted via JSON, exposed in ImGui, passed into the GPU constant buffer, and applied in the compute shader to scale fallback reflection blending.

Changes

Reflection Fallback Amount Feature

Layer / File(s) Summary
Settings contract and bounds definition
src/Features/DynamicCubemaps.h
Three new static constexpr floats define reflection fallback min, max, and default values. The nested Settings struct gains ReflectionFallbackAmount initialized to the default with adjusted padding and preserved 16-byte alignment.
Settings UI and serialization
src/Features/DynamicCubemaps.cpp
DynamicCubemaps::Settings JSON mapping now includes ReflectionFallbackAmount. An ImGui "Native Cubemap Fallback" slider is added (always-clamped) with a tooltip; loaded values are clamped in LoadSettings().
GPU constant buffer and shader integration
package/Shaders/Common/SharedData.hlsli, features/Dynamic Cubemaps/Shaders/DynamicCubemaps/InferCubemapCS.hlsl
CubemapCreatorSettings adds EnabledSSR and ReflectionFallbackAmount with padding adjustments. The infer shader multiplies saturate(mipLevel / 7.0) by cubemapCreatorSettings.ReflectionFallbackAmount to compute the fallback blend weight used in lerp.
Feature version metadata
features/Dynamic Cubemaps/Shaders/Features/DynamicCubemaps.ini
Version bumped from 2-3-1 to 2-3-2.

Sequence Diagram(s)

sequenceDiagram
  participant ImGui as ImGui (Editor)
  participant Settings as DynamicCubemaps::Settings
  participant CB as SharedData::CubemapCreatorSettings
  participant Shader as InferCubemapCS

  ImGui->>Settings: slider sets ReflectionFallbackAmount
  Settings->>Settings: clamp to kReflectionFallbackMin/Max
  Settings->>CB: write ReflectionFallbackAmount into constant buffer
  Shader->>CB: read ReflectionFallbackAmount
  Shader->>Shader: compute fallbackWeight = saturate(mipLevel/7.0) * ReflectionFallbackAmount
  Shader->>Shader: blend sampled reflections using fallbackWeight
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • doodlum
  • alandtse

Poem

I hop through cubemap fields so bright,
A slider tunes fallback just right,
From UI to GPU the numbers stream,
Shaders blend reflections in a dream,
A rabbit’s cheer for polished light 🐇✨

🚥 Pre-merge checks | ✅ 4 | ❌ 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 (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix(dynamic cubemap): blend native cubemap fallback' directly matches the main changeset objective: adding blending for native cubemap fallback into dynamic cubemap reflections with a configurable slider.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@Dlizzio Dlizzio changed the title fix(dynamic cubemap): reduce native cubemap fallback fix(dynamic cubemap): blend native cubemap fallback May 12, 2026
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)
features/Dynamic Cubemaps/Shaders/Features/DynamicCubemaps.ini (1)

2-2: Consider tightening PR metadata for traceability.

Suggested title (<=50 chars): fix(dynamiccubemaps): reduce fallback blend
If this maps to a tracked issue, add Fixes #<id> in the PR description.

As per coding guidelines, "provide suggestions for Conventional Commit Titles" and "Suggest adding appropriate GitHub keywords: 'Fixes #123' or 'Closes #123'."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@features/Dynamic` Cubemaps/Shaders/Features/DynamicCubemaps.ini at line 2,
Update the PR metadata: set the PR title to the suggested Conventional Commit
short title "fix(dynamiccubemaps): reduce fallback blend" and add a GitHub
keyword line like "Fixes #<id>" in the PR description (replace <id> with the
tracked issue number); reference the DynamicCubemaps module by mentioning
Features/Dynamic Cubemaps/Shaders/Features/DynamicCubemaps.ini (e.g., the
Version = 2-3-2 entry) in the PR body if helpful for traceability.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@features/Dynamic` Cubemaps/Shaders/Features/DynamicCubemaps.ini:
- Line 2: Update the PR metadata: set the PR title to the suggested Conventional
Commit short title "fix(dynamiccubemaps): reduce fallback blend" and add a
GitHub keyword line like "Fixes #<id>" in the PR description (replace <id> with
the tracked issue number); reference the DynamicCubemaps module by mentioning
Features/Dynamic Cubemaps/Shaders/Features/DynamicCubemaps.ini (e.g., the
Version = 2-3-2 entry) in the PR body if helpful for traceability.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: ad3bbb2f-578c-4b15-9a56-9b12407f7d30

📥 Commits

Reviewing files that changed from the base of the PR and between 9a3e7b5 and efb0995.

📒 Files selected for processing (5)
  • features/Dynamic Cubemaps/Shaders/DynamicCubemaps/InferCubemapCS.hlsl
  • features/Dynamic Cubemaps/Shaders/Features/DynamicCubemaps.ini
  • package/Shaders/Common/SharedData.hlsli
  • src/Features/DynamicCubemaps.cpp
  • src/Features/DynamicCubemaps.h

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 12, 2026

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

@SkrubbySkrubInAShrub
Copy link
Copy Markdown
Collaborator

When enabling IBL the effect of this significantly diminishes. I am not sure if it is a worthwile slider to add when IBL already has such a massive impact on the same metallics.

@Dlizzio
Copy link
Copy Markdown
Contributor Author

Dlizzio commented May 13, 2026

When enabling IBL the effect of this significantly diminishes. I am not sure if it is a worthwile slider to add when IBL already has such a massive impact on the same metallics.

IBL has nothing to do with this. Also, metallics are broken with IBL unless you use DALC.

@SkrubbySkrubInAShrub
Copy link
Copy Markdown
Collaborator

Okay this slider makes sense, Am just surprised that it wasn't done like this before.

@alandtse alandtse merged commit 27d3e95 into community-shaders:dev May 15, 2026
11 checks passed
ParticleTroned pushed a commit to ParticleTroned/skyrim-community-shaders that referenced this pull request May 16, 2026
IgorAlanAlbuquerque pushed a commit to IgorAlanAlbuquerque/skyrim-community-shaders that referenced this pull request May 29, 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