Lesson 02

A lit world: meshes, materials, and light

A 3D scene needs three things to be visible: geometry, a light, and an environment. We'll build a ground plane and a couple of shapes, give them materials, and light the scene so GlitchFall's world exists.

▸ By the end of this lesson: A lit floor with colored shapes and a sky — the stage for everything else

2.1Add a ground plane

  1. With Main selected, add a child StaticBody3D, rename it Ground. Static bodies don't move but collide — perfect for floors and walls.
  2. Under Ground, add a MeshInstance3D. In the Inspector, click its Mesh property → New PlaneMesh. Set the plane's Size to (30, 30).
  3. Also under Ground, add a CollisionShape3D. Set its Shape → New BoxShape3D, and size it roughly (30, 0.2, 30) so the player has something solid to stand on.

Visual mesh vs collision shape

In 3D, what you see (MeshInstance3D) and what you collide with (CollisionShape3D) are separate nodes. They usually match, but they don't have to. Forgetting the collision shape is the #1 reason players fall through the floor.

2.2Give it a material

  1. Select the ground's MeshInstance3D. In the Inspector find Surface Material Override → 0 (or the mesh's Material) → New StandardMaterial3D.
  2. Expand it and set Albedo → Color to a dark slate blue. This is GlitchFall's floor.

StandardMaterial3D

The all-purpose 3D material. Albedo is the base color; you can also set metallic, roughness, emission (glow), and more. For a stylized low-poly look, flat albedo colors with a bit of roughness go a long way.

2.3Light the scene

  1. Add a child of Main: DirectionalLight3D (this is your sun). Rotate it in the viewport so it points down at an angle — set its rotation to about (-45, -30, 0) in the Inspector.
  2. Turn on Shadow → Enabled in the light's Inspector for grounded-looking shapes.
  3. Add another child of Main: WorldEnvironment. Set its Environment → New Environment. In that resource, set Background → Mode to Sky and add a New ProceduralSkyMaterial under Sky.

Black screen = no light or no environment

If your 3D scene renders pure black, you're missing a light, an environment, or both. Every new 3D scene needs at least one light and a WorldEnvironment (or ambient light) to be visible. Godot's editor adds a preview light, but the running game won't have one unless you add it.

2.4Drop in some shapes

  1. Add a MeshInstance3D under Main, give it a New BoxMesh, and move it up so it sits on the floor (position y ≈ 0.5).
  2. Add another with a CylinderMesh or SphereMesh nearby. Give each a colored StandardMaterial3D.
  3. These are placeholder scenery — GlitchFall's 'glitched' aesthetic comes from tilting and floating some of these later.
  1. Press F6 to run the current scene. You should see a lit floor with your shapes and a sky.
  2. It renders from a default angle because there's no camera yet — that's the next lesson.

Checkpoint — expected state