mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
add egg-flat-colors
This commit is contained in:
parent
fc021fb6af
commit
80705de816
@ -93,6 +93,18 @@ ConfigVariableBool egg_flat_shading
|
|||||||
"to set it true if your scene largely or entirely consists of "
|
"to set it true if your scene largely or entirely consists of "
|
||||||
"flat-shaded polygons."));
|
"flat-shaded polygons."));
|
||||||
|
|
||||||
|
ConfigVariableBool egg_flat_colors
|
||||||
|
("egg-flat-colors", true,
|
||||||
|
PRC_DESC("Set this true to allow the egg loader to create geometry with the "
|
||||||
|
"ColorAttrib::T_flat attribute set: that is, geometry that uses "
|
||||||
|
"the scene graph color instead of per-vertex color. Normally Panda "
|
||||||
|
"will do this as an optimization for Geoms whose vertices are all "
|
||||||
|
"the same color, or all white. This allows the removal of the "
|
||||||
|
"color attribute from the vertices where it is not necessary to "
|
||||||
|
"specify colors per-vertex. If this is false, the color attribute "
|
||||||
|
"will always be specified per-vertex, even if all vertices have the "
|
||||||
|
"same value."));
|
||||||
|
|
||||||
ConfigVariableBool egg_load_old_curves
|
ConfigVariableBool egg_load_old_curves
|
||||||
("egg-load-old-curves", true,
|
("egg-load-old-curves", true,
|
||||||
PRC_DESC("When this is true, a <NurbsCurve> entry appearing in an egg file "
|
PRC_DESC("When this is true, a <NurbsCurve> entry appearing in an egg file "
|
||||||
|
@ -42,6 +42,7 @@ extern EXPCL_PANDAEGG ConfigVariableDouble egg_flatten_radius;
|
|||||||
extern EXPCL_PANDAEGG ConfigVariableBool egg_combine_geoms;
|
extern EXPCL_PANDAEGG ConfigVariableBool egg_combine_geoms;
|
||||||
extern EXPCL_PANDAEGG ConfigVariableBool egg_rigid_geometry;
|
extern EXPCL_PANDAEGG ConfigVariableBool egg_rigid_geometry;
|
||||||
extern EXPCL_PANDAEGG ConfigVariableBool egg_flat_shading;
|
extern EXPCL_PANDAEGG ConfigVariableBool egg_flat_shading;
|
||||||
|
extern EXPCL_PANDAEGG ConfigVariableBool egg_flat_colors;
|
||||||
extern EXPCL_PANDAEGG ConfigVariableBool egg_load_old_curves;
|
extern EXPCL_PANDAEGG ConfigVariableBool egg_load_old_curves;
|
||||||
extern EXPCL_PANDAEGG ConfigVariableBool egg_load_classic_nurbs_curves;
|
extern EXPCL_PANDAEGG ConfigVariableBool egg_load_classic_nurbs_curves;
|
||||||
extern EXPCL_PANDAEGG ConfigVariableBool egg_accept_errors;
|
extern EXPCL_PANDAEGG ConfigVariableBool egg_accept_errors;
|
||||||
|
@ -371,6 +371,12 @@ make_polyset(EggBin *egg_bin, PandaNode *parent, const LMatrix4d *transform,
|
|||||||
bool has_overall_color;
|
bool has_overall_color;
|
||||||
Colorf overall_color;
|
Colorf overall_color;
|
||||||
vertex_pool->check_overall_color(has_overall_color, overall_color);
|
vertex_pool->check_overall_color(has_overall_color, overall_color);
|
||||||
|
if (!egg_flat_colors) {
|
||||||
|
// If flat colors aren't allowed, then we don't care whether
|
||||||
|
// there is an overall color. In that case, treat all vertex
|
||||||
|
// pools as if they contain a combination of multiple colors.
|
||||||
|
has_overall_color = false;
|
||||||
|
}
|
||||||
|
|
||||||
// Create a handful of GeomPrimitives corresponding to the various
|
// Create a handful of GeomPrimitives corresponding to the various
|
||||||
// types of primitives that reference this vertex pool.
|
// types of primitives that reference this vertex pool.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user