瀏覽代碼

Fix gl texture size for luminance plane yet again

Dominic Szablewski 11 年之前
父節點
當前提交
32f8c176b8
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      jsmpg.js

+ 3 - 3
jsmpg.js 查看文件

@@ -846,15 +846,15 @@ jsmpeg.prototype.renderFrameGL = function() {
846 846
 	gl.activeTexture(gl.TEXTURE0);
847 847
 	gl.bindTexture(gl.TEXTURE_2D, this.YTexture);
848 848
 
849
-	gl.texImage2D(gl.TEXTURE_2D, 0, gl.LUMINANCE, this.codedWidth, this.codedHeight, 0, gl.LUMINANCE, gl.UNSIGNED_BYTE, uint8Y);
849
+	gl.texImage2D(gl.TEXTURE_2D, 0, gl.LUMINANCE, this.codedWidth, this.height, 0, gl.LUMINANCE, gl.UNSIGNED_BYTE, uint8Y);
850 850
 	
851 851
 	gl.activeTexture(gl.TEXTURE1);
852 852
 	gl.bindTexture(gl.TEXTURE_2D, this.CBTexture);
853
-	gl.texImage2D(gl.TEXTURE_2D, 0, gl.LUMINANCE, this.halfWidth, this.halfHeight, 0, gl.LUMINANCE, gl.UNSIGNED_BYTE, uint8Cr);
853
+	gl.texImage2D(gl.TEXTURE_2D, 0, gl.LUMINANCE, this.halfWidth, this.height/2, 0, gl.LUMINANCE, gl.UNSIGNED_BYTE, uint8Cr);
854 854
 	
855 855
 	gl.activeTexture(gl.TEXTURE2);
856 856
 	gl.bindTexture(gl.TEXTURE_2D, this.CRTexture);
857
-	gl.texImage2D(gl.TEXTURE_2D, 0, gl.LUMINANCE, this.halfWidth, this.halfHeight, 0, gl.LUMINANCE, gl.UNSIGNED_BYTE, uint8Cb);
857
+	gl.texImage2D(gl.TEXTURE_2D, 0, gl.LUMINANCE, this.halfWidth, this.height/2, 0, gl.LUMINANCE, gl.UNSIGNED_BYTE, uint8Cb);
858 858
 	
859 859
 	gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);
860 860
 };