浏览代码

Merge pull request #13470 from mrdoob/videotexture-test

Test manually updating video texture in webvr_video
Mr.doob 7 年之前
父节点
当前提交
d4d51ce6ec
共有 1 个文件被更改,包括 12 次插入1 次删除
  1. 12 1
      examples/webvr_video.html

+ 12 - 1
examples/webvr_video.html

@@ -65,11 +65,22 @@
 				video.setAttribute( 'webkit-playsinline', 'webkit-playsinline' );
 				video.play();
 
-				texture = new THREE.VideoTexture( video );
+				texture = new THREE.Texture( video );
+				texture.generateMipmaps = false;
 				texture.minFilter = THREE.NearestFilter;
 				texture.maxFilter = THREE.NearestFilter;
 				texture.format = THREE.RGBFormat;
 
+				setInterval( function () {
+
+					if ( video.readyState >= video.HAVE_CURRENT_DATA ) {
+
+						texture.needsUpdate = true;
+
+					}
+
+				}, 1000 / 24 );
+
 				scene = new THREE.Scene();
 				scene.background = new THREE.Color( 0x101010 );