-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Further gsplat shader refinements (#7185)
- Loading branch information
Showing
16 changed files
with
222 additions
and
186 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
export default /* glsl */` | ||
uniform mat4 matrix_model; | ||
uniform mat4 matrix_view; | ||
uniform mat4 matrix_projection; | ||
// project the model space gaussian center to view and clip space | ||
bool initCenter(SplatSource source, vec3 modelCenter, out SplatCenter center) { | ||
mat4 modelView = matrix_view * matrix_model; | ||
vec4 centerView = modelView * vec4(modelCenter, 1.0); | ||
// early out if splat is behind the camear | ||
if (centerView.z > 0.0) { | ||
return false; | ||
} | ||
vec4 centerProj = matrix_projection * centerView; | ||
// ensure gaussians are not clipped by camera near and far | ||
centerProj.z = clamp(centerProj.z, -abs(centerProj.w), abs(centerProj.w)); | ||
center.view = centerView.xyz / centerView.w; | ||
center.proj = centerProj; | ||
center.projMat00 = matrix_projection[0][0]; | ||
center.modelView = modelView; | ||
return true; | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.