Răsfoiți Sursa

glFT2: Fix texture size in export.

Kim Kulling 4 luni în urmă
părinte
comite
676ef9637b
1 a modificat fișierele cu 2 adăugiri și 0 ștergeri
  1. 2 0
      code/AssetLib/glTF2/glTF2Exporter.cpp

+ 2 - 0
code/AssetLib/glTF2/glTF2Exporter.cpp

@@ -614,6 +614,8 @@ void glTF2Exporter::GetMatTex(const aiMaterial &mat, Ref<Texture> &texture, unsi
 
                     // The asset has its own buffer, see Image::SetData
                     // basisu: "image/ktx2", "image/basis" as is
+                    const size_t length = curTex->mWidth * curTex->mHeight;
+                    //texture->source->SetData(reinterpret_cast<uint8_t *>(curTex->pcData), length, *mAsset);
                     texture->source->SetData(reinterpret_cast<uint8_t *>(curTex->pcData), curTex->mWidth, *mAsset);
                 } else {
                     texture->source->uri = path;