From 8877a2dd8051aae9745e1cf8bf7f1f2e4bd05659 Mon Sep 17 00:00:00 2001 From: mosure Date: Tue, 2 Jan 2024 19:51:21 -0600 Subject: [PATCH] fix: color correction, remove OBB conic, default to scale 1.0 --- src/gaussian/settings.rs | 2 +- src/material/spherical_harmonics.wgsl | 2 +- src/render/gaussian.wgsl | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/gaussian/settings.rs b/src/gaussian/settings.rs index 6f4d7b66..b9a941aa 100644 --- a/src/gaussian/settings.rs +++ b/src/gaussian/settings.rs @@ -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, diff --git a/src/material/spherical_harmonics.wgsl b/src/material/spherical_harmonics.wgsl index fbe5465d..9e1bfa50 100644 --- a/src/material/spherical_harmonics.wgsl +++ b/src/material/spherical_harmonics.wgsl @@ -65,5 +65,5 @@ fn spherical_harmonics_lookup( color += shc[15] * vec3(sh[45], sh[46], sh[47]) * ray_direction.x * (rds.x - 3.0 * rds.y); #endif - return srgb_to_linear(color); + return color; } diff --git a/src/render/gaussian.wgsl b/src/render/gaussian.wgsl index 175fd3de..20610e5b 100644 --- a/src/render/gaussian.wgsl +++ b/src/render/gaussian.wgsl @@ -151,10 +151,9 @@ fn compute_cov2d( var t = view.inverse_view * vec4(position, 1.0); - let device_pixel_ratio = 1.0; let focal = vec2( - 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); @@ -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( @@ -356,6 +355,7 @@ fn vs_points( cov2d.x * det_inv ); output.conic = conic; +#endif let bb = get_bounding_box( cov2d,