From e9a5cc762739b8d8f8c7241c9680b3613cb10281 Mon Sep 17 00:00:00 2001 From: Donovan Hutchence Date: Fri, 6 Dec 2024 15:12:36 +0000 Subject: [PATCH] Fix negative tonemapped values (#7179) --- src/scene/shader-lib/chunks/gsplat/vert/gsplat.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scene/shader-lib/chunks/gsplat/vert/gsplat.js b/src/scene/shader-lib/chunks/gsplat/vert/gsplat.js index c14f955df23..ef59c49cbd8 100644 --- a/src/scene/shader-lib/chunks/gsplat/vert/gsplat.js +++ b/src/scene/shader-lib/chunks/gsplat/vert/gsplat.js @@ -32,7 +32,7 @@ void main(void) { // evaluate spherical harmonics #if SH_BANDS > 0 - clr.xyz = max(vec3(0.0), clr.xyz + evalSH(state, projState)); + clr.xyz += evalSH(state, projState)); #endif applyClipping(projState, clr.w); @@ -40,7 +40,7 @@ void main(void) { // write output gl_Position = projState.cornerProj; gaussianUV = projState.cornerUV; - gaussianColor = vec4(prepareOutputFromGamma(clr.xyz), clr.w); + gaussianColor = vec4(prepareOutputFromGamma(max(clr.xyz, 0.0)), clr.w); #ifndef DITHER_NONE id = float(state.id);