Skip to content

Lights and shadows

A new scene has a Sun: a directional light that casts shadows. Add more lights with Add Component > Light.

Type is one of:

  • Directional: light from far away in one direction, like the sun or the moon. It shines along the entity’s forward axis (its -Z); where the entity is does not matter, only which way it faces.
  • Point: light from a point in every direction, like a bulb or a torch. It reaches as far as its Range.
  • Spot: a cone of light from a point, like a flashlight or a stage light, along the entity’s forward axis. Inner Angle is where the cone is at full strength, and Outer Angle where it has faded out; both are half the cone’s width, in radians.

Every light has a Color and an Intensity (1 at first, up to 50). A point or spot light fades smoothly to nothing at its Range, and is brightest close up. Enabled turns it off without removing it.

A view lights each surface with up to 256 lights at once.

A light casts shadows when its Casts Shadows is on. It is off for a new light: shadows cost time, so give them to the lights that need them.

  • Shadow Strength: how dark the shadow is, from 0 (none) to 1 (full).
  • Shadow Normal Bias and Shadow Depth Bias Scale: if a surface is covered in fine stripes or speckles of its own shadow, raise them a little; if a shadow comes away from the foot of what casts it, lower them.

One directional light casts shadows: the first one with Casts Shadows. Its shadow is split into four bands, finer near the camera and coarser far away. The scene’s settings say how far it reaches: in the inspector’s Scene tab, under Environment:

  • Shadow Distance (300 m): how far from the camera shadows are drawn. A shorter distance makes sharper shadows, so set it no further than the game needs.
  • Shadow Cascade Split (0.5): how the bands are shared out. Towards 1 gives more detail near the camera; 0 spreads it evenly.
  • Shadow Fade Distance (40 m): over what distance shadows fade out at the far end, so they do not stop at a line.

Point and spot lights share room for 16 shadows: a spot light takes one, a point light six (one for each side of a cube). When more lights want shadows than there is room for, those nearest the camera get them, and the rest light without shadows.

Shadow Update saves time for lights that do not move:

  • Realtime (the default): the shadow is drawn every frame.
  • Static: the shadow is drawn once, and again only when the light or something in its reach moves. Static lights have their own room for 16 shadows, beside the realtime ones.

Light also comes from the sky, and from the scene’s Ambient Color and Ambient Intensity, on the Scene tab under Environment. See Environment and post-processing.