Skip to main content

🎨 Lesson 2.3: Primitives, Meshes & Materials

A mesh is an object's shape. A material is how its surface looks — colour, shininess, texture. Together they decide what you see. Let's add some colour to your world.

🎯 Learning Objectives

  • Explain the difference between a mesh and a material
  • Understand the Mesh Filter + Mesh Renderer pair
  • Create a new Material asset and set its Base colour (URP Lit shader)
  • Apply a material to an object by dragging

Estimated Time: 35 minutes

In This Lesson

Primitives: Built-in Shapes

Unity ships with a handful of ready-made shapes called primitives — Cube, Sphere, Capsule, Cylinder, Plane, and Quad. They're perfect for learning and for "blocking out" a game before you have real 3D art.

A real Unity render of a cube, sphere, capsule, and cylinder on a floor.
Figure 1: The common primitives (real render). Each is a GameObject with a built-in mesh.

Meshes: the Shape

A mesh is the actual 3D shape — a web of points and triangles. Two components work together to show it:

ComponentJob
Mesh FilterHolds which mesh this object uses (e.g. "Cube").
Mesh RendererActually draws the mesh, and holds the material(s) used to paint it.
💡 Remove the Mesh Renderer and the object becomes invisible (but still exists). Remove the Mesh Filter and there's no shape to draw at all.

Materials: the Look

A material controls the surface appearance of a mesh — its colour, how shiny or rough it is, and any texture image wrapped onto it. The same sphere mesh with five different materials gives five very different looks:

A real Unity render of five spheres with red, green, blue, yellow, and purple materials.
Figure 2: One mesh (Sphere), five materials (real render). Materials are where colour lives.

📖 Definition

Material: an asset that describes a surface's appearance. It uses a shader (the maths that draws the surface) — in URP the default is Universal Render Pipeline/Lit — and exposes settings like the Base Map colour.

Making a Material

New primitives start with a plain grey default material. Let's make a coloured one:

  1. In the Project panel, right-click ▸ Create ▸ Material.
  2. Name it something clear, like Mat_Red.
  3. Select it. In the Inspector, its Shader should read Universal Render Pipeline/Lit.
  4. Click the Base Map colour swatch and pick a red.
  5. Drag the material from the Project panel onto your object in the Scene view (or into its Mesh Renderer's Materials slot). Done — it's now red.

✅ Pro Tip: reuse materials

One material can be applied to many objects. Change the material's colour once and every object using it updates instantly. Create a small palette of materials and reuse them across your game for a consistent look.

⚠️ Watch Out: everything turned pink/magenta?

Bright magenta means a material's shader doesn't match your render pipeline. In a URP project, make sure materials use a Universal Render Pipeline shader (like Lit). This most often happens with assets made for the older Built-in pipeline.

Hands-on Exercise

🏋️ Exercise: A colourful row

  1. Add three Spheres to a scene, spaced out along X.
  2. Create three Materials — red, green, blue — with the Lit shader.
  3. Drag one colour onto each sphere.
  4. Bonus: apply your red material to a Cube too, and notice it's the same material reused.
✅ Success check

Three coloured spheres like Figure 2. If a sphere is still grey, you didn't drop the material onto it — try dragging directly onto the object in the Scene view.

🎯 Quick Quiz

Question 1: What does a material control?

Question 2: Your object turned bright magenta. Most likely cause?

Summary

🎉 Key Takeaways

  • Primitives are built-in shapes great for prototyping.
  • A mesh is the shape; Mesh Filter holds it and Mesh Renderer draws it.
  • A material controls surface look and uses a shader (URP Lit by default).
  • Create materials in the Project panel and drag them onto objects; reuse them for consistency.

🚀 What's Next?

What if you want fifty identical crates and the power to change them all at once? That's what Prefabs are for — Lesson 2.4.

🎉 Your world has colour now!