$npx -y skills add thedivergentai/GD-Agentic-Skills --skill godot-3d-lightingExpert patterns for Godot 3D lighting including DirectionalLight3D shadow cascades, OmniLight3D attenuation, SpotLight3D projectors, VoxelGI vs SDFGI, and LightmapGI baking. Use when implementing realistic 3D lighting, shadow optimization, global illumination, or light probes. Tr
| 1 | # 3D Lighting |
| 2 | |
| 3 | Expert guidance for realistic 3D lighting with shadows and global illumination. |
| 4 | |
| 5 | ## NEVER Do |
| 6 | |
| 7 | - **NEVER use VoxelGI without setting a proper extents** — Unbound VoxelGI tanks performance. Always set `size` to tightly fit your scene. |
| 8 | - **NEVER enable shadows on every light** — Each shadow-casting light is expensive. Use shadows sparingly: 1-2 DirectionalLights, ~3-5 OmniLights max. |
| 9 | - **NEVER forget directional_shadow_mode** — Default is ORTHOGONAL. For large outdoor scenes, use PARALLEL_4_SPLITS for better shadow quality at distance. |
| 10 | - **NEVER use LightmapGI for fully dynamic scenes** — Lightmaps are baked. Moving geometry won't receive updated lighting. Use VoxelGI or SDFGI instead. |
| 11 | - **NEVER set omni_range too large** — Light attenuation is quadratic. A range of 500 affects 785,000 sq units. Keep range as small as visually acceptable. |
| 12 | - **NEVER hide a Light node using the Visible property to exclude it from a Lightmap bake** — Hiding a light has no effect on the baker. You must change the light's Bake Mode to Disabled. |
| 13 | - **NEVER use VoxelGI with paper-thin walls** — VoxelGI evaluates lighting using a 3D grid. Thin walls (less than one voxel thick) will cause severe light leaking. Seal your geometry or place hidden thick MeshInstance3D blocks around the exterior. |
| 14 | - **NEVER leave shadow bias at default for cascades** — Default bias often causes Peter Panning or light leaking at split transitions. Tune bias per-light based on your scene's scale. |
| 15 | - **NEVER bake LightmapGI without a Denoiser** — Godot's baked lightmaps are noisy by default. Use OIDN or JNLM (in Project Settings) for professional results. |
| 16 | - **NEVER use real-time SDFGI on Mobile/Compatibility renderers** — It is a Forward+ exclusive feature. Use fake GI bounce lights for lower-end platforms. |
| 17 | - **NEVER use 'Update Continuity' in ReflectionProbes for performance** — Keep ReflectionProbes on 'Update Once' and trigger manual updates only when necessary. |
| 18 | |
| 19 | --- |
| 20 | |
| 21 | ## Godot 4.7: AreaLight3D |
| 22 | |
| 23 | - **AreaLight3D** provides rectangular area lights with soft shadows — prefer over emissive-material + GI workarounds for screens, glowing panels, and billboards. |
| 24 | - **HDR output** is supported on all major platforms; enable in Project Settings → Rendering → Viewport for true HDR display chain. |
| 25 | - **NEVER** use emissive-only fake panels when AreaLight3D gives correct falloff and shadow softness in Forward+. |
| 26 | |
| 27 | ## Available Scripts |
| 28 | |
| 29 | > **MANDATORY**: Read the appropriate script before implementing the corresponding pattern. |
| 30 | |
| 31 | ### [day_night_cycle.gd](scripts/day_night_cycle.gd) |
| 32 | Dynamic sun position and color based on time-of-day. Handles DirectionalLight3D rotation, color temperature, and intensity curves. Use for outdoor day/night systems. |
| 33 | |
| 34 | ### [light_probe_manager.gd](scripts/light_probe_manager.gd) |
| 35 | VoxelGI and SDFGI management for global illumination setup. |
| 36 | |
| 37 | ### [lighting_manager.gd](scripts/lighting_manager.gd) |
| 38 | Dynamic light pooling and LOD. Manages light culling and shadow toggling based on camera distance. Use for performance optimization with many lights. |
| 39 | |
| 40 | ### [volumetric_fx.gd](scripts/volumetric_fx.gd) |
| 41 | Volumetric fog and god ray configuration. Runtime fog density/color adjustments and light shaft setup. Use for atmospheric effects. |
| 42 | |
| 43 | ### [shadow_cascade_tuner.gd](scripts/shadow_cascade_tuner.gd) |
| 44 | Expert logic for adjusting DirectionalLight3D shadow split distances dynamically based on sun angle and camera tilt. |
| 45 | |
| 46 | ### [lightmap_bake_helper.gd](scripts/lightmap_bake_helper.gd) |
| 47 | Advanced LightmapGI configuration pattern using Shadowmasking mode for hybrid static/dynamic shadowing. |
| 48 | |
| 49 | ### [sdfgi_probe_manager.gd](scripts/sdfgi_probe_manager.gd) |
| 50 | Dynamic quality scaler for real-time Global Illumination (SDFGI). Adjusts cell size and occlusion for performance/quality trade-offs. |
| 51 | |
| 52 | ### [volumetric_fog_zones.gd](scripts/volumetric_fog_zones.gd) |
| 53 | Smoothly transitioning localized fog density for cave entrances or forest clearings using Tweens and Area3D triggers. |
| 54 | |
| 55 | ### [fake_gi_bounce.gd](scripts/fake_gi_bounce.gd) |
| 56 | Efficient 'Mobile-GI' pattern. Simulates light bouncing off the floor using non-shadowed directional fill lights. |
| 57 | |
| 58 | ### [environment_blender.gd](scripts/environment_blender.gd) |
| 59 | Architectural pattern for transitioning WorldEnvironment parameters (Sky, Ambient, Tonemap) during gameplay. |
| 60 | |
| 61 | ### [shadow_bias_tuner.gd](scripts/shadow_bias_tuner.gd) |
| 62 | Optimization script for correcting 'Peter Pan |