forked from mosure/bevy_gaussian_splatting
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: precompute_covariance_3d * docs: credits * docs: todo cleanup * fix: clarify draw_indirect contents * docs: use go example * docs: remove bicycle from readme * docs: credits * chore: offline build support * feat: precomputed covariance 3d - f16, buffer_storage * fix: rotated covariance 3d * fix: simplify frag uv * docs: dynamic quad SH color * docs: early depth termination * docs: macos radix sort is unusable, MSAA may be too expensive * fix: buffer_textures build * docs: texture gcloud io * fix: disable vendor mode * fix: buffer_textures, precompute_cov3d support
- Loading branch information
Showing
27 changed files
with
631 additions
and
108 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
debug/ | ||
target/ | ||
vendor/ | ||
out/ | ||
Cargo.lock | ||
**/*.rs.bk | ||
|
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,49 @@ | ||
use bevy::math::{ | ||
Mat3, | ||
Vec3, | ||
Vec4, | ||
}; | ||
|
||
|
||
#[allow(non_snake_case)] | ||
pub fn compute_covariance_3d( | ||
rotation: Vec4, | ||
scale: Vec3, | ||
) -> [f32; 6] { | ||
let S = Mat3::from_diagonal(scale); | ||
|
||
let r = rotation.x; | ||
let x = rotation.y; | ||
let y = rotation.z; | ||
let z = rotation.w; | ||
|
||
let R = Mat3::from_cols( | ||
Vec3::new( | ||
1.0 - 2.0 * (y * y + z * z), | ||
2.0 * (x * y - r * z), | ||
2.0 * (x * z + r * y), | ||
), | ||
Vec3::new( | ||
2.0 * (x * y + r * z), | ||
1.0 - 2.0 * (x * x + z * z), | ||
2.0 * (y * z - r * x), | ||
), | ||
Vec3::new( | ||
2.0 * (x * z - r * y), | ||
2.0 * (y * z + r * x), | ||
1.0 - 2.0 * (x * x + y * y), | ||
), | ||
); | ||
|
||
let M = S * R; | ||
let Sigma = M.transpose() * M; | ||
|
||
[ | ||
Sigma.row(0).x, | ||
Sigma.row(0).y, | ||
Sigma.row(0).z, | ||
Sigma.row(1).y, | ||
Sigma.row(1).z, | ||
Sigma.row(2).z, | ||
] | ||
} |
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.