Skip to content

Commit

Permalink
fix: precomputed covariance surfel incompatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
mosure committed Dec 17, 2024
1 parent 2d25dd2 commit cb1b07e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 35 deletions.
11 changes: 7 additions & 4 deletions src/render/gaussian.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,18 @@
get_rotation_matrix,
get_scale_matrix,
}
#import bevy_gaussian_splatting::transform::{
world_to_clip,
in_frustum,
}

#ifdef GAUSSIAN_SURFEL
#import bevy_gaussian_splatting::surfel::{
compute_cov2d_surfel,
get_bounding_box_cov2d,
surfel_fragment_power,
}
#import bevy_gaussian_splatting::transform::{
world_to_clip,
in_frustum,
}
#endif

#ifdef PACKED
#ifdef PRECOMPUTE_COVARIANCE_3D
Expand Down
35 changes: 4 additions & 31 deletions src/render/surfel.wgsl
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#define_import_path bevy_gaussian_splatting::surfel


#ifdef GAUSSIAN_SURFEL
#import bevy_gaussian_splatting::bindings::{
view,
gaussian_uniforms,
Expand All @@ -11,15 +13,6 @@
}

#ifdef PACKED
#ifdef PRECOMPUTE_COVARIANCE_3D
#import bevy_gaussian_splatting::packed::{
get_position,
get_color,
get_visibility,
get_opacity,
get_cov3d,
}
#else
#import bevy_gaussian_splatting::packed::{
get_position,
get_color,
Expand All @@ -28,19 +21,9 @@
get_rotation,
get_scale,
}
#endif
#else

#ifdef BUFFER_STORAGE
#ifdef PRECOMPUTE_COVARIANCE_3D
#import bevy_gaussian_splatting::planar::{
get_position,
get_color,
get_visibility,
get_opacity,
get_cov3d,
}
#else
#import bevy_gaussian_splatting::planar::{
get_position,
get_color,
Expand All @@ -50,22 +33,11 @@
get_scale,
}
#endif
#endif

#endif


#ifdef BUFFER_TEXTURE
#ifdef PRECOMPUTE_COVARIANCE_3D
#import bevy_gaussian_splatting::texture::{
get_position,
get_color,
get_visibility,
get_opacity,
get_cov3d,
location,
}
#else
#import bevy_gaussian_splatting::texture::{
get_position,
get_color,
Expand All @@ -76,7 +48,6 @@
location,
}
#endif
#endif


struct Surfel {
Expand Down Expand Up @@ -195,3 +166,5 @@ fn surfel_fragment_power(

return power;
}

#endif // GAUSSIAN_SURFEL

0 comments on commit cb1b07e

Please sign in to comment.