diff -r -u panda3d-1.8.1/panda/src/pgraphnodes/shaderGenerator.cxx panda3d-1.8.1-patch-shadergenerror/panda/src/pgraphnodes/shaderGenerator.cxx --- panda3d-1.8.1/panda/src/pgraphnodes/shaderGenerator.cxx 2013-02-12 17:28:17.000000000 +0200 +++ panda3d-1.8.1-patch-shadergenerror/panda/src/pgraphnodes/shaderGenerator.cxx 2013-09-01 14:44:24.965821227 +0300 @@ -1158,7 +1158,8 @@ } } const LightRampAttrib *light_ramp = DCAST(LightRampAttrib, rs->get_attrib_def(LightRampAttrib::get_class_slot())); - if(_auto_ramp_on) { + if(_auto_ramp_on && ( (_separate_ambient_diffuse && _have_diffuse) || + (!_separate_ambient_diffuse && (_have_ambient || _have_diffuse)) ) ) { switch (light_ramp->get_mode()) { case LightRampAttrib::LRT_single_threshold: { Only in panda3d-1.8.1-patch-shadergenerror/panda/src/pgraphnodes: shaderGenerator.cxx~