You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Very true, I misinterpreted how textures & images work within the format. This also fixes the Sponza test model (although not entirely as some triangles are much too stretched for yet unknown reasons), with which most textures were wrong; that explains a lot. I'll unit test this and push a commit soon, thanks a lot!
I think there is an error in file GltfLoad.cpp
Available:
347 if (mat.pbrData.baseColorTexture && images[mat.pbrData.baseColorTexture->textureIndex])
348 matProgram.setTexture(Texture2D::create(*images[mat.pbrData.baseColorTexture->textureIndex]), MaterialTexture::BaseColor);
...
Right:
add const std::vectorfastgltf::Texture& textures as parameter in void loadMaterials
347 if (mat.pbrData.baseColorTexture && textures[mat.pbrData.baseColorTexture->textureIndex].imageIndex)
{
auto imageIndex = textures[mat.pbrData.baseColorTexture->textureIndex].imageIndex.value();
matProgram.setTexture(Texture2D::create(*images[imageIndex]), MaterialTexture::BaseColor);
}
At least it works correctly for me.
The text was updated successfully, but these errors were encountered: