Lightmap baking with Indigo Renderer

We finally got lightmap baking working in world, and it looks awesome! Steps:

  • Wrote an exporter that takes our parcels (you can consider them mini-scenes) and exports an indigo renderer .igs file with embedded meshes
  • Bake the meshes (we have a windows PC with RTX 2070 super that can bake reasonably quality lightmaps in about 10 seconds)
  • Convert the meshes to .jpg and upload to S3
  • Load the meshes in world.,3N

The only really clever trick we have to do is to deterministically create the uv lightmapping coordinates, we use potpack.js (since we’re only packing quads) and lodash sortBy (for a stable sort function). Because we generate the same lightmap coords on the client as on the baking server, it means we only need to fetch the jpg for the lightmap, we don’t have to store uv coordinates anywhere.

By using lightmapTexture in babylonJS, we get a nice blending of the lightmap with our textures, which comes out looking pretty nice.


Very cool @bnolan! So is this a manual process or automated server-side?

Eventually I want to try automatically rendering high-quality lightmaps of dynamic/parametric geometry using Blender command line on the server, unless someone comes up with a Babylon.js lightmap baking solution before then :wink:

How do you do the baking? With blender? Or unity?

i normaly use blender but not in 10 sec nice