@@ -91,31 +91,28 @@ export const createDepthOfFieldPassRenderer = (gl: WebGL2RenderingContext) => {
9191 gl . clear ( gl . COLOR_BUFFER_BIT | gl . DEPTH_BUFFER_BIT ) ;
9292 draw ( ) ;
9393
94+ gl . activeTexture ( gl . TEXTURE0 + 1 ) ;
95+ gl . bindTexture ( gl . TEXTURE_2D , colorTextureScene ) ;
96+ gl . activeTexture ( gl . TEXTURE0 + 2 ) ;
97+ gl . bindTexture ( gl . TEXTURE_2D , depthTextureScene ) ;
98+ gl . activeTexture ( gl . TEXTURE0 + 3 ) ;
99+ gl . bindTexture ( gl . TEXTURE_2D , colorTextureBlur ) ;
100+
94101 gl . disable ( gl . DEPTH_TEST ) ;
95102 gl . bindVertexArray ( vao ) ;
96103
97104 gl . useProgram ( programBlur ) ;
98105
99106 gl . uniform1i ( blurUniforms . u_colorTexture , 1 ) ;
100- gl . activeTexture ( gl . TEXTURE0 + 1 ) ;
101- gl . bindTexture ( gl . TEXTURE_2D , colorTextureScene ) ;
102107
103108 gl . bindFramebuffer ( gl . FRAMEBUFFER , framebufferBlur ) ;
104109 gl . clear ( gl . COLOR_BUFFER_BIT ) ;
105110 gl . drawArrays ( gl . TRIANGLE_STRIP , 0 , 4 ) ;
106111
107112 gl . useProgram ( programComposition ) ;
108113
109- gl . activeTexture ( gl . TEXTURE0 + 1 ) ;
110- gl . bindTexture ( gl . TEXTURE_2D , colorTextureScene ) ;
111114 gl . uniform1i ( compositionUniforms . u_colorTexture , 1 ) ;
112-
113- gl . activeTexture ( gl . TEXTURE0 + 2 ) ;
114- gl . bindTexture ( gl . TEXTURE_2D , depthTextureScene ) ;
115115 gl . uniform1i ( compositionUniforms . u_depthTexture , 2 ) ;
116-
117- gl . activeTexture ( gl . TEXTURE0 + 3 ) ;
118- gl . bindTexture ( gl . TEXTURE_2D , colorTextureBlur ) ;
119116 gl . uniform1i ( compositionUniforms . u_blurredTexture , 3 ) ;
120117
121118 gl . uniform4f (
0 commit comments