...

/

Blender to Bake Lightmaps and Ambient Occlusion

Blender to Bake Lightmaps and Ambient Occlusion

Learn how to bake lightmaps and ambient occlusion maps in Blender and use them inside Three.js.

Baking lightmaps and ambient occlusion maps

Baking lightmap provides good-looking lighting without having to calculate it in real time in Three.js. To do this with Blender, we’re going to take the following steps:

  1. Set up a simple scene in Blender with a couple of models.

  2. Set up the lighting and the models in Blender.

  3. Bake the lighting to textures in Blender.

  4. Export the scene.

  5. Render everything in Three.js.

In this lesson, we will discuss each step in detail.

Setting up a scene in Blender

For this example, we’ll create a simple scene in which we’ll bake in some lighting.

  • Start a new project.

  • Delete the default cube by selecting it and hitting “x”, and do the same for the default light.

  • Use “Add | Mesh | Plane” to add a simple 2D plane to the scene.

  • Press “Tab” to go to “Edit Mode”, select three vertices, and extrude “e” and then “z” to extrude along the zz-axis to get a simple shape like this:

Press + to interact
Creating a simple room structure
Creating a simple room structure
...