Skip to content

Commit

Permalink
Fixes for gsplat spherical harmonics (#7182)
Browse files Browse the repository at this point in the history
  • Loading branch information
slimbuck committed Dec 9, 2024
1 parent c017a1f commit 29a8a0c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/scene/gsplat/gsplat-compressed.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,10 @@ class GSplatCompressed {
const srcCoeffs = [3, 8, 15][shBands - 1];

for (let i = 0; i < numSplats; ++i) {
for (let j = 0; j < srcCoeffs; ++j) {
target0[i * 16 + j] = shData[(i * 3 + 0) * srcCoeffs + j];
target1[i * 16 + j] = shData[(i * 3 + 1) * srcCoeffs + j];
target2[i * 16 + j] = shData[(i * 3 + 2) * srcCoeffs + j];
for (let j = 0; j < 15; ++j) {
target0[i * 16 + j] = j < srcCoeffs ? shData[(i * 3 + 0) * srcCoeffs + j] : 127;
target1[i * 16 + j] = j < srcCoeffs ? shData[(i * 3 + 1) * srcCoeffs + j] : 127;
target2[i * 16 + j] = j < srcCoeffs ? shData[(i * 3 + 2) * srcCoeffs + j] : 127;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/scene/shader-lib/chunks/gsplat/vert/gsplat.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void main(void) {
// evaluate spherical harmonics
#if SH_BANDS > 0
clr.xyz += evalSH(state, projState));
clr.xyz += evalSH(state, projState);
#endif
applyClipping(projState, clr.w);
Expand Down

0 comments on commit 29a8a0c

Please sign in to comment.