Skip to content

raisin::AdditionalLight ​

struct · #include <rayrai/RenderQuality.hpp>

Lightweight imported or viewer light used for extra fill/rim lighting.

Extra lights are shading-only by default and are capped to keep the fast one-light path available. One of them can be promoted to the main shadow-casting light.

Public attributes ​

type ​

cpp
LightType type

Light model.

position ​

cpp
glm::vec3 position

World position, metres (point/spot/area).

direction ​

cpp
glm::vec3 direction

Direction the light travels (directional/spot); normalized when added.

ambient ​

cpp
glm::vec3 ambient

Ambient color contribution (linear RGB).

diffuse ​

cpp
glm::vec3 diffuse

Diffuse color/intensity (linear RGB).

specular ​

cpp
glm::vec3 specular

Specular color/intensity (linear RGB).

constant ​

cpp
float constant

Attenuation: intensity / (constant + linear * d + quadratic * d^2).

linear ​

cpp
float linear

Linear attenuation term, 1/m.

quadratic ​

cpp
float quadratic

Quadratic attenuation term, 1/m^2.

spotInnerCos ​

cpp
float spotInnerCos

Cosine of the full-intensity spot cone half-angle (swapped with outer if smaller).

spotOuterCos ​

cpp
float spotOuterCos

Cosine of the spot cutoff half-angle.

radius ​

cpp
float radius

Light source size, metres: the attenuation distance is at least this (a quarter, min 0.1 m, for area lights). Not a cutoff.

areaSize ​

cpp
glm::vec2 areaSize

Area-light extents along areaRight/areaUp, metres.

areaRight ​

cpp
glm::vec3 areaRight

Area-light width axis.

areaUp ​

cpp
glm::vec3 areaUp

Area-light height axis.

projectorMap ​

cpp
unsigned int projectorMap

Optional GL 2D texture projected by the light; 0 = none.

projectorStrength ​

cpp
float projectorStrength

Projector blend, [0, 1].

projectorUvScaleOffset ​

cpp
glm::vec4 projectorUvScaleOffset

Projector UV transform (scale.xy, offset.zw).

negative ​

cpp
bool negative

Subtract this light's contribution instead of adding it.

temperatureEnabled ​

cpp
bool temperatureEnabled

Tint the light by temperatureKelvin.

temperatureKelvin ​

cpp
float temperatureKelvin

Color temperature, kelvin.

distanceFadeEnabled ​

cpp
bool distanceFadeEnabled

Fade non-directional lights by distance from the camera.

distanceFadeBegin ​

cpp
float distanceFadeBegin

Camera distance where the light fade starts, metres.

distanceFadeShadow ​

cpp
float distanceFadeShadow

Camera distance where the shadow fade starts, metres.

distanceFadeLength ​

cpp
float distanceFadeLength

Length of the smooth fade band, metres.

castsShadows ​

cpp
bool castsShadows

Allow this light to be selected for a shadow map.

RaiSim — physics for robotics and AI.