15 #include "config_egg2pg.h"
18 #include "loaderFileTypeEgg.h"
19 #include "loaderFileTypeRegistry.h"
20 #include "configVariableManager.h"
21 #include "configVariableCore.h"
22 #include "eggRenderState.h"
24 ConfigureDef(config_egg2pg);
25 NotifyCategoryDef(egg2pg,
"");
28 (
"egg-normal-scale", 1.0);
30 (
"egg-show-normals",
false);
33 (
"egg-coordinate-system", CS_default);
36 (
"egg-ignore-mipmaps",
false);
38 (
"egg-ignore-filters",
false);
40 (
"egg-ignore-decals",
false);
43 PRC_DESC(
"This is normally true to flatten out useless nodes after loading "
44 "an egg file. Set it false if you want to see the complete "
45 "and true hierarchy as the egg loader created it (although the "
46 "extra nodes may have a small impact on render performance)."));
49 (
"egg-flatten-radius", 0.0,
50 PRC_DESC(
"This specifies the minimum cull radius in the egg file. Nodes "
51 "whose bounding volume is smaller than this radius will be "
52 "flattened tighter than nodes larger than this radius, to "
53 "reduce the node count even further. The idea is that small "
54 "objects will not need to have their individual components "
55 "culled separately, but large environments should. This allows "
56 "the user to specify what should be considered \"small\". Set "
57 "it to 0.0 to disable this feature."));
61 PRC_DESC(
"When this is true, then in addition to flattening the scene graph "
62 "nodes, the egg loader will also combine as many Geoms as "
64 "a given node into a single Geom. This has theoretical performance "
65 "benefits, especially on higher-end graphics cards, but it also "
66 "slightly slows down egg loading."));
69 (
"egg-combine-geoms",
false,
70 PRC_DESC(
"Set this true to combine sibling GeomNodes into a single GeomNode, "
71 "when possible. This usually shouldn't be necessary, since the "
72 "egg loader does a pretty good job of combining these by itself."));
75 (
"egg-rigid-geometry",
false,
76 PRC_DESC(
"Set this true to create rigid pieces of an animated character as "
77 "separate static nodes, or false to leave these in with the parent "
78 "node as vertex-animated geometry. Setting this true means less "
79 "geometry has to be vertex-animated, but there will tend to be "
80 "more separate pieces."));
83 (
"egg-flat-shading",
false,
84 PRC_DESC(
"Set this true to allow the egg loader to create geometry with the "
85 "ShadeModelAttrib::M_flat attribute set. It will do this only "
86 "for geometry that has per-polygon normals and/or colors. This "
87 "allows the egg loader to avoid duplicating vertices when they "
88 "are shared between connected polygons with different normals or "
89 "colors, but it prevents the flat-shaded geometry from being "
90 "combined with any adjacent smooth-shaded geometry (for instance, "
91 "as the result of a flatten_strong operation). It is false by "
92 "default, since flat-shaded geometry is rare; but you may wish "
93 "to set it true if your scene largely or entirely consists of "
94 "flat-shaded polygons."));
97 (
"egg-flat-colors",
true,
98 PRC_DESC(
"Set this true to allow the egg loader to create geometry with the "
99 "ColorAttrib::T_flat attribute set: that is, geometry that uses "
100 "the scene graph color instead of per-vertex color. Normally Panda "
101 "will do this as an optimization for Geoms whose vertices are all "
102 "the same color, or all white. This allows the removal of the "
103 "color attribute from the vertices where it is not necessary to "
104 "specify colors per-vertex. If this is false, the color attribute "
105 "will always be specified per-vertex, even if all vertices have the "
109 (
"egg-load-old-curves",
true,
110 PRC_DESC(
"When this is true, a <NurbsCurve> entry appearing in an egg file "
111 "will load as a NurbsCurve or ClassicNurbsCurve object (see below). "
112 "When this is false, it will load a RopeNode instead, which uses the "
113 "new NurbsCurveEvaluator interface."));
117 (
"egg-load-classic-nurbs-curves",
false,
118 PRC_DESC(
"When this is true (and the above is also true), a <NurbsCurve> "
119 "entry appearing in an egg file will load a ClassicNurbsCurve object "
120 "instead of the default, a NurbsCurve object. This only makes a "
121 "difference when the NURBS++ library is available, in which case the "
122 "default, NurbsCurve, is actually a NurbsPPCurve object."));
126 (
"egg-accept-errors",
true,
127 PRC_DESC(
"When this is true, certain kinds of recoverable errors (not syntax "
128 "errors) in an egg file will be allowed and ignored when an egg file "
129 "is loaded. When it is false, only perfectly pristine egg files may "
134 (
"egg-suppress-hidden",
false,
135 PRC_DESC(
"When this is true, objects flagged as \"hidden\" with the visibility "
136 "scalar are not created at all. When false, these objects are "
137 "created, but initially stashed."));
141 (
"egg-alpha-mode", EggRenderMode::AM_blend,
142 PRC_DESC(
"Specifies the alpha mode to apply when the alpha specification "
143 "\"on\" appears in the egg file (or when a primitive is implicitly "
144 "transparent, because of a <RGBA> that involves a non-unity alpha, "
145 "or because of a four-channel texture."));
148 (
"egg-max-vertices", 65534,
149 PRC_DESC(
"Specifies the maximum number of vertices that will be "
150 "added to any one GeomVertexData by the egg loader."));
153 (
"egg-max-indices", 65535,
154 PRC_DESC(
"Specifies the maximum number of vertex indices that will be "
155 "added to any one GeomPrimitive by the egg loader."));
158 (
"egg-emulate-bface",
true,
159 PRC_DESC(
"When this is true, the bface flag applied to a polygon will "
160 "cause two different polygons to be created, back-to-back. When "
161 "it is false, a single polygon will be created with the two_sided "
165 (
"egg-preload-simple-textures",
true,
166 PRC_DESC(
"This specifies whether the egg loader will generate simple "
167 "texture images for each texture loaded. This supercedes the "
168 "preload-simple-textures global default, for egg files. In "
169 "fact, the egg loader will generate simple texture images if "
170 "either this or preload-simple-textures is true."));
173 (
"egg-vertex-membership-quantize", 0.1,
174 PRC_DESC(
"Specifies the nearest amount to round each vertex joint "
175 "membership value when loading an egg file. This affects animated "
176 "egg files only. There is a substantial runtime "
177 "performance advantage for reducing trivial differences in joint "
178 "membership. Set this to 0 to leave joint membership as it is."));
181 (
"egg-vertex-max-num-joints", 4,
182 PRC_DESC(
"Specifies the maximum number of distinct joints that are allowed "
183 "to control any one vertex. If a vertex requests assignment to "
184 "more than this number of joints, the joints with the lesser membership "
185 "value are ignored. Set this to -1 to allow any number of joints."));
188 (
"egg-implicit-alpha-binary",
false,
189 PRC_DESC(
"If this is true, then a <Scalar> alpha value appearing in an egg "
190 "file that appears to specify only a binary (0 or 1) value for alpha "
191 "will automatically be downgraded to alpha type \"binary\" instead of "
192 "whatever appears in the egg file."));
194 ConfigureFn(config_egg2pg) {
208 static bool initialized =
false;
220 (
"egg-object-type-*",
221 ConfigVariableCore::VT_string,
"",
222 "Defines egg syntax for the named object type.",
223 ConfigVariableCore::F_dynamic);
225 EggRenderState::init_type();
226 LoaderFileTypeEgg::init_type();
ConfigVariableCore * make_variable_template(const string &pattern, ConfigFlags::ValueType type, const string &default_value, const string &description=string(), int flags=0)
Defines a variable "template" to match against dynamically-defined variables that may or may not be c...
This is a convenience class to specialize ConfigVariable as a boolean type.
static LoaderFileTypeRegistry * get_global_ptr()
Returns a pointer to the global LoaderFileTypeRegistry object.
This defines the Loader interface to read Egg files.
A global object that maintains the set of ConfigVariables (actually, ConfigVariableCores) everywhere ...
void register_type(LoaderFileType *type)
Defines a new LoaderFileType in the universe.
This is a convenience class to specialize ConfigVariable as a floating-point type.
This class specializes ConfigVariable as an enumerated type.
This class maintains the set of all known LoaderFileTypes in the universe.
This is a convenience class to specialize ConfigVariable as an integer type.