Select Page

Bakery: Lightmapping Solution for Unity3D

Unity3D is a powerful game engine that provides developers with a wide range of tools for creating immersive, interactive games. One of the key features that make Unity3D so popular is its ability to render high-quality graphics with efficient performance. One important aspect of achieving that is by using lightmapping.

Lightmapping is the process of precomputing lighting information for a scene, which can then be used during gameplay to create realistic lighting effects. While Unity3D comes with a built-in lightmapper, it may not be sufficient for high-end productions. That’s where Bakery, a Unity3D addon, comes into play.

In this article, we will explore Bakery and its features in detail, including its benefits for game developers and the games that have shipped with Bakery.

How does the Bakery Unity3D addon work? #

Bakery is a GPU-based lightmapper that utilizes the power of modern graphics cards to perform fast and efficient lighting calculations for 3D scenes. It works by computing how light behaves as it interacts with various objects in the scene and then uses this information to create lightmaps that can be used to simulate realistic lighting conditions in real-time.

When a scene is rendered, the lighting is calculated by tracing rays of light from light sources to the surfaces of objects, and then bouncing the light around the scene until it reaches the camera. This process is known as path tracing, and it can be very computationally expensive, especially for complex scenes with many light sources and reflective surfaces.

Bakery works by precomputing these lighting calculations and storing the results in lightmaps, which are essentially 2D textures that contain information about the lighting at each point in the scene. These lightmaps can then be used by the game engine to simulate realistic lighting conditions without the need for real-time path tracing.

Bakery also includes a number of features that help to improve the quality of the lighting in a scene, such as the ability to fix various baking artifacts like seams, light and shadow leaks, incorrect shadow terminators, and more. It can also bake all kinds of useful lighting data, including direct and indirect contributions of different light sources, separate shadow masks, direction vectors, spherical harmonics, and more.

Additionally, Bakery supports LOD (level of detail) support, and can take advantage of RTX hardware to speed up baking times, resulting in faster iteration times for artists and developers.

Features of Bakery #

Bakery is a high-end, production-ready GPU lightmapper, designed to solve various problems that may arise when baking lightmaps. Some of the key features of Bakery include:

  1. Fixing Baking Artifacts – Bakery can fix various baking artifacts that can occur during lightmapping, such as seams, light/shadow leaks, incorrect shadow terminators, and more. This ensures that baking a lightmap doesn’t create more problems than rendering a camera frame in an offline renderer.
  2. All Kinds of Lighting Data – Bakery can bake all kinds of useful lighting data, including direct and indirect contributions of different light sources in any combination, separate shadow masks, direction vectors, spherical harmonics, and more. Lighting can also be baked per-vertex or into probes instead of using textures.
  3. Physical Correctness – Bakery’s results have been thoroughly compared against Mitsuba, a well-known unbiased renderer, to ensure physical correctness.
  4. LOD Support – Bakery supports Level of Detail (LOD), which enables developers to optimize game performance by reducing the complexity of the scene based on the player’s distance from objects.
  5. RTX Hardware Support – Bakery can take advantage of RTX hardware to speed up the lightmapping process.

Benefits of Bakery in Unity3D #

When used in Unity3D, Bakery provides several benefits to game developers. Some of these benefits include:

  1. Directional Information – Directional information can be baked in the form of a dominant direction map, three maps for Radiosity Normal Mapping, or four maps for per-pixel Spherical Harmonics. This provides much higher quality lighting than the classic “directional” mode in Unity3D. Additionally, multiple directional modes can be used in a single scene on different objects.
  2. Light Falloff Support – Bakery supports both correct inverse-squared light falloff and Unity’s own non-physical one.
  3. IES Light Support Bakery supports IES lights, which enables developers to use real-world light profiles for more realistic lighting effects.
  4. Baked Prefab Support – Bakery supports baked prefabs, which allows for more efficient workflow by enabling developers to reuse lightmaps across multiple instances of the same object.

Requirements #

NOTE: Requires modern Nvidia GPU (6xx or newer) and 64-bit Windows (7 or higher).
Doesn’t support AMD cards for baking.
Doesn’t support Macs.
Tested on everything from Unity 5.6 to 2022.1.23, as well as URP/HDRP.
If Asset Store does not allow downloading to pre-2018.4 versions, you can install 2018.4, download it and then copy to an earlier version project.

Resulting lightmaps are compatible with all platforms.

Games Shipped with Bakery Unity3D #

Several notable games have shipped with Bakery, including:

  1. Escape from Tarkov: A hardcore tactical first-person shooter with a focus on realism and immersion.
  2. X4: Foundations: A space simulation game that allows players to build and manage their own space empire.
  3. The Bradwell Conspiracy: A narrative-driven adventure game set in an underground facility where players must use their wits to uncover the truth behind a deadly incident.

FAQ #

Q: Can I use Bakery for VRChat worlds? #

A: Yes.

Q: What is Bakery? #

A: Bakery is a high-end, GPU-based lightmapper for Unity that is designed to provide fast and efficient lighting calculations for 3D scenes.

Q: How does Bakery work? #

A: Bakery precomputes lighting calculations and stores the results in lightmaps, which can then be used by the game engine to simulate realistic lighting conditions without the need for real-time path tracing.

Q: What are the benefits of using Bakery? #

A: Bakery includes features like the ability to fix various baking artifacts, bake all kinds of useful lighting data, support LOD, and take advantage of RTX hardware to speed up baking times, resulting in faster iteration times for artists and developers.

Q: What kind of lighting data can Bakery bake? #

A: Bakery can bake direct and indirect contributions of different light sources, separate shadow masks, direction vectors, spherical harmonics, and more.

Q: What kind of games have used Bakery? #

A: Some notable games that have shipped using Bakery include Shadow Tactics: Blades of the Shogun, Cultist Simulator, and Luna: The Shadow Dust.

Q: Can Bakery support IES light data? #

A: Yes, Bakery includes support for IES lights.

Q: Can Bakery support baked prefabs? #

A: Yes, Bakery includes support for baked prefabs.

Q: How can I get started with using Bakery in Unity? #

A: To get started with using Bakery in Unity, you can download the Bakery addon from the Unity Asset Store and follow the documentation provided by the developer.

Tutorials #

Powered by BetterDocs