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