---
title: "Atmosphere sky lighting fog and time of day"
description: "The world needs a sun, sky, and mood. Lighting and local atmosphere are real AI-authorable components; the global sky preset and day-night rate live on the world environment."
engineVersion: v1.0.234
date: 2026-09-28
license: "(c) Gessa, proprietary. Cite with attribution to https://gessa.ai/docs/. Terms: https://gessa.ai/terms/."
canonical: https://gessa.ai/docs/knowledge/playbooks/atmosphere-sky-and-lighting/
---

# Atmosphere sky lighting fog and time of day

## When to use

The world needs a sun, sky, and mood. Lighting and local atmosphere are real
AI-authorable components; the global sky preset and day-night rate live on the
world environment.

## The recipe

1. Sun: attach a directional `LightComponent`
   `{ "type":"LightComponent", "mode":"directional", "color":"#fff2e0",
   "intensity": 3, "castShadow": true }`. `mode` is one of `directional`,
   `point`, `spot`, `area_rect`, `area_disc`, `ambient`. Point the sun by
   rotating the entity's `TransformComponent`.
2. Fill: add a second entity with an ambient `LightComponent`
   `{ "type":"LightComponent", "mode":"ambient", "color":"#8090b0",
   "intensity": 0.4 }` so shadows are not pure black.
3. Effect lights: `point`/`spot` lights use `distance`, `decay`, `angleDeg`
   (1..180 for spot cone), `penumbra`; flicker/pulse via `modulation`
   `{ "mode":"flicker", "rateHz": 6, "depth": 0.4, "seed": 1 }` (modes `none`,
   `strobe`, `pulse`, `flicker`, `disco`).
4. Mood zones: attach `LocalEnvironmentVolumeComponent` to a region entity
   `{ "type":"LocalEnvironmentVolumeComponent", "enabled": true, "shape":"box",
   "overrideFog": true, "fogDensity": 0.3, "overrideAmbient": true,
   "ambientIntensity": 0.6, "overrideExposureCompensation": true,
   "exposureCompensationBias": -0.5, "priority": 1, "blendDistance": 4 }`. It
   sparse-overrides the global environment inside its bounds and blends to the
   world default at `blendDistance`.
5. Global look: apply a renderer visual profile to the world with
   `world_apply_visual_profile` (`renderer.visual_profile.apply`) for the sky
   preset, tone mapping, and post look shipped as a profile.
6. Day-night: the world environment carries an authored EnvState seed
   (`simTimeSeconds` in [0,86400), `timeOfDayRate` game-hours per real second;
   0 is static). A moving sun is that rate plus, if you want scripted control, a
   `TimerComponent` firing a handler that patches the sun `LightComponent`.

## Pitfalls

- Every `color` is `#rrggbb`/`#rrggbbaa`; `intensity`, `distance`, `decay` are
  `>= 0`. `angleDeg` is 1..180.
- Only ENABLED `LocalEnvironmentVolumeComponent`s apply, and equal-priority
  overlaps resolve deterministically by entity id (warned). Give the dominant
  zone a higher `priority`.
- `LocalEnvironmentVolumeComponent` only overrides the fields whose `override*`
  flag is true; setting `fogDensity` without `overrideFog: true` does nothing.
- There is no SkyComponent atomic; global sky is world environment plus a
  visual profile, not a component you attach to an entity.

## Verify

- `engine_get_component_schema` on `LightComponent` and
  `LocalEnvironmentVolumeComponent`.
- `qa_capture_renderer_viewport` to confirm the sun, shadows, and fog read.
