소스 검색

Fix LensFlarePlugin example on Firefox

On Firefox (windows), the LensFlare example does not show any lens flare since at least r71. Chrome and IE are okay.

The plugin can be fixed by unbinding a texture slot.
dubejf 10 년 전
부모
커밋
a37b30695a
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      src/renderers/webgl/plugins/LensFlarePlugin.js

+ 2 - 0
src/renderers/webgl/plugins/LensFlarePlugin.js

@@ -346,6 +346,8 @@ THREE.LensFlarePlugin = function ( renderer, flares ) {
 
 
 				// save current RGB to temp texture
 				// save current RGB to temp texture
 
 
+				renderer.state.activeTexture( gl.TEXTURE0 );
+				renderer.state.bindTexture( gl.TEXTURE_2D, null );
 				renderer.state.activeTexture( gl.TEXTURE1 );
 				renderer.state.activeTexture( gl.TEXTURE1 );
 				renderer.state.bindTexture( gl.TEXTURE_2D, tempTexture );
 				renderer.state.bindTexture( gl.TEXTURE_2D, tempTexture );
 				gl.copyTexImage2D( gl.TEXTURE_2D, 0, gl.RGB, screenPositionPixels.x - 8, screenPositionPixels.y - 8, 16, 16, 0 );
 				gl.copyTexImage2D( gl.TEXTURE_2D, 0, gl.RGB, screenPositionPixels.x - 8, screenPositionPixels.y - 8, 16, 16, 0 );