Panda3D
Loading...
Searching...
No Matches
lightLensNode.I
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 lightLensNode.I
10 * @author drose
11 * @date 2002-03-26
12 */
13
14/**
15 * Returns true if this light defines a specular color, false if the specular
16 * color is derived automatically from the light color.
17 */
18INLINE bool LightLensNode::
19has_specular_color() const {
20 return _has_specular_color;
21}
22
23/**
24 * Returns whether this light is configured to cast shadows or not.
25 */
26INLINE bool LightLensNode::
27is_shadow_caster() const {
28 return _shadow_caster;
29}
30
31/**
32 * Returns the sort of the shadow buffer to be created for this light source.
33 */
36 return _sb_sort;
37}
38
39/**
40 * Returns the size of the shadow buffer to be created for this light source.
41 */
42INLINE LVecBase2i LightLensNode::
44 return _sb_size;
45}
46
47/**
48 * Sets the size of the shadow buffer to be created for this light source.
49 */
50INLINE void LightLensNode::
51set_shadow_buffer_size(const LVecBase2i &size) {
52 if (size != _sb_size) {
53 clear_shadow_buffers();
54 _sb_size = size;
55 setup_shadow_map();
56 }
57}
58
59/**
60 * Returns the buffer that has been constructed for a given GSG, or NULL if no
61 * such buffer has (yet) been constructed. This should be used for debugging
62 * only, you will not need to call this normally.
63 */
66 ShadowBuffers::iterator it = _sbuffers.find(gsg);
67 if (it == _sbuffers.end()) {
68 return nullptr;
69 } else {
70 return (*it).second;
71 }
72}
73
74/**
75 * Marks this light as having been used by the auto shader.
76 */
77INLINE void LightLensNode::
79 _used_by_auto_shader = true;
80}
An abstract base class for GraphicsOutput, for all the usual reasons.
This is a base class for the GraphicsStateGuardian class, which is itself a base class for the variou...
set_shadow_buffer_size
Sets the size of the shadow buffer to be created for this light source.
is_shadow_caster
Returns whether this light is configured to cast shadows or not.
bool has_specular_color() const
Returns true if this light defines a specular color, false if the specular color is derived automatic...
int get_shadow_buffer_sort() const
Returns the sort of the shadow buffer to be created for this light source.
void mark_used_by_auto_shader() const
Marks this light as having been used by the auto shader.
get_shadow_buffer_size
Returns the size of the shadow buffer to be created for this light source.
GraphicsOutputBase * get_shadow_buffer(GraphicsStateGuardianBase *gsg)
Returns the buffer that has been constructed for a given GSG, or NULL if no such buffer has (yet) bee...