Light Maps to Boost Rendering Performance

If you’ve ever tried rendering a 3min animation scene in 1080p at 30fps on a relatively good PC setup you’ll understand how long it takes.

Animation time: 3min = 180s = 5400 frames (@30fps)

Even if it only takes 20s to render one frame, the 3min animation would be completed in 30 HOURS!

Now you ask why 30fps? Lower just the fps will dramatically decrease the total time it takes, however that 30fps may be necessary when you’re doing those panning shots, camera fly-by of a landscape, or turn around of a model. Without the high fps, the video becomes choppy and things aren’t as pleasant. You spend hours slaving around the computer to a spectacular 3D model and you want to share it to the world. Not just in an image format, I want to make a film a walk around the model and really bring some life into it.

You will love light maps!

This took 2s to render with light maps compared to 20s without light maps.

This took 2s to render with light maps compared to 20s without light maps.

By using light maps to render out my landscape terrain, I was able to reduce the rendering time from 20s to 2s for ever frame. 2 SECONDS!

 

What are light maps?

Light Maps bake lighting data onto textures based on the UV coordinates of the geometry.

Light Maps bake lighting data onto textures based on the UV coordinates of the geometry.

Light maps are texture files that have lighting data baked into the texture. The lighting data comes from lights that you have set up in the scene. When it comes time to render, you switch out the original material for your 3D geometry for the light map material and instead of making the computer recalculate all the light rays and light bouncing for every frame, it just reads it off the light map texture. This is the secret to the fast performance.

What’s the catch?

Light maps can’t be used in all scenarios, for example, if you have light that is moving a lot in the scene, as if the light has animated motion then light maps aren’t as useful. As mentioned before, light maps are recorded light data so all the data is static. If you have lights that are moving, the light data isn’t static at all and changes for every frame.

So, when to use light maps?

When you have a scene that has static lighting conditions, for example a panning shot or camera fly-by of a landscape.

Light maps can still be used in scenes where the lights are animated, but you just won’t be as big as a boost from 20s to 2s. Most polished scene have multiple lights, some have 10 to 20 lights in the scene set up just to get that perfect shot. And not all the lights may be animated, there may be a lamp or point light in a corner just to light up that culling area under the geometry. And you can create a light map for the static lights in the scene and calculate the dynamic light on render time, combining the best of both worlds.

You can choose which lights to bake into the light map and choose how to combine them in a material for rendering.

Here’s a tutorial on how to create light maps in Houdini using Redshift. If you don’t use Houdini or Redshift, you may still find the first 1min of the video helpful, because I explain the basic idea of how a light map works. And the first minute of the video is’t tied to any software application because it’s explain core concepts.