Skip to content

Stars, ambient lighting, and fog

These controls make a calculated day/night cycle readable in the scene. They remain optional presentation consumers: star brightness, ambient fill, and fog color do not change astronomical state.

Stars

Bind StarController to a context with initialized Astronomy, then assign it to Sky Controller. Solar-elevation thresholds fade stars into view: the component defaults begin at 0° and reach full visibility at −12°. Tint, intensity, and an artistic rotation offset affect the displayed field.

The controller supplies an equatorial orientation basis using the observer and date/time. It does not render a separate catalog of physical stars. Star density, size, and glow belong to the active sky material's appearance settings. Disable an old star-dome Renderer if it duplicates stars already drawn in the Tunal sky; the Inspector diagnoses that configuration.

The onStarsUpdated event is a presentation update, not a new astronomical clock. Query the controller's visibility/orientation state for custom consumers rather than rotating the entire sky by world Y and assuming it represents the observer's celestial pole.

Fog color

Add/bind EnvironmentController in the presentation hierarchy. Control Fog changes the scene fog color only; it does not enable fog or set density. Configure fog enablement/mode/density in the rendering/environment setup appropriate to your project.

Fog Horizon Influence blends palette fog color toward the sky horizon. Zero leaves the palette fog color unblended; the component default is 0.15. If fog never appears, increasing this color blend cannot fix disabled fog or an unsupported shader path.

Ambient lighting

Control Ambient enables the controller's ambient ownership. Available modes are Gradient, Flat, and Skybox. Gradient is the component default and uses sky/equator/ground colors; Flat uses a single ambient color. Skybox requires an up-to-date ambient probe to follow a changing sky, so do not assume a runtime sky change instantly refreshes baked or probed lighting.

Sky/equator/ground influences and ground brightness tune fill independently of the directional Light. Solar Ambient Influence optionally modulates brightness by solar elevation. Zero preserves palette brightness; minimum solar brightness and dark/bright elevation thresholds define the extra modulation. This is an artistic ambient response, not a physical exposure model.

Environment Controller inherits phase-dependent presentation behavior. Check Day Phase availability and palette configuration before diagnosing an ambient color as a light bug. Several active environment controllers share the same scene-global RenderSettings; they cannot each privately own those globals for different contexts.

Related: Day Phases, Sky, context switching.