LightLensNode

from panda3d.core import LightLensNode
class LightLensNode

Bases: Light, Camera

A derivative of Light and of Camera. The name might be misleading: it does not directly derive from LensNode, but through the Camera class. The Camera serves no purpose unless shadows are enabled.

Inheritance diagram

Inheritance diagram of LightLensNode

static getClassType()TypeHandle
getShadowBuffer(gsg: GraphicsStateGuardianBase)GraphicsOutputBase

Returns the buffer that has been constructed for a given GSG, or NULL if no such buffer has (yet) been constructed. This should be used for debugging only, you will not need to call this normally.

getShadowBufferSize()LVecBase2i

Returns the size of the shadow buffer to be created for this light source.

getShadowBufferSort()int

Returns the sort of the shadow buffer to be created for this light source.

hasSpecularColor()bool

Returns true if this light defines a specular color, false if the specular color is derived automatically from the light color.

isShadowCaster()bool

Returns whether this light is configured to cast shadows or not.

output(out: ostream)None

We have to explicitly publish these because they resolve the multiple inheritance.

setShadowBufferSize(size: LVecBase2i)None

Sets the size of the shadow buffer to be created for this light source.

setShadowCaster(caster: bool)None

Sets the flag indicating whether this light should cast shadows or not. This is the variant without buffer size, meaning that the current buffer size will be kept (512x512 is the default). Note that enabling shadows will require the shader generator to be enabled on the scene.

setShadowCaster(caster: bool, buffer_xsize: int, buffer_ysize: int, sort: int)None

Sets the flag indicating whether this light should cast shadows or not. The xsize and ysize parameters specify the size of the shadow buffer that will be set up, the sort parameter specifies the sort. Note that enabling shadows will require the shader generator to be enabled on the scene.

property shadow_buffer_sizeLVecBase2i
Getter

Returns the size of the shadow buffer to be created for this light source.

Setter

Sets the size of the shadow buffer to be created for this light source.

property shadow_casterbool

Returns whether this light is configured to cast shadows or not.

write(out: ostream, indent_level: int)None