浏览代码

don't create flat-white colorattrib

David Rose 18 年之前
父节点
当前提交
7400cfacab
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      panda/src/egg2pg/eggLoader.cxx

+ 3 - 1
panda/src/egg2pg/eggLoader.cxx

@@ -432,7 +432,9 @@ make_polyset(EggBin *egg_bin, PandaNode *parent, const LMatrix4d *transform,
 
       CPT(RenderState) geom_state = render_state->_state;
       if (has_overall_color) {
-        geom_state = geom_state->add_attrib(ColorAttrib::make_flat(overall_color), -1);
+        if (!overall_color.almost_equal(Colorf(1.0f, 1.0f, 1.0f, 1.0f))) {
+          geom_state = geom_state->add_attrib(ColorAttrib::make_flat(overall_color), -1);
+        }
       } else {
         geom_state = geom_state->add_attrib(ColorAttrib::make_vertex(), -1);
       }