瀏覽代碼

Examples: Fix onWindowResize() in webgl_postprocessing_dof2

Mugen87 6 年之前
父節點
當前提交
537b37bb54
共有 1 個文件被更改,包括 9 次插入0 次删除
  1. 9 0
      examples/webgl_postprocessing_dof2.html

+ 9 - 0
examples/webgl_postprocessing_dof2.html

@@ -332,6 +332,15 @@
 				camera.aspect = window.innerWidth / window.innerHeight;
 				camera.updateProjectionMatrix();
 
+				windowHalfX = window.innerWidth / 2;
+				windowHalfY = window.innerHeight / 2;
+
+				postprocessing.rtTextureDepth.setSize( window.innerWidth, window.innerHeight );
+				postprocessing.rtTextureColor.setSize( window.innerWidth, window.innerHeight );
+
+				postprocessing.bokeh_uniforms[ 'textureWidth' ].value = window.innerWidth;
+				postprocessing.bokeh_uniforms[ 'textureHeight' ].value = window.innerHeight;
+
 				renderer.setSize( window.innerWidth, window.innerHeight );
 
 			}