Browse Source

Fix updating of light position uniform in GLSL (thanks to deflected for tracking this down)

rdb 10 years ago
parent
commit
bfe42fa8e9
1 changed files with 3 additions and 1 deletions
  1. 3 1
      panda/src/glstuff/glShaderContext_src.cxx

+ 3 - 1
panda/src/glstuff/glShaderContext_src.cxx

@@ -1196,7 +1196,9 @@ reflect_uniform(int i, char *name_buffer, GLsizei name_buflen) {
           bind._func = Shader::SMF_first;
           bind._part[0] = Shader::SMO_vec_constant_x_attrib;
           bind._arg[0] = iname;
-          bind._dep[0] = Shader::SSD_general | Shader::SSD_shaderinputs | Shader::SSD_frame;
+          // We need SSD_transform since some attributes (eg. light
+          // position) have to be transformed to view space.
+          bind._dep[0] = Shader::SSD_general | Shader::SSD_shaderinputs | Shader::SSD_frame | Shader::SSD_transform;
           bind._part[1] = Shader::SMO_identity;
           bind._arg[1] = NULL;
           bind._dep[1] = Shader::SSD_NONE;