@@ -59,6 +59,7 @@ export class DepthOfFieldEffect extends Effect {
5959 [ "nearColorBuffer" , new Uniform ( null ) ] ,
6060 [ "farColorBuffer" , new Uniform ( null ) ] ,
6161 [ "nearCoCBuffer" , new Uniform ( null ) ] ,
62+ [ "farCoCBuffer" , new Uniform ( null ) ] ,
6263 [ "scale" , new Uniform ( 1.0 ) ]
6364 ] )
6465 } ) ;
@@ -126,6 +127,7 @@ export class DepthOfFieldEffect extends Effect {
126127
127128 this . renderTargetCoC = this . renderTarget . clone ( ) ;
128129 this . renderTargetCoC . texture . name = "DoF.CoC" ;
130+ this . uniforms . get ( "farCoCBuffer" ) . value = this . renderTargetCoC . texture ;
129131
130132 /**
131133 * A render target that stores a blurred copy of the circle of confusion.
@@ -180,7 +182,7 @@ export class DepthOfFieldEffect extends Effect {
180182
181183 this . maskPass = new ShaderPass ( new MaskMaterial ( this . renderTargetCoC . texture ) ) ;
182184 const maskMaterial = this . maskPass . fullscreenMaterial ;
183- maskMaterial . maskFunction = MaskFunction . MULTIPLY_RGB_SET_ALPHA ;
185+ maskMaterial . maskFunction = MaskFunction . MULTIPLY_RGB ;
184186 maskMaterial . colorChannel = ColorChannel . GREEN ;
185187
186188 /**
@@ -508,12 +510,12 @@ export class DepthOfFieldEffect extends Effect {
508510 this . maskPass . setSize ( width , height ) ;
509511
510512 // These buffers require full resolution to prevent color bleeding.
513+ this . renderTargetFar . setSize ( width , height ) ;
511514 this . renderTargetCoC . setSize ( width , height ) ;
512515 this . renderTargetMasked . setSize ( width , height ) ;
513516
514517 this . renderTarget . setSize ( w , h ) ;
515518 this . renderTargetNear . setSize ( w , h ) ;
516- this . renderTargetFar . setSize ( w , h ) ;
517519 this . renderTargetCoCBlurred . setSize ( w , h ) ;
518520
519521 // Optimization: 1 / (TexelSize * ResolutionScale) = FullResolution
0 commit comments