From 57fece98d81ce163218cc51ca912c6acc5770c2e Mon Sep 17 00:00:00 2001 From: David Rose Date: Thu, 21 Apr 2005 00:53:40 +0000 Subject: [PATCH] fix flat-shaded multicolored polys --- panda/src/egg2pg/eggLoader.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/panda/src/egg2pg/eggLoader.cxx b/panda/src/egg2pg/eggLoader.cxx index 9975c42524..8c39b3c825 100644 --- a/panda/src/egg2pg/eggLoader.cxx +++ b/panda/src/egg2pg/eggLoader.cxx @@ -176,6 +176,14 @@ build_graph() { _data->get_connected_shading(); _data->unify_attributes(true, true); + // Now we need to get the connected shading again, since in unifying + // the attributes we may have made vertices suddenly become + // identical to each other, thereby connecting more primitives than + // before. + _data->clear_connected_shading(); + _data->remove_unused_vertices(true); + _data->get_connected_shading(); + // Sequences and switches have special needs. Make sure that // primitives parented directly to a sequence or switch are sorted // into sub-groups first, to prevent them being unified into a