Blender to Bake Lightmaps and Ambient Occlusion
Explore how to bake lightmaps and ambient occlusion maps in Blender to achieve realistic lighting effects without real-time calculations. Understand setting up scenes, applying HDRI lighting, baking textures, fixing UV maps, and exporting for Three.js integration to optimize 3D rendering performance.
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:
Set up a simple scene in Blender with a couple of models.
Set up the lighting and the models in Blender.
Bake the lighting to textures in Blender.
Export the scene.
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
axis to get a simple shape like this: