Fix diffuse-only material shaders not applying.

This commit is contained in:
Marisa the Magician 2023-01-12 14:03:19 +01:00 committed by Christoph Oelckers
parent f9de0d5c11
commit 81e7d77b44

View file

@ -133,13 +133,16 @@ FMaterial::FMaterial(FGameTexture * tx, int scaleflags)
if (index >= FIRST_USER_SHADER) if (index >= FIRST_USER_SHADER)
{ {
const UserShaderDesc& usershader = usershaders[index - FIRST_USER_SHADER]; const UserShaderDesc& usershader = usershaders[index - FIRST_USER_SHADER];
if (tx->Layers && usershader.shaderType == mShaderIndex) // Only apply user shader if it matches the expected material if (usershader.shaderType == mShaderIndex) // Only apply user shader if it matches the expected material
{
if (tx->Layers)
{ {
for (auto& texture : tx->Layers->CustomShaderTextures) for (auto& texture : tx->Layers->CustomShaderTextures)
{ {
if (texture == nullptr) continue; if (texture == nullptr) continue;
mTextureLayers.Push({ texture.get(), 0 }); // scalability should be user-definable. mTextureLayers.Push({ texture.get(), 0 }); // scalability should be user-definable.
} }
}
mShaderIndex = index; mShaderIndex = index;
} }
} }