Selaa lähdekoodia

Improve FB2Tex example one more time

Mugen87 7 vuotta sitten
vanhempi
commit
b9ea7e900b
1 muutettua tiedostoa jossa 6 lisäystä ja 2 poistoa
  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;
 
 				//