struct

LightComponent

ECS component for light sources

Module
SceneTypes
Header
#include "SceneTypes/Components/LightComponent.h"
Namespace
Mowo
Reflection
Reflected by MowoHeaderTool

Properties

TypeNameDescription
boolenabledDefault true.
LightTypetypeDefault LightType::Point.
Vec3colorCommon properties Default Vec3(1.0f, 1.0f, 1.0f).
floatintensityDeliberately carries no MOWO_UNITS: what this number means is decided by intensityUnits below, so a fixed suffix would be wrong for every value of that enum but one. Default 1.0f.
ELightIntensityUnitsintensityUnitsPhotometric units for intensity. Legacy (default) keeps the historical artist scale and the range-window falloff — every existing scene renders byte-identically. Lumens/Candela/EV100 make a local light physical (true inverse-square falloff, the radius only windows the cull range); Lux is the directional-only illuminance unit. Mismatched unit/type combinations fall back to Legacy semantics. Default ELightIntensityUnits::Legacy.
floatcolorTemperatureBlackbody color temperature in Kelvin (0 = disabled, 1000-15000 valid). Multiplies the authored color by the normalized Planckian-locus tint at packet build — never per pixel. Default 0.0f.
floatradiusPoint/Spot light specific Default 10.0f.
floatsourceRadiusArea light source radius (R3 lighting upgrade). A physical emitter size (a sphere/disk bulb) → soft, large specular highlights via the representative-point method. 0 = a classic punctual light. Default 0.0f.
floatsourceAngleDefault 0.5357f.
floatinnerConeAngleSpot light specific Default 25.0f.
floatouterConeAngleDefault 35.0f.
EAreaLightShapeareaShapeRect (area) light specific — emitter extents in world units. The emitter faces along the entity's forward axis; width runs along the right axis. Disc reads width as its diameter, tube reads width as its length and height as its diameter. Default EAreaLightShape::Rect.
floatsourceWidthDefault 1.0f.
floatsourceHeightDefault 1.0f.
booltwoSidedDefault false.
floatcontactShadowLengthScreen-space contact shadows — a short depth-buffer ray march toward the light that grounds small-scale contact geometry the shadow map misses. Ray length in world units; 0 = off (UE default). Applies to all types. Default 0.0f.
std::stringiesProfilePathIES photometric profile — a real-world luminaire intensity distribution (.ies file in the VFS, or a "builtin:*" preset). Empty = a uniform light.
std::stringcookieTexturePathLight function / cookie (gobo) — a texture projected through the light frustum that tints and masks the emitted light. Spot/rect project along the aim axis; point lights map by direction. Empty = no cookie.
std::stringlightFunctionMaterialPathLight function (UE's): a material — best a graph with Domain = Light Function, whose Emissive becomes the filter — evaluated every frame and projected through the light like the cookie, which it replaces. Point, spot and rect lights; a directional light ignores it. Empty = none.
uint32_tlightChannelsLight channel bitmask — a light only affects geometry whose own channel mask shares a bit. Default 1 (channel 0) matches the default mesh mask, so an unauthored scene is unchanged. 0 is treated as "all channels". Four channels are enforced per pixel (bits 0..3); higher bits read as 0. Default 1.
boolcastShadowsShadow casting. Default ON per the UE convention — MDF omits default-valued fields, so unauthored scenes pick the new default up and an explicit untick keeps working. Default true.
floatshadowBiasDefault 1.0f.
int32_tshadowResolutionBiasDefault 0.
floatshadowNearPlaneDefault 0.1f.
floatvolumetricScatteringDefault 1.0f.

Constructors

SignatureNameDescription
LightComponent() = defaultLightComponent

Public functions

ReturnsNameDescription
LightComponentCreatePoint
LightComponentCreateDirectional
LightComponentCreateSpot
LightComponentCreateRect
Vec3EffectiveColor
DirectionalLightToDirectionalLightDirection should be provided from transform
PointLightToPointLightPosition should be provided from transform
SpotLightToSpotLightPosition and direction should be provided from transform
RectLightToRectLightPosition, forward and right axes should be provided from transform

Function details

LightComponent

C++
LightComponent() = default

CreatePoint

C++
static LightComponent CreatePoint(const Vec3& col = Vec3(1.0f, 1.0f, 1.0f), float intens = 1.0f, float rad = 10.0f)

CreateDirectional

C++
static LightComponent CreateDirectional(const Vec3& col = Vec3(1.0f, 1.0f, 1.0f), float intens = 1.0f)

CreateSpot

C++
static LightComponent CreateSpot(const Vec3& col = Vec3(1.0f, 1.0f, 1.0f), float intens = 1.0f, float rad = 10.0f, float innerAngle = 25.0f, float outerAngle = 35.0f)

CreateRect

C++
static LightComponent CreateRect(const Vec3& col = Vec3(1.0f, 1.0f, 1.0f), float intens = 1.0f, float rad = 10.0f, float w = 1.0f, float h = 1.0f)

EffectiveColor

C++
Vec3 EffectiveColor() const

ToDirectionalLight

C++
DirectionalLight ToDirectionalLight(const Vec3& direction) const

Direction should be provided from transform

ToPointLight

C++
PointLight ToPointLight(const Vec3& position) const

Position should be provided from transform

ToSpotLight

C++
SpotLight ToSpotLight(const Vec3& position, const Vec3& direction) const

Position and direction should be provided from transform

ToRectLight

C++
RectLight ToRectLight(const Vec3& position, const Vec3& direction, const Vec3& rightAxis) const

Position, forward and right axes should be provided from transform

Generated from SceneTypes/Components/LightComponent.h via scenetypes.json · Nov 4, 2026Version 1.0.0