Scene sun
One directional light for the whole scene. Configure it in Scene Settings.
Properties
Section titled “Properties”Scene Settings sunlight widgets:
| Widget | Purpose |
|---|---|
| Active | Enable the sun. |
| Lux | Illuminance. |
| Azimuth (deg) | Compass angle, 0 to 360. |
| Elevation (deg) | Height above the horizon, -15 to 90. |
| Tint | RGB color. |
| Temperature (K) | Color temperature. |
| Specular Intensity | Highlight strength. |
The stored direction vector is light travel into the scene. (0, -1, 0) is noon (straight down). DirectionalLight.Direction uses that vector.
Pair Lux with Ambient Lux. Ambient Lux is the sky fill widget in Sky / Environment, not “Sky ambient”.
Full physical sun (~100,000 lux) is optional and needs a matching exposure range. Do not use outdoor EV 10 to 16 with sun lux 6.
Shadows
Section titled “Shadows”Scene Settings shadow widgets:
| Widget | Purpose |
|---|---|
| Active | Enable sun shadows. |
| Blur Scale | Edge softness scale. |
| Bias Scale | Self-shadow offset scale. |
| Normal Bias Scale | Normal-offset scale. |
Engine Settings
Section titled “Engine Settings”Cascade count and sun shadow distance come from Engine Settings Shadow Quality. They are not Scene Settings sliders.
| Shadow Quality | Cascades | Sun shadow distance | Local shadow max / fade |
|---|---|---|---|
| OFF | - | : | - |
| LOW | 1 | 50 m | 10 / 5 |
| MEDIUM | 2 | 100 m | 14 / 7 |
| HIGH | 3 | 100 m | 16 / 8 |
| ULTRA | 3 | 200 m | 24 / 12 |
Quality overwrites those distances at load. Near-cascade split is 0.1 × distance. Changing Shadow Quality needs an engine restart for map resolution and cascade count.
Scripting
Section titled “Scripting”The sun is a DirectionalLight component. Read it and set its properties from C#:
using Kolpa.Engine;
public class SunTuner : MonoBehaviour{ public override void OnCreate() { DirectionalLight sun = gameObject.GetComponent<DirectionalLight>(); if (sun != null) { sun.Intensity = 6f; sun.Color = Color.White; sun.Direction = new Vector3(0.55f, -1f, 0.5f); sun.CastsShadows = true; } }}See DirectionalLight for the full surface. Sky ambient and shadow quality stay in the editor settings.
Continue reading
Section titled “Continue reading”Previous: Lighting overview: lux, lumens, and shadow maps.
Next: Light component: local Point and Spot lights.
