Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small change to splat shader in a way model matrix is used #6101

Merged
merged 1 commit into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions examples/src/examples/loaders/gsplat-many/example.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ assetListLoader.load(() => {

const material = guitar.gsplat.material;
material.setParameter('uTime', currentTime);


biker2.rotate(0, 80 * dt, 0);

});
});

Expand Down
5 changes: 3 additions & 2 deletions src/scene/gsplat/shader-generator-gsplat.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ const splatCoreVS = `
#else
vec3 splat_cova;
vec3 splat_covb;
computeCov3d(mat3(matrix_model) * quatToMat3(rotation), scale, splat_cova, splat_covb);
computeCov3d(quatToMat3(rotation), scale, splat_cova, splat_covb);

mat3 Vrk = mat3(
splat_cova.x, splat_cova.y, splat_cova.z,
Expand All @@ -191,7 +191,8 @@ const splatCoreVS = `
0., 0., 0.
);

mat3 W = transpose(mat3(matrix_view));
mat3 W = transpose(mat3(matrix_view) * mat3(matrix_model));

mat3 T = W * J;
mat3 cov = transpose(T) * Vrk * T;

Expand Down