Skip to content

Commit

Permalink
Fixes for gsplat spherical harmonics (playcanvas#7182)
Browse files Browse the repository at this point in the history
  • Loading branch information
slimbuck committed Dec 9, 2024
1 parent 9704599 commit 8a92135
Showing 1 changed file with 4 additions and 4 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 @@ -103,10 +103,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

0 comments on commit 8a92135

Please sign in to comment.