Skip to content

Tutorials · Light and Shadow · Chapter 2

A lantern

20 minutes Uses: Light

By the end

  • A Point light on lantern_1: Radius 260, Intensity 2.2, a warm orange
  • The hall dark at last, with one warm pool of light
  • What a Radius reaches, what an Intensity above 1 does, and how a light fades
On this page

A light on the lantern

A light is a component, so it goes on a node. Put it on a lantern’s own node and it hangs where the lantern does, and moves with it.

  1. Select lantern_1, press Add component, type light, and choose LightComponent. The hall goes dark at once, apart from a warm pool round the lantern: a light can light now, so the ambient applies.
  2. Leave Kind on Point and Enabled ticked.
  3. Set Radius to 260 and Intensity to 2.2. Click Color; if the button at the top left of the picker reads U8, press it so it reads F, as in chapter 1. Set Color to 1.0, 0.72, 0.42, alpha 1: a warm orange.
  4. Leave Softness at 0.
  5. Press Ctrl+S.
lantern_1 selected, its Inspector narrowed to its Light: Enabled ticked, Kind Point, Radius 260.00, Intensity 2.2, a pale orange Color swatch, Direction 0 and 1, Angle 1.2, Sort Layer Default 0, Channel 0, Softness 0.00, then a Sprite group and a Freeform group; the Viewport shows the hall dim, a warm pool on the first lantern’s bricks, and a yellow circle, the Radius, round the lantern with a dot to drag it
Kind
The shape the light throws. A Point light lights all round its node. The other four, Cone, Directional, Sprite and Freeform, are Part 2’s.
Enabled
Whether the light lights. A hall whose every light is off is as dark as its ambient; only a hall with no light in it draws at full brightness, as in chapter 1.

The component lists every field of every kind, and a Point light reads only some of them. Direction and Angle belong to a Cone, Texture and Size to a Sprite light, Outline and Falloff to a Freeform light: leave them, since chapters 5, 7 and 8 use them. Channel and Sort Layer stay at 0. A channel is how a light’s colour joins the scene, which chapter 9 changes, and Sort Layer is the order lights are drawn in, which chapter 4 explains. Light lists every field.

How far, how bright

A Point light is brightest at its node and fades to nothing at its Radius. Past the Radius it adds nothing, and the bricks there stay at the ambient you set in chapter 1. Two numbers decide how the lantern reads: how far it reaches, and how bright it is at its middle.

Radius
How far the light reaches, in world units, from its node to where its light is gone. The hall is 640 units wide, so the lantern’s 260 is a circle 520 across, and the light you can see ends well inside it. Between 150 and 400 looks right on a lantern here: 150 is a small pool on the bricks, and 400 reaches the window. In the Viewport the Radius is the circle round the light: drag the dot on it.
Intensity
How bright the light is at its node, where it is brightest, from 0 up to 8. At 1 a white light brings the bricks at the node to their own painted colour; above 1 they go brighter than their paint, as bricks do beside a real flame. 1.5 to 4 suits a lantern here, 2.2 is what you set, and by 8, the top of the range, the bricks round the lamp burn pale.
Color
The light’s own colour: three numbers from 0 to 1, and an alpha, which you leave at 1. Everything the light reaches is tinted by it. The lantern’s is a warm orange, 1.0, 0.72, 0.42.
The left end of the hall lit by the first lantern at Radius 150: a small warm pool on the bricks round the lamp, fading to dark at the edge of the brick patch, the left pillar’s top lit, the window to the right in the dark
For comparison, Radius 150: a small pool on the bricks.
The same end of the hall at Radius 260: the whole brick patch lit, brightest at the lamp, the pillar’s top and the stonework beside the window catching some light
Radius 260, the value you set.
The same end of the hall at Radius 400: the brick patch lit more evenly, the pillar’s top brighter, the stonework beside the window and the window’s glass lighter
For comparison, Radius 400: the light reaches the window.
The first lantern and its bricks at Intensity 1: the bricks a dim brown, a little brighter nearest the lamp, the wall round them dark blue
For comparison, Intensity 1.
The first lantern and its bricks at Intensity 2.2: the bricks brighter and warmer, a clear glow round the lamp
Intensity 2.2, the value you set.
The first lantern and its bricks at Intensity 8: the bricks nearest the lamp burnt to a pale gold, the pillar’s top bright yellow, and the wall round the patch lit blue-green as well
For comparison, Intensity 8, the top of the range.

How the light fades

The light falls off smoothly from the node to its Radius, and reaches exactly nothing there, so a light is skipped altogether once its circle is out of view. The fall is steep at first and gentle at the end: the brightness is the Intensity times the square of what is left of the Radius. At half the Radius a light is a quarter as bright as at its node, and three quarters of the way out, a sixteenth. That is why the pool on the bricks looks smaller than the circle in the Viewport.

Every lit sprite is its own colour times the light. A light cannot make a black pixel bright, and the painted dark between the bricks stays dark. The colour of the light matters as much as its strength: the warm 1.0, 0.72, 0.42 against the cold ambient is what reads as lamplight, warm where the lamp is and cold where it is not.

The first lantern and its bricks lit by a white light of the same Intensity: the bricks a flat pale tan with none of the orange glow, so the lamp no longer reads as a flame
For comparison, a white light of the same Intensity: the bricks lose their warmth.

The lantern

FieldValue
KindPoint
Radius260
Intensity2.2
Color1.0, 0.72, 0.42
Softness0 (6 from chapter 4)
Channel0

Check it works