Skip to content

Commit

Permalink
fix: color correction, remove OBB conic, default to scale 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mosure committed Jan 3, 2024
1 parent 1166519 commit 8877a2d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/gaussian/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ impl Default for GaussianCloudSettings {
fn default() -> Self {
Self {
aabb: false,
global_scale: 2.0,
global_scale: 1.0,
global_transform: Transform::IDENTITY.into(),
visualize_bounding_box: false,
visualize_depth: false,
Expand Down
2 changes: 1 addition & 1 deletion src/material/spherical_harmonics.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,5 @@ fn spherical_harmonics_lookup(
color += shc[15] * vec3<f32>(sh[45], sh[46], sh[47]) * ray_direction.x * (rds.x - 3.0 * rds.y);
#endif

return srgb_to_linear(color);
return color;
}
8 changes: 4 additions & 4 deletions src/render/gaussian.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,9 @@ fn compute_cov2d(

var t = view.inverse_view * vec4<f32>(position, 1.0);

let device_pixel_ratio = 1.0;
let focal = vec2<f32>(
view.projection.x.x * device_pixel_ratio * view.viewport.z * 0.45,
view.projection.y.y * device_pixel_ratio * view.viewport.w * 0.45,
view.projection.x.x * view.viewport.z,
view.projection.y.y * view.viewport.w,
);

let s = 1.0 / (t.z * t.z);
Expand Down Expand Up @@ -347,7 +346,7 @@ fn vs_points(

let cov2d = compute_cov2d(transformed_position, get_scale(splat_index), get_rotation(splat_index));

// TODO: disable output.conic in obb mode
#ifdef USE_AABB
let det = cov2d.x * cov2d.z - cov2d.y * cov2d.y;
let det_inv = 1.0 / det;
let conic = vec3<f32>(
Expand All @@ -356,6 +355,7 @@ fn vs_points(
cov2d.x * det_inv
);
output.conic = conic;
#endif

let bb = get_bounding_box(
cov2d,
Expand Down

0 comments on commit 8877a2d

Please sign in to comment.