Expand internal splat scale encoding to e^[-12,9]. Lower zero cut-off to e^-30. Fix background color selection in editor. (#110)

This commit is contained in:
Andreas Sundquist
2025-07-11 10:48:10 -07:00
committed by GitHub
parent c8394665ec
commit dc07e02a33
10 changed files with 33 additions and 28 deletions
+4 -1
View File
@@ -4,12 +4,15 @@
// If these values are changed, the corresponding values in splatDefines.glsl
// must also be updated to match.
export const LN_SCALE_MIN = -9.0;
export const LN_SCALE_MIN = -12.0;
export const LN_SCALE_MAX = 9.0;
export const LN_RESCALE = (LN_SCALE_MAX - LN_SCALE_MIN) / 254.0; // 1..=255
export const SCALE_MIN = Math.exp(LN_SCALE_MIN);
export const SCALE_MAX = Math.exp(LN_SCALE_MAX);
export const LN_SCALE_ZERO = -30.0;
export const SCALE_ZERO = Math.exp(LN_SCALE_ZERO);
// Gsplats are stored in textures that are 2^11 x 2^11 x up to 2^11
// Most WebGL2 implementations support 2D textures up to 2^12 x 2^12 (max 16M Gsplats)
// 2D array textures and 3D textures up to 2^11 x 2^11 x 2^11 (max 8G Gsplats),