Lights
Forge currently supports three built-in light types:
PointLightSphereLightEnvLight
PointLight
Preferred form:
let key = PointLight {
position: vec3(3.4, 4.0, 4.8),
color: #fff2d8,
intensity: 120.0
};
Supported fields:
positioncolorintensity
The emitted power is color * intensity, with inverse-square falloff from the light position.
SphereLight
SphereLight is the first real area light in ForgedThoughts. It gives softer shadows than PointLight by sampling a spherical emitter.
let key = SphereLight {
position: vec3(2.6, 3.4, 3.8),
radius: 0.7,
color: #fff1da,
intensity: 48.0,
samples: 8
};
Supported fields:
positionradiusorrcolorintensitysamples
Notes:
- The emitted power is
color * intensity. - Larger
radiusvalues produce softer shadows. - Higher
samplesvalues reduce shadow stepping/noise, but cost more render time. - If
radiusis0,SphereLightbehaves like a point light.
EnvLight
Preferred form:
let sky = EnvLight {
color: #d8e7ff,
intensity: 0.35
};
Supported fields:
colorintensity
The environment contribution is color * intensity.