summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntti Määttä <antti.maatta@qt.io>2020-01-20 10:04:43 +0200
committerAntti Määttä <antti.maatta@qt.io>2020-01-20 11:31:16 +0200
commit61d6d98a9824936ce75031e6cf99d99cb5bf99d2 (patch)
tree84cdc3f3c55885d26244bf6372aa51541311fea1
parent64f4a0f31565dce726d1306c0e36dea517bf80f3 (diff)
Fix adding uTransform and vTransform to shaders
These variables need to be added when any of the conditions are met, not when all conditions are met. Task-number: QT3DS-4043 Change-Id: I229fe4029a63ee4979dfe3fbf5d163fd95cfc40f Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
-rw-r--r--src/runtimerender/Qt3DSRenderDefaultMaterialShaderGenerator.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/runtimerender/Qt3DSRenderDefaultMaterialShaderGenerator.cpp b/src/runtimerender/Qt3DSRenderDefaultMaterialShaderGenerator.cpp
index 462cca8..41446e3 100644
--- a/src/runtimerender/Qt3DSRenderDefaultMaterialShaderGenerator.cpp
+++ b/src/runtimerender/Qt3DSRenderDefaultMaterialShaderGenerator.cpp
@@ -1038,7 +1038,7 @@ struct SShaderGenerator : public IDefaultMaterialShaderGenerator
// generated.
// we rely on the linker to strip out what isn't necessary instead of explicitly stripping
// it for code simplicity.
- if (hasImage && hasLighting && hasLightmaps) {
+ if (hasImage || hasLighting || hasLightmaps) {
fragmentShader.Append(" vec3 uTransform;");
fragmentShader.Append(" vec3 vTransform;");
}