@@ -294,14 +294,8 @@ export class SparkRenderer extends THREE.Mesh {
294
294
vertexShader : shaders . splatVertex ,
295
295
fragmentShader : shaders . splatFragment ,
296
296
uniforms,
297
+ premultipliedAlpha,
297
298
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 ,
305
299
depthTest : true ,
306
300
depthWrite : false ,
307
301
side : THREE . DoubleSide ,
@@ -435,8 +429,6 @@ export class SparkRenderer extends THREE.Mesh {
435
429
time : { value : 0 } ,
436
430
// Delta time in seconds since last frame
437
431
deltaTime : { value : 0 } ,
438
- // Whether to use premultiplied alpha when accumulating splat RGB
439
- premultipliedAlpha : { value : true } ,
440
432
// Whether to encode Gsplat with linear RGB (for environment mapping)
441
433
encodeLinear : { value : false } ,
442
434
// Debug flag that alternates each frame
@@ -531,20 +523,10 @@ export class SparkRenderer extends THREE.Mesh {
531
523
532
524
if ( isNewFrame ) {
533
525
// 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 ;
545
528
this . material . needsUpdate = true ;
546
529
}
547
- this . uniforms . premultipliedAlpha . value = this . premultipliedAlpha ;
548
530
this . uniforms . time . value = time ;
549
531
this . uniforms . deltaTime . value = deltaTime ;
550
532
// Alternating debug flag that can aid in visual debugging
0 commit comments