Sun Temple
Roll a white marble through a temple at sunset. Each of the three halls has a sun shard at the back, under a beam of light. Take all three and bring them to the altar in the middle of the courtyard, as fast as you can. In the right-hand hall the floor has strips of lava: roll round them through the gaps, or you go back to the hall's door. Look at the light as you go: soft evening shadows in the courtyard, red light bouncing round the red hall, a cave lit only by its crystals, and a hall lit by its own lava. The marble takes the color of each room.
It shows baked lighting. All of the light in the temple is baked by Generate Lighting, and the rules are an event sheet: there are no code scripts.
Controls: press Start, then the joystick rolls the marble (WASD or the arrow keys on a computer). Keep off the lava.

Open it in the editor
- Download sun-temple.tge (190 KB).
- Open the editor: editor.jeevagames.com on a computer, or the Android app.
- On the home screen tap Import .tge and pick the file, then open Sun Temple (imported).
- Press ▶ Play. To see how the light is made, open the Scene tab → Lighting: the scene is already baked, and Generate Lighting bakes it again after you change something.

How it works
Static objects and light maps
Every wall, floor, roof, pillar, crystal and strip of lava has Contribute GI on (under Shape & look). Generate Lighting traces the light that reaches each of them and stores it in one light map picture (Files → Lightmaps/Main). The game then draws that picture on them, so the soft shadows and the bounced light cost nothing while it runs.
The scene's Lighting settings:
| Setting | Value | Why |
|---|---|---|
| Lightmap resolution | 4 texels per metre | A small temple: enough for soft shadows, and one picture for everything. The sand ground has a Scale in lightmap of 0.5, as it is big and plain. |
| Indirect samples | 128 | Less noise in the dark halls, where most of the light has bounced. |
| Bounces | 2 | Light goes through a doorway and round a corner. |
| Lighting Mode | Shadowmask | See the next part. |
It bakes in about 4 seconds on a laptop's graphics card (Progressive GPU).
The sun: a Mixed light with a shadowmask
The sun is a low, warm directional light with Mode: Mixed and Baked Shadow Angle 3°. With the scene's Lighting Mode set to Shadowmask, its shadows from static objects are baked (long, soft pillar shadows), but it still lights things while the game runs. So the two Sweepers turning in the courtyard, which are not static, cast a sharp realtime shadow that joins the baked ones.

The red hall: baked lights and bounced color
The red hall has a roof, so the sun hardly reaches inside. Four point lights by the walls are Mode: Baked: their light and shadows go into the light map, and once the scene is baked they cost nothing while the game runs. The red walls throw red light back onto the pale floor (that's the bounce).

The cave and the lava hall: glowing materials light the room
The cave has no lights at all. Its crystals have a cyan Glow color with Glow intensity 6 and Global Illumination: Baked, so the bake treats them as light sources: the floor and the walls around them turn blue. The lava strips do the same in orange (Glow intensity 3).


Light probes: the marble and the shards
Light maps are only for static objects. The marble and the shards move, so a Light probe volume (an object named Light probes) covers the whole temple with a probe every 1.5 m. Generate Lighting bakes the light at each probe, and moving objects take their light from the nearest probes. That is why the white marble turns red, blue or orange as it rolls from room to room. With the Shadowmask, the probes also know where the sun's baked shadows are.
The marble also carries a weak realtime point light (Marble light, a child object). It adds to the baked light around it, and you can see it most in the dark cave.
The camera fades the roofs
The camera has Camera follow with Fade in way on, Fade tag fade and Fade opacity 0.06. Each hall's roof and front wall have the tag fade, so whichever ones are between the camera and the marble turn almost fully see-through, and you look down into the hall. They are still in the bake, which is why it is dark inside.
The rules
- On clicked
StartButton: hide the start screen, show the hint line,Started= 1. - Every tick while
Started= 1 and until you win: Move with input from the joystick, and adddttoTime. - On collision with
#shard: sparkle, Play soundCoin, destroy it, add 1 toShards. Its beam of light is a child object, so it goes with it. - On collision with
#lava: an explosion, Play soundZap, Set position back to the lava hall's door, Set velocity to 0, andLavaMsg= 3: for 3 seconds the hint line says how to get past. - On collision with
AltarZone(an invisible trigger round the altar) whenShards ≥ 3:Won= 1, show the flame, Play soundWin, show the win screen. - After the win, every tick: Set light intensity of
AltarLightup to 8 over about a second. It is a realtime light, so it can change while the game runs: a Baked light can't once the scene is baked.

Make it yours
- Move the sun (turn the Sun object), then Generate Lighting: the baked shadows follow. If you play before baking again, the sun's shadows from the temple are realtime only, because a Shadowmask light that has moved no longer fits its mask.
- Change a crystal's Glow color, or a hall's wall color, and bake again to see the new bounce.
- Try Lighting Mode: Baked Indirect: the sun's shadows are then all realtime, sharp and shorter-reaching.
- Raise Lightmap resolution to 8 for crisper shadows: the bake takes longer and the light map picture grows.
- Turn the Light probes object off and play: the marble is lit the same everywhere.