Skip to content

Conversation

@slimbuck
Copy link
Member

Fix for gaussian splats on webgpu.

Webgpu uses z clip range of 0..1, unlike webgl which uses range -1..1.

@slimbuck slimbuck added bug Something isn't working area: graphics Graphics related issue labels Apr 25, 2025
@slimbuck slimbuck requested review from a team and Copilot April 25, 2025 12:47
@slimbuck slimbuck self-assigned this Apr 25, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request fixes the Gaussian splat shader rendering for WebGPU by adjusting the z clipping range to account for WebGPU’s clip-space (0..1) as opposed to WebGL’s (-1..1).

  • Updates z clipping clamp values using a preprocessor directive for WEBGPU
  • Retains the existing behavior for WebGL using a conditional compilation branch
Comments suppressed due to low confidence (1)

src/scene/shader-lib/chunks/gsplat/vert/gsplatCenter.js:19

  • Consider adding tests to verify that the shader behaves correctly with the updated z clipping configuration for both WEBGPU and WebGL, ensuring that the intended behavior is maintained.
#if WEBGPU

@slimbuck slimbuck merged commit 8b8da53 into playcanvas:main Apr 25, 2025
7 checks passed
@slimbuck slimbuck deleted the render-fix branch April 25, 2025 12:50
slimbuck added a commit that referenced this pull request Apr 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: graphics Graphics related issue bug Something isn't working

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants