Skip to content

Sky and atmosphere

SkyController drives the Tunal sky from astronomical state and resolved palettes. It controls the sky material; it does not enable Unity fog, compute a second Sun position, or create directional lights.

Setup workflow

  1. Use the supplied presentation prefab as a working resource/reference starting point.
  2. Bind it to the intended context. Enable Astronomy for solar inputs and Day Phases for authored phase palettes; enable Lunar for simulated Moon inputs.
  3. Assign the Lite Sky Material and optional High Quality Sky Material using the corresponding Tunal sky shaders.
  4. Choose Sky Quality, then inspect requested and effective quality in Play Mode. Automatic is the component default.
  5. Adjust Sun appearance, phase palette values, and optional star/cloud references one at a time. Check sunrise, noon, sunset, and night rather than tuning only one frame.

The controller owns a runtime material for its presentation. Author project-specific copies of source materials/profiles rather than altering the package's shared art assets. Read RuntimeMaterial only as live presentation state; do not treat it as your persistent authored material asset.

Atmosphere and celestial appearance

Day-phase palettes provide time-dependent appearance; optional transition settings blend presentation near phase changes. These normalized 0–1 transition settings are not the Time System's real-second clock-transition duration. Polar palette influence can affect appearance before the exact day-phase classification becomes polar.

The Sun's apparent diameter controls the visible disk in degrees, not light intensity. Moon apparent diameter/texture inputs come from the Lunar profile. A bright-looking disk does not guarantee scene illumination; configure the directional light controller separately.

Use SetSkyQuality, SetSkyMaterial, SetHighQualitySkyMaterial, and SetSunApparentDiameterDegrees for their corresponding runtime configuration changes. Changing a requested quality does not bypass shader/resource capability checks.

Stars and nebula

Assign a Star Controller to connect visibility and orientation. Appearance such as density/size/glow remains in the sky material where exposed; Star Controller is not a duplicate material editor.

The High sky supports optional deep-sky nebula overrides. With the override disabled, the active material supplies nebula settings. Texture mode uses the assigned panoramic texture, Procedural needs no texture, and Hybrid combines them. Intensity, opacity, tint, dusk fade, full-Moon dimming, and star occlusion govern visibility. Procedural placement uses right ascension/declination and radius in degrees; shape controls include noise scale, threshold, softness, distortion, seed, and 1–3 noise octaves.

These are artistic sky effects, not a catalog of observed nebulae. Test night scenes with and without Moon illumination before assuming a texture failed to load.

Diagnose unexpected results

If the sky remains unchanged, check group authority, initialized modules, phase/profile validity, material shader, and effective quality. If the sky works but objects are dark, check lighting/ambient settings. If the sky changes in one context but not another, inspect each group assignment rather than replacing shared global settings manually.

Related: rendering paths, Day Phases, environment.