Skip to content

Commit f3298cf

Browse files
committed
Gsplat render fix for wgpu (#7609)
1 parent fcf05aa commit f3298cf

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ bool initCenter(vec3 modelCenter, out SplatCenter center) {
1616
vec4 centerProj = matrix_projection * centerView;
1717
1818
// ensure gaussians are not clipped by camera near and far
19+
#if WEBGPU
20+
centerProj.z = clamp(centerProj.z, 0, abs(centerProj.w));
21+
#else
1922
centerProj.z = clamp(centerProj.z, -abs(centerProj.w), abs(centerProj.w));
23+
#endif
2024
2125
center.view = centerView.xyz / centerView.w;
2226
center.proj = centerProj;

0 commit comments

Comments
 (0)