Legacy Documentation: Version 2018.1 (Go to current version)
LanguageEnglish
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

Lightmapping.BakeMultipleScenes

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

public static method BakeMultipleScenes(paths: string[]): void;
public static void BakeMultipleScenes(string[] paths);

Parameters

pathsThe path of the scenes that should be baked.

Description

Bakes an array of scenes.

This loads all scenes and then builds all lightmaps, reflection probes and enlighten data. The function automatically splits all baked data based on scene. Lightmap atlasses for example are always split between scenes. Thus you can bake lightmaps for two adjacent levels and light and shadows casted onto objects in level A will be affected by the objects in level B.

Enlighten system data will automatically connect neighboring systems when it is additively loaded, thus bounce lighting can flow from one scene to another.

A single LightProbe asset is generated for all scenes. Hence for the time being, lightprobes always take as much memory as there are lightprobes in all levels that are baked together.

Only one ambient probe & default sky probe will be baked and assigned to each scene.

Multiple Lightmapsnapshot objects containing the data for each scene are written into a single file in "MyScene/LightmapSnapshot.asset". At build time this data will also be automatically split as well, hence if you bake multiple scenes but then only deploy one scene then only the lightmap data for that scene will be deployed.

Did you find this page useful? Please give it a rating: