Skip to content

Commit 7397c0e

Browse files
authored
Sync GLSL gsplat chunks with WGSL (#8072)
1 parent aa13e37 commit 7397c0e

File tree

3 files changed

+2
-3
lines changed

3 files changed

+2
-3
lines changed

src/scene/shader-lib/glsl/chunks/gsplat/vert/gsplatCommon.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default /* glsl */`
1111
1212
// modify the gaussian corner so it excludes gaussian regions with alpha less than 1/255
1313
void clipCorner(inout SplatCorner corner, float alpha) {
14-
float clip = min(1.0, sqrt(-log(1.0 / 255.0 / alpha)) / 2.0);
14+
float clip = min(1.0, sqrt(-log(1.0 / (255.0 * alpha))) / 2.0);
1515
corner.offset *= clip;
1616
corner.uv *= clip;
1717
}

src/scene/shader-lib/glsl/chunks/gsplat/vert/gsplatSogsColor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ uniform highp sampler2D packedSh0;
44
uniform float sh0_mins;
55
uniform float sh0_maxs;
66
7-
float SH_C0 = 0.28209479177387814;
7+
const float SH_C0 = 0.28209479177387814;
88
99
vec4 readColor(in SplatSource source) {
1010
vec3 clr = mix(vec3(sh0_mins), vec3(sh0_maxs), unpack111110(pack8888(texelFetch(packedSh0, source.uv, 0))));

src/scene/shader-lib/wgsl/chunks/gsplat/vert/gsplatCommon.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,4 @@ fn clipCorner(corner: ptr<function, SplatCorner>, alpha: f32) {
1515
corner.offset = corner.offset * clip;
1616
corner.uv = corner.uv * clip;
1717
}
18-
1918
`;

0 commit comments

Comments
 (0)