Skip to content

Commit

Permalink
fix: minor axis normal
Browse files Browse the repository at this point in the history
  • Loading branch information
mosure committed Jun 10, 2024
1 parent 8bed2b7 commit 08f6e4a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "bevy_gaussian_splatting"
description = "bevy gaussian splatting render pipeline plugin"
version = "2.2.0"
version = "2.2.1"
edition = "2021"
authors = ["mosure <[email protected]>"]
license = "MIT"
Expand Down
15 changes: 14 additions & 1 deletion src/render/gaussian.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,17 @@ fn get_bounding_box(
// // TODO: compute cov2d, color (any non-quad gaussian property)
// }

fn inverted_infinity_norm(v: vec3<f32>) -> vec3<f32> {
let min_value = min(v.x, min(v.y, v.z));
let min_vec = vec3<f32>(min_value);

return select(
vec3<f32>(0.0),
vec3<f32>(1.0),
v == min_vec,
);
}


@vertex
fn vs_points(
Expand Down Expand Up @@ -395,7 +406,9 @@ fn vs_points(
);

let R = get_rotation_matrix(get_rotation(splat_index));
let S = get_scale_matrix(get_scale(splat_index));
let scale = get_scale(splat_index);
let scale_inf = inverted_infinity_norm(scale);
let S = get_scale_matrix(scale_inf);

let M = S * R;
let Sigma = transpose(M) * M;
Expand Down

0 comments on commit 08f6e4a

Please sign in to comment.