Sfoglia il codice sorgente

Fixed readPixels bug

David catuhe 10 anni fa
parent
commit
5a276815ff

File diff suppressed because it is too large
+ 1298 - 1298
dist/preview release - beta/babylon.2.2.d.ts


File diff suppressed because it is too large
+ 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) {
         Engine.prototype.readPixels = function (x, y, width, height) {
             var data = new Uint8Array(height * width * 4);
             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;
             return data;
         };
         };
         // Dispose
         // Dispose

File diff suppressed because it is too large
+ 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) {
         Engine.prototype.readPixels = function (x, y, width, height) {
             var data = new Uint8Array(height * width * 4);
             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;
             return data;
         };
         };
         // Dispose
         // Dispose

+ 1 - 1
src/babylon.engine.ts

@@ -2147,7 +2147,7 @@
 
 
         public readPixels(x: number, y: number, width: number, height: number): Uint8Array {
         public readPixels(x: number, y: number, width: number, height: number): Uint8Array {
             var data = new Uint8Array(height * width * 4);
             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;
             return data;
         }
         }