Panda3D
config_pgraphnodes.cxx
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file config_pgraphnodes.cxx
10  * @author drose
11  * @date 2008-11-05
12  */
13 
14 #include "config_pgraphnodes.h"
15 
16 #include "ambientLight.h"
17 #include "callbackData.h"
18 #include "callbackNode.h"
19 #include "callbackObject.h"
20 #include "computeNode.h"
21 #include "directionalLight.h"
22 #include "fadeLodNode.h"
23 #include "fadeLodNodeData.h"
24 #include "lightLensNode.h"
25 #include "lightNode.h"
26 #include "lodNode.h"
27 #include "nodeCullCallbackData.h"
28 #include "pointLight.h"
29 #include "rectangleLight.h"
30 #include "selectiveChildNode.h"
31 #include "sequenceNode.h"
32 #include "shaderGenerator.h"
33 #include "sphereLight.h"
34 #include "spotlight.h"
35 #include "switchNode.h"
36 #include "uvScrollNode.h"
37 
38 #include "dconfig.h"
39 
40 #if !defined(CPPPARSER) && !defined(LINK_ALL_STATIC) && !defined(BUILDING_PANDA_PGRAPHNODES)
41  #error Buildsystem error: BUILDING_PANDA_PGRAPHNODES not defined
42 #endif
43 
44 ConfigureDef(config_pgraphnodes);
45 NotifyCategoryDef(pgraphnodes, "");
46 
47 ConfigureFn(config_pgraphnodes) {
49 }
50 
51 ConfigVariableEnum<LODNodeType> default_lod_type
52 ("default-lod-type", LNT_pop,
53  PRC_DESC("Set this to either 'pop' or 'fade' to determine the type of "
54  "LODNode that is created by LODNode::make_default_lod()."));
55 
56 ConfigVariableBool support_fade_lod
57 ("support-fade-lod", true,
58  PRC_DESC("Set this false to make FadeLOD nodes behave like regular LOD nodes "
59  "(ignoring the fade time). This may be useful, for instance, to "
60  "test the performance impact of using FadeLOD nodes."));
61 
62 ConfigVariableDouble lod_fade_time
63 ("lod-fade-time", 0.5,
64  PRC_DESC("The default amount of time (in seconds) over which a FadeLODNode "
65  "transitions between its different levels."));
66 
67 ConfigVariableString lod_fade_bin_name
68 ("lod-fade-bin-name", "fixed",
69  PRC_DESC("The default bin name in which to place the fading part of a "
70  "FadeLODNode transition."));
71 
72 ConfigVariableInt lod_fade_bin_draw_order
73 ("lod-fade-bin-draw-order", 0,
74  PRC_DESC("The default bin draw order to assign the fading part of a "
75  "FadeLODNode transition."));
76 
77 ConfigVariableInt lod_fade_state_override
78 ("lod-fade-state-override", 1000,
79  PRC_DESC("The default override value to assign to the fade attribs "
80  "in order to effect a FadeLODNode transition."));
81 
82 ConfigVariableBool verify_lods
83 ("verify-lods", false,
84  PRC_DESC("When this is true, LODNodes will test when they are rendered to "
85  "ensure that each child's geometry fits entirely within the radius "
86  "defined by its switch-out distance. When it is false, LODNodes "
87  "may have any switch in and out distances, regardless of the "
88  "actual size of their geometry. This test is only made in NDEBUG "
89  "mode (the variable is ignored in a production build)."));
90 
91 ConfigVariableInt parallax_mapping_samples
92 ("parallax-mapping-samples", 3,
93  PRC_DESC("Sets the amount of samples to use in the parallax mapping "
94  "implementation. A value of 0 means to disable it entirely."));
95 
96 ConfigVariableDouble parallax_mapping_scale
97 ("parallax-mapping-scale", 0.1,
98  PRC_DESC("Sets the strength of the effect of parallax mapping, that is, "
99  "how much influence the height values have on the texture "
100  "coordinates."));
101 
102 /**
103  * Initializes the library. This must be called at least once before any of
104  * the functions or classes in this library can be used. Normally it will be
105  * called by the static initializers and need not be called explicitly, but
106  * special cases exist.
107  */
108 void
110  static bool initialized = false;
111  if (initialized) {
112  return;
113  }
114  initialized = true;
115 
116  AmbientLight::init_type();
117  CallbackData::init_type();
118  CallbackNode::init_type();
119  CallbackObject::init_type();
120  ComputeNode::init_type();
121  DirectionalLight::init_type();
122  FadeLODNode::init_type();
123  FadeLODNodeData::init_type();
124  LightLensNode::init_type();
125  LightNode::init_type();
126  LODNode::init_type();
127  NodeCullCallbackData::init_type();
128  PointLight::init_type();
129  RectangleLight::init_type();
130  SelectiveChildNode::init_type();
131  SequenceNode::init_type();
132  ShaderGenerator::init_type();
133  SphereLight::init_type();
134  Spotlight::init_type();
135  SwitchNode::init_type();
136  UvScrollNode::init_type();
137 
153 }
LODNode::register_with_read_factory
static void register_with_read_factory()
Tells the BamReader how to create objects of type LODNode.
Definition: lodNode.cxx:682
lightLensNode.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
ConfigVariableBool
This is a convenience class to specialize ConfigVariable as a boolean type.
Definition: configVariableBool.h:23
shaderGenerator.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
rectangleLight.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
FadeLODNode::register_with_read_factory
static void register_with_read_factory()
Tells the BamReader how to create objects of type LODNode.
Definition: fadeLodNode.cxx:345
sequenceNode.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
AmbientLight::register_with_read_factory
static void register_with_read_factory()
Tells the BamReader how to create objects of type AmbientLight.
Definition: ambientLight.cxx:95
selectiveChildNode.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
nodeCullCallbackData.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
uvScrollNode.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
UvScrollNode::register_with_read_factory
static void register_with_read_factory()
Tells the BamReader how to create objects of type UvScrollNode.
Definition: uvScrollNode.cxx:43
ConfigVariableEnum
This class specializes ConfigVariable as an enumerated type.
Definition: configVariableEnum.h:31
config_pgraphnodes.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
fadeLodNode.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
CallbackNode::register_with_read_factory
static void register_with_read_factory()
Tells the BamReader how to create objects of type CallbackNode.
Definition: callbackNode.cxx:156
switchNode.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
sphereLight.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
ComputeNode::register_with_read_factory
static void register_with_read_factory()
Tells the BamReader how to create objects of type ComputeNode.
Definition: computeNode.cxx:150
lodNode.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
SwitchNode::register_with_read_factory
static void register_with_read_factory()
Tells the BamReader how to create objects of type SwitchNode.
Definition: switchNode.cxx:152
PointLight::register_with_read_factory
static void register_with_read_factory()
Tells the BamReader how to create objects of type PointLight.
Definition: pointLight.cxx:221
computeNode.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
ambientLight.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
lightNode.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
init_libpgraphnodes
void init_libpgraphnodes()
Initializes the library.
Definition: config_pgraphnodes.cxx:109
fadeLodNodeData.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
callbackNode.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Spotlight::register_with_read_factory
static void register_with_read_factory()
Tells the BamReader how to create objects of type Spotlight.
Definition: spotlight.cxx:242
dconfig.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
SphereLight::register_with_read_factory
static void register_with_read_factory()
Tells the BamReader how to create objects of type SphereLight.
Definition: sphereLight.cxx:106
RectangleLight::register_with_read_factory
static void register_with_read_factory()
Tells the BamReader how to create objects of type RectangleLight.
Definition: rectangleLight.cxx:110
pointLight.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
ConfigVariableDouble
This is a convenience class to specialize ConfigVariable as a floating- point type.
Definition: configVariableDouble.h:24
directionalLight.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
callbackObject.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
DirectionalLight::register_with_read_factory
static void register_with_read_factory()
Tells the BamReader how to create objects of type DirectionalLight.
Definition: directionalLight.cxx:157
ConfigVariableInt
This is a convenience class to specialize ConfigVariable as an integer type.
Definition: configVariableInt.h:24
PandaNode::register_with_read_factory
static void register_with_read_factory()
Tells the BamReader how to create objects of type PandaNode.
Definition: pandaNode.cxx:3574
callbackData.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
spotlight.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
ConfigVariableString
This is a convenience class to specialize ConfigVariable as a string type.
Definition: configVariableString.h:23
SequenceNode::register_with_read_factory
static void register_with_read_factory()
Tells the BamReader how to create objects of type SequenceNode.
Definition: sequenceNode.cxx:146