Skip to main content

LightSpot

The LightSpot class represents a spot light source such as a flashlight or car headlights. It includes a radius parameter to attenuate light intensity based on the distance between the light and the receiver. The area radius simulates a spherical light source, producing accurate soft shadows. It allows setting inner and outer angles to control the beam shape. An optional 2D intensity texture can be applied to simulate direction-dependent color modulation.

#include <scene/TellusimLightSpot.h>

Inheritance

Constructors

explicit LightSpot(const char *name = nullptr)
explicit LightSpot(Scene &scene, const char *name = nullptr)

Methods

Light radius.

void setRadius(float32_t radius)
float32_t getRadius() const

Light area radius.

void setAreaRadius(float32_t radius)
float32_t getAreaRadius() const

Light angles.

void setInnerAngle(float32_t inner_angle)
void setOuterAngle(float32_t outer_angle)
void setAngles(float32_t inner_angle, float32_t outer_angle)
float32_t getInnerAngle() const
float32_t getOuterAngle() const

Intensity texture.

void setIntensityTexture(const char *file, uint32_t priority = 0)
void setIntensityTexture(const String &file, uint32_t priority = 0)
void setIntensityTexture(const char *hash, const char *file, uint32_t priority = 0)
void setIntensityTexture(const char *hash, Image &image, uint32_t priority = 0)
void setIntensityTexture(const char *hash, Texture &texture, uint32_t priority = 0)
String getIntensityTextureHash() const
String getIntensityTextureFile() const
Texture getIntensityTextureSource() const