14#ifndef SCENEGRAPHREDUCER_H
15#define SCENEGRAPHREDUCER_H
39class EXPCL_PANDA_PGRAPH SceneGraphReducer {
42 INLINE ~SceneGraphReducer();
47 TT_color_scale = 0x004,
48 TT_tex_matrix = 0x008,
49 TT_clip_plane = 0x010,
51 TT_apply_texture_color = 0x040,
55 enum CombineSiblings {
57 CS_within_radius = 0x002,
62 enum CollectVertexData {
73 CVD_transform = 0x004,
79 CVD_avoid_dynamic = 0x008,
83 CVD_one_node_only = 0x010,
93 CVD_usage_hint = 0x040,
97 CVD_animation_type = 0x080,
100 enum MakeNonindexed {
104 MN_composite_only = 0x001,
109 MN_avoid_animated = 0x002,
113 MN_avoid_dynamic = 0x004,
123 INLINE
void apply_attribs(
PandaNode *node,
int attrib_types = ~(TT_clip_plane | TT_cull_face | TT_apply_texture_color));
149 int combine_siblings_bits);
150 int flatten_siblings(
PandaNode *parent_node,
151 int combine_siblings_bits);
153 bool consider_child(
PandaNode *grandparent_node,
158 bool do_flatten_child(
PandaNode *grandparent_node,
174 int r_collect_vertex_data(
PandaNode *node,
int collect_bits,
176 int r_make_nonindexed(
PandaNode *node,
int collect_bits);
177 void r_unify(
PandaNode *node,
int max_indices,
bool preserve_order);
185 PN_stdfloat _combine_radius;
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This class is used by the SceneGraphReducer to maintain and accumulate the set of attributes we have ...
This is a base class for the GraphicsStateGuardian class, which is itself a base class for the variou...
Encodes a string name in a hash table, mapping it to a pointer.
A lightweight class that represents a single element that may be timed and/or counted via stats.
A basic node of the scene graph or data graph.
This represents a unique collection of RenderAttrib objects that correspond to a particular renderabl...
int collect_vertex_data(PandaNode *root, int collect_bits=~0)
Collects all different GeomVertexData blocks that have compatible formats at this node and below into...
int make_compatible_format(PandaNode *root, int collect_bits=~0)
Walks through the tree at this node and below and unifies the GeomVertexFormat for any GeomVertexData...
int make_nonindexed(PandaNode *root, int nonindexed_bits=~0)
Converts indexed geometry to nonindexed geometry at the indicated node and below, by duplicating vert...
void set_combine_radius(PN_stdfloat combine_radius)
Specifies the radius that is used in conjunction with CS_within_radius to decide whether a subgraph's...
PN_stdfloat get_combine_radius() const
Returns the radius that is used in conjunction with CS_within_radius.
void set_gsg(GraphicsStateGuardianBase *gsg)
Specifies the particular GraphicsStateGuardian that this object will attempt to optimize to.
int flatten(PandaNode *root, int combine_siblings_bits)
Simplifies the graph by removing unnecessary nodes and nodes.
int make_compatible_state(PandaNode *root)
Searches for GeomNodes that contain multiple Geoms that differ only in their ColorAttribs.
GraphicsStateGuardianBase * get_gsg() const
Returns the particular GraphicsStateGuardian that this object will attempt to optimize to.
void unify(PandaNode *root, bool preserve_order)
Calls unify() on every GeomNode at this level and below.
void clear_gsg()
Specifies that no particular GraphicsStateGuardian will be used to guide the optimization.
int remove_column(PandaNode *root, const InternalName *column)
Removes the indicated data column from any GeomVertexDatas found at the indicated root and below.
void remove_unused_vertices(PandaNode *root)
Removes any vertices in GeomVertexDatas that are no longer used at this level and below.
void premunge(PandaNode *root, const RenderState *initial_state)
Walks the scene graph rooted at this node and below, and uses the indicated GSG to premunge every Geo...
bool check_live_flatten(PandaNode *node)
In a non-release build, returns false if the node is correctly not in a live scene graph.
void decompose(PandaNode *root)
Calls decompose() on every GeomNode at this level and below.
void apply_attribs(PandaNode *node, int attrib_types=~(TT_clip_plane|TT_cull_face|TT_apply_texture_color))
Walks the scene graph, accumulating attribs of the indicated types, applying them to the vertices,...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.