s&box provides five lighting components that cover the full range of real-time and baked illumination. This page documents the properties of the sharedDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/facepunch/sbox-public/llms.txt
Use this file to discover all available pages before exploring further.
Light base class and each concrete light type, plus the EnvmapProbe component that captures and applies environment reflections.
Light base class
All dynamic light components —DirectionalLight, PointLight, and SpotLight — inherit from the abstract Light class, which provides shared color, shadow, and fog properties.
Color
The primary color and intensity of the light. Brightness is driven by the HDR value of this color — values above 1.0 in linear space produce light brighter than white.
Shadows
Enables shadow casting for this light. Disable on lights that are far away or contribute little to scene shading to save shadow-map draw calls.
Depth offset applied when comparing shadow map samples. Increase slightly if you see shadow acne (self-shadowing artifacts). Range 0–1.
Controls shadow softness.
0 produces hard-edged shadows; 1 produces the softest result. Range 0–1.Fog
Controls whether this light contributes to volumetric fog.
| Value | Behavior |
|---|---|
Disabled | Light does not scatter in fog. |
Enabled | Light scatters in fog with shadow casting. |
WithoutShadows | Light scatters in fog but casts no fog shadows. |
Multiplier on this light’s contribution to volumetric fog scattering. Range 0–1.
DirectionalLight
DirectionalLight simulates a distant light source such as the sun. It illuminates the entire scene uniformly from a single direction determined by the GameObject’s rotation. It uses cascaded shadow maps to provide high-quality shadows across large distances.
An ambient sky color blended in for legacy compatibility. Use
AmbientLight for new projects instead.Number of shadow map cascades. More cascades improve shadow resolution at distance, but each additional cascade adds GPU cost. User quality settings can reduce this at runtime.
Distribution of cascades between the first cascade boundary and the far clip.
0 is uniform; 1 is fully logarithmic. Higher values concentrate more shadow resolution near the camera. Hidden when ShadowCascadeCount is 1.PointLight
PointLight emits light equally in all directions from a single point. It is the standard choice for light bulbs, torches, explosions, and any omni-directional source.
Maximum range of the light in world units. Objects beyond this distance receive no light from this source.
Quadratic falloff coefficient. Higher values make the light fall off faster within the radius, producing a tighter hot spot.
0 gives no quadratic falloff (flat attenuation within radius).SpotLight
SpotLight emits a cone of light in the direction the GameObject faces — useful for flashlights, stage lighting, and vehicle headlights. The cone is defined by inner and outer angles; the area between the two angles is where the light fades from full intensity to zero.
Maximum range of the spotlight in world units.
The half-angle (degrees) of the inner cone where light is at full intensity.
The half-angle (degrees) of the outer cone edge. Light fades to zero between
ConeInner and ConeOuter.Quadratic falloff coefficient, same as
PointLight.Attenuation.An optional texture projected by the spotlight. Use a black-and-white cookie to shape the beam (for example, a window frame pattern).
AmbientLight
AmbientLight adds a global fill light applied uniformly to all surfaces in the scene. It is the simplest way to prevent areas shadowed by DirectionalLight from going completely black.
The ambient light color applied globally outside any light probes. Use low-intensity values — typical ambient colors are below 0.1 in linear space.
AmbientLight replaces the SkyColor property on DirectionalLight from earlier versions of s&box. Prefer AmbientLight for new projects.EnvmapProbe
EnvmapProbe captures a cubemap of the environment from its location and applies it as specular reflections to nearby surfaces. Probes can be baked offline, rendered once on load, updated in real time, or use a manually provided texture.
Mode
Controls how the probe’s cubemap texture is sourced.
| Mode | Behavior |
|---|---|
Baked | Uses the BakedTexture property set during scene baking. |
Realtime | Renders the cubemap dynamically according to UpdateStrategy. |
CustomTexture | Uses the texture assigned to the Texture property. |
The custom cubemap texture used when
Mode is CustomTexture.The pre-baked cubemap texture used when
Mode is Baked. Set automatically during baking.Volume and blending
Whether the cubemap is projected using
Box or Sphere projection. Box projection corrects parallax inside enclosed rooms; sphere is appropriate for open areas.The world-space bounding volume within which this probe influences surfaces.
Distance over which the probe’s influence blends in or out at the edges of
Bounds. Positive values create a soft falloff; negative values create a hard edge.A multiplicative tint applied to the captured cubemap. Use to warm or cool reflections without re-capturing.
When multiple probes overlap, the one with the highest priority wins.
Rendering (Realtime / Baked)
Resolution of the captured cubemap. Higher resolutions show more detail but use more GPU memory and baking time.
| Value | Resolution |
|---|---|
Small | 128 × 128 |
Medium | 256 × 256 |
Large | 512 × 512 |
Huge | 1024 × 1024 |
Near clip distance for the probe’s capture camera.
Far clip distance for the probe’s capture camera.
Realtime update strategy
Controls how often the realtime cubemap is re-rendered.
| Value | When it updates |
|---|---|
OnEnabled | Once when the component is enabled (or on demand via MultiBounce). |
EveryFrame | Every frame. Expensive — avoid unless necessary. |
FrameInterval | Every FrameInterval frames. |
TimeInterval | Every DelayBetweenUpdates seconds. |
Only updates dynamically when the camera is within this distance of the probe.
Number of frames between updates when
UpdateStrategy is FrameInterval. Range 0–16.Seconds between updates when
UpdateStrategy is TimeInterval. Range 0–10.When
true and UpdateStrategy is OnEnabled, the probe renders 4 bounces on startup to converge inter-reflection. Adds cost on load.Setting this to
true forces the probe to re-render on the next frame, regardless of update strategy.Lighting tips
Shadow quality vs performance
Keep
ShadowCascadeCount at 2 for indoor scenes. Use 4 only for large outdoor environments where far-field shadows are visible.PointLight vs SpotLight
Prefer
SpotLight wherever a surface or direction is obvious — it costs less per shadow draw call and avoids wasted light on areas you cannot see.EnvmapProbe placement
Place one probe per distinct enclosed area. Enable
Projection = Box for rooms and corridors so reflections are parallax-corrected.Ambient fill
Set
AmbientLight.Color to a low-saturation complement of your DirectionalLight color (e.g., a cool blue ambient for a warm orange sun) for natural-looking shadowed areas.Related pages
Rendering guide
Overview of the rendering pipeline and post-processing.
CameraComponent
Camera settings, post-process anchors, and HUD rendering.
Shaders guide
Writing shaders that react to scene lights and environment maps.
Scene & GameObjects
How components attach to GameObjects.