浏览代码

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;
 
 				//