using_lightmap_gi.rst 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541
  1. .. _doc_using_lightmap_gi:
  2. Using Lightmap global illumination
  3. ==================================
  4. Baked lightmaps are a workflow for adding indirect (or fully baked)
  5. lighting to a scene. Unlike the :ref:`VoxelGI <doc_using_voxel_gi>` and
  6. :ref:`SDFGI <doc_using_sdfgi>` approaches, baked lightmaps work fine on low-end PCs
  7. and mobile devices, as they consume almost no resources at run-time. Also unlike
  8. VoxelGI and SDFGI, baked lightmaps can optionally be used to store direct
  9. lighting, which provides even further performance gains.
  10. Unlike VoxelGI and SDFGI, baked lightmaps are completely static. Once baked, they
  11. can't be modified at all. They also don't provide the scene with reflections, so
  12. using :ref:`doc_reflection_probes` together with it on interiors (or using a Sky
  13. on exteriors) is a requirement to get good quality.
  14. As they are baked, they have fewer problems than VoxelGI and SDFGI regarding
  15. light bleeding, and indirect light will often look better. The downside is that
  16. baking lightmaps takes longer compared to baking VoxelGI. While baking VoxelGI
  17. can be done in a matter of seconds, baking lightmaps can take several minutes if
  18. not more. This can slow down iteration speed significantly, so it is recommended
  19. to bake lightmaps only when you actually need to see changes in lighting. Since
  20. Godot 4.0, lightmaps are baked on the GPU, making light baking faster if you
  21. have a mid-range or high-end dedicated GPU.
  22. Baking lightmaps will also reserve baked materials' UV2 slot, which means you can
  23. no longer use it for other purposes in materials (either in the built-in
  24. :ref:`doc_standard_material_3d` or in custom shaders).
  25. Despite their lack of flexibility, baked lightmaps typically offer both the best
  26. quality *and* performance at the same time in (mostly) static scenes. This makes
  27. lightmaps still popular in game development, despite lightmaps being the
  28. oldest technique for global illumination in video games.
  29. .. seealso::
  30. Not sure if LightmapGI is suited to your needs?
  31. See :ref:`doc_introduction_to_global_illumination_comparison`
  32. for a comparison of GI techniques available in Godot 4.
  33. Visual comparison
  34. -----------------
  35. .. figure:: img/gi_none.webp
  36. :alt: LightmapGI disabled.
  37. LightmapGI disabled.
  38. .. figure:: img/gi_lightmap_gi_indirect_only.webp
  39. :alt: LightmapGI enabled (with indirect light baked only).
  40. LightmapGI enabled (with indirect light baked only). Direct light is still
  41. real-time, allowing for subtle changes during gameplay.
  42. .. figure:: img/gi_lightmap_gi_direct_and_indirect.webp
  43. :alt: LightmapGI enabled (with direct and indirect light baked).
  44. LightmapGI enabled (with direct and indirect light baked). Best performance,
  45. but lower quality visuals. Notice the blurrier sun shadow in the top-right
  46. corner.
  47. Here are some comparisons of how LightmapGI vs. VoxelGI look. Notice that
  48. lightmaps are more accurate, but also suffer from the fact
  49. that lighting is on an unwrapped texture, so transitions and resolution may not
  50. be that good. VoxelGI looks less accurate (as it's an approximation), but
  51. smoother overall.
  52. .. image:: img/lightmap_gi_comparison.png
  53. SDFGI is also less accurate compared to LightmapGI. However, SDFGI can support
  54. large open worlds without any need for baking.
  55. Setting up
  56. ----------
  57. .. warning::
  58. Baking lightmaps in the Android and web editors is not supported due to
  59. graphics API limitations on those devices. On Android and web platforms,
  60. only *rendering* lightmaps that were baked on a desktop PC is supported.
  61. First of all, before the lightmapper can do anything, the objects to be baked need
  62. a UV2 layer and a texture size. A UV2 layer is a set of secondary texture coordinates
  63. that ensures any face in the object has its own place in the UV map. Faces must
  64. not share pixels in the texture.
  65. There are a few ways to ensure your object has a unique UV2 layer and texture size:
  66. Unwrap on scene import (recommended)
  67. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  68. In most scenarios, this is the best approach to use. The only downside is that,
  69. on large models, unwrapping can take a while on import. Nonetheless, Godot will
  70. cache the UV2 across reimports, so it will only be regenerated when needed.
  71. Select the imported scene in the filesystem dock, then go to the **Import** dock.
  72. There, the following option can be modified:
  73. .. image:: img/lightmap_gi_import.webp
  74. The **Meshes > Light Baking** option must be set to **Static Lightmaps (VoxelGI/SDFGI/LightmapGI)**:
  75. .. image:: img/lightmap_gi_mesh_import_meshes.webp
  76. When unwrapping on import, you can adjust the texture size using the **Meshes > Lightmap
  77. Texel Size** option. *Lower* values will result in more detailed lightmaps,
  78. possibly resulting in higher visual quality at the cost of longer bake times and
  79. larger lightmap file sizes. The default value of ``0.2`` is suited for
  80. small/medium-sized scenes, but you may want to increase it to ``0.5`` or even
  81. more for larger scenes. This is especially the case if you're baking indirect
  82. lighting only, as indirect light is low-frequency data (which means it doesn't
  83. need high-resolution textures to be accurately represented).
  84. The effect of setting this option is that all meshes within the scene will have
  85. their UV2 maps properly generated.
  86. .. warning::
  87. When reusing a mesh within a scene, keep in mind that UVs will be generated
  88. for the first instance found. If the mesh is re-used with different scales
  89. (and the scales are wildly different, more than half or twice), this will
  90. result in inefficient lightmaps. To avoid this, adjust the **Lightmap
  91. Scale** property in the GeometryInstance3D section of a MeshInstance3D node.
  92. This lets you *increase* the level of lightmap detail for specific
  93. MeshInstance3D nodes (but not decrease it).
  94. Also, the ``*.unwrap_cache`` files should *not* be ignored in version control
  95. as these files guarantee that UV2 reimports are consistent across platforms
  96. and engine versions.
  97. Unwrap from within Godot
  98. ^^^^^^^^^^^^^^^^^^^^^^^^
  99. .. warning::
  100. If this Mesh menu operation is used on an imported 3D scene, the generated
  101. UV2 will be lost when the scene is reloaded.
  102. Godot has an option to unwrap meshes and visualize the UV channels. After
  103. selecting a MeshInstance3D node, it can be found in the **Mesh** menu at the top
  104. of the 3D editor viewport:
  105. .. image:: img/lightmap_gi_mesh_menu.webp
  106. This will generate a second set of UV2 coordinates which can be used for baking.
  107. It will also set the texture size automatically.
  108. Unwrap from your 3D modeling software
  109. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  110. The last option is to do it from your favorite 3D app. This approach is
  111. generally **not recommended**, but it's explained so that you know it exists.
  112. The main advantage is that, on complex objects that you may want to re-import a
  113. lot, the texture generation process can be quite costly within Godot, so having
  114. it unwrapped before import can be faster.
  115. Simply do an unwrap on the second UV2 layer.
  116. .. image:: img/lightmap_gi_blender.webp
  117. Then import the 3D scene normally. Remember you will need to set the texture
  118. size on the mesh after import.
  119. .. image:: img/lightmap_gi_lmsize.webp
  120. If you use external meshes on import, the size will be kept. Be wary that most
  121. unwrappers in 3D modeling software are not quality-oriented, as they are meant
  122. to work quickly. You will mostly need to use seams or other techniques to create
  123. better unwrapping.
  124. Generating UV2 for primitive meshes
  125. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  126. .. note::
  127. This option is only available for primitive meshes such as :ref:`class_BoxMesh`,
  128. :ref:`class_CylinderMesh`, :ref:`class_PlaneMesh`, etc.
  129. Enabling UV2 on primitive meshes allows you to make them receive and contribute
  130. to baked lighting. This can be used in certain lighting setups. For instance,
  131. you could hide a torus that has an emissive material after baking lightmaps to
  132. create an area light that follows the shape of a torus.
  133. By default, primitive meshes do not have UV2 generated to save resources (as
  134. these meshes may be created during gameplay). You can edit a primitive mesh in
  135. the inspector and enable **Add UV2** to make the engine procedurally generate
  136. UV2 for a primitive mesh. The default **UV2 Padding** value is tuned to avoid
  137. most lightmap bleeding, without wasting too much space on the edges. If you
  138. notice lightmap bleeding on a specific primitive mesh only, you may have to
  139. increase **UV2 Padding**.
  140. **Lightmap Size Hint** represents the size taken by a single mesh on the
  141. lightmap texture, which varies depending on the mesh's size properties and the
  142. **UV2 Padding** value. **Lightmap Size Hint** should not be manually changed, as
  143. any modifications will be lost when the scene is reloaded.
  144. Checking UV2
  145. ^^^^^^^^^^^^
  146. In the **Mesh** menu mentioned before, the UV2 texture coordinates can be visualized.
  147. If something is failing, double-check that the meshes have these UV2 coordinates:
  148. .. image:: img/lightmap_gi_uvchannel.webp
  149. Setting up the scene
  150. --------------------
  151. Before anything is done, a **LightmapGI** node needs to be added to a scene.
  152. This will enable light baking on all nodes (and sub-nodes) in that scene, even
  153. on instanced scenes.
  154. .. image:: img/lightmap_gi_scene.webp
  155. A sub-scene can be instanced several times, as this is supported by the baker.
  156. Each instance will be assigned a lightmap of its own. To avoid issues with
  157. inconsistent lightmap texel scaling, make sure to respect the rule about mesh
  158. scaling mentioned before.
  159. Setting up meshes
  160. ^^^^^^^^^^^^^^^^^
  161. For a **MeshInstance3D** node to take part in the baking process, it needs to have
  162. its bake mode set to **Static**. Meshes that have their bake mode set to **Disabled**
  163. or **Dynamic** will be ignored by the lightmapper.
  164. .. image:: img/lightmap_gi_use.webp
  165. When auto-generating lightmaps on scene import, this is enabled automatically.
  166. Setting up lights
  167. ^^^^^^^^^^^^^^^^^
  168. Lights are baked with indirect light only by default. This means that shadowmapping
  169. and lighting are still dynamic and affect moving objects, but light bounces from
  170. that light will be baked.
  171. Lights can be disabled (no bake) or be fully baked (direct and indirect). This
  172. can be controlled from the **Bake Mode** menu in lights:
  173. .. image:: img/lightmap_gi_bake_mode.webp
  174. The modes are:
  175. Disabled
  176. ^^^^^^^^
  177. The light is ignored when baking lightmaps. This is the mode to use for dynamic
  178. lighting effects such as explosions and weapon effects.
  179. .. warning::
  180. Hiding a light has no effect on the resulting lightmap bake. This means
  181. you must use the Disabled bake mode instead of hiding the Light node by
  182. disabling its **Visible** property.
  183. Dynamic
  184. ^^^^^^^
  185. This is the default mode, and is a compromise between performance and real-time
  186. friendliness. Only indirect lighting will be baked. Direct light and shadows are
  187. still real-time, as they would be without LightmapGI.
  188. This mode allows performing *subtle* changes to a light's color, energy and
  189. position while still looking fairly correct. For example, you can use this
  190. to create flickering static torches that have their indirect light baked.
  191. Static
  192. ^^^^^^
  193. Both indirect and direct lighting will be baked. Since static surfaces can skip
  194. lighting and shadow computations entirely, this mode provides the best
  195. performance along with smooth shadows that never fade based on distance. The
  196. real-time light will not affect baked surfaces anymore, but it will still affect
  197. dynamic objects. When using the **All** bake mode on a light, dynamic objects
  198. will not cast real-time shadows onto baked surfaces, so you need to use a
  199. different approach such as blob shadows instead. Blob shadows can be implemented
  200. with a Decal node.
  201. The light will not be adjustable at all during gameplay. Moving the light or
  202. changing its color (or energy) will not have any effect on static surfaces.
  203. Since bake modes can be adjusted on a per-light basis, it is possible to create
  204. hybrid baked light setups. One popular option is to use a real-time
  205. DirectionalLight with its bake mode set to **Dynamic**, and use the **Static**
  206. bake mode for OmniLights and SpotLights. This provides good performance while
  207. still allowing dynamic objects to cast real-time shadows in outdoor areas.
  208. Fully baked lights can also make use of light nodes' **Size** (omni/spot) or
  209. **Angular Distance** (directional) properties. This allows for shadows with
  210. realistic penumbra that increases in size as the distance between the caster and
  211. the shadow increases. This also has a lower performance cost compared to
  212. real-time PCSS shadows, as only dynamic objects have real-time shadows rendered
  213. on them.
  214. .. image:: img/lightmap_gi_omnilight_size.png
  215. Baking
  216. ------
  217. To begin the bake process, click the **Bake Lightmaps** button at the top of the
  218. 3D editor viewport when selecting the LightmapGI node:
  219. .. image:: img/lightmap_gi_bake.webp
  220. This can take from seconds to minutes (or hours) depending on scene size, bake
  221. method and quality selected.
  222. .. warning::
  223. Baking lightmaps is a process that can require a lot of video memory,
  224. especially if the resulting texture is large. Due to internal limitations,
  225. the engine may also crash if the generated texture size is too large (even
  226. on systems with a lot of video memory).
  227. To avoid crashes, make sure the lightmap texel size in the Import dock is
  228. set to a high enough value.
  229. Tweaks
  230. ^^^^^^
  231. - **Quality:** Four bake quality modes are provided: Low, Medium, High, and
  232. Ultra. Higher quality takes more time, but result in a better-looking lightmap
  233. with less noise. The difference is especially noticeable with emissive
  234. materials or areas that get little to no direct lighting. Each bake quality
  235. mode can be further adjusted in the Project Settings.
  236. - **Bounces:** The number of bounces to use for indirect lighting. The default
  237. value (``3``) is a good compromise between bake times and quality. Higher
  238. values will make light bounce around more times before it stops, which makes
  239. indirect lighting look smoother (but also possibly brighter depending on
  240. materials and geometry).
  241. - **Bounce Indirect Energy:** The global multiplier to use when baking lights'
  242. indirect energy. This multiplies each light's own **Indirect Energy** value.
  243. Values different from ``1.0`` are not physically accurate, but can be used for
  244. artistic effect.
  245. - **Directional:** If enabled, stores directional information for lightmaps.
  246. This improves normal mapped materials' appearance for baked surfaces,
  247. especially with fully baked lights (since they also have direct light baked).
  248. The downside is that directional lightmaps are slightly more expensive to render.
  249. They also require more time to bake and result in larger file sizes.
  250. - **Interior:** If enabled, environment lighting will not be sourced. Use this
  251. for purely indoor scenes to avoid light leaks.
  252. - **Use Texture for Bounces:** If enabled, a texture with the lighting
  253. information will be generated to speed up the generation of indirect lighting
  254. at the cost of some accuracy. The geometry might exhibit extra light leak
  255. artifacts when using low resolution lightmaps or UVs that stretch the lightmap
  256. significantly across surfaces. Leave this enabled if unsure.
  257. - **Use Denoiser:** If enabled, uses a denoising algorithm to make the lightmap
  258. significantly less noisy. This increases bake times and can occasionally
  259. introduce artifacts, but the result is often worth it. See
  260. :ref:`doc_using_lightmap_gi_denoising` for more information.
  261. - **Denoiser Strength:** The strength of denoising step applied to the generated
  262. lightmaps. Higher values are more effective at removing noise, but can reduce
  263. shadow detail for static shadows. Only effective if denoising is enabled and
  264. the denoising method is :abbr:`JNLM (Non-Local Means with Joint Filtering)`
  265. (:abbr:`OIDN (Open Image Denoise)` does not have a denoiser strength setting).
  266. - **Bias:** The offset value to use for shadows in 3D units. You generally don't
  267. need to change this value, except if you run into issues with light bleeding or
  268. dark spots in your lightmap after baking. This setting does not affect real-time
  269. shadows casted on baked surfaces (for lights with **Dynamic** bake mode).
  270. - **Max Texture Size:** The maximum texture size for the generated texture
  271. atlas. Higher values will result in fewer slices being generated, but may not
  272. work on all hardware as a result of hardware limitations on texture sizes.
  273. Leave this at its default value of ``16384`` if unsure.
  274. - **Environment > Mode:** Controls how environment lighting is sourced when
  275. baking lightmaps. The default value of **Scene** is suited for levels with
  276. visible exterior parts. For purely indoor scenes, set this to **Disabled** to
  277. avoid light leaks and speed up baking. This can also be set to **Custom Sky**
  278. or **Custom Color** to use environment lighting that differs from the actual
  279. scene's environment sky.
  280. - **Gen Probes > Subdiv:** See :ref:`doc_using_lightmap_gi_dynamic_objects`.
  281. - **Data > Light Data:** See :ref:`doc_using_lightmap_gi_data`.
  282. Balancing bake times with quality
  283. ---------------------------------
  284. Since high-quality bakes can take very long (up to dozens of minutes for large
  285. complex scenes), it is recommended to use lower quality settings at first. Then,
  286. once you are confident with your scene's lighting setup, raise the quality
  287. settings and perform a "final" bake before exporting your project.
  288. Reducing the lightmap resolution by increasing **Lightmap Texel Size** on the
  289. imported 3D scenes will also speed up baking significantly. However, this will
  290. require you to reimport all lightmapped 3D scenes before you can bake lightmaps
  291. again.
  292. .. _doc_using_lightmap_gi_denoising:
  293. Denoising
  294. ---------
  295. Since baking lightmaps relies on raytracing, there will always be visible noise
  296. in the "raw" baked lightmap. Noise is especially visible in areas that are
  297. difficult to reach by bounced light, such as indoor areas with small openings
  298. where the sunlight can enter. Noise can be reduced by increasing bake quality,
  299. but doing so will increase bake times significantly.
  300. .. figure:: img/lightmap_gi_denoiser_comparison.webp
  301. :align: center
  302. :alt: Comparison between denoising disabled and enabled
  303. Comparison between denoising disabled and enabled (with the default JNLM denoiser).
  304. To combat noise without increasing bake times too much, a denoiser can be used.
  305. A denoiser is an algorithm that runs on the final baked lightmap, detects patterns of
  306. noise and softens them while attempting to best preserve detail.
  307. Godot offers two denoising algorithms:
  308. JNLM (Non-Local Means with Joint Filtering)
  309. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  310. JNLM is the default denoising method and is included in Godot. It uses a simple
  311. but efficient denoising algorithm known as *non-local means*. JNLM runs on the
  312. GPU using a compute shader, and is compatible with any GPU that can run Godot
  313. 4's Vulkan-based rendering methods. No additional setup is required.
  314. JNLM's denoising can be adjusted using the **Denoiser Strength** property that
  315. is visible when **Use Denoiser** enabled. Higher values can be more effective at
  316. removing noise, at the cost of suppressing shadow detail for static shadows.
  317. .. figure:: img/lightmap_gi_denoiser_jnlm_strength.webp
  318. :align: center
  319. :alt: Comparison between JNLM denoiser strength values
  320. Comparison between JNLM denoiser strength values. Higher values can reduce detail.
  321. OIDN (Open Image Denoise)
  322. ^^^^^^^^^^^^^^^^^^^^^^^^^
  323. Unlike JNLM, OIDN uses a machine learning approach to denoising lightmaps. It
  324. features a model specifically trained to remove noise from lightmaps while
  325. preserving more shadow detail in most scenes compared to JNLM.
  326. OIDN can run on the GPU if hardware acceleration is configured. With a modern
  327. high-end GPU, this can provide a speedup of over 50× over CPU-based denoising:
  328. - On AMD GPUs, HIP must be installed and configured.
  329. - On NVIDIA GPUs, CUDA must be installed and configured. This may automatically
  330. be done by the NVIDIA installer, but on Linux, CUDA libraries may not be
  331. installed by default. Double-check that the CUDA packages from your Linux
  332. distribution are installed.
  333. - On Intel GPUs, SYCL must be installed and configured.
  334. If hardware acceleration is not available, OIDN will fall back to multithreaded
  335. CPU-based denoising. To confirm whether GPU-based denoising is working, use a
  336. GPU utilization monitor while baking lightmaps and look at the GPU utilization
  337. percentage and VRAM utilization while the denoising step is shown in the Godot
  338. editor. The ``nvidia-smi`` command line tool can be useful for this.
  339. OIDN is not included with Godot due to its relatively large download size. You
  340. can download precompiled OIDN binary packages from its
  341. `website <https://www.openimagedenoise.org/downloads.html>`__.
  342. Extract the package to a location on your PC, then specify the path to the
  343. ``oidnDenoise`` executable in the Editor Settings (**FileSystem > Tools > OIDN >
  344. OIDN Denoise Path**). This executable is located within the ``bin`` folder of
  345. the binary package you extracted.
  346. After specifying the path to the OIDN denoising executable, change the denoising
  347. method in the project settings by setting **Rendering > Lightmapping >
  348. Denoiser** to **OIDN**. This will affect all lightmap bakes on this project
  349. after the setting is changed.
  350. .. note::
  351. The denoising method is configured in the project settings instead of the
  352. editor settings. This is done so that different team members working on the
  353. same project are assured to be using the same denoising method for
  354. consistent results.
  355. .. figure:: img/lightmap_gi_denoiser_jnlm_vs_oidn.webp
  356. :align: center
  357. :alt: Comparison between JNLM and OIDN denoisers
  358. Comparison between JNLM and OIDN denoisers.
  359. Notice how OIDN better preserves detail and reduces seams across different objects.
  360. .. _doc_using_lightmap_gi_dynamic_objects:
  361. Dynamic objects
  362. ---------------
  363. Unlike VoxelGI and SDFGI, dynamic objects receive indirect lighting differently
  364. compared to static objects. This is because lightmapping is only performed on
  365. static objects.
  366. To display indirect lighting on dynamic objects, a 3D probe system is used, with
  367. light probes being spread throughout the scene. When baking lightmaps, the
  368. lightmapper will calculate the amount of *indirect* light received by the probe.
  369. Direct light is not stored within light probes, even for lights that have their
  370. bake mode set to **Static** (as dynamic objects continue to be lit in
  371. real-time).
  372. There are 2 ways to add light probes to a scene:
  373. - **Automatic:** Set **Gen Probes > Subdiv** to a value other than **Disabled**,
  374. then bake lightmaps. The default is ``8``, but you can choose a greater value
  375. to improve precision at the cost of longer bake times and larger output file
  376. size.
  377. - **Manual:** In addition or as an alternative to generating probes
  378. automatically, you can add light probes manually by adding :ref:`class_LightmapProbe`
  379. nodes to the scene. This can be used to improve lighting detail in areas frequently
  380. travelled by dynamic objects. After placing LightmapProbe nodes in the scene,
  381. you must bake lightmaps again for them to be effective.
  382. .. note::
  383. After baking lightmaps, you will notice white spheres in the 3D scene that
  384. represent how baked lighting will affect dynamic objects. These spheres do
  385. **not** appear in the running project.
  386. If you want to hide these spheres in the editor, toggle **View > Gizmos >
  387. LightmapGI** at the top of the 3D editor (a "closed eye" icon indicates the
  388. gizmo is hidden).
  389. .. _doc_using_lightmap_gi_data:
  390. Lightmap data
  391. -------------
  392. The **Data > Light Data** property in the LightmapGI node contains the lightmap
  393. data after baking. Textures are saved to disk, but this also contains the
  394. capture data for dynamic objects, which can be heavy. If you are using a scene
  395. in ``.tscn`` format, you should save this resource to an external binary
  396. ``.lmbake`` file to avoid bloating the ``.tscn`` scene with binary data encoded
  397. in Base64.
  398. .. tip::
  399. The generated EXR file can be viewed and even edited using an image editor
  400. to perform post-processing if needed. However, keep in mind that changes to
  401. the EXR file will be lost when baking lightmaps again.
  402. Reducing LightmapGI artifacts
  403. -----------------------------
  404. If you notice LightmapGI nodes popping in and out of existence as the camera
  405. moves, this is most likely because the engine is rendering too many LightmapGI
  406. instances at once. Godot is limited to rendering 8 LightmapGI nodes at once,
  407. which means up to 8 instances can be in the camera view before some of them will
  408. start flickering.