From 676ef9637b3c1bc7689d16ecda0f55f8bfa4d650 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Tue, 11 Mar 2025 13:04:10 +0100 Subject: [PATCH] glFT2: Fix texture size in export. --- code/AssetLib/glTF2/glTF2Exporter.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/AssetLib/glTF2/glTF2Exporter.cpp b/code/AssetLib/glTF2/glTF2Exporter.cpp index dc2235ba2..d2f88c36c 100644 --- a/code/AssetLib/glTF2/glTF2Exporter.cpp +++ b/code/AssetLib/glTF2/glTF2Exporter.cpp @@ -614,6 +614,8 @@ void glTF2Exporter::GetMatTex(const aiMaterial &mat, Ref &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(curTex->pcData), length, *mAsset); texture->source->SetData(reinterpret_cast(curTex->pcData), curTex->mWidth, *mAsset); } else { texture->source->uri = path;