xushiting 3 years ago
parent
commit
cb374e2ed4
1 changed files with 11 additions and 15 deletions
  1. 11 15
      src/XMaterialComponent.js

+ 11 - 15
src/XMaterialComponent.js

@@ -129,10 +129,6 @@ export default class XMaterialComponent {
                 if(VideoTexture != null){
                     VideoTexture.update(stream)
                     VideoTexture.updateSamplingMode(BABYLON.Texture.BILINEAR_SAMPLINGMODE)
-                    
-                    // let Y = yuv.subarray(0, 720*1280);
-                    // VideoTexture.update(Y)
-                    // VideoTexture.updateSamplingMode(BABYLON.Texture.BILINEAR_SAMPLINGMODE)
                 
                 }
                 //(o = this._videoRawYUVTexArray.getVideoYUVTex(videosResOriArrayIndex)) == null || o.update(stream),
@@ -168,7 +164,7 @@ export default class XMaterialComponent {
                                 gl_FragColor = vec4( color, 1.0); 
                             }
                         `;
-
+                            
                         
                         window.testPlane.material = new BABYLON.ShaderMaterial(
                             'customShader',
@@ -181,13 +177,8 @@ export default class XMaterialComponent {
                               attributes: ['uv', 'position'],
                               uniforms: ['view', 'projection', 'worldViewProjection', 'world'],
                             },
-                        )
-                        window.testPlane.material.setTexture('chrominanceYTexture', window._videoRawYTexture)
-                        */
-                       
-                        window.testPlane.material = new BABYLON.StandardMaterial("xsttest",this.scene);
-                        window.testPlane.material.backFaceCulling = false;//Allways show the front and the back of an element
-
+                        )*/
+                        
                         window._videoRawYTexture = BABYLON.RawTexture.CreateLuminanceTexture(
                             null,
                             512,
@@ -197,9 +188,14 @@ export default class XMaterialComponent {
                             true,
                           )
 
-                         window.testPlane.material.diffuseTexture = window._videoRawYTexture
-
-
+                       // window.testPlane.material.setTexture('chrominanceYTexture', window._videoRawYTexture)
+                        
+                       
+                        
+                        window.testPlane.material = new BABYLON.StandardMaterial("xsttest",this.scene);
+                        window.testPlane.material.diffuseTexture = window._videoRawYTexture
+                        
+                        window.testPlane.material.backFaceCulling = false;//Allways show the front and the back of an element
                         window.setInterval( ()=>{
                             window.updateTexture( new Uint8Array(window.generateRandomArray()) );
                         }, 60);