Skip to content

feat(VR): separate interior/exterior options for depth buffer culling#1362

Merged
alandtse merged 2 commits into
community-shaders:devfrom
sicsix:vr-db-culling-opts
Aug 4, 2025
Merged

feat(VR): separate interior/exterior options for depth buffer culling#1362
alandtse merged 2 commits into
community-shaders:devfrom
sicsix:vr-db-culling-opts

Conversation

@sicsix
Copy link
Copy Markdown
Collaborator

@sicsix sicsix commented Aug 4, 2025

  • adds separate controls to enable/disable depth buffer culling in interiors and exteriors - interiors benefit the least and have unavoidable occasional but distracting visual glitches due to the technique used
  • fixes the regression where both the enabled/disabled state and gMinOccludeeBoxExtent were no longer being set when changing settings in the UI

Summary by CodeRabbit

  • New Features

    • Added separate options to enable depth buffer culling for interior and exterior environments in VR settings.
    • Updated the VR settings interface to provide two distinct checkboxes for controlling depth buffer culling in interiors and exteriors, each with its own tooltip.
  • Improvements

    • The minimum occludee box extent slider now applies changes immediately when adjusted.
    • Enhanced runtime logic to respect the new separate culling settings based on environment type.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Aug 4, 2025

Walkthrough

The changes split the VR depth buffer culling setting into two separate options for interior and exterior environments, update the settings structure and UI accordingly, and introduce a new lifecycle method (EarlyPrepass) to set the culling flag based on the current environment. Unused includes are removed, and settings serialization is updated.

Changes

Cohort / File(s) Change Summary
VR Depth Buffer Culling Settings Refactor
src/Features/VR.cpp, src/Features/VR.h
Split single depth buffer culling boolean into two (interior/exterior); updated settings struct, serialization, and UI; added EarlyPrepass() method; removed unused include; adjusted method logic to use new settings.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant VR_Settings_UI
    participant VR_Feature

    User->>VR_Settings_UI: Toggle culling checkboxes (interior/exterior)
    VR_Settings_UI->>VR_Feature: Update Settings (EnableDepthBufferCullingInterior/Exterior)
    VR_Feature->>VR_Feature: EarlyPrepass()
    VR_Feature->>VR_Feature: Set culling flag based on current environment
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15 minutes

Suggested reviewers

  • alandtse

Poem

Two checkboxes now, not just one,
For culling depth, the work is done!
Interiors cozy, exteriors wide—
Each gets a toggle, no need to hide.
Rabbits hop through code so neat,
With EarlyPrepass, the cycle’s complete!
🐇✨


📜 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 e39f8cc and 175880a.

📒 Files selected for processing (2)
  • src/Features/VR.cpp (3 hunks)
  • src/Features/VR.h (2 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 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.
Learnt from: alandtse
PR: doodlum/skyrim-community-shaders#0
File: :0-0
Timestamp: 2025-07-05T05:20:45.823Z
Learning: In the skyrim-community-shaders repository, file deletion error handling improvements that replace existence checks and try-catch blocks with std::filesystem::remove error-code-based approaches are considered bug fixes rather than refactoring, as they address inadequate error handling and misleading log messages.
Learnt from: jiayev
PR: doodlum/skyrim-community-shaders#0
File: :0-0
Timestamp: 2025-08-03T18:37:19.673Z
Learning: ISReflectionsRayTracing.hlsl and ISWorldMap.hlsl in the skyrim-community-shaders repository are image-space post-processing shaders that perform color sampling and blending operations that need proper linear color space handling for the linear lighting system. ISReflectionsRayTracing handles screen-space reflections and should use conditional Color::IrradianceToLinear/Gamma conversions similar to ISCompositeLensFlareVolumetricLighting.hlsl. ISWorldMap performs 7x7 color accumulation that should be done in linear space similar to the pattern used in ISSAOComposite.hlsl.
Learnt from: jiayev
PR: doodlum/skyrim-community-shaders#0
File: :0-0
Timestamp: 2025-07-18T15:21:03.641Z
Learning: In the skyrim-community-shaders rendering pipeline, materials with alpha < 1 or alpha blending enabled are rendered in non-deferred mode rather than deferred mode. This means issues with dynamic cubemaps on transparent materials are actually non-deferred rendering issues.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build plugin and addons
🔇 Additional comments (7)
src/Features/VR.h (2)

283-283: LGTM! New lifecycle method added for early rendering pass.

The addition of the EarlyPrepass() virtual method provides a proper lifecycle hook for setting the depth buffer culling flag based on the current environment (interior vs exterior) before the main rendering pass begins.


315-317: Excellent separation of interior/exterior depth buffer culling controls.

The split from a single EnableDepthBufferCulling boolean to separate EnableDepthBufferCullingExterior (default true) and EnableDepthBufferCullingInterior (default false) addresses the core PR objective. The default values are well-chosen: exteriors benefit from depth buffer culling for VR performance, while interiors are disabled by default to avoid visual glitches mentioned in the PR description.

The repositioning of MinOccludeeBoxExtent after the culling settings maintains logical grouping of related performance optimization parameters.

src/Features/VR.cpp (5)

32-33: LGTM!

The JSON serialization correctly replaces the single depth buffer culling field with two separate fields for interior and exterior environments. The field names are descriptive and follow the existing naming conventions.


114-114: Good default choice for initialization.

Setting the global depth buffer culling flag to the exterior setting during initialization makes sense as a reasonable default, since the EarlyPrepass() method will dynamically update it based on the current environment.


118-121: Excellent implementation of dynamic depth buffer culling.

The EarlyPrepass() method correctly implements the core feature by dynamically setting the depth buffer culling flag based on the current environment. The logic is sound: interior cells use the interior setting, exterior cells use the exterior setting.


560-567: Well-designed UI for the new feature.

The UI correctly splits the single depth buffer culling option into two separate checkboxes with clear labels and helpful tooltips. The tooltips provide valuable guidance on the performance/quality tradeoffs and align with the PR's stated goals.


568-569: Good fix for the settings regression.

The immediate update of gMinOccludeeBoxExtent when the slider changes addresses the regression mentioned in the PR objectives. This ensures the parameter is updated in real-time rather than only on save, providing better user experience.

✨ 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

github-actions Bot commented Aug 4, 2025

Using provided base ref: e39f8cc
Using base ref: e39f8cc
Base commit date: 2025-08-03T17:49:27-07:00 (Sunday, August 03, 2025 05:49 PM)
No actionable suggestions for changed features.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Aug 4, 2025

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

@alandtse alandtse merged commit 3f1ec27 into community-shaders:dev Aug 4, 2025
15 checks passed
alandtse added a commit to alandtse/open-shaders that referenced this pull request May 20, 2026
Move the vcpkg pin from 1f1738c2 to wolfpld/tracy@14a1a322
(upstream master HEAD) to pick up 12 newer commits, notably
upstream PR community-shaders#1362 which adds the save_trace MCP tool plus
parent-callstack and JSON-callstack improvements. Keeps the
client baked into the game in protocol/source sync with locally
built tracy-profiler and the MCP server.

The build-tools.patch context is unchanged at the new commit
(tail of CMakeLists.txt, head of cmake/server.cmake and
cmake/vendor.cmake all match), so the patch still applies
cleanly with no edits.

Version-string normalized to 0.13.3-14a1a322 (dropped the
ad-hoc "-enable" suffix; the commit hash already gives vcpkg
a unique cache key).

Verified: tracy[core,crash-handler,on-demand]@0.13.3-14a1a322
installs cleanly, TracyClient.lib stays ~2.4 MB with
TRACY_ENABLE;TRACY_ON_DEMAND on the imported target's
INTERFACE_COMPILE_DEFINITIONS, CommunityShaders.dll rebuilds
and deploys.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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