$npx -y skills add TabooHarmony/roblox-brain --skill roblox-lightingUse for Roblox lighting, atmosphere, day/night, or post-processing effects.
| 1 | # Roblox Lighting & Atmosphere |
| 2 | |
| 3 | ## When to Load |
| 4 | |
| 5 | Load for Roblox lighting, atmosphere, day/night, or post-processing (Bloom, ColorCorrection, DepthOfField). |
| 6 | |
| 7 | ## Quick Reference |
| 8 | |
| 9 | ### Lighting Service |
| 10 | ```luau |
| 11 | Lighting.ClockTime = 14 -- 0-24 numeric |
| 12 | Lighting.Brightness = 2 -- 0-10, default 2 |
| 13 | Lighting.Ambient = Color3.fromRGB(70, 70, 70) -- shadow fill |
| 14 | Lighting.OutdoorAmbient = Color3.fromRGB(128, 128, 128) |
| 15 | Lighting.GlobalShadows = true |
| 16 | Lighting.ShadowSoftness = 0.2 -- 0=sharp, 1=soft |
| 17 | -- Current Studio uses LightingStyle and PrioritizeLightingQuality instead of Technology. |
| 18 | -- Verify enum values and device behavior against current Creator Hub docs before setting them. |
| 19 | ``` |
| 20 | |
| 21 | ### Atmosphere |
| 22 | ```luau |
| 23 | local atmo = Instance.new("Atmosphere") |
| 24 | atmo.Density = 0.3 -- 0=clear, 1=opaque (keep <0.5) |
| 25 | atmo.Offset = 0.25 -- 0=ground, 1=sky |
| 26 | atmo.Color = Color3.fromRGB(199, 199, 199) -- near fog |
| 27 | atmo.Decay = Color3.fromRGB(92, 92, 92) -- far/horizon |
| 28 | atmo.Glare = 0 -- 0-10 |
| 29 | atmo.Haze = 0 -- 0-10 |
| 30 | atmo.Parent = Lighting |
| 31 | ``` |
| 32 | |
| 33 | ### Post-Processing (all parented to Lighting) |
| 34 | | Effect | Key Properties | |
| 35 | |--------|---------------| |
| 36 | | `BloomEffect` | Intensity (0-1), Size (px), Threshold (>0.7 recommended) | |
| 37 | | `ColorCorrectionEffect` | Brightness, Contrast, Saturation (-1 to 1), TintColor | |
| 38 | | `DepthOfFieldEffect` | FarIntensity, FocusDistance, InFocusRadius, NearIntensity | |
| 39 | | `SunRaysEffect` | Intensity (0-1), Spread (0-1) | |
| 40 | |
| 41 | ### Day/Night Cycle |
| 42 | ```luau |
| 43 | local CYCLE_SPEED = 1 -- minutes per full day |
| 44 | task.spawn(function() |
| 45 | while true do |
| 46 | Lighting.ClockTime += (task.wait() / 60) * (24 / CYCLE_SPEED) |
| 47 | if Lighting.ClockTime >= 24 then Lighting.ClockTime -= 24 end |
| 48 | end |
| 49 | end) |
| 50 | ``` |
| 51 | |
| 52 | ### Local Lights |
| 53 | | Light | Use | Key Props | |
| 54 | |-------|-----|-----------| |
| 55 | | `PointLight` | Lamps, torches | Range, Brightness, Color | |
| 56 | | `SpotLight` | Flashlights | Range, Angle, Face | |
| 57 | | `SurfaceLight` | Screens, panels | Range, Angle, Face | |
| 58 | |
| 59 | **Perf:** Limit shadow-casting lights to 4-6 visible. Use `Shadows=false` on most. Neon material = cheap glow. |
| 60 | |
| 61 | **MCP:** Inspect, change minimally, capture, check performance. |
| 62 | |
| 63 | ### Common Pitfalls |
| 64 | - Brightness >3 washes out. Density >0.5 = soup. Max 2-3 post effects. |
| 65 | - Ambient should not be black. Use LightingStyle/PrioritizeLightingQuality; never set deprecated Technology. |
| 66 | |
| 67 | ### References |
| 68 | - Mood presets (Day, Golden Hour, Night, Horror, Underwater, Sci-Fi), zone tweens, full examples: `references/full.md` |