1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Fix texture matrix handling in our shaders

This commit is contained in:
sfan5 2024-09-06 10:32:05 +02:00
parent 9e5d6bc162
commit e90ef85e7d
3 changed files with 9 additions and 5 deletions

View file

@ -1096,8 +1096,11 @@ void COpenGL3DriverBase::setMaterial(const SMaterial &material)
OverrideMaterial.apply(Material);
for (u32 i = 0; i < Feature.MaxTextureUnits; ++i) {
CacheHandler->getTextureCache().set(i, material.getTexture(i));
setTransform((E_TRANSFORMATION_STATE)(ETS_TEXTURE_0 + i), material.getTextureMatrix(i));
auto *texture = material.getTexture(i);
CacheHandler->getTextureCache().set(i, texture);
if (texture) {
setTransform((E_TRANSFORMATION_STATE)(ETS_TEXTURE_0 + i), material.getTextureMatrix(i));
}
}
}