Browse Source

Shaders: generate textured Phong VS only if textures are actually used.

Previously this got enabled also when AlphaMask was enabled, but no
texture. That's a strange case but nevertheless, let's be precise.
pull/338/head
Vladimír Vondruš 7 years ago
parent
commit
a1d3f734d6
  1. 2
      src/Magnum/Shaders/Phong.cpp

2
src/Magnum/Shaders/Phong.cpp

@ -87,7 +87,7 @@ Phong::Phong(const Flags flags, const UnsignedInt lightCount): _flags{flags}, _l
lightInitializer.resize(lightInitializer.size() - 1); lightInitializer.resize(lightInitializer.size() - 1);
#endif #endif
vert.addSource(flags ? "#define TEXTURED\n" : "") vert.addSource(flags & (Flag::AmbientTexture|Flag::DiffuseTexture|Flag::SpecularTexture) ? "#define TEXTURED\n" : "")
.addSource(Utility::formatString("#define LIGHT_COUNT {}\n", lightCount)) .addSource(Utility::formatString("#define LIGHT_COUNT {}\n", lightCount))
.addSource(rs.get("generic.glsl")) .addSource(rs.get("generic.glsl"))
.addSource(rs.get("Phong.vert")); .addSource(rs.get("Phong.vert"));

Loading…
Cancel
Save