Skip to content

Conversation

@asd56585452
Copy link

Summary This PR updates the rendering pipeline to enable Z-Write and adjusts the blending mode. These changes ensure that Gaussian Splat objects interact correctly with the depth buffer, allowing multiple GS objects to properly occlude each other and integrate better with the rest of the scene. Additionally, a potential divide-by-zero error in the composite shader has been fixed.

Key Changes

Enabled Depth Occlusion (Z-Write)

Modified RenderGaussianSplats.shader to set ZWrite On and updated the Blend mode to One OneMinusSrcAlpha.

This ensures splats write to the depth buffer, which is critical for handling occlusion between different objects.

Adjusted Rendering Sort Order

Updated GaussianSplatRenderer.cs to invert the sorting logic for both render order and camera distance.

This reordering is necessary to support the changes in blending and depth writing.

Fixed Divide-by-Zero in Shader

Added a safety check in GaussianComposite.shader to verify if col.a > 0 before division.

This prevents NaN or invalid color values from appearing when the alpha channel is zero.

Impact

Inter-Object Occlusion: Multiple Gaussian Splat objects can now correctly occlude each other based on depth.

Scene Integration: Improved depth sorting and occlusion against other opaque scene geometry.

Stability: Eliminated rendering artifacts caused by invalid alpha division in the composite pass.

Before
image

After
image

@aras-p
Copy link
Owner

aras-p commented Dec 13, 2025

This PR is full of unrelated changes to unrelated files

@asd56585452
Copy link
Author

I delete unrelated files

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