Browse Source

Adding TGA tests + prevent unbind in upload

Sebastien Vandenberghe 7 năm trước cách đây
mục cha
commit
cc19720ef1

+ 2 - 0
src/Engine/babylon.engine.ts

@@ -5252,6 +5252,8 @@
             this._bindTextureDirectly(bindTarget, texture, true);
 
             this._uploadDataToTextureDirectly(texture, texture.width, texture.height, imageData, faceIndex, lod);
+
+            this._bindTextureDirectly(bindTarget, null, true);
         }
 
         /** @hidden */

+ 1 - 1
src/Tools/babylon.tga.ts

@@ -196,7 +196,7 @@
             var imageData = (<any>TGATools)[func](header, palettes, pixel_data, y_start, y_step, y_end, x_start, x_step, x_end);
 
             const engine = texture.getEngine();
-            engine._uploadArrayBufferViewToTexture(texture, imageData);
+            engine._uploadDataToTextureDirectly(texture, texture.width, texture.height, imageData);
         }
 
         static _getImageData8bits(header: any, palettes: Uint8Array, pixel_data: Uint8Array, y_start: number, y_step: number, y_end: number, x_start: number, x_step: number, x_end: number): Uint8Array {

BIN
tests/validation/ReferenceImages/tga.png


+ 5 - 0
tests/validation/config.json

@@ -475,6 +475,11 @@
       "title": "Local cubemaps",
       "playgroundId": "#RNASML#4",
       "referenceImage": "local cubemaps.png"
+    },
+    {
+      "title": "TGA",
+      "playgroundId": "#ZI77S7#0",
+      "referenceImage": "tga.png"
     }
   ]
 }