浏览代码

Fixed readPixels bug

David catuhe 10 年之前
父节点
当前提交
5a276815ff

文件差异内容过多而无法显示
+ 1298 - 1298
dist/preview release - beta/babylon.2.2.d.ts


文件差异内容过多而无法显示
+ 1 - 1
dist/preview release - beta/babylon.2.2.js


+ 1 - 1
dist/preview release - beta/babylon.2.2.max.js

@@ -6869,7 +6869,7 @@ var BABYLON;
         };
         Engine.prototype.readPixels = function (x, y, width, height) {
             var data = new Uint8Array(height * width * 4);
-            this._gl.readPixels(0, 0, width, height, this._gl.RGBA, this._gl.UNSIGNED_BYTE, data);
+            this._gl.readPixels(x, y, width, height, this._gl.RGBA, this._gl.UNSIGNED_BYTE, data);
             return data;
         };
         // Dispose

文件差异内容过多而无法显示
+ 1 - 1
dist/preview release - beta/babylon.2.2.noworker.js


+ 1 - 1
src/babylon.engine.js

@@ -1803,7 +1803,7 @@ var BABYLON;
         };
         Engine.prototype.readPixels = function (x, y, width, height) {
             var data = new Uint8Array(height * width * 4);
-            this._gl.readPixels(0, 0, width, height, this._gl.RGBA, this._gl.UNSIGNED_BYTE, data);
+            this._gl.readPixels(x, y, width, height, this._gl.RGBA, this._gl.UNSIGNED_BYTE, data);
             return data;
         };
         // Dispose

+ 1 - 1
src/babylon.engine.ts

@@ -2147,7 +2147,7 @@
 
         public readPixels(x: number, y: number, width: number, height: number): Uint8Array {
             var data = new Uint8Array(height * width * 4);
-            this._gl.readPixels(0, 0, width, height, this._gl.RGBA, this._gl.UNSIGNED_BYTE, data);
+            this._gl.readPixels(x, y, width, height, this._gl.RGBA, this._gl.UNSIGNED_BYTE, data);
             return data;
         }