浏览代码

ShaderGenerator: additional case where vtx_color isn't needed

See sample code in a comment in #370
rdb 7 年之前
父节点
当前提交
60468b0bec
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      panda/src/pgraphnodes/shaderGenerator.cxx

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

@@ -738,7 +738,7 @@ synthesize_shader(const RenderState *rs, const GeomVertexAnimationSpec &anim) {
   bool need_color = false;
   if (key._color_type != ColorAttrib::T_off) {
     if (key._lighting) {
-      if ((key._material_flags & Material::F_ambient) == 0 ||
+      if (((key._material_flags & Material::F_ambient) == 0 && key._have_separate_ambient) ||
           (key._material_flags & Material::F_diffuse) == 0 ||
           key._calc_primary_alpha) {
         need_color = true;