Light¶
from panda3d.core import Light
-
class
Light
¶ The abstract interface to all kinds of lights. The actual light objects also inherit from
PandaNode
, and can therefore be added to the scene graph at some arbitrary point to define the coordinate system of effect.Inheritance diagram
-
property
color
→ LColor¶ - Getter
Returns the basic color of the light.
- Setter
Sets the basic color of the light.
-
property
color_temperature
→ float¶ - Getter
Returns the basic color temperature of the light, assuming
hasColorTemperature()
returns true.New in version 1.10.0.
- Setter
Sets the color temperature of the light in kelvins. This will recalculate the light’s color.
The default value is 6500 K, corresponding to a perfectly white light assuming a D65 white point.
New in version 1.10.0.
-
getAttenuation
() → LVecBase3¶ Returns the terms of the attenuation equation for the light. These are, in order, the constant, linear, and quadratic terms based on the distance from the point to the vertex.
-
static
getClassType
() → TypeHandle¶
-
getColorTemperature
() → float¶ Returns the basic color temperature of the light, assuming
hasColorTemperature()
returns true.New in version 1.10.0.
-
getExponent
() → float¶ For spotlights, returns the exponent that controls the amount of light falloff from the center of the spotlight. For other kinds of lights, returns 0.
-
getPriority
() → int¶ Returns the priority associated with this light. See
setPriority()
.
-
getSpecularColor
() → LColor¶ Returns the color of specular highlights generated by the light. This value is meaningless for ambient lights.
-
hasColorTemperature
() → bool¶ Returns true if the color was specified as a temperature in kelvins, and
getColorTemperature()
is defined.New in version 1.10.0.
-
isAmbientLight
() → bool¶ Returns true if this is an
AmbientLight
, false if it is some other kind of light.
-
property
priority
→ int¶ - Getter
Returns the priority associated with this light. See
setPriority()
.- Setter
Changes the relative importance of this light relative to the other lights that are applied simultaneously.
The priority number is used to decide which of the requested lights are to be selected for rendering when more lights are requested than the hardware will support. The highest-priority n lights are selected for rendering.
This is similar to
TextureStage.setPriority()
.
-
setColorTemperature
(temperature: float) → None¶ Sets the color temperature of the light in kelvins. This will recalculate the light’s color.
The default value is 6500 K, corresponding to a perfectly white light assuming a D65 white point.
New in version 1.10.0.
-
setPriority
(priority: int) → None¶ Changes the relative importance of this light relative to the other lights that are applied simultaneously.
The priority number is used to decide which of the requested lights are to be selected for rendering when more lights are requested than the hardware will support. The highest-priority n lights are selected for rendering.
This is similar to
TextureStage.setPriority()
.
-
property