struct
LightComponent
ECS component for light sources
- Module
- SceneTypes
- Header
#include "SceneTypes/Components/LightComponent.h"- Namespace
Mowo- Reflection
- Reflected by MowoHeaderTool
Properties
| Type | Name | Description |
|---|---|---|
bool | enabled | Default true. |
LightType | type | Default LightType::Point. |
Vec3 | color | Common properties Default Vec3(1.0f, 1.0f, 1.0f). |
float | intensity | Deliberately 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. |
ELightIntensityUnits | intensityUnits | Photometric 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. |
float | colorTemperature | Blackbody 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. |
float | radius | Point/Spot light specific Default 10.0f. |
float | sourceRadius | Area 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. |
float | sourceAngle | Default 0.5357f. |
float | innerConeAngle | Spot light specific Default 25.0f. |
float | outerConeAngle | Default 35.0f. |
EAreaLightShape | areaShape | Rect (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. |
float | sourceWidth | Default 1.0f. |
float | sourceHeight | Default 1.0f. |
bool | twoSided | Default false. |
float | contactShadowLength | Screen-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::string | iesProfilePath | IES photometric profile — a real-world luminaire intensity distribution (.ies file in the VFS, or a "builtin:*" preset). Empty = a uniform light. |
std::string | cookieTexturePath | Light 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::string | lightFunctionMaterialPath | Light 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_t | lightChannels | Light 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. |
bool | castShadows | Shadow 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. |
float | shadowBias | Default 1.0f. |
int32_t | shadowResolutionBias | Default 0. |
float | shadowNearPlane | Default 0.1f. |
float | volumetricScattering | Default 1.0f. |
Constructors
| Signature | Name | Description |
|---|---|---|
LightComponent() = default | LightComponent |
Public functions
| Returns | Name | Description |
|---|---|---|
LightComponent | CreatePoint | |
LightComponent | CreateDirectional | |
LightComponent | CreateSpot | |
LightComponent | CreateRect | |
Vec3 | EffectiveColor | |
DirectionalLight | ToDirectionalLight | Direction should be provided from transform |
PointLight | ToPointLight | Position should be provided from transform |
SpotLight | ToSpotLight | Position and direction should be provided from transform |
RectLight | ToRectLight | Position, forward and right axes should be provided from transform |
Function details
LightComponent
C++
LightComponent() = defaultCreatePoint
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() constToDirectionalLight
C++
DirectionalLight ToDirectionalLight(const Vec3& direction) constDirection should be provided from transform
ToPointLight
C++
PointLight ToPointLight(const Vec3& position) constPosition should be provided from transform
ToSpotLight
C++
SpotLight ToSpotLight(const Vec3& position, const Vec3& direction) constPosition and direction should be provided from transform
ToRectLight
C++
RectLight ToRectLight(const Vec3& position, const Vec3& direction, const Vec3& rightAxis) constPosition, forward and right axes should be provided from transform
Generated from SceneTypes/Components/LightComponent.h via scenetypes.json · Nov 4, 2026Version 1.0.0