Lighting
Controls global lighting, time of day, ambient light, shadows, and fog.
- Service
game:GetService("Lighting")- Inherits
- Instance
- Replication
- Never
Behavior
Lighting configures lighting and fog for the entire place. Local lights are
configured with PointLight, SpotLight, and SurfaceLight.
Parent a Sky to this service to configure the sky.
Summary
The rate at which automatic exposure approaches the target exposure.
The ambient light color applied to surfaces not directly lit by the sun.
The multiplier applied to ambient illumination.
The intensity multiplier for directional sunlight and moonlight.
The time of day, in hours, clamped to the inclusive range 0–24.
The color shift applied to downward-facing surfaces.
The color shift applied to upward-facing surfaces.
The multiplier applied to diffuse environment lighting.
The multiplier applied to specular environment reflections.
The exposure adjustment in stops, clamped to -5 through 5.
Whether exposure is manually configured or adapted from scene luminance.
The color used for fog.
The distance from the camera, in studs, at which fog fully obscures rendered geometry.
The distance from the camera, in studs, at which fog begins affecting rendered geometry.
The latitude used for sun positioning, in degrees.
Whether directional lighting casts shadows.
The upper exposure bound used by automatic exposure.
The lower exposure bound used by automatic exposure.
The ambient light color applied to surfaces exposed to the sky.
Whether parts render with black outlines.
Whether the renderer favors lighting quality when allocating lighting resources.
The color used to tint shadowed surfaces.
The softness of shadow edges.
The global lighting style.
The operator used to map scene lighting to display color.
Returns this instance if it is an ExecutionGroup.
Returns the moon direction in world space.
Returns the sun direction in world space.
Properties
AdaptationSpeed
Lighting.AdaptationSpeed: number = 1.5The rate at which automatic exposure approaches the target exposure.
Ambient
Lighting.Ambient: Color3 = Color3.new(0.4, 0.4, 0.4)The ambient light color applied to surfaces not directly lit by the sun.
AmbientBrightness
Lighting.AmbientBrightness: number = 1The multiplier applied to ambient illumination.
Brightness
Lighting.Brightness: number = 1The intensity multiplier for directional sunlight and moonlight. It does not change ambient light.
ClockTime
Lighting.ClockTime: numberThe time of day, in hours, clamped to the inclusive range 0–24. A value of 12 represents noon. Non-finite assignments are ignored.
ColorShift_Bottom
Lighting.ColorShift_Bottom: Color3 = Color3.new(0, 0, 0)The color shift applied to downward-facing surfaces.
ColorShift_Top
Lighting.ColorShift_Top: Color3 = Color3.new(0, 0, 0)The color shift applied to upward-facing surfaces.
EnvironmentDiffuseScale
Lighting.EnvironmentDiffuseScale: number = 1The multiplier applied to diffuse environment lighting.
EnvironmentSpecularScale
Lighting.EnvironmentSpecularScale: number = 1The multiplier applied to specular environment reflections.
ExposureCompensation
Lighting.ExposureCompensation: number = 0The exposure adjustment in stops, clamped to -5 through 5. Non-finite assignments are ignored.
ExposureMode
Lighting.ExposureMode: Enum.ExposureMode = Enum.ExposureMode.ManualWhether exposure is manually configured or adapted from scene luminance.
FogColor
Lighting.FogColor: Color3The color used for fog.
FogEnd
Lighting.FogEnd: numberThe distance from the camera, in studs, at which fog fully obscures rendered geometry. Fog blends linearly between FogStart and FogEnd.
FogStart
Lighting.FogStart: numberThe distance from the camera, in studs, at which fog begins affecting rendered geometry.
GeographicLatitude
Lighting.GeographicLatitude: numberThe latitude used for sun positioning, in degrees. Assignments are clamped to -90 through 90. Non-finite assignments are ignored.
GlobalShadows
Lighting.GlobalShadows: boolean = falseWhether directional lighting casts shadows. Enabling shadows adds rendering work.
MaxExposure
Lighting.MaxExposure: number = 2The upper exposure bound used by automatic exposure.
MinExposure
Lighting.MinExposure: number = -2The lower exposure bound used by automatic exposure.
OutdoorAmbient
Lighting.OutdoorAmbient: Color3 = Color3.new(0.5, 0.5, 0.5)The ambient light color applied to surfaces exposed to the sky.
Outlines
Lighting.Outlines: boolean = trueWhether parts render with black outlines.
PrioritizeLightingQuality
Lighting.PrioritizeLightingQuality: boolean = falseWhether the renderer favors lighting quality when allocating lighting resources.
ShadowColor
Lighting.ShadowColor: Color3 = Color3.new(0.7, 0.7, 0.72)The color used to tint shadowed surfaces.
ShadowSoftness
Lighting.ShadowSoftness: number = 0.5The softness of shadow edges. A value of 0 produces hard edges.
Style
Lighting.Style: Enum.LightingStyle = Enum.LightingStyle.ClassicThe global lighting style.
Tonemapper
Lighting.Tonemapper: Enum.Tonemapper = Enum.Tonemapper.NeutralThe operator used to map scene lighting to display color.
Methods
GetExecutionGroup
Lighting:GetExecutionGroup(): ExecutionGroup?Returns this instance if it is an ExecutionGroup. Otherwise returns the nearest ancestor ExecutionGroup, or nil when no group contains the instance.
GetMoonDirection
Lighting:GetMoonDirection(): Vector3Returns the moon direction in world space.
GetSunDirection
Lighting:GetSunDirection(): Vector3Returns the sun direction in world space.
Inherited members
- Properties
- ArchivableClassNameNameParent
- Methods
- AddComponent()AddTag()ClearAllChildren()ClearTags()Clone()Destroy()FindFirstAncestor()FindFirstAncestorOfClass()FindFirstAncestorWhichIsA()FindFirstChild()FindFirstChildOfClass()FindFirstChildWhichIsA()FindFirstDescendant()GetAttribute()GetAttributeChangedSignal()GetAttributes()GetChildren()GetComponent()GetComponentChangedSignal()GetComponents()GetDebugId()GetDescendants()GetFullName()GetPropertyChangedSignal()GetReferencing()GetTags()HasComponent()HasTag()IsA()IsAncestorOf()IsDescendantOf()RemoveComponent()RemoveTag()SetAttribute()WaitForChild()
- Events
- AncestryChangedAttributeChangedChangedChildAddedChildRemovedDescendantAddedDescendantRemovingDestroying
Example
local Lighting = game:GetService("Lighting")
Lighting.ClockTime = 14Related APIs
PointLight · Color3 · Sky