Skip to content

Commit

Permalink
Fix covariance computation (#6100)
Browse files Browse the repository at this point in the history
  • Loading branch information
kemchenj authored Feb 29, 2024
1 parent 8ac33ba commit 6e54f72
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions src/scene/gsplat/shader-generator-gsplat.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,19 +118,22 @@ const splatCoreVS = `
void computeCov3d(in mat3 rot, in vec3 scale, out vec3 covA, out vec3 covB)
{
// M = S * R
vec3 M0 = scale[0] * rot[0];
vec3 M1 = scale[1] * rot[1];
vec3 M2 = scale[2] * rot[2];
mat3 M = transpose(mat3(
scale[0] * rot[0],
scale[1] * rot[1],
scale[2] * rot[2]
));
covA = vec3(
dot(M0, M0),
dot(M0, M1),
dot(M0, M2)
dot(M[0], M[0]),
dot(M[0], M[1]),
dot(M[0], M[2])
);
covB = vec3(
dot(M1, M1),
dot(M1, M2),
dot(M2, M2)
dot(M[1], M[1]),
dot(M[1], M[2]),
dot(M[2], M[2])
);
}
Expand Down

0 comments on commit 6e54f72

Please sign in to comment.