فهرست منبع

Merge pull request #6569 from TrevorDev/iosEdgeBasisFix

ios black texture fix
sebavan 6 سال پیش
والد
کامیت
4e7037041d
2فایلهای تغییر یافته به همراه6 افزوده شده و 5 حذف شده
  1. 1 1
      dist/preview release/what's new.md
  2. 5 4
      src/Misc/basis.ts

+ 1 - 1
dist/preview release/what's new.md

@@ -61,7 +61,7 @@
 
 ### Loaders
 - Added support for non-float accessors in animation data for glTF loader. ([bghgary](https://github.com/bghgary))
-- Support loading cube data in .basis loader ([TrevorDev](https://github.com/TrevorDev))
+- Support loading cube data in the .basis loader ([TrevorDev](https://github.com/TrevorDev))
 - Load glTF extras into BJS metadata ([pjoe](https://github.com/pjoe))
 
 ### Materials

+ 5 - 4
src/Misc/basis.ts

@@ -188,13 +188,11 @@ export class BasisTools {
                 texture.type = Engine.TEXTURETYPE_UNSIGNED_SHORT_5_6_5;
                 texture.format = Engine.TEXTUREFORMAT_RGB;
 
-                // Fallback is already inverted
-                texture._invertVScale = !texture.invertY;
-
-                if (texture.getEngine().webGLVersion < 2 && (Scalar.Log2(texture.width) % 1 !== 0 || Scalar.Log2(texture.height) % 1 !== 0)) {
+                if (texture.getEngine().webGLVersion < 2 && (Scalar.Log2(rootImage.width) % 1 !== 0 || Scalar.Log2(rootImage.height) % 1 !== 0)) {
                     // Create non power of two texture
                     let source = new InternalTexture(texture.getEngine(), InternalTexture.DATASOURCE_TEMP);
 
+                    texture._invertVScale = texture.invertY;
                     source.type = Engine.TEXTURETYPE_UNSIGNED_SHORT_5_6_5;
                     source.format = Engine.TEXTUREFORMAT_RGB;
                     // Fallback requires aligned width/height
@@ -209,6 +207,9 @@ export class BasisTools {
                         source.getEngine()._bindTextureDirectly(source.getEngine()._gl.TEXTURE_2D, texture, true);
                     });
                 }else {
+                    // Fallback is already inverted
+                    texture._invertVScale = !texture.invertY;
+
                     // Upload directly
                     texture.width = (rootImage.width + 3) & ~3;
                     texture.height = (rootImage.height + 3) & ~3;