Skip to content

Commit

Permalink
Merge branch 'main' into feat/2dgs
Browse files Browse the repository at this point in the history
  • Loading branch information
mosure authored Oct 16, 2024
2 parents 2b0c18e + 399fba9 commit a5be3a5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/gaussian/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ pub enum GaussianCloudRasterize {
#[reflect(Component)]
pub struct GaussianCloudSettings {
pub aabb: bool,
pub global_opacity: f32,
pub global_scale: f32,
pub transform: Transform,
pub opacity_adaptive_radius: bool,
Expand All @@ -74,6 +75,7 @@ impl Default for GaussianCloudSettings {
fn default() -> Self {
Self {
aabb: false,
global_opacity: 1.0,
global_scale: 1.0,
transform: Transform::IDENTITY,
opacity_adaptive_radius: true,
Expand Down
1 change: 1 addition & 0 deletions src/render/bindings.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

struct GaussianUniforms {
transform: mat4x4<f32>,
global_opacity: f32,
global_scale: f32,
count: u32,
count_root_ceil: u32,
Expand Down
2 changes: 1 addition & 1 deletion src/render/gaussian.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ fn vs_points(
// TODO: verify color benefit for ray_direction computed at quad verticies instead of gaussian center (same as current complexity)
output.color = vec4<f32>(
rgb,
opacity,
opacity * gaussian_uniforms.global_opacity,
);

#ifdef HIGHLIGHT_SELECTED
Expand Down
2 changes: 2 additions & 0 deletions src/render/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,7 @@ type DrawGaussians = (
#[derive(Component, ShaderType, Clone)]
pub struct GaussianCloudUniform {
pub transform: Mat4,
pub global_opacity: f32,
pub global_scale: f32,
pub count: u32,
pub count_root_ceil: u32,
Expand Down Expand Up @@ -746,6 +747,7 @@ pub fn extract_gaussians(

let settings_uniform = GaussianCloudUniform {
transform: settings.transform.compute_matrix(),
global_opacity: settings.global_opacity,
global_scale: settings.global_scale,
count: cloud.count as u32,
count_root_ceil: (cloud.count as f32).sqrt().ceil() as u32,
Expand Down

0 comments on commit a5be3a5

Please sign in to comment.