@@ -65,6 +65,13 @@ THREE.BloomPass = function ( strength, kernelSize, sigma, resolution ) {
65
65
this . needsSwap = false ;
66
66
this . clear = false ;
67
67
68
+
69
+ this . camera = new THREE . OrthographicCamera ( - 1 , 1 , 1 , - 1 , 0 , 1 ) ;
70
+ this . scene = new THREE . Scene ( ) ;
71
+
72
+ this . quad = new THREE . Mesh ( new THREE . PlaneGeometry ( 2 , 2 ) , null ) ;
73
+ this . scene . add ( this . quad ) ;
74
+
68
75
} ;
69
76
70
77
THREE . BloomPass . prototype = {
@@ -75,30 +82,30 @@ THREE.BloomPass.prototype = {
75
82
76
83
// Render quad with blured scene into texture (convolution pass 1)
77
84
78
- THREE . EffectComposer . quad . material = this . materialConvolution ;
85
+ this . quad . material = this . materialConvolution ;
79
86
80
87
this . convolutionUniforms [ "tDiffuse" ] . value = readBuffer ;
81
88
this . convolutionUniforms [ "uImageIncrement" ] . value = THREE . BloomPass . blurX ;
82
89
83
- renderer . render ( THREE . EffectComposer . scene , THREE . EffectComposer . camera , this . renderTargetX , true ) ;
90
+ renderer . render ( this . scene , this . camera , this . renderTargetX , true ) ;
84
91
85
92
86
93
// Render quad with blured scene into texture (convolution pass 2)
87
94
88
95
this . convolutionUniforms [ "tDiffuse" ] . value = this . renderTargetX ;
89
96
this . convolutionUniforms [ "uImageIncrement" ] . value = THREE . BloomPass . blurY ;
90
97
91
- renderer . render ( THREE . EffectComposer . scene , THREE . EffectComposer . camera , this . renderTargetY , true ) ;
98
+ renderer . render ( this . scene , this . camera , this . renderTargetY , true ) ;
92
99
93
100
// Render original scene with superimposed blur to texture
94
101
95
- THREE . EffectComposer . quad . material = this . materialCopy ;
102
+ this . quad . material = this . materialCopy ;
96
103
97
104
this . copyUniforms [ "tDiffuse" ] . value = this . renderTargetY ;
98
105
99
106
if ( maskActive ) renderer . context . enable ( renderer . context . STENCIL_TEST ) ;
100
107
101
- renderer . render ( THREE . EffectComposer . scene , THREE . EffectComposer . camera , readBuffer , this . clear ) ;
108
+ renderer . render ( this . scene , this . camera , readBuffer , this . clear ) ;
102
109
103
110
}
104
111
0 commit comments