From 5dd4a067a519af13ac92d531de153fba9b9fc2d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 7 Feb 2022 19:54:32 +0100 Subject: [PATCH] Shaders: properly bind the instancedNormalMatrix PhongGL attribute. It was only bound via the explicit binding, which isn't in GLES2. Yet however it just worked, everywhere I tested, somehow. --- src/Magnum/Shaders/PhongGL.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Magnum/Shaders/PhongGL.cpp b/src/Magnum/Shaders/PhongGL.cpp index 5fca3b52b..39eb3e80d 100644 --- a/src/Magnum/Shaders/PhongGL.cpp +++ b/src/Magnum/Shaders/PhongGL.cpp @@ -329,8 +329,11 @@ PhongGL::PhongGL(const Flags flags, const UnsignedInt lightCount if(flags >= Flag::InstancedObjectId) bindAttributeLocation(ObjectId::Location, "instanceObjectId"); #endif - if(flags & Flag::InstancedTransformation) + if(flags & Flag::InstancedTransformation) { bindAttributeLocation(TransformationMatrix::Location, "instancedTransformationMatrix"); + if(lightCount) + bindAttributeLocation(NormalMatrix::Location, "instancedNormalMatrix"); + } if(flags >= Flag::InstancedTextureOffset) bindAttributeLocation(TextureOffset::Location, "instancedTextureOffset"); }