# Lighting Environment 2D

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

```
component engine.LightingEnvironment2D
```

Lighting and output policy for a camera. An empty camera applies to the current output; overlapping environments are an error.

[LightingEnvironment2D](/ref/engine.LightingEnvironment2D.md) supplies ambient colour and intensity, exposure, `Auto`/`LDR`/`HDR`, mask resolution and the local-shadow budget. Set `camera` to target one Camera2D, or leave it empty to apply to the world's 2D outputs. Several matching environments produce a diagnostic; their order never chooses a winner. Without an environment, white ambient with intensity one preserves compatible Lit defaults.

LDR uses a linear RGBA8 scene target. HDR uses a verified renderable RGBA16F target and a display resolve. Auto chooses HDR when the output needs lighting and the device supports it. If the actual framebuffer cannot be used, the Inspector reports the LDR fallback reason. The UI and editor overlays stay outside scene tone mapping. A camera with an active Bloom pass filters the composed scene before this display transform.

Scene View has its own output, not the identity of a game camera. Select **Preview in Scene View** in an environment's Inspector to preview that environment explicitly. Changes to its fields become visible immediately. **Use scene environment defaults** clears the preview selection. The selection is per document and does not alter camera references, prefabs, Play state or Undo history. Deleting or disabling the selected environment preserves its preview ID and reports a diagnostic until it is restored or the selection is reset.

The Scene View toolbar can bypass lighting or display transformed normals and shadow visibility. These controls affect that view only. For a transparent HDR output, resolve preserves the premultiplied colour contract. Additive emission must first be composed into an opaque backdrop, or retained in a linear RGBA16F intermediate, before a display image is produced. Additive RGB preserves destination alpha.

## Fields

| Name | Script name | Type | Default | Description |
|---|---|---|---|---|
| Camera | `Camera` | `NodeRef` | `none` | Optional Camera2D node. Empty applies to all 2D views of this world. |
| Ambient Color | `AmbientColor` | `Color` | `rgba(1, 1, 1, 1)` | Linear ambient surface illumination. Default white preserves unlit-looking Lit scenes with no lights. |
| Ambient Intensity | `AmbientIntensity` | `float` | `1` | Nonnegative ambient energy multiplier. |
| Color Mode | `ColorMode` | `enum` | `auto` | Auto chooses supported HDR for Lit output; LDR uses RGBA8 and HDR requests RGBA16F. |
| Exposure | `Exposure` | `float` | `1` | Positive display-resolve exposure, without changing UI or simulation. |
| Shadow Resolution | `ShadowResolution` | `int` | `256` | Power-of-two mask dimension between 64 and 2048. Initial profile uses 256. |
| Max Shadowed Lights | `MaxShadowedLights` | `int` | `8` | Per-camera local-shadow budget from 0 through 16; actual performance depends on the GPU. |
