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 }
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
static void register_with_read_factory()
Tells the BamReader how to create objects of type SphereLight.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
static void register_with_read_factory()
Tells the BamReader how to create objects of type SequenceNode.
static void register_with_read_factory()
Tells the BamReader how to create objects of type UvScrollNode.
static void register_with_read_factory()
Tells the BamReader how to create objects of type DirectionalLight.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is a convenience class to specialize ConfigVariable as a boolean type.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
static void register_with_read_factory()
Tells the BamReader how to create objects of type ComputeNode.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
static void register_with_read_factory()
Tells the BamReader how to create objects of type PandaNode.
Definition: pandaNode.cxx:3580
static void register_with_read_factory()
Tells the BamReader how to create objects of type LODNode.
Definition: lodNode.cxx:682
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is a convenience class to specialize ConfigVariable as a floating- point type.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void init_libpgraphnodes()
Initializes the library.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is a convenience class to specialize ConfigVariable as a string type.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This class specializes ConfigVariable as an enumerated type.
static void register_with_read_factory()
Tells the BamReader how to create objects of type PointLight.
Definition: pointLight.cxx:221
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.
static void register_with_read_factory()
Tells the BamReader how to create objects of type Spotlight.
Definition: spotlight.cxx:242
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is a convenience class to specialize ConfigVariable as an integer type.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
static void register_with_read_factory()
Tells the BamReader how to create objects of type SwitchNode.
Definition: switchNode.cxx:152
static void register_with_read_factory()
Tells the BamReader how to create objects of type RectangleLight.
static void register_with_read_factory()
Tells the BamReader how to create objects of type CallbackNode.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
static void register_with_read_factory()
Tells the BamReader how to create objects of type AmbientLight.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
static void register_with_read_factory()
Tells the BamReader how to create objects of type LODNode.