Skip to content

Commit

Permalink
feat: sh degree feature flags
Browse files Browse the repository at this point in the history
  • Loading branch information
mosure committed Oct 3, 2024
1 parent 9df6508 commit 39af338
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
9 changes: 8 additions & 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.4.3"
version = "2.5.0"
edition = "2021"
authors = ["mosure <[email protected]>"]
license = "MIT"
Expand Down Expand Up @@ -46,6 +46,7 @@ default = [

# "f32",
"f16",
"sh3",

# "precompute_covariance_3d",

Expand Down Expand Up @@ -77,6 +78,11 @@ noise = []
f32 = []
f16 = ["half"]

sh0 = []
sh1 = []
sh2 = []
sh3 = []

precompute_covariance_3d = []

packed = []
Expand Down Expand Up @@ -119,6 +125,7 @@ viewer = [
web = [
"buffer_storage",
"f16",
"sh0",
"io_flexbuffers",
"io_ply",
"planar",
Expand Down
10 changes: 8 additions & 2 deletions src/material/spherical_harmonics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,16 @@ const fn num_sh_coefficients(degree: usize) -> usize {
}


#[cfg(feature = "web")]
#[cfg(feature = "sh0")]
const SH_DEGREE: usize = 0;

#[cfg(not(feature = "web"))]
#[cfg(feature = "sh1")]
const SH_DEGREE: usize = 1;

#[cfg(feature = "sh2")]
const SH_DEGREE: usize = 2;

#[cfg(feature = "sh3")]
const SH_DEGREE: usize = 3;

pub const SH_CHANNELS: usize = 3;
Expand Down

0 comments on commit 39af338

Please sign in to comment.