Kaira Digital ArtsKaira Digital Arts
Sayfalar (23)Celestial Module

Celestial Module

Son güncelleme: 6 Ekim 2026

Bu sayfa henüz Türkçeye çevrilmedi, İngilizcesi gösteriliyor.

Lighting and the look of the sky. It drives the sun light's color, intensity and shadows, writes Unity's ambient (Trilight) colors, sets the sky's zenith and horizon colors, and controls how the sun and moon look.

The inspector has the sections General References, Lighting Settings, Sun Settings, Moon Settings and Sky Colors. Most values can be switched between a fixed value and a 24 hour curve or gradient.

References

SettingDescription
directionalLightThe sun light this module colors. The Time Module rotates it
skyboxMaterialThe sky material. Falls back to the scene's skybox when empty
cloudMaterialThe sky dome material
setAsEnvironmentLightSets the light as the scene's sun (RenderSettings.sun)
reflectionModeEnvironment reflection source

Auto-Find References fills these in. It prefers the system's own sun and ignores lights named like a moon.

Light and shadows

SettingDescription
lightIntensity, lightColorIntensity and color of the sun light, fixed or over the day
shadowType, shadowResolutionLight shadow type and resolution
shadowStrength, shadowSoftness, shadowDistanceShadow response, fixed or over the day
overridePipelineShadowSettingsLets the module write the shadow distance into the URP asset

Ambient light

SettingDescription
ambientSkyColor, ambientEquatorColor, ambientGroundColorThe three Trilight ambient colors, fixed or over the day
ambientIntensityAmbient strength, fixed or over the day
groundColorMultiplierBrightness multiplier for the ground color
useCloudCoverageOnAmbient, cloudCoverageInfluenceDarkens the ambient light as the clouds thicken

Sun and moon

SettingDescription
sunColor, sunSize, sunGlow, sunsetIntensityThe sun disc, its glow and the strength of the sunset coloring
moonColor, moonSize, moonGlow, moonTextureThe moon

Sun visibility

How much of the sun gets through. These settings sit under Sun Settings and let a storm dim the sun while a low sun can still be seen through the horizon fog.

SettingDefaultDescription
sunDiscIntensity, sunGlowIntensity5, 2Brightness of the sun disc and of the halo around it (HDR)
dimSunByClouds (Dimmed By Clouds)onDims the disc, the halo and the lens flare with cloud cover. Skipped while the 2D cloud layer is off, since nothing is drawn in front of the sun
cloudSunDimming0.85How much the clouds take away at full cover
cloudSunDimmingStart (Starts At Coverage)0.55Coverage where the dimming starts, so a partly cloudy sky keeps a bright sun
sunHorizonBoost (Horizon Boost)1.8Extra disc brightness while the sun is low, where the fog is thickest. 1 means no boost
sunHorizonBoostHeight0.25Sun height where the boost has faded out
autoLensFlare, lensFlareonFades a LensFlareSmoothOcclusion on the sun with the sun height and dims it with cloud cover. Found automatically
lensFlareOutHeight, lensFlareInHeight-0.02, 0.12Sun heights where the flare is fully out and fully in. It is gone before the sun light switches off, so it never pops

Sky colors

skyZenithColor and skyHorizonColor color the sky overhead and at the horizon. Each has a gradient (on by default) that covers the whole day, night included, so one gradient per row is all you edit.

For shader authors

The module publishes shader globals every frame, for materials outside the sky:

GlobalContent
_KDASkyZenithWS, _KDASkyHorizonWSCurrent sky colors
_KDASunDirWS, _KDASunColorWSSun direction and color
_KDASunVisibilityx = cloud cover factor, y = daylight, w = 1 while valid

The demo water builds its reflection and sun glitter from these, so it follows the time of day and the weather. Your own shaders can read them the same way.

Public API

MemberDescription
void SetLightIntensity(float intensity)Set the light intensity
void SetLightColor(Color color)Set the light color
void SetShadowSettings(float strength, float softness, float distance)Set the three shadow values
void SetAmbientColors(Color sky, Color equator, Color ground, float intensity)Set the ambient light
void SetCloudCoverage(float coverage)Feed a coverage value into the ambient darkening
float GetSunHeight()Sine of the sun's elevation, read from the clock so it never jumps when the light switches
float SunVisibilityCloud cover factor last applied to the sun: 1 for a clear sky
void UpdateDirectionalLight(), void UpdateAmbientLight(), void UpdateShaders()Push values after changing fields from code
void SetWeatherOverrideFields(WeatherOverrideFields fields, bool active)Hands values to a weather preset, or takes them back. A held value skips its gradient or curve
WeatherOverrideFields WeatherOverrideMask, bool IsWeatherOverriding(WeatherOverrideFields fields)Which values a preset currently holds
SetWeatherOverrideActive(bool), SetWeatherLightOverrideActive(bool), SetWeatherAmbientOverrideActive(bool)Shortcuts for the Sky, Light and Ambient groups
void SetWeatherAmbientBlend(float blend), float WeatherAmbientBlendHow far the cloud darkening of the equator color is handed to the preset, 0 to 1

WeatherOverrideFields is a flags enum: SunColor, MoonColor, SunsetIntensity, SkyZenith, SkyHorizon, LightIntensity, LightColor, ShadowStrength, AmbientSky, AmbientEquator, AmbientGround, AmbientIntensity, and the groups Sky, Light, Ambient and All. The Weather Effects Module uses these; you need them only when you drive these values from your own code while a gradient is on.

Bu sayfaya bağlantı veren sayfalar

Hâlâ takıldınız mı?

Unity sürümünüzü, render pipeline bilginizi ve sorunun ekran görüntüsünü gönderin.

Destek alın