From 60468b0becbe1b11aefd068c90b72d0398a19ec3 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 5 Aug 2018 12:48:48 +0200 Subject: [PATCH] ShaderGenerator: additional case where vtx_color isn't needed See sample code in a comment in #370 --- panda/src/pgraphnodes/shaderGenerator.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panda/src/pgraphnodes/shaderGenerator.cxx b/panda/src/pgraphnodes/shaderGenerator.cxx index 47d735c781..f52d0f4579 100644 --- a/panda/src/pgraphnodes/shaderGenerator.cxx +++ b/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;