# aego/lighting

> Aego 0.12.5 · development; docs build `4a32b816933e02930662f6a443cb25abe6050d090c55e237cbff5c44ae9b25f8`. [Build manifest](/docs-build.json).

Use `SetEnabled` to compare the lit image with the original albedo. `SetDebug` accepts `lighting`, `normals` or `shadows`; invalid names fault before changing the view. `Enabled` and `Debug` read the current view state. These calls do not edit material assets, scene components or gameplay state.

```aes check
package demo

import (
    "aego/lighting"
    "aego/log"
)

script InspectLighting {
    func Ready() {
        lighting.SetEnabled(true)
        lighting.SetDebug("normals")
        log.Info("Lighting display: " + lighting.Debug())
    }
}
```

Light components use the regular typed API and animation property paths. For example, `Light2D.intensity`, `Light2D.range`, `Light2D.color` and the cone angles can be animated with Tween or Animation. In the MaterialOverride track, select the declared Lit parameter by name: `NormalStrength`, `EmissionIntensity` or `ReceiveShadows`. A normal-map or cookie reference is a texture resource, not a numerical instance override.

### A lamp in the platformer

Open `examples/platformer`, whose main level contains the canonical lighting demonstration. Its lamp sprites use emission for their own appearance and separate Light2D components to illuminate nearby surfaces. Platforms and walls supply manual shadow contours. HUD and menus remain Unlit. The project includes actual albedo, normal and height source assets with `.meta` identities.

Change a lamp's colour, height or range, then use Undo/Redo, Play and the registered lighting debug actions. Bloom on the main camera spreads bright lamp and spark pixels into a halo. The lamp’s Light2D illuminates neighbouring surfaces. Export this project for native or web using the normal strict export workflow. The website demo is built from the same platformer export, with no independently edited copy of its level.

## Debug

```
func Debug() string
```

Returns this world's view debug display: lighting, normals or shadows.

## Enabled

```
func Enabled() bool
```

Returns whether this world's current view applies lighting.

## SetDebug

```
func SetDebug(mode string)
```

Selects the view debug display: lighting, normals or shadows. This does not mutate the scene.

## SetEnabled

```
func SetEnabled(enabled bool)
```

Enables or bypasses lighting in this world's current view without changing scene materials or simulation.
