@@ -294,14 +294,8 @@ export class SparkRenderer extends THREE.Mesh {
294294 vertexShader : shaders . splatVertex ,
295295 fragmentShader : shaders . splatFragment ,
296296 uniforms,
297+ premultipliedAlpha,
297298 transparent : true ,
298- blending : premultipliedAlpha
299- ? THREE . CustomBlending
300- : THREE . NormalBlending ,
301- blendSrc : premultipliedAlpha ? THREE . OneFactor : THREE . SrcAlphaFactor ,
302- blendDst : premultipliedAlpha
303- ? THREE . OneMinusSrcAlphaFactor
304- : THREE . OneFactor ,
305299 depthTest : true ,
306300 depthWrite : false ,
307301 side : THREE . DoubleSide ,
@@ -435,8 +429,6 @@ export class SparkRenderer extends THREE.Mesh {
435429 time : { value : 0 } ,
436430 // Delta time in seconds since last frame
437431 deltaTime : { value : 0 } ,
438- // Whether to use premultiplied alpha when accumulating splat RGB
439- premultipliedAlpha : { value : true } ,
440432 // Whether to encode Gsplat with linear RGB (for environment mapping)
441433 encodeLinear : { value : false } ,
442434 // Debug flag that alternates each frame
@@ -531,20 +523,10 @@ export class SparkRenderer extends THREE.Mesh {
531523
532524 if ( isNewFrame ) {
533525 // Keep these uniforms the same for both eyes if in WebXR
534- const blending = this . premultipliedAlpha
535- ? THREE . CustomBlending
536- : THREE . NormalBlending ;
537- if ( blending !== this . material . blending ) {
538- this . material . blending = blending ;
539- this . material . blendSrc = this . premultipliedAlpha
540- ? THREE . OneFactor
541- : THREE . SrcAlphaFactor ;
542- this . material . blendDst = this . premultipliedAlpha
543- ? THREE . OneMinusSrcAlphaFactor
544- : THREE . OneFactor ;
526+ if ( this . material . premultipliedAlpha !== this . premultipliedAlpha ) {
527+ this . material . premultipliedAlpha = this . premultipliedAlpha ;
545528 this . material . needsUpdate = true ;
546529 }
547- this . uniforms . premultipliedAlpha . value = this . premultipliedAlpha ;
548530 this . uniforms . time . value = time ;
549531 this . uniforms . deltaTime . value = deltaTime ;
550532 // Alternating debug flag that can aid in visual debugging
0 commit comments