소스 검색

Improve FB2Tex example one more time

Mugen87 7 년 전
부모
커밋
b9ea7e900b
1개의 변경된 파일6개의 추가작업 그리고 2개의 파일을 삭제
  1. 6 2
      examples/webgl_framebuffer_texture.html

+ 6 - 2
examples/webgl_framebuffer_texture.html

@@ -116,10 +116,14 @@
 
 				//
 
-				texture = new THREE.Texture();
-				texture.image = new Image( imageWidth, imageHeight );
+				var canvas = document.createElement( 'canvas' );
+				canvas.width = imageWidth;
+				canvas.height = imageHeight;
+
+				texture = new THREE.CanvasTexture( canvas );
 				texture.format = THREE.RGBFormat;
 				texture.minFilter = texture.magFilter = THREE.NearestFilter;
+				texture.needsUpdate = true;
 
 				//