Browse Source

ShaderGenerator: don't output unused attr_ambient input variable

rdb 5 years ago
parent
commit
61a089ad59
1 changed files with 3 additions and 1 deletions
  1. 3 1
      panda/src/pgraphnodes/shaderGenerator.cxx

+ 3 - 1
panda/src/pgraphnodes/shaderGenerator.cxx

@@ -1094,7 +1094,9 @@ synthesize_shader(const RenderState *rs, const GeomVertexAnimationSpec &anim) {
     text << "\t uniform float4 clipplane_" << i << ",\n";
     text << "\t uniform float4 clipplane_" << i << ",\n";
   }
   }
 
 
-  text << "\t uniform float4 attr_ambient,\n";
+  if (key._lighting) {
+    text << "\t uniform float4 attr_ambient,\n";
+  }
   text << "\t uniform float4 attr_colorscale\n";
   text << "\t uniform float4 attr_colorscale\n";
   text << ") {\n";
   text << ") {\n";