<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://geom.io/bakery/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Mr+F</id>
	<title>Bakery GPU Lightmapper: Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://geom.io/bakery/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Mr+F"/>
	<link rel="alternate" type="text/html" href="https://geom.io/bakery/wiki/index.php?title=Special:Contributions/Mr_F"/>
	<updated>2026-05-03T02:21:02Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.32.1</generator>
	<entry>
		<id>https://geom.io/bakery/wiki/index.php?title=Troubleshooting&amp;diff=1870</id>
		<title>Troubleshooting</title>
		<link rel="alternate" type="text/html" href="https://geom.io/bakery/wiki/index.php?title=Troubleshooting&amp;diff=1870"/>
		<updated>2026-04-08T10:01:14Z</updated>

		<summary type="html">&lt;p&gt;Mr F: /* Error message &amp;quot;Failed to load OptiX library&amp;quot; */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a list of common problems, their symptoms and solutions.&lt;br /&gt;
&lt;br /&gt;
=== Shadowmasks are not baked ===&lt;br /&gt;
Check following things:&lt;br /&gt;
* Bakery's [[Manual#Render Mode|Render Mode]] is set to Shadowmask.&lt;br /&gt;
* Masked lights have both Unity and Bakery light components on them.&lt;br /&gt;
* Masked Bakery light components have &amp;quot;Baked contribution&amp;quot; set to &amp;quot;Indirect and shadowmask&amp;quot;.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Shadowmasks are baked, but Unity renders real-time shadows instead ===&lt;br /&gt;
You're in Distance Shadowmask mode, it's expected. Read more about the difference:&lt;br /&gt;
&lt;br /&gt;
https://docs.unity3d.com/Manual/LightMode-Mixed-Shadowmask.html&lt;br /&gt;
&lt;br /&gt;
https://docs.unity3d.com/Manual/LightMode-Mixed-DistanceShadowmask.html&lt;br /&gt;
&lt;br /&gt;
* To switch between two modes, you can use &amp;quot;Distance Shadowmask&amp;quot; checkbox in Bakery main window.&lt;br /&gt;
* If you're on 5.6, go to Window-&amp;gt;Lighting-&amp;gt;Mixed Lighting-&amp;gt;Lighting Mode to switch the mode.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I can't see specular lighting after the bake ===&lt;br /&gt;
Apparently specular lighting was provided by real-time lights before the bake. Now the lighting is baked into static textures and there is no specular. However, you can:&lt;br /&gt;
* Use Reflection Probes. Good option for highly glossy objects.&lt;br /&gt;
* Use mixed lights and only bake GI/[[Manual#Shadowmask|Shadowmasks]]. Specular remains real-time.&lt;br /&gt;
* Bake in [[Manual#Dominant_Direction|Dominant Direction]] or [[Manual#SH|SH]] mode and use [[Manual#Bakery_shaders|Bakery shaders]] with &amp;quot;Lightmapped specular&amp;quot; option. It will give some specular approximation. Looks good on surfaces with medium/high roughness.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Using a version control system I copied the scene to another PC and it doesn't look right ===&lt;br /&gt;
Make sure you followed [[How_do_I...#How_do_I_use_git.2Fcollab.2Fother_version_control_system_with_Bakery.3F|version control guidelines]].&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Baking same asset in one scene breaks its UVs in another scene ===&lt;br /&gt;
The reason here is [[Manual#Asset_UV_Processing|UV padding adjustment]]. It modifies the UVs in the asset, so spacing between UV charts is optimal, meaning they never leak over each other and there is no much wasted space. Unity has a manual Pack Margin option on model assets, but it’s limited since it applies the same exact value for all meshes inside the model, while each mesh can get drastically different size in the final lightmap based on its surface area. Therefore Bakery overrides it with automatically calculated per-mesh (instead of per-model) padding. However, because “optimal” varies depending on baking resolution, it can be problematic to reuse the same asset in isolated scenes with different lightmap size. There are multiple ways to solve it:&lt;br /&gt;
* a) Just disable UV padding adjustment (set to [[Manual#Asset_UV_Processing|Don't Change]]). Results will be similar to built-in baking.&lt;br /&gt;
* b) Generate your own optimal UVs. UV padding adjustment only applies to models with auto-generated UV layout (aka “Generate Lightmap UVs” checkbox) and never touches custom data.&lt;br /&gt;
* c) Set Asset UV Processing to &amp;quot;Adjust UV padding only for new meshes&amp;quot; (currently available in the [[Github_access|github]] version).&lt;br /&gt;
* d) Use [[Manual#UV_padding:_increase_only|UV padding: increase only]] checkbox and first bake the lowest resolution scene, and then the rest.&lt;br /&gt;
* e) Use two different models for different lightmap resolutions, so each will get the most efficient set of UVs.&lt;br /&gt;
* f) Bake both scenes together.&lt;br /&gt;
* g) Lock UVs using [[How_do_I...#Alternative_solution|Save UV padding to asset]]&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser throws error 505 or Unknown error ===&lt;br /&gt;
[https://www.nvidia.com/Download/index.aspx?lang=en-US Update the driver].&lt;br /&gt;
&lt;br /&gt;
If you are using a Kepler GPU, try switching to [[Manual#Legacy_denoiser|legacy denoiser]].&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get an “Out of memory” error ===&lt;br /&gt;
This means rendering needed more video memory from your GPU than it has available.&lt;br /&gt;
&lt;br /&gt;
First, try closing any other graphics-intensive programs (browsers too).&lt;br /&gt;
&lt;br /&gt;
If the problem persists, the most likely reason is that the resolution you selected is unreasonably high for the given scene. Resolution is defined by [[Manual#Texels_per_unit|Texels per Unit]] (this section also has a list of reference values) or set explicitly in [[Manual#Bakery_Lightmap_Group_Selector|Lightmap Groups]]. Reducing it will help. You can always selectively use high resolution for important objects via [https://docs.unity3d.com/Manual/class-MeshRenderer.html Scale in Lightmap].&lt;br /&gt;
&lt;br /&gt;
If you have terrains in your scene, make sure [[Manual#Terrain_optimization|Terrain optimization]] is enabled.&lt;br /&gt;
&lt;br /&gt;
If you have a very high amount of painted trees on your terrain, try disabling the [[Manual#Export_terrain_trees|Export terrain trees]] option.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a “Can't map texture” error ===&lt;br /&gt;
Typically happens if your system went out of RAM (system memory, not video memory) during the scene export process. Your scene could already be taking too much RAM by itself, not leaving enough free memory for Bakery export.&lt;br /&gt;
&lt;br /&gt;
* Try closing any memory-intensive programs before baking.&lt;br /&gt;
* Try reducing [[Manual#Max_resolution|Max Resolution]] from 4096 to 2048.&lt;br /&gt;
* If you are baking very highly detailed (millions of triangles) geometry, try excluding some of it from the bake.&lt;br /&gt;
* Try disabling [[Manual#Export_terrain_trees|Export terrain trees]].&lt;br /&gt;
* Try enabling [[Manual#Terrain_optimization|Terrain optimization]].&lt;br /&gt;
&lt;br /&gt;
This error can also be shown in case of GPU driver crash, in which case Unity editor also won't render anything.&lt;br /&gt;
&lt;br /&gt;
If this error happens at the end of the render process (from the seamfixer app), try increasing the [[Troubleshooting#I_get_a_.22Launch_timeout.22_error|TDR]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a “Can't create texture” or &amp;quot;Can't create rasterizer state&amp;quot; error ===&lt;br /&gt;
Typically errors like this are caused by such chain of events:&lt;br /&gt;
* Some objects in the scene have incorrect lightmapping UVs. Often the UVs contain many large triangles overlapping each other.&lt;br /&gt;
* Scene uses large lightmaps.&lt;br /&gt;
* Bakery tries to rasterize a huge amount of 4k-sized overlapping triangles to prepare the UV GBuffer.&lt;br /&gt;
* This operation takes &amp;gt; 2 seconds, and the driver is reset by Windows due to TDR: https://docs.microsoft.com/en-us/windows-hardware/drivers/display/timeout-detection-and-recovery&lt;br /&gt;
* Consequent GPU operations are failed due to reset.&lt;br /&gt;
&lt;br /&gt;
Solution:&lt;br /&gt;
* Make sure all your objects either have non-overlapping UV2 or enable &amp;quot;Generate lightmapping UVs&amp;quot; on all model assets.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== After importing Bakery I get errors containing “obsolete” and “UnityUpgradable” ===&lt;br /&gt;
Before importing Bakery, make sure you don't have any compilation errors in your project.&lt;br /&gt;
&lt;br /&gt;
Restart Unity, reimport the package. Click “I made a backup, go ahead” if Unity asks.&lt;br /&gt;
&lt;br /&gt;
See [https://docs.unity3d.com/Manual/APIUpdater.html this page] for more details.&lt;br /&gt;
&lt;br /&gt;
It is also known that some versions of Unity Hub have a [https://forum.unity.com/threads/bakery-gpu-lightmapper-v1-6-released.536008/page-63#post-4668227 bug] preventing API updater from running.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a &amp;quot;Can't load&amp;quot; error ===&lt;br /&gt;
If Bakery says it can't load something, make sure you have enough free disk space on the drive used for [[Manual#Temp_path|temporary data]].&lt;br /&gt;
&lt;br /&gt;
Some parts of Bakery can't deal with non-ASCII characters (this is going to be fixed soon). Try naming your scenes and lightmap group assets with ASCII characters. Latin letters and numbers must always work.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a &amp;quot;Launch timeout&amp;quot; error ===&lt;br /&gt;
This error can happen if your GPU took more time than it is allowed by [https://docs.microsoft.com/en-us/windows-hardware/drivers/display/timeout-detection-and-recovery Windows TDR].&lt;br /&gt;
* Try disabling [[Manual#Terrain_optimization|Terrain Optimization]].&lt;br /&gt;
* Try lowering the value of [[Manual#Tile_size|Tile Size]], especially if it's higher than 512, so baking job is split into smaller chunks.&lt;br /&gt;
* Depending on the pass being processed, try lowering the Samples value (e.g. [[Manual#Samples|GI samples]], [[Manual#Bakery_Sky_Light|Skylight samples]], etc).&lt;br /&gt;
* Reduce geometric complexity of the scene, if tile size/samples don't help.&lt;br /&gt;
* As a last resort, [https://docs.microsoft.com/en-us/windows-hardware/drivers/display/tdr-registry-keys disable TDR registry keys]. This will prevent Windows from resetting the driver, but your computer may appear unresponsive during the bake.&lt;br /&gt;
&lt;br /&gt;
[https://substance3d.adobe.com/documentation/spdoc/gpu-drivers-crash-with-long-computations-tdr-crash-128745489.html Additional instructions for changing the timeout (from Substance)]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I have an Android project, and lightmaps don't look good ===&lt;br /&gt;
[[File:Banding.jpg|Android banding artifacts|thumb]]&lt;br /&gt;
[[File:LightmapsTechnicalDetails.png|Lightmap encoding in player settings|thumb]]&lt;br /&gt;
[[File:Astc.jpg|Build texture compression settings|thumb]]&lt;br /&gt;
Sometimes, when working on Android projects, you may encounter banding artifacts, with gradients having discrete steps of different hue.&lt;br /&gt;
This is caused by texture compression and HDR encoding Unity uses for this platform, which often turns out to be &amp;quot;Double LDR&amp;quot; ([https://docs.unity3d.com/Manual/Lightmaps-TechnicalInformation.html see details]). The problem is not exclusive to Bakery and will as well happen with built-in lightmaps.&lt;br /&gt;
&lt;br /&gt;
In Player Settings, set Lightmap Encoding to '''High Quality'''.&lt;br /&gt;
&lt;br /&gt;
If your target devices support ASTC compression, make sure it is enabled in Build settings. PVRTC is also a good choice, although it is mostly supported on iOS devices. ETC compression gives poor results for lightmaps.&lt;br /&gt;
&lt;br /&gt;
If above solutions are not enough, select lightmap assets and set texture compression quality to '''High''' or '''None''' (try both).&lt;br /&gt;
&lt;br /&gt;
Note that setting it to None will use more video memory on the device.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I have a scene baked with MonoSH, and lighting looks pixelated ===&lt;br /&gt;
[[File:Normalq.jpg|MonoSH compressed with low quality encoding|thumb]]&lt;br /&gt;
In some scenes, [[Manual#MonoSH|MonoSH]] lightmaps can look pixelated, if low (or &amp;quot;normal&amp;quot;) quality compression is used (e.g. DXT1). Usually setting Compression = High on the L1 texture fixes the issue.&lt;br /&gt;
&lt;br /&gt;
You can enable all L1 textures to always use High quality compression by toggling Project Settings -&amp;gt; Bakery -&amp;gt; '''High quality direction'''.&lt;br /&gt;
&lt;br /&gt;
Note that depending on the platform, High quality compression can take more memory. On PC it usually doubles by going from DXT1 to BC7 format.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== There are weird square artifacts on my geometry ===&lt;br /&gt;
[[File:Smoothnormals flatshape.jpg|Square artifacts from incorrect normals|thumb]]&lt;br /&gt;
Weird squares may sometimes be seen on models when their shape is too different from their normals. Bakery [https://ndotl.wordpress.com/#shadowterm tries to compensate] starting ray points to take fake normal smoothness into account, but in extreme cases the algorithm can't handle the discrepancy.&lt;br /&gt;
Usually it's enough to just recalculate normals on the model. E.g. in Unity you can select the FBX and change &amp;quot;Normals&amp;quot; to &amp;quot;Calculate&amp;quot; instead of &amp;quot;Import&amp;quot;.&lt;br /&gt;
Alternatively, you can disable the related compensation algorithm, but it’s actually beneficial in most cases. You can toggle it in Project Settings → Bakery → Generate smooth positions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get too many lightmaps ===&lt;br /&gt;
Possible causes are:&lt;br /&gt;
&lt;br /&gt;
* [[Manual#Atlas_Packer|Atlas packer]] is set to ''Default'' or ''Post-packing'' is disabled. Set Atlas Packer to ''xatlas'' and enable Post-packing for best results.&lt;br /&gt;
&lt;br /&gt;
* ''Texels Per Unit'' value is high or ''Max Resolution'' is low. Bakery packs objects from open scenes into multiple lightmap atlases and packs them as rectangles (in a fashion similar to [https://blackpawn.com/texts/lightmaps/default.html this]; unless Hole Filling is enabled) with their size dependent on (surface area * texels per unit). If some object can't fit into existing atlases, a new one is allocated. New atlases are always as large as the Max Resolution parameter, or smaller (but not smaller than ''Min Resolution''), if the estimated surface area of remaining unpacked objects is below some threshold. You can also increase Min Resolution a bit, replacing a bunch of small (but dense) maps with a few large (but possibly with some empty space).&lt;br /&gt;
&lt;br /&gt;
Additionally, increase ''Min Resolution'' to prefer larger combined lightmaps instead of many smaller ones.&lt;br /&gt;
&lt;br /&gt;
If not using post-packing:&lt;br /&gt;
&lt;br /&gt;
* If you bake multiple open scenes and ''Split by scene'' checkbox is on, different scenes will never share the same lightmap, therefore multiplying their count.&lt;br /&gt;
* If ''Terrain optimization'' is on, terrains will always use a separate lightmap.&lt;br /&gt;
Pre-atlasing your scene in your modelling package of choice and using the [https://geom.io/bakery/wiki/index.php?title=Manual#Bakery_Lightmap_Group_Selector Original UV] mode instead of relying on the auto-atlaser can significantly improve packing effectiveness.&lt;br /&gt;
&lt;br /&gt;
Since v1.71 Bakery prints number of future used lightmaps to console when enabling/refreshing Checker Preview. You can experiment with resolution/density settings until the desired value is printed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get jagged shadows ===&lt;br /&gt;
[[File:Softshadows.png|Jagged shadow mitigation|thumb]]&lt;br /&gt;
Apparently you are baking very sharp shadows at low resolution. Try increasing shadow spread parameter on the light ([[Manual#Bakery_Direct_Light|direct]] or [[Manual#Bakery_Point_Light|point]]) and optionally enable [[Manual#Shader_Tweaks|bicubic interpolation]].&lt;br /&gt;
On a [[Manual#Bakery_Direct_Light|Direct Light]] you can also enable the '''Anti-Alias''' option.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Exporting scene - preparing&amp;quot; is taking too long ===&lt;br /&gt;
(Or &amp;quot;Exporting scene - atlasing&amp;quot;)&lt;br /&gt;
* Try setting [[Manual#Atlas_Packer|Atlas Packer]] to Default.&lt;br /&gt;
* Make sure you use reasonable [[Manual#Texels_per_unit|Texels Per Unit]] value.&lt;br /&gt;
* Make sure your meshes are [[Manual#Quickstart|correctly unwrapped]].&lt;br /&gt;
* Possibly disable [[Manual#Asset_UV_Processing|UV Padding Adjustment]].&lt;br /&gt;
&lt;br /&gt;
If you're converting a large existing scene, make sure to follow [[How_do_I...#How_do_I_quickly_port_my_existing_scene_to_Bakery.3F|this guide]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Stuck at &amp;quot;Waiting for Unity to initialize the probes...&amp;quot; ===&lt;br /&gt;
There isn't much Bakery can do about the logic of Unity lighting data asset generation (there is no API in the engine to control it at the moment). Try to focus editor window (especially scene view) to wake Unity up.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Baked prefabs instantiated at runtime in a build have no lightmaps ===&lt;br /&gt;
Because Unity technically has no support for prefabs having lightmaps, it can omit lightmapped shader versions from builds, not realizing they are needed. You can fix it by going to [https://docs.unity3d.com/Manual/class-GraphicsSettings.html?_ga=2.212464724.1917527976.1586930444-1257434621.1522062178#stripping Shader stripping settings] and enabling lightmap modes you use.&lt;br /&gt;
Additionally, try disabling '''Optimize Mesh Data''' in Player Settings, as Unity may omit UV from the build.&lt;br /&gt;
&lt;br /&gt;
{{note|In Shader Stripping settings &amp;quot;Directional&amp;quot; mode only applies to standard Unity directional maps aka [[Manual#Dominant_Direction|Dominant Direction]]. When using Baked Normal Maps, RNM or SH, use &amp;quot;Non-directional&amp;quot; lightmap mode checkboxes.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Speedtrees look fine in the editor, but black in builds ===&lt;br /&gt;
Also related to shader stripping. See the [[Troubleshooting#Baked_prefabs_instantiated_at_runtime_in_a_build_have_no_lightmaps|prefab solution]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Scene is black in build ===&lt;br /&gt;
See advice above. Additionally, if the scene is loaded asynchronously, call ftLightmaps.RefreshFull() when it is fully loaded.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== HDRI produces scattered bright spots (fireflies) ===&lt;br /&gt;
[[File:Fireflies.jpg|thumb|Typical &amp;quot;fireflies&amp;quot;]]&lt;br /&gt;
[[File:Upload 2019-7-3 11-27-22.png|thumb|Removing sun from HDRI]]&lt;br /&gt;
This artefact comes from the fact your HDRI has very bright, yet very small parts, typically sun. Rays will miss it often, producing occasional spots when they don't. This problem is well known in many offline ray tracers as well.&lt;br /&gt;
* Use [[Manual#Bakery_Direct_Light|Direct Light]] for the sun&lt;br /&gt;
* Remove sun from HDRI (also [https://seblagarde.wordpress.com/2016/08/28/siggraph-2016-an-artist-friendly-workflow-for-panoramic-hdri/ recommended by Unity])&lt;br /&gt;
* Possibly downsample/blur the HDRI&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Small emissive (or brightly lit) surfaces produce noise ===&lt;br /&gt;
The issue is similar to the one above and may happen when using very small and very bright emissive surfaces, or small non-emissive surfaces lit by a very intense light. In case of emissive surfaces, you can replace them with [[Manual#Bakery_Light_Mesh|Light Meshes]] to prevent it. See [[Manual#Differences_between_Light_Mesh_and_emissive_materials|Differences between Light Mesh and emissive materials]]. Alternatively, try increasing [[Manual#Samples|GI sample count]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Adjusting UV padding&amp;quot; happens too often and takes too much time ===&lt;br /&gt;
[[Manual#Asset_UV_Processing|UV padding adjustment]] is a feature that optimizes asset UVs based on the size they take in lightmaps. This process will happen for a model if:&lt;br /&gt;
* Option is globally enabled.&lt;br /&gt;
* Asset has &amp;quot;Generate Lightmap UVs&amp;quot; checkbox enabled. Models with custom UVs are not adjusted.&lt;br /&gt;
* Model was not adjusted before or...&lt;br /&gt;
* ... its lightmap size has changed.&lt;br /&gt;
Therefore it can be triggered for all auto-unwrapped models after their geometry or resolution changes.&lt;br /&gt;
UV padding adjustment will try to waste less lightmap resolution and reduce texel leaking, but it is not necessary. If you are doing many experimental/draft bakes, you may consider disabling it (set to &amp;quot;Don't change&amp;quot;), then possibly enabling it back for the final quality bake.&lt;br /&gt;
&lt;br /&gt;
Also note that using xatlas as [[Manual#Unwrapper|Unwrapper]] can be notoriously slower comparing to Default.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser produces bright edges around geometry/shadows ===&lt;br /&gt;
[[File:Bredges.jpg|thumb|Bright edges]]&lt;br /&gt;
Sometimes you may encounter bright edges or spots at high contrast edges caused by the denoising neural net, most notably OptiX 6 and 7.&lt;br /&gt;
* Use OptiX 5 or OpenImageDenoise if you can ([[Manual#Denoiser|denoiser]] option).&lt;br /&gt;
* Try enabling [[Manual#Denoise:_fix_bright_edges|Denoise: Fix bright edges]].&lt;br /&gt;
* Try setting texture compression to None on lightmap assets.&lt;br /&gt;
* Try setting [[Manual#Backface_GI|Backface GI]] to 1, removing dark shadows inside objects. While these shadows are normally not visible, their edges may cause problems for both the denoiser and texture compression.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Light probes are too bright in Subtractive mode ===&lt;br /&gt;
&lt;br /&gt;
[[File:98911466-ae8c5b00-24d5-11eb-8d51-4e764ac0f163.png|thumb|The effect of occlusion probes]]&lt;br /&gt;
&lt;br /&gt;
Light occlusion information is not baked into probes. Solution:&lt;br /&gt;
* Set your Unity directional light to Mixed mode.&lt;br /&gt;
* Enable [[Manual#Occlusion_probes|Occlusion Probes]].&lt;br /&gt;
* Bake&lt;br /&gt;
&lt;br /&gt;
Some versions of Unity may need a scene reload to properly apply the Lighting Data Asset.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Baking produces &amp;quot;Not allowed to access uv2&amp;quot; errors ===&lt;br /&gt;
All lightmapped models must have [https://docs.unity3d.com/Manual/FBXImporter-Model.html Read/Write enabled] on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Whole scene is very bright or black ===&lt;br /&gt;
* Check if your light intensities are in a reasonable range (&amp;lt; 100; or &amp;lt;= 100000 Lux in HDRP).&lt;br /&gt;
* Check the same for indirect intensity on all lights. A multiplication of direct and intensity intensity must not go into thousands, otherwise GI algorithm may overflow.&lt;br /&gt;
* Check if you don't use assets with High mesh compression. When set to High, Unity mesh compression will completely destroy lightmap UVs, only leaving 8 bits for them. This may produce many lightmapping errors including this one.&lt;br /&gt;
* Check if you have any .hdr overrides in the Preset Manager that change the way lightmaps are imported.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery says &amp;quot;Device is not DX11&amp;quot; ===&lt;br /&gt;
Currently Bakery needs Unity editor to be running in DX11 mode to directly exchange texture data, so make sure your editor's window header says &amp;quot;&amp;lt;DX11&amp;gt;&amp;quot;. If it does not, change active graphics API to DX11: &lt;br /&gt;
* Go to Player Settings.&lt;br /&gt;
* If &amp;quot;Auto Graphics API for Windows&amp;quot; is unchecked, you will see a list of APIs.&lt;br /&gt;
* Make sure &amp;quot;Direct3D11&amp;quot; is on top or place it there.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery doesn't work on my 3070/3080/3090 GPU? ===&lt;br /&gt;
1. Please enable [[Manual#RTX_Mode|RTX mode]].&lt;br /&gt;
&lt;br /&gt;
2. If denoiser also fails, please update from [[Github_access|github]] and use OpenImageDenoise option (some instructions are [[Troubleshooting#Denoiser_produces_bright_edges_around_geometry.2Fshadows|here]]).&lt;br /&gt;
&lt;br /&gt;
Updated denoiser (both new OptiX version and OpenImageDenoise) as well as automatic hardware detection will be soon released on the Asset Store.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser produces grid-like patterns ===&lt;br /&gt;
[[File:Gridlike.jpg|thumb|Grid-like denoiser pattern]]&lt;br /&gt;
&lt;br /&gt;
OptiX denoiser might produdce grid-like patterns when fed with very low-precision lightmaps. Low precision is usually caused by either extremely dark or extremely bright lighting. It is recommended to stay within reasonable intensity range (see a similar advice for [[Troubleshooting#Lightmaps_look_black_or_have_bad_quality_in_an_HDRP_scene|HDRP]] above).&lt;br /&gt;
&lt;br /&gt;
* Alternatively use OpenImageDenoise, as it does not produce this pattern.&lt;br /&gt;
&lt;br /&gt;
* This issue also does not affect OptiX 5.1 denoiser (&amp;quot;Legacy denoiser&amp;quot;) as its training dataset is in its own DLL, but affects the non-legacy version (OptiX 6.0) and only on driver versions newer than 442.50, as the training datasets are in the driver ([https://forums.developer.nvidia.com/t/optix7-denoiser-different-results-with-different-version-of-drivers/117989/2 explanation from NVIDIA]).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get &amp;quot;rtcRes == RTC_SUCCESS&amp;quot; error ===&lt;br /&gt;
&lt;br /&gt;
You are using a 3xxx+ GPU with RTX mode disabled. Enable [[Manual#RTX_Mode|RTX mode]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Baking any scene crashes with unknown error ===&lt;br /&gt;
&lt;br /&gt;
There were [https://twitter.com/HarryAlisavakis/status/1331630028665348096 some reports] that Avast antivirus can block Bakery from running, even though Bakery's executables don't trigger any antivirus (including Avast) when [https://twitter.com/guycalledfrank/status/1331640614077796354 scanned via VirusTotal]. Perhaps it just block any executables that were launched 'indirectly', i.e. from another application. In any case, if you have Avast, try adding your project folder to exception list.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Combined meshes (e.g. using Mesh Combine asset) bake incorrectly ===&lt;br /&gt;
&lt;br /&gt;
[[File:Meshcombine.jpg|thumb|Mesh Combine &amp;quot;Regenerate Lightmap UVs&amp;quot; option]]&lt;br /&gt;
&lt;br /&gt;
Most mesh combining assets have an option to regenerate lightmap UVs. Without it, combined UVs will overlap each other. If you are using Mesh Combine, make sure &amp;quot;Regenerate Lightmap UVs&amp;quot; option is enabled in output settings.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a &amp;quot;Can't create vertex buffer&amp;quot; error ===&lt;br /&gt;
&lt;br /&gt;
This error can happen if the scene has more than ~40 million vertices. It is recommended to reduce geometric complexity of the scene, as tracing it would be too slow anyway. The typical cause of going over this limit is trying to bake with large arrays of trees painted on the terrain. In this case try disabling [[Manual#Export_terrain_trees|Export Terrain Trees]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Soft shadows appear like multiple hard shadows ===&lt;br /&gt;
&lt;br /&gt;
[[File:Unknown.png|thumb|Undersampled shadow]]&lt;br /&gt;
&lt;br /&gt;
Increase ''Shadow Samples'' on the light or decrease the ''Shadow Spread''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Lightmaps are black on GTX 650 ===&lt;br /&gt;
&lt;br /&gt;
Apparently newer Nvidia drivers deprecate some CUDA functions on older hardware. It is recommended to use driver version 442 on GTX 650, as it still supported everything Bakery uses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Lightmaps disappear on play ===&lt;br /&gt;
&lt;br /&gt;
* Make sure that '''Project Settings''' -&amp;gt; '''Editor''' -&amp;gt; '''Enter Play Mode Settings''' -&amp;gt; '''Reload Scene''' is turned '''on'''.&lt;br /&gt;
* If that doesn't help, try applying the latest [[Github_access|patch]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a DllNotFoundException ===&lt;br /&gt;
&lt;br /&gt;
* Check if the DLL file mentioned in the error actually exists in your project. If it doesn't, your Bakery installation is incomplete or corrupted; please reinstall it.&lt;br /&gt;
* Check if you're running 64-bit Unity Editor under 64-bit Windows (7 or newer) (as listed in [[Manual#System_requirements|system requirements]]).&lt;br /&gt;
* Make sure you have 64-bit [https://www.microsoft.com/en-us/download/details.aspx?id=48145 Visual C++ Redistributables for Visual Studio 2015] installed. In case if the Microsoft site download is broken, here is a [https://drive.google.com/file/d/1WfRP1A43bCwZflZ_I0wHSGPyC3b-0lqK/view?usp=sharing reupload].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Lightmap UVs are wrong when opening previously baked project on a Mac ===&lt;br /&gt;
&lt;br /&gt;
When Unity reimports model assets, it performs UV unwrapping. If you baked the scene with [[Manual#Unwrapper|Unwrapper]] was set to xatlas, it won't work on a Mac because Bakery's xatlas wrapper library is only compiled for Windows. Rebaking with Default unwrapper should fix it.&lt;br /&gt;
&lt;br /&gt;
You can still keep xatlas as the [[Manual#Atlas_Packer|Atlas Packer]].&lt;br /&gt;
&lt;br /&gt;
''Unwrapper'' is used to generate UVs for individual, isolated meshes, while ''Atlas Packer'' packs big scene-specific atlases out of many unwrapped layouts.&lt;br /&gt;
&lt;br /&gt;
Combining Default unwrapper with xatlas being used as the Atlas Packer and enabling [[Manual#Hole_filling|Hole Filling]] should give pretty good [https://x.com/guycalledfrank/status/1231890428313600000 results] and compensate for any individual mesh unwrapping inefficiencies.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Error message &amp;quot;Failed to load OptiX library&amp;quot; ===&lt;br /&gt;
&lt;br /&gt;
(Aka &amp;quot;Both RTX and non-RTX lightmapper failed to run&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Nvidia driver 590 (and newer) [https://forums.developer.nvidia.com/t/optix-6-0-0-is-broken-on-driver-591-44/353738 removed support for OptiX 6.0] which Bakery depended on. Bakery v1.98 added support for the new driver, now using OptiX 9.0.&lt;br /&gt;
* Make sure you're using a [[Manual#System_requirements|supported Nvidia GPU]].&lt;br /&gt;
* Update Bakery to v1.98 via the [https://assetstore.unity.com/packages/tools/level-design/bakery-gpu-lightmapper-122218 Asset Store], [[Github_access|github or the built-in patcher]].&lt;br /&gt;
* If you still get the error every time, click '''Bakery -&amp;gt; Utilities -&amp;gt; Detect Optimal Settings''' and choose &amp;quot;Set recommended as default&amp;quot;.&lt;br /&gt;
* If you don't want to update Bakery, roll back your GPU driver to any pre-590 version (e.g. [https://www.nvidia.com/en-eu/geforce/drivers/results/257569/ 581.80]).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Point Light with a cookie/cubemap is black ===&lt;br /&gt;
Note that Bakery supports colored cookies and reads RGB from cookie/cubemap textures. Unity, on the other hand, only supports grayscale cookies. Setting Texture Type to &amp;quot;Cookie&amp;quot; on the asset will convert it to a single-channel A8 format. For Bakery, leave Texture Type to Default.&lt;/div&gt;</summary>
		<author><name>Mr F</name></author>
		
	</entry>
	<entry>
		<id>https://geom.io/bakery/wiki/index.php?title=Troubleshooting&amp;diff=1869</id>
		<title>Troubleshooting</title>
		<link rel="alternate" type="text/html" href="https://geom.io/bakery/wiki/index.php?title=Troubleshooting&amp;diff=1869"/>
		<updated>2026-04-08T10:00:36Z</updated>

		<summary type="html">&lt;p&gt;Mr F: /* Error message &amp;quot;Failed to load OptiX library&amp;quot; (&amp;quot;Both RTX and non-RTX lightmapper failed to run&amp;quot;) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a list of common problems, their symptoms and solutions.&lt;br /&gt;
&lt;br /&gt;
=== Shadowmasks are not baked ===&lt;br /&gt;
Check following things:&lt;br /&gt;
* Bakery's [[Manual#Render Mode|Render Mode]] is set to Shadowmask.&lt;br /&gt;
* Masked lights have both Unity and Bakery light components on them.&lt;br /&gt;
* Masked Bakery light components have &amp;quot;Baked contribution&amp;quot; set to &amp;quot;Indirect and shadowmask&amp;quot;.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Shadowmasks are baked, but Unity renders real-time shadows instead ===&lt;br /&gt;
You're in Distance Shadowmask mode, it's expected. Read more about the difference:&lt;br /&gt;
&lt;br /&gt;
https://docs.unity3d.com/Manual/LightMode-Mixed-Shadowmask.html&lt;br /&gt;
&lt;br /&gt;
https://docs.unity3d.com/Manual/LightMode-Mixed-DistanceShadowmask.html&lt;br /&gt;
&lt;br /&gt;
* To switch between two modes, you can use &amp;quot;Distance Shadowmask&amp;quot; checkbox in Bakery main window.&lt;br /&gt;
* If you're on 5.6, go to Window-&amp;gt;Lighting-&amp;gt;Mixed Lighting-&amp;gt;Lighting Mode to switch the mode.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I can't see specular lighting after the bake ===&lt;br /&gt;
Apparently specular lighting was provided by real-time lights before the bake. Now the lighting is baked into static textures and there is no specular. However, you can:&lt;br /&gt;
* Use Reflection Probes. Good option for highly glossy objects.&lt;br /&gt;
* Use mixed lights and only bake GI/[[Manual#Shadowmask|Shadowmasks]]. Specular remains real-time.&lt;br /&gt;
* Bake in [[Manual#Dominant_Direction|Dominant Direction]] or [[Manual#SH|SH]] mode and use [[Manual#Bakery_shaders|Bakery shaders]] with &amp;quot;Lightmapped specular&amp;quot; option. It will give some specular approximation. Looks good on surfaces with medium/high roughness.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Using a version control system I copied the scene to another PC and it doesn't look right ===&lt;br /&gt;
Make sure you followed [[How_do_I...#How_do_I_use_git.2Fcollab.2Fother_version_control_system_with_Bakery.3F|version control guidelines]].&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Baking same asset in one scene breaks its UVs in another scene ===&lt;br /&gt;
The reason here is [[Manual#Asset_UV_Processing|UV padding adjustment]]. It modifies the UVs in the asset, so spacing between UV charts is optimal, meaning they never leak over each other and there is no much wasted space. Unity has a manual Pack Margin option on model assets, but it’s limited since it applies the same exact value for all meshes inside the model, while each mesh can get drastically different size in the final lightmap based on its surface area. Therefore Bakery overrides it with automatically calculated per-mesh (instead of per-model) padding. However, because “optimal” varies depending on baking resolution, it can be problematic to reuse the same asset in isolated scenes with different lightmap size. There are multiple ways to solve it:&lt;br /&gt;
* a) Just disable UV padding adjustment (set to [[Manual#Asset_UV_Processing|Don't Change]]). Results will be similar to built-in baking.&lt;br /&gt;
* b) Generate your own optimal UVs. UV padding adjustment only applies to models with auto-generated UV layout (aka “Generate Lightmap UVs” checkbox) and never touches custom data.&lt;br /&gt;
* c) Set Asset UV Processing to &amp;quot;Adjust UV padding only for new meshes&amp;quot; (currently available in the [[Github_access|github]] version).&lt;br /&gt;
* d) Use [[Manual#UV_padding:_increase_only|UV padding: increase only]] checkbox and first bake the lowest resolution scene, and then the rest.&lt;br /&gt;
* e) Use two different models for different lightmap resolutions, so each will get the most efficient set of UVs.&lt;br /&gt;
* f) Bake both scenes together.&lt;br /&gt;
* g) Lock UVs using [[How_do_I...#Alternative_solution|Save UV padding to asset]]&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser throws error 505 or Unknown error ===&lt;br /&gt;
[https://www.nvidia.com/Download/index.aspx?lang=en-US Update the driver].&lt;br /&gt;
&lt;br /&gt;
If you are using a Kepler GPU, try switching to [[Manual#Legacy_denoiser|legacy denoiser]].&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get an “Out of memory” error ===&lt;br /&gt;
This means rendering needed more video memory from your GPU than it has available.&lt;br /&gt;
&lt;br /&gt;
First, try closing any other graphics-intensive programs (browsers too).&lt;br /&gt;
&lt;br /&gt;
If the problem persists, the most likely reason is that the resolution you selected is unreasonably high for the given scene. Resolution is defined by [[Manual#Texels_per_unit|Texels per Unit]] (this section also has a list of reference values) or set explicitly in [[Manual#Bakery_Lightmap_Group_Selector|Lightmap Groups]]. Reducing it will help. You can always selectively use high resolution for important objects via [https://docs.unity3d.com/Manual/class-MeshRenderer.html Scale in Lightmap].&lt;br /&gt;
&lt;br /&gt;
If you have terrains in your scene, make sure [[Manual#Terrain_optimization|Terrain optimization]] is enabled.&lt;br /&gt;
&lt;br /&gt;
If you have a very high amount of painted trees on your terrain, try disabling the [[Manual#Export_terrain_trees|Export terrain trees]] option.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a “Can't map texture” error ===&lt;br /&gt;
Typically happens if your system went out of RAM (system memory, not video memory) during the scene export process. Your scene could already be taking too much RAM by itself, not leaving enough free memory for Bakery export.&lt;br /&gt;
&lt;br /&gt;
* Try closing any memory-intensive programs before baking.&lt;br /&gt;
* Try reducing [[Manual#Max_resolution|Max Resolution]] from 4096 to 2048.&lt;br /&gt;
* If you are baking very highly detailed (millions of triangles) geometry, try excluding some of it from the bake.&lt;br /&gt;
* Try disabling [[Manual#Export_terrain_trees|Export terrain trees]].&lt;br /&gt;
* Try enabling [[Manual#Terrain_optimization|Terrain optimization]].&lt;br /&gt;
&lt;br /&gt;
This error can also be shown in case of GPU driver crash, in which case Unity editor also won't render anything.&lt;br /&gt;
&lt;br /&gt;
If this error happens at the end of the render process (from the seamfixer app), try increasing the [[Troubleshooting#I_get_a_.22Launch_timeout.22_error|TDR]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a “Can't create texture” or &amp;quot;Can't create rasterizer state&amp;quot; error ===&lt;br /&gt;
Typically errors like this are caused by such chain of events:&lt;br /&gt;
* Some objects in the scene have incorrect lightmapping UVs. Often the UVs contain many large triangles overlapping each other.&lt;br /&gt;
* Scene uses large lightmaps.&lt;br /&gt;
* Bakery tries to rasterize a huge amount of 4k-sized overlapping triangles to prepare the UV GBuffer.&lt;br /&gt;
* This operation takes &amp;gt; 2 seconds, and the driver is reset by Windows due to TDR: https://docs.microsoft.com/en-us/windows-hardware/drivers/display/timeout-detection-and-recovery&lt;br /&gt;
* Consequent GPU operations are failed due to reset.&lt;br /&gt;
&lt;br /&gt;
Solution:&lt;br /&gt;
* Make sure all your objects either have non-overlapping UV2 or enable &amp;quot;Generate lightmapping UVs&amp;quot; on all model assets.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== After importing Bakery I get errors containing “obsolete” and “UnityUpgradable” ===&lt;br /&gt;
Before importing Bakery, make sure you don't have any compilation errors in your project.&lt;br /&gt;
&lt;br /&gt;
Restart Unity, reimport the package. Click “I made a backup, go ahead” if Unity asks.&lt;br /&gt;
&lt;br /&gt;
See [https://docs.unity3d.com/Manual/APIUpdater.html this page] for more details.&lt;br /&gt;
&lt;br /&gt;
It is also known that some versions of Unity Hub have a [https://forum.unity.com/threads/bakery-gpu-lightmapper-v1-6-released.536008/page-63#post-4668227 bug] preventing API updater from running.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a &amp;quot;Can't load&amp;quot; error ===&lt;br /&gt;
If Bakery says it can't load something, make sure you have enough free disk space on the drive used for [[Manual#Temp_path|temporary data]].&lt;br /&gt;
&lt;br /&gt;
Some parts of Bakery can't deal with non-ASCII characters (this is going to be fixed soon). Try naming your scenes and lightmap group assets with ASCII characters. Latin letters and numbers must always work.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a &amp;quot;Launch timeout&amp;quot; error ===&lt;br /&gt;
This error can happen if your GPU took more time than it is allowed by [https://docs.microsoft.com/en-us/windows-hardware/drivers/display/timeout-detection-and-recovery Windows TDR].&lt;br /&gt;
* Try disabling [[Manual#Terrain_optimization|Terrain Optimization]].&lt;br /&gt;
* Try lowering the value of [[Manual#Tile_size|Tile Size]], especially if it's higher than 512, so baking job is split into smaller chunks.&lt;br /&gt;
* Depending on the pass being processed, try lowering the Samples value (e.g. [[Manual#Samples|GI samples]], [[Manual#Bakery_Sky_Light|Skylight samples]], etc).&lt;br /&gt;
* Reduce geometric complexity of the scene, if tile size/samples don't help.&lt;br /&gt;
* As a last resort, [https://docs.microsoft.com/en-us/windows-hardware/drivers/display/tdr-registry-keys disable TDR registry keys]. This will prevent Windows from resetting the driver, but your computer may appear unresponsive during the bake.&lt;br /&gt;
&lt;br /&gt;
[https://substance3d.adobe.com/documentation/spdoc/gpu-drivers-crash-with-long-computations-tdr-crash-128745489.html Additional instructions for changing the timeout (from Substance)]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I have an Android project, and lightmaps don't look good ===&lt;br /&gt;
[[File:Banding.jpg|Android banding artifacts|thumb]]&lt;br /&gt;
[[File:LightmapsTechnicalDetails.png|Lightmap encoding in player settings|thumb]]&lt;br /&gt;
[[File:Astc.jpg|Build texture compression settings|thumb]]&lt;br /&gt;
Sometimes, when working on Android projects, you may encounter banding artifacts, with gradients having discrete steps of different hue.&lt;br /&gt;
This is caused by texture compression and HDR encoding Unity uses for this platform, which often turns out to be &amp;quot;Double LDR&amp;quot; ([https://docs.unity3d.com/Manual/Lightmaps-TechnicalInformation.html see details]). The problem is not exclusive to Bakery and will as well happen with built-in lightmaps.&lt;br /&gt;
&lt;br /&gt;
In Player Settings, set Lightmap Encoding to '''High Quality'''.&lt;br /&gt;
&lt;br /&gt;
If your target devices support ASTC compression, make sure it is enabled in Build settings. PVRTC is also a good choice, although it is mostly supported on iOS devices. ETC compression gives poor results for lightmaps.&lt;br /&gt;
&lt;br /&gt;
If above solutions are not enough, select lightmap assets and set texture compression quality to '''High''' or '''None''' (try both).&lt;br /&gt;
&lt;br /&gt;
Note that setting it to None will use more video memory on the device.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I have a scene baked with MonoSH, and lighting looks pixelated ===&lt;br /&gt;
[[File:Normalq.jpg|MonoSH compressed with low quality encoding|thumb]]&lt;br /&gt;
In some scenes, [[Manual#MonoSH|MonoSH]] lightmaps can look pixelated, if low (or &amp;quot;normal&amp;quot;) quality compression is used (e.g. DXT1). Usually setting Compression = High on the L1 texture fixes the issue.&lt;br /&gt;
&lt;br /&gt;
You can enable all L1 textures to always use High quality compression by toggling Project Settings -&amp;gt; Bakery -&amp;gt; '''High quality direction'''.&lt;br /&gt;
&lt;br /&gt;
Note that depending on the platform, High quality compression can take more memory. On PC it usually doubles by going from DXT1 to BC7 format.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== There are weird square artifacts on my geometry ===&lt;br /&gt;
[[File:Smoothnormals flatshape.jpg|Square artifacts from incorrect normals|thumb]]&lt;br /&gt;
Weird squares may sometimes be seen on models when their shape is too different from their normals. Bakery [https://ndotl.wordpress.com/#shadowterm tries to compensate] starting ray points to take fake normal smoothness into account, but in extreme cases the algorithm can't handle the discrepancy.&lt;br /&gt;
Usually it's enough to just recalculate normals on the model. E.g. in Unity you can select the FBX and change &amp;quot;Normals&amp;quot; to &amp;quot;Calculate&amp;quot; instead of &amp;quot;Import&amp;quot;.&lt;br /&gt;
Alternatively, you can disable the related compensation algorithm, but it’s actually beneficial in most cases. You can toggle it in Project Settings → Bakery → Generate smooth positions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get too many lightmaps ===&lt;br /&gt;
Possible causes are:&lt;br /&gt;
&lt;br /&gt;
* [[Manual#Atlas_Packer|Atlas packer]] is set to ''Default'' or ''Post-packing'' is disabled. Set Atlas Packer to ''xatlas'' and enable Post-packing for best results.&lt;br /&gt;
&lt;br /&gt;
* ''Texels Per Unit'' value is high or ''Max Resolution'' is low. Bakery packs objects from open scenes into multiple lightmap atlases and packs them as rectangles (in a fashion similar to [https://blackpawn.com/texts/lightmaps/default.html this]; unless Hole Filling is enabled) with their size dependent on (surface area * texels per unit). If some object can't fit into existing atlases, a new one is allocated. New atlases are always as large as the Max Resolution parameter, or smaller (but not smaller than ''Min Resolution''), if the estimated surface area of remaining unpacked objects is below some threshold. You can also increase Min Resolution a bit, replacing a bunch of small (but dense) maps with a few large (but possibly with some empty space).&lt;br /&gt;
&lt;br /&gt;
Additionally, increase ''Min Resolution'' to prefer larger combined lightmaps instead of many smaller ones.&lt;br /&gt;
&lt;br /&gt;
If not using post-packing:&lt;br /&gt;
&lt;br /&gt;
* If you bake multiple open scenes and ''Split by scene'' checkbox is on, different scenes will never share the same lightmap, therefore multiplying their count.&lt;br /&gt;
* If ''Terrain optimization'' is on, terrains will always use a separate lightmap.&lt;br /&gt;
Pre-atlasing your scene in your modelling package of choice and using the [https://geom.io/bakery/wiki/index.php?title=Manual#Bakery_Lightmap_Group_Selector Original UV] mode instead of relying on the auto-atlaser can significantly improve packing effectiveness.&lt;br /&gt;
&lt;br /&gt;
Since v1.71 Bakery prints number of future used lightmaps to console when enabling/refreshing Checker Preview. You can experiment with resolution/density settings until the desired value is printed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get jagged shadows ===&lt;br /&gt;
[[File:Softshadows.png|Jagged shadow mitigation|thumb]]&lt;br /&gt;
Apparently you are baking very sharp shadows at low resolution. Try increasing shadow spread parameter on the light ([[Manual#Bakery_Direct_Light|direct]] or [[Manual#Bakery_Point_Light|point]]) and optionally enable [[Manual#Shader_Tweaks|bicubic interpolation]].&lt;br /&gt;
On a [[Manual#Bakery_Direct_Light|Direct Light]] you can also enable the '''Anti-Alias''' option.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Exporting scene - preparing&amp;quot; is taking too long ===&lt;br /&gt;
(Or &amp;quot;Exporting scene - atlasing&amp;quot;)&lt;br /&gt;
* Try setting [[Manual#Atlas_Packer|Atlas Packer]] to Default.&lt;br /&gt;
* Make sure you use reasonable [[Manual#Texels_per_unit|Texels Per Unit]] value.&lt;br /&gt;
* Make sure your meshes are [[Manual#Quickstart|correctly unwrapped]].&lt;br /&gt;
* Possibly disable [[Manual#Asset_UV_Processing|UV Padding Adjustment]].&lt;br /&gt;
&lt;br /&gt;
If you're converting a large existing scene, make sure to follow [[How_do_I...#How_do_I_quickly_port_my_existing_scene_to_Bakery.3F|this guide]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Stuck at &amp;quot;Waiting for Unity to initialize the probes...&amp;quot; ===&lt;br /&gt;
There isn't much Bakery can do about the logic of Unity lighting data asset generation (there is no API in the engine to control it at the moment). Try to focus editor window (especially scene view) to wake Unity up.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Baked prefabs instantiated at runtime in a build have no lightmaps ===&lt;br /&gt;
Because Unity technically has no support for prefabs having lightmaps, it can omit lightmapped shader versions from builds, not realizing they are needed. You can fix it by going to [https://docs.unity3d.com/Manual/class-GraphicsSettings.html?_ga=2.212464724.1917527976.1586930444-1257434621.1522062178#stripping Shader stripping settings] and enabling lightmap modes you use.&lt;br /&gt;
Additionally, try disabling '''Optimize Mesh Data''' in Player Settings, as Unity may omit UV from the build.&lt;br /&gt;
&lt;br /&gt;
{{note|In Shader Stripping settings &amp;quot;Directional&amp;quot; mode only applies to standard Unity directional maps aka [[Manual#Dominant_Direction|Dominant Direction]]. When using Baked Normal Maps, RNM or SH, use &amp;quot;Non-directional&amp;quot; lightmap mode checkboxes.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Speedtrees look fine in the editor, but black in builds ===&lt;br /&gt;
Also related to shader stripping. See the [[Troubleshooting#Baked_prefabs_instantiated_at_runtime_in_a_build_have_no_lightmaps|prefab solution]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Scene is black in build ===&lt;br /&gt;
See advice above. Additionally, if the scene is loaded asynchronously, call ftLightmaps.RefreshFull() when it is fully loaded.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== HDRI produces scattered bright spots (fireflies) ===&lt;br /&gt;
[[File:Fireflies.jpg|thumb|Typical &amp;quot;fireflies&amp;quot;]]&lt;br /&gt;
[[File:Upload 2019-7-3 11-27-22.png|thumb|Removing sun from HDRI]]&lt;br /&gt;
This artefact comes from the fact your HDRI has very bright, yet very small parts, typically sun. Rays will miss it often, producing occasional spots when they don't. This problem is well known in many offline ray tracers as well.&lt;br /&gt;
* Use [[Manual#Bakery_Direct_Light|Direct Light]] for the sun&lt;br /&gt;
* Remove sun from HDRI (also [https://seblagarde.wordpress.com/2016/08/28/siggraph-2016-an-artist-friendly-workflow-for-panoramic-hdri/ recommended by Unity])&lt;br /&gt;
* Possibly downsample/blur the HDRI&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Small emissive (or brightly lit) surfaces produce noise ===&lt;br /&gt;
The issue is similar to the one above and may happen when using very small and very bright emissive surfaces, or small non-emissive surfaces lit by a very intense light. In case of emissive surfaces, you can replace them with [[Manual#Bakery_Light_Mesh|Light Meshes]] to prevent it. See [[Manual#Differences_between_Light_Mesh_and_emissive_materials|Differences between Light Mesh and emissive materials]]. Alternatively, try increasing [[Manual#Samples|GI sample count]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Adjusting UV padding&amp;quot; happens too often and takes too much time ===&lt;br /&gt;
[[Manual#Asset_UV_Processing|UV padding adjustment]] is a feature that optimizes asset UVs based on the size they take in lightmaps. This process will happen for a model if:&lt;br /&gt;
* Option is globally enabled.&lt;br /&gt;
* Asset has &amp;quot;Generate Lightmap UVs&amp;quot; checkbox enabled. Models with custom UVs are not adjusted.&lt;br /&gt;
* Model was not adjusted before or...&lt;br /&gt;
* ... its lightmap size has changed.&lt;br /&gt;
Therefore it can be triggered for all auto-unwrapped models after their geometry or resolution changes.&lt;br /&gt;
UV padding adjustment will try to waste less lightmap resolution and reduce texel leaking, but it is not necessary. If you are doing many experimental/draft bakes, you may consider disabling it (set to &amp;quot;Don't change&amp;quot;), then possibly enabling it back for the final quality bake.&lt;br /&gt;
&lt;br /&gt;
Also note that using xatlas as [[Manual#Unwrapper|Unwrapper]] can be notoriously slower comparing to Default.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser produces bright edges around geometry/shadows ===&lt;br /&gt;
[[File:Bredges.jpg|thumb|Bright edges]]&lt;br /&gt;
Sometimes you may encounter bright edges or spots at high contrast edges caused by the denoising neural net, most notably OptiX 6 and 7.&lt;br /&gt;
* Use OptiX 5 or OpenImageDenoise if you can ([[Manual#Denoiser|denoiser]] option).&lt;br /&gt;
* Try enabling [[Manual#Denoise:_fix_bright_edges|Denoise: Fix bright edges]].&lt;br /&gt;
* Try setting texture compression to None on lightmap assets.&lt;br /&gt;
* Try setting [[Manual#Backface_GI|Backface GI]] to 1, removing dark shadows inside objects. While these shadows are normally not visible, their edges may cause problems for both the denoiser and texture compression.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Light probes are too bright in Subtractive mode ===&lt;br /&gt;
&lt;br /&gt;
[[File:98911466-ae8c5b00-24d5-11eb-8d51-4e764ac0f163.png|thumb|The effect of occlusion probes]]&lt;br /&gt;
&lt;br /&gt;
Light occlusion information is not baked into probes. Solution:&lt;br /&gt;
* Set your Unity directional light to Mixed mode.&lt;br /&gt;
* Enable [[Manual#Occlusion_probes|Occlusion Probes]].&lt;br /&gt;
* Bake&lt;br /&gt;
&lt;br /&gt;
Some versions of Unity may need a scene reload to properly apply the Lighting Data Asset.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Baking produces &amp;quot;Not allowed to access uv2&amp;quot; errors ===&lt;br /&gt;
All lightmapped models must have [https://docs.unity3d.com/Manual/FBXImporter-Model.html Read/Write enabled] on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Whole scene is very bright or black ===&lt;br /&gt;
* Check if your light intensities are in a reasonable range (&amp;lt; 100; or &amp;lt;= 100000 Lux in HDRP).&lt;br /&gt;
* Check the same for indirect intensity on all lights. A multiplication of direct and intensity intensity must not go into thousands, otherwise GI algorithm may overflow.&lt;br /&gt;
* Check if you don't use assets with High mesh compression. When set to High, Unity mesh compression will completely destroy lightmap UVs, only leaving 8 bits for them. This may produce many lightmapping errors including this one.&lt;br /&gt;
* Check if you have any .hdr overrides in the Preset Manager that change the way lightmaps are imported.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery says &amp;quot;Device is not DX11&amp;quot; ===&lt;br /&gt;
Currently Bakery needs Unity editor to be running in DX11 mode to directly exchange texture data, so make sure your editor's window header says &amp;quot;&amp;lt;DX11&amp;gt;&amp;quot;. If it does not, change active graphics API to DX11: &lt;br /&gt;
* Go to Player Settings.&lt;br /&gt;
* If &amp;quot;Auto Graphics API for Windows&amp;quot; is unchecked, you will see a list of APIs.&lt;br /&gt;
* Make sure &amp;quot;Direct3D11&amp;quot; is on top or place it there.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery doesn't work on my 3070/3080/3090 GPU? ===&lt;br /&gt;
1. Please enable [[Manual#RTX_Mode|RTX mode]].&lt;br /&gt;
&lt;br /&gt;
2. If denoiser also fails, please update from [[Github_access|github]] and use OpenImageDenoise option (some instructions are [[Troubleshooting#Denoiser_produces_bright_edges_around_geometry.2Fshadows|here]]).&lt;br /&gt;
&lt;br /&gt;
Updated denoiser (both new OptiX version and OpenImageDenoise) as well as automatic hardware detection will be soon released on the Asset Store.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser produces grid-like patterns ===&lt;br /&gt;
[[File:Gridlike.jpg|thumb|Grid-like denoiser pattern]]&lt;br /&gt;
&lt;br /&gt;
OptiX denoiser might produdce grid-like patterns when fed with very low-precision lightmaps. Low precision is usually caused by either extremely dark or extremely bright lighting. It is recommended to stay within reasonable intensity range (see a similar advice for [[Troubleshooting#Lightmaps_look_black_or_have_bad_quality_in_an_HDRP_scene|HDRP]] above).&lt;br /&gt;
&lt;br /&gt;
* Alternatively use OpenImageDenoise, as it does not produce this pattern.&lt;br /&gt;
&lt;br /&gt;
* This issue also does not affect OptiX 5.1 denoiser (&amp;quot;Legacy denoiser&amp;quot;) as its training dataset is in its own DLL, but affects the non-legacy version (OptiX 6.0) and only on driver versions newer than 442.50, as the training datasets are in the driver ([https://forums.developer.nvidia.com/t/optix7-denoiser-different-results-with-different-version-of-drivers/117989/2 explanation from NVIDIA]).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get &amp;quot;rtcRes == RTC_SUCCESS&amp;quot; error ===&lt;br /&gt;
&lt;br /&gt;
You are using a 3xxx+ GPU with RTX mode disabled. Enable [[Manual#RTX_Mode|RTX mode]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Baking any scene crashes with unknown error ===&lt;br /&gt;
&lt;br /&gt;
There were [https://twitter.com/HarryAlisavakis/status/1331630028665348096 some reports] that Avast antivirus can block Bakery from running, even though Bakery's executables don't trigger any antivirus (including Avast) when [https://twitter.com/guycalledfrank/status/1331640614077796354 scanned via VirusTotal]. Perhaps it just block any executables that were launched 'indirectly', i.e. from another application. In any case, if you have Avast, try adding your project folder to exception list.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Combined meshes (e.g. using Mesh Combine asset) bake incorrectly ===&lt;br /&gt;
&lt;br /&gt;
[[File:Meshcombine.jpg|thumb|Mesh Combine &amp;quot;Regenerate Lightmap UVs&amp;quot; option]]&lt;br /&gt;
&lt;br /&gt;
Most mesh combining assets have an option to regenerate lightmap UVs. Without it, combined UVs will overlap each other. If you are using Mesh Combine, make sure &amp;quot;Regenerate Lightmap UVs&amp;quot; option is enabled in output settings.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a &amp;quot;Can't create vertex buffer&amp;quot; error ===&lt;br /&gt;
&lt;br /&gt;
This error can happen if the scene has more than ~40 million vertices. It is recommended to reduce geometric complexity of the scene, as tracing it would be too slow anyway. The typical cause of going over this limit is trying to bake with large arrays of trees painted on the terrain. In this case try disabling [[Manual#Export_terrain_trees|Export Terrain Trees]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Soft shadows appear like multiple hard shadows ===&lt;br /&gt;
&lt;br /&gt;
[[File:Unknown.png|thumb|Undersampled shadow]]&lt;br /&gt;
&lt;br /&gt;
Increase ''Shadow Samples'' on the light or decrease the ''Shadow Spread''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Lightmaps are black on GTX 650 ===&lt;br /&gt;
&lt;br /&gt;
Apparently newer Nvidia drivers deprecate some CUDA functions on older hardware. It is recommended to use driver version 442 on GTX 650, as it still supported everything Bakery uses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Lightmaps disappear on play ===&lt;br /&gt;
&lt;br /&gt;
* Make sure that '''Project Settings''' -&amp;gt; '''Editor''' -&amp;gt; '''Enter Play Mode Settings''' -&amp;gt; '''Reload Scene''' is turned '''on'''.&lt;br /&gt;
* If that doesn't help, try applying the latest [[Github_access|patch]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a DllNotFoundException ===&lt;br /&gt;
&lt;br /&gt;
* Check if the DLL file mentioned in the error actually exists in your project. If it doesn't, your Bakery installation is incomplete or corrupted; please reinstall it.&lt;br /&gt;
* Check if you're running 64-bit Unity Editor under 64-bit Windows (7 or newer) (as listed in [[Manual#System_requirements|system requirements]]).&lt;br /&gt;
* Make sure you have 64-bit [https://www.microsoft.com/en-us/download/details.aspx?id=48145 Visual C++ Redistributables for Visual Studio 2015] installed. In case if the Microsoft site download is broken, here is a [https://drive.google.com/file/d/1WfRP1A43bCwZflZ_I0wHSGPyC3b-0lqK/view?usp=sharing reupload].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Lightmap UVs are wrong when opening previously baked project on a Mac ===&lt;br /&gt;
&lt;br /&gt;
When Unity reimports model assets, it performs UV unwrapping. If you baked the scene with [[Manual#Unwrapper|Unwrapper]] was set to xatlas, it won't work on a Mac because Bakery's xatlas wrapper library is only compiled for Windows. Rebaking with Default unwrapper should fix it.&lt;br /&gt;
&lt;br /&gt;
You can still keep xatlas as the [[Manual#Atlas_Packer|Atlas Packer]].&lt;br /&gt;
&lt;br /&gt;
''Unwrapper'' is used to generate UVs for individual, isolated meshes, while ''Atlas Packer'' packs big scene-specific atlases out of many unwrapped layouts.&lt;br /&gt;
&lt;br /&gt;
Combining Default unwrapper with xatlas being used as the Atlas Packer and enabling [[Manual#Hole_filling|Hole Filling]] should give pretty good [https://x.com/guycalledfrank/status/1231890428313600000 results] and compensate for any individual mesh unwrapping inefficiencies.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Error message &amp;quot;Failed to load OptiX library&amp;quot; ===&lt;br /&gt;
&lt;br /&gt;
(Aka &amp;quot;Both RTX and non-RTX lightmapper failed to run&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Nvidia driver 590 (and newer) removed support for OptiX 6.0 which Bakery depended on. Bakery v1.98 added support for the new driver, now using OptiX 9.0.&lt;br /&gt;
* Make sure you're using a [[Manual#System_requirements|supported Nvidia GPU]].&lt;br /&gt;
* Update Bakery to v1.98 via the [https://assetstore.unity.com/packages/tools/level-design/bakery-gpu-lightmapper-122218 Asset Store], [[Github_access|github or the built-in patcher]].&lt;br /&gt;
* If you still get the error every time, click '''Bakery -&amp;gt; Utilities -&amp;gt; Detect Optimal Settings''' and choose &amp;quot;Set recommended as default&amp;quot;.&lt;br /&gt;
* If you don't want to update Bakery, roll back your GPU driver to any pre-590 version (e.g. [https://www.nvidia.com/en-eu/geforce/drivers/results/257569/ 581.80]).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Point Light with a cookie/cubemap is black ===&lt;br /&gt;
Note that Bakery supports colored cookies and reads RGB from cookie/cubemap textures. Unity, on the other hand, only supports grayscale cookies. Setting Texture Type to &amp;quot;Cookie&amp;quot; on the asset will convert it to a single-channel A8 format. For Bakery, leave Texture Type to Default.&lt;/div&gt;</summary>
		<author><name>Mr F</name></author>
		
	</entry>
	<entry>
		<id>https://geom.io/bakery/wiki/index.php?title=Troubleshooting&amp;diff=1868</id>
		<title>Troubleshooting</title>
		<link rel="alternate" type="text/html" href="https://geom.io/bakery/wiki/index.php?title=Troubleshooting&amp;diff=1868"/>
		<updated>2026-04-08T10:00:17Z</updated>

		<summary type="html">&lt;p&gt;Mr F: /* Error message &amp;quot;Failed to load OptiX library&amp;quot; */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a list of common problems, their symptoms and solutions.&lt;br /&gt;
&lt;br /&gt;
=== Shadowmasks are not baked ===&lt;br /&gt;
Check following things:&lt;br /&gt;
* Bakery's [[Manual#Render Mode|Render Mode]] is set to Shadowmask.&lt;br /&gt;
* Masked lights have both Unity and Bakery light components on them.&lt;br /&gt;
* Masked Bakery light components have &amp;quot;Baked contribution&amp;quot; set to &amp;quot;Indirect and shadowmask&amp;quot;.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Shadowmasks are baked, but Unity renders real-time shadows instead ===&lt;br /&gt;
You're in Distance Shadowmask mode, it's expected. Read more about the difference:&lt;br /&gt;
&lt;br /&gt;
https://docs.unity3d.com/Manual/LightMode-Mixed-Shadowmask.html&lt;br /&gt;
&lt;br /&gt;
https://docs.unity3d.com/Manual/LightMode-Mixed-DistanceShadowmask.html&lt;br /&gt;
&lt;br /&gt;
* To switch between two modes, you can use &amp;quot;Distance Shadowmask&amp;quot; checkbox in Bakery main window.&lt;br /&gt;
* If you're on 5.6, go to Window-&amp;gt;Lighting-&amp;gt;Mixed Lighting-&amp;gt;Lighting Mode to switch the mode.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I can't see specular lighting after the bake ===&lt;br /&gt;
Apparently specular lighting was provided by real-time lights before the bake. Now the lighting is baked into static textures and there is no specular. However, you can:&lt;br /&gt;
* Use Reflection Probes. Good option for highly glossy objects.&lt;br /&gt;
* Use mixed lights and only bake GI/[[Manual#Shadowmask|Shadowmasks]]. Specular remains real-time.&lt;br /&gt;
* Bake in [[Manual#Dominant_Direction|Dominant Direction]] or [[Manual#SH|SH]] mode and use [[Manual#Bakery_shaders|Bakery shaders]] with &amp;quot;Lightmapped specular&amp;quot; option. It will give some specular approximation. Looks good on surfaces with medium/high roughness.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Using a version control system I copied the scene to another PC and it doesn't look right ===&lt;br /&gt;
Make sure you followed [[How_do_I...#How_do_I_use_git.2Fcollab.2Fother_version_control_system_with_Bakery.3F|version control guidelines]].&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Baking same asset in one scene breaks its UVs in another scene ===&lt;br /&gt;
The reason here is [[Manual#Asset_UV_Processing|UV padding adjustment]]. It modifies the UVs in the asset, so spacing between UV charts is optimal, meaning they never leak over each other and there is no much wasted space. Unity has a manual Pack Margin option on model assets, but it’s limited since it applies the same exact value for all meshes inside the model, while each mesh can get drastically different size in the final lightmap based on its surface area. Therefore Bakery overrides it with automatically calculated per-mesh (instead of per-model) padding. However, because “optimal” varies depending on baking resolution, it can be problematic to reuse the same asset in isolated scenes with different lightmap size. There are multiple ways to solve it:&lt;br /&gt;
* a) Just disable UV padding adjustment (set to [[Manual#Asset_UV_Processing|Don't Change]]). Results will be similar to built-in baking.&lt;br /&gt;
* b) Generate your own optimal UVs. UV padding adjustment only applies to models with auto-generated UV layout (aka “Generate Lightmap UVs” checkbox) and never touches custom data.&lt;br /&gt;
* c) Set Asset UV Processing to &amp;quot;Adjust UV padding only for new meshes&amp;quot; (currently available in the [[Github_access|github]] version).&lt;br /&gt;
* d) Use [[Manual#UV_padding:_increase_only|UV padding: increase only]] checkbox and first bake the lowest resolution scene, and then the rest.&lt;br /&gt;
* e) Use two different models for different lightmap resolutions, so each will get the most efficient set of UVs.&lt;br /&gt;
* f) Bake both scenes together.&lt;br /&gt;
* g) Lock UVs using [[How_do_I...#Alternative_solution|Save UV padding to asset]]&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser throws error 505 or Unknown error ===&lt;br /&gt;
[https://www.nvidia.com/Download/index.aspx?lang=en-US Update the driver].&lt;br /&gt;
&lt;br /&gt;
If you are using a Kepler GPU, try switching to [[Manual#Legacy_denoiser|legacy denoiser]].&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get an “Out of memory” error ===&lt;br /&gt;
This means rendering needed more video memory from your GPU than it has available.&lt;br /&gt;
&lt;br /&gt;
First, try closing any other graphics-intensive programs (browsers too).&lt;br /&gt;
&lt;br /&gt;
If the problem persists, the most likely reason is that the resolution you selected is unreasonably high for the given scene. Resolution is defined by [[Manual#Texels_per_unit|Texels per Unit]] (this section also has a list of reference values) or set explicitly in [[Manual#Bakery_Lightmap_Group_Selector|Lightmap Groups]]. Reducing it will help. You can always selectively use high resolution for important objects via [https://docs.unity3d.com/Manual/class-MeshRenderer.html Scale in Lightmap].&lt;br /&gt;
&lt;br /&gt;
If you have terrains in your scene, make sure [[Manual#Terrain_optimization|Terrain optimization]] is enabled.&lt;br /&gt;
&lt;br /&gt;
If you have a very high amount of painted trees on your terrain, try disabling the [[Manual#Export_terrain_trees|Export terrain trees]] option.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a “Can't map texture” error ===&lt;br /&gt;
Typically happens if your system went out of RAM (system memory, not video memory) during the scene export process. Your scene could already be taking too much RAM by itself, not leaving enough free memory for Bakery export.&lt;br /&gt;
&lt;br /&gt;
* Try closing any memory-intensive programs before baking.&lt;br /&gt;
* Try reducing [[Manual#Max_resolution|Max Resolution]] from 4096 to 2048.&lt;br /&gt;
* If you are baking very highly detailed (millions of triangles) geometry, try excluding some of it from the bake.&lt;br /&gt;
* Try disabling [[Manual#Export_terrain_trees|Export terrain trees]].&lt;br /&gt;
* Try enabling [[Manual#Terrain_optimization|Terrain optimization]].&lt;br /&gt;
&lt;br /&gt;
This error can also be shown in case of GPU driver crash, in which case Unity editor also won't render anything.&lt;br /&gt;
&lt;br /&gt;
If this error happens at the end of the render process (from the seamfixer app), try increasing the [[Troubleshooting#I_get_a_.22Launch_timeout.22_error|TDR]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a “Can't create texture” or &amp;quot;Can't create rasterizer state&amp;quot; error ===&lt;br /&gt;
Typically errors like this are caused by such chain of events:&lt;br /&gt;
* Some objects in the scene have incorrect lightmapping UVs. Often the UVs contain many large triangles overlapping each other.&lt;br /&gt;
* Scene uses large lightmaps.&lt;br /&gt;
* Bakery tries to rasterize a huge amount of 4k-sized overlapping triangles to prepare the UV GBuffer.&lt;br /&gt;
* This operation takes &amp;gt; 2 seconds, and the driver is reset by Windows due to TDR: https://docs.microsoft.com/en-us/windows-hardware/drivers/display/timeout-detection-and-recovery&lt;br /&gt;
* Consequent GPU operations are failed due to reset.&lt;br /&gt;
&lt;br /&gt;
Solution:&lt;br /&gt;
* Make sure all your objects either have non-overlapping UV2 or enable &amp;quot;Generate lightmapping UVs&amp;quot; on all model assets.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== After importing Bakery I get errors containing “obsolete” and “UnityUpgradable” ===&lt;br /&gt;
Before importing Bakery, make sure you don't have any compilation errors in your project.&lt;br /&gt;
&lt;br /&gt;
Restart Unity, reimport the package. Click “I made a backup, go ahead” if Unity asks.&lt;br /&gt;
&lt;br /&gt;
See [https://docs.unity3d.com/Manual/APIUpdater.html this page] for more details.&lt;br /&gt;
&lt;br /&gt;
It is also known that some versions of Unity Hub have a [https://forum.unity.com/threads/bakery-gpu-lightmapper-v1-6-released.536008/page-63#post-4668227 bug] preventing API updater from running.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a &amp;quot;Can't load&amp;quot; error ===&lt;br /&gt;
If Bakery says it can't load something, make sure you have enough free disk space on the drive used for [[Manual#Temp_path|temporary data]].&lt;br /&gt;
&lt;br /&gt;
Some parts of Bakery can't deal with non-ASCII characters (this is going to be fixed soon). Try naming your scenes and lightmap group assets with ASCII characters. Latin letters and numbers must always work.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a &amp;quot;Launch timeout&amp;quot; error ===&lt;br /&gt;
This error can happen if your GPU took more time than it is allowed by [https://docs.microsoft.com/en-us/windows-hardware/drivers/display/timeout-detection-and-recovery Windows TDR].&lt;br /&gt;
* Try disabling [[Manual#Terrain_optimization|Terrain Optimization]].&lt;br /&gt;
* Try lowering the value of [[Manual#Tile_size|Tile Size]], especially if it's higher than 512, so baking job is split into smaller chunks.&lt;br /&gt;
* Depending on the pass being processed, try lowering the Samples value (e.g. [[Manual#Samples|GI samples]], [[Manual#Bakery_Sky_Light|Skylight samples]], etc).&lt;br /&gt;
* Reduce geometric complexity of the scene, if tile size/samples don't help.&lt;br /&gt;
* As a last resort, [https://docs.microsoft.com/en-us/windows-hardware/drivers/display/tdr-registry-keys disable TDR registry keys]. This will prevent Windows from resetting the driver, but your computer may appear unresponsive during the bake.&lt;br /&gt;
&lt;br /&gt;
[https://substance3d.adobe.com/documentation/spdoc/gpu-drivers-crash-with-long-computations-tdr-crash-128745489.html Additional instructions for changing the timeout (from Substance)]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I have an Android project, and lightmaps don't look good ===&lt;br /&gt;
[[File:Banding.jpg|Android banding artifacts|thumb]]&lt;br /&gt;
[[File:LightmapsTechnicalDetails.png|Lightmap encoding in player settings|thumb]]&lt;br /&gt;
[[File:Astc.jpg|Build texture compression settings|thumb]]&lt;br /&gt;
Sometimes, when working on Android projects, you may encounter banding artifacts, with gradients having discrete steps of different hue.&lt;br /&gt;
This is caused by texture compression and HDR encoding Unity uses for this platform, which often turns out to be &amp;quot;Double LDR&amp;quot; ([https://docs.unity3d.com/Manual/Lightmaps-TechnicalInformation.html see details]). The problem is not exclusive to Bakery and will as well happen with built-in lightmaps.&lt;br /&gt;
&lt;br /&gt;
In Player Settings, set Lightmap Encoding to '''High Quality'''.&lt;br /&gt;
&lt;br /&gt;
If your target devices support ASTC compression, make sure it is enabled in Build settings. PVRTC is also a good choice, although it is mostly supported on iOS devices. ETC compression gives poor results for lightmaps.&lt;br /&gt;
&lt;br /&gt;
If above solutions are not enough, select lightmap assets and set texture compression quality to '''High''' or '''None''' (try both).&lt;br /&gt;
&lt;br /&gt;
Note that setting it to None will use more video memory on the device.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I have a scene baked with MonoSH, and lighting looks pixelated ===&lt;br /&gt;
[[File:Normalq.jpg|MonoSH compressed with low quality encoding|thumb]]&lt;br /&gt;
In some scenes, [[Manual#MonoSH|MonoSH]] lightmaps can look pixelated, if low (or &amp;quot;normal&amp;quot;) quality compression is used (e.g. DXT1). Usually setting Compression = High on the L1 texture fixes the issue.&lt;br /&gt;
&lt;br /&gt;
You can enable all L1 textures to always use High quality compression by toggling Project Settings -&amp;gt; Bakery -&amp;gt; '''High quality direction'''.&lt;br /&gt;
&lt;br /&gt;
Note that depending on the platform, High quality compression can take more memory. On PC it usually doubles by going from DXT1 to BC7 format.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== There are weird square artifacts on my geometry ===&lt;br /&gt;
[[File:Smoothnormals flatshape.jpg|Square artifacts from incorrect normals|thumb]]&lt;br /&gt;
Weird squares may sometimes be seen on models when their shape is too different from their normals. Bakery [https://ndotl.wordpress.com/#shadowterm tries to compensate] starting ray points to take fake normal smoothness into account, but in extreme cases the algorithm can't handle the discrepancy.&lt;br /&gt;
Usually it's enough to just recalculate normals on the model. E.g. in Unity you can select the FBX and change &amp;quot;Normals&amp;quot; to &amp;quot;Calculate&amp;quot; instead of &amp;quot;Import&amp;quot;.&lt;br /&gt;
Alternatively, you can disable the related compensation algorithm, but it’s actually beneficial in most cases. You can toggle it in Project Settings → Bakery → Generate smooth positions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get too many lightmaps ===&lt;br /&gt;
Possible causes are:&lt;br /&gt;
&lt;br /&gt;
* [[Manual#Atlas_Packer|Atlas packer]] is set to ''Default'' or ''Post-packing'' is disabled. Set Atlas Packer to ''xatlas'' and enable Post-packing for best results.&lt;br /&gt;
&lt;br /&gt;
* ''Texels Per Unit'' value is high or ''Max Resolution'' is low. Bakery packs objects from open scenes into multiple lightmap atlases and packs them as rectangles (in a fashion similar to [https://blackpawn.com/texts/lightmaps/default.html this]; unless Hole Filling is enabled) with their size dependent on (surface area * texels per unit). If some object can't fit into existing atlases, a new one is allocated. New atlases are always as large as the Max Resolution parameter, or smaller (but not smaller than ''Min Resolution''), if the estimated surface area of remaining unpacked objects is below some threshold. You can also increase Min Resolution a bit, replacing a bunch of small (but dense) maps with a few large (but possibly with some empty space).&lt;br /&gt;
&lt;br /&gt;
Additionally, increase ''Min Resolution'' to prefer larger combined lightmaps instead of many smaller ones.&lt;br /&gt;
&lt;br /&gt;
If not using post-packing:&lt;br /&gt;
&lt;br /&gt;
* If you bake multiple open scenes and ''Split by scene'' checkbox is on, different scenes will never share the same lightmap, therefore multiplying their count.&lt;br /&gt;
* If ''Terrain optimization'' is on, terrains will always use a separate lightmap.&lt;br /&gt;
Pre-atlasing your scene in your modelling package of choice and using the [https://geom.io/bakery/wiki/index.php?title=Manual#Bakery_Lightmap_Group_Selector Original UV] mode instead of relying on the auto-atlaser can significantly improve packing effectiveness.&lt;br /&gt;
&lt;br /&gt;
Since v1.71 Bakery prints number of future used lightmaps to console when enabling/refreshing Checker Preview. You can experiment with resolution/density settings until the desired value is printed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get jagged shadows ===&lt;br /&gt;
[[File:Softshadows.png|Jagged shadow mitigation|thumb]]&lt;br /&gt;
Apparently you are baking very sharp shadows at low resolution. Try increasing shadow spread parameter on the light ([[Manual#Bakery_Direct_Light|direct]] or [[Manual#Bakery_Point_Light|point]]) and optionally enable [[Manual#Shader_Tweaks|bicubic interpolation]].&lt;br /&gt;
On a [[Manual#Bakery_Direct_Light|Direct Light]] you can also enable the '''Anti-Alias''' option.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Exporting scene - preparing&amp;quot; is taking too long ===&lt;br /&gt;
(Or &amp;quot;Exporting scene - atlasing&amp;quot;)&lt;br /&gt;
* Try setting [[Manual#Atlas_Packer|Atlas Packer]] to Default.&lt;br /&gt;
* Make sure you use reasonable [[Manual#Texels_per_unit|Texels Per Unit]] value.&lt;br /&gt;
* Make sure your meshes are [[Manual#Quickstart|correctly unwrapped]].&lt;br /&gt;
* Possibly disable [[Manual#Asset_UV_Processing|UV Padding Adjustment]].&lt;br /&gt;
&lt;br /&gt;
If you're converting a large existing scene, make sure to follow [[How_do_I...#How_do_I_quickly_port_my_existing_scene_to_Bakery.3F|this guide]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Stuck at &amp;quot;Waiting for Unity to initialize the probes...&amp;quot; ===&lt;br /&gt;
There isn't much Bakery can do about the logic of Unity lighting data asset generation (there is no API in the engine to control it at the moment). Try to focus editor window (especially scene view) to wake Unity up.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Baked prefabs instantiated at runtime in a build have no lightmaps ===&lt;br /&gt;
Because Unity technically has no support for prefabs having lightmaps, it can omit lightmapped shader versions from builds, not realizing they are needed. You can fix it by going to [https://docs.unity3d.com/Manual/class-GraphicsSettings.html?_ga=2.212464724.1917527976.1586930444-1257434621.1522062178#stripping Shader stripping settings] and enabling lightmap modes you use.&lt;br /&gt;
Additionally, try disabling '''Optimize Mesh Data''' in Player Settings, as Unity may omit UV from the build.&lt;br /&gt;
&lt;br /&gt;
{{note|In Shader Stripping settings &amp;quot;Directional&amp;quot; mode only applies to standard Unity directional maps aka [[Manual#Dominant_Direction|Dominant Direction]]. When using Baked Normal Maps, RNM or SH, use &amp;quot;Non-directional&amp;quot; lightmap mode checkboxes.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Speedtrees look fine in the editor, but black in builds ===&lt;br /&gt;
Also related to shader stripping. See the [[Troubleshooting#Baked_prefabs_instantiated_at_runtime_in_a_build_have_no_lightmaps|prefab solution]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Scene is black in build ===&lt;br /&gt;
See advice above. Additionally, if the scene is loaded asynchronously, call ftLightmaps.RefreshFull() when it is fully loaded.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== HDRI produces scattered bright spots (fireflies) ===&lt;br /&gt;
[[File:Fireflies.jpg|thumb|Typical &amp;quot;fireflies&amp;quot;]]&lt;br /&gt;
[[File:Upload 2019-7-3 11-27-22.png|thumb|Removing sun from HDRI]]&lt;br /&gt;
This artefact comes from the fact your HDRI has very bright, yet very small parts, typically sun. Rays will miss it often, producing occasional spots when they don't. This problem is well known in many offline ray tracers as well.&lt;br /&gt;
* Use [[Manual#Bakery_Direct_Light|Direct Light]] for the sun&lt;br /&gt;
* Remove sun from HDRI (also [https://seblagarde.wordpress.com/2016/08/28/siggraph-2016-an-artist-friendly-workflow-for-panoramic-hdri/ recommended by Unity])&lt;br /&gt;
* Possibly downsample/blur the HDRI&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Small emissive (or brightly lit) surfaces produce noise ===&lt;br /&gt;
The issue is similar to the one above and may happen when using very small and very bright emissive surfaces, or small non-emissive surfaces lit by a very intense light. In case of emissive surfaces, you can replace them with [[Manual#Bakery_Light_Mesh|Light Meshes]] to prevent it. See [[Manual#Differences_between_Light_Mesh_and_emissive_materials|Differences between Light Mesh and emissive materials]]. Alternatively, try increasing [[Manual#Samples|GI sample count]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Adjusting UV padding&amp;quot; happens too often and takes too much time ===&lt;br /&gt;
[[Manual#Asset_UV_Processing|UV padding adjustment]] is a feature that optimizes asset UVs based on the size they take in lightmaps. This process will happen for a model if:&lt;br /&gt;
* Option is globally enabled.&lt;br /&gt;
* Asset has &amp;quot;Generate Lightmap UVs&amp;quot; checkbox enabled. Models with custom UVs are not adjusted.&lt;br /&gt;
* Model was not adjusted before or...&lt;br /&gt;
* ... its lightmap size has changed.&lt;br /&gt;
Therefore it can be triggered for all auto-unwrapped models after their geometry or resolution changes.&lt;br /&gt;
UV padding adjustment will try to waste less lightmap resolution and reduce texel leaking, but it is not necessary. If you are doing many experimental/draft bakes, you may consider disabling it (set to &amp;quot;Don't change&amp;quot;), then possibly enabling it back for the final quality bake.&lt;br /&gt;
&lt;br /&gt;
Also note that using xatlas as [[Manual#Unwrapper|Unwrapper]] can be notoriously slower comparing to Default.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser produces bright edges around geometry/shadows ===&lt;br /&gt;
[[File:Bredges.jpg|thumb|Bright edges]]&lt;br /&gt;
Sometimes you may encounter bright edges or spots at high contrast edges caused by the denoising neural net, most notably OptiX 6 and 7.&lt;br /&gt;
* Use OptiX 5 or OpenImageDenoise if you can ([[Manual#Denoiser|denoiser]] option).&lt;br /&gt;
* Try enabling [[Manual#Denoise:_fix_bright_edges|Denoise: Fix bright edges]].&lt;br /&gt;
* Try setting texture compression to None on lightmap assets.&lt;br /&gt;
* Try setting [[Manual#Backface_GI|Backface GI]] to 1, removing dark shadows inside objects. While these shadows are normally not visible, their edges may cause problems for both the denoiser and texture compression.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Light probes are too bright in Subtractive mode ===&lt;br /&gt;
&lt;br /&gt;
[[File:98911466-ae8c5b00-24d5-11eb-8d51-4e764ac0f163.png|thumb|The effect of occlusion probes]]&lt;br /&gt;
&lt;br /&gt;
Light occlusion information is not baked into probes. Solution:&lt;br /&gt;
* Set your Unity directional light to Mixed mode.&lt;br /&gt;
* Enable [[Manual#Occlusion_probes|Occlusion Probes]].&lt;br /&gt;
* Bake&lt;br /&gt;
&lt;br /&gt;
Some versions of Unity may need a scene reload to properly apply the Lighting Data Asset.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Baking produces &amp;quot;Not allowed to access uv2&amp;quot; errors ===&lt;br /&gt;
All lightmapped models must have [https://docs.unity3d.com/Manual/FBXImporter-Model.html Read/Write enabled] on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Whole scene is very bright or black ===&lt;br /&gt;
* Check if your light intensities are in a reasonable range (&amp;lt; 100; or &amp;lt;= 100000 Lux in HDRP).&lt;br /&gt;
* Check the same for indirect intensity on all lights. A multiplication of direct and intensity intensity must not go into thousands, otherwise GI algorithm may overflow.&lt;br /&gt;
* Check if you don't use assets with High mesh compression. When set to High, Unity mesh compression will completely destroy lightmap UVs, only leaving 8 bits for them. This may produce many lightmapping errors including this one.&lt;br /&gt;
* Check if you have any .hdr overrides in the Preset Manager that change the way lightmaps are imported.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery says &amp;quot;Device is not DX11&amp;quot; ===&lt;br /&gt;
Currently Bakery needs Unity editor to be running in DX11 mode to directly exchange texture data, so make sure your editor's window header says &amp;quot;&amp;lt;DX11&amp;gt;&amp;quot;. If it does not, change active graphics API to DX11: &lt;br /&gt;
* Go to Player Settings.&lt;br /&gt;
* If &amp;quot;Auto Graphics API for Windows&amp;quot; is unchecked, you will see a list of APIs.&lt;br /&gt;
* Make sure &amp;quot;Direct3D11&amp;quot; is on top or place it there.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery doesn't work on my 3070/3080/3090 GPU? ===&lt;br /&gt;
1. Please enable [[Manual#RTX_Mode|RTX mode]].&lt;br /&gt;
&lt;br /&gt;
2. If denoiser also fails, please update from [[Github_access|github]] and use OpenImageDenoise option (some instructions are [[Troubleshooting#Denoiser_produces_bright_edges_around_geometry.2Fshadows|here]]).&lt;br /&gt;
&lt;br /&gt;
Updated denoiser (both new OptiX version and OpenImageDenoise) as well as automatic hardware detection will be soon released on the Asset Store.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser produces grid-like patterns ===&lt;br /&gt;
[[File:Gridlike.jpg|thumb|Grid-like denoiser pattern]]&lt;br /&gt;
&lt;br /&gt;
OptiX denoiser might produdce grid-like patterns when fed with very low-precision lightmaps. Low precision is usually caused by either extremely dark or extremely bright lighting. It is recommended to stay within reasonable intensity range (see a similar advice for [[Troubleshooting#Lightmaps_look_black_or_have_bad_quality_in_an_HDRP_scene|HDRP]] above).&lt;br /&gt;
&lt;br /&gt;
* Alternatively use OpenImageDenoise, as it does not produce this pattern.&lt;br /&gt;
&lt;br /&gt;
* This issue also does not affect OptiX 5.1 denoiser (&amp;quot;Legacy denoiser&amp;quot;) as its training dataset is in its own DLL, but affects the non-legacy version (OptiX 6.0) and only on driver versions newer than 442.50, as the training datasets are in the driver ([https://forums.developer.nvidia.com/t/optix7-denoiser-different-results-with-different-version-of-drivers/117989/2 explanation from NVIDIA]).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get &amp;quot;rtcRes == RTC_SUCCESS&amp;quot; error ===&lt;br /&gt;
&lt;br /&gt;
You are using a 3xxx+ GPU with RTX mode disabled. Enable [[Manual#RTX_Mode|RTX mode]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Baking any scene crashes with unknown error ===&lt;br /&gt;
&lt;br /&gt;
There were [https://twitter.com/HarryAlisavakis/status/1331630028665348096 some reports] that Avast antivirus can block Bakery from running, even though Bakery's executables don't trigger any antivirus (including Avast) when [https://twitter.com/guycalledfrank/status/1331640614077796354 scanned via VirusTotal]. Perhaps it just block any executables that were launched 'indirectly', i.e. from another application. In any case, if you have Avast, try adding your project folder to exception list.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Combined meshes (e.g. using Mesh Combine asset) bake incorrectly ===&lt;br /&gt;
&lt;br /&gt;
[[File:Meshcombine.jpg|thumb|Mesh Combine &amp;quot;Regenerate Lightmap UVs&amp;quot; option]]&lt;br /&gt;
&lt;br /&gt;
Most mesh combining assets have an option to regenerate lightmap UVs. Without it, combined UVs will overlap each other. If you are using Mesh Combine, make sure &amp;quot;Regenerate Lightmap UVs&amp;quot; option is enabled in output settings.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a &amp;quot;Can't create vertex buffer&amp;quot; error ===&lt;br /&gt;
&lt;br /&gt;
This error can happen if the scene has more than ~40 million vertices. It is recommended to reduce geometric complexity of the scene, as tracing it would be too slow anyway. The typical cause of going over this limit is trying to bake with large arrays of trees painted on the terrain. In this case try disabling [[Manual#Export_terrain_trees|Export Terrain Trees]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Soft shadows appear like multiple hard shadows ===&lt;br /&gt;
&lt;br /&gt;
[[File:Unknown.png|thumb|Undersampled shadow]]&lt;br /&gt;
&lt;br /&gt;
Increase ''Shadow Samples'' on the light or decrease the ''Shadow Spread''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Lightmaps are black on GTX 650 ===&lt;br /&gt;
&lt;br /&gt;
Apparently newer Nvidia drivers deprecate some CUDA functions on older hardware. It is recommended to use driver version 442 on GTX 650, as it still supported everything Bakery uses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Lightmaps disappear on play ===&lt;br /&gt;
&lt;br /&gt;
* Make sure that '''Project Settings''' -&amp;gt; '''Editor''' -&amp;gt; '''Enter Play Mode Settings''' -&amp;gt; '''Reload Scene''' is turned '''on'''.&lt;br /&gt;
* If that doesn't help, try applying the latest [[Github_access|patch]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a DllNotFoundException ===&lt;br /&gt;
&lt;br /&gt;
* Check if the DLL file mentioned in the error actually exists in your project. If it doesn't, your Bakery installation is incomplete or corrupted; please reinstall it.&lt;br /&gt;
* Check if you're running 64-bit Unity Editor under 64-bit Windows (7 or newer) (as listed in [[Manual#System_requirements|system requirements]]).&lt;br /&gt;
* Make sure you have 64-bit [https://www.microsoft.com/en-us/download/details.aspx?id=48145 Visual C++ Redistributables for Visual Studio 2015] installed. In case if the Microsoft site download is broken, here is a [https://drive.google.com/file/d/1WfRP1A43bCwZflZ_I0wHSGPyC3b-0lqK/view?usp=sharing reupload].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Lightmap UVs are wrong when opening previously baked project on a Mac ===&lt;br /&gt;
&lt;br /&gt;
When Unity reimports model assets, it performs UV unwrapping. If you baked the scene with [[Manual#Unwrapper|Unwrapper]] was set to xatlas, it won't work on a Mac because Bakery's xatlas wrapper library is only compiled for Windows. Rebaking with Default unwrapper should fix it.&lt;br /&gt;
&lt;br /&gt;
You can still keep xatlas as the [[Manual#Atlas_Packer|Atlas Packer]].&lt;br /&gt;
&lt;br /&gt;
''Unwrapper'' is used to generate UVs for individual, isolated meshes, while ''Atlas Packer'' packs big scene-specific atlases out of many unwrapped layouts.&lt;br /&gt;
&lt;br /&gt;
Combining Default unwrapper with xatlas being used as the Atlas Packer and enabling [[Manual#Hole_filling|Hole Filling]] should give pretty good [https://x.com/guycalledfrank/status/1231890428313600000 results] and compensate for any individual mesh unwrapping inefficiencies.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Error message &amp;quot;Failed to load OptiX library&amp;quot; (&amp;quot;Both RTX and non-RTX lightmapper failed to run&amp;quot;) ===&lt;br /&gt;
&lt;br /&gt;
(Aka &amp;quot;Both RTX and non-RTX lightmapper failed to run&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Nvidia driver 590 (and newer) removed support for OptiX 6.0 which Bakery depended on. Bakery v1.98 added support for the new driver, now using OptiX 9.0.&lt;br /&gt;
* Make sure you're using a [[Manual#System_requirements|supported Nvidia GPU]].&lt;br /&gt;
* Update Bakery to v1.98 via the [https://assetstore.unity.com/packages/tools/level-design/bakery-gpu-lightmapper-122218 Asset Store], [[Github_access|github or the built-in patcher]].&lt;br /&gt;
* If you still get the error every time, click '''Bakery -&amp;gt; Utilities -&amp;gt; Detect Optimal Settings''' and choose &amp;quot;Set recommended as default&amp;quot;.&lt;br /&gt;
* If you don't want to update Bakery, roll back your GPU driver to any pre-590 version (e.g. [https://www.nvidia.com/en-eu/geforce/drivers/results/257569/ 581.80]).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Point Light with a cookie/cubemap is black ===&lt;br /&gt;
Note that Bakery supports colored cookies and reads RGB from cookie/cubemap textures. Unity, on the other hand, only supports grayscale cookies. Setting Texture Type to &amp;quot;Cookie&amp;quot; on the asset will convert it to a single-channel A8 format. For Bakery, leave Texture Type to Default.&lt;/div&gt;</summary>
		<author><name>Mr F</name></author>
		
	</entry>
	<entry>
		<id>https://geom.io/bakery/wiki/index.php?title=Troubleshooting&amp;diff=1867</id>
		<title>Troubleshooting</title>
		<link rel="alternate" type="text/html" href="https://geom.io/bakery/wiki/index.php?title=Troubleshooting&amp;diff=1867"/>
		<updated>2026-04-08T09:59:59Z</updated>

		<summary type="html">&lt;p&gt;Mr F: /* Error message &amp;quot;Failed to load OptiX library&amp;quot; */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a list of common problems, their symptoms and solutions.&lt;br /&gt;
&lt;br /&gt;
=== Shadowmasks are not baked ===&lt;br /&gt;
Check following things:&lt;br /&gt;
* Bakery's [[Manual#Render Mode|Render Mode]] is set to Shadowmask.&lt;br /&gt;
* Masked lights have both Unity and Bakery light components on them.&lt;br /&gt;
* Masked Bakery light components have &amp;quot;Baked contribution&amp;quot; set to &amp;quot;Indirect and shadowmask&amp;quot;.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Shadowmasks are baked, but Unity renders real-time shadows instead ===&lt;br /&gt;
You're in Distance Shadowmask mode, it's expected. Read more about the difference:&lt;br /&gt;
&lt;br /&gt;
https://docs.unity3d.com/Manual/LightMode-Mixed-Shadowmask.html&lt;br /&gt;
&lt;br /&gt;
https://docs.unity3d.com/Manual/LightMode-Mixed-DistanceShadowmask.html&lt;br /&gt;
&lt;br /&gt;
* To switch between two modes, you can use &amp;quot;Distance Shadowmask&amp;quot; checkbox in Bakery main window.&lt;br /&gt;
* If you're on 5.6, go to Window-&amp;gt;Lighting-&amp;gt;Mixed Lighting-&amp;gt;Lighting Mode to switch the mode.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I can't see specular lighting after the bake ===&lt;br /&gt;
Apparently specular lighting was provided by real-time lights before the bake. Now the lighting is baked into static textures and there is no specular. However, you can:&lt;br /&gt;
* Use Reflection Probes. Good option for highly glossy objects.&lt;br /&gt;
* Use mixed lights and only bake GI/[[Manual#Shadowmask|Shadowmasks]]. Specular remains real-time.&lt;br /&gt;
* Bake in [[Manual#Dominant_Direction|Dominant Direction]] or [[Manual#SH|SH]] mode and use [[Manual#Bakery_shaders|Bakery shaders]] with &amp;quot;Lightmapped specular&amp;quot; option. It will give some specular approximation. Looks good on surfaces with medium/high roughness.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Using a version control system I copied the scene to another PC and it doesn't look right ===&lt;br /&gt;
Make sure you followed [[How_do_I...#How_do_I_use_git.2Fcollab.2Fother_version_control_system_with_Bakery.3F|version control guidelines]].&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Baking same asset in one scene breaks its UVs in another scene ===&lt;br /&gt;
The reason here is [[Manual#Asset_UV_Processing|UV padding adjustment]]. It modifies the UVs in the asset, so spacing between UV charts is optimal, meaning they never leak over each other and there is no much wasted space. Unity has a manual Pack Margin option on model assets, but it’s limited since it applies the same exact value for all meshes inside the model, while each mesh can get drastically different size in the final lightmap based on its surface area. Therefore Bakery overrides it with automatically calculated per-mesh (instead of per-model) padding. However, because “optimal” varies depending on baking resolution, it can be problematic to reuse the same asset in isolated scenes with different lightmap size. There are multiple ways to solve it:&lt;br /&gt;
* a) Just disable UV padding adjustment (set to [[Manual#Asset_UV_Processing|Don't Change]]). Results will be similar to built-in baking.&lt;br /&gt;
* b) Generate your own optimal UVs. UV padding adjustment only applies to models with auto-generated UV layout (aka “Generate Lightmap UVs” checkbox) and never touches custom data.&lt;br /&gt;
* c) Set Asset UV Processing to &amp;quot;Adjust UV padding only for new meshes&amp;quot; (currently available in the [[Github_access|github]] version).&lt;br /&gt;
* d) Use [[Manual#UV_padding:_increase_only|UV padding: increase only]] checkbox and first bake the lowest resolution scene, and then the rest.&lt;br /&gt;
* e) Use two different models for different lightmap resolutions, so each will get the most efficient set of UVs.&lt;br /&gt;
* f) Bake both scenes together.&lt;br /&gt;
* g) Lock UVs using [[How_do_I...#Alternative_solution|Save UV padding to asset]]&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser throws error 505 or Unknown error ===&lt;br /&gt;
[https://www.nvidia.com/Download/index.aspx?lang=en-US Update the driver].&lt;br /&gt;
&lt;br /&gt;
If you are using a Kepler GPU, try switching to [[Manual#Legacy_denoiser|legacy denoiser]].&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get an “Out of memory” error ===&lt;br /&gt;
This means rendering needed more video memory from your GPU than it has available.&lt;br /&gt;
&lt;br /&gt;
First, try closing any other graphics-intensive programs (browsers too).&lt;br /&gt;
&lt;br /&gt;
If the problem persists, the most likely reason is that the resolution you selected is unreasonably high for the given scene. Resolution is defined by [[Manual#Texels_per_unit|Texels per Unit]] (this section also has a list of reference values) or set explicitly in [[Manual#Bakery_Lightmap_Group_Selector|Lightmap Groups]]. Reducing it will help. You can always selectively use high resolution for important objects via [https://docs.unity3d.com/Manual/class-MeshRenderer.html Scale in Lightmap].&lt;br /&gt;
&lt;br /&gt;
If you have terrains in your scene, make sure [[Manual#Terrain_optimization|Terrain optimization]] is enabled.&lt;br /&gt;
&lt;br /&gt;
If you have a very high amount of painted trees on your terrain, try disabling the [[Manual#Export_terrain_trees|Export terrain trees]] option.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a “Can't map texture” error ===&lt;br /&gt;
Typically happens if your system went out of RAM (system memory, not video memory) during the scene export process. Your scene could already be taking too much RAM by itself, not leaving enough free memory for Bakery export.&lt;br /&gt;
&lt;br /&gt;
* Try closing any memory-intensive programs before baking.&lt;br /&gt;
* Try reducing [[Manual#Max_resolution|Max Resolution]] from 4096 to 2048.&lt;br /&gt;
* If you are baking very highly detailed (millions of triangles) geometry, try excluding some of it from the bake.&lt;br /&gt;
* Try disabling [[Manual#Export_terrain_trees|Export terrain trees]].&lt;br /&gt;
* Try enabling [[Manual#Terrain_optimization|Terrain optimization]].&lt;br /&gt;
&lt;br /&gt;
This error can also be shown in case of GPU driver crash, in which case Unity editor also won't render anything.&lt;br /&gt;
&lt;br /&gt;
If this error happens at the end of the render process (from the seamfixer app), try increasing the [[Troubleshooting#I_get_a_.22Launch_timeout.22_error|TDR]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a “Can't create texture” or &amp;quot;Can't create rasterizer state&amp;quot; error ===&lt;br /&gt;
Typically errors like this are caused by such chain of events:&lt;br /&gt;
* Some objects in the scene have incorrect lightmapping UVs. Often the UVs contain many large triangles overlapping each other.&lt;br /&gt;
* Scene uses large lightmaps.&lt;br /&gt;
* Bakery tries to rasterize a huge amount of 4k-sized overlapping triangles to prepare the UV GBuffer.&lt;br /&gt;
* This operation takes &amp;gt; 2 seconds, and the driver is reset by Windows due to TDR: https://docs.microsoft.com/en-us/windows-hardware/drivers/display/timeout-detection-and-recovery&lt;br /&gt;
* Consequent GPU operations are failed due to reset.&lt;br /&gt;
&lt;br /&gt;
Solution:&lt;br /&gt;
* Make sure all your objects either have non-overlapping UV2 or enable &amp;quot;Generate lightmapping UVs&amp;quot; on all model assets.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== After importing Bakery I get errors containing “obsolete” and “UnityUpgradable” ===&lt;br /&gt;
Before importing Bakery, make sure you don't have any compilation errors in your project.&lt;br /&gt;
&lt;br /&gt;
Restart Unity, reimport the package. Click “I made a backup, go ahead” if Unity asks.&lt;br /&gt;
&lt;br /&gt;
See [https://docs.unity3d.com/Manual/APIUpdater.html this page] for more details.&lt;br /&gt;
&lt;br /&gt;
It is also known that some versions of Unity Hub have a [https://forum.unity.com/threads/bakery-gpu-lightmapper-v1-6-released.536008/page-63#post-4668227 bug] preventing API updater from running.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a &amp;quot;Can't load&amp;quot; error ===&lt;br /&gt;
If Bakery says it can't load something, make sure you have enough free disk space on the drive used for [[Manual#Temp_path|temporary data]].&lt;br /&gt;
&lt;br /&gt;
Some parts of Bakery can't deal with non-ASCII characters (this is going to be fixed soon). Try naming your scenes and lightmap group assets with ASCII characters. Latin letters and numbers must always work.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a &amp;quot;Launch timeout&amp;quot; error ===&lt;br /&gt;
This error can happen if your GPU took more time than it is allowed by [https://docs.microsoft.com/en-us/windows-hardware/drivers/display/timeout-detection-and-recovery Windows TDR].&lt;br /&gt;
* Try disabling [[Manual#Terrain_optimization|Terrain Optimization]].&lt;br /&gt;
* Try lowering the value of [[Manual#Tile_size|Tile Size]], especially if it's higher than 512, so baking job is split into smaller chunks.&lt;br /&gt;
* Depending on the pass being processed, try lowering the Samples value (e.g. [[Manual#Samples|GI samples]], [[Manual#Bakery_Sky_Light|Skylight samples]], etc).&lt;br /&gt;
* Reduce geometric complexity of the scene, if tile size/samples don't help.&lt;br /&gt;
* As a last resort, [https://docs.microsoft.com/en-us/windows-hardware/drivers/display/tdr-registry-keys disable TDR registry keys]. This will prevent Windows from resetting the driver, but your computer may appear unresponsive during the bake.&lt;br /&gt;
&lt;br /&gt;
[https://substance3d.adobe.com/documentation/spdoc/gpu-drivers-crash-with-long-computations-tdr-crash-128745489.html Additional instructions for changing the timeout (from Substance)]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I have an Android project, and lightmaps don't look good ===&lt;br /&gt;
[[File:Banding.jpg|Android banding artifacts|thumb]]&lt;br /&gt;
[[File:LightmapsTechnicalDetails.png|Lightmap encoding in player settings|thumb]]&lt;br /&gt;
[[File:Astc.jpg|Build texture compression settings|thumb]]&lt;br /&gt;
Sometimes, when working on Android projects, you may encounter banding artifacts, with gradients having discrete steps of different hue.&lt;br /&gt;
This is caused by texture compression and HDR encoding Unity uses for this platform, which often turns out to be &amp;quot;Double LDR&amp;quot; ([https://docs.unity3d.com/Manual/Lightmaps-TechnicalInformation.html see details]). The problem is not exclusive to Bakery and will as well happen with built-in lightmaps.&lt;br /&gt;
&lt;br /&gt;
In Player Settings, set Lightmap Encoding to '''High Quality'''.&lt;br /&gt;
&lt;br /&gt;
If your target devices support ASTC compression, make sure it is enabled in Build settings. PVRTC is also a good choice, although it is mostly supported on iOS devices. ETC compression gives poor results for lightmaps.&lt;br /&gt;
&lt;br /&gt;
If above solutions are not enough, select lightmap assets and set texture compression quality to '''High''' or '''None''' (try both).&lt;br /&gt;
&lt;br /&gt;
Note that setting it to None will use more video memory on the device.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I have a scene baked with MonoSH, and lighting looks pixelated ===&lt;br /&gt;
[[File:Normalq.jpg|MonoSH compressed with low quality encoding|thumb]]&lt;br /&gt;
In some scenes, [[Manual#MonoSH|MonoSH]] lightmaps can look pixelated, if low (or &amp;quot;normal&amp;quot;) quality compression is used (e.g. DXT1). Usually setting Compression = High on the L1 texture fixes the issue.&lt;br /&gt;
&lt;br /&gt;
You can enable all L1 textures to always use High quality compression by toggling Project Settings -&amp;gt; Bakery -&amp;gt; '''High quality direction'''.&lt;br /&gt;
&lt;br /&gt;
Note that depending on the platform, High quality compression can take more memory. On PC it usually doubles by going from DXT1 to BC7 format.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== There are weird square artifacts on my geometry ===&lt;br /&gt;
[[File:Smoothnormals flatshape.jpg|Square artifacts from incorrect normals|thumb]]&lt;br /&gt;
Weird squares may sometimes be seen on models when their shape is too different from their normals. Bakery [https://ndotl.wordpress.com/#shadowterm tries to compensate] starting ray points to take fake normal smoothness into account, but in extreme cases the algorithm can't handle the discrepancy.&lt;br /&gt;
Usually it's enough to just recalculate normals on the model. E.g. in Unity you can select the FBX and change &amp;quot;Normals&amp;quot; to &amp;quot;Calculate&amp;quot; instead of &amp;quot;Import&amp;quot;.&lt;br /&gt;
Alternatively, you can disable the related compensation algorithm, but it’s actually beneficial in most cases. You can toggle it in Project Settings → Bakery → Generate smooth positions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get too many lightmaps ===&lt;br /&gt;
Possible causes are:&lt;br /&gt;
&lt;br /&gt;
* [[Manual#Atlas_Packer|Atlas packer]] is set to ''Default'' or ''Post-packing'' is disabled. Set Atlas Packer to ''xatlas'' and enable Post-packing for best results.&lt;br /&gt;
&lt;br /&gt;
* ''Texels Per Unit'' value is high or ''Max Resolution'' is low. Bakery packs objects from open scenes into multiple lightmap atlases and packs them as rectangles (in a fashion similar to [https://blackpawn.com/texts/lightmaps/default.html this]; unless Hole Filling is enabled) with their size dependent on (surface area * texels per unit). If some object can't fit into existing atlases, a new one is allocated. New atlases are always as large as the Max Resolution parameter, or smaller (but not smaller than ''Min Resolution''), if the estimated surface area of remaining unpacked objects is below some threshold. You can also increase Min Resolution a bit, replacing a bunch of small (but dense) maps with a few large (but possibly with some empty space).&lt;br /&gt;
&lt;br /&gt;
Additionally, increase ''Min Resolution'' to prefer larger combined lightmaps instead of many smaller ones.&lt;br /&gt;
&lt;br /&gt;
If not using post-packing:&lt;br /&gt;
&lt;br /&gt;
* If you bake multiple open scenes and ''Split by scene'' checkbox is on, different scenes will never share the same lightmap, therefore multiplying their count.&lt;br /&gt;
* If ''Terrain optimization'' is on, terrains will always use a separate lightmap.&lt;br /&gt;
Pre-atlasing your scene in your modelling package of choice and using the [https://geom.io/bakery/wiki/index.php?title=Manual#Bakery_Lightmap_Group_Selector Original UV] mode instead of relying on the auto-atlaser can significantly improve packing effectiveness.&lt;br /&gt;
&lt;br /&gt;
Since v1.71 Bakery prints number of future used lightmaps to console when enabling/refreshing Checker Preview. You can experiment with resolution/density settings until the desired value is printed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get jagged shadows ===&lt;br /&gt;
[[File:Softshadows.png|Jagged shadow mitigation|thumb]]&lt;br /&gt;
Apparently you are baking very sharp shadows at low resolution. Try increasing shadow spread parameter on the light ([[Manual#Bakery_Direct_Light|direct]] or [[Manual#Bakery_Point_Light|point]]) and optionally enable [[Manual#Shader_Tweaks|bicubic interpolation]].&lt;br /&gt;
On a [[Manual#Bakery_Direct_Light|Direct Light]] you can also enable the '''Anti-Alias''' option.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Exporting scene - preparing&amp;quot; is taking too long ===&lt;br /&gt;
(Or &amp;quot;Exporting scene - atlasing&amp;quot;)&lt;br /&gt;
* Try setting [[Manual#Atlas_Packer|Atlas Packer]] to Default.&lt;br /&gt;
* Make sure you use reasonable [[Manual#Texels_per_unit|Texels Per Unit]] value.&lt;br /&gt;
* Make sure your meshes are [[Manual#Quickstart|correctly unwrapped]].&lt;br /&gt;
* Possibly disable [[Manual#Asset_UV_Processing|UV Padding Adjustment]].&lt;br /&gt;
&lt;br /&gt;
If you're converting a large existing scene, make sure to follow [[How_do_I...#How_do_I_quickly_port_my_existing_scene_to_Bakery.3F|this guide]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Stuck at &amp;quot;Waiting for Unity to initialize the probes...&amp;quot; ===&lt;br /&gt;
There isn't much Bakery can do about the logic of Unity lighting data asset generation (there is no API in the engine to control it at the moment). Try to focus editor window (especially scene view) to wake Unity up.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Baked prefabs instantiated at runtime in a build have no lightmaps ===&lt;br /&gt;
Because Unity technically has no support for prefabs having lightmaps, it can omit lightmapped shader versions from builds, not realizing they are needed. You can fix it by going to [https://docs.unity3d.com/Manual/class-GraphicsSettings.html?_ga=2.212464724.1917527976.1586930444-1257434621.1522062178#stripping Shader stripping settings] and enabling lightmap modes you use.&lt;br /&gt;
Additionally, try disabling '''Optimize Mesh Data''' in Player Settings, as Unity may omit UV from the build.&lt;br /&gt;
&lt;br /&gt;
{{note|In Shader Stripping settings &amp;quot;Directional&amp;quot; mode only applies to standard Unity directional maps aka [[Manual#Dominant_Direction|Dominant Direction]]. When using Baked Normal Maps, RNM or SH, use &amp;quot;Non-directional&amp;quot; lightmap mode checkboxes.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Speedtrees look fine in the editor, but black in builds ===&lt;br /&gt;
Also related to shader stripping. See the [[Troubleshooting#Baked_prefabs_instantiated_at_runtime_in_a_build_have_no_lightmaps|prefab solution]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Scene is black in build ===&lt;br /&gt;
See advice above. Additionally, if the scene is loaded asynchronously, call ftLightmaps.RefreshFull() when it is fully loaded.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== HDRI produces scattered bright spots (fireflies) ===&lt;br /&gt;
[[File:Fireflies.jpg|thumb|Typical &amp;quot;fireflies&amp;quot;]]&lt;br /&gt;
[[File:Upload 2019-7-3 11-27-22.png|thumb|Removing sun from HDRI]]&lt;br /&gt;
This artefact comes from the fact your HDRI has very bright, yet very small parts, typically sun. Rays will miss it often, producing occasional spots when they don't. This problem is well known in many offline ray tracers as well.&lt;br /&gt;
* Use [[Manual#Bakery_Direct_Light|Direct Light]] for the sun&lt;br /&gt;
* Remove sun from HDRI (also [https://seblagarde.wordpress.com/2016/08/28/siggraph-2016-an-artist-friendly-workflow-for-panoramic-hdri/ recommended by Unity])&lt;br /&gt;
* Possibly downsample/blur the HDRI&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Small emissive (or brightly lit) surfaces produce noise ===&lt;br /&gt;
The issue is similar to the one above and may happen when using very small and very bright emissive surfaces, or small non-emissive surfaces lit by a very intense light. In case of emissive surfaces, you can replace them with [[Manual#Bakery_Light_Mesh|Light Meshes]] to prevent it. See [[Manual#Differences_between_Light_Mesh_and_emissive_materials|Differences between Light Mesh and emissive materials]]. Alternatively, try increasing [[Manual#Samples|GI sample count]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Adjusting UV padding&amp;quot; happens too often and takes too much time ===&lt;br /&gt;
[[Manual#Asset_UV_Processing|UV padding adjustment]] is a feature that optimizes asset UVs based on the size they take in lightmaps. This process will happen for a model if:&lt;br /&gt;
* Option is globally enabled.&lt;br /&gt;
* Asset has &amp;quot;Generate Lightmap UVs&amp;quot; checkbox enabled. Models with custom UVs are not adjusted.&lt;br /&gt;
* Model was not adjusted before or...&lt;br /&gt;
* ... its lightmap size has changed.&lt;br /&gt;
Therefore it can be triggered for all auto-unwrapped models after their geometry or resolution changes.&lt;br /&gt;
UV padding adjustment will try to waste less lightmap resolution and reduce texel leaking, but it is not necessary. If you are doing many experimental/draft bakes, you may consider disabling it (set to &amp;quot;Don't change&amp;quot;), then possibly enabling it back for the final quality bake.&lt;br /&gt;
&lt;br /&gt;
Also note that using xatlas as [[Manual#Unwrapper|Unwrapper]] can be notoriously slower comparing to Default.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser produces bright edges around geometry/shadows ===&lt;br /&gt;
[[File:Bredges.jpg|thumb|Bright edges]]&lt;br /&gt;
Sometimes you may encounter bright edges or spots at high contrast edges caused by the denoising neural net, most notably OptiX 6 and 7.&lt;br /&gt;
* Use OptiX 5 or OpenImageDenoise if you can ([[Manual#Denoiser|denoiser]] option).&lt;br /&gt;
* Try enabling [[Manual#Denoise:_fix_bright_edges|Denoise: Fix bright edges]].&lt;br /&gt;
* Try setting texture compression to None on lightmap assets.&lt;br /&gt;
* Try setting [[Manual#Backface_GI|Backface GI]] to 1, removing dark shadows inside objects. While these shadows are normally not visible, their edges may cause problems for both the denoiser and texture compression.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Light probes are too bright in Subtractive mode ===&lt;br /&gt;
&lt;br /&gt;
[[File:98911466-ae8c5b00-24d5-11eb-8d51-4e764ac0f163.png|thumb|The effect of occlusion probes]]&lt;br /&gt;
&lt;br /&gt;
Light occlusion information is not baked into probes. Solution:&lt;br /&gt;
* Set your Unity directional light to Mixed mode.&lt;br /&gt;
* Enable [[Manual#Occlusion_probes|Occlusion Probes]].&lt;br /&gt;
* Bake&lt;br /&gt;
&lt;br /&gt;
Some versions of Unity may need a scene reload to properly apply the Lighting Data Asset.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Baking produces &amp;quot;Not allowed to access uv2&amp;quot; errors ===&lt;br /&gt;
All lightmapped models must have [https://docs.unity3d.com/Manual/FBXImporter-Model.html Read/Write enabled] on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Whole scene is very bright or black ===&lt;br /&gt;
* Check if your light intensities are in a reasonable range (&amp;lt; 100; or &amp;lt;= 100000 Lux in HDRP).&lt;br /&gt;
* Check the same for indirect intensity on all lights. A multiplication of direct and intensity intensity must not go into thousands, otherwise GI algorithm may overflow.&lt;br /&gt;
* Check if you don't use assets with High mesh compression. When set to High, Unity mesh compression will completely destroy lightmap UVs, only leaving 8 bits for them. This may produce many lightmapping errors including this one.&lt;br /&gt;
* Check if you have any .hdr overrides in the Preset Manager that change the way lightmaps are imported.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery says &amp;quot;Device is not DX11&amp;quot; ===&lt;br /&gt;
Currently Bakery needs Unity editor to be running in DX11 mode to directly exchange texture data, so make sure your editor's window header says &amp;quot;&amp;lt;DX11&amp;gt;&amp;quot;. If it does not, change active graphics API to DX11: &lt;br /&gt;
* Go to Player Settings.&lt;br /&gt;
* If &amp;quot;Auto Graphics API for Windows&amp;quot; is unchecked, you will see a list of APIs.&lt;br /&gt;
* Make sure &amp;quot;Direct3D11&amp;quot; is on top or place it there.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery doesn't work on my 3070/3080/3090 GPU? ===&lt;br /&gt;
1. Please enable [[Manual#RTX_Mode|RTX mode]].&lt;br /&gt;
&lt;br /&gt;
2. If denoiser also fails, please update from [[Github_access|github]] and use OpenImageDenoise option (some instructions are [[Troubleshooting#Denoiser_produces_bright_edges_around_geometry.2Fshadows|here]]).&lt;br /&gt;
&lt;br /&gt;
Updated denoiser (both new OptiX version and OpenImageDenoise) as well as automatic hardware detection will be soon released on the Asset Store.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser produces grid-like patterns ===&lt;br /&gt;
[[File:Gridlike.jpg|thumb|Grid-like denoiser pattern]]&lt;br /&gt;
&lt;br /&gt;
OptiX denoiser might produdce grid-like patterns when fed with very low-precision lightmaps. Low precision is usually caused by either extremely dark or extremely bright lighting. It is recommended to stay within reasonable intensity range (see a similar advice for [[Troubleshooting#Lightmaps_look_black_or_have_bad_quality_in_an_HDRP_scene|HDRP]] above).&lt;br /&gt;
&lt;br /&gt;
* Alternatively use OpenImageDenoise, as it does not produce this pattern.&lt;br /&gt;
&lt;br /&gt;
* This issue also does not affect OptiX 5.1 denoiser (&amp;quot;Legacy denoiser&amp;quot;) as its training dataset is in its own DLL, but affects the non-legacy version (OptiX 6.0) and only on driver versions newer than 442.50, as the training datasets are in the driver ([https://forums.developer.nvidia.com/t/optix7-denoiser-different-results-with-different-version-of-drivers/117989/2 explanation from NVIDIA]).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get &amp;quot;rtcRes == RTC_SUCCESS&amp;quot; error ===&lt;br /&gt;
&lt;br /&gt;
You are using a 3xxx+ GPU with RTX mode disabled. Enable [[Manual#RTX_Mode|RTX mode]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Baking any scene crashes with unknown error ===&lt;br /&gt;
&lt;br /&gt;
There were [https://twitter.com/HarryAlisavakis/status/1331630028665348096 some reports] that Avast antivirus can block Bakery from running, even though Bakery's executables don't trigger any antivirus (including Avast) when [https://twitter.com/guycalledfrank/status/1331640614077796354 scanned via VirusTotal]. Perhaps it just block any executables that were launched 'indirectly', i.e. from another application. In any case, if you have Avast, try adding your project folder to exception list.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Combined meshes (e.g. using Mesh Combine asset) bake incorrectly ===&lt;br /&gt;
&lt;br /&gt;
[[File:Meshcombine.jpg|thumb|Mesh Combine &amp;quot;Regenerate Lightmap UVs&amp;quot; option]]&lt;br /&gt;
&lt;br /&gt;
Most mesh combining assets have an option to regenerate lightmap UVs. Without it, combined UVs will overlap each other. If you are using Mesh Combine, make sure &amp;quot;Regenerate Lightmap UVs&amp;quot; option is enabled in output settings.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a &amp;quot;Can't create vertex buffer&amp;quot; error ===&lt;br /&gt;
&lt;br /&gt;
This error can happen if the scene has more than ~40 million vertices. It is recommended to reduce geometric complexity of the scene, as tracing it would be too slow anyway. The typical cause of going over this limit is trying to bake with large arrays of trees painted on the terrain. In this case try disabling [[Manual#Export_terrain_trees|Export Terrain Trees]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Soft shadows appear like multiple hard shadows ===&lt;br /&gt;
&lt;br /&gt;
[[File:Unknown.png|thumb|Undersampled shadow]]&lt;br /&gt;
&lt;br /&gt;
Increase ''Shadow Samples'' on the light or decrease the ''Shadow Spread''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Lightmaps are black on GTX 650 ===&lt;br /&gt;
&lt;br /&gt;
Apparently newer Nvidia drivers deprecate some CUDA functions on older hardware. It is recommended to use driver version 442 on GTX 650, as it still supported everything Bakery uses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Lightmaps disappear on play ===&lt;br /&gt;
&lt;br /&gt;
* Make sure that '''Project Settings''' -&amp;gt; '''Editor''' -&amp;gt; '''Enter Play Mode Settings''' -&amp;gt; '''Reload Scene''' is turned '''on'''.&lt;br /&gt;
* If that doesn't help, try applying the latest [[Github_access|patch]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a DllNotFoundException ===&lt;br /&gt;
&lt;br /&gt;
* Check if the DLL file mentioned in the error actually exists in your project. If it doesn't, your Bakery installation is incomplete or corrupted; please reinstall it.&lt;br /&gt;
* Check if you're running 64-bit Unity Editor under 64-bit Windows (7 or newer) (as listed in [[Manual#System_requirements|system requirements]]).&lt;br /&gt;
* Make sure you have 64-bit [https://www.microsoft.com/en-us/download/details.aspx?id=48145 Visual C++ Redistributables for Visual Studio 2015] installed. In case if the Microsoft site download is broken, here is a [https://drive.google.com/file/d/1WfRP1A43bCwZflZ_I0wHSGPyC3b-0lqK/view?usp=sharing reupload].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Lightmap UVs are wrong when opening previously baked project on a Mac ===&lt;br /&gt;
&lt;br /&gt;
When Unity reimports model assets, it performs UV unwrapping. If you baked the scene with [[Manual#Unwrapper|Unwrapper]] was set to xatlas, it won't work on a Mac because Bakery's xatlas wrapper library is only compiled for Windows. Rebaking with Default unwrapper should fix it.&lt;br /&gt;
&lt;br /&gt;
You can still keep xatlas as the [[Manual#Atlas_Packer|Atlas Packer]].&lt;br /&gt;
&lt;br /&gt;
''Unwrapper'' is used to generate UVs for individual, isolated meshes, while ''Atlas Packer'' packs big scene-specific atlases out of many unwrapped layouts.&lt;br /&gt;
&lt;br /&gt;
Combining Default unwrapper with xatlas being used as the Atlas Packer and enabling [[Manual#Hole_filling|Hole Filling]] should give pretty good [https://x.com/guycalledfrank/status/1231890428313600000 results] and compensate for any individual mesh unwrapping inefficiencies.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Error message &amp;quot;Failed to load OptiX library&amp;quot; (&amp;quot;Both RTX and non-RTX lightmapper failed to run&amp;quot;) ===&lt;br /&gt;
&lt;br /&gt;
Nvidia driver 590 (and newer) removed support for OptiX 6.0 which Bakery depended on. Bakery v1.98 added support for the new driver, now using OptiX 9.0.&lt;br /&gt;
* Make sure you're using a [[Manual#System_requirements|supported Nvidia GPU]].&lt;br /&gt;
* Update Bakery to v1.98 via the [https://assetstore.unity.com/packages/tools/level-design/bakery-gpu-lightmapper-122218 Asset Store], [[Github_access|github or the built-in patcher]].&lt;br /&gt;
* If you still get the error every time, click '''Bakery -&amp;gt; Utilities -&amp;gt; Detect Optimal Settings''' and choose &amp;quot;Set recommended as default&amp;quot;.&lt;br /&gt;
* If you don't want to update Bakery, roll back your GPU driver to any pre-590 version (e.g. [https://www.nvidia.com/en-eu/geforce/drivers/results/257569/ 581.80]).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Point Light with a cookie/cubemap is black ===&lt;br /&gt;
Note that Bakery supports colored cookies and reads RGB from cookie/cubemap textures. Unity, on the other hand, only supports grayscale cookies. Setting Texture Type to &amp;quot;Cookie&amp;quot; on the asset will convert it to a single-channel A8 format. For Bakery, leave Texture Type to Default.&lt;/div&gt;</summary>
		<author><name>Mr F</name></author>
		
	</entry>
	<entry>
		<id>https://geom.io/bakery/wiki/index.php?title=Bakery_-_GPU_Lightmapper&amp;diff=1866</id>
		<title>Bakery - GPU Lightmapper</title>
		<link rel="alternate" type="text/html" href="https://geom.io/bakery/wiki/index.php?title=Bakery_-_GPU_Lightmapper&amp;diff=1866"/>
		<updated>2026-04-05T21:30:05Z</updated>

		<summary type="html">&lt;p&gt;Mr F: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[What is Bakery and why use it]]&lt;br /&gt;
&lt;br /&gt;
== Bakery for Unity ==&lt;br /&gt;
* [https://assetstore.unity.com/packages/tools/level-design/bakery-gpu-lightmapper-122218 Asset Store page]&lt;br /&gt;
* [[Github access]]&lt;br /&gt;
* '''[[RTPreview|RTPreview manual]]'''&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* '''[[Manual|Manual (v1.98)]]'''&lt;br /&gt;
** &amp;lt;small&amp;gt;Also available in different languages:&amp;lt;/small&amp;gt;&lt;br /&gt;
*** &amp;lt;small&amp;gt;[[Benutzerhandbuch]]&amp;lt;/small&amp;gt;&lt;br /&gt;
*** &amp;lt;small&amp;gt;[[使用手册]]&amp;lt;/small&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
* [https://docs.google.com/document/d/1r-ZFqovUkVXL-1S9ATYqUHL00M5SpiM2Qwjg0eVCJ4Y/edit Changelog]&lt;br /&gt;
* [https://drive.google.com/file/d/1i_zkeB4VBgNOI_-dBqxkdwZ4HCj6tTyA/view?usp=share_link Latest URP graphs (rev 2.0) (12.1.6)]&lt;br /&gt;
* [https://drive.google.com/file/d/1kutq2zwyOGhSw79_rtZNeW5cFOLWzuVr/view?usp=share_link Latest URP graphs (14.0.7)]&lt;br /&gt;
* [https://drive.google.com/file/d/1CIM7_LFaMJ2lxs4eZMZ-KgX8OA7KBt2U/view?usp=sharing Latest URP graphs (15.0.6)]&lt;br /&gt;
* [https://drive.google.com/file/d/1IJIbw2He3c5xa9hdaTVHnqIf5Ewfg0gZ/view?usp=sharing Latest URP graphs (15.0.7)]&lt;br /&gt;
* [https://drive.google.com/file/d/1lmQsDjLnP-HlslQNHffjqj6Bty9iJUzH/view?usp=sharing Latest URP graphs (16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/1mTpG6o9RfjSlq8EBdpQ8kSZVZq3JP4BQ/view?usp=sharing Latest URP graphs (rev 9.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/1fw7OM83pp0jRHqLjpF2WRZYSd1Z1H1Eh/view?usp=sharing Latest URP graphs (rev 12.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/18TU_8MpVdUiSQjCm1JWyg-binr02ZfzZ/view?usp=sharing Latest URP graphs (rev 13.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/15Nga4ld-F0_GzCfkDLrE3Uv1QfIYvIGk/view?usp=sharing Latest URP graphs (rev 14.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/1x6kCNmJzKgOnnQRQx7ol5VSNMq4VwFeU/view?usp=sharing Latest URP graphs (rev 15.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/1RvaSoy4ceOCTQIHs5DvdYlt5gUEkDYG5/view?usp=sharing Latest URP graphs (rev 16.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/1Y_pueZASUJif6B98EG7RB38ZgdekkJpb/view?usp=sharing Latest URP graphs (rev 17.0) (17.3)]&lt;br /&gt;
* [https://drive.google.com/file/d/1-1_oNZyPptlcUWWjcXzcTv1-b-mPJBsw/view?usp=sharing Latest HDRP graphs (10.4.0)]&lt;br /&gt;
* [https://drive.google.com/file/d/1hYn8FXPf47FsVTgoao0jV0AqxGFN48dH/view?usp=sharing Latest HDRP graphs (11.0.0)]&lt;br /&gt;
* [https://drive.google.com/file/d/1dLlg-GWYbyzvG9jo9srnpnht1S19W6Z2/view Latest HDRP graphs (12.1.6)]&lt;br /&gt;
* [https://drive.google.com/file/d/1RBRS024Dd9ddM-35D1KssOReTrcC8zGn/view?usp=sharing Latest HDRP graphs (14.0.7)]&lt;br /&gt;
* [https://drive.google.com/file/d/1z3jSHNgHALU6r3b6lBXEBvHLlxEmXARZ/view?usp=sharing Latest HDRP graphs (rev 2.0) (14.0.7)]&lt;br /&gt;
* [[FAQ]]&lt;br /&gt;
* [[How do I...]]&lt;br /&gt;
* [[Reporting bugs]]&lt;br /&gt;
* [[Troubleshooting]]&lt;br /&gt;
* [[Community extensions]]&lt;br /&gt;
* [https://discord.gg/dP3SkdM Community Discord]&amp;lt;br&amp;gt;&amp;lt;small&amp;gt;(for support, please contact me on [https://discussions.unity.com/t/bakery-gpu-lightmapper-v1-96-rtpreview-released/704890/7512 Unity forum] / [https://github.com/guycalledfrank/bakery-issues/issues github] / or via email listed [https://assetstore.unity.com/publishers/37453 here]).&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bakery is made by [https://twitter.com/guycalledfrank Mr F]&lt;br /&gt;
&lt;br /&gt;
== Decalery ==&lt;br /&gt;
* '''[[Decalery manual]]'''&lt;br /&gt;
* [[Decalery Github access]]&lt;/div&gt;</summary>
		<author><name>Mr F</name></author>
		
	</entry>
	<entry>
		<id>https://geom.io/bakery/wiki/index.php?title=Troubleshooting&amp;diff=1865</id>
		<title>Troubleshooting</title>
		<link rel="alternate" type="text/html" href="https://geom.io/bakery/wiki/index.php?title=Troubleshooting&amp;diff=1865"/>
		<updated>2026-03-07T23:07:23Z</updated>

		<summary type="html">&lt;p&gt;Mr F: /* Error message &amp;quot;Failed to load OptiX library&amp;quot; */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a list of common problems, their symptoms and solutions.&lt;br /&gt;
&lt;br /&gt;
=== Shadowmasks are not baked ===&lt;br /&gt;
Check following things:&lt;br /&gt;
* Bakery's [[Manual#Render Mode|Render Mode]] is set to Shadowmask.&lt;br /&gt;
* Masked lights have both Unity and Bakery light components on them.&lt;br /&gt;
* Masked Bakery light components have &amp;quot;Baked contribution&amp;quot; set to &amp;quot;Indirect and shadowmask&amp;quot;.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Shadowmasks are baked, but Unity renders real-time shadows instead ===&lt;br /&gt;
You're in Distance Shadowmask mode, it's expected. Read more about the difference:&lt;br /&gt;
&lt;br /&gt;
https://docs.unity3d.com/Manual/LightMode-Mixed-Shadowmask.html&lt;br /&gt;
&lt;br /&gt;
https://docs.unity3d.com/Manual/LightMode-Mixed-DistanceShadowmask.html&lt;br /&gt;
&lt;br /&gt;
* To switch between two modes, you can use &amp;quot;Distance Shadowmask&amp;quot; checkbox in Bakery main window.&lt;br /&gt;
* If you're on 5.6, go to Window-&amp;gt;Lighting-&amp;gt;Mixed Lighting-&amp;gt;Lighting Mode to switch the mode.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I can't see specular lighting after the bake ===&lt;br /&gt;
Apparently specular lighting was provided by real-time lights before the bake. Now the lighting is baked into static textures and there is no specular. However, you can:&lt;br /&gt;
* Use Reflection Probes. Good option for highly glossy objects.&lt;br /&gt;
* Use mixed lights and only bake GI/[[Manual#Shadowmask|Shadowmasks]]. Specular remains real-time.&lt;br /&gt;
* Bake in [[Manual#Dominant_Direction|Dominant Direction]] or [[Manual#SH|SH]] mode and use [[Manual#Bakery_shaders|Bakery shaders]] with &amp;quot;Lightmapped specular&amp;quot; option. It will give some specular approximation. Looks good on surfaces with medium/high roughness.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Using a version control system I copied the scene to another PC and it doesn't look right ===&lt;br /&gt;
Make sure you followed [[How_do_I...#How_do_I_use_git.2Fcollab.2Fother_version_control_system_with_Bakery.3F|version control guidelines]].&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Baking same asset in one scene breaks its UVs in another scene ===&lt;br /&gt;
The reason here is [[Manual#Asset_UV_Processing|UV padding adjustment]]. It modifies the UVs in the asset, so spacing between UV charts is optimal, meaning they never leak over each other and there is no much wasted space. Unity has a manual Pack Margin option on model assets, but it’s limited since it applies the same exact value for all meshes inside the model, while each mesh can get drastically different size in the final lightmap based on its surface area. Therefore Bakery overrides it with automatically calculated per-mesh (instead of per-model) padding. However, because “optimal” varies depending on baking resolution, it can be problematic to reuse the same asset in isolated scenes with different lightmap size. There are multiple ways to solve it:&lt;br /&gt;
* a) Just disable UV padding adjustment (set to [[Manual#Asset_UV_Processing|Don't Change]]). Results will be similar to built-in baking.&lt;br /&gt;
* b) Generate your own optimal UVs. UV padding adjustment only applies to models with auto-generated UV layout (aka “Generate Lightmap UVs” checkbox) and never touches custom data.&lt;br /&gt;
* c) Set Asset UV Processing to &amp;quot;Adjust UV padding only for new meshes&amp;quot; (currently available in the [[Github_access|github]] version).&lt;br /&gt;
* d) Use [[Manual#UV_padding:_increase_only|UV padding: increase only]] checkbox and first bake the lowest resolution scene, and then the rest.&lt;br /&gt;
* e) Use two different models for different lightmap resolutions, so each will get the most efficient set of UVs.&lt;br /&gt;
* f) Bake both scenes together.&lt;br /&gt;
* g) Lock UVs using [[How_do_I...#Alternative_solution|Save UV padding to asset]]&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser throws error 505 or Unknown error ===&lt;br /&gt;
[https://www.nvidia.com/Download/index.aspx?lang=en-US Update the driver].&lt;br /&gt;
&lt;br /&gt;
If you are using a Kepler GPU, try switching to [[Manual#Legacy_denoiser|legacy denoiser]].&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get an “Out of memory” error ===&lt;br /&gt;
This means rendering needed more video memory from your GPU than it has available.&lt;br /&gt;
&lt;br /&gt;
First, try closing any other graphics-intensive programs (browsers too).&lt;br /&gt;
&lt;br /&gt;
If the problem persists, the most likely reason is that the resolution you selected is unreasonably high for the given scene. Resolution is defined by [[Manual#Texels_per_unit|Texels per Unit]] (this section also has a list of reference values) or set explicitly in [[Manual#Bakery_Lightmap_Group_Selector|Lightmap Groups]]. Reducing it will help. You can always selectively use high resolution for important objects via [https://docs.unity3d.com/Manual/class-MeshRenderer.html Scale in Lightmap].&lt;br /&gt;
&lt;br /&gt;
If you have terrains in your scene, make sure [[Manual#Terrain_optimization|Terrain optimization]] is enabled.&lt;br /&gt;
&lt;br /&gt;
If you have a very high amount of painted trees on your terrain, try disabling the [[Manual#Export_terrain_trees|Export terrain trees]] option.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a “Can't map texture” error ===&lt;br /&gt;
Typically happens if your system went out of RAM (system memory, not video memory) during the scene export process. Your scene could already be taking too much RAM by itself, not leaving enough free memory for Bakery export.&lt;br /&gt;
&lt;br /&gt;
* Try closing any memory-intensive programs before baking.&lt;br /&gt;
* Try reducing [[Manual#Max_resolution|Max Resolution]] from 4096 to 2048.&lt;br /&gt;
* If you are baking very highly detailed (millions of triangles) geometry, try excluding some of it from the bake.&lt;br /&gt;
* Try disabling [[Manual#Export_terrain_trees|Export terrain trees]].&lt;br /&gt;
* Try enabling [[Manual#Terrain_optimization|Terrain optimization]].&lt;br /&gt;
&lt;br /&gt;
This error can also be shown in case of GPU driver crash, in which case Unity editor also won't render anything.&lt;br /&gt;
&lt;br /&gt;
If this error happens at the end of the render process (from the seamfixer app), try increasing the [[Troubleshooting#I_get_a_.22Launch_timeout.22_error|TDR]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a “Can't create texture” or &amp;quot;Can't create rasterizer state&amp;quot; error ===&lt;br /&gt;
Typically errors like this are caused by such chain of events:&lt;br /&gt;
* Some objects in the scene have incorrect lightmapping UVs. Often the UVs contain many large triangles overlapping each other.&lt;br /&gt;
* Scene uses large lightmaps.&lt;br /&gt;
* Bakery tries to rasterize a huge amount of 4k-sized overlapping triangles to prepare the UV GBuffer.&lt;br /&gt;
* This operation takes &amp;gt; 2 seconds, and the driver is reset by Windows due to TDR: https://docs.microsoft.com/en-us/windows-hardware/drivers/display/timeout-detection-and-recovery&lt;br /&gt;
* Consequent GPU operations are failed due to reset.&lt;br /&gt;
&lt;br /&gt;
Solution:&lt;br /&gt;
* Make sure all your objects either have non-overlapping UV2 or enable &amp;quot;Generate lightmapping UVs&amp;quot; on all model assets.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== After importing Bakery I get errors containing “obsolete” and “UnityUpgradable” ===&lt;br /&gt;
Before importing Bakery, make sure you don't have any compilation errors in your project.&lt;br /&gt;
&lt;br /&gt;
Restart Unity, reimport the package. Click “I made a backup, go ahead” if Unity asks.&lt;br /&gt;
&lt;br /&gt;
See [https://docs.unity3d.com/Manual/APIUpdater.html this page] for more details.&lt;br /&gt;
&lt;br /&gt;
It is also known that some versions of Unity Hub have a [https://forum.unity.com/threads/bakery-gpu-lightmapper-v1-6-released.536008/page-63#post-4668227 bug] preventing API updater from running.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a &amp;quot;Can't load&amp;quot; error ===&lt;br /&gt;
If Bakery says it can't load something, make sure you have enough free disk space on the drive used for [[Manual#Temp_path|temporary data]].&lt;br /&gt;
&lt;br /&gt;
Some parts of Bakery can't deal with non-ASCII characters (this is going to be fixed soon). Try naming your scenes and lightmap group assets with ASCII characters. Latin letters and numbers must always work.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a &amp;quot;Launch timeout&amp;quot; error ===&lt;br /&gt;
This error can happen if your GPU took more time than it is allowed by [https://docs.microsoft.com/en-us/windows-hardware/drivers/display/timeout-detection-and-recovery Windows TDR].&lt;br /&gt;
* Try disabling [[Manual#Terrain_optimization|Terrain Optimization]].&lt;br /&gt;
* Try lowering the value of [[Manual#Tile_size|Tile Size]], especially if it's higher than 512, so baking job is split into smaller chunks.&lt;br /&gt;
* Depending on the pass being processed, try lowering the Samples value (e.g. [[Manual#Samples|GI samples]], [[Manual#Bakery_Sky_Light|Skylight samples]], etc).&lt;br /&gt;
* Reduce geometric complexity of the scene, if tile size/samples don't help.&lt;br /&gt;
* As a last resort, [https://docs.microsoft.com/en-us/windows-hardware/drivers/display/tdr-registry-keys disable TDR registry keys]. This will prevent Windows from resetting the driver, but your computer may appear unresponsive during the bake.&lt;br /&gt;
&lt;br /&gt;
[https://substance3d.adobe.com/documentation/spdoc/gpu-drivers-crash-with-long-computations-tdr-crash-128745489.html Additional instructions for changing the timeout (from Substance)]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I have an Android project, and lightmaps don't look good ===&lt;br /&gt;
[[File:Banding.jpg|Android banding artifacts|thumb]]&lt;br /&gt;
[[File:LightmapsTechnicalDetails.png|Lightmap encoding in player settings|thumb]]&lt;br /&gt;
[[File:Astc.jpg|Build texture compression settings|thumb]]&lt;br /&gt;
Sometimes, when working on Android projects, you may encounter banding artifacts, with gradients having discrete steps of different hue.&lt;br /&gt;
This is caused by texture compression and HDR encoding Unity uses for this platform, which often turns out to be &amp;quot;Double LDR&amp;quot; ([https://docs.unity3d.com/Manual/Lightmaps-TechnicalInformation.html see details]). The problem is not exclusive to Bakery and will as well happen with built-in lightmaps.&lt;br /&gt;
&lt;br /&gt;
In Player Settings, set Lightmap Encoding to '''High Quality'''.&lt;br /&gt;
&lt;br /&gt;
If your target devices support ASTC compression, make sure it is enabled in Build settings. PVRTC is also a good choice, although it is mostly supported on iOS devices. ETC compression gives poor results for lightmaps.&lt;br /&gt;
&lt;br /&gt;
If above solutions are not enough, select lightmap assets and set texture compression quality to '''High''' or '''None''' (try both).&lt;br /&gt;
&lt;br /&gt;
Note that setting it to None will use more video memory on the device.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I have a scene baked with MonoSH, and lighting looks pixelated ===&lt;br /&gt;
[[File:Normalq.jpg|MonoSH compressed with low quality encoding|thumb]]&lt;br /&gt;
In some scenes, [[Manual#MonoSH|MonoSH]] lightmaps can look pixelated, if low (or &amp;quot;normal&amp;quot;) quality compression is used (e.g. DXT1). Usually setting Compression = High on the L1 texture fixes the issue.&lt;br /&gt;
&lt;br /&gt;
You can enable all L1 textures to always use High quality compression by toggling Project Settings -&amp;gt; Bakery -&amp;gt; '''High quality direction'''.&lt;br /&gt;
&lt;br /&gt;
Note that depending on the platform, High quality compression can take more memory. On PC it usually doubles by going from DXT1 to BC7 format.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== There are weird square artifacts on my geometry ===&lt;br /&gt;
[[File:Smoothnormals flatshape.jpg|Square artifacts from incorrect normals|thumb]]&lt;br /&gt;
Weird squares may sometimes be seen on models when their shape is too different from their normals. Bakery [https://ndotl.wordpress.com/#shadowterm tries to compensate] starting ray points to take fake normal smoothness into account, but in extreme cases the algorithm can't handle the discrepancy.&lt;br /&gt;
Usually it's enough to just recalculate normals on the model. E.g. in Unity you can select the FBX and change &amp;quot;Normals&amp;quot; to &amp;quot;Calculate&amp;quot; instead of &amp;quot;Import&amp;quot;.&lt;br /&gt;
Alternatively, you can disable the related compensation algorithm, but it’s actually beneficial in most cases. You can toggle it in Project Settings → Bakery → Generate smooth positions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get too many lightmaps ===&lt;br /&gt;
Possible causes are:&lt;br /&gt;
&lt;br /&gt;
* [[Manual#Atlas_Packer|Atlas packer]] is set to ''Default'' or ''Post-packing'' is disabled. Set Atlas Packer to ''xatlas'' and enable Post-packing for best results.&lt;br /&gt;
&lt;br /&gt;
* ''Texels Per Unit'' value is high or ''Max Resolution'' is low. Bakery packs objects from open scenes into multiple lightmap atlases and packs them as rectangles (in a fashion similar to [https://blackpawn.com/texts/lightmaps/default.html this]; unless Hole Filling is enabled) with their size dependent on (surface area * texels per unit). If some object can't fit into existing atlases, a new one is allocated. New atlases are always as large as the Max Resolution parameter, or smaller (but not smaller than ''Min Resolution''), if the estimated surface area of remaining unpacked objects is below some threshold. You can also increase Min Resolution a bit, replacing a bunch of small (but dense) maps with a few large (but possibly with some empty space).&lt;br /&gt;
&lt;br /&gt;
Additionally, increase ''Min Resolution'' to prefer larger combined lightmaps instead of many smaller ones.&lt;br /&gt;
&lt;br /&gt;
If not using post-packing:&lt;br /&gt;
&lt;br /&gt;
* If you bake multiple open scenes and ''Split by scene'' checkbox is on, different scenes will never share the same lightmap, therefore multiplying their count.&lt;br /&gt;
* If ''Terrain optimization'' is on, terrains will always use a separate lightmap.&lt;br /&gt;
Pre-atlasing your scene in your modelling package of choice and using the [https://geom.io/bakery/wiki/index.php?title=Manual#Bakery_Lightmap_Group_Selector Original UV] mode instead of relying on the auto-atlaser can significantly improve packing effectiveness.&lt;br /&gt;
&lt;br /&gt;
Since v1.71 Bakery prints number of future used lightmaps to console when enabling/refreshing Checker Preview. You can experiment with resolution/density settings until the desired value is printed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get jagged shadows ===&lt;br /&gt;
[[File:Softshadows.png|Jagged shadow mitigation|thumb]]&lt;br /&gt;
Apparently you are baking very sharp shadows at low resolution. Try increasing shadow spread parameter on the light ([[Manual#Bakery_Direct_Light|direct]] or [[Manual#Bakery_Point_Light|point]]) and optionally enable [[Manual#Shader_Tweaks|bicubic interpolation]].&lt;br /&gt;
On a [[Manual#Bakery_Direct_Light|Direct Light]] you can also enable the '''Anti-Alias''' option.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Exporting scene - preparing&amp;quot; is taking too long ===&lt;br /&gt;
(Or &amp;quot;Exporting scene - atlasing&amp;quot;)&lt;br /&gt;
* Try setting [[Manual#Atlas_Packer|Atlas Packer]] to Default.&lt;br /&gt;
* Make sure you use reasonable [[Manual#Texels_per_unit|Texels Per Unit]] value.&lt;br /&gt;
* Make sure your meshes are [[Manual#Quickstart|correctly unwrapped]].&lt;br /&gt;
* Possibly disable [[Manual#Asset_UV_Processing|UV Padding Adjustment]].&lt;br /&gt;
&lt;br /&gt;
If you're converting a large existing scene, make sure to follow [[How_do_I...#How_do_I_quickly_port_my_existing_scene_to_Bakery.3F|this guide]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Stuck at &amp;quot;Waiting for Unity to initialize the probes...&amp;quot; ===&lt;br /&gt;
There isn't much Bakery can do about the logic of Unity lighting data asset generation (there is no API in the engine to control it at the moment). Try to focus editor window (especially scene view) to wake Unity up.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Baked prefabs instantiated at runtime in a build have no lightmaps ===&lt;br /&gt;
Because Unity technically has no support for prefabs having lightmaps, it can omit lightmapped shader versions from builds, not realizing they are needed. You can fix it by going to [https://docs.unity3d.com/Manual/class-GraphicsSettings.html?_ga=2.212464724.1917527976.1586930444-1257434621.1522062178#stripping Shader stripping settings] and enabling lightmap modes you use.&lt;br /&gt;
Additionally, try disabling '''Optimize Mesh Data''' in Player Settings, as Unity may omit UV from the build.&lt;br /&gt;
&lt;br /&gt;
{{note|In Shader Stripping settings &amp;quot;Directional&amp;quot; mode only applies to standard Unity directional maps aka [[Manual#Dominant_Direction|Dominant Direction]]. When using Baked Normal Maps, RNM or SH, use &amp;quot;Non-directional&amp;quot; lightmap mode checkboxes.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Speedtrees look fine in the editor, but black in builds ===&lt;br /&gt;
Also related to shader stripping. See the [[Troubleshooting#Baked_prefabs_instantiated_at_runtime_in_a_build_have_no_lightmaps|prefab solution]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Scene is black in build ===&lt;br /&gt;
See advice above. Additionally, if the scene is loaded asynchronously, call ftLightmaps.RefreshFull() when it is fully loaded.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== HDRI produces scattered bright spots (fireflies) ===&lt;br /&gt;
[[File:Fireflies.jpg|thumb|Typical &amp;quot;fireflies&amp;quot;]]&lt;br /&gt;
[[File:Upload 2019-7-3 11-27-22.png|thumb|Removing sun from HDRI]]&lt;br /&gt;
This artefact comes from the fact your HDRI has very bright, yet very small parts, typically sun. Rays will miss it often, producing occasional spots when they don't. This problem is well known in many offline ray tracers as well.&lt;br /&gt;
* Use [[Manual#Bakery_Direct_Light|Direct Light]] for the sun&lt;br /&gt;
* Remove sun from HDRI (also [https://seblagarde.wordpress.com/2016/08/28/siggraph-2016-an-artist-friendly-workflow-for-panoramic-hdri/ recommended by Unity])&lt;br /&gt;
* Possibly downsample/blur the HDRI&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Small emissive (or brightly lit) surfaces produce noise ===&lt;br /&gt;
The issue is similar to the one above and may happen when using very small and very bright emissive surfaces, or small non-emissive surfaces lit by a very intense light. In case of emissive surfaces, you can replace them with [[Manual#Bakery_Light_Mesh|Light Meshes]] to prevent it. See [[Manual#Differences_between_Light_Mesh_and_emissive_materials|Differences between Light Mesh and emissive materials]]. Alternatively, try increasing [[Manual#Samples|GI sample count]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Adjusting UV padding&amp;quot; happens too often and takes too much time ===&lt;br /&gt;
[[Manual#Asset_UV_Processing|UV padding adjustment]] is a feature that optimizes asset UVs based on the size they take in lightmaps. This process will happen for a model if:&lt;br /&gt;
* Option is globally enabled.&lt;br /&gt;
* Asset has &amp;quot;Generate Lightmap UVs&amp;quot; checkbox enabled. Models with custom UVs are not adjusted.&lt;br /&gt;
* Model was not adjusted before or...&lt;br /&gt;
* ... its lightmap size has changed.&lt;br /&gt;
Therefore it can be triggered for all auto-unwrapped models after their geometry or resolution changes.&lt;br /&gt;
UV padding adjustment will try to waste less lightmap resolution and reduce texel leaking, but it is not necessary. If you are doing many experimental/draft bakes, you may consider disabling it (set to &amp;quot;Don't change&amp;quot;), then possibly enabling it back for the final quality bake.&lt;br /&gt;
&lt;br /&gt;
Also note that using xatlas as [[Manual#Unwrapper|Unwrapper]] can be notoriously slower comparing to Default.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser produces bright edges around geometry/shadows ===&lt;br /&gt;
[[File:Bredges.jpg|thumb|Bright edges]]&lt;br /&gt;
Sometimes you may encounter bright edges or spots at high contrast edges caused by the denoising neural net, most notably OptiX 6 and 7.&lt;br /&gt;
* Use OptiX 5 or OpenImageDenoise if you can ([[Manual#Denoiser|denoiser]] option).&lt;br /&gt;
* Try enabling [[Manual#Denoise:_fix_bright_edges|Denoise: Fix bright edges]].&lt;br /&gt;
* Try setting texture compression to None on lightmap assets.&lt;br /&gt;
* Try setting [[Manual#Backface_GI|Backface GI]] to 1, removing dark shadows inside objects. While these shadows are normally not visible, their edges may cause problems for both the denoiser and texture compression.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Light probes are too bright in Subtractive mode ===&lt;br /&gt;
&lt;br /&gt;
[[File:98911466-ae8c5b00-24d5-11eb-8d51-4e764ac0f163.png|thumb|The effect of occlusion probes]]&lt;br /&gt;
&lt;br /&gt;
Light occlusion information is not baked into probes. Solution:&lt;br /&gt;
* Set your Unity directional light to Mixed mode.&lt;br /&gt;
* Enable [[Manual#Occlusion_probes|Occlusion Probes]].&lt;br /&gt;
* Bake&lt;br /&gt;
&lt;br /&gt;
Some versions of Unity may need a scene reload to properly apply the Lighting Data Asset.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Baking produces &amp;quot;Not allowed to access uv2&amp;quot; errors ===&lt;br /&gt;
All lightmapped models must have [https://docs.unity3d.com/Manual/FBXImporter-Model.html Read/Write enabled] on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Whole scene is very bright or black ===&lt;br /&gt;
* Check if your light intensities are in a reasonable range (&amp;lt; 100; or &amp;lt;= 100000 Lux in HDRP).&lt;br /&gt;
* Check the same for indirect intensity on all lights. A multiplication of direct and intensity intensity must not go into thousands, otherwise GI algorithm may overflow.&lt;br /&gt;
* Check if you don't use assets with High mesh compression. When set to High, Unity mesh compression will completely destroy lightmap UVs, only leaving 8 bits for them. This may produce many lightmapping errors including this one.&lt;br /&gt;
* Check if you have any .hdr overrides in the Preset Manager that change the way lightmaps are imported.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery says &amp;quot;Device is not DX11&amp;quot; ===&lt;br /&gt;
Currently Bakery needs Unity editor to be running in DX11 mode to directly exchange texture data, so make sure your editor's window header says &amp;quot;&amp;lt;DX11&amp;gt;&amp;quot;. If it does not, change active graphics API to DX11: &lt;br /&gt;
* Go to Player Settings.&lt;br /&gt;
* If &amp;quot;Auto Graphics API for Windows&amp;quot; is unchecked, you will see a list of APIs.&lt;br /&gt;
* Make sure &amp;quot;Direct3D11&amp;quot; is on top or place it there.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery doesn't work on my 3070/3080/3090 GPU? ===&lt;br /&gt;
1. Please enable [[Manual#RTX_Mode|RTX mode]].&lt;br /&gt;
&lt;br /&gt;
2. If denoiser also fails, please update from [[Github_access|github]] and use OpenImageDenoise option (some instructions are [[Troubleshooting#Denoiser_produces_bright_edges_around_geometry.2Fshadows|here]]).&lt;br /&gt;
&lt;br /&gt;
Updated denoiser (both new OptiX version and OpenImageDenoise) as well as automatic hardware detection will be soon released on the Asset Store.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser produces grid-like patterns ===&lt;br /&gt;
[[File:Gridlike.jpg|thumb|Grid-like denoiser pattern]]&lt;br /&gt;
&lt;br /&gt;
OptiX denoiser might produdce grid-like patterns when fed with very low-precision lightmaps. Low precision is usually caused by either extremely dark or extremely bright lighting. It is recommended to stay within reasonable intensity range (see a similar advice for [[Troubleshooting#Lightmaps_look_black_or_have_bad_quality_in_an_HDRP_scene|HDRP]] above).&lt;br /&gt;
&lt;br /&gt;
* Alternatively use OpenImageDenoise, as it does not produce this pattern.&lt;br /&gt;
&lt;br /&gt;
* This issue also does not affect OptiX 5.1 denoiser (&amp;quot;Legacy denoiser&amp;quot;) as its training dataset is in its own DLL, but affects the non-legacy version (OptiX 6.0) and only on driver versions newer than 442.50, as the training datasets are in the driver ([https://forums.developer.nvidia.com/t/optix7-denoiser-different-results-with-different-version-of-drivers/117989/2 explanation from NVIDIA]).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get &amp;quot;rtcRes == RTC_SUCCESS&amp;quot; error ===&lt;br /&gt;
&lt;br /&gt;
You are using a 3xxx+ GPU with RTX mode disabled. Enable [[Manual#RTX_Mode|RTX mode]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Baking any scene crashes with unknown error ===&lt;br /&gt;
&lt;br /&gt;
There were [https://twitter.com/HarryAlisavakis/status/1331630028665348096 some reports] that Avast antivirus can block Bakery from running, even though Bakery's executables don't trigger any antivirus (including Avast) when [https://twitter.com/guycalledfrank/status/1331640614077796354 scanned via VirusTotal]. Perhaps it just block any executables that were launched 'indirectly', i.e. from another application. In any case, if you have Avast, try adding your project folder to exception list.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Combined meshes (e.g. using Mesh Combine asset) bake incorrectly ===&lt;br /&gt;
&lt;br /&gt;
[[File:Meshcombine.jpg|thumb|Mesh Combine &amp;quot;Regenerate Lightmap UVs&amp;quot; option]]&lt;br /&gt;
&lt;br /&gt;
Most mesh combining assets have an option to regenerate lightmap UVs. Without it, combined UVs will overlap each other. If you are using Mesh Combine, make sure &amp;quot;Regenerate Lightmap UVs&amp;quot; option is enabled in output settings.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a &amp;quot;Can't create vertex buffer&amp;quot; error ===&lt;br /&gt;
&lt;br /&gt;
This error can happen if the scene has more than ~40 million vertices. It is recommended to reduce geometric complexity of the scene, as tracing it would be too slow anyway. The typical cause of going over this limit is trying to bake with large arrays of trees painted on the terrain. In this case try disabling [[Manual#Export_terrain_trees|Export Terrain Trees]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Soft shadows appear like multiple hard shadows ===&lt;br /&gt;
&lt;br /&gt;
[[File:Unknown.png|thumb|Undersampled shadow]]&lt;br /&gt;
&lt;br /&gt;
Increase ''Shadow Samples'' on the light or decrease the ''Shadow Spread''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Lightmaps are black on GTX 650 ===&lt;br /&gt;
&lt;br /&gt;
Apparently newer Nvidia drivers deprecate some CUDA functions on older hardware. It is recommended to use driver version 442 on GTX 650, as it still supported everything Bakery uses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Lightmaps disappear on play ===&lt;br /&gt;
&lt;br /&gt;
* Make sure that '''Project Settings''' -&amp;gt; '''Editor''' -&amp;gt; '''Enter Play Mode Settings''' -&amp;gt; '''Reload Scene''' is turned '''on'''.&lt;br /&gt;
* If that doesn't help, try applying the latest [[Github_access|patch]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a DllNotFoundException ===&lt;br /&gt;
&lt;br /&gt;
* Check if the DLL file mentioned in the error actually exists in your project. If it doesn't, your Bakery installation is incomplete or corrupted; please reinstall it.&lt;br /&gt;
* Check if you're running 64-bit Unity Editor under 64-bit Windows (7 or newer) (as listed in [[Manual#System_requirements|system requirements]]).&lt;br /&gt;
* Make sure you have 64-bit [https://www.microsoft.com/en-us/download/details.aspx?id=48145 Visual C++ Redistributables for Visual Studio 2015] installed. In case if the Microsoft site download is broken, here is a [https://drive.google.com/file/d/1WfRP1A43bCwZflZ_I0wHSGPyC3b-0lqK/view?usp=sharing reupload].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Lightmap UVs are wrong when opening previously baked project on a Mac ===&lt;br /&gt;
&lt;br /&gt;
When Unity reimports model assets, it performs UV unwrapping. If you baked the scene with [[Manual#Unwrapper|Unwrapper]] was set to xatlas, it won't work on a Mac because Bakery's xatlas wrapper library is only compiled for Windows. Rebaking with Default unwrapper should fix it.&lt;br /&gt;
&lt;br /&gt;
You can still keep xatlas as the [[Manual#Atlas_Packer|Atlas Packer]].&lt;br /&gt;
&lt;br /&gt;
''Unwrapper'' is used to generate UVs for individual, isolated meshes, while ''Atlas Packer'' packs big scene-specific atlases out of many unwrapped layouts.&lt;br /&gt;
&lt;br /&gt;
Combining Default unwrapper with xatlas being used as the Atlas Packer and enabling [[Manual#Hole_filling|Hole Filling]] should give pretty good [https://x.com/guycalledfrank/status/1231890428313600000 results] and compensate for any individual mesh unwrapping inefficiencies.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Error message &amp;quot;Failed to load OptiX library&amp;quot; ===&lt;br /&gt;
&lt;br /&gt;
Nvidia driver 590 (and newer) removed support for OptiX 6.0 which Bakery depended on. Bakery v1.98 added support for the new driver, now using OptiX 9.0.&lt;br /&gt;
* Make sure you're using a [[Manual#System_requirements|supported Nvidia GPU]].&lt;br /&gt;
* Update Bakery to v1.98 via the [https://assetstore.unity.com/packages/tools/level-design/bakery-gpu-lightmapper-122218 Asset Store], [[Github_access|github or the built-in patcher]].&lt;br /&gt;
* If you still get the error every time, click '''Bakery -&amp;gt; Utilities -&amp;gt; Detect Optimal Settings''' and choose &amp;quot;Set recommended as default&amp;quot;.&lt;br /&gt;
* If you don't want to update Bakery, roll back your GPU driver to any pre-590 version (e.g. [https://www.nvidia.com/en-eu/geforce/drivers/results/257569/ 581.80]).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Point Light with a cookie/cubemap is black ===&lt;br /&gt;
Note that Bakery supports colored cookies and reads RGB from cookie/cubemap textures. Unity, on the other hand, only supports grayscale cookies. Setting Texture Type to &amp;quot;Cookie&amp;quot; on the asset will convert it to a single-channel A8 format. For Bakery, leave Texture Type to Default.&lt;/div&gt;</summary>
		<author><name>Mr F</name></author>
		
	</entry>
	<entry>
		<id>https://geom.io/bakery/wiki/index.php?title=Troubleshooting&amp;diff=1864</id>
		<title>Troubleshooting</title>
		<link rel="alternate" type="text/html" href="https://geom.io/bakery/wiki/index.php?title=Troubleshooting&amp;diff=1864"/>
		<updated>2026-02-07T21:14:15Z</updated>

		<summary type="html">&lt;p&gt;Mr F: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a list of common problems, their symptoms and solutions.&lt;br /&gt;
&lt;br /&gt;
=== Shadowmasks are not baked ===&lt;br /&gt;
Check following things:&lt;br /&gt;
* Bakery's [[Manual#Render Mode|Render Mode]] is set to Shadowmask.&lt;br /&gt;
* Masked lights have both Unity and Bakery light components on them.&lt;br /&gt;
* Masked Bakery light components have &amp;quot;Baked contribution&amp;quot; set to &amp;quot;Indirect and shadowmask&amp;quot;.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Shadowmasks are baked, but Unity renders real-time shadows instead ===&lt;br /&gt;
You're in Distance Shadowmask mode, it's expected. Read more about the difference:&lt;br /&gt;
&lt;br /&gt;
https://docs.unity3d.com/Manual/LightMode-Mixed-Shadowmask.html&lt;br /&gt;
&lt;br /&gt;
https://docs.unity3d.com/Manual/LightMode-Mixed-DistanceShadowmask.html&lt;br /&gt;
&lt;br /&gt;
* To switch between two modes, you can use &amp;quot;Distance Shadowmask&amp;quot; checkbox in Bakery main window.&lt;br /&gt;
* If you're on 5.6, go to Window-&amp;gt;Lighting-&amp;gt;Mixed Lighting-&amp;gt;Lighting Mode to switch the mode.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I can't see specular lighting after the bake ===&lt;br /&gt;
Apparently specular lighting was provided by real-time lights before the bake. Now the lighting is baked into static textures and there is no specular. However, you can:&lt;br /&gt;
* Use Reflection Probes. Good option for highly glossy objects.&lt;br /&gt;
* Use mixed lights and only bake GI/[[Manual#Shadowmask|Shadowmasks]]. Specular remains real-time.&lt;br /&gt;
* Bake in [[Manual#Dominant_Direction|Dominant Direction]] or [[Manual#SH|SH]] mode and use [[Manual#Bakery_shaders|Bakery shaders]] with &amp;quot;Lightmapped specular&amp;quot; option. It will give some specular approximation. Looks good on surfaces with medium/high roughness.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Using a version control system I copied the scene to another PC and it doesn't look right ===&lt;br /&gt;
Make sure you followed [[How_do_I...#How_do_I_use_git.2Fcollab.2Fother_version_control_system_with_Bakery.3F|version control guidelines]].&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Baking same asset in one scene breaks its UVs in another scene ===&lt;br /&gt;
The reason here is [[Manual#Asset_UV_Processing|UV padding adjustment]]. It modifies the UVs in the asset, so spacing between UV charts is optimal, meaning they never leak over each other and there is no much wasted space. Unity has a manual Pack Margin option on model assets, but it’s limited since it applies the same exact value for all meshes inside the model, while each mesh can get drastically different size in the final lightmap based on its surface area. Therefore Bakery overrides it with automatically calculated per-mesh (instead of per-model) padding. However, because “optimal” varies depending on baking resolution, it can be problematic to reuse the same asset in isolated scenes with different lightmap size. There are multiple ways to solve it:&lt;br /&gt;
* a) Just disable UV padding adjustment (set to [[Manual#Asset_UV_Processing|Don't Change]]). Results will be similar to built-in baking.&lt;br /&gt;
* b) Generate your own optimal UVs. UV padding adjustment only applies to models with auto-generated UV layout (aka “Generate Lightmap UVs” checkbox) and never touches custom data.&lt;br /&gt;
* c) Set Asset UV Processing to &amp;quot;Adjust UV padding only for new meshes&amp;quot; (currently available in the [[Github_access|github]] version).&lt;br /&gt;
* d) Use [[Manual#UV_padding:_increase_only|UV padding: increase only]] checkbox and first bake the lowest resolution scene, and then the rest.&lt;br /&gt;
* e) Use two different models for different lightmap resolutions, so each will get the most efficient set of UVs.&lt;br /&gt;
* f) Bake both scenes together.&lt;br /&gt;
* g) Lock UVs using [[How_do_I...#Alternative_solution|Save UV padding to asset]]&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser throws error 505 or Unknown error ===&lt;br /&gt;
[https://www.nvidia.com/Download/index.aspx?lang=en-US Update the driver].&lt;br /&gt;
&lt;br /&gt;
If you are using a Kepler GPU, try switching to [[Manual#Legacy_denoiser|legacy denoiser]].&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get an “Out of memory” error ===&lt;br /&gt;
This means rendering needed more video memory from your GPU than it has available.&lt;br /&gt;
&lt;br /&gt;
First, try closing any other graphics-intensive programs (browsers too).&lt;br /&gt;
&lt;br /&gt;
If the problem persists, the most likely reason is that the resolution you selected is unreasonably high for the given scene. Resolution is defined by [[Manual#Texels_per_unit|Texels per Unit]] (this section also has a list of reference values) or set explicitly in [[Manual#Bakery_Lightmap_Group_Selector|Lightmap Groups]]. Reducing it will help. You can always selectively use high resolution for important objects via [https://docs.unity3d.com/Manual/class-MeshRenderer.html Scale in Lightmap].&lt;br /&gt;
&lt;br /&gt;
If you have terrains in your scene, make sure [[Manual#Terrain_optimization|Terrain optimization]] is enabled.&lt;br /&gt;
&lt;br /&gt;
If you have a very high amount of painted trees on your terrain, try disabling the [[Manual#Export_terrain_trees|Export terrain trees]] option.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a “Can't map texture” error ===&lt;br /&gt;
Typically happens if your system went out of RAM (system memory, not video memory) during the scene export process. Your scene could already be taking too much RAM by itself, not leaving enough free memory for Bakery export.&lt;br /&gt;
&lt;br /&gt;
* Try closing any memory-intensive programs before baking.&lt;br /&gt;
* Try reducing [[Manual#Max_resolution|Max Resolution]] from 4096 to 2048.&lt;br /&gt;
* If you are baking very highly detailed (millions of triangles) geometry, try excluding some of it from the bake.&lt;br /&gt;
* Try disabling [[Manual#Export_terrain_trees|Export terrain trees]].&lt;br /&gt;
* Try enabling [[Manual#Terrain_optimization|Terrain optimization]].&lt;br /&gt;
&lt;br /&gt;
This error can also be shown in case of GPU driver crash, in which case Unity editor also won't render anything.&lt;br /&gt;
&lt;br /&gt;
If this error happens at the end of the render process (from the seamfixer app), try increasing the [[Troubleshooting#I_get_a_.22Launch_timeout.22_error|TDR]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a “Can't create texture” or &amp;quot;Can't create rasterizer state&amp;quot; error ===&lt;br /&gt;
Typically errors like this are caused by such chain of events:&lt;br /&gt;
* Some objects in the scene have incorrect lightmapping UVs. Often the UVs contain many large triangles overlapping each other.&lt;br /&gt;
* Scene uses large lightmaps.&lt;br /&gt;
* Bakery tries to rasterize a huge amount of 4k-sized overlapping triangles to prepare the UV GBuffer.&lt;br /&gt;
* This operation takes &amp;gt; 2 seconds, and the driver is reset by Windows due to TDR: https://docs.microsoft.com/en-us/windows-hardware/drivers/display/timeout-detection-and-recovery&lt;br /&gt;
* Consequent GPU operations are failed due to reset.&lt;br /&gt;
&lt;br /&gt;
Solution:&lt;br /&gt;
* Make sure all your objects either have non-overlapping UV2 or enable &amp;quot;Generate lightmapping UVs&amp;quot; on all model assets.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== After importing Bakery I get errors containing “obsolete” and “UnityUpgradable” ===&lt;br /&gt;
Before importing Bakery, make sure you don't have any compilation errors in your project.&lt;br /&gt;
&lt;br /&gt;
Restart Unity, reimport the package. Click “I made a backup, go ahead” if Unity asks.&lt;br /&gt;
&lt;br /&gt;
See [https://docs.unity3d.com/Manual/APIUpdater.html this page] for more details.&lt;br /&gt;
&lt;br /&gt;
It is also known that some versions of Unity Hub have a [https://forum.unity.com/threads/bakery-gpu-lightmapper-v1-6-released.536008/page-63#post-4668227 bug] preventing API updater from running.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a &amp;quot;Can't load&amp;quot; error ===&lt;br /&gt;
If Bakery says it can't load something, make sure you have enough free disk space on the drive used for [[Manual#Temp_path|temporary data]].&lt;br /&gt;
&lt;br /&gt;
Some parts of Bakery can't deal with non-ASCII characters (this is going to be fixed soon). Try naming your scenes and lightmap group assets with ASCII characters. Latin letters and numbers must always work.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a &amp;quot;Launch timeout&amp;quot; error ===&lt;br /&gt;
This error can happen if your GPU took more time than it is allowed by [https://docs.microsoft.com/en-us/windows-hardware/drivers/display/timeout-detection-and-recovery Windows TDR].&lt;br /&gt;
* Try disabling [[Manual#Terrain_optimization|Terrain Optimization]].&lt;br /&gt;
* Try lowering the value of [[Manual#Tile_size|Tile Size]], especially if it's higher than 512, so baking job is split into smaller chunks.&lt;br /&gt;
* Depending on the pass being processed, try lowering the Samples value (e.g. [[Manual#Samples|GI samples]], [[Manual#Bakery_Sky_Light|Skylight samples]], etc).&lt;br /&gt;
* Reduce geometric complexity of the scene, if tile size/samples don't help.&lt;br /&gt;
* As a last resort, [https://docs.microsoft.com/en-us/windows-hardware/drivers/display/tdr-registry-keys disable TDR registry keys]. This will prevent Windows from resetting the driver, but your computer may appear unresponsive during the bake.&lt;br /&gt;
&lt;br /&gt;
[https://substance3d.adobe.com/documentation/spdoc/gpu-drivers-crash-with-long-computations-tdr-crash-128745489.html Additional instructions for changing the timeout (from Substance)]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I have an Android project, and lightmaps don't look good ===&lt;br /&gt;
[[File:Banding.jpg|Android banding artifacts|thumb]]&lt;br /&gt;
[[File:LightmapsTechnicalDetails.png|Lightmap encoding in player settings|thumb]]&lt;br /&gt;
[[File:Astc.jpg|Build texture compression settings|thumb]]&lt;br /&gt;
Sometimes, when working on Android projects, you may encounter banding artifacts, with gradients having discrete steps of different hue.&lt;br /&gt;
This is caused by texture compression and HDR encoding Unity uses for this platform, which often turns out to be &amp;quot;Double LDR&amp;quot; ([https://docs.unity3d.com/Manual/Lightmaps-TechnicalInformation.html see details]). The problem is not exclusive to Bakery and will as well happen with built-in lightmaps.&lt;br /&gt;
&lt;br /&gt;
In Player Settings, set Lightmap Encoding to '''High Quality'''.&lt;br /&gt;
&lt;br /&gt;
If your target devices support ASTC compression, make sure it is enabled in Build settings. PVRTC is also a good choice, although it is mostly supported on iOS devices. ETC compression gives poor results for lightmaps.&lt;br /&gt;
&lt;br /&gt;
If above solutions are not enough, select lightmap assets and set texture compression quality to '''High''' or '''None''' (try both).&lt;br /&gt;
&lt;br /&gt;
Note that setting it to None will use more video memory on the device.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I have a scene baked with MonoSH, and lighting looks pixelated ===&lt;br /&gt;
[[File:Normalq.jpg|MonoSH compressed with low quality encoding|thumb]]&lt;br /&gt;
In some scenes, [[Manual#MonoSH|MonoSH]] lightmaps can look pixelated, if low (or &amp;quot;normal&amp;quot;) quality compression is used (e.g. DXT1). Usually setting Compression = High on the L1 texture fixes the issue.&lt;br /&gt;
&lt;br /&gt;
You can enable all L1 textures to always use High quality compression by toggling Project Settings -&amp;gt; Bakery -&amp;gt; '''High quality direction'''.&lt;br /&gt;
&lt;br /&gt;
Note that depending on the platform, High quality compression can take more memory. On PC it usually doubles by going from DXT1 to BC7 format.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== There are weird square artifacts on my geometry ===&lt;br /&gt;
[[File:Smoothnormals flatshape.jpg|Square artifacts from incorrect normals|thumb]]&lt;br /&gt;
Weird squares may sometimes be seen on models when their shape is too different from their normals. Bakery [https://ndotl.wordpress.com/#shadowterm tries to compensate] starting ray points to take fake normal smoothness into account, but in extreme cases the algorithm can't handle the discrepancy.&lt;br /&gt;
Usually it's enough to just recalculate normals on the model. E.g. in Unity you can select the FBX and change &amp;quot;Normals&amp;quot; to &amp;quot;Calculate&amp;quot; instead of &amp;quot;Import&amp;quot;.&lt;br /&gt;
Alternatively, you can disable the related compensation algorithm, but it’s actually beneficial in most cases. You can toggle it in Project Settings → Bakery → Generate smooth positions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get too many lightmaps ===&lt;br /&gt;
Possible causes are:&lt;br /&gt;
&lt;br /&gt;
* [[Manual#Atlas_Packer|Atlas packer]] is set to ''Default'' or ''Post-packing'' is disabled. Set Atlas Packer to ''xatlas'' and enable Post-packing for best results.&lt;br /&gt;
&lt;br /&gt;
* ''Texels Per Unit'' value is high or ''Max Resolution'' is low. Bakery packs objects from open scenes into multiple lightmap atlases and packs them as rectangles (in a fashion similar to [https://blackpawn.com/texts/lightmaps/default.html this]; unless Hole Filling is enabled) with their size dependent on (surface area * texels per unit). If some object can't fit into existing atlases, a new one is allocated. New atlases are always as large as the Max Resolution parameter, or smaller (but not smaller than ''Min Resolution''), if the estimated surface area of remaining unpacked objects is below some threshold. You can also increase Min Resolution a bit, replacing a bunch of small (but dense) maps with a few large (but possibly with some empty space).&lt;br /&gt;
&lt;br /&gt;
Additionally, increase ''Min Resolution'' to prefer larger combined lightmaps instead of many smaller ones.&lt;br /&gt;
&lt;br /&gt;
If not using post-packing:&lt;br /&gt;
&lt;br /&gt;
* If you bake multiple open scenes and ''Split by scene'' checkbox is on, different scenes will never share the same lightmap, therefore multiplying their count.&lt;br /&gt;
* If ''Terrain optimization'' is on, terrains will always use a separate lightmap.&lt;br /&gt;
Pre-atlasing your scene in your modelling package of choice and using the [https://geom.io/bakery/wiki/index.php?title=Manual#Bakery_Lightmap_Group_Selector Original UV] mode instead of relying on the auto-atlaser can significantly improve packing effectiveness.&lt;br /&gt;
&lt;br /&gt;
Since v1.71 Bakery prints number of future used lightmaps to console when enabling/refreshing Checker Preview. You can experiment with resolution/density settings until the desired value is printed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get jagged shadows ===&lt;br /&gt;
[[File:Softshadows.png|Jagged shadow mitigation|thumb]]&lt;br /&gt;
Apparently you are baking very sharp shadows at low resolution. Try increasing shadow spread parameter on the light ([[Manual#Bakery_Direct_Light|direct]] or [[Manual#Bakery_Point_Light|point]]) and optionally enable [[Manual#Shader_Tweaks|bicubic interpolation]].&lt;br /&gt;
On a [[Manual#Bakery_Direct_Light|Direct Light]] you can also enable the '''Anti-Alias''' option.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Exporting scene - preparing&amp;quot; is taking too long ===&lt;br /&gt;
(Or &amp;quot;Exporting scene - atlasing&amp;quot;)&lt;br /&gt;
* Try setting [[Manual#Atlas_Packer|Atlas Packer]] to Default.&lt;br /&gt;
* Make sure you use reasonable [[Manual#Texels_per_unit|Texels Per Unit]] value.&lt;br /&gt;
* Make sure your meshes are [[Manual#Quickstart|correctly unwrapped]].&lt;br /&gt;
* Possibly disable [[Manual#Asset_UV_Processing|UV Padding Adjustment]].&lt;br /&gt;
&lt;br /&gt;
If you're converting a large existing scene, make sure to follow [[How_do_I...#How_do_I_quickly_port_my_existing_scene_to_Bakery.3F|this guide]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Stuck at &amp;quot;Waiting for Unity to initialize the probes...&amp;quot; ===&lt;br /&gt;
There isn't much Bakery can do about the logic of Unity lighting data asset generation (there is no API in the engine to control it at the moment). Try to focus editor window (especially scene view) to wake Unity up.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Baked prefabs instantiated at runtime in a build have no lightmaps ===&lt;br /&gt;
Because Unity technically has no support for prefabs having lightmaps, it can omit lightmapped shader versions from builds, not realizing they are needed. You can fix it by going to [https://docs.unity3d.com/Manual/class-GraphicsSettings.html?_ga=2.212464724.1917527976.1586930444-1257434621.1522062178#stripping Shader stripping settings] and enabling lightmap modes you use.&lt;br /&gt;
Additionally, try disabling '''Optimize Mesh Data''' in Player Settings, as Unity may omit UV from the build.&lt;br /&gt;
&lt;br /&gt;
{{note|In Shader Stripping settings &amp;quot;Directional&amp;quot; mode only applies to standard Unity directional maps aka [[Manual#Dominant_Direction|Dominant Direction]]. When using Baked Normal Maps, RNM or SH, use &amp;quot;Non-directional&amp;quot; lightmap mode checkboxes.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Speedtrees look fine in the editor, but black in builds ===&lt;br /&gt;
Also related to shader stripping. See the [[Troubleshooting#Baked_prefabs_instantiated_at_runtime_in_a_build_have_no_lightmaps|prefab solution]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Scene is black in build ===&lt;br /&gt;
See advice above. Additionally, if the scene is loaded asynchronously, call ftLightmaps.RefreshFull() when it is fully loaded.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== HDRI produces scattered bright spots (fireflies) ===&lt;br /&gt;
[[File:Fireflies.jpg|thumb|Typical &amp;quot;fireflies&amp;quot;]]&lt;br /&gt;
[[File:Upload 2019-7-3 11-27-22.png|thumb|Removing sun from HDRI]]&lt;br /&gt;
This artefact comes from the fact your HDRI has very bright, yet very small parts, typically sun. Rays will miss it often, producing occasional spots when they don't. This problem is well known in many offline ray tracers as well.&lt;br /&gt;
* Use [[Manual#Bakery_Direct_Light|Direct Light]] for the sun&lt;br /&gt;
* Remove sun from HDRI (also [https://seblagarde.wordpress.com/2016/08/28/siggraph-2016-an-artist-friendly-workflow-for-panoramic-hdri/ recommended by Unity])&lt;br /&gt;
* Possibly downsample/blur the HDRI&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Small emissive (or brightly lit) surfaces produce noise ===&lt;br /&gt;
The issue is similar to the one above and may happen when using very small and very bright emissive surfaces, or small non-emissive surfaces lit by a very intense light. In case of emissive surfaces, you can replace them with [[Manual#Bakery_Light_Mesh|Light Meshes]] to prevent it. See [[Manual#Differences_between_Light_Mesh_and_emissive_materials|Differences between Light Mesh and emissive materials]]. Alternatively, try increasing [[Manual#Samples|GI sample count]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Adjusting UV padding&amp;quot; happens too often and takes too much time ===&lt;br /&gt;
[[Manual#Asset_UV_Processing|UV padding adjustment]] is a feature that optimizes asset UVs based on the size they take in lightmaps. This process will happen for a model if:&lt;br /&gt;
* Option is globally enabled.&lt;br /&gt;
* Asset has &amp;quot;Generate Lightmap UVs&amp;quot; checkbox enabled. Models with custom UVs are not adjusted.&lt;br /&gt;
* Model was not adjusted before or...&lt;br /&gt;
* ... its lightmap size has changed.&lt;br /&gt;
Therefore it can be triggered for all auto-unwrapped models after their geometry or resolution changes.&lt;br /&gt;
UV padding adjustment will try to waste less lightmap resolution and reduce texel leaking, but it is not necessary. If you are doing many experimental/draft bakes, you may consider disabling it (set to &amp;quot;Don't change&amp;quot;), then possibly enabling it back for the final quality bake.&lt;br /&gt;
&lt;br /&gt;
Also note that using xatlas as [[Manual#Unwrapper|Unwrapper]] can be notoriously slower comparing to Default.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser produces bright edges around geometry/shadows ===&lt;br /&gt;
[[File:Bredges.jpg|thumb|Bright edges]]&lt;br /&gt;
Sometimes you may encounter bright edges or spots at high contrast edges caused by the denoising neural net, most notably OptiX 6 and 7.&lt;br /&gt;
* Use OptiX 5 or OpenImageDenoise if you can ([[Manual#Denoiser|denoiser]] option).&lt;br /&gt;
* Try enabling [[Manual#Denoise:_fix_bright_edges|Denoise: Fix bright edges]].&lt;br /&gt;
* Try setting texture compression to None on lightmap assets.&lt;br /&gt;
* Try setting [[Manual#Backface_GI|Backface GI]] to 1, removing dark shadows inside objects. While these shadows are normally not visible, their edges may cause problems for both the denoiser and texture compression.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Light probes are too bright in Subtractive mode ===&lt;br /&gt;
&lt;br /&gt;
[[File:98911466-ae8c5b00-24d5-11eb-8d51-4e764ac0f163.png|thumb|The effect of occlusion probes]]&lt;br /&gt;
&lt;br /&gt;
Light occlusion information is not baked into probes. Solution:&lt;br /&gt;
* Set your Unity directional light to Mixed mode.&lt;br /&gt;
* Enable [[Manual#Occlusion_probes|Occlusion Probes]].&lt;br /&gt;
* Bake&lt;br /&gt;
&lt;br /&gt;
Some versions of Unity may need a scene reload to properly apply the Lighting Data Asset.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Baking produces &amp;quot;Not allowed to access uv2&amp;quot; errors ===&lt;br /&gt;
All lightmapped models must have [https://docs.unity3d.com/Manual/FBXImporter-Model.html Read/Write enabled] on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Whole scene is very bright or black ===&lt;br /&gt;
* Check if your light intensities are in a reasonable range (&amp;lt; 100; or &amp;lt;= 100000 Lux in HDRP).&lt;br /&gt;
* Check the same for indirect intensity on all lights. A multiplication of direct and intensity intensity must not go into thousands, otherwise GI algorithm may overflow.&lt;br /&gt;
* Check if you don't use assets with High mesh compression. When set to High, Unity mesh compression will completely destroy lightmap UVs, only leaving 8 bits for them. This may produce many lightmapping errors including this one.&lt;br /&gt;
* Check if you have any .hdr overrides in the Preset Manager that change the way lightmaps are imported.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery says &amp;quot;Device is not DX11&amp;quot; ===&lt;br /&gt;
Currently Bakery needs Unity editor to be running in DX11 mode to directly exchange texture data, so make sure your editor's window header says &amp;quot;&amp;lt;DX11&amp;gt;&amp;quot;. If it does not, change active graphics API to DX11: &lt;br /&gt;
* Go to Player Settings.&lt;br /&gt;
* If &amp;quot;Auto Graphics API for Windows&amp;quot; is unchecked, you will see a list of APIs.&lt;br /&gt;
* Make sure &amp;quot;Direct3D11&amp;quot; is on top or place it there.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery doesn't work on my 3070/3080/3090 GPU? ===&lt;br /&gt;
1. Please enable [[Manual#RTX_Mode|RTX mode]].&lt;br /&gt;
&lt;br /&gt;
2. If denoiser also fails, please update from [[Github_access|github]] and use OpenImageDenoise option (some instructions are [[Troubleshooting#Denoiser_produces_bright_edges_around_geometry.2Fshadows|here]]).&lt;br /&gt;
&lt;br /&gt;
Updated denoiser (both new OptiX version and OpenImageDenoise) as well as automatic hardware detection will be soon released on the Asset Store.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser produces grid-like patterns ===&lt;br /&gt;
[[File:Gridlike.jpg|thumb|Grid-like denoiser pattern]]&lt;br /&gt;
&lt;br /&gt;
OptiX denoiser might produdce grid-like patterns when fed with very low-precision lightmaps. Low precision is usually caused by either extremely dark or extremely bright lighting. It is recommended to stay within reasonable intensity range (see a similar advice for [[Troubleshooting#Lightmaps_look_black_or_have_bad_quality_in_an_HDRP_scene|HDRP]] above).&lt;br /&gt;
&lt;br /&gt;
* Alternatively use OpenImageDenoise, as it does not produce this pattern.&lt;br /&gt;
&lt;br /&gt;
* This issue also does not affect OptiX 5.1 denoiser (&amp;quot;Legacy denoiser&amp;quot;) as its training dataset is in its own DLL, but affects the non-legacy version (OptiX 6.0) and only on driver versions newer than 442.50, as the training datasets are in the driver ([https://forums.developer.nvidia.com/t/optix7-denoiser-different-results-with-different-version-of-drivers/117989/2 explanation from NVIDIA]).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get &amp;quot;rtcRes == RTC_SUCCESS&amp;quot; error ===&lt;br /&gt;
&lt;br /&gt;
You are using a 3xxx+ GPU with RTX mode disabled. Enable [[Manual#RTX_Mode|RTX mode]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Baking any scene crashes with unknown error ===&lt;br /&gt;
&lt;br /&gt;
There were [https://twitter.com/HarryAlisavakis/status/1331630028665348096 some reports] that Avast antivirus can block Bakery from running, even though Bakery's executables don't trigger any antivirus (including Avast) when [https://twitter.com/guycalledfrank/status/1331640614077796354 scanned via VirusTotal]. Perhaps it just block any executables that were launched 'indirectly', i.e. from another application. In any case, if you have Avast, try adding your project folder to exception list.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Combined meshes (e.g. using Mesh Combine asset) bake incorrectly ===&lt;br /&gt;
&lt;br /&gt;
[[File:Meshcombine.jpg|thumb|Mesh Combine &amp;quot;Regenerate Lightmap UVs&amp;quot; option]]&lt;br /&gt;
&lt;br /&gt;
Most mesh combining assets have an option to regenerate lightmap UVs. Without it, combined UVs will overlap each other. If you are using Mesh Combine, make sure &amp;quot;Regenerate Lightmap UVs&amp;quot; option is enabled in output settings.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a &amp;quot;Can't create vertex buffer&amp;quot; error ===&lt;br /&gt;
&lt;br /&gt;
This error can happen if the scene has more than ~40 million vertices. It is recommended to reduce geometric complexity of the scene, as tracing it would be too slow anyway. The typical cause of going over this limit is trying to bake with large arrays of trees painted on the terrain. In this case try disabling [[Manual#Export_terrain_trees|Export Terrain Trees]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Soft shadows appear like multiple hard shadows ===&lt;br /&gt;
&lt;br /&gt;
[[File:Unknown.png|thumb|Undersampled shadow]]&lt;br /&gt;
&lt;br /&gt;
Increase ''Shadow Samples'' on the light or decrease the ''Shadow Spread''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Lightmaps are black on GTX 650 ===&lt;br /&gt;
&lt;br /&gt;
Apparently newer Nvidia drivers deprecate some CUDA functions on older hardware. It is recommended to use driver version 442 on GTX 650, as it still supported everything Bakery uses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Lightmaps disappear on play ===&lt;br /&gt;
&lt;br /&gt;
* Make sure that '''Project Settings''' -&amp;gt; '''Editor''' -&amp;gt; '''Enter Play Mode Settings''' -&amp;gt; '''Reload Scene''' is turned '''on'''.&lt;br /&gt;
* If that doesn't help, try applying the latest [[Github_access|patch]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a DllNotFoundException ===&lt;br /&gt;
&lt;br /&gt;
* Check if the DLL file mentioned in the error actually exists in your project. If it doesn't, your Bakery installation is incomplete or corrupted; please reinstall it.&lt;br /&gt;
* Check if you're running 64-bit Unity Editor under 64-bit Windows (7 or newer) (as listed in [[Manual#System_requirements|system requirements]]).&lt;br /&gt;
* Make sure you have 64-bit [https://www.microsoft.com/en-us/download/details.aspx?id=48145 Visual C++ Redistributables for Visual Studio 2015] installed. In case if the Microsoft site download is broken, here is a [https://drive.google.com/file/d/1WfRP1A43bCwZflZ_I0wHSGPyC3b-0lqK/view?usp=sharing reupload].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Lightmap UVs are wrong when opening previously baked project on a Mac ===&lt;br /&gt;
&lt;br /&gt;
When Unity reimports model assets, it performs UV unwrapping. If you baked the scene with [[Manual#Unwrapper|Unwrapper]] was set to xatlas, it won't work on a Mac because Bakery's xatlas wrapper library is only compiled for Windows. Rebaking with Default unwrapper should fix it.&lt;br /&gt;
&lt;br /&gt;
You can still keep xatlas as the [[Manual#Atlas_Packer|Atlas Packer]].&lt;br /&gt;
&lt;br /&gt;
''Unwrapper'' is used to generate UVs for individual, isolated meshes, while ''Atlas Packer'' packs big scene-specific atlases out of many unwrapped layouts.&lt;br /&gt;
&lt;br /&gt;
Combining Default unwrapper with xatlas being used as the Atlas Packer and enabling [[Manual#Hole_filling|Hole Filling]] should give pretty good [https://x.com/guycalledfrank/status/1231890428313600000 results] and compensate for any individual mesh unwrapping inefficiencies.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Error message &amp;quot;Failed to load OptiX library&amp;quot; ===&lt;br /&gt;
&lt;br /&gt;
Nvidia driver 590 (and newer) removed support for OptiX 6.0 which Bakery depended on. Bakery v1.98 added support for the new driver, now using OptiX 9.0.&lt;br /&gt;
* Make sure you're using a [[Manual#System_requirements|supported Nvidia GPU]].&lt;br /&gt;
* Update Bakery to v1.98 via the [https://assetstore.unity.com/packages/tools/level-design/bakery-gpu-lightmapper-122218 Asset Store], [[Github_access|github or the built-in patcher]].&lt;br /&gt;
* If you still get the error every time, click Bakery -&amp;gt; Utilities -&amp;gt; Detect Optimal Settings and choose &amp;quot;Set recommended as default&amp;quot;.&lt;br /&gt;
* If you don't want to update Bakery, roll back your GPU driver to any pre-590 version (e.g. [https://www.nvidia.com/en-eu/geforce/drivers/results/257569/ 581.80]).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Point Light with a cookie/cubemap is black ===&lt;br /&gt;
Note that Bakery supports colored cookies and reads RGB from cookie/cubemap textures. Unity, on the other hand, only supports grayscale cookies. Setting Texture Type to &amp;quot;Cookie&amp;quot; on the asset will convert it to a single-channel A8 format. For Bakery, leave Texture Type to Default.&lt;/div&gt;</summary>
		<author><name>Mr F</name></author>
		
	</entry>
	<entry>
		<id>https://geom.io/bakery/wiki/index.php?title=Manual&amp;diff=1863</id>
		<title>Manual</title>
		<link rel="alternate" type="text/html" href="https://geom.io/bakery/wiki/index.php?title=Manual&amp;diff=1863"/>
		<updated>2026-02-07T21:13:11Z</updated>

		<summary type="html">&lt;p&gt;Mr F: /* Bakery Point Light */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== System requirements ==&lt;br /&gt;
To use Bakery you'll need:&lt;br /&gt;
* Windows (7 or higher) PC.&lt;br /&gt;
* Nvidia GPU. Minimum supported model is Kepler (GeForce 650 or newer. For Quadro cards check the specs).&lt;br /&gt;
* 64-bit Unity editor. Bakery was tested on all versions from 5.6 to 6 or higher.&lt;br /&gt;
&lt;br /&gt;
{{note|System requirements are for developer machine, not target platform. You can use lightmaps baked with Bakery anywhere.}}&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
* Make sure your project does not have any script compilation errors, as it will prevent Bakery scripts from compiling as well.&lt;br /&gt;
* Make sure you have the latest GPU driver. [https://www.nvidia.com/Download/index.aspx?lang=en-US Update it] if needed.&lt;br /&gt;
&lt;br /&gt;
'''Use the Game-Ready (standard) driver, not the &amp;quot;Studio&amp;quot; one.'''&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
1. Import Bakery to your project via [https://assetstore.unity.com/packages/tools/level-design/bakery-gpu-lightmapper-122218 Asset Store].&lt;br /&gt;
&lt;br /&gt;
2. Unity will show a list of files to import. If it's your first time using Bakery, it is recommended you just '''click Import'''. Experienced users may want to untick the ''examples'' folder for a more lightweight installation.&lt;br /&gt;
&lt;br /&gt;
Files will be imported to Assets/Bakery and Assets/Editor/x64/Bakery. These folders can be moved later.&lt;br /&gt;
&lt;br /&gt;
3. Unity will then import Bakery and compile the scripts. It may show a window like this:&lt;br /&gt;
&lt;br /&gt;
[[File:Goahead.png]]&lt;br /&gt;
&lt;br /&gt;
In which case you should click &amp;quot;Go Ahead&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
You should now see Bakery menu added to the editor:&lt;br /&gt;
&lt;br /&gt;
[[File:bmenu.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Quickstart ==&lt;br /&gt;
&lt;br /&gt;
1. Add some model or primitive and mark it as Static.&lt;br /&gt;
&lt;br /&gt;
'''Meshes must have non-overlapping UV for lightmapping. UV2 is used if present (otherwise UV1). If you did not unwrap models for lightmapping, make sure to check [https://docs.unity3d.com/Manual/LightingGiUvs-GeneratingLightmappingUVs.html Generate Lightmap UVs] on the asset.''' Unity primitives already have correct UV2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Staticmarked.jpg|320px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Select Directional Light (the one Unity created for you) and add '''Bakery Direct Light''' component to it.&lt;br /&gt;
{{note| Bakery and Unity use separate light source components.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Bakery Direct Light has many options to tweak, but you can easily match it to Unity light. Click '''Match lightmapped to real-time'''. Now Bakery light should have the same yellowish color as Unity’s default Directional.&lt;br /&gt;
&lt;br /&gt;
[[File:Matching.jpg|640px]]&lt;br /&gt;
&lt;br /&gt;
{{note| Direct Light component may complain about project not using linear light intensity. The problem is that by default Unity applies gamma correction to light source colors [https://twitter.com/guycalledfrank/status/1001108508614553600 incorrectly]. Correct mode can be enabled by [https://docs.unity3d.com/ScriptReference/Rendering.GraphicsSettings-lightsUseLinearIntensity.html scripting], and that’s what the “Fix” button does. If you already have many light sources set up in non-linear intensity mode, and you don’t want to change them again, you may skip fixing. Even if you press “Fix”, you can always revert the change anytime.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. To get shadowed ambient lighting, create Skylight (Bakery-&amp;gt;Create-&amp;gt;Skylight).&lt;br /&gt;
&lt;br /&gt;
[[File:Menusky.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Select Skylight, give it some bluish color and click '''Match scene skybox to this light'''. This will make scene skybox match lighting exactly.&lt;br /&gt;
{{note| Matching Unity skybox to Bakery skylight is optional but useful for correctness, as to ensure that visible environment and in-engine reflection probes match baked lighting. Currently this option only works for Standard render pipeline.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Skycomp.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Click Bakery-&amp;gt;Render Lightmap. By default, Full Lighting mode is active. It will bake both direct and indirect contribution from all lights. If you want to combine real-time shadows with baked GI, change it to '''Indirect'''.&lt;br /&gt;
&lt;br /&gt;
[[File:Bakerywindow.jpg]]&lt;br /&gt;
&lt;br /&gt;
{{note| Bakery may complain that you are using old [https://docs.unity3d.com/Manual/LinearLighting.html gamma mode] and suggest to change it. If you care about quality of lighting, using Linear mode is highly recommended. You may ignore it if you already have a big project set up with incorrect gamma and don’t want to change it or when shipping to mobile devices that don't support it.}}&lt;br /&gt;
&lt;br /&gt;
7. Click '''Render'''.&lt;br /&gt;
&lt;br /&gt;
8. Done! You should now have baked GI:&lt;br /&gt;
&lt;br /&gt;
[[File:Bakedgi.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Render settings ==&lt;br /&gt;
&lt;br /&gt;
All render settings can be accessed via Bakery-&amp;gt;Render Lightmap. Settings are saved for every scene. The topmost option in Bakery window allows you to switch between Simple, Advanced and Experimental settings, each succeeding mode revealing more tweakable options. Simple mode is enough for most scenes and it's a good way to get started.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render mode ===&lt;br /&gt;
Defines the type of lightmaps to bake. &lt;br /&gt;
&lt;br /&gt;
===== Full Lighting =====&lt;br /&gt;
Complete direct and indirect lighting for all Bakery lights.&lt;br /&gt;
{{note| On pre-2017.3 Unity versions if you have both Unity and Bakery components on the same object, you will need to disable Unity ones manually to avoid double brightness. On newer versions real-time effects are automatically disabled for baked lights, as with built-in lightmappers.}}&lt;br /&gt;
&lt;br /&gt;
===== Indirect =====&lt;br /&gt;
[[File:Image26.png|thumb|Comparison of different render modes supported by Unity]]&lt;br /&gt;
Basic mixed mode. It will look at the Baked Contribution selector on every light: if it’s set to ''Direct And Indirect'', the light is baked as in Full Lighting mode. If it’s set to ''Indirect Only'', only indirect contribution (GI) from this light is baked. In latter case you should keep both Unity and Bakery lights on the object, one giving real-time direct contribution, and another for precomputed GI.&lt;br /&gt;
&lt;br /&gt;
[[File:Indirectonly.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== Shadowmask =====&lt;br /&gt;
[[File:Image21.png|thumb|Left: completely baked light. Center: dynamic light with baked GI. Right: capsule shadow, bump and specular are dynamic, but cube shadow and GI are baked.]]&lt;br /&gt;
[[File:Image6.png|thumb|When camera gets far away enough or if dynamic shadows are disabled, the same scene will look like this]]&lt;br /&gt;
A more advanced mixed mode. It works by generating two types of lightmaps - one with baked color (as in Indirect mode), and another with shadows from static objects. It has several benefits:&lt;br /&gt;
* Real-time shadows can render only a handful of dynamic objects, instead of the whole scene.&lt;br /&gt;
* Real-time and baked shadows blend together properly.&lt;br /&gt;
* Real-time lights can render bump, specular and other surface effects, while still being occluded by high-quality baked shadows.&lt;br /&gt;
[https://docs.unity3d.com/Manual/LightMode-Mixed-Shadowmask.html More details]&lt;br /&gt;
&lt;br /&gt;
To enable this behaviour, you must have both Unity and Bakery lights on the same object, with Baked Contribution set to ''Shadowmask and Indirect''. Unmarked lights will be baked as in Indirect mode.&lt;br /&gt;
&lt;br /&gt;
[[File:Smask22.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== Distance Shadowmask =====&lt;br /&gt;
This checkbox is only visible if you chose shadowmask and simply toggles [https://docs.unity3d.com/Manual/LightMode-Mixed-ShadowmaskMode.html equally named setting] in project’s Quality Settings.&lt;br /&gt;
[https://docs.unity3d.com/Manual/LightMode-Mixed-DistanceShadowmask.html More details.]&lt;br /&gt;
{{note| Checkbox is not visible on Unity 5.6.x due to the lack of corresponding scripting API. Instead you can toggle it in Window-&amp;gt;Lighting-&amp;gt;Mixed Lighting-&amp;gt;Lighting Mode.}}&lt;br /&gt;
{{note| On Unity versions &amp;lt; 2017.3 rendering Shadowmask lightmaps will clear the light probes due to API limitations. They will need to be re-rendered again after bake. It shouldn’t happen on newer versions.}}&lt;br /&gt;
&lt;br /&gt;
===== Subtractive =====&lt;br /&gt;
Enables [https://docs.unity3d.com/Manual/LightMode-Mixed-Subtractive.html Subtractive] lighting mode. &lt;br /&gt;
&lt;br /&gt;
This option does not do anything special to lightmaps and, in fact, works just like Full Lighting.&lt;br /&gt;
&lt;br /&gt;
The only difference is that it also sets up real-time Unity lights to work with Subtractive mode (as it cannot be done through UI).&lt;br /&gt;
&lt;br /&gt;
You will need to additionally set up global subtractive parameters (like the global shadow color) in [https://docs.unity3d.com/Manual/GlobalIllumination.html#MixedLighting Unity lighting window].&lt;br /&gt;
&lt;br /&gt;
===== Ambient Occlusion Only =====&lt;br /&gt;
Only bakes AO. May be useful if you know what you're doing. Make sure to set up [[#Ambient_occlusion|AO options]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Directional mode ===&lt;br /&gt;
[[File:Image3.png|thumb|Comparison of different directional modes]]&lt;br /&gt;
Defines how directional information is baked. Standard lightmaps only store a single color per texel, while directional lightmaps give shaders a hint of how lighting changes over a hemisphere around the texel. This data is required to combine fully lightmapped areas with normal maps. Plugging it into the built-in [[#Bakery_shaders|Bakery shader]] can also produce approximate specular response.&lt;br /&gt;
&lt;br /&gt;
===== None =====&lt;br /&gt;
No directional data, single color per texel.&lt;br /&gt;
&lt;br /&gt;
===== Baked Normal Maps =====&lt;br /&gt;
Still no directional data, but normal maps are taken into account when rendering the lightmap. There is no additional runtime overhead. Since lightmaps usually have lower resolution than normal maps, the result may look blurry. Other problems include aliasing at distance due to lack of mipmapping and denoising step potentially smudging the detail. To learn how to use custom shaders with procedural normals in this mode, read [[#Normal_mapping|Normal Mapping]] section.&lt;br /&gt;
&lt;br /&gt;
===== Dominant Direction =====&lt;br /&gt;
This mode is similar to what Enlighten and Progressive bake in Unity. It is compatible will most shaders, only generates one additional map and the runtime overhead is minimal. The downside is that bump-mapping looks rather faint and gray-ish and can be quite different comparing to the same object under real-time lighting.&lt;br /&gt;
&lt;br /&gt;
===== RNM =====&lt;br /&gt;
Based on Radiosity Normal Mapping technique originally invented for HL2 ([https://steamcdn-a.akamaihd.net/apps/valve/2004/GDC2004_Half-Life2_Shading.pdf slides]) and later used in many games (e.g. Mirror’s Edge). It generates 3 HDR maps in total, being the most memory-demanding mode of all. Runtime overhead is still relatively low. This mode is more precise than Dominant Direction. It is better at reproducing surface contrast and handling colored lights affecting normal maps from different angles.&lt;br /&gt;
&lt;br /&gt;
===== SH =====&lt;br /&gt;
Based on “Precomputed Global Illumination in Frostbite” [https://media.contentapi.ea.com/content/dam/eacom/frostbite/files/gdc2018-precomputedgiobalilluminationinfrostbite.pdf paper]. This is the highest quality mode, giving much better surface contrast and representing differently colored lighting coming from different directions. Generates 4 maps in total, only one of them being HDR, therefore takes less memory than RNM. Runtime overhead is slightly higher than that of RNM.&lt;br /&gt;
&lt;br /&gt;
===== MonoSH =====&lt;br /&gt;
[[File:FY8Ru8hWIAAdYYH.jpg|thumb|Size/quality comparison of Dominant Direction, full SH and MonoSH]]&lt;br /&gt;
Same as SH, but using a monochromatic L1 directional coefficients. Similarly good surface contrast, although not accurately representing different colors shining from different directions at one texel; but good enough for many scenes. Only generates one additional map, so the VRAM usage/bandwidth is similar to Dominant Direction; in fact it's even smaller, due to Dominant Direction using RGBA maps, while MonoSH only needing RGB. The map is fed via the built-in directional lightmap system, but ''won't look correct with standard shaders''. Make sure to use a compatible shader.&lt;br /&gt;
&lt;br /&gt;
===== Limitations =====&lt;br /&gt;
&lt;br /&gt;
* RNM and SH/MonoSH can be only used with [[#Bakery_shaders|Bakery shader]] or require adjustments to your shaders.&lt;br /&gt;
* In RNM and SH modes, standard color lightmaps are not created. You need to either have Bakery shader on all materials in the scene, or use [[#Bakery_Lightmap_Group_Selector|Lightmap Groups]] to separate RNM/SH objects from the rest.&lt;br /&gt;
* RNM and SH maps are applied to objects using [https://docs.unity3d.com/ScriptReference/MaterialPropertyBlock.html MaterialPropertyBlock] and so may be not shown completely in Unity’s Lighting window.&lt;br /&gt;
* Dominant Direction, RNM and SH/MonoSH modes may require slightly more samples for GI and Light Meshes to get comparable quality.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Texels per unit ===&lt;br /&gt;
[[File:Texelscomp.jpg|thumb|1 vs 10 texels per unit]]&lt;br /&gt;
Approximate amount of lightmap texels per world unit. Affects the amount and resolution of generated lightmaps.&lt;br /&gt;
&lt;br /&gt;
Example values to get you started:&lt;br /&gt;
* Large outdoor area (a city): 1 - 5&lt;br /&gt;
* Medium outdoor area (a few alleys): 10-20&lt;br /&gt;
* High quality interior: 100&lt;br /&gt;
&lt;br /&gt;
It is assumed that scene scale is roughly 1 unit = 1 meter. Such scale is generally recommended when working in Unity for better navigation and for physics simulation. If your scale is different, multiply Texels accordingly.&lt;br /&gt;
&lt;br /&gt;
Keep in mind that Texels Per Unit is base resolution, but every object can be additionally tweaked using [https://docs.unity3d.com/Manual/class-MeshRenderer.html Scale in Lightmap] option on Mesh Renderers as well as [[#Scale per map type|Scale per map type]] in Bakery window.&lt;br /&gt;
&lt;br /&gt;
{{note| Objects with Scale in Lightmap set to 0 will not be baked, but will still cast shadows and affect GI.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Max resolution ===&lt;br /&gt;
Maximum lightmap size limit. If objects can't fit in a single lightmap (given current Texels Per Unit value), additional lightmaps will be allocated. Same 4 square objects can take four 512x512 maps or one 1024x1024.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bounces ===&lt;br /&gt;
[[File:Image36.png|thumb|Note how more bounces bring more light to closed spaces.]]&lt;br /&gt;
Defines how many times light rays should bounce off surfaces. Usually lower values are sufficient for outdoor scenes (e.g. a city), while higher values are required for more closed scenes (interiors, caves).&lt;br /&gt;
&lt;br /&gt;
While the slider is limited by 5 bounces, it is possible to type any amount of bounces into the number field.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Samples ===&lt;br /&gt;
[[File:Image7.png|thumb|Left: samples = 4, right: samples = 16. Denoising is off for illustrative purposes.]]&lt;br /&gt;
Affects quality of GI. Typical values are from 16 to 32.&lt;br /&gt;
&lt;br /&gt;
{{note| It is possible to type in any number, beyond the maximum slider value, but be aware that this number represents a square root of the final ray count, i.e. 32 is 1024 rays, 64 is 4096 rays, etc.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GPU Priority ===&lt;br /&gt;
While GPU is working on lightmaps, OS and other software may become less responsive. This option allows you to balance between baking speed and system responsiveness.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render ===&lt;br /&gt;
Bakes lightmaps for all opened scenes.&lt;br /&gt;
If [[Manual#Light_probe_mode|Light Probe Mode]] is set to L1 or L2, also bakes light probes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Render Light Probes ===&lt;br /&gt;
Bakes [https://docs.unity3d.com/Manual/LightProbes.html light probes] for all opened scenes.&lt;br /&gt;
&lt;br /&gt;
Note that to get correct mixed light shadowing on dynamic objects in Shadowmask mode you also need to enable [[Manual#Occlusion_probes|occlusion probes]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Render Reflection Probes ===&lt;br /&gt;
Bakes [https://docs.unity3d.com/Manual/class-ReflectionProbe.html reflection probes] for all opened scenes. This button is just for convenience and will call built-in engine reflection probe update.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update Skybox Probe ===&lt;br /&gt;
Bakes global diffuse and reflection probe for the current skybox. As with &amp;quot;Render Reflection Probes&amp;quot;, it just calls built-in engine functions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Occlusion probes ===&lt;br /&gt;
When rendering light probes, lets Unity bake occlusion probes using currently selected built-in lightmapper. Occlusion probes is additional data stored inside regular light probes, and it prevents dynamic objects from getting lit in shadowed areas. Currently there is no way to use custom occlusion probes in Unity, and it has to call its own lightmappers instead to do the job.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Warnings ===&lt;br /&gt;
These options will validate the scene after one of the Render buttons is pressed and show warning dialog boxes asking to continue or stop the baking process.&lt;br /&gt;
* Suppress all popups: don't show any dialog boxes after pressing Render.&lt;br /&gt;
* UV validation: will check if all models have fully correct lightmapping UVs - specifically if they lie within 0-1 range and don’t overlap.&lt;br /&gt;
* Overwrite check: will tell which lightmap files are going to be overwritten.&lt;br /&gt;
* Memory check: will tell a very approximate amount of video memory required.&lt;br /&gt;
* Sample count check: will check if any lights, GI or AO have unreasonable sample counts that can make GPU go out of available resources.&lt;br /&gt;
* Lightmapped prefab validation: validates Lightmapped Prefabs and notifies if some prefabs are going to be overwritten.&lt;br /&gt;
&lt;br /&gt;
== Advanced render settings ==&lt;br /&gt;
=== Light probe mode ===&lt;br /&gt;
Changes the way light probes are baked.&lt;br /&gt;
&lt;br /&gt;
* Legacy:  use Render Light Probes button to generate the probes. Point and directional lights are calculated within the lightmapper, while area/sky/indirect lighting is gathered by rendering a cubemap at each probe position. Results are stored as [https://docs.unity3d.com/ScriptReference/Rendering.SphericalHarmonicsL2.html L2 spherical harmonics]. The downsides are slow cubemap rendering performance and possible mismatch between lightmaps and probes in cases where shaders in your game do not physically represent lit surfaces or your project is set up for mobile (Unity can clip high intensity values away).&lt;br /&gt;
&lt;br /&gt;
* L1: light probes will be rendered together with lightmaps when you click Render. This option provides superior baking performance and will guarantee that probe lighting matches the lightmaps. Results are stored as L1 spherical harmonics (can be still used by regular shaders). Results can be further improved by using Non-Linear Light Probe SH option in [[#Bakery_shaders|Bakery shader]].&lt;br /&gt;
&lt;br /&gt;
* L2: superior quality (full L2 spherical harmonics). As with L1, automatically rendered together with lightmaps. Negligible performance impact compared to L1. Should look OK with all shaders. Probe contrast/directionality/ringing removal can be tweaked via Project Settings -&amp;gt; Bakery -&amp;gt; &amp;quot;Ringing removal for L2 light probes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''There seems to be a bug in Unity 2019.3 preventing Legacy light probe colors from being properly saved IF [[Manual#Occlusion_probes|occlusion probes]] option is enabled. L2 mode is now default and recommended when using occlusion probes.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Asset UV Processing ===&lt;br /&gt;
Configures UV padding adjustment for assets. Possible values:&lt;br /&gt;
* Don't change: don't touch the assets.&lt;br /&gt;
* Adjust UV padding: will look for models with auto-generated UVs (“Generate Lightmap UVs” on the asset) and adjust them further to have proper padding between UV islands per-mesh. Model-wide Pack Margin in importer settings is ignored. Optimal values are calculated instead, given area of each mesh and lightmap resolution.&lt;br /&gt;
* Adjust UV padding for new meshes only: same, but skips any models that were previously adjusted at least once.&lt;br /&gt;
* Remove UV adjustments: reverts all previous UV adjustments, makes auto-unwrapped models look they way Unity originally unwrapped them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser ===&lt;br /&gt;
Sets the desired denoiser. Possible values:&lt;br /&gt;
* Optix 5: uses OptiX 5.1 AI denoiser (previously known as &amp;quot;Legacy denoiser&amp;quot;). Runs on the GPU. Supported on everything from [https://en.wikipedia.org/wiki/Kepler_(microarchitecture) Kepler] (typically GeForce 6xx) to [https://en.wikipedia.org/wiki/Turing_(microarchitecture) Turing] (typically Geforce 20xx). Not supported on [https://en.wikipedia.org/wiki/Ampere_(microarchitecture) Ampere] (30xx). OptiX 5.1 uses a static training dataset which is embedded into it, meaning it is not affected by the driver implementation.&lt;br /&gt;
* Optix 6: uses OptiX 6.0 AI denoiser (previously the default option). Runs on the GPU. Seems to fail on Kepler (6xx) GPUs, but runs on everything newer, including Ampere (30xx). Since 6.0 the training dataset for the OptiX denoiser is in the driver. Before driver v442.50 its behaviour was similar to OptiX 5.1; however, after it NVIDIA has [https://forums.developer.nvidia.com/t/optix7-denoiser-different-results-with-different-version-of-drivers/117989/2 changed the dataset], and results can be different. The updated dataset may sometimes produce grid-like patterns and more bright edges (still fixable with [[Manual#Denoise:_fix_bright_edges|&amp;quot;Denoise: fix bright edges&amp;quot;]]), but it runs faster.&lt;br /&gt;
* Optix 7: uses OptiX 7.2 AI denoiser. Behaves similarly to OptiX 6.0, but might be better supported on Ampere (30xx).&lt;br /&gt;
* OpenImageDenoise: uses Intel Open Image Denoise library. Runs on the CPU (any CPU that supports SSE 4.1). Can be slightly slower than OptiX, but the quality is comparable.&lt;br /&gt;
* OpenImageDenoise2: uses Intel Open Image Denoise 2, CUDA mode. Runs on the GPU, performance is comparable to OptiX 6/7, quality is identical to the CPU version.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Adjust sample positions ===&lt;br /&gt;
Find best sample positions to prevent lighting leaks. Details of the algorithm are outlined [https://ndotl.wordpress.com/2018/08/29/baking-artifact-free-lightmaps/#leaks here]. In some cases (usually large and very low poly geometry with smooth normals) it may produce incorrect results, in which case you can disable it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Unload scenes before render ===&lt;br /&gt;
Unloads Unity scenes before baking to free up video memory. Complex scenes can take a few gigabytes of VRAM by simply being shown in editor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Denoise ===&lt;br /&gt;
[[File:Image31.png|thumb|Left: denoising off, right: denoising on.]]&lt;br /&gt;
If enabled, will apply denoising algorithm. Bakery uses [https://developer.nvidia.com/optix-denoiser Nvidia’s AI denoiser (OptiX)] or Intel's Open Image Denoise (if selected).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Fix Seams ===&lt;br /&gt;
[[File:Image22.png|thumb|Left: seams, right: seams are fixed.]]&lt;br /&gt;
If enabled, will attempt to blend seams created by UV discontinuities. Useful for smooth geometry, including Unity’s default sphere.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Split by scene ===&lt;br /&gt;
If multiple scenes are loaded at once, and this option is enabled, each scene will have its own set of lightmaps, not shared with others. It can be useful for limiting the amount of textures loaded when scenes are streamed at runtime.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hole filling ===&lt;br /&gt;
[[File:Holefilling.jpg|thumb|Hole filling off vs on.]]&lt;br /&gt;
If [[Manual#Atlas_Packer|Atlas Packer]] is set to xatlas, will try to fill every hole, resulting in more efficient atlases. For scenes with very complex geometry it can increase scene export time, but otherwise recommended.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Min resolution ===&lt;br /&gt;
Minimum lightmap size limit. Can be used to balance between many small but fully occupied lightmaps vs few incompletely filled.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Scale per map type ===&lt;br /&gt;
Allows you to scale the resolution of color/shadowmask/direction maps differently. For example, a common case would be to have low resolution indirect color but highly detailed shadowmask. Note that scaling is applied after the lightmaps are rendered, so it won’t save baking time. If “Adjust UV padding” is on, padding will be based on the lowest resolution map to prevent texel leaking.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Checker preview ===&lt;br /&gt;
[[File:Image12.png|thumb|Checker preview in action]]&lt;br /&gt;
If Show checker checkbox is on, Scene View will render a checkerboard pattern on top of visible objects to demonstrate lightmap texel size. This is useful to make sure you are using adequate values for Texels Per Unit and other resolution-affecting settings before you bake.&lt;br /&gt;
&lt;br /&gt;
Enabling checker preview will force Bakery to perform atlas packing. It can take some time, but shouldn’t be longer than a few seconds. Press Refresh checker to re-atlas the scene after you changed something to see changes.&lt;br /&gt;
&lt;br /&gt;
Checker preview also uses random colors to show how the scene will be split into different lightmaps.&lt;br /&gt;
&lt;br /&gt;
{{note| Checker preview currently does not show correct texel sizes for Terrains.}}&lt;br /&gt;
&lt;br /&gt;
==== Atlas preview ====&lt;br /&gt;
[[File:FN-TmhRXwAE9i2I.png|thumb|Atlas preview in action]]&lt;br /&gt;
Atlas preview button is visible when Checker preview is on. Clicking it will open a new window where the UV layouts of future lightmaps are shown. Click &amp;quot;&amp;lt;&amp;quot; &amp;quot;&amp;gt;&amp;quot; buttons to browse the lightmaps.&lt;br /&gt;
This is useful for checking out packing quality and lightmap count before baking.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Emissive boost ===&lt;br /&gt;
Multiplies any surface emission by this number.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Indirect boost ===&lt;br /&gt;
Multiplies all bounced lighting by this number. Same as Indirect Intensity on light components, but global.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Backface GI ===&lt;br /&gt;
[[File:Image30.jpg|thumb|Backface GI]]&lt;br /&gt;
[[File:Image35.png|thumb|Left: backface GI = 0, right: backface GI = 1. Note how shadowed areas receive more green lighting.]]&lt;br /&gt;
Determines how much light is passed through front faces to back faces and then bounced off by GI. This is especially useful for thin translucent surfaces like leaves. Values are in 0-1 range.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Ambient occlusion ===&lt;br /&gt;
[[File:Image15.png|thumb|Left: AO intensity = 0. Right: AO intensity = 1.]]&lt;br /&gt;
Simple non-physical ambient occlusion you can apply over final scene lighting for aesthetic purposes.&lt;br /&gt;
* Intensity: controls visibility of the AO effect. Value of 0 disables the effect.&lt;br /&gt;
* Radius: determines the ray distance used in the AO effect. Smaller values give localized occlusion (corners, wrinkles), while larger values make it more similar to Skylight, giving shadows from distant objects.&lt;br /&gt;
* Samples: affects the quality of ambient occlusion. Typical values are from 4 to 32.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dither transparency ===&lt;br /&gt;
Enables semi-transparent shadows by automatically dithering alpha textures. See [[Manual#Opacity|how Bakery interprets opacity maps]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== RTX Mode ===&lt;br /&gt;
Enables RTX hardware acceleration. Only RTX GPUs will benefit from this option. Minimum supported driver version is 418.&lt;br /&gt;
&lt;br /&gt;
Drivers can emulate RTX mode on most non-RTX Nvidia cards, but the result is usually slower.&lt;br /&gt;
&lt;br /&gt;
RTX mode '''must''' be enabled on Ampere (3xxx) or newer cards.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Export terrain trees ===&lt;br /&gt;
If enabled, painted terrain trees will affect lighting. Trees themselves will not be baked. Note that highest possible LOD level is used for every tree during baking. It is not recommended to use this option for rendering multi-kilometer forests with highly detailed models.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Terrain optimization ===&lt;br /&gt;
If enabled (default), Terrains use separate ray tracing technique to take advantage of their heightfield geometry. Otherwise they are treated like any other mesh. Terrain optimization significantly reduces memory footprint required for high-resolution landscapes. In some cases it can also make terrain baking faster, in other cases (especially with simple low-resolution landscapes) it might make sense to disable it.&lt;br /&gt;
&lt;br /&gt;
{{note| Terrain Optimization is not currently compatible with painted terrain holes. Disable it to make them work.}}&lt;br /&gt;
{{note| Terrain Optimization is only supported in non-RTX mode.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Light Mesh batch limit ===&lt;br /&gt;
If this value is above 0, combines many [[Manual#Bakery_Light_Mesh|Light Meshes]] into one, given they have identical settings and affect the same [[Manual#Bakery_Lightmap_Group_Selector|Lightmap Groups]], but limiting their total sample count to this value (I.e. if the limit is 64, it can combine 2 lights with samples=32 or 4 lights with samples=16, etc). This will increase performance in scenes with many Light Meshes. Be careful setting this value too high, as the GPU may hit the OS driver timeout while processing too many samples at once.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Compress volumes ===&lt;br /&gt;
If enabled, applies texture compression to volume 3D textures and switches Bakery shaders to a corresponding sampling mode. Not recommended for very low resolution volumes. Volume size may be increased to be a multiple of 4.&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
* Currently it can only compress to BC6H/BC7 texture formats (desktop/consoles).&lt;br /&gt;
* Volume compression is only supported on Unity 2020.1 or newer.&lt;br /&gt;
* Currently only Bakery shader for the standard rendering pipeline supports using compressed volumes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Samples multiplier ===&lt;br /&gt;
Multiplies all shadow and GI samples by the specified factor. Use it to quickly change between draft and final quality.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Tile size ===&lt;br /&gt;
Same as [[#GPU Priority|GPU Priority]], but instead of abstract priority you set tile size. Bakery splits lightmaps into smaller tiles and updates one at a time. Smaller size means more GPU work interruptions, and can make system more responsive.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Temp path ===&lt;br /&gt;
Temporary files folder. Bakery may require a few gigabytes of free space during rendering. Having this folder on SSD can make rendering slightly faster comparing to HDD. At the moment, this folder is not cleaned automatically. You can delete its contents anytime (except during rendering) manually or via Bakery -&amp;gt; Utilities -&amp;gt; Clear cache.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Output path ===&lt;br /&gt;
Lightmap folder. This is where all lightmap, and also lightprobe and vertex color assets will be saved. This path is relative to your Assets folder.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Use scene named output path ===&lt;br /&gt;
If this option is enabled, output path will be automatically set to a folder with the same name as the currently active scene (Assets/CurrentSceneName/). This is similar to how built-in Unity lightmappers behave.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render Selected Groups ===&lt;br /&gt;
Only bakes [[#Bakery_Lightmap_Group_Selector|Lightmap Groups]] containing selected objects.&lt;br /&gt;
Not only selected objects will be redrawn, but all Lightmap Groups they belong to. Other lightmaps will not be updated. If objects are not a part of some manually assigned group, then a part of the scene using the same lightmap will be rebaked.&lt;br /&gt;
&lt;br /&gt;
Currently it is more convenient to use [[Partial_scene_baking|Sectors for partial scene baking]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Beep on finish ===&lt;br /&gt;
If enabled, Bakery will play a sound when the bake is finished.&lt;br /&gt;
&lt;br /&gt;
== Experimental render settings ==&lt;br /&gt;
=== Unwrapper ===&lt;br /&gt;
If [[#Asset_UV_Processing|Adjust UV Padding]] is enabled, defines the unwrapper that will be used.&lt;br /&gt;
* Default: standard Unity unwrapper. Bakery will call [https://docs.unity3d.com/ScriptReference/Unwrapping.GenerateSecondaryUVSet.html Unwrapping.GenerateSecondaryUVSet] for every mesh with different padding parameters.&lt;br /&gt;
* xatlas: uses [https://github.com/jpcy/xatlas xatlas] by [https://github.com/jpcy jpcy], a modified version of [https://github.com/Thekla/thekla_atlas thekla_atlas] by [https://github.com/castano Ignacio Castaño]. thekla_atlas was used in The Witness ([http://the-witness.net/news/2010/03/graphics-tech-texture-parameterization/ blog post]).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Atlas Packer ===&lt;br /&gt;
Selects the algorithm to use when packing different object UV layouts into large lightmap atlases.&lt;br /&gt;
* Default: original algorithm Bakery used before v1.7.&lt;br /&gt;
* xatlas: uses xatlas.&lt;br /&gt;
&lt;br /&gt;
Some features are only supported with one atlas packer:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Default&lt;br /&gt;
! xatlas&lt;br /&gt;
|-&lt;br /&gt;
| [[Manual#Bakery_Lightmap_Group_Selector|Override resolution]]&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
|-&lt;br /&gt;
| Efficient LOD packing&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Manual#Hole_filling|Hole filling]]&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that atlas packer can be also chosen separately for every Lightmap Group.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Export geometry and maps ===&lt;br /&gt;
If enabled, Bakery will export the scene to its format before rendering. If you are sure that geometry and textures of the scene and lightmap resolution settings were not changed (e.g. you are only tweaking GI or light settings), you can disable this checkbox to make next rendering faster.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update unmodified lights ===&lt;br /&gt;
If enabled, Bakery will recalculate light sources that didn’t change since last rendering. If you are only tweaking one light and don’t want to wait for other lights to re-render, you can disable this checkbox.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update modified lights and GI ===&lt;br /&gt;
If enabled, Bakery will recalculate GI and lights that were changed since last rendering.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== UV padding: increase only ===&lt;br /&gt;
Only visible if [[#Asset_UV_Processing|Adjust UV padding]] is on. By default, optimal UV padding for a model asset is calculated only based on currently loaded scenes. If there are multiple instances of the same model using different lightmap resolution, the smallest one will define padding, so spacing between UV charts is large enough to prevent them from leaking over each other. However, baking the same model in 2 different isolated scenes will possibly break UVs in previous scenes while optimizing for the new one. This checkbox allows to prevent such behaviour by never decreasing the padding value, so it will be always optimized for the lowest resolution instance ever baked.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoise: fix bright edges ===&lt;br /&gt;
[[File:Image19.png|thumb|Left: a bright edge is visible after denoising; Right: fixed.]]&lt;br /&gt;
Only visible if [[#Denoise|Denoise]] is on. Sometimes the neural net used for denoising may produce bright edges around shadows, like if a sharpening effect was applied. If this option is enabled, Bakery will try to filter them away. Denoising stage may get slightly slower, when enabled.&lt;br /&gt;
&lt;br /&gt;
This feature may also be used to filter &amp;quot;fireflies&amp;quot;, i.e. occasional bright dots from the lightmap.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Post-packing ===&lt;br /&gt;
Sometimes when rendering a scene, Bakery can split the lightmap into multiple sub-lightmaps, e.g. when baking different LODs or terrains.&lt;br /&gt;
Post-packing tries to minimize final atlas count by combining these sub-lightmaps in one texture.&lt;br /&gt;
It is recommended to keep this option enabled.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Combine with Enlighten real-time GI ===&lt;br /&gt;
If enabled, then when the Render button is pressed, it will first try to bake with Enlighten to calculate real-time GI. After that, regular Bakery lightmapping process will happen. Both baked and real-time GI will work together.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bake on remote server ===&lt;br /&gt;
Enables [[Network baking|network baking]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Presets ===&lt;br /&gt;
Currently shown under Render/Update buttons when settings are in Experimental mode.&lt;br /&gt;
* Click '''New''' to save all current settings to a preset file.&lt;br /&gt;
* By default, when a preset is active, all settings are grayed out to prevent overwriting the preset.&lt;br /&gt;
* Click '''Modify preset''' to be able to change settings and overwrite the preset.&lt;br /&gt;
* Presets can be swapped via the preset field. Disable preset usage by setting it to None.&lt;br /&gt;
&lt;br /&gt;
== Components ==&lt;br /&gt;
=== Bakery Lightmap Group Selector ===&lt;br /&gt;
&lt;br /&gt;
Specifies which '''Lightmap Group''' to use for the object and all of its children.&lt;br /&gt;
Lightmap Group is a term Bakery uses for a collection of objects sharing one lightmap. Groups have properties telling Bakery how to pack the objects, which lights should affect them, should the result be baked into a texture or vertices.&lt;br /&gt;
By default all static objects are automatically packed into multiple lightmaps groups (atlases), so you don’t have to worry. Defining groups manually should be only used for special purposes, for example:&lt;br /&gt;
* Marking certain objects use [[Vertex Lightmaps|per-vertex lightmap]] instead of textures.&lt;br /&gt;
* Baking a lightmap using exact unscaled UVs as they were in a modeling package.&lt;br /&gt;
* Grouping certain areas of the level to use single lightmap to facilitate resource streaming or to switch different baked lighting at runtime via scripts.&lt;br /&gt;
* Using Render Selected Groups button to only update grouped objects.&lt;br /&gt;
&lt;br /&gt;
To manually define a group, you create '''Lightmap Group Assets''', either by using Assets-&amp;gt;Create menu, or using the Create New button in the component. When using the Create New button, new asset will be created based on these forms:&lt;br /&gt;
* Name: name of the Lightmap Group Asset to create.&lt;br /&gt;
* Packing mode: this selector defines the packing mode of the Lightmap Group. There are 3 modes:&lt;br /&gt;
** Original UV: object and its children will be baked with unmodified UVs. No packing is performed. This is useful for models when multiple meshes share the same already packed UV layout.&lt;br /&gt;
** Pack Atlas: object and its children are packed into a dedicated texture atlas. Before v1.3 every packable child needed to have the component, but it’s no longer necessary. Every child will be packed as its own rectangle, except when Bakery auto-detects a child having non-overlapping sub-children, in which case multiple objects can use a single rectangle.&lt;br /&gt;
** Vertex: object and its children will use vertex-colored baked lighting instead of textures. Note that you’ll need a custom shader for this to work, like [[#Bakery_shaders|Bakery Shader]]. One simple shader (&amp;quot;Bakery/Simple Vertex Lightmapped&amp;quot;) is also included for demonstration and reference. [[Vertex Lightmaps|Learn more about vertex lightmaps.]]&lt;br /&gt;
* Directional mode: allows you to override [[#Directional mode|directional mode]] on the group. Options are the same except for Auto, which will simply use the global setting.&lt;br /&gt;
* Resolution: desired lightmap resolution.&lt;br /&gt;
* Auto-resolution: use [[Manual#Texels_per_unit|Texels Per Unit]] to determine closest power-of-two resolution.&lt;br /&gt;
* Atlas packer: select [[Manual#Atlas_Packer|atlas packing]] algorithm for this group.&lt;br /&gt;
* Bitmask: a list of toggles used to exclude light sources from affecting the lightmap. Every Bakery light source also has a bitmask setting. Lights only affects Lightmap Groups with which they share at least one of these toggles. Default settings mean all lights affect all lightmaps.&lt;br /&gt;
&lt;br /&gt;
[[File:Ts.jpg|thumb|Transparent selfshadow OFF vs ON: note how some single-sided but back-facing polygons become properly lit]]&lt;br /&gt;
&lt;br /&gt;
If you have a Lightmap Group with the Pack Atlas mode assigned, additional settings will appear on the component:&lt;br /&gt;
* Override resolution: override the resolution this object and its children occupy in the lightmap.&lt;br /&gt;
* Resolution: manually defined resolution. For example, if you have a lightmap with a resolution of 512 and it is assigned to 4 objects with override resolution set to 256, Bakery will generate a single 512x512 lightmap where each object takes exactly 256x256 square.&lt;br /&gt;
&lt;br /&gt;
If you select a Lightmap Group asset, additional experimental settings will be visible:&lt;br /&gt;
* [[Subsurface scattering|Subsurface scattering: (click to read more)]]&lt;br /&gt;
* Normal offset: allows you to offset rays from the surface. This is rarely useful and mostly present for experimental purposes.&lt;br /&gt;
* Transparent selfshadow: start rays behind the surface so it doesn't cast shadows on self. Might be useful for translucent foliage.&lt;br /&gt;
* Vertex sampling density (only if Packing Mode is set to Vertex): by default per-vertex bakes only compute 1 value for every vertex; if sampling density is &amp;gt; 0, it will instead average many samples scattered across triangles, yielding super-sampled, smoother results.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Lightmapped Prefab ===&lt;br /&gt;
This component allows prefabs to store lightmapping metadata. Such prefabs can be then instantiated in any scene, both in editor and at runtime.&lt;br /&gt;
The component should be added directly to the root object of the prefab. Nested prefabs are not supported. Because the prefab is going to be overwritten after bake (the same way as when the “Apply” button is pressed), it is required that the prefab does not have any unapplied changes (child objects shouldn’t be moved, materials and script parameters should be unchanged, etc). If such changes are detected, an error will be printed in the component UI and no metadata will be saved after bake. If [[#Warnings|Lightmapped prefab validation]] warning is enabled, all prefab errors will be also shown in a dialog box before the bake.&lt;br /&gt;
&lt;br /&gt;
Lightmapped prefabs support all Bakery features, such as LODs, terrains, directional lightmaps, RNM, SH, per-vertex modes and shadowmasks. For shadowmasks to work, you need lights to also be a part of the same prefab.&lt;br /&gt;
&lt;br /&gt;
{{note| Note that prefab shadowmasks only work on Unity 2017.4 or newer due to API limitations.}}&lt;br /&gt;
&lt;br /&gt;
After baking, an object named “BakeryPrefabLightmapData” will be added to prefab. This object holds a script with all necessary data to apply the lightmaps.&lt;br /&gt;
&lt;br /&gt;
Additionally, Lightmapped Prefab allows to save current render settings and load them back to any currently open scene, using two buttons:&lt;br /&gt;
* Save current render settings to prefab: stores a copy of current Render Settings on  this prefab.&lt;br /&gt;
* Load render settings from prefab: sets current Render Settings to those stored on the prefab.&lt;br /&gt;
[[File:Upload 2019-9-17 10-32-34.png|thumb|Applying the prefab]]&lt;br /&gt;
When baking a Lightmapped Prefab, it is recommended to check that:&lt;br /&gt;
* Prefab is &amp;quot;Applied&amp;quot;. On older Unity versions, click &amp;quot;Apply&amp;quot; button on the top right corner on the Inspector. On newer versions click the &amp;quot;Overrides&amp;quot; list and then &amp;quot;Apply all&amp;quot;.&lt;br /&gt;
* Prefab component UI does not show any errors.&lt;br /&gt;
* &amp;quot;Lightmapped prefab validation&amp;quot; checkbox is enabled in the main window. This option will validate all Lightmapped Prefabs in the scene and notify about any potential issues with a dialog box.&lt;br /&gt;
&lt;br /&gt;
{{note| Lightmaps are named after the scene they are baked in or a Lightmap Group they use (if any). When baking different prefabs in the same scene, make sure to either use a differently named [[Manual#Bakery_Lightmap_Group_Selector|Lightmap Group]] or change the [[Manual#Output_path|Output Path]].}}&lt;br /&gt;
&lt;br /&gt;
{{note| When baking multiple prefabs using identical models one by one, it is recommended to set [[Manual#Asset_UV_Processing|Asset UV Processing]] to ''Don't Change'', to prevent alteration of shared model UVs.}}&lt;br /&gt;
&lt;br /&gt;
{{note| Bakery's prefab workflow was implemented before Unity had a &amp;quot;double-click into prefab&amp;quot; view feature. Thus, lightmaps may be not correctly applied in the isolated prefab view, and the component may show a &amp;quot;This GameObject is not a prefab&amp;quot; message. It should work as expected when working in a normal scene.}}&lt;br /&gt;
&lt;br /&gt;
{{note|When unpacking previously baked prefabs and unlinking them from existing lightmaps, make sure to remove the BakeryPrefabLightmapData object which holds the prefab-wide lightmap/renderer connections.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Direct Light ===&lt;br /&gt;
[[File:Directlight.jpg|thumb|Pure direct light with GI]]&lt;br /&gt;
[[File:Image4.png|thumb|Left: shadow spread = 0.01, right: 0.05. Note how shadows start sharp and get gradually blurrier with distance.]]&lt;br /&gt;
Infinitely distant directional light (e.g. Sun).&lt;br /&gt;
* Color: color.&lt;br /&gt;
* Intensity: linear color multiplier.&lt;br /&gt;
* Shadow spread: size of the light source or, simply put, shadow blurriness. 0 = max sharp shadows, 1 = max blurred shadows. Technically it interpolates from a single ray to a wider cone of rays.&lt;br /&gt;
* Shadow samples: affect shadows quality. The smaller the Shadow Spread value, the less samples are needed for a clean image. Typical values for sun shadows are from 1 to 16. Setting samples to 0 will make shadows from this light disappear.&lt;br /&gt;
* Bitmask: a list of toggles used to exclude this light source from affecting particular Lightmap Groups.&lt;br /&gt;
* Baked contribution: determines what kind of lighting data should be baked. Only visible in Indirect or Shadowmask modes. Possible values:&lt;br /&gt;
** Direct and Indirect: both direct and indirect contribution will be completely baked.&lt;br /&gt;
** Indirect only: a realtime light is supposed to provide direct contribution; only indirect lighting is baked.&lt;br /&gt;
** Shadowmask and indirect: a realtime light is supposed to provide direct contribution, but shadows from static geometry will be baked to a separate map. Dynamic and static shadows will be mixed together. Indirect lighting will be baked as usual.&lt;br /&gt;
** Direct, Indirect, Shadowmask (custom lighting only): same as Direct and Indirect, but the Shadowmask is also produced and assigned to use with custom shaders.&lt;br /&gt;
* Denoise shadowmask: determines if denoising should be applied to this light’s shadowmask. Usually it’s not necessary as shadows don’t exhibit much noise, but can be useful for very wide blurry shadows (large shadow spread).&lt;br /&gt;
* Indirect intensity: non-physical GI multiplier for this light. Should be 1 for natural lighting, but can be modified for more stylized scenes.&lt;br /&gt;
* Anti-alias: performs super-sampling for the shadow.&lt;br /&gt;
* Texture projection: projects a multiplicative tiled texture over lighting. Can be used to emulate distant cloud shadows.&lt;br /&gt;
When texture projection is set, its scale/offset can be manipulated using &amp;quot;Tiling&amp;quot; and &amp;quot;Offset&amp;quot; fields. Alternatively, click &amp;quot;Tweak projection in Scene View&amp;quot; and use additional gizmo to move and scale the projection visually. Click &amp;quot;Render reference frame&amp;quot; to save a PNG of &amp;quot;light's point of view&amp;quot;. This is useful to paint cloud shadows over the scene.&lt;br /&gt;
&lt;br /&gt;
If the same object has both Unity and Bakery light sources enabled, and they don’t match, two buttons will appear:&lt;br /&gt;
* Match lightmapped to real-time: copy common settings from Unity light to Bakery light.&lt;br /&gt;
* Match real-time to lightmapped: copy common settings from Bakery light to Unity light.&lt;br /&gt;
&lt;br /&gt;
{{note| In physical terms, Bakery's &amp;quot;Intensity&amp;quot; for directional lights is Lux divided by Pi.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Sky Light ===&lt;br /&gt;
[[File:Skylight.jpg|thumb|Pure sky light with GI]]&lt;br /&gt;
Infinitely distant shadowed ambient light (sky).&lt;br /&gt;
* Color: color.&lt;br /&gt;
* Intensity: linear color multiplier.&lt;br /&gt;
* Sky texture: optional cubemap asset, e.g. HDRI panorama to affect lighting colors from different directions.&lt;br /&gt;
{{note| Rotating sky light’s GameObject will rotate lighting from the cubemap accordingly.}}&lt;br /&gt;
* Samples: affects shadows quality. Typical values are from 8 to 32.&lt;br /&gt;
* Hemispherical: if enabled, lighting will only come from above (upper hemisphere). Otherwise from all directions.&lt;br /&gt;
* Bitmask: a list of toggles used to exclude this light source from affecting particular Lightmap Groups.&lt;br /&gt;
* Baked contribution: determines what kind of lighting data should be baked. Only visible in Indirect or Shadowmask modes. Possible values:&lt;br /&gt;
** Direct and Indirect: both direct and indirect contribution will be completely baked. This is the default and recommended behaviour for all Sky Lights, as there is no real-time version to emulate them in Unity.&lt;br /&gt;
** Indirect only: a realtime light is supposed to provide direct contribution; only indirect lighting is baked.&lt;br /&gt;
&lt;br /&gt;
If sky light’s settings and current scene skybox don’t match, two buttons will appear:&lt;br /&gt;
* Match this light to scene skybox: copy common settings from active skybox material to Bakery sky light. Currently it can only match skyboxes using the “Skybox/Cubemap” or “Skybox/Bakery skybox” shaders.&lt;br /&gt;
* Match scene skybox to this light: copy common settings from Bakery sky light to scene skybox.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bakery Light Mesh ===&lt;br /&gt;
[[File:Image29.png|thumb|Left: Samples Near = 0, Samples Far = 4096.&amp;lt;br&amp;gt;&lt;br /&gt;
Middle: Samples Near = 0, Samples Far = 128.&amp;lt;br&amp;gt;&lt;br /&gt;
Right: Samples Near = 16, Samples Far = 128.&amp;lt;br&amp;gt;&lt;br /&gt;
Note how the lighting appearance is similar, yet less combined samples are used.]]&lt;br /&gt;
Emissive mesh of any shape. Should be used together with the Mesh Renderer component or with a Light component set to Area mode.&lt;br /&gt;
* Color: color&lt;br /&gt;
* Intensity: linear color multiplier.&lt;br /&gt;
* Cutoff: maximum lighting distance. Bakery will additionally attenuate correct inverse-squared falloff near the limit. It works best when cutoff value is just where physical falloff gets very dim. Cutoff can improve baking performance, but you also can set it to a very high (unreachable) value for complete correctness.&lt;br /&gt;
* Self Shadow: determines if light mesh itself casts shadows. This option also enables a more precise lighting algorithm.&lt;br /&gt;
* Samples Near: affect lighting quality near the mesh. Typical values are from 16 to 64. This option is only available when Self Shadow is on.&lt;br /&gt;
* Samples Far: affects lighting quality far away from the mesh. Typical values are from 4 to 4096.&lt;br /&gt;
&lt;br /&gt;
Bakery mixes two different algorithms for area lights based on emissive surface proximity. Close to the light it works similar to the GI algorithm, while at a distance the light is approximated as a cloud of virtual point lights.&lt;br /&gt;
&lt;br /&gt;
{{note| &amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;Light Meshes don’t receive lighting on their own and don’t get lightmapped.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;One Light Mesh with many polygons is faster to bake than many simple Light Meshes.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;If you keep getting dirty/noisy results, try setting Samples Near to 0. Then only the VPL algorithm is used. It is also useful for very simple lights where precision is not important (e.g. window lights on a building).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;}}&lt;br /&gt;
[[File:Dd99d-QU0AEKFBK.jpg|thumb|A curved Light Mesh]]&lt;br /&gt;
* Bitmask: a list of toggles used to exclude this light source from affecting particular Lightmap Groups.&lt;br /&gt;
* Baked contribution: determines what kind of lighting data should be baked. Only visible in Indirect or Shadowmask modes. Possible values:&lt;br /&gt;
** Direct and Indirect: both direct and indirect contribution will be completely baked. This is the default and recommended behaviour for all Light Meshes, as there is no real-time version to emulate them in Unity.&lt;br /&gt;
** Indirect only: a realtime light is supposed to provide direct contribution; only indirect lighting is baked.&lt;br /&gt;
** Shadowmask and Indirect: a realtime light is supposed to provide direct contribution, but shadows from static geometry will be baked to a separate map. Dynamic and static shadows will be mixed together. Indirect lighting will be baked as usual. Currently only HDRP (and custom renderers) support mixed area lights.&lt;br /&gt;
** Direct, Indirect, Shadowmask (custom lighting only): same as Direct and Indirect, but the Shadowmask is also produced and assigned to use with custom shaders.&lt;br /&gt;
* Indirect intensity: non-physical GI multiplier for this light. Should be 1 for natural lighting, but can be modified for more stylized scenes.&lt;br /&gt;
* Shadowmask with falloff: bakes complete light attenuation into the shadowmask (only useful with custom shaders).&lt;br /&gt;
&lt;br /&gt;
If mesh material and light settings do not match, two buttons will appear:&lt;br /&gt;
* Match light to material:  copy common settings from unlit mesh material or area light to Bakery light.&lt;br /&gt;
* Match material to light: copy common settings from Bakery light to unlit mesh material or area light.&lt;br /&gt;
&lt;br /&gt;
==== Differences between Light Mesh and emissive materials ====&lt;br /&gt;
Emissive material:&lt;br /&gt;
* Propagates light during GI calculation, therefore is “free”, no matter how many meshes are emissive.&lt;br /&gt;
* Small and bright lights can give inaccurate noisy results, depending on GI sample count.&lt;br /&gt;
* Has to occupy space in lightmap due to the way GI in Bakery works, therefore possibly wasting it. Also it means that emissive objects require valid UVs and have “Cast shadows” enabled..&lt;br /&gt;
&lt;br /&gt;
Light Mesh:&lt;br /&gt;
* Lighting is calculated separately for each light, therefore is slower than emissive materials.&lt;br /&gt;
* Designed to give clean results for small and bright lights, even very far away from them.&lt;br /&gt;
* Doesn’t take space in lightmaps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Point Light ===&lt;br /&gt;
[[File:Image11.png|thumb|Left: Shadow Spread = 0.5, right: Shadow Spread = 1.]]&lt;br /&gt;
Point light, doesn’t have area. Despite physical impossibility it is useful for games and the only way to match Unity’s point and spot lights.&lt;br /&gt;
{{note|Spot lights are just point lights with additional projection mask.}}&lt;br /&gt;
* Color: color.&lt;br /&gt;
* Intensity: linear color multiplier.&lt;br /&gt;
* Shadow spread: shadow blurriness. Although point lights don’t have area, it is often desired to still have blurred shadows from them. For this purpose shadows are simulated as if they were cast from a spherical area light. This parameter defines the radius of such virtual sphere, directly affecting blurriness.&lt;br /&gt;
* Physical falloff: if enabled, will use correct inverse-squared falloff with additional attenuation near the limit. Otherwise will try to mimic Unity’s falloff.&lt;br /&gt;
* Falloff min size: learn more in [[Point Light Attenuation]] section.&lt;br /&gt;
* Range: if physical falloff is disabled, equals to Unity’s light range. If it’s enabled, will only slightly fade away physical falloff at the edge.&lt;br /&gt;
* Samples: affects shadows quality. Typical values are from 1 to 512. Setting samples to 0 will make shadows from this light disappear.&lt;br /&gt;
[[File:Image10.png|thumb|Left to right: Omni, Cookie (default spot texture), Cubemap, IES.]]&lt;br /&gt;
* Projection mask: type of mask/cookie. Options:&lt;br /&gt;
** Omni: no mask, equals to Unity’s Point Light.&lt;br /&gt;
** Cookie: cookie texture projection. Additional options:&lt;br /&gt;
*** Cookie texture: 2D texture asset. Bakery includes the original Unity’s Spot Light texture (named ftUnitySpotTexture) that you can use to mimic it.&lt;br /&gt;
*** Angle: texture projection angle (similar to Unity’s Spot Light).&lt;br /&gt;
*** Correct distortion: corrects cookie distortion visible on straight lines at wide angles.&lt;br /&gt;
** Cubemap: cubemap cookie projection. Additional options:&lt;br /&gt;
*** Projected cubemap: cubemap asset.&lt;br /&gt;
{{note|Bakery supports colored cookies and reads RGB from cookie/cubemap textures. Unity, on the other hand, only supports grayscale cookies. Setting Texture Type to &amp;quot;Cookie&amp;quot; on the asset will convert it to a single-channel A8 format. For Bakery, leave Texture Type to Default.}}&lt;br /&gt;
** IES: lighting is modulated by the IES file data. Additional options:&lt;br /&gt;
*** IES file: file with .ies extension.&lt;br /&gt;
* Bitmask: a list of toggles used to exclude this light source from affecting particular Lightmap Groups.&lt;br /&gt;
* Baked contribution: determines what kind of lighting data should be baked. Only visible in Indirect or Shadowmask modes. Possible values:&lt;br /&gt;
** Direct and Indirect: both direct and indirect contribution will be completely baked.&lt;br /&gt;
** Indirect only: a realtime light is supposed to provide direct contribution; only indirect lighting is baked.&lt;br /&gt;
** Shadowmask and Indirect: a realtime light is supposed to provide direct contribution, but shadows from static geometry will be baked to a separate map. Dynamic and static shadows will be mixed together. Indirect lighting will be baked as usual.&lt;br /&gt;
** Direct, Indirect, Shadowmask (custom lighting only): same as Direct and Indirect, but the Shadowmask is also produced and assigned to use with custom shaders.&lt;br /&gt;
* Indirect intensity: non-physical GI multiplier for this light. Should be 1 for natural lighting, but can be modified for more stylized scenes.&lt;br /&gt;
* Shadowmask with falloff: bakes complete light attenuation (except for distance) into the shadowmask (only useful with custom shaders).&lt;br /&gt;
* Legacy sampling: use Bakery's original more biased shadow sampling strategy. Produces noise-free shadows, but wide penumbras can exhibit banding. If disabled, an unbiased, but noisier technique is used.&lt;br /&gt;
&lt;br /&gt;
If the same object has both Unity and Bakery light sources enabled, and they don’t match, two buttons will appear:&lt;br /&gt;
* Match lightmapped to real-time: copy common settings from Unity light to Bakery light.&lt;br /&gt;
* Match real-time to lightmapped: copy common settings from Bakery light to Unity light.&lt;br /&gt;
&lt;br /&gt;
{{note| In physical terms, Bakery's &amp;quot;Intensity&amp;quot; for points lights is (Candela/Pi).}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Volume ===&lt;br /&gt;
[[File:Voldemo notlonely.gif|A dynamic door being lit by a BakeryVolume (animated GIF by NOTLonely)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Volumes generate 3D textures that store light probes per voxel (L1 spherical harmonics and shadowmasks) making them a viable replacement for regular Unity light probes.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Unity Light Probes&lt;br /&gt;
! Unity LPPV&lt;br /&gt;
! Bakery Volumes&lt;br /&gt;
|-&lt;br /&gt;
| Manually placing each probe&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | No&lt;br /&gt;
|-&lt;br /&gt;
| Interpolate multiple probes on one object&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Movable at runtime&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Can put in a prefab&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Full scripting API&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Ringing&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Possible&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Possible&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Fixed&lt;br /&gt;
|-&lt;br /&gt;
| Denoising&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Runtime overhead&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | CPU: low; GPU: low.&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | CPU: medium; GPU: medium.&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#e4ead3;&amp;quot; | CPU: none; GPU: medium.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bakery Volume is a bounding box linked to a set of 3D textures (3 SH textures and one shadowmask, if needed), making it very easy to use and script. Volumes can be trivially swapped, moved, loaded or unloaded at runtime or linked to prefabs. They also do not need any Light Probe Groups and manual probe placement; the whole volume is filled with a uniform grid of probe voxels. Light/shadow leaking is automatically fixed the same way it is done for lightmaps (although thin double-sided walls may be a problem with large voxel size, but it can be avoided by using different volumes on different sides). Because of the uniform nature of voxel grids, it is also possible to apply lightmap-like denoising to them, which is not possible with regular light probes. Additionally, Bakery shaders use the [https://drive.google.com/file/d/1MK6Clw93q8ljijRjb4gQOzzaIjn1uF9Y/view Geomerics sampling trick] to completely get rid of the &amp;quot;ringing&amp;quot; artifact spherical harmonics can sometimes produce with high-contrast HDR lighting.&lt;br /&gt;
&lt;br /&gt;
Because of that, Volumes can produce clean, detailed, high-quality baked lighting for dynamic objects (that is, the lighting that comes from the static objects and affects dynamic objects, not the other way around).&lt;br /&gt;
&lt;br /&gt;
The only downside of the Volume approach is the higher per-pixel shading cost. The cost is similar to LPPV (scaling with the amount of shaded volume-affected pixels on the screen) but unlike LPPV, the Volumes themselves are never updated once they are baked. Multiple volume blending can be avoided by slightly overlapping them instead.&lt;br /&gt;
&lt;br /&gt;
====Setting volume transform====&lt;br /&gt;
[[File:Bvolgizmo.jpg|thumb|Volume gizmo]]&lt;br /&gt;
When BakeryVolume is added to a GameObject, a bounding box gizmo will appear in scene view. Dragging it by the little squares will scale it.&lt;br /&gt;
There are also other ways to change volume size and position:&lt;br /&gt;
* Drag any renderable GameObject into &amp;quot;Wrap to object&amp;quot; field. The volume will wrap around this object (and its children) to encapsulate them.&lt;br /&gt;
* If there is a Box Collider added to the same object, &amp;quot;Set from box collider&amp;quot; and &amp;quot;Set to box collider&amp;quot; buttons will appear. These can be used to quickly copy values between Volume/Collider.&lt;br /&gt;
&lt;br /&gt;
====Resolution====&lt;br /&gt;
When &amp;quot;Adaptive resolution&amp;quot; is enabled, the amount of voxels is governed by &amp;quot;Voxels per unit&amp;quot;. Disabling it allows to manually enter the resolution. For most games with 1 unit = 1 meter, a reasonable &amp;quot;Voxels per unit&amp;quot; value is 2, but there are cases (e.g. dynamic doors) when using a smaller, but higher resolution volume is beneficial.&lt;br /&gt;
&lt;br /&gt;
====Other settings====&lt;br /&gt;
* Enable baking: should the volume be (re)computed? Disable to prevent overwriting existing data.&lt;br /&gt;
* Denoise: apply denoising after baking the volume. Recommended for high-resolution volumes. Avoid using for very low-resolution volumes covering many lights, as it will be hard for denoisers to tell actual content from noise.&lt;br /&gt;
* Global: automatically assign this volume to all volume-compatible shaders, unless they have overrides. Internally it will call Shader.SetGlobalTexture()/SetGlobalVector().&lt;br /&gt;
&lt;br /&gt;
====Usage====&lt;br /&gt;
Volumes can be assigned to objects using a volume-aware shader. Bakery comes with &amp;quot;Bakery Standard&amp;quot; shader that implements it, as well as a HDRP and URP graphs. See example_volumes scenes for various ways of applying a volume.&lt;br /&gt;
&lt;br /&gt;
====Hints====&lt;br /&gt;
* Make sure to check the examples.&lt;br /&gt;
* If two volumes connect, make them overlap a bit. The size of the overlap should be equal to the size of the largest dynamic object. This way simply switching between volumes on the go will work.&lt;br /&gt;
* Only place volumes around areas dynamic objects can actually reach. E.g. use player height to limit volume height.&lt;br /&gt;
&lt;br /&gt;
====Rotating volumes====&lt;br /&gt;
Volumes can be rotated around Y axis, if &amp;quot;Rotate around Y&amp;quot; option is enabled. Rotation is very cheap and only uses 2 extra floats of data (precomputed sin/cos of the angle).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There is also an additional option to rotate volumes at runtime (Experimental -&amp;gt; &amp;quot;Support rotation after bake&amp;quot; and a similar option in Bakery Shader), in which case they need to be baked with zero initial rotation.&lt;br /&gt;
&lt;br /&gt;
In URP such dynamic rotation can be used with BakeryURPVolumeGraphRotatable.shadergraph.&lt;br /&gt;
&lt;br /&gt;
For global volumes dynamic rotation will be updated when the component is (re)enabled or volume.SetGlobalParams() is called. Using local rotated volumes requires manually setting the rotation on the material or the MaterialPropertyBlock:&lt;br /&gt;
{{code|&amp;lt;nowiki&amp;gt;SetMatrix(&amp;quot;_VolumeMatrix&amp;quot;, volume.GetMatrix())&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
====Technical information====&lt;br /&gt;
Volumes can work automatically (check example scenes), but it is also possible to script the way they are used.&lt;br /&gt;
&lt;br /&gt;
Volume data can be retrieved from the component via these public properties:&lt;br /&gt;
* bakedTexture0: stores L0 RGB coefficients and L1 Z red channel in alpha.&lt;br /&gt;
* bakedTexture1: stores L1 X RGB coefficients and L1 Z green channel in alpha.&lt;br /&gt;
* bakedTexture2: stores L1 Y RGB coefficients and L1 Z blue channel in alpha.&lt;br /&gt;
* bakedMask: stores the volumetric shadowmask.&lt;br /&gt;
* bounds: the bounding box of the volume.&lt;br /&gt;
&lt;br /&gt;
All bakedTexture* maps use RGBAHalf (8 bytes per voxel) format and the mask is ARGB32 (4 bytes per voxel). Shadowmask can also use single-channel R8 format (1 byte per voxel).&lt;br /&gt;
&lt;br /&gt;
Therefore volume byte size = width*height*depth*3*8 + (only if the shadowmask is used) width*height*depth*4 (or width*height*depth with an R8 mask).&lt;br /&gt;
&lt;br /&gt;
[[Manual#Compress_volumes|Texture compression]] can be enabled on volumes to make them much smaller.&lt;br /&gt;
&lt;br /&gt;
To sample the volume, a special shader is needed, and these are included in Bakery. To add volumes to a custom shader, check BakeryVolume_float() function in BakeryDecodeLightmap.hlsl which is included in HDRP/URP packages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Light Filter ===&lt;br /&gt;
[[File:Output optimized.gif|Stained glass, as seen in Bakery Real-Time Preview. Same results are baked by the Bakery lightmapper.]]&lt;br /&gt;
&lt;br /&gt;
Marks a renderer as a Light Filter. Filters tint all direct/indirect rays with their color, similar to real-life optical filters, allowing for colored transparencies (e.g. stained glass). The only parameter is the texture used for tinting.&lt;br /&gt;
* Light Filter objects still receive lightmaps like everything else.&lt;br /&gt;
* Filters don't scatter/blur rays (for that try [[Subsurface_scattering|Subsurface Scattering]] or [[Manual#Backface_GI|Backface GI]]).&lt;br /&gt;
* Filters can produce color-tinted shadows. If [[Manual#Shadowmask|Shadowmask]] mode is used on the light, only R channel of the result will be saved (as Unity only supports single-channel masks). For fully baked shadows there are no limitations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Sector ===&lt;br /&gt;
See '''[[Partial_scene_baking|Partial scene baking]]'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Always Render ===&lt;br /&gt;
If added to an object, Bakery will always take it into account when baking, even if its renderer is disabled.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Pack As Single Square ===&lt;br /&gt;
If added to an object, Bakery will treat UVs of this object and its children as a single combined square and never move them away from each other during automatic atlas packing or in a Lightmap Group with Pack Atlas mode. Whole children hierarchy will be packed as one.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Shared LOD UV ===&lt;br /&gt;
If added to a LODGroup, will mark all similarly-named LODs as sharing the same lightmap. By default, every LOD mesh receives a unique lightmap, taking space in the atlas; If, however, it is known that LODs of the same object have similar UV2 (or UV1, if it's non-overlapping, and UV2 is not present), they can map to the same part of the atlas, saving memory.&lt;br /&gt;
This technique is also known as [https://github.com/laurenth-personal/LODLightmapScripts/ Lightmap Stealing].&lt;br /&gt;
&lt;br /&gt;
= Material compatibility =&lt;br /&gt;
=== Albedo and emission ===&lt;br /&gt;
Bakery supports most Unity materials by utilizing the [https://docs.unity3d.com/Manual/MetaPass.html Meta Pass] system. All built-in, surface, URP and HDRP shaders already have a correct meta pass defined.&lt;br /&gt;
&lt;br /&gt;
If you have an Unlit shader, add meta pass manually, as described in Unity docs.&lt;br /&gt;
&lt;br /&gt;
If the pass is not present, Bakery will assume {{codeVar|_MainTex}}, {{codeVar|_BaseColorMap}} or {{codeVar|_Color}} (if no texture is set) properties as material albedo and {{codeVar|_EmissionMap}} and {{codeVar|_EmissionColor}} as emissive color.&lt;br /&gt;
&lt;br /&gt;
In order for emission to work, [https://docs.unity3d.com/ScriptReference/Material-globalIlluminationFlags.html Material.globalIlluminationFlags] must be set to [https://docs.unity3d.com/ScriptReference/MaterialGlobalIlluminationFlags.BakedEmissive.html MaterialGlobalIlluminationFlags.BakedEmissive]. Standard shaders set this value automatically.&lt;br /&gt;
&lt;br /&gt;
=== Opacity ===&lt;br /&gt;
[[File:Upload 2019-1-25 0-4-30.png|thumb|Material parameters converted to cutout (default)]]&lt;br /&gt;
[[File:Alphacombos dither.jpg|thumb|Semi-transparent values added via Dither Transparency option]]&lt;br /&gt;
[[File:Alphacombos filter.jpg|thumb|Light Filter components used on red planes, producing colored shadows]]&lt;br /&gt;
By default, Bakery always takes full resolution opacity from the alpha value of {{codeVar|_MainTex}}, {{codeVar|_BaseColorMap}} or {{codeVar|_BaseMap}} and treats it as cutout (1 bit tranparency).&lt;br /&gt;
&lt;br /&gt;
When '''Dither Transparency''' option is enabled, semi-transparent values are automatically converted to variable blue noise, which is then filtered/blurred, resulting in partial transparency (it was previously possible using custom manually dithered maps, but since v1.97 it is automatic).&lt;br /&gt;
&lt;br /&gt;
In order for opacity to work, [https://docs.unity3d.com/Manual/SL-SubShaderTags.html RenderType tag] of the shader must be one of these values:&lt;br /&gt;
* {{codeVar|Transparent}}&lt;br /&gt;
* {{codeVar|TransparentCutout}}&lt;br /&gt;
* {{codeVar|TreeLeaf}}&lt;br /&gt;
&lt;br /&gt;
If a property named {{codeVar|_Cutoff}} is present, it will affect the cutout (therefore Standard shader cutoff slider works automatically).&lt;br /&gt;
&lt;br /&gt;
Without Dither Transparency, if material RenderType is {{codeVar|Transparent}} or {{codeVar|TreeLeaf}}, then alpha value of {{codeVar|_Color}} will additionally modify the cutoff: ''finalCutoff = 1 - (1 - cutoff) * alpha''&lt;br /&gt;
&lt;br /&gt;
For colored transparency, use the [[Manual#Bakery_Light_Filter|Light Filter]] component.&lt;br /&gt;
&lt;br /&gt;
For diffuse translucency effects read about [[#Backface GI|Backface GI]] and [[subsurface scattering]].&lt;br /&gt;
&lt;br /&gt;
==== Alpha Meta Pass ====&lt;br /&gt;
Since v1.9 Bakery also supports specifying custom shader-based transparency, but it requires a compatible shader. To take advantage of ''Alpha Meta Pass'', following steps must be taken:&lt;br /&gt;
* Add a property named '''BAKERY_META_ALPHA_ENABLE''' to the shader. For example:&lt;br /&gt;
{{code|&amp;lt;nowiki&amp;gt;[HideInInspector] BAKERY_META_ALPHA_ENABLE (&amp;quot;Enable Bakery alpha meta pass&amp;quot;, Float) = 1.0&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
* Make sure that RenderType tag is set to one of the values above.&lt;br /&gt;
* Declare a pass named '''META_BAKERY'''. &lt;br /&gt;
* In that pass check if '''unity_MetaFragmentControl.w''' is non-zero, in which case, return the computed transparency value. &lt;br /&gt;
&lt;br /&gt;
See ''Baked_Alpha_meta.shader'' included in the package as an example.&lt;br /&gt;
&lt;br /&gt;
Note: currently Alpha Meta Pass requires Light Probe Mode to be set to L1 or L2.&lt;br /&gt;
&lt;br /&gt;
=== Normal mapping ===&lt;br /&gt;
Custom surface normals can be used in conjunction with [[#Baked Normal Maps|Baked Normal Maps]] mode. Unfortunately, Unity's Meta Pass does not output normal information, so by default normals are taken from a texture named {{codeVar|_BumpMap}}, additionally transformed by {{codeVar|_MainTex_ST}}.&lt;br /&gt;
&lt;br /&gt;
It is however possible to make completely custom shaders with advanced normal mapping features (e.g. blending multiple layers) compatible with baking. To do that you'll need:&lt;br /&gt;
&lt;br /&gt;
1. Define a Meta Pass in your shader, just [https://docs.unity3d.com/Manual/MetaPass.html#ExampleMetaPass as described in Unity docs].&lt;br /&gt;
&lt;br /&gt;
2. Name it {{codeVar|&amp;quot;META_BAKERY&amp;quot;}}, instead of just {{codeVar|&amp;quot;META&amp;quot;}}.&lt;br /&gt;
&lt;br /&gt;
3. Include {{codeVar|&amp;quot;BakeryMetaPass.cginc&amp;quot;}}.&lt;br /&gt;
&lt;br /&gt;
4. Add {{codeVar|#pragma vertex vert_bakerymt}}&lt;br /&gt;
&lt;br /&gt;
5. If {{codeVar|unity_MetaFragmentControl.z}} variable is not 0, shader should return world-space normal. Returned normal should be encoded using {{codeVar|BakeryEncodeNormal}} function.&lt;br /&gt;
&lt;br /&gt;
Two example shaders implementing this extended Meta Pass are included in Assets/Bakery/examples/shaders.&lt;br /&gt;
&lt;br /&gt;
You can copy and modify BakeryMetaPass.cginc to suit your needs, e.g. pass additional data from the vertex shader.&lt;br /&gt;
&lt;br /&gt;
=== Front/back faces ===&lt;br /&gt;
No matter what culling mode is used on the shader, Bakery treats all back-faces as opaque, meaning any direct light ray will not pass through a back-face, just as it will not pass through a front-face.&lt;br /&gt;
However, back-faces can partially emit lighting received by a front-face, if you use [[Manual#Backface_GI|Backface GI]].&lt;br /&gt;
&lt;br /&gt;
= &amp;quot;Lightmap Parameters&amp;quot; assets =&lt;br /&gt;
[[File:Lp.jpg|thumb|Extended Lightmap Parameters]]&lt;br /&gt;
Similar to Bakery's [[Manual#Bakery_Lightmap_Group_Selector|Lightmap Groups]], Unity has [https://docs.unity3d.com/Manual/class-LightmapParameters.html Lightmap Parameters] that can be created as assets and assigned to Mesh Renderers. Their logic has differences and similarities:&lt;br /&gt;
* Lightmap Group's primary usage is to group multiple objects in one atlas. Additionally it allows overriding baking settings for this atlas.&lt;br /&gt;
* Lightmap Parameters are primarily used to override baking settings for an object. But additionally they can influence packing by using the &amp;quot;Baked Tag&amp;quot; option: objects with a different Baked Tag will never share the same atlas.&lt;br /&gt;
&lt;br /&gt;
Since some users are more used to the Lightmap Parameters workflow, Bakery now supports and extends them:&lt;br /&gt;
* Baked Tag is respected by Bakery.&lt;br /&gt;
* Additional Bakery-specific options will be shown in the Lightmap Parameters UI. Refer to the [[Manual#Bakery_Lightmap_Group_Selector|Lightmap Group]] section for their meaning.&lt;br /&gt;
&lt;br /&gt;
= Project Settings =&lt;br /&gt;
Some global settings can be tweaked in Project Settings -&amp;gt; Bakery GPU Lightmapper (this option is only visible in Unity 2018.3 or newer; for older versions, edit BakeryProjectSettings.asset instead):&lt;br /&gt;
* Mipmap lightmaps: enables mipmapping on lightmap assets. Can cause leaks across UV charts as atlases get smaller; on the other hand, it reduces high resolution lightmap aliasing in the distance. Overall it is recommended to use separately baked LODs with lower resolution lightmaps for very distant objects instead.&lt;br /&gt;
* Color file format: format for regular HDR color lightmaps. Possible values:&lt;br /&gt;
** HDR: Radiance HDR format (default). Can be opened in many image editors.&lt;br /&gt;
** Asset: native Unity format. Can have custom mipmap count.&lt;br /&gt;
* Mask/Direction file format: format for additional LDR maps, such as shadowmasks or directional data. Possible values:&lt;br /&gt;
** TGA: 8-bit Targa (default).&lt;br /&gt;
** PNG: 8-bit PNG. Usually takes less space on disk compared to TGA.&lt;br /&gt;
** Asset: native Unity format. Can have custom mipmap count.&lt;br /&gt;
* Compress lightmaps: defines lightmap asset compression behaviour. Compressed lightmaps take less VRAM, but may exhibit some visual artifacts (such as banding or colored blotches) depending on the type of compression (for mobile compression issues [[Troubleshooting#I_have_an_Android_project.2C_and_lightmaps_don.27t_look_good|see this]]). Possible values:&lt;br /&gt;
*** Compress but allow overriding asset: new lightmaps will be created with compression enabled. After they are created, it is possible to change their compression settings in Inspector. These modified values will be kept after rebaking (default).&lt;br /&gt;
*** Force compress: always compress all lightmaps.&lt;br /&gt;
*** Force no compress: always produce uncompressed lightmaps.&lt;br /&gt;
* High quality direction: enables &amp;quot;high&amp;quot; quality compression for directional maps. Actual formats depend on platform. On PC, for example, it will change it from DXT1 to BC7, which gives higher quality, but doubles the VRAM usage.&lt;br /&gt;
* Texel padding (default atlas packer): defines how many empty texels to add between objects' UV layouts in lightmap atlases, when using the default atlas packer.&lt;br /&gt;
* Texel padding (xatlas packer): same, but when using xatlas.&lt;br /&gt;
* Alpha Meta Pass resolution multiplier: multiplies resolution of the [[Manual#Alpha_Meta_Pass|Alpha Meta Pass]] allowing to have precise shader-based cutouts while baking low resolution lightmaps.&lt;br /&gt;
* Volume render mode: which [[Manual#Render_mode|render mode]] to use for all [[Manual#Bakery_Volume|Volumes]]? Auto uses current active render mode (default).&lt;br /&gt;
* Delete previous lightmaps before bake: actually delete all previously rendered lightmap files from this scene before baking new ones.&lt;br /&gt;
* Log level: defines how much information is printed to console during the bake. Possible values:&lt;br /&gt;
** 0: do not print anything.&lt;br /&gt;
** 1: only print progress information.&lt;br /&gt;
** 2: only print warnings.&lt;br /&gt;
** 3: print everything.&lt;br /&gt;
* Alternative scale in lightmap: makes 'Scale in Lightmap' renderer property act more similar to built-in Unity behaviour.&lt;br /&gt;
* Align to texture compression blocks with xatlas: makes xatlas align charts to 4x4 block boundaries, which gives more compression-friendly results.&lt;br /&gt;
* Generate smooth positions: should sample positions be adjusted to prevent incorrect shadowing on low-poly geometry with smooth normals? Can be disabled in very rare cases when using geometry with wildly mismatching normals. See [https://ndotl.wordpress.com/2018/08/29/baking-artifact-free-lightmaps/#shadowterm  this article] for technical explanation.&lt;br /&gt;
* Smooth positions per-triangle: should smooth/flat position be decided per-triangle? Can be disabled in very rare cases when using geometry with wildly mismatching normals.&lt;br /&gt;
* Use 'Receive GI' values: take 'Receive Global Illumination' values into account on renderers. Originally Bakery ignored it.&lt;br /&gt;
* Remove ringing in Legacy light probes: enables softer light probe convolution in Legacy mode to prevent artifacts in high-contrast areas.&lt;br /&gt;
* Always render reflection probes: automatically render reflection probes after every Render/Render Light Probes.&lt;br /&gt;
* Ringing removal for L2 light probes: applies de-ringing to [[Manual#Light_probe_mode|L2 light probes]]. The higher the value, the smoother the probe lighting is; this smoothing reduces [https://docs.unity3d.com/6000.2/Documentation/Manual/light-probes-troubleshooting.html ringing] artifacts (if present).&lt;br /&gt;
* Put menu under Tools: puts Bakery menu under the Tools menu.&lt;br /&gt;
&lt;br /&gt;
If any format is set to Asset, and mipmapping is enabled, an additional option is shown:&lt;br /&gt;
* Maximum mipmap count: defines maximum amount of mipmaps. For example, if set to 2, a 8K lightmap will only have two additional mipmaps: 4K and 2K. Lower resolutions will be omitted, thus limiting leaking artifacts during mipmapping.&lt;br /&gt;
&lt;br /&gt;
= Skinned mesh renderer support =&lt;br /&gt;
&lt;br /&gt;
Bakery supports skinned meshes since v1.65. However, there are some limitations:&lt;br /&gt;
* Some versions of Unity do not support UV1 on skinned meshes and silently ignore &amp;quot;Generate lightmap UVs&amp;quot;. Make sure the actual mesh used in your scene has UV1 and use non-overlapping UV0 if possible;&lt;br /&gt;
* UV padding adjustment does not work on skinned meshes (Unity seems to crash when attempting to call Unwrap function on them);&lt;br /&gt;
* Skinned meshes can't have per-vertex lightmaps (engine has no support for additionalVertexStreams with skinning).&lt;br /&gt;
&lt;br /&gt;
= Shader Tweaks =&lt;br /&gt;
[[File:Image2.jpg|thumb|Left: default bilinear filtering. Right: bicubic filtering.]]&lt;br /&gt;
[[File:Image34.jpg|thumb|Left: both shadows are baked.&amp;lt;br&amp;gt;&lt;br /&gt;
Center: spherical shadow is dynamic, and other shadow is static. Combined together with multiplication.&amp;lt;br&amp;gt;&lt;br /&gt;
Right: same as center, but combined with default minimum.]]&lt;br /&gt;
Bakery offers optional shader modifications that can be applied to Unity shaders to improve lightmap sampling and match real-time lighting closer to lightmaps. Shader tweaking menu can be accessed via Bakery-&amp;gt;Shader Tweaks.&lt;br /&gt;
&lt;br /&gt;
These options will patch base Unity shader includes (from the CGIncludes folder) that are used by most built-in and third party shaders. All modifications will affect all projects opened with this version of editor, but can be also easily reverted back. Shader tweaks affect the way standard and surface shaders work. HDRP, URP and other SRPs are not affected.&lt;br /&gt;
&lt;br /&gt;
All available modifications are shown as buttons. Press the button to apply modification, and it will remain pressed. Un-press the button to remove the modification. Currently available options:&lt;br /&gt;
&lt;br /&gt;
{{note| You may need to run Unity editor as admin to make CGIncludes patching work}}&lt;br /&gt;
&lt;br /&gt;
* Use bicubic interpolation for lightmaps: bicubic interpolation will be used instead of default bilinear. This tweak fixes many jagged edges of low resolution lightmaps pretty well. Currently it only works on DX11 and modern consoles, while other platforms will remain using bilinear.&lt;br /&gt;
&lt;br /&gt;
* Use multiplication for shadowmask: combine static and dynamic shadows using multiplication instead of minimum. For reasons unknown Unity decided to use minimum operator by default, and it produces artifacts that are not present with multiplication.&lt;br /&gt;
&lt;br /&gt;
* Use physical light falloff (forward): replace default attenuation of real-time point/spot lights with a more physically correct inverse-squared. “Range” will only slightly fade it out near the edge (matches Bakery lights with Physical Falloff checkbox). Only affects forward renderer. See [[Point Light Attenuation]] for more details.&lt;br /&gt;
&lt;br /&gt;
* Use physical light falloff (deferred): same as above, but only affects deferred renderer.&lt;br /&gt;
&lt;br /&gt;
'''Falloff tweaks may not fully work on &amp;gt; 2017 Unity versions. Also, SRPs have correct falloff by default.'''&lt;br /&gt;
&lt;br /&gt;
= Bakery shaders =&lt;br /&gt;
Bakery includes its own shaders with support for vertex lightmapping, as well as RNM and SH directional modes. It also allows approximate baked specular to be calculated from directional data. &lt;br /&gt;
Bakery shader is '''not required''' for regular color lightmaps, shadow masks and Dominant Direction mode, as these features are supported by most Unity shaders anyway.&lt;br /&gt;
&lt;br /&gt;
=== Standard render pipeline ===&lt;br /&gt;
'''Bakery/Standard''': extends regular Standard shader. Additional options:&lt;br /&gt;
* Allow Vertex Lightmaps: allows this material to be used with [[Vertex Lightmaps|vertex lightmapping]].&lt;br /&gt;
* Allow RNM Lightmaps: allows this material to be used with [[#RNM|RNM directional mode]].&lt;br /&gt;
* Allow SH Lightmaps: allows this material to be used with [[#SH|SH directional mode]].&lt;br /&gt;
{{note| All “Allow” toggles enable a certain code path in the shader. It is recommended to only use one “allow” option in a material for performance reasons.}}&lt;br /&gt;
* Enable Lightmap Specular: calculates baked specular using data from Dominant Direction, RNM or SH directional modes. Note that due to the lack of information, the effect is very approximate. If you ever used baked specular in Unity 4, it should be comparable. It looks best together with highly perturbed normal maps, not so good on flat surfaces.&lt;br /&gt;
* Enable VertexLM directional: if vertex lightmaps are present, specifies that Dominant Direction data is stored in vertices and should be used.&lt;br /&gt;
* Enable VertexLM SH: if vertex lightmaps are present, specifies that SH data is stored in vertices and should be used.&lt;br /&gt;
* Enable VertexLM Shadowmask: if vertex lightmaps are present, specifies that shadow mask is stored in vertices and should be used.&lt;br /&gt;
* Enable MonoSH: treat directional maps as MonoSH maps.&lt;br /&gt;
[[File:Image5.png|thumb|Standard SH light probe vs non-linear]]&lt;br /&gt;
[[File:Shspec.jpg|thumb|SH specular effect]]&lt;br /&gt;
* Non-linear SH: in SH directional mode this option can enhance contrast (closer to ground truth), but it makes the shader a bit slower. This trick is based on [https://drive.google.com/file/d/1MK6Clw93q8ljijRjb4gQOzzaIjn1uF9Y/view “Reconstructing Diffuse Lighting from Spherical Harmonic Data”] paper by Geomerics.&lt;br /&gt;
* Non-linear Light Probe SH: similar to Non-linear SH, but works for light probes instead. In case of probes the most notable benefit is getting rid of incorrect negative values. This problem often happens in high-contrast scenes with bright HDR light sources. It’s an inherent limitation of spherical harmonics and not specific to Bakery (i.e. you can get similar artifacts with built-in lightmappers as well).&lt;br /&gt;
* Force Bicubic Filter: enables bicubic filtering for all additional maps. For complete bicubic filtering (including the first color map) it is recommended to also enable it in [[#Shader Tweaks|Shader Tweaks]].&lt;br /&gt;
&lt;br /&gt;
'''Bakery/Standard Specular''': same as Standard, but for specular workflow.&lt;br /&gt;
&lt;br /&gt;
=== HDRP &amp;amp; URP ===&lt;br /&gt;
To extract additional HDRP/URP shaders, open Bakery_ShaderGraphHDRP.unitypackage or Bakery_ShaderGraphURP.unitypackage included with Bakery. Inside you will find Shader Subgraphs that you can use in your own Shader Graphs as well as some example materials.&lt;br /&gt;
&lt;br /&gt;
=== Feature support across shaders ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Most Unity shaders&lt;br /&gt;
! Most HDRP &amp;amp; URP shaders&lt;br /&gt;
! Bakery Standard&lt;br /&gt;
! HDRP graphs&lt;br /&gt;
! URP graphs&lt;br /&gt;
|-&lt;br /&gt;
| HDR color lightmaps&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Shadowmask&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes (Since URP 10.1)&lt;br /&gt;
|-&lt;br /&gt;
| Dominant Direction&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| RNM&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| SH&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| MonoSH&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Lightmap specular&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes for dominant direction and SH&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes for dominant direction (see link)&lt;br /&gt;
|-&lt;br /&gt;
| Bicubic filtering&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes,&lt;br /&gt;
with [[#Shader Tweaks|Shader Tweaks]]&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes,&lt;br /&gt;
with [[#Shader Tweaks|Shader Tweaks]]&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
|-&lt;br /&gt;
| Vertex lightmaps&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Single color, no per-vertex SH, direction or shadowmasks (shader graph limitation)&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Single color, no per-vertex SH, direction or shadowmasks (shader graph limitation)&lt;br /&gt;
|-&lt;br /&gt;
| Non-Linear Light Probes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Volumes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Volume shadowmask&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Compressed volumes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{note| Everything except for regular color lightmaps requires at least Shader Model 3.0 to work.}}&lt;br /&gt;
{{note| Vertex Lightmaps with SH mode require at least Shader Model 4.0 due to interpolator limit.}}&lt;br /&gt;
{{note| Updated URP graphs with specular from Dominant Direction can be downloaded [[Bakery_-_GPU_Lightmapper|from the main wiki page]].}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
See also: [[Integrating_Bakery_shader_features_to_custom_shaders| Integrating Bakery shader features to custom shaders]]&lt;br /&gt;
&lt;br /&gt;
= Notes on HDRP/URP =&lt;br /&gt;
Once the package is imported into an HDRP or URP project, in general it can be used right away, but there are some things to note:&lt;br /&gt;
&lt;br /&gt;
* Example scenes use both regular Standard and, in some cases, &amp;quot;Bakery Standard&amp;quot; shaders. HDRP and URP provide a mechanism to update project shaders from Standard to Lit, but they cannot upgrade from Bakery Standard. Replace Bakery Standard materials with the ones coming from Bakery_ShaderGraphHDRP.unitypackage or Bakery_ShaderGraphURP.unitypackage.&lt;br /&gt;
&lt;br /&gt;
* In HDRP, the default HDRI sky intensity is high (11) and sky reflection is not being occluded by default. Together with default eye adaption it may result in some example scenes being hardly visible, as they are baked using much lower intensities. Reduce HDRI sky intensity to 1 in this case. HDRI settings are usually located in Assets/HDRPDefaultResources/DefaultSettingsVolumeProfile.&lt;br /&gt;
&lt;br /&gt;
* In HDRP, if lights in example scenes are too bright, click &amp;quot;match real-time to lightmapped&amp;quot; on Bakery light components.&lt;br /&gt;
&lt;br /&gt;
* Use OpenImageDenoise 2 (best) or OptiX 7 denoiser in HDRP, as it is better suited for high intensity values.&lt;br /&gt;
&lt;br /&gt;
* In HDRP &amp;quot;distance&amp;quot; and regular Shadowmask can be switched on the Light component itself, not in global settings.&lt;br /&gt;
&lt;br /&gt;
* Don't use &amp;quot;match&amp;quot; buttons on the Skylight, as HDRP uses a very specific procedural sky shader. Instead, bake it into a HDRI [[How_do_I...#How_do_I_use_Skylight_with_a_procedural_sky_shader.3F|this way]].&lt;br /&gt;
&lt;br /&gt;
* It is recommended to always set Light Probe Mode to L2 or L1 when using HDRP, as HDRP's renderer is not optimized for the Legacy mode.&lt;br /&gt;
&lt;br /&gt;
* Newest version of HDRP/URP have their own IES file importer. Because of the asset type mismatch, Unity will unplug them from Bakery IES lights saved using older versions, meaning they will appear as regular point lights instead. They can be plugged back and re-saved.&lt;br /&gt;
&lt;br /&gt;
Bakery's example scenes are designed for the Built-in rendering pipeline, so there are a few steps to properly render them in HDRP/URP. Here are some tips; a fresh project with default HDRP/URP settings is assumed:&lt;br /&gt;
&lt;br /&gt;
=== Viewing example scenes on HDRP ===&lt;br /&gt;
* After importing Bakery, upgrade standard materials to HDRP: Edit-&amp;gt;Rendering-&amp;gt;Materials-&amp;gt;Convert All Built-in Materials To HDRP.&lt;br /&gt;
* Import Bakery_ShaderGraphHDRP.unitypackage into the project, as it contains special shader graphs implementing advanced Bakery features (not required for classic color/directional/mask lightmaps).&lt;br /&gt;
* Select DefaultSettingsVolumeProfile.asset. In HDRI Sky section, change Exposure Compensation to 1. Otherwise the default HDRP will be too bright compared to example scenes, and they will appear black due to this exposure adjustment.&lt;br /&gt;
* When selecting lights in example scenes, HDRP will initialize its own light data. Sometimes it may result in the light immediately becoming much brighter. Click &amp;quot;Match real-time to lightmapped&amp;quot; to synchronize.&lt;br /&gt;
* Set Light Probe Mode to L2 before rendering light probes.&lt;br /&gt;
* '''example_directional''': change shaders to BakeryDirSpecGraph to see baked highlights (or just regular HDRP/Lit for diffuse-only normal mapping). Delete the sphere, as there is currently no shader graph supporting per-vertex direction.&lt;br /&gt;
* '''example_directional_MonoSH''': change shaders to BakerySpecMonoSHGraph (or BakeryMonoSHGraph for a slightly cheaper version without highlights). Delete the sphere, as there is currently no shader graph supporting per-vertex MonoSH.&lt;br /&gt;
* '''example_RNM''': change shaders to BakeryRNMGraph.&lt;br /&gt;
* '''example_SH''': change shaders to BakerySpecSHGraph (or BakerySHGraph for a slightly cheaper version without highlights). Delete the sphere, as there is currently no shader graph supporting per-vertex SH.&lt;br /&gt;
* '''example_mixed_directional_mode''': similarly a different graph is needed for MonoSH/RNM/SH planes.&lt;br /&gt;
* '''example_lights''': change the shader of the vertex-lightmapped sphere to BakeryVertexColorGraph.&lt;br /&gt;
* '''example_prefabs_bake''': no further adjustments needed.&lt;br /&gt;
* '''example_sectors''': no further adjustments needed.&lt;br /&gt;
* '''example_shadowmask''': Select the DirectLight and click &amp;quot;Match real-time to lightmapped&amp;quot; to fix brightness. Set Shadowmask Mode to Shadowmask on all HDRP lights. &lt;br /&gt;
* '''example_sponza_day''': set OpenImageDenoise 2 (or Optix 7, if unsupported) as preferred denoiser.&lt;br /&gt;
* '''example_sponza_evening''': set OpenImageDenoise 2 (or Optix 7, if unsupported) as preferred denoiser.&lt;br /&gt;
* '''example_subtractive''': HDRP doesn't support the subtractive mode.&lt;br /&gt;
* '''example_volumes_simple''': change train shader to BakeryVolumeSpecGraph (or BakeryVolumeGraph for a slightly cheaper version without highlights).&lt;br /&gt;
* '''example_volumes_simple_shadowmask''': shadowmask volumes are not currently supported for HDRP.&lt;br /&gt;
* '''example_volumes_advanced''': same as with example_volumes_simple.&lt;br /&gt;
* '''example_translucency''': most of the scene should appear fine. For the &amp;quot;Dynamic sphere lit by volume&amp;quot;, set shader to BakeryVolumeGraph.&lt;br /&gt;
&lt;br /&gt;
=== Viewing example scenes on URP ===&lt;br /&gt;
* After importing Bakery, upgrade standard materials to URP: open Assets/Bakery/examples/content, select all materials by typing &amp;quot;t:material&amp;quot; and choosing to only search the &amp;quot;content&amp;quot; folder below. Click Edit-&amp;gt;Rendering-&amp;gt;Materials-&amp;gt;Convert Selected Built-in Materials To URP.&lt;br /&gt;
* Import Bakery_ShaderGraphURP.unitypackage into the project, as it contains special shader graphs implementing advanced Bakery features (not required for classic color/directional/mask lightmaps).&lt;br /&gt;
* '''example_directional''': change shaders to BakeryURPLit, enable &amp;quot;Bakery Lightmapped Specular&amp;quot; (or just keep regular URP/Lit for diffuse-only normal mapping). Delete the sphere, as there is currently no shader graph supporting per-vertex direction.&lt;br /&gt;
* '''example_directional_MonoSH''': change shaders to BakeryURPLit, set Bakery Mode to MonoSH, enable &amp;quot;Bakery Lightmapped Specular&amp;quot;. On the vertex-lit sphere also enable &amp;quot;Per-vertex&amp;quot;.&lt;br /&gt;
* '''example_RNM''': change shaders to BakeryURPLit, set Bakery Mode to RNM, enable &amp;quot;Bakery Lightmapped Specular&amp;quot;.&lt;br /&gt;
* '''example_SH''': change shaders to BakeryURPLit, set Bakery Mode to SH, enable &amp;quot;Bakery Lightmapped Specular&amp;quot;. Delete the sphere, as there is currently no shader graph supporting per-vertex SH.&lt;br /&gt;
* '''example_mixed_directional_mode''': similarly use BakeryURPLit with a different Bakery Mode (MonoSH, RNM, SH). Non-directional / dominant direction / baked normap maps can use regular URP/Lit.&lt;br /&gt;
* '''example_lights''': no further adjustments needed.&lt;br /&gt;
* '''example_prefabs_bake''': no further adjustments needed.&lt;br /&gt;
* '''example_sectors''': no further adjustments needed.&lt;br /&gt;
* '''example_shadowmask''': similarly to the Built-in pipeline, uncheck Distance Shadowmask in Bakery window (or project Quality Settings) to see actual baked/real-time shadow mixing near the camera.&lt;br /&gt;
* '''example_sponza_day''': enable alpha clipping on the foliage material.&lt;br /&gt;
* '''example_sponza_evening''': same as example_sponza_day.&lt;br /&gt;
* '''example_subtractive''': no further adjustments needed.&lt;br /&gt;
* '''example_volumes_simple''': change train shader to BakeryURPLit and set Bakery Mode to Volume. Optionally enable &amp;quot;Bakery Lightmapped Specular&amp;quot;.&lt;br /&gt;
* '''example_volumes_simple_shadowmask''': same as example_volumes_simple, but also enable &amp;quot;Volume Shadowmask&amp;quot;.&lt;br /&gt;
* '''example_volumes_advanced''': same as with example_volumes_simple.&lt;br /&gt;
* '''example_translucency''': most of the scene should appear fine. For the &amp;quot;Dynamic sphere lit by volume&amp;quot;, set shader to BakeryURPLit and Bakery Mode to Volume.&lt;br /&gt;
&lt;br /&gt;
= Upgrading Bakery =&lt;br /&gt;
When it comes to upgrading the asset, it is recommended to follow these steps:&lt;br /&gt;
* Close Bakery windows.&lt;br /&gt;
* Close Unity.&lt;br /&gt;
* Open it again.&lt;br /&gt;
* Import the updated package.&lt;br /&gt;
&lt;br /&gt;
Note that without first closing Unity importing may fail because of locked DLL files (printing messages like &amp;quot;alphabuffergen.dll: Access is denied.&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
If you moved Bakery folders (Assets/Bakery and Assets/Editor/x64/Bakery) to other locations, you might need to move them back before updating to prevent getting two conflicting copies of the package.&lt;br /&gt;
&lt;br /&gt;
= Scripting API =&lt;br /&gt;
&lt;br /&gt;
==Basic usage==&lt;br /&gt;
&lt;br /&gt;
Get and modify render settings:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ftLightmapsStorage storage = ftRenderLightmap.FindRenderSettingsStorage();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Full list of available settings can be seen in ftLightmapsStorage.cs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Get lightmapper instance and (re)load settings:&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap bakery = ftRenderLightmap.instance != null ? ftRenderLightmap.instance : new ftRenderLightmap();&lt;br /&gt;
bakery.LoadRenderSettings();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Render lightmaps (also probes if they're set to L1 or L2 mode):&lt;br /&gt;
&amp;lt;pre&amp;gt;bakery.RenderButton(bool showMsgWindows)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Render light probes only:&lt;br /&gt;
&amp;lt;pre&amp;gt;bakery.RenderLightProbesButton(bool showMsgWindows)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Render reflection probes only:&lt;br /&gt;
&amp;lt;pre&amp;gt;bakery.RenderReflectionProbesButton(bool showMsgWindows)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''showMsgWindows''' tells if any dialog boxes/confirmations can be shown. Supressed, if set to false.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Check if baking is in progress:&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.bakeInProgress&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For usage example check [[Community_extensions#Batch_scene_baker|Batch Scene Baker]] script.&lt;br /&gt;
&lt;br /&gt;
==Additional functions==&lt;br /&gt;
&lt;br /&gt;
Copies all render settings from one ftLightmapsStorage to another:&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmapsStorage.CopySettings(ftLightmapsStorage src, ftLightmapsStorage dest)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Gets global (per-project) storage object:&lt;br /&gt;
&amp;lt;pre&amp;gt;ftGlobalStorage gstorage = ftLightmaps.GetGlobalStorage()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copies all render settings from ftLightmapsStorage (per-scene) to ftGlobalStorage  (per-project):&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmapsStorage.CopySettings(ftLightmapsStorage src, ftGlobalStorage dest)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copies all render settings from ftGlobalStorage (per-project) to ftLightmapsStorage (per-scene):&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmapsStorage.CopySettings(ftGlobalStorage src, ftLightmapsStorage dest)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Gets the path to the folder containing Bakery binaries:&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmaps.GetEditorPath()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Additional variables==&lt;br /&gt;
&lt;br /&gt;
Gets the current temporary files path (ftRenderLightmap instance must be created first):&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.scenePath&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Gets/sets UVGBuffer data compression (LZ4, if enabled, DDS if not):&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.compressedGBuffer&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Gets/sets output lightmap data compression (LZ4, if enabled, DDS if not):&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.compressedOutput&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Events==&lt;br /&gt;
&lt;br /&gt;
Scripts can subscribe to static events in ftRenderLightmap class.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Called before full Render:&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnPreFullRender&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Called before each light probe is rendered in Legacy light probe mode. ProbeEventArgs is a struct containing '''pos''' field with current light probe position:&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler&amp;lt;ProbeEventArgs&amp;gt; OnPreRenderProbe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Called after Legacy light probes were rendered:&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnFinishedProbes&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Called after full Render was finished:&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnFinishedFullRender&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Called before reflection probes are rendered:&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnPreReflectionProbeRender&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Called after reflection probes were rendered:&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnFinishedReflectionProbes&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mr F</name></author>
		
	</entry>
	<entry>
		<id>https://geom.io/bakery/wiki/index.php?title=Bakery_-_GPU_Lightmapper&amp;diff=1862</id>
		<title>Bakery - GPU Lightmapper</title>
		<link rel="alternate" type="text/html" href="https://geom.io/bakery/wiki/index.php?title=Bakery_-_GPU_Lightmapper&amp;diff=1862"/>
		<updated>2026-01-11T16:05:36Z</updated>

		<summary type="html">&lt;p&gt;Mr F: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[What is Bakery and why use it]]&lt;br /&gt;
&lt;br /&gt;
== Bakery for Unity ==&lt;br /&gt;
* [https://assetstore.unity.com/packages/tools/level-design/bakery-gpu-lightmapper-122218 Asset Store page]&lt;br /&gt;
* [[Github access]]&lt;br /&gt;
* '''[[RTPreview|RTPreview manual]]'''&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* '''[[Manual|Manual (v1.98)]]'''&lt;br /&gt;
** &amp;lt;small&amp;gt;Also available in different languages:&amp;lt;/small&amp;gt;&lt;br /&gt;
*** &amp;lt;small&amp;gt;[[Benutzerhandbuch]]&amp;lt;/small&amp;gt;&lt;br /&gt;
*** &amp;lt;small&amp;gt;[[使用手册]]&amp;lt;/small&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
* [https://docs.google.com/document/d/1r-ZFqovUkVXL-1S9ATYqUHL00M5SpiM2Qwjg0eVCJ4Y/edit Changelog]&lt;br /&gt;
* [https://drive.google.com/file/d/1i_zkeB4VBgNOI_-dBqxkdwZ4HCj6tTyA/view?usp=share_link Latest URP graphs (rev 2.0) (12.1.6)]&lt;br /&gt;
* [https://drive.google.com/file/d/1kutq2zwyOGhSw79_rtZNeW5cFOLWzuVr/view?usp=share_link Latest URP graphs (14.0.7)]&lt;br /&gt;
* [https://drive.google.com/file/d/1CIM7_LFaMJ2lxs4eZMZ-KgX8OA7KBt2U/view?usp=sharing Latest URP graphs (15.0.6)]&lt;br /&gt;
* [https://drive.google.com/file/d/1IJIbw2He3c5xa9hdaTVHnqIf5Ewfg0gZ/view?usp=sharing Latest URP graphs (15.0.7)]&lt;br /&gt;
* [https://drive.google.com/file/d/1lmQsDjLnP-HlslQNHffjqj6Bty9iJUzH/view?usp=sharing Latest URP graphs (16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/1mTpG6o9RfjSlq8EBdpQ8kSZVZq3JP4BQ/view?usp=sharing Latest URP graphs (rev 9.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/1fw7OM83pp0jRHqLjpF2WRZYSd1Z1H1Eh/view?usp=sharing Latest URP graphs (rev 12.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/18TU_8MpVdUiSQjCm1JWyg-binr02ZfzZ/view?usp=sharing Latest URP graphs (rev 13.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/15Nga4ld-F0_GzCfkDLrE3Uv1QfIYvIGk/view?usp=sharing Latest URP graphs (rev 14.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/1x6kCNmJzKgOnnQRQx7ol5VSNMq4VwFeU/view?usp=sharing Latest URP graphs (rev 15.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/1RvaSoy4ceOCTQIHs5DvdYlt5gUEkDYG5/view?usp=sharing Latest URP graphs (rev 16.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/1-1_oNZyPptlcUWWjcXzcTv1-b-mPJBsw/view?usp=sharing Latest HDRP graphs (10.4.0)]&lt;br /&gt;
* [https://drive.google.com/file/d/1hYn8FXPf47FsVTgoao0jV0AqxGFN48dH/view?usp=sharing Latest HDRP graphs (11.0.0)]&lt;br /&gt;
* [https://drive.google.com/file/d/1dLlg-GWYbyzvG9jo9srnpnht1S19W6Z2/view Latest HDRP graphs (12.1.6)]&lt;br /&gt;
* [https://drive.google.com/file/d/1RBRS024Dd9ddM-35D1KssOReTrcC8zGn/view?usp=sharing Latest HDRP graphs (14.0.7)]&lt;br /&gt;
* [https://drive.google.com/file/d/1z3jSHNgHALU6r3b6lBXEBvHLlxEmXARZ/view?usp=sharing Latest HDRP graphs (rev 2.0) (14.0.7)]&lt;br /&gt;
* [[FAQ]]&lt;br /&gt;
* [[How do I...]]&lt;br /&gt;
* [[Reporting bugs]]&lt;br /&gt;
* [[Troubleshooting]]&lt;br /&gt;
* [[Community extensions]]&lt;br /&gt;
* [https://discord.gg/dP3SkdM Community Discord]&amp;lt;br&amp;gt;&amp;lt;small&amp;gt;(for support, please contact me on [https://discussions.unity.com/t/bakery-gpu-lightmapper-v1-96-rtpreview-released/704890/7512 Unity forum] / [https://github.com/guycalledfrank/bakery-issues/issues github] / or via email listed [https://assetstore.unity.com/publishers/37453 here]).&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bakery is made by [https://twitter.com/guycalledfrank Mr F]&lt;br /&gt;
&lt;br /&gt;
== Decalery ==&lt;br /&gt;
* '''[[Decalery manual]]'''&lt;br /&gt;
* [[Decalery Github access]]&lt;/div&gt;</summary>
		<author><name>Mr F</name></author>
		
	</entry>
	<entry>
		<id>https://geom.io/bakery/wiki/index.php?title=Bakery_-_GPU_Lightmapper&amp;diff=1861</id>
		<title>Bakery - GPU Lightmapper</title>
		<link rel="alternate" type="text/html" href="https://geom.io/bakery/wiki/index.php?title=Bakery_-_GPU_Lightmapper&amp;diff=1861"/>
		<updated>2026-01-11T16:05:30Z</updated>

		<summary type="html">&lt;p&gt;Mr F: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[What is Bakery and why use it]]&lt;br /&gt;
&lt;br /&gt;
== Bakery for Unity ==&lt;br /&gt;
* [https://assetstore.unity.com/packages/tools/level-design/bakery-gpu-lightmapper-122218 Asset Store page]&lt;br /&gt;
* [[Github access]]&lt;br /&gt;
* '''[[RTPreview|RTPreview manual]]'''&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* '''[[Manual|Manual (v1.98)]]'''&lt;br /&gt;
** &amp;lt;small&amp;gt;Also available in different languages:&amp;lt;/small&amp;gt;&lt;br /&gt;
*** &amp;lt;small&amp;gt;[[Benutzerhandbuch]]&amp;lt;/small&amp;gt;&lt;br /&gt;
*** &amp;lt;small&amp;gt;[[使用手册]]&amp;lt;/small&amp;gt;&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
* [https://docs.google.com/document/d/1r-ZFqovUkVXL-1S9ATYqUHL00M5SpiM2Qwjg0eVCJ4Y/edit Changelog]&lt;br /&gt;
* [https://drive.google.com/file/d/1i_zkeB4VBgNOI_-dBqxkdwZ4HCj6tTyA/view?usp=share_link Latest URP graphs (rev 2.0) (12.1.6)]&lt;br /&gt;
* [https://drive.google.com/file/d/1kutq2zwyOGhSw79_rtZNeW5cFOLWzuVr/view?usp=share_link Latest URP graphs (14.0.7)]&lt;br /&gt;
* [https://drive.google.com/file/d/1CIM7_LFaMJ2lxs4eZMZ-KgX8OA7KBt2U/view?usp=sharing Latest URP graphs (15.0.6)]&lt;br /&gt;
* [https://drive.google.com/file/d/1IJIbw2He3c5xa9hdaTVHnqIf5Ewfg0gZ/view?usp=sharing Latest URP graphs (15.0.7)]&lt;br /&gt;
* [https://drive.google.com/file/d/1lmQsDjLnP-HlslQNHffjqj6Bty9iJUzH/view?usp=sharing Latest URP graphs (16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/1mTpG6o9RfjSlq8EBdpQ8kSZVZq3JP4BQ/view?usp=sharing Latest URP graphs (rev 9.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/1fw7OM83pp0jRHqLjpF2WRZYSd1Z1H1Eh/view?usp=sharing Latest URP graphs (rev 12.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/18TU_8MpVdUiSQjCm1JWyg-binr02ZfzZ/view?usp=sharing Latest URP graphs (rev 13.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/15Nga4ld-F0_GzCfkDLrE3Uv1QfIYvIGk/view?usp=sharing Latest URP graphs (rev 14.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/1x6kCNmJzKgOnnQRQx7ol5VSNMq4VwFeU/view?usp=sharing Latest URP graphs (rev 15.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/1RvaSoy4ceOCTQIHs5DvdYlt5gUEkDYG5/view?usp=sharing Latest URP graphs (rev 16.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/1-1_oNZyPptlcUWWjcXzcTv1-b-mPJBsw/view?usp=sharing Latest HDRP graphs (10.4.0)]&lt;br /&gt;
* [https://drive.google.com/file/d/1hYn8FXPf47FsVTgoao0jV0AqxGFN48dH/view?usp=sharing Latest HDRP graphs (11.0.0)]&lt;br /&gt;
* [https://drive.google.com/file/d/1dLlg-GWYbyzvG9jo9srnpnht1S19W6Z2/view Latest HDRP graphs (12.1.6)]&lt;br /&gt;
* [https://drive.google.com/file/d/1RBRS024Dd9ddM-35D1KssOReTrcC8zGn/view?usp=sharing Latest HDRP graphs (14.0.7)]&lt;br /&gt;
* [https://drive.google.com/file/d/1z3jSHNgHALU6r3b6lBXEBvHLlxEmXARZ/view?usp=sharing Latest HDRP graphs (rev 2.0) (14.0.7)]&lt;br /&gt;
* [[FAQ]]&lt;br /&gt;
* [[How do I...]]&lt;br /&gt;
* [[Reporting bugs]]&lt;br /&gt;
* [[Troubleshooting]]&lt;br /&gt;
* [[Community extensions]]&lt;br /&gt;
* [https://discord.gg/dP3SkdM Community Discord]&amp;lt;br&amp;gt;&amp;lt;small&amp;gt;(for support, please contact me on [https://discussions.unity.com/t/bakery-gpu-lightmapper-v1-96-rtpreview-released/704890/7512 Unity forum] / [https://github.com/guycalledfrank/bakery-issues/issues github] / or via email listed [https://assetstore.unity.com/publishers/37453 here]).&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bakery is made by [https://twitter.com/guycalledfrank Mr F]&lt;br /&gt;
&lt;br /&gt;
== Decalery ==&lt;br /&gt;
* '''[[Decalery manual]]'''&lt;br /&gt;
* [[Decalery Github access]]&lt;/div&gt;</summary>
		<author><name>Mr F</name></author>
		
	</entry>
	<entry>
		<id>https://geom.io/bakery/wiki/index.php?title=Troubleshooting&amp;diff=1860</id>
		<title>Troubleshooting</title>
		<link rel="alternate" type="text/html" href="https://geom.io/bakery/wiki/index.php?title=Troubleshooting&amp;diff=1860"/>
		<updated>2026-01-07T13:00:35Z</updated>

		<summary type="html">&lt;p&gt;Mr F: /* Error message &amp;quot;Failed to load OptiX library&amp;quot; */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a list of common problems, their symptoms and solutions.&lt;br /&gt;
&lt;br /&gt;
=== Shadowmasks are not baked ===&lt;br /&gt;
Check following things:&lt;br /&gt;
* Bakery's [[Manual#Render Mode|Render Mode]] is set to Shadowmask.&lt;br /&gt;
* Masked lights have both Unity and Bakery light components on them.&lt;br /&gt;
* Masked Bakery light components have &amp;quot;Baked contribution&amp;quot; set to &amp;quot;Indirect and shadowmask&amp;quot;.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Shadowmasks are baked, but Unity renders real-time shadows instead ===&lt;br /&gt;
You're in Distance Shadowmask mode, it's expected. Read more about the difference:&lt;br /&gt;
&lt;br /&gt;
https://docs.unity3d.com/Manual/LightMode-Mixed-Shadowmask.html&lt;br /&gt;
&lt;br /&gt;
https://docs.unity3d.com/Manual/LightMode-Mixed-DistanceShadowmask.html&lt;br /&gt;
&lt;br /&gt;
* To switch between two modes, you can use &amp;quot;Distance Shadowmask&amp;quot; checkbox in Bakery main window.&lt;br /&gt;
* If you're on 5.6, go to Window-&amp;gt;Lighting-&amp;gt;Mixed Lighting-&amp;gt;Lighting Mode to switch the mode.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I can't see specular lighting after the bake ===&lt;br /&gt;
Apparently specular lighting was provided by real-time lights before the bake. Now the lighting is baked into static textures and there is no specular. However, you can:&lt;br /&gt;
* Use Reflection Probes. Good option for highly glossy objects.&lt;br /&gt;
* Use mixed lights and only bake GI/[[Manual#Shadowmask|Shadowmasks]]. Specular remains real-time.&lt;br /&gt;
* Bake in [[Manual#Dominant_Direction|Dominant Direction]] or [[Manual#SH|SH]] mode and use [[Manual#Bakery_shaders|Bakery shaders]] with &amp;quot;Lightmapped specular&amp;quot; option. It will give some specular approximation. Looks good on surfaces with medium/high roughness.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Using a version control system I copied the scene to another PC and it doesn't look right ===&lt;br /&gt;
Make sure you followed [[How_do_I...#How_do_I_use_git.2Fcollab.2Fother_version_control_system_with_Bakery.3F|version control guidelines]].&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Baking same asset in one scene breaks its UVs in another scene ===&lt;br /&gt;
The reason here is [[Manual#Asset_UV_Processing|UV padding adjustment]]. It modifies the UVs in the asset, so spacing between UV charts is optimal, meaning they never leak over each other and there is no much wasted space. Unity has a manual Pack Margin option on model assets, but it’s limited since it applies the same exact value for all meshes inside the model, while each mesh can get drastically different size in the final lightmap based on its surface area. Therefore Bakery overrides it with automatically calculated per-mesh (instead of per-model) padding. However, because “optimal” varies depending on baking resolution, it can be problematic to reuse the same asset in isolated scenes with different lightmap size. There are multiple ways to solve it:&lt;br /&gt;
* a) Just disable UV padding adjustment (set to [[Manual#Asset_UV_Processing|Don't Change]]). Results will be similar to built-in baking.&lt;br /&gt;
* b) Generate your own optimal UVs. UV padding adjustment only applies to models with auto-generated UV layout (aka “Generate Lightmap UVs” checkbox) and never touches custom data.&lt;br /&gt;
* c) Set Asset UV Processing to &amp;quot;Adjust UV padding only for new meshes&amp;quot; (currently available in the [[Github_access|github]] version).&lt;br /&gt;
* d) Use [[Manual#UV_padding:_increase_only|UV padding: increase only]] checkbox and first bake the lowest resolution scene, and then the rest.&lt;br /&gt;
* e) Use two different models for different lightmap resolutions, so each will get the most efficient set of UVs.&lt;br /&gt;
* f) Bake both scenes together.&lt;br /&gt;
* g) Lock UVs using [[How_do_I...#Alternative_solution|Save UV padding to asset]]&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser throws error 505 or Unknown error ===&lt;br /&gt;
[https://www.nvidia.com/Download/index.aspx?lang=en-US Update the driver].&lt;br /&gt;
&lt;br /&gt;
If you are using a Kepler GPU, try switching to [[Manual#Legacy_denoiser|legacy denoiser]].&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get an “Out of memory” error ===&lt;br /&gt;
This means rendering needed more video memory from your GPU than it has available.&lt;br /&gt;
&lt;br /&gt;
First, try closing any other graphics-intensive programs (browsers too).&lt;br /&gt;
&lt;br /&gt;
If the problem persists, the most likely reason is that the resolution you selected is unreasonably high for the given scene. Resolution is defined by [[Manual#Texels_per_unit|Texels per Unit]] (this section also has a list of reference values) or set explicitly in [[Manual#Bakery_Lightmap_Group_Selector|Lightmap Groups]]. Reducing it will help. You can always selectively use high resolution for important objects via [https://docs.unity3d.com/Manual/class-MeshRenderer.html Scale in Lightmap].&lt;br /&gt;
&lt;br /&gt;
If you have terrains in your scene, make sure [[Manual#Terrain_optimization|Terrain optimization]] is enabled.&lt;br /&gt;
&lt;br /&gt;
If you have a very high amount of painted trees on your terrain, try disabling the [[Manual#Export_terrain_trees|Export terrain trees]] option.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a “Can't map texture” error ===&lt;br /&gt;
Typically happens if your system went out of RAM (system memory, not video memory) during the scene export process. Your scene could already be taking too much RAM by itself, not leaving enough free memory for Bakery export.&lt;br /&gt;
&lt;br /&gt;
* Try closing any memory-intensive programs before baking.&lt;br /&gt;
* Try reducing [[Manual#Max_resolution|Max Resolution]] from 4096 to 2048.&lt;br /&gt;
* If you are baking very highly detailed (millions of triangles) geometry, try excluding some of it from the bake.&lt;br /&gt;
* Try disabling [[Manual#Export_terrain_trees|Export terrain trees]].&lt;br /&gt;
* Try enabling [[Manual#Terrain_optimization|Terrain optimization]].&lt;br /&gt;
&lt;br /&gt;
This error can also be shown in case of GPU driver crash, in which case Unity editor also won't render anything.&lt;br /&gt;
&lt;br /&gt;
If this error happens at the end of the render process (from the seamfixer app), try increasing the [[Troubleshooting#I_get_a_.22Launch_timeout.22_error|TDR]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a “Can't create texture” or &amp;quot;Can't create rasterizer state&amp;quot; error ===&lt;br /&gt;
Typically errors like this are caused by such chain of events:&lt;br /&gt;
* Some objects in the scene have incorrect lightmapping UVs. Often the UVs contain many large triangles overlapping each other.&lt;br /&gt;
* Scene uses large lightmaps.&lt;br /&gt;
* Bakery tries to rasterize a huge amount of 4k-sized overlapping triangles to prepare the UV GBuffer.&lt;br /&gt;
* This operation takes &amp;gt; 2 seconds, and the driver is reset by Windows due to TDR: https://docs.microsoft.com/en-us/windows-hardware/drivers/display/timeout-detection-and-recovery&lt;br /&gt;
* Consequent GPU operations are failed due to reset.&lt;br /&gt;
&lt;br /&gt;
Solution:&lt;br /&gt;
* Make sure all your objects either have non-overlapping UV2 or enable &amp;quot;Generate lightmapping UVs&amp;quot; on all model assets.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== After importing Bakery I get errors containing “obsolete” and “UnityUpgradable” ===&lt;br /&gt;
Before importing Bakery, make sure you don't have any compilation errors in your project.&lt;br /&gt;
&lt;br /&gt;
Restart Unity, reimport the package. Click “I made a backup, go ahead” if Unity asks.&lt;br /&gt;
&lt;br /&gt;
See [https://docs.unity3d.com/Manual/APIUpdater.html this page] for more details.&lt;br /&gt;
&lt;br /&gt;
It is also known that some versions of Unity Hub have a [https://forum.unity.com/threads/bakery-gpu-lightmapper-v1-6-released.536008/page-63#post-4668227 bug] preventing API updater from running.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a &amp;quot;Can't load&amp;quot; error ===&lt;br /&gt;
If Bakery says it can't load something, make sure you have enough free disk space on the drive used for [[Manual#Temp_path|temporary data]].&lt;br /&gt;
&lt;br /&gt;
Some parts of Bakery can't deal with non-ASCII characters (this is going to be fixed soon). Try naming your scenes and lightmap group assets with ASCII characters. Latin letters and numbers must always work.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a &amp;quot;Launch timeout&amp;quot; error ===&lt;br /&gt;
This error can happen if your GPU took more time than it is allowed by [https://docs.microsoft.com/en-us/windows-hardware/drivers/display/timeout-detection-and-recovery Windows TDR].&lt;br /&gt;
* Try disabling [[Manual#Terrain_optimization|Terrain Optimization]].&lt;br /&gt;
* Try lowering the value of [[Manual#Tile_size|Tile Size]], especially if it's higher than 512, so baking job is split into smaller chunks.&lt;br /&gt;
* Depending on the pass being processed, try lowering the Samples value (e.g. [[Manual#Samples|GI samples]], [[Manual#Bakery_Sky_Light|Skylight samples]], etc).&lt;br /&gt;
* Reduce geometric complexity of the scene, if tile size/samples don't help.&lt;br /&gt;
* As a last resort, [https://docs.microsoft.com/en-us/windows-hardware/drivers/display/tdr-registry-keys disable TDR registry keys]. This will prevent Windows from resetting the driver, but your computer may appear unresponsive during the bake.&lt;br /&gt;
&lt;br /&gt;
[https://substance3d.adobe.com/documentation/spdoc/gpu-drivers-crash-with-long-computations-tdr-crash-128745489.html Additional instructions for changing the timeout (from Substance)]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I have an Android project, and lightmaps don't look good ===&lt;br /&gt;
[[File:Banding.jpg|Android banding artifacts|thumb]]&lt;br /&gt;
[[File:LightmapsTechnicalDetails.png|Lightmap encoding in player settings|thumb]]&lt;br /&gt;
[[File:Astc.jpg|Build texture compression settings|thumb]]&lt;br /&gt;
Sometimes, when working on Android projects, you may encounter banding artifacts, with gradients having discrete steps of different hue.&lt;br /&gt;
This is caused by texture compression and HDR encoding Unity uses for this platform, which often turns out to be &amp;quot;Double LDR&amp;quot; ([https://docs.unity3d.com/Manual/Lightmaps-TechnicalInformation.html see details]). The problem is not exclusive to Bakery and will as well happen with built-in lightmaps.&lt;br /&gt;
&lt;br /&gt;
In Player Settings, set Lightmap Encoding to '''High Quality'''.&lt;br /&gt;
&lt;br /&gt;
If your target devices support ASTC compression, make sure it is enabled in Build settings. PVRTC is also a good choice, although it is mostly supported on iOS devices. ETC compression gives poor results for lightmaps.&lt;br /&gt;
&lt;br /&gt;
If above solutions are not enough, select lightmap assets and set texture compression quality to '''High''' or '''None''' (try both).&lt;br /&gt;
&lt;br /&gt;
Note that setting it to None will use more video memory on the device.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I have a scene baked with MonoSH, and lighting looks pixelated ===&lt;br /&gt;
[[File:Normalq.jpg|MonoSH compressed with low quality encoding|thumb]]&lt;br /&gt;
In some scenes, [[Manual#MonoSH|MonoSH]] lightmaps can look pixelated, if low (or &amp;quot;normal&amp;quot;) quality compression is used (e.g. DXT1). Usually setting Compression = High on the L1 texture fixes the issue.&lt;br /&gt;
&lt;br /&gt;
You can enable all L1 textures to always use High quality compression by toggling Project Settings -&amp;gt; Bakery -&amp;gt; '''High quality direction'''.&lt;br /&gt;
&lt;br /&gt;
Note that depending on the platform, High quality compression can take more memory. On PC it usually doubles by going from DXT1 to BC7 format.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== There are weird square artifacts on my geometry ===&lt;br /&gt;
[[File:Smoothnormals flatshape.jpg|Square artifacts from incorrect normals|thumb]]&lt;br /&gt;
Weird squares may sometimes be seen on models when their shape is too different from their normals. Bakery [https://ndotl.wordpress.com/#shadowterm tries to compensate] starting ray points to take fake normal smoothness into account, but in extreme cases the algorithm can't handle the discrepancy.&lt;br /&gt;
Usually it's enough to just recalculate normals on the model. E.g. in Unity you can select the FBX and change &amp;quot;Normals&amp;quot; to &amp;quot;Calculate&amp;quot; instead of &amp;quot;Import&amp;quot;.&lt;br /&gt;
Alternatively, you can disable the related compensation algorithm, but it’s actually beneficial in most cases. You can toggle it in Project Settings → Bakery → Generate smooth positions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get too many lightmaps ===&lt;br /&gt;
Possible causes are:&lt;br /&gt;
&lt;br /&gt;
* [[Manual#Atlas_Packer|Atlas packer]] is set to ''Default'' or ''Post-packing'' is disabled. Set Atlas Packer to ''xatlas'' and enable Post-packing for best results.&lt;br /&gt;
&lt;br /&gt;
* ''Texels Per Unit'' value is high or ''Max Resolution'' is low. Bakery packs objects from open scenes into multiple lightmap atlases and packs them as rectangles (in a fashion similar to [https://blackpawn.com/texts/lightmaps/default.html this]; unless Hole Filling is enabled) with their size dependent on (surface area * texels per unit). If some object can't fit into existing atlases, a new one is allocated. New atlases are always as large as the Max Resolution parameter, or smaller (but not smaller than ''Min Resolution''), if the estimated surface area of remaining unpacked objects is below some threshold. You can also increase Min Resolution a bit, replacing a bunch of small (but dense) maps with a few large (but possibly with some empty space).&lt;br /&gt;
&lt;br /&gt;
Additionally, increase ''Min Resolution'' to prefer larger combined lightmaps instead of many smaller ones.&lt;br /&gt;
&lt;br /&gt;
If not using post-packing:&lt;br /&gt;
&lt;br /&gt;
* If you bake multiple open scenes and ''Split by scene'' checkbox is on, different scenes will never share the same lightmap, therefore multiplying their count.&lt;br /&gt;
* If ''Terrain optimization'' is on, terrains will always use a separate lightmap.&lt;br /&gt;
Pre-atlasing your scene in your modelling package of choice and using the [https://geom.io/bakery/wiki/index.php?title=Manual#Bakery_Lightmap_Group_Selector Original UV] mode instead of relying on the auto-atlaser can significantly improve packing effectiveness.&lt;br /&gt;
&lt;br /&gt;
Since v1.71 Bakery prints number of future used lightmaps to console when enabling/refreshing Checker Preview. You can experiment with resolution/density settings until the desired value is printed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get jagged shadows ===&lt;br /&gt;
[[File:Softshadows.png|Jagged shadow mitigation|thumb]]&lt;br /&gt;
Apparently you are baking very sharp shadows at low resolution. Try increasing shadow spread parameter on the light ([[Manual#Bakery_Direct_Light|direct]] or [[Manual#Bakery_Point_Light|point]]) and optionally enable [[Manual#Shader_Tweaks|bicubic interpolation]].&lt;br /&gt;
On a [[Manual#Bakery_Direct_Light|Direct Light]] you can also enable the '''Anti-Alias''' option.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Exporting scene - preparing&amp;quot; is taking too long ===&lt;br /&gt;
(Or &amp;quot;Exporting scene - atlasing&amp;quot;)&lt;br /&gt;
* Try setting [[Manual#Atlas_Packer|Atlas Packer]] to Default.&lt;br /&gt;
* Make sure you use reasonable [[Manual#Texels_per_unit|Texels Per Unit]] value.&lt;br /&gt;
* Make sure your meshes are [[Manual#Quickstart|correctly unwrapped]].&lt;br /&gt;
* Possibly disable [[Manual#Asset_UV_Processing|UV Padding Adjustment]].&lt;br /&gt;
&lt;br /&gt;
If you're converting a large existing scene, make sure to follow [[How_do_I...#How_do_I_quickly_port_my_existing_scene_to_Bakery.3F|this guide]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Stuck at &amp;quot;Waiting for Unity to initialize the probes...&amp;quot; ===&lt;br /&gt;
There isn't much Bakery can do about the logic of Unity lighting data asset generation (there is no API in the engine to control it at the moment). Try to focus editor window (especially scene view) to wake Unity up.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Baked prefabs instantiated at runtime in a build have no lightmaps ===&lt;br /&gt;
Because Unity technically has no support for prefabs having lightmaps, it can omit lightmapped shader versions from builds, not realizing they are needed. You can fix it by going to [https://docs.unity3d.com/Manual/class-GraphicsSettings.html?_ga=2.212464724.1917527976.1586930444-1257434621.1522062178#stripping Shader stripping settings] and enabling lightmap modes you use.&lt;br /&gt;
Additionally, try disabling '''Optimize Mesh Data''' in Player Settings, as Unity may omit UV from the build.&lt;br /&gt;
&lt;br /&gt;
{{note|In Shader Stripping settings &amp;quot;Directional&amp;quot; mode only applies to standard Unity directional maps aka [[Manual#Dominant_Direction|Dominant Direction]]. When using Baked Normal Maps, RNM or SH, use &amp;quot;Non-directional&amp;quot; lightmap mode checkboxes.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Speedtrees look fine in the editor, but black in builds ===&lt;br /&gt;
Also related to shader stripping. See the [[Troubleshooting#Baked_prefabs_instantiated_at_runtime_in_a_build_have_no_lightmaps|prefab solution]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Scene is black in build ===&lt;br /&gt;
See advice above. Additionally, if the scene is loaded asynchronously, call ftLightmaps.RefreshFull() when it is fully loaded.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== HDRI produces scattered bright spots (fireflies) ===&lt;br /&gt;
[[File:Fireflies.jpg|thumb|Typical &amp;quot;fireflies&amp;quot;]]&lt;br /&gt;
[[File:Upload 2019-7-3 11-27-22.png|thumb|Removing sun from HDRI]]&lt;br /&gt;
This artefact comes from the fact your HDRI has very bright, yet very small parts, typically sun. Rays will miss it often, producing occasional spots when they don't. This problem is well known in many offline ray tracers as well.&lt;br /&gt;
* Use [[Manual#Bakery_Direct_Light|Direct Light]] for the sun&lt;br /&gt;
* Remove sun from HDRI (also [https://seblagarde.wordpress.com/2016/08/28/siggraph-2016-an-artist-friendly-workflow-for-panoramic-hdri/ recommended by Unity])&lt;br /&gt;
* Possibly downsample/blur the HDRI&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Small emissive (or brightly lit) surfaces produce noise ===&lt;br /&gt;
The issue is similar to the one above and may happen when using very small and very bright emissive surfaces, or small non-emissive surfaces lit by a very intense light. In case of emissive surfaces, you can replace them with [[Manual#Bakery_Light_Mesh|Light Meshes]] to prevent it. See [[Manual#Differences_between_Light_Mesh_and_emissive_materials|Differences between Light Mesh and emissive materials]]. Alternatively, try increasing [[Manual#Samples|GI sample count]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Adjusting UV padding&amp;quot; happens too often and takes too much time ===&lt;br /&gt;
[[Manual#Asset_UV_Processing|UV padding adjustment]] is a feature that optimizes asset UVs based on the size they take in lightmaps. This process will happen for a model if:&lt;br /&gt;
* Option is globally enabled.&lt;br /&gt;
* Asset has &amp;quot;Generate Lightmap UVs&amp;quot; checkbox enabled. Models with custom UVs are not adjusted.&lt;br /&gt;
* Model was not adjusted before or...&lt;br /&gt;
* ... its lightmap size has changed.&lt;br /&gt;
Therefore it can be triggered for all auto-unwrapped models after their geometry or resolution changes.&lt;br /&gt;
UV padding adjustment will try to waste less lightmap resolution and reduce texel leaking, but it is not necessary. If you are doing many experimental/draft bakes, you may consider disabling it (set to &amp;quot;Don't change&amp;quot;), then possibly enabling it back for the final quality bake.&lt;br /&gt;
&lt;br /&gt;
Also note that using xatlas as [[Manual#Unwrapper|Unwrapper]] can be notoriously slower comparing to Default.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser produces bright edges around geometry/shadows ===&lt;br /&gt;
[[File:Bredges.jpg|thumb|Bright edges]]&lt;br /&gt;
Sometimes you may encounter bright edges or spots at high contrast edges caused by the denoising neural net, most notably OptiX 6 and 7.&lt;br /&gt;
* Use OptiX 5 or OpenImageDenoise if you can ([[Manual#Denoiser|denoiser]] option).&lt;br /&gt;
* Try enabling [[Manual#Denoise:_fix_bright_edges|Denoise: Fix bright edges]].&lt;br /&gt;
* Try setting texture compression to None on lightmap assets.&lt;br /&gt;
* Try setting [[Manual#Backface_GI|Backface GI]] to 1, removing dark shadows inside objects. While these shadows are normally not visible, their edges may cause problems for both the denoiser and texture compression.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Light probes are too bright in Subtractive mode ===&lt;br /&gt;
&lt;br /&gt;
[[File:98911466-ae8c5b00-24d5-11eb-8d51-4e764ac0f163.png|thumb|The effect of occlusion probes]]&lt;br /&gt;
&lt;br /&gt;
Light occlusion information is not baked into probes. Solution:&lt;br /&gt;
* Set your Unity directional light to Mixed mode.&lt;br /&gt;
* Enable [[Manual#Occlusion_probes|Occlusion Probes]].&lt;br /&gt;
* Bake&lt;br /&gt;
&lt;br /&gt;
Some versions of Unity may need a scene reload to properly apply the Lighting Data Asset.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Baking produces &amp;quot;Not allowed to access uv2&amp;quot; errors ===&lt;br /&gt;
All lightmapped models must have [https://docs.unity3d.com/Manual/FBXImporter-Model.html Read/Write enabled] on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Whole scene is very bright or black ===&lt;br /&gt;
* Check if your light intensities are in a reasonable range (&amp;lt; 100; or &amp;lt;= 100000 Lux in HDRP).&lt;br /&gt;
* Check the same for indirect intensity on all lights. A multiplication of direct and intensity intensity must not go into thousands, otherwise GI algorithm may overflow.&lt;br /&gt;
* Check if you don't use assets with High mesh compression. When set to High, Unity mesh compression will completely destroy lightmap UVs, only leaving 8 bits for them. This may produce many lightmapping errors including this one.&lt;br /&gt;
* Check if you have any .hdr overrides in the Preset Manager that change the way lightmaps are imported.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery says &amp;quot;Device is not DX11&amp;quot; ===&lt;br /&gt;
Currently Bakery needs Unity editor to be running in DX11 mode to directly exchange texture data, so make sure your editor's window header says &amp;quot;&amp;lt;DX11&amp;gt;&amp;quot;. If it does not, change active graphics API to DX11: &lt;br /&gt;
* Go to Player Settings.&lt;br /&gt;
* If &amp;quot;Auto Graphics API for Windows&amp;quot; is unchecked, you will see a list of APIs.&lt;br /&gt;
* Make sure &amp;quot;Direct3D11&amp;quot; is on top or place it there.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery doesn't work on my 3070/3080/3090 GPU? ===&lt;br /&gt;
1. Please enable [[Manual#RTX_Mode|RTX mode]].&lt;br /&gt;
&lt;br /&gt;
2. If denoiser also fails, please update from [[Github_access|github]] and use OpenImageDenoise option (some instructions are [[Troubleshooting#Denoiser_produces_bright_edges_around_geometry.2Fshadows|here]]).&lt;br /&gt;
&lt;br /&gt;
Updated denoiser (both new OptiX version and OpenImageDenoise) as well as automatic hardware detection will be soon released on the Asset Store.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser produces grid-like patterns ===&lt;br /&gt;
[[File:Gridlike.jpg|thumb|Grid-like denoiser pattern]]&lt;br /&gt;
&lt;br /&gt;
OptiX denoiser might produdce grid-like patterns when fed with very low-precision lightmaps. Low precision is usually caused by either extremely dark or extremely bright lighting. It is recommended to stay within reasonable intensity range (see a similar advice for [[Troubleshooting#Lightmaps_look_black_or_have_bad_quality_in_an_HDRP_scene|HDRP]] above).&lt;br /&gt;
&lt;br /&gt;
* Alternatively use OpenImageDenoise, as it does not produce this pattern.&lt;br /&gt;
&lt;br /&gt;
* This issue also does not affect OptiX 5.1 denoiser (&amp;quot;Legacy denoiser&amp;quot;) as its training dataset is in its own DLL, but affects the non-legacy version (OptiX 6.0) and only on driver versions newer than 442.50, as the training datasets are in the driver ([https://forums.developer.nvidia.com/t/optix7-denoiser-different-results-with-different-version-of-drivers/117989/2 explanation from NVIDIA]).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get &amp;quot;rtcRes == RTC_SUCCESS&amp;quot; error ===&lt;br /&gt;
&lt;br /&gt;
You are using a 3xxx+ GPU with RTX mode disabled. Enable [[Manual#RTX_Mode|RTX mode]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Baking any scene crashes with unknown error ===&lt;br /&gt;
&lt;br /&gt;
There were [https://twitter.com/HarryAlisavakis/status/1331630028665348096 some reports] that Avast antivirus can block Bakery from running, even though Bakery's executables don't trigger any antivirus (including Avast) when [https://twitter.com/guycalledfrank/status/1331640614077796354 scanned via VirusTotal]. Perhaps it just block any executables that were launched 'indirectly', i.e. from another application. In any case, if you have Avast, try adding your project folder to exception list.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Combined meshes (e.g. using Mesh Combine asset) bake incorrectly ===&lt;br /&gt;
&lt;br /&gt;
[[File:Meshcombine.jpg|thumb|Mesh Combine &amp;quot;Regenerate Lightmap UVs&amp;quot; option]]&lt;br /&gt;
&lt;br /&gt;
Most mesh combining assets have an option to regenerate lightmap UVs. Without it, combined UVs will overlap each other. If you are using Mesh Combine, make sure &amp;quot;Regenerate Lightmap UVs&amp;quot; option is enabled in output settings.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a &amp;quot;Can't create vertex buffer&amp;quot; error ===&lt;br /&gt;
&lt;br /&gt;
This error can happen if the scene has more than ~40 million vertices. It is recommended to reduce geometric complexity of the scene, as tracing it would be too slow anyway. The typical cause of going over this limit is trying to bake with large arrays of trees painted on the terrain. In this case try disabling [[Manual#Export_terrain_trees|Export Terrain Trees]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Soft shadows appear like multiple hard shadows ===&lt;br /&gt;
&lt;br /&gt;
[[File:Unknown.png|thumb|Undersampled shadow]]&lt;br /&gt;
&lt;br /&gt;
Increase ''Shadow Samples'' on the light or decrease the ''Shadow Spread''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Lightmaps are black on GTX 650 ===&lt;br /&gt;
&lt;br /&gt;
Apparently newer Nvidia drivers deprecate some CUDA functions on older hardware. It is recommended to use driver version 442 on GTX 650, as it still supported everything Bakery uses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Lightmaps disappear on play ===&lt;br /&gt;
&lt;br /&gt;
* Make sure that '''Project Settings''' -&amp;gt; '''Editor''' -&amp;gt; '''Enter Play Mode Settings''' -&amp;gt; '''Reload Scene''' is turned '''on'''.&lt;br /&gt;
* If that doesn't help, try applying the latest [[Github_access|patch]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a DllNotFoundException ===&lt;br /&gt;
&lt;br /&gt;
* Check if the DLL file mentioned in the error actually exists in your project. If it doesn't, your Bakery installation is incomplete or corrupted; please reinstall it.&lt;br /&gt;
* Check if you're running 64-bit Unity Editor under 64-bit Windows (7 or newer) (as listed in [[Manual#System_requirements|system requirements]]).&lt;br /&gt;
* Make sure you have 64-bit [https://www.microsoft.com/en-us/download/details.aspx?id=48145 Visual C++ Redistributables for Visual Studio 2015] installed. In case if the Microsoft site download is broken, here is a [https://drive.google.com/file/d/1WfRP1A43bCwZflZ_I0wHSGPyC3b-0lqK/view?usp=sharing reupload].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Lightmap UVs are wrong when opening previously baked project on a Mac ===&lt;br /&gt;
&lt;br /&gt;
When Unity reimports model assets, it performs UV unwrapping. If you baked the scene with [[Manual#Unwrapper|Unwrapper]] was set to xatlas, it won't work on a Mac because Bakery's xatlas wrapper library is only compiled for Windows. Rebaking with Default unwrapper should fix it.&lt;br /&gt;
&lt;br /&gt;
You can still keep xatlas as the [[Manual#Atlas_Packer|Atlas Packer]].&lt;br /&gt;
&lt;br /&gt;
''Unwrapper'' is used to generate UVs for individual, isolated meshes, while ''Atlas Packer'' packs big scene-specific atlases out of many unwrapped layouts.&lt;br /&gt;
&lt;br /&gt;
Combining Default unwrapper with xatlas being used as the Atlas Packer and enabling [[Manual#Hole_filling|Hole Filling]] should give pretty good [https://x.com/guycalledfrank/status/1231890428313600000 results] and compensate for any individual mesh unwrapping inefficiencies.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Error message &amp;quot;Failed to load OptiX library&amp;quot; ===&lt;br /&gt;
&lt;br /&gt;
Nvidia driver 590 (and newer) removed support for OptiX 6.0 which Bakery depended on. Bakery v1.98 added support for the new driver, now using OptiX 9.0.&lt;br /&gt;
* Make sure you're using a [[Manual#System_requirements|supported Nvidia GPU]].&lt;br /&gt;
* Update Bakery to v1.98 via the [https://assetstore.unity.com/packages/tools/level-design/bakery-gpu-lightmapper-122218 Asset Store], [[Github_access|github or the built-in patcher]].&lt;br /&gt;
* If you still get the error every time, click Bakery -&amp;gt; Utilities -&amp;gt; Detect Optimal Settings and choose &amp;quot;Set recommended as default&amp;quot;.&lt;br /&gt;
* If you don't want to update Bakery, roll back your GPU driver to any pre-590 version (e.g. [https://www.nvidia.com/en-eu/geforce/drivers/results/257569/ 581.80]).&lt;/div&gt;</summary>
		<author><name>Mr F</name></author>
		
	</entry>
	<entry>
		<id>https://geom.io/bakery/wiki/index.php?title=Benutzerhandbuch&amp;diff=1859</id>
		<title>Benutzerhandbuch</title>
		<link rel="alternate" type="text/html" href="https://geom.io/bakery/wiki/index.php?title=Benutzerhandbuch&amp;diff=1859"/>
		<updated>2026-01-03T22:42:47Z</updated>

		<summary type="html">&lt;p&gt;Mr F: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&amp;lt;!-- This box simply informs German users that a) this Manual was translated from English into German, b) it may be outdated due to frequent updates, c) users should read the original English version for a more up-to-date edition. --&amp;gt;&lt;br /&gt;
{{note| Dieses Benutzerhandbuch wurde aus dem Englischen ins Deutsche übersetzt. Es kann unter Umständen veraltete Informationen enthalten, da Bakery stetig weiterentwickelt wird. Für eine aktuellere Version, lesen Sie bitte die [[Manual|englische Originalfassung]].}}&lt;br /&gt;
(Translation by Mauri)&lt;br /&gt;
&lt;br /&gt;
== Systemanforderungen ==&lt;br /&gt;
Um Bakery nutzen zu können, benötigen Sie:&lt;br /&gt;
* einen PC mit Windows (7 oder höher).&lt;br /&gt;
* eine NVIDIA GPU. Minimal unterstütztes Modell ist Kepler (GeForce 650 oder neuer; Für Quadro-Karten überprüfen Sie bitte die jeweiligen Spezifikationen).&lt;br /&gt;
* einen 64-bit Unity Editor. Bakery wurde auf allen Versionen - von 5.6 bis 6000.X und höher - getestet.&lt;br /&gt;
&lt;br /&gt;
{{note| Die Systemanforderungen gelten nur für die Entwicklerumgebung, nicht für die anvisierte(n) Zielplattform(en). Mit Bakery gebackene Lightmaps können überall verwendet werden.}}&lt;br /&gt;
&lt;br /&gt;
== Bevor Sie beginnen... ==&lt;br /&gt;
* ... stellen Sie bitte sicher, dass Ihr Unity Projekt keine Skriptkompilierungsfehler enthält, da diese auch die Kompilierung von Bakery-Skripten verhindern.&lt;br /&gt;
* ... stellen Sie außerdem sicher, dass Sie den aktuellsten Grafiktreiber für Ihre Karte installiert haben. [https://www.nvidia.com/Download/index.aspx?lang=en-US Aktualisieren Sie Ihren Grafiktreiber], falls nötig.&lt;br /&gt;
&lt;br /&gt;
'''Wichtig: Verwenden Sie den GeForce Game Ready-Treiber (Standard) anstelle des NVIDIA Studio-Treibers.'''&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
1. Importieren Sie Bakery über den [https://assetstore.unity.com/packages/tools/level-design/bakery-gpu-lightmapper-122218 Asset Store] in Ihr Projekt.&lt;br /&gt;
&lt;br /&gt;
2. Unity wird Ihnen eine Liste an Dateien, die zu importieren sind, anzeigen. Wenn Sie Bakery zum ersten Mal verwenden, empfehlen wir Ihnen den einfachen Klick auf '''Import'''. Erfahrene Benutzer möchten zuvor möglicherweise noch den Ordner ''examples'' exkludieren, um eine schlankere Installation zu erhalten.&lt;br /&gt;
&lt;br /&gt;
Die Dateien werden in die Ordner Assets/Bakery und Assets/Editor/x64/Bakery kopiert. Beide Ordner können später verschoben werden.&lt;br /&gt;
&lt;br /&gt;
3. Unity importiert nun Bakery und kompiliert die Skripte. Es wird eventuell folgendes Fenster angezeigt:&lt;br /&gt;
&lt;br /&gt;
[[File:Goahead.png]]&lt;br /&gt;
&lt;br /&gt;
In diesem Fall können Sie einfach auf &amp;quot;Go Ahead&amp;quot; klicken.&lt;br /&gt;
&lt;br /&gt;
Sie sollten jetzt den Menüeintrag von Bakery am oberen Bildschirmrand sehen:&lt;br /&gt;
&lt;br /&gt;
[[File:bmenu.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Schnellstart ==&lt;br /&gt;
&lt;br /&gt;
1. Platzieren Sie ein beliebiges 3D-Modell oder Unity Primitive in Ihre Szene und markieren Sie es als Static.&lt;br /&gt;
&lt;br /&gt;
'''Meshes dürfen für das Lightmapping keine überlappenden UV-Bereiche vorweisen. Der UV2-Kanal wird, sofern vorhanden, verwendet (andernfalls UV1). Sollten Sie Ihre 3D-Modelle nicht für das Lightmapping vorbereitet haben, müssen Sie die Einstellung [https://docs.unity3d.com/Manual/LightingGiUvs-GeneratingLightmappingUVs.html Generate Lightmap UVs] am Asset aktivieren.''' Unity Primitives besitzen bereits valide UV2-Kanäle.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Staticmarked.jpg|320px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Wählen Sie das Directional Light (das, was von Unity bereits erstellt wurde) aus und fügen Sie ihm eine '''Bakery Direct Light'''-Komponente hinzu.&lt;br /&gt;
{{note| Bakery und Unity nutzen jeweils separate Lichtquellen-Komponenten.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Das Bakery Direct Light bietet viele verschiedene Einstellungsmöglichkeiten, aber es ist sehr einfach, die Komponente an das Unity-eigene Licht anzugleichen. Klicken Sie hierfür auf '''Match lightmapped to real-time'''. Nun sollte das Bakery Direct Light die gleiche Lichtfarbe besitzen wie Unity’s Directional Light.&lt;br /&gt;
&lt;br /&gt;
[[File:Matching.jpg|640px]]&lt;br /&gt;
&lt;br /&gt;
{{note| Die Direct Light-Komponente könnte eine Warnung anzeigen, dass das Projekt keine lineare Lichtintensität verwendet. Das Problem besteht darin, dass Unity standardmäßig die Gammakorrektur auf die Farben der Lichtquellen [https://twitter.com/guycalledfrank/status/1001108508614553600 falsch anwendet]. Der richtige Modus kann per [https://docs.unity3d.com/ScriptReference/Rendering.GraphicsSettings-lightsUseLinearIntensity.html Skript] aktiviert werden, was mithilfe der Schaltfläche “Fix” geschiet. Wenn Sie bereits viele Lichtquellen im nicht-linearen Intensitätsmodus eingerichtet haben und diese nicht erneut ändern möchten, können Sie die Korrektur überspringen. Die Änderungen, die durch den “Fix” verursacht wurden, können jederzeit wieder rückgängig gemacht werden.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Um eine Umgebungsbeleuchtung mit Schatten zu erzielen, müssen Sie zuerst ein Skylight erstellen (Bakery-&amp;gt;Create-&amp;gt;Skylight).&lt;br /&gt;
&lt;br /&gt;
[[File:Menusky.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Wählen Sie das Skylight aus, weisen Sie es eine bläuliche Farbe zu und klicken Sie auf '''Match scene skybox to this light'''. Dadurch wird die Beleuchtung der Skybox genau angepasst.&lt;br /&gt;
{{note| Das Anpassen der Skybox an das Bakery Skylight ist optional, aber für die Korrektheit sinnvoll. Damit wird sichergestellt, dass die sichtbare Umgebung und die Reflection Probes in der Engine mit der gebackenen Beleuchtung übereinstimmen. Derzeit funktioniert diese Einstellung nur in der Built-In Render Pipeline von Unity.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Skycomp.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Wählen Sie nun Bakery-&amp;gt;Render Lightmap vom oberen Menü aus. Standardmäßig ist der Full Lighting-Modus aktiviert. Dieser berechnet sowohl direkte als auch indirekte Beleuchtung aller Lichter. Wenn Sie Echtzeit-Schatten mit gebackener Beleuchtung kombinieren möchten, ändern Sie die Einstellung auf '''Indirect'''.&lt;br /&gt;
&lt;br /&gt;
[[File:Bakerywindow.jpg]]&lt;br /&gt;
&lt;br /&gt;
{{note| Bakery könnte sich darüber beschweren, dass Sie den veralteten [https://docs.unity3d.com/Manual/LinearLighting.html Gamma-Modus] verwenden, und Ihnen empfehlen, diesen zu ändern. Wenn Ihnen die Qualität der Beleuchtung wichtig ist, wird die Verwendung des linearen Modus dringend empfohlen. Sie können diese Warnung ignorieren, falls Sie bereits ein großes Projekt mit Gamma-Modus eingerichtet haben und es nicht nachträglich ändern möchten oder wenn Sie für mobile Endgeräte entwickeln, die den linearen Modus nicht unterstützen.}}&lt;br /&gt;
&lt;br /&gt;
7. Klicken Sie auf die Schaltfläche '''Render'''.&lt;br /&gt;
&lt;br /&gt;
8. Fertig! Sie sollten nun gebackene Beleuchtung sehen:&lt;br /&gt;
&lt;br /&gt;
[[File:Bakedgi.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Rendereinstellungen ==&lt;br /&gt;
&lt;br /&gt;
Alle Rendereinstellungen können jederzeit über Bakery-&amp;gt;Render Lightmap eingesehen werden. Diese Einstellungen werden für jede Szene gespeichert. Die oberste Option im Bakery-Fenster ermöglicht es Ihnen, zwischen den Einstellungen Simple, Advanced und Experimental zu wechseln, wobei jeder nachfolgende Modus mehr anpassbare Optionen offenlegt. Der einfache Modus (Simple) reicht für die meisten Szenen aus und ist ein guter Einstieg.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render mode ===&lt;br /&gt;
Legt den Typ der zu backenden Lightmaps fest. &lt;br /&gt;
&lt;br /&gt;
===== Full Lighting =====&lt;br /&gt;
Vollständige direkte und indirekte Beleuchtung für alle Bakery-Lichter.&lt;br /&gt;
{{note| Bei Unity Versionen vor 2017.3 müssen Sie, wenn Sie sowohl Unity- als auch Bakery-Komponenten auf demselben GameObject haben, die Unity-Komponente manuell deaktivieren, um eine doppelte Helligkeit zu vermeiden. In neueren Versionen von Unity werden Echtzeit-Lichteffekte für gebackene Lichter automatisch deaktiviert, so wie es auch bei den integrierten Lightmappern der Fall ist.}}&lt;br /&gt;
&lt;br /&gt;
===== Indirect =====&lt;br /&gt;
[[File:Image26.png|thumb|Vergleich der verschiedenen Render-Modi, die von Unity unterstützt werden]]&lt;br /&gt;
Grundlegender Mixed mode. Es wird die Baked Contribution-Auswahl auf jedem Licht überprüft: Wenn die Einstellung auf ''Direct And Indirect'' gesetzt ist, wird das Licht wie im Full Lighting-Modus gebacken. Ist sie stattdessen auf ''Indirect Only'' gesetzt, wird nur der indirekte Beitrag (GI) dieses Lichts gebacken. Im letzteren Fall sollten Sie sowohl Unity- als auch Bakery-Lichter auf dem GameObject belassen, wobei eines einen direkten Echtzeitbeitrag leistet und das andere für vorab berechnete GI zuständig ist.&lt;br /&gt;
&lt;br /&gt;
[[File:Indirectonly.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== Shadowmask =====&lt;br /&gt;
[[File:Image21.png|thumb|Links: vollständig gebackenes Licht. Mitte: dynamisches Licht mit gebackener Beleuchtung. Rechts: der Schatten der Capsule sowie die Unebenheiten (bump) und Spiegelungen (specular) von Oberflächen sind dynamisch, während der Schatten des Cube und die Beleuchtung gebacken sind.]]&lt;br /&gt;
[[File:Image6.png|thumb|Wenn die Kamera weit genug entfernt ist oder dynamische Schatten deaktiviert sind, sieht dieselbe Szene wie folgt aus]]&lt;br /&gt;
Ein etwas fortgeschrittenerer Mixed mode. Er funktioniert durch die Erzeugung von zwei Arten von Lightmaps - eine mit gebackenen Farben (wie im Indirect mode) und eine weitere mit Schatten von statischen Objekten. Dies hat einige Vorteile:&lt;br /&gt;
* Echtzeit-Schatten können nur von einer Handvoll dynamischer Objekte erzeugt werden, nicht von der gesamten Szene.&lt;br /&gt;
* Echtzeit- und gebackene Schatten verschmelzen ordnungsgemäß miteinander.&lt;br /&gt;
* Echtzeit-Lichter können Bump-, Specular- und andere Oberflächeneffekte wiedergeben, während sie weiterhin durch hochwertige gebackene Schatten verdeckt werden.&lt;br /&gt;
[https://docs.unity3d.com/Manual/LightMode-Mixed-Shadowmask.html Mehr Informationen]&lt;br /&gt;
&lt;br /&gt;
Um dieses Verhalten zu aktivieren, müssen Sie sowohl Unity- als auch Bakery-Lichter auf demselben GameObject haben und Baked Contribution muss auf ''Shadowmask and Indirect'' eingestellt sein. Nicht markierte Lichter werden wie im Indirect mode gebacken.&lt;br /&gt;
&lt;br /&gt;
[[File:Smask22.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== Distance Shadowmask =====&lt;br /&gt;
Dieses Kontrollkästchen ist nur sichtbar, wenn Sie Shadowmask ausgewählt haben. Es schaltet die [https://docs.unity3d.com/Manual/LightMode-Mixed-ShadowmaskMode.html gleichnamige Einstellung] in den Quality Settings des Projekts um.&lt;br /&gt;
[https://docs.unity3d.com/Manual/LightMode-Mixed-DistanceShadowmask.html Mehr Informationen.]&lt;br /&gt;
{{note| Das Kontrollkästchen ist in Unity 5.6.x aufgrund fehlender Skript-API nicht sichtbar. Stattdessen können Sie die Einstellung unter Window-&amp;gt;Lighting-&amp;gt;Mixed Lighting-&amp;gt;Lighting Mode ändern.}}&lt;br /&gt;
{{note| In Versionen von Unity &amp;lt; 2017.3 werden aufgrund von API-Einschränkungen beim Rendern von Shadowmask-Lightmaps in der Szene platzierte Light Probes zurückgesetzt. Diese müssen nach dem Backvorgang erneut berechnet werden. In neueren Versionen sollte dies nicht mehr vorkommen.}}&lt;br /&gt;
&lt;br /&gt;
===== Subtractive =====&lt;br /&gt;
Aktiviert den [https://docs.unity3d.com/Manual/LightMode-Mixed-Subtractive.html Subtractive] Beleuchtungsmodus. &lt;br /&gt;
&lt;br /&gt;
Diese Einstellung hat keine besonderen Auswirkungen auf Lightmaps und funktioniert genau wie Full Lighting.&lt;br /&gt;
&lt;br /&gt;
Der einzige Unterschied besteht darin, dass sie auch Echtzeit-Lichter von Unity für den subtraktiven Modus einrichtet (da dies über die Benutzeroberfläche nicht möglich ist).&lt;br /&gt;
&lt;br /&gt;
Sie müssen zusätzlich globale subtraktive Parameter (wie die globale Schattenfarbe) in Unity’s [https://docs.unity3d.com/Manual/GlobalIllumination.html#MixedLighting Lighting Fenster] einrichten. .&lt;br /&gt;
&lt;br /&gt;
===== Ambient Occlusion Only =====&lt;br /&gt;
Es wird nur die Umgebungsverdeckung (AO) gebacken. Kann nützlich sein, wenn Sie wissen, was Sie tun. Stellen Sie sicher, dass die [[#Ambient_occlusion|AO Einstellungen]] eingerichtet wurden.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Directional mode ===&lt;br /&gt;
[[File:Image3.png|thumb|Vergleich verschiedener Richtungsmodi]]&lt;br /&gt;
Legt fest, wie Richtungsinformationen eingebettet werden. Standardmäßige Lightmaps speichern nur eine einzige Farbe pro Texel, während Lightmaps mit Richtungsinformationen den Shadern einen Hinweis darauf geben, wie sich die Beleuchtung über eine Halbkugel um das Texel herum verändert. Diese Daten sind erforderlich, um vollständig belichtete Bereiche mit Normal Maps zu kombinieren. Durch das Einbinden in den integrierten [[#Bakery_shaders|Bakery Shader]] kann ebenfalls eine ungefähre Spiegelungsreaktion erzeugt werden.&lt;br /&gt;
&lt;br /&gt;
===== None =====&lt;br /&gt;
Keine Richtungsdaten, eine Farbe pro Texel.&lt;br /&gt;
&lt;br /&gt;
===== Baked Normal Maps =====&lt;br /&gt;
Immer noch keine Richtungsdaten, aber Normal Maps werden beim Rendern der Lightmap berücksichtigt. Es gibt keinen zusätzlichen Laufzeit-Overhead. Da Lightmaps in der Regel eine geringere Auflösung als Normal Maps haben, kann das Ergebnis unscharf aussehen. Weitere Probleme sind Aliasing in der Ferne aufgrund fehlendes Mipmapping und eine mögliche Verwischung von Details durch die Rauschunterdrückungsprozedur (Denoising). Um zu erfahren, wie Sie in diesem Modus benutzerdefinierte Shader mit prozeduralen Normalen verwenden können, lesen Sie den Abschnitt [[#Normal_mapping|Normal Mapping]].&lt;br /&gt;
&lt;br /&gt;
===== Dominant Direction =====&lt;br /&gt;
Dieser Modus ähnelt dem, was Enlighten und Progressive in Unity backen. Er ist mit den meisten Shadern kompatibel, generiert nur eine zusätzliche Map und der Laufzeit-Overhead ist minimal. Der Nachteil ist, dass das Bump Mapping eher blass und grau wirkt und sich deutlich von demselben Objekt unter Echtzeitbeleuchtung unterscheiden kann.&lt;br /&gt;
&lt;br /&gt;
===== RNM =====&lt;br /&gt;
Basierend auf der Radiosity Normal Mapping-Technik, die ursprünglich für HL2 ([https://steamcdn-a.akamaihd.net/apps/valve/2004/GDC2004_Half-Life2_Shading.pdf Folien]) entwickelt und später in vielen weiteren Spielen (z. B. Mirror’s Edge) verwendet wurde. Es werden insgesamt 3 HDR-Maps erzeugt und ist damit der Modus mit dem höchsten Speicherbedarf. Der Laufzeit-Overhead ist immer noch relativ gering. Dieser Modus ist außerdem präziser als Dominant Direction. Er ist besser darin, Oberflächenkontraste wiederzugeben und kann mit farbigem Licht umgehen, welches Normal Maps aus verschiedenen Winkeln beeinflusst.&lt;br /&gt;
&lt;br /&gt;
===== SH =====&lt;br /&gt;
Basierend auf dem “Precomputed Global Illumination in Frostbite” [https://media.contentapi.ea.com/content/dam/eacom/frostbite/files/gdc2018-precomputedgiobalilluminationinfrostbite.pdf Papier]. Dies ist der Modus mit der höchsten Qualität, der einen deutlich besseren Oberflächenkontrast bietet und unterschiedlich gefärbtes Licht aus verschiedenen Richtungen darstellen kann. Erzeugt insgesamt 4 Maps, von denen nur eine HDR ist, und benötigt daher weniger Speicherplatz als RNM. Der Laufzeit-Overhead ist etwas höher als bei RNM.&lt;br /&gt;
&lt;br /&gt;
===== MonoSH =====&lt;br /&gt;
[[File:FY8Ru8hWIAAdYYH.jpg|thumb|Größen/Qualitätsvergleich von Dominant Direction, SH und MonoSH]]&lt;br /&gt;
Wie SH, jedoch unter Verwendung monochromatischer L1-Richtungskoeffizienten. Ähnlich guter Oberflächenkontrast, obwohl unterschiedliche Farben, die aus verschiedenen Richtungen auf ein Texel fallen, nicht genau wiedergegeben werden; für viele Szenen jedoch ausreichend. Es wird nur eine zusätzliche Map generiert, sodass die VRAM-Nutzung/Bandbreite ähnlich ist wie bei Dominant Direction; tatsächlich ist sie sogar noch geringer, da Dominant Direction RGBA-kodierte Maps verwendet, während MonoSH nur RGB benötigt. Die Map wird über das integrierte Richtungs-Lightmap-System gespeist, ''sieht jedoch mit Standard Shadern nicht korrekt aus''. Achten Sie darauf, einen kompatiblen Shader zu verwenden.&lt;br /&gt;
&lt;br /&gt;
===== Einschränkungen =====&lt;br /&gt;
&lt;br /&gt;
* RNM und SH/MonoSH können nur mit dem [[#Bakery_shaders|Bakery Shader]] verwendet werden oder benötigen Anpassungen an Ihren Shadern.&lt;br /&gt;
* Im RNM- und SH-Modus werden keine Standard-Farb-Lightmaps erstellt. Sie müssen entweder den Bakery Shader für alle Materialien in der Szene verwenden oder [[#Bakery_Lightmap_Group_Selector|Lightmap Groups]] einsetzen, um RNM/SH-Objekte von den übrigen zu trennen.&lt;br /&gt;
* RNM- und SH-Maps werden mithilfe von [https://docs.unity3d.com/ScriptReference/MaterialPropertyBlock.html MaterialPropertyBlock] auf Objekte angewendet und werden daher möglicherweise nicht vollständig im Lighting Fenster von Unity angezeigt.&lt;br /&gt;
* Die Modi Dominant Direction, RNM and SH/MonoSH erfordern möglicherweise etwas mehr Samples für GI und Light Meshes, um eine vergleichbare Qualität erzielen zu können.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Texels per unit ===&lt;br /&gt;
[[File:Texelscomp.jpg|thumb|1 vs 10 Texels pro Welteinheit]]&lt;br /&gt;
Ungefähre Anzahl der Lightmap-Texel pro Welteinheit. Beeinflusst die Anzahl und Auflösung der generierten Lightmaps.&lt;br /&gt;
&lt;br /&gt;
Beispielwerte für den Einstieg:&lt;br /&gt;
* Großer Außenbereich (z. B. eine Stadt): 1 - 5&lt;br /&gt;
* Mittlerer Außenbereich (einige Gassen): 10 - 20&lt;br /&gt;
* Hochwertige Innenbeleuchtung: 100&lt;br /&gt;
&lt;br /&gt;
Es wird davon ausgegangen, dass der Maßstab der Szene ungefähr 1 Einheit = 1 Meter beträgt. Eine solche Skalierung wird im Allgemeinen bei der Arbeit in Unity empfohlen, um eine bessere Navigation und Physiksimulation zu erzielen. Wenn Ihre Skalierung anders ist, multiplizieren Sie die Texel entsprechend.&lt;br /&gt;
&lt;br /&gt;
Beachten Sie, dass Texels per unit die Basisauflösung ist, aber jedes Objekt noch zusätzlich mit [https://docs.unity3d.com/Manual/class-MeshRenderer.html Scale in Lightmap] in den Mesh Renderern sowie mit [[#Scale per map type|Scale per map type]] im Bakery-Fenster angepasst werden kann.&lt;br /&gt;
&lt;br /&gt;
{{note| Objekte, bei denen Scale in Lightmap auf 0 gesetzt ist, werden nicht gebacken, werfen jedoch weiterhin Schatten und beeinflussen GI.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Max resolution ===&lt;br /&gt;
Maximale Größe der Lightmap. Falls nicht alle Objekte in eine einzelne Lightmap passen (bei gegebenem Texels Per Unit-Wert), werden zusätzliche Lightmaps zugewiesen. Dieselben vier quadratischen Objekte können vier 512x512-Maps oder eine 1024x1024-Map belegen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bounces ===&lt;br /&gt;
[[File:Image36.png|thumb|Beachten Sie, wie mehr Reflexionen zu mehr Licht in geschlossenen Räume führen.]]&lt;br /&gt;
Legt fest, wie oft Lichtstrahlen von Oberflächen reflektiert werden sollen. In der Regel sind niedrige Werte für Außenbereiche (z. B. eine Stadt) ausreichend, während für geschlossene Bereiche (Innenräume, Höhlen) höhere Werte erforderlich sind.&lt;br /&gt;
&lt;br /&gt;
Der Schieberegler ist zwar auf 5 Reflektierungen begrenzt, es ist jedoch möglich, eine beliebige Anzahl von Reflektierungen in das Zahlenfeld einzugeben.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Samples ===&lt;br /&gt;
[[File:Image7.png|thumb|Links: samples = 4, rechts: samples = 16. Zur Veranschaulichung wurde die Rauschunterdrückung (Denoising) deaktiviert.]]&lt;br /&gt;
Beeinflusst die Qualität von GI. Typische Werte liegen zwischen 16 und 32.&lt;br /&gt;
&lt;br /&gt;
{{note| Es ist möglich, eine beliebige Zahl einzugeben, die über dem maximalen Schiebereglerwert liegt. Beachten Sie jedoch, dass diese Zahl die Quadratwurzel der endgültigen Strahlanzahl darstellt - d. h. 32 entspricht 1024 Strahlen, 64 entspricht 4096 Strahlen usw.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GPU Priority ===&lt;br /&gt;
Während die GPU an Lightmaps arbeitet, können das Betriebssystem und andere Software weniger reaktiv werden. Mit dieser Option können Sie ein Gleichgewicht zwischen der Baking-Geschwindigkeit und der Reaktionsfähigkeit des Systems herstellen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render ===&lt;br /&gt;
Backt Lightmaps für alle geöffneten Szenen.&lt;br /&gt;
Wenn [[Manual#Light_probe_mode|Light Probe Mode]] auf L1 oder L2 eingestellt ist, werden auch Light Probes mitgebacken.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Render Light Probes ===&lt;br /&gt;
Backt [https://docs.unity3d.com/Manual/LightProbes.html Light Probes] für alle geöffneten Szenen.&lt;br /&gt;
&lt;br /&gt;
Beachten Sie, dass Sie für korrekte Mixed light Schatten auf dynamischen Objekten im Shadowmask-Modus auch [[Manual#Occlusion_probes|Okklusionsproben]] aktivieren müssen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Render Reflection Probes ===&lt;br /&gt;
Backt [https://docs.unity3d.com/Manual/class-ReflectionProbe.html Reflection Probes] für alle geöffneten Szenen. Diese Schaltfläche dient lediglich der Benutzerfreundlichkeit und ruft die interne Aktualisierungsroutine der Engine für Reflection Probes auf.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update Skybox Probe ===&lt;br /&gt;
Backt globale Diffuse- und Reflection Probes für die aktuelle Skybox. Wie bei &amp;quot;Render Reflection Probes&amp;quot; werden lediglich integrierte Engine-Funktionen aufgerufen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Occlusion probes ===&lt;br /&gt;
Lässt Unity beim Rendern von Light Probes Okklusionsproben mit dem aktuell ausgewählten integrierten Lightmapper backen. Okklusionsproben sind zusätzliche Daten, die in regulären Light Probes gespeichert werden und verhindern, dass dynamische Objekte in schattigen Bereichen beleuchtet werden. Derzeit gibt es keine Möglichkeit, benutzerdefinierte Okklusionsproben in Unity zu erstellen, weshalb Unity’s eigene Lightmapper aufgerufen werden müssen, um diese Aufgabe zu erledigen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Warnings ===&lt;br /&gt;
Diese Optionen validieren die Szene, nachdem eine der Render-Schaltflächen gedrückt wurde, und zeigen Warnungsdialogfelder an, in denen Sie gefragt werden, ob Sie den Backvorgang fortsetzen oder beenden möchten.&lt;br /&gt;
* Suppress all popups: Nach dem Drücken von Render werden keine Dialogfelder mehr angezeigt.&lt;br /&gt;
* UV validation: Überprüft, ob alle Modelle vollständig korrekte Lightmapping UVs aufweisen – insbesondere, ob sie im Bereich von 0 bis 1 liegen und sich nicht überlappen.&lt;br /&gt;
* Overwrite check: Teilt mit, ob und welche Lightmap-Dateien überschrieben werden.&lt;br /&gt;
* Memory check: Gibt einen sehr ungefähren Wert für den benötigten Videospeicher an.&lt;br /&gt;
* Sample count check: Überprüft, ob Lichter, GI oder AO unangemessene Sample-Werte aufweisen, die dazu führen könnten, dass die GPU ihre verfügbaren Ressourcen überschreitet.&lt;br /&gt;
* Lightmapped prefab validation: Validiert Lightmapped Prefabs und benachrichtigt Sie, falls Prefabs überschrieben werden.&lt;br /&gt;
&lt;br /&gt;
== Erweiterte Rendereinstellungen ==&lt;br /&gt;
=== Light probe mode ===&lt;br /&gt;
Ändert die Art und Weise, wie Light Probes gebacken werden.&lt;br /&gt;
&lt;br /&gt;
* Legacy: Verwenden Sie die Schaltfläche Render Light Probes, um Probes zu rendern. Punkt- und direktionale Lichter werden innerhalb des Lightmappers berechnet, während Flächen-/Himmels-/indirekte Beleuchtung durch das Rendern einer Cubemap an jeder Probenposition erfasst wird. Die Ergebnisse werden als [https://docs.unity3d.com/ScriptReference/Rendering.SphericalHarmonicsL2.html sphärische Harmonische der Ordnung L2] gespeichert. Die Nachteile sind eine langsame Cubemap-Rendering-Leistung und mögliche Abweichungen zwischen Lightmaps und Probes in Fällen, in denen Shader in Ihrem Spiel beleuchtete Oberflächen nicht physikalisch darstellen können oder Ihr Projekt für mobile Endgeräte eingerichtet ist (Unity kann hohe Intensitätswerte wegschneiden).&lt;br /&gt;
&lt;br /&gt;
* L1: Light Probes werden zusammen mit Lightmaps gerendert, wenn Sie auf Render klicken. Diese Einstellung bietet eine überlegendere Backleistung und garantiert, dass die Beleuchtung der Proben mit den Lightmaps übereinstimmen. Ergebnisse werden als sphärische Harmonische der Ordnung L1 gespeichert (und können weiterhin von regulären Shadern verwendet werden). Durch Anwendung der Einstellung Non-Linear Light Probe SH im [[#Bakery_shaders|Bakery Shader]] können die Ergebnisse weiter verbessert werden.&lt;br /&gt;
&lt;br /&gt;
* L2: überragende Qualität (vollständige sphärische Harmonische der Ordnung L2). Wie bei L1, werden sie automatisch zusammen mit Lightmaps gerendert. Vernachlässigbare Auswirkungen auf die Leistung im Vergleich zu L1. Sollte mit allen Shadern gut aussehen. Kontrast/Direktionalität/Ringing-Entfernung der Proben kann über Project Settings -&amp;gt; Bakery -&amp;gt; &amp;quot;Ringing removal for L2 light probes&amp;quot; angepasst werden.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Es scheint einen Fehler in Unity 2019.3 zu geben, der verhindert, dass Legacy Light Probe-Farben ordnungsgemäß gespeichert werden, falls die Einstellung [[Manual#Occlusion_probes|Occlusion probes]] aktiviert ist. Der L2-Modus ist jetzt der Standardmodus und wird bei Verwendung von Okklusionsproben empfohlen.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Asset UV Processing ===&lt;br /&gt;
Konfiguriert die UV Padding-Anpassung für Assets. Mögliche Werte:&lt;br /&gt;
* Don't change: Es werden keine Änderungen an Assets vorgenommen.&lt;br /&gt;
* Adjust UV padding: Sucht nach Modellen mit automatisch generierten UVs (“Generate Lightmap UVs” auf dem Asset) und passt diese weiter an, um ein korrektes Padding zwischen den UV-Inseln pro Mesh zu erzielen. Die modellweite Pack Margin in den Importeinstellungen wird ignoriert. Stattdessen werden optimale Werte berechnet, basierend auf der Fläche jedes Meshes und der Auflösung der Lightmap.&lt;br /&gt;
* Adjust UV padding for new meshes only: Wie oben, jedoch werden alle Modelle übersprungen, die zuvor mindestens einmal angepasst wurden.&lt;br /&gt;
* Remove UV adjustments: Hebt alle vorherigen UV-Anpassungen auf und lässt automatisch unwrappte Modelle so aussehen, wie Unity sie ursprünglich unwrappt hat.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser ===&lt;br /&gt;
Legt den gewünschten Denoiser fest. Mögliche Werte:&lt;br /&gt;
* Optix 5: Verwendet den OptiX 5.1 AI-Denoiser (früher bekannt als &amp;quot;Legacy denoiser&amp;quot;). Läuft auf der GPU. Unterstützt auf allen Grafikkarten von [https://en.wikipedia.org/wiki/Kepler_(microarchitecture) Kepler] (GeForce 6xx) bis [https://en.wikipedia.org/wiki/Turing_(microarchitecture) Turing] (Geforce 20xx). Nicht unterstützt auf [https://en.wikipedia.org/wiki/Ampere_(microarchitecture) Ampere] (30xx)-Grafikkarten. OptiX 5.1 verwendet einen statischen Trainingsdatensatz, der darin eingebettet ist, sodass er nicht von der Treiberimplementierung beeinflusst wird.&lt;br /&gt;
* Optix 6: Verwendet den OptiX 6.0 AI-Denoiser (war zuvor die Standardeinstellung). Läuft auf der GPU. Scheint auf Kepler (6xx)-GPUs nicht zu funktionieren, läuft dafür aber auf neueren Modellen - einschließlich Ampere (30xx). Seit Version 6.0 befindet sich der Trainingsdatensatz für den OptiX Denoiser im Grafikkartentreiber. Das Verhalten war vor Treiberversion 442.50 ähnlich wie bei OptiX 5.1; nach diesem Treiber hat NVIDIA jedoch [https://forums.developer.nvidia.com/t/optix7-denoiser-different-results-with-different-version-of-drivers/117989/2 den Datensatz geändert], sodass die Ergebnisse unterschiedlicher ausfallen können. Der aktualisierte Datensatz kann manchmal gitterartige Muster und hellere Kanten erzeugen (die jedoch mit [[Manual#Denoise:_fix_bright_edges|&amp;quot;Denoise: fix bright edges&amp;quot;]] behoben werden können), läuft aber schneller.&lt;br /&gt;
* Optix 7: Verwendet den OptiX 7.2 AI-Denoiser. Verhält sich ähnlich wie OptiX 6.0, wird jedoch möglicherweise besser von Ampere (30xx) unterstützt.&lt;br /&gt;
* OpenImageDenoise: Verwendet Intel Open Image Denoise. Läuft auf der CPU (jede CPU, die SSE 4.1 unterstützt). Kann etwas langsamer als OptiX sein, aber die Qualität ist vergleichbar.&lt;br /&gt;
* OpenImageDenoise2: Verwendet Intel Open Image Denoise 2 im CUDA-Modus. Läuft auf der GPU, die Leistung ist vergleichbar mit OptiX 6/7 und die Qualität ist identisch mit der CPU-Version.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Adjust sample positions ===&lt;br /&gt;
Findet die besten Positionen für die Proben, um Beleuchtungslecks zu vermeiden. Die Details des Algorithmus werden [https://ndotl.wordpress.com/2018/08/29/baking-artifact-free-lightmaps/#leaks hier] beschrieben. In einigen Fällen (in der Regel bei großen Geometrien mit sehr niedriger Polygonanzahl und glatten Normalen) kann es zu falschen Ergebnissen kommen. In diesem Fall können Sie die Funktion deaktivieren.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Unload scenes before render ===&lt;br /&gt;
Entlädt Szenen vor dem Backen, um Videospeicher freizugeben. Komplexere Szenen können allein durch die Anzeige im Editor mehrere Gigabyte VRAM beanspruchen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Denoise ===&lt;br /&gt;
[[File:Image31.png|thumb|Links: Denoising deaktiviert, rechts: Denoising aktiviert.]]&lt;br /&gt;
Wenn aktiviert, wird der Entrauschungsalgorithmus angewendet. Bakery verwendet [https://developer.nvidia.com/optix-denoiser NVIDIA’s AI-Denoiser (OptiX)] oder Intel's Open Image Denoise (falls ausgewählt).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Fix Seams ===&lt;br /&gt;
[[File:Image22.png|thumb|Left: Übergänge, right: Übergänge sind geglättet.]]&lt;br /&gt;
Wenn aktiviert, wird versucht, durch UV-Diskontinuitäten entstandene Übergänge zu glätten. Nützlich für glatte Geometrien - einschließlich der Standardkugel von Unity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Split by scene ===&lt;br /&gt;
Wenn mehrere Szenen gleichzeitig geladen werden und diese Option aktiviert ist, verfügt jede Szene über einen eigenen Satz Lightmaps, der nicht mit anderen geteilt wird. Dies kann hilfreich sein, um die Anzahl der geladenen Texturen zu begrenzen, wenn Szenen während der Laufzeit gestreamed werden.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hole filling ===&lt;br /&gt;
[[File:Holefilling.jpg|thumb|Lochfüllung aus vs. ein.]]&lt;br /&gt;
Wenn [[Manual#Atlas_Packer|Atlas Packer]] auf xatlas eingestellt ist, wird versucht, jedes Loch zu füllen, was zu effizienteren Atlas-Texturen führt. Bei Szenen mit sehr komplexer Geometrie kann dies die Exportzeit der Szene verlängern, ist aber ansonsten empfehlenswert.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Min resolution ===&lt;br /&gt;
Mindestgröße für Lightmaps. Kann verwendet werden, um zwischen vielen kleinen, aber vollständig belegten Lightmaps und wenigen unvollständig gefüllten Lightmaps abzuwägen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Scale per map type ===&lt;br /&gt;
Ermöglicht es Ihnen, die Auflösung von Color/Shadowmask/Direction-Maps unterschiedlich zu skalieren. Ein häufiger Fall wäre beispielsweise eine indirekte Färbung mit niedriger Auflösung, aber einer sehr detaillierten Shadowmask. Beachten Sie, dass die Skalierung erst nach dem Rendern der Lightmaps angewendet wird, sodass keine Zeit beim Baking eingespart wird. Wenn “Adjust UV padding” aktiviert ist, basiert das Padding auf der Map mit der niedrigsten Auflösung, um Texel-Leaking zu verhindern.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Checker preview ===&lt;br /&gt;
[[File:Image12.png|thumb|Checker preview in Aktion]]&lt;br /&gt;
Wenn das Kontrollkästchen Show checker aktiviert ist, rendert die Scene View ein Schachbrettmuster über alle sichtbaren Objekte, um die Größe der Lightmap-Texel anzuzeigen. Dies ist nützlich, um sicherzustellen, dass Sie vor dem Backen angemessene Werte für Texels Per Unit und andere Einstellungen, die sich auf die Auflösung auswirken, verwenden.&lt;br /&gt;
&lt;br /&gt;
Durch das Aktivieren der Checker preview wird Bakery gezwungen, Atlas Packing durchzuführen. Dies kann einige Sekunden dauern. Klicken Sie auf Refresh checker, um die Szene nach einer vorgenommenen Änderung neu zu atlasieren und die Änderungen anzuzeigen.&lt;br /&gt;
&lt;br /&gt;
Checker preview verwendet ebenfalls zufällige Farben, um zu zeigen, wie die Szene in verschiedene Lightmaps aufgeteilt sein wird.&lt;br /&gt;
&lt;br /&gt;
{{note| Checker preview zeigt derzeit keine korrekten Texel-Größen für Terrains an.}}&lt;br /&gt;
&lt;br /&gt;
==== Atlas preview ====&lt;br /&gt;
[[File:FN-TmhRXwAE9i2I.png|thumb|Atlas preview in Aktion]]&lt;br /&gt;
Die Schaltfläche Atlas preview ist sichtbar, wenn die Checker preview aktiviert ist. Durch Anklicken öffnet sich ein neues Fenster, in dem die UV-Layouts zukünftiger Lightmaps angezeigt werden. Sie können mithilfe der &amp;quot;&amp;lt;&amp;quot; und &amp;quot;&amp;gt;&amp;quot; Schaltflächen zwischen den Lightmaps wechseln.&lt;br /&gt;
Dies kann nützlich sein, um vor dem Backen die Packungsqualität und die Anzahl der Lightmaps zu überprüfen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Emissive boost ===&lt;br /&gt;
Multipliziert jede Oberflächenemission mit dieser Zahl.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Indirect boost ===&lt;br /&gt;
Multipliziert alle reflektierten Lichtstrahlen mit diesem Wert. Entspricht der Indirect Intensity-Einstellung bei Licht-Komponenten, gilt jedoch global.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Backface GI ===&lt;br /&gt;
[[File:Image30.jpg|thumb|Backface GI]]&lt;br /&gt;
[[File:Image35.png|thumb|Links: backface GI = 0, rechts: backface GI = 1. Beachten Sie, wie schattige Bereiche mehr grünes Licht erhalten.]]&lt;br /&gt;
Bestimmt, wie viel Licht durch die Vorderfläche zur Rückfläche gelangt und dann von GI reflektiert wird. Dies ist besonders nützlich für dünne, durchscheinende Oberflächen wie Blätter. Die Werte liegen im Bereich von 0 bis 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Ambient occlusion ===&lt;br /&gt;
[[File:Image15.png|thumb|Left: AO intensity = 0. Right: AO intensity = 1.]]&lt;br /&gt;
Einfache nicht-physikalische Umgebungsverdeckung, die Sie aus ästhetischen Gründen über die endgültige Szenenbeleuchtung legen können.&lt;br /&gt;
* Intensity: Steuert die Sichtbarkeit des AO-Effekts. Ein Wert von 0 deaktiviert den Effekt.&lt;br /&gt;
* Radius: Legt die im AO-Effekt verwendete Strahlungsentfernung fest. Kleinere Werte führen zu lokalisierten Verdunkelungen (Ecken, Falten), während höhere Werte eher einem Skylight ähneln und Schatten von weiter entfernten Objekten erzeugen.&lt;br /&gt;
* Samples: Beeinflusst die Qualität der Umgebungsverdeckung. Typische Werte liegen zwischen 4 und 32.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dither transparency ===&lt;br /&gt;
Aktiviert halbtransparente Schatten durch das automatische Dithering von Alpha-Texturen. Lernen Sie, [[Manual#Opacity|wie Bakery Opacity Maps interpretiert]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== RTX Mode ===&lt;br /&gt;
Aktiviert die RTX-Hardwarebeschleunigung. Nur RTX-GPUs profitieren von dieser Einstellung. Die minimal unterstützte Treiberversion ist 418.&lt;br /&gt;
&lt;br /&gt;
Treiber können den RTX-Modus auf den meisten Nicht-RTX NVIDIA-Karten emulieren, aber das Ergebnis ist in der Regel langsamer.&lt;br /&gt;
&lt;br /&gt;
Der RTX-Modus '''muss''' auf Ampere (3xxx) oder neueren Karten aktiviert sein.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Export terrain trees ===&lt;br /&gt;
Wenn diese Einstellung aktiviert ist, beeinflussen Bäume auf Terrain die Beleuchtung. Die Bäume selbst werden nicht gebacken. Beachten Sie, dass beim Backen für jeden Baum die höchstmögliche LOD-Stufe verwendet wird. Daher wird es nicht empfohlen, diese Einstellung für die Darstellung von mehreren Kilometern großen Wäldern mit hochdetaillierten Modellen zu verwenden.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Terrain optimization ===&lt;br /&gt;
Wenn aktiviert (Standard), verwenden Terrains eine separate Raytracing-Technik, um die Vorteile ihrer Höhenfeldgeometrie zu nutzen. Andernfalls werden sie wie jedes andere Mesh behandelt. Terrain optimization reduziert den Speicherbedarf für hochauflösende Landschaften erheblich. In einigen Fällen kann es auch das Backen des Terrains beschleunigen, in anderen Fällen (insbesondere bei einfachen Landschaften mit niedriger Auflösung) kann es sinnvoll sein, sie zu deaktivieren.&lt;br /&gt;
&lt;br /&gt;
{{note| Terrain Optimization ist derzeit nicht mit Terrainlöchern kompatibel. Deaktivieren Sie die Einstellung, damit sie funktionieren.}}&lt;br /&gt;
{{note| Terrain Optimization wird nur im Nicht-RTX-Modus unterstützt.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Light Mesh batch limit ===&lt;br /&gt;
Wenn dieser Wert über 0 liegt, werden mehrere [[Manual#Bakery_Light_Mesh|Light Meshes]] zu einem zusammengefasst, vorausgesetzt, sie haben identische Einstellungen und wirken sich auf dieselben [[Manual#Bakery_Lightmap_Group_Selector|Lightmap Groups]] aus, wobei ihre Gesamtzahl an Samples jedoch auf diesen Wert begrenzt wird (d. h. wenn das Limit 64 beträgt, können 2 Lichter mit Samples=32 oder 4 Lichter mit Samples=16 usw. zusammengefasst werden). Dies erhöht die Leistung in Szenen mit vielen Light Meshes. Achten Sie darauf, diesen Wert nicht zu hoch einzustellen, da ansonsten die GPU bei der Verarbeitung zu vieler Samples gleichzeitig das Zeitlimit des Betriebssystemtreibers erreichen könnte.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Compress volumes ===&lt;br /&gt;
Wenn aktiviert, wird die Texturkomprimierung auf 3D-Volumen-Texturen angewendet und die Bakery Shader werden auf einen entsprechenden Abtastmodus umgeschaltet. Nicht empfohlen für Volumes mit sehr niedriger Auflösung. Die Volumengröße kann auf ein Vielfaches von 4 erhöht werden.&lt;br /&gt;
&lt;br /&gt;
Anmerkungen:&lt;br /&gt;
* Derzeit kann nur in die Texturenformate BC6H/BC7 (Desktop/Konsolen) komprimiert werden.&lt;br /&gt;
* Die Volumenkomprimierung wird nur in Unity 2020.1 oder neuer unterstützt.&lt;br /&gt;
* Derzeit unterstützt nur der Bakery Shader für die Built-In Render Pipeline die Verwendung komprimierter Volumes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Samples multiplier ===&lt;br /&gt;
Multipliziert alle Schatten- und GI-Samples mit dem angegebenen Faktor. Verwenden Sie diese Einstellung, um schnell zwischen Entwurfs- und Endqualität zu wechseln.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Tile size ===&lt;br /&gt;
Wie bei der [[#GPU Priority|GPU Priority]], jedoch legen Sie anstelle der abstrakten Priorität die Kachelgröße fest. Bakery teilt Lightmaps in kleinere Kacheln auf und aktualisiert diese nacheinander. Eine kleinere Größe bedeutet mehr Unterbrechungen in der GPU-Arbeit und kann das System reaktionsfähiger machen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Temp path ===&lt;br /&gt;
Ordner für temporäre Dateien. Bakery benötigt während des Renderns möglicherweise einige Gigabyte freien Speicherplatz. Wenn sich dieser Ordner auf einer SSD befindet, kann das Rendern im Vergleich zu einer HDD etwas schneller erfolgen. Derzeit wird dieser Ordner nicht automatisch bereinigt. Sie können den Inhalt jederzeit (außer während des Renderns) manuell oder über Bakery -&amp;gt; Utilities -&amp;gt; Clear cache löschen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Output path ===&lt;br /&gt;
Ordner für Lightmaps. Hier werden alle Lightmap-, Light Probe- und Vertex-Color Assets gespeichert. Dieser Pfad ist relativ zu Ihrem Assets Ordner.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Use scene named output path ===&lt;br /&gt;
Wenn diese Einstellung aktiviert ist, wird der Ausgabepfad automatisch auf einen Ordner mit dem gleichen Namen wie die aktuell aktive Szene gesetzt (Assets/AktuellerSzenenName/). Dies ähnelt dem Verhalten der integrierten Unity Lightmapper.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render Selected Groups ===&lt;br /&gt;
Backt nur [[#Bakery_Lightmap_Group_Selector|Lightmap Groups]], die ausgewählte Objekte enthalten.&lt;br /&gt;
Nicht nur ausgewählte Objekte werden neu gezeichnet, sondern auch alle Lightmap Groups, zu denen sie gehören. Andere Lightmaps werden nicht aktualisiert. Falls Objekte nicht zu einer manuell zugewiesenen Gruppe gehören, wird ein Teil der Szene, der dieselbe Lightmap verwendet, neu berechnet.&lt;br /&gt;
&lt;br /&gt;
Derzeit ist es praktischer, [[Partial_scene_baking|Sektoren für das teilweise Backen von Szenen zu verwenden]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Beep on finish ===&lt;br /&gt;
Wenn diese Einstellung aktiviert ist, gibt Bakery nach Abschluss des Backvorgangs einen Ton aus.&lt;br /&gt;
&lt;br /&gt;
== Experimentelle Rendereinstellungen ==&lt;br /&gt;
=== Unwrapper ===&lt;br /&gt;
Definiert den zu verwendenden Unwrapper, wenn [[#Asset_UV_Processing|Adjust UV Padding]] aktiviert ist.&lt;br /&gt;
* Default: Standard Unity Unwrapper. Bakery ruft [https://docs.unity3d.com/ScriptReference/Unwrapping.GenerateSecondaryUVSet.html Unwrapping.GenerateSecondaryUVSet] für jedes Mesh mit unterschiedlichen Padding-Parametern auf.&lt;br /&gt;
* xatlas: Verwendet [https://github.com/jpcy/xatlas xatlas] von [https://github.com/jpcy jpcy] - eine modifizierte Version von [https://github.com/Thekla/thekla_atlas thekla_atlas] des Entwicklers [https://github.com/castano Ignacio Castaño]. thekla_atlas wurde im Spiel The Witness ([http://the-witness.net/news/2010/03/graphics-tech-texture-parameterization/ Blog post]) eingesetzt.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Atlas Packer ===&lt;br /&gt;
Wählt den Algorithmus aus, der beim Packen verschiedener Objekt-UV-Layouts in große Lightmap-Atlas-Texturen verwendet werden soll.&lt;br /&gt;
* Default: Originalalgorithmus, den Bakery vor Version 1.7 verwendet hat.&lt;br /&gt;
* xatlas: Verwendet xatlas.&lt;br /&gt;
&lt;br /&gt;
Einige Funktionen werden nur mit einem Atlas Packer unterstützt:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Default&lt;br /&gt;
! xatlas&lt;br /&gt;
|-&lt;br /&gt;
| [[Manual#Bakery_Lightmap_Group_Selector|Override resolution]]&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
|-&lt;br /&gt;
| Efficient LOD packing&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|-&lt;br /&gt;
| [[Manual#Hole_filling|Hole filling]]&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Beachten Sie, dass der Atlas Packer auch für jede Lightmap Group separat ausgewählt werden kann.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Export geometry and maps ===&lt;br /&gt;
Wenn diese Einstellung aktiviert ist, exportiert Bakery die Szene vor dem Rendern in ein für Bakery passendes Format. Falls Sie sich sicher sind, dass die Geometrie und Texturen in der Szene sowie die Einstellungen für die Lightmap-Auflösung nicht geändert wurden (z. B. wenn Sie nur GI- oder Lichteinstellungen angepasst haben), können Sie dieses Kontrollkästchen deaktivieren, um das nächste Rendern zu beschleunigen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update unmodified lights ===&lt;br /&gt;
Wenn diese Einstellung aktiviert ist, berechnet Bakery die Lichtquellen neu, die sich seit dem letzten Rendern nicht verändert haben. Falls Sie nur eine Lichtquelle anpassen und nicht warten möchten, bis alle anderen Lichtquellen neu gerendert werden, können Sie dieses Kontrollkästchen deaktivieren.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update modified lights and GI ===&lt;br /&gt;
Wenn diese Einstellung aktiviert ist, berechnet Bakery GI und die Lichter, die seit dem letzten Rendern geändert wurden, neu.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== UV padding: increase only ===&lt;br /&gt;
Nur sichtbar wenn [[#Asset_UV_Processing|Adjust UV padding]] aktiviert ist. Standardmäßig wird das optimale UV-Padding für ein Modell-Asset nur auf der Grundlage der aktuell geladenen Szenen berechnet. Falls mehrere Instanzen desselben Modells unterschiedliche Lightmap-Auflösungen verwenden, bestimmt die kleinste davon das Padding, sodass der Abstand zwischen den UV-Flächen groß genug ist, um ein Überlappen zu verhindern. Jedoch kann das Backen desselben Modells in zwei verschiedenen isolierten Szenen dazu führen, dass die UVs in den vorherigen Szenen beschädigt werden, während sie für die neue Szene optimiert werden. Dieses Kontrollkästchen verhindert ein solches Verhalten, indem es den Padding-Wert niemals verringert, sodass er immer für die Instanz mit der niedrigsten Auflösung optimiert wird, die jemals gebacken wurde.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoise: fix bright edges ===&lt;br /&gt;
[[File:Image19.png|thumb|Links: Nach der Rauschunterdrückung ist ein heller Rand sichtbar; Rechts: behoben.]]&lt;br /&gt;
Nur sichtbar wenn [[#Denoise|Denoise]] aktiviert ist. Manchmal kann das zur Rauschunterdrückung verwendete neuronale Netz helle Kanten um Schatten herum erzeugen, als wäre ein Schärfeeffekt angewendet worden. Wenn diese Option aktiviert ist, versucht Bakery, diese herauszufiltern. Die Denoising-Phase kann bei Aktivierung etwas langsamer werden.&lt;br /&gt;
&lt;br /&gt;
Diese Funktion kann auch zum Filtern von &amp;quot;fireflies&amp;quot; verwendet werden, d. h. gelegentlich auftretende helle Punkte auf der Lightmap.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Post-packing ===&lt;br /&gt;
Manchmal kann Bakery beim Rendern einer Szene die Lightmap in mehrere Sub-Lightmaps aufteilen, z. B. beim Backen verschiedener LODs oder Terrains.&lt;br /&gt;
Post-packing versucht, die endgültige Atlasanzahl zu minimieren, indem diese Sub-Lightmaps zu einer Textur kombiniert werden.&lt;br /&gt;
Es wird empfohlen, diese Einstellung aktiviert zu lassen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Combine with Enlighten real-time GI ===&lt;br /&gt;
Wenn diese Einstellung aktiviert ist, wird beim Klicken der Schaltfläche Render zunächst versucht, mit Enlighten zu backen, um Echtzeit-GI zu berechnen. Danach erfolgt der reguläre Bakery-Lightmapping-Prozess. Sowohl gebackene als auch Echtzeit-GI werden dann zusammen verwendet.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bake on remote server ===&lt;br /&gt;
Aktiviert [[Network baking|Backen über das Netzwerk]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Presets ===&lt;br /&gt;
Wird derzeit unter den Schaltflächen Render/Update angezeigt, wenn sich die Einstellungen im Experimental-Modus befinden.&lt;br /&gt;
* Klicken Sie auf '''New''', um alle aktuellen Einstellungen in einer Voreinstellungsdatei zu speichern.&lt;br /&gt;
* Standardmäßig sind alle Einstellungen ausgegraut, wenn eine Voreinstellung aktiv ist, um ein Überschreiben der Voreinstellung zu verhindern.&lt;br /&gt;
* Klicken Sie auf '''Modify preset''', um die Einstellungen zu ändern und die Voreinstellungsdatei zu überschreiben.&lt;br /&gt;
* Voreinstellungsdateien können über das Voreinstellungsfeld ausgetauscht werden. Deaktivieren Sie die Verwendung von Voreinstellungen, indem Sie die Einstellung auf None setzen.&lt;br /&gt;
&lt;br /&gt;
== Komponenten ==&lt;br /&gt;
=== Bakery Lightmap Group Selector ===&lt;br /&gt;
&lt;br /&gt;
Legt fest, welche '''Lightmap Group''' für das Objekt und alle seine untergeordneten Objekte verwendet werden soll.&lt;br /&gt;
Lightmap Group ist ein Begriff, den Bakery für eine Sammlung von Objekten verwendet, die sich eine Lightmap teilen. Groups haben Eigenschaften, die Bakery mitteilen, wie die Objekte gepackt werden sollen, welche Lichter sie beeinflussen sollen und ob das Ergebnis in eine Textur oder in Eckpunkte (Vertices) gebacken werden soll.&lt;br /&gt;
Standardmäßig werden alle statischen Objekte automatisch in mehrere Lightmap Groups (Atlas-Texturen) gepackt, sodass Sie sich keine Gedanken darüber machen müssen. Die manuelle Definition von Gruppen sollte nur für spezielle Zwecke verwendet werden - zum Beispiel:&lt;br /&gt;
* Markieren von Objekten, damit diese [[Vertex Lightmaps|Per-vertex Lightmaps]] statt Texturen verwenden.&lt;br /&gt;
* Backen einer Lightmap unter Verwendung exakter, nicht skalierter UVs, so wie sie in einer Modellierungssoftware vorhanden waren.&lt;br /&gt;
* Gruppierung bestimmter Bereiche des Levels, um eine einzige Lightmap zu verwenden und damit das Streaming von Ressourcen zu erleichtern oder um während der Laufzeit mittels Skripte zwischen verschiedenen gebackenen Beleuchtungen zu wechseln.&lt;br /&gt;
* Verwenden der Using Render Selected Groups-Schaltfläche, um nur gruppierte Objekte zu aktualisieren.&lt;br /&gt;
&lt;br /&gt;
Um eine Gruppe manuell zu definieren, müssen Sie ein '''Lightmap Group Assets''' erstellen - entweder über das Assets-&amp;gt;Create Menü, oder mithilfe der Create New-Schaltfläche auf der Komponente. Wenn die Schaltfläche Create New verwendet wurde, wird ein neues Asset mit folgenden Eigenschaften erstellt:&lt;br /&gt;
* Name: Name des zu erstellenden Lightmap Group Asset.&lt;br /&gt;
* Packing mode: Dieser Selektor definiert den Packmodus der Lightmap Group. Es gibt 3 Modi:&lt;br /&gt;
** Original UV: Das Objekt und seine untergeordneten Objekte werden mit unveränderten UVs gebacken. Packing wird nicht vorgenommen. Dies ist nützlich für Modelle, bei denen mehrere Meshes dasselbe bereits gepackte UV-Layout verwenden.&lt;br /&gt;
** Pack Atlas: Das Objekt und seine untergeordneten Objekte werden in einen eigenen Texturatlas gepackt. Vor Version 1.3 musste jedes packbare untergeordnete Objekt über die Komponente verfügen, aber das ist nun nicht mehr erforderlich. Jedes untergeordnete Objekt wird als eigenes Rechteck gepackt - es sei denn, Bakery erkennt automatisch, dass ein untergeordnetes Objekt nicht überlappende untergeordnete Objekte hat. In diesem Fall können mehrere Objekte ein einziges Rechteck verwenden.&lt;br /&gt;
** Vertex: Das Objekt und seine untergeordneten Objekte verwenden anstelle von Texturen eine vertex-farbige gebackene Beleuchtung. Beachten Sie, dass Sie dafür einen benutzerdefinierten Shader benötigen - beispielsweise den [[#Bakery_shaders|Bakery Shader]]. Ein einfacher Shader (&amp;quot;Bakery/Simple Vertex Lightmapped&amp;quot;) ist bereits zu Demonstrationszwecken und als Referenz enthalten. [[Vertex Lightmaps|Lernen Sie mehr über Vertex Lightmaps.]]&lt;br /&gt;
* Directional mode: Ermöglicht es Ihnen, den [[#Directional mode|Directional Mode]] für die Gruppe zu überschreiben. Die Optionen sind identisch - mit Ausnahme von Auto, das einfach die globale Einstellung verwendet.&lt;br /&gt;
* Resolution: Gewünschte Auflösung der Lightmap.&lt;br /&gt;
* Auto-resolution: [[Manual#Texels_per_unit|Texels Per Unit]] verwenden, um die nächstgelegene Zweierpotenz (power of two) zu bestimmen.&lt;br /&gt;
* Atlas packer: Zu verwendender [[Manual#Atlas_Packer|Atlas Packing]]-Algorithmus für diese Gruppe.&lt;br /&gt;
* Bitmask: Eine Liste von Umschaltflächen, die verwendet werden können, um bestimmte Lichtquellen von der Beeinflussung der Lightmap auszuschließen. Jede Bakery-Lichtquelle verfügt auch über eine Bitmask-Einstellung. Lichter wirken sich nur auf Lightmap Groups aus, mit denen sie mindestens eine dieser Umschaltflächen gemeinsam haben. Die Standardeinstellung bedeutet, dass alle Lichter alle Lightmaps beeinflussen können.&lt;br /&gt;
&lt;br /&gt;
[[File:Ts.jpg|thumb|Transparenter Selbstschatten AUS vs. EIN: Beachten Sie, wie einige einseitige, aber nach hinten gerichtete Polygone nun korrekt beleuchtet werden]]&lt;br /&gt;
&lt;br /&gt;
Falls Sie eine Lightmap Group mit einem ihr zugewiesenem Pack Atlas-Modus haben, werden zusätzliche Einstellungen auf der Komponente angezeigt:&lt;br /&gt;
* Override resolution: Überschreibt die Auflösung, die dieses Objekt und seine untergeordneten Objekte in der Lightmap einnehmen.&lt;br /&gt;
* Resolution: Manuell festgelegte Auflösung. Wenn Sie beispielsweise eine Lightmap mit einer Auflösung von 512 haben, die vier Objekten mit einer überschriebenen Auflösung von 256 zugewiesen ist, generiert Bakery eine einzige Lightmap mit einer Größe von 512x512, wobei jedes Objekt genau 256x256 Flächen einnimmt.&lt;br /&gt;
&lt;br /&gt;
Wenn Sie ein Lightmap Group Asset auswählen, werden zusätzliche experimentelle Einstellungen angezeigt:&lt;br /&gt;
* [[Subsurface scattering|Subsurface scattering: (Klicken, um mehr zu erfahren)]]&lt;br /&gt;
* Normal offset: Erlaubt es Ihnen, Strahlen von der Oberfläche zu versetzen. Dies ist selten nützlich und dient hauptsächlich zu Versuchszwecken.&lt;br /&gt;
* Transparent selfshadow: Strahlen hinter der Oberfläche werfen, damit diese keine Schatten auf sich selbst wirft. Kann z. B. für durchscheinendes Laub hilfreich sein.&lt;br /&gt;
* Vertex sampling density (nur wenn Packing Mode auf Vertex eingestellt ist): Standardmäßig berechnet das Per-Vertex-Backen nur 1 Wert für jeden Vertex. Falls die Abtastdichte über 0 ist, wird stattdessen der Durchschnitt vieler über Dreiecke verteilter Abtastwerte gebildet, was zu supersamplierten, glatteren Ergebnissen führt.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Lightmapped Prefab ===&lt;br /&gt;
Diese Komponente erlaubt Prefabs das Speichern von Lightmapping-Metadaten. Solche Prefabs können dann, sowohl im Editor als auch während der Laufzeit, in jeder Szene instanziiert werden.&lt;br /&gt;
Die Komponente sollte direkt zum Wurzelobjekt des Prefabs hinzugefügt werden. Verschachtelte Prefabs werden nicht unterstützt. Da das Prefab nach dem Backen überschrieben wird (genauso wie beim Klick auf die Schaltfläche “Apply”), darf das Prefab keine unangewendeten Änderungen enthalten (untergeordnete Objekte dürfen nicht verschoben werden, Materialien und Skriptparameter müssen unverändert bleiben usw). Sollten solche Änderungen erkannt werden, wird in der Benutzeroberfläche der Komponente eine Fehlermeldung angezeigt und nach dem Backen werden keine Metadaten gespeichert. Falls die Warnung zur [[#Warnings|Lightmapped prefab validation]] aktiviert ist, werden eventuell vorhandene Prefab-Fehler vor dem Backen in einem Dialogfeld angezeigt.&lt;br /&gt;
&lt;br /&gt;
Lightmapped Prefabs unterstützen alle Bakery-Funktionen, wie LODs, Terrains, Directional Lightmaps, RNM, SH, Per-Vertex-Modi und Shadowmasks. Damit Shadowmasks funktionieren, müssen Lichter ebenfalls Teil desselben Prefabs sein.&lt;br /&gt;
&lt;br /&gt;
{{note| Beachten Sie, dass Shadowmasks von Prefabs aufgrund von API-Einschränkungen nur mit Unity 2017.4 oder neuer funktionieren.}}&lt;br /&gt;
&lt;br /&gt;
Nach dem Backen wird ein Objekt namens “BakeryPrefabLightmapData” zum Prefab hinzugefügt. Dieses Objekt enthält ein Skript mit allen erforderlichen Daten zum Anwenden der Lightmaps.&lt;br /&gt;
&lt;br /&gt;
Darüber hinaus ermöglicht Lightmapped Prefab das Speichern der aktuellen Rendereinstellungen und das Laden dieser Einstellungen in jede derzeit geöffnete Szene mithilfe zweier Schaltflächen:&lt;br /&gt;
* Save current render settings to prefab: Speichert eine Kopie der aktuellen Rendereinstellungen auf dieses Prefab.&lt;br /&gt;
* Load render settings from prefab: Setzt die aktuellen Rendereinstellungen auf die vom Prefab gespeicherten Werte.&lt;br /&gt;
[[File:Upload 2019-9-17 10-32-34.png|thumb|Anwenden des Prefabs]]&lt;br /&gt;
Beim Backen eines Lightmapped Prefabs wird empfohlen, Folgendes zu überprüfen:&lt;br /&gt;
* Das Prefab wurde &amp;quot;Angewendet&amp;quot;. Klicken Sie hierfür bei älteren Unity Versionen auf die Schaltfläche &amp;quot;Apply&amp;quot; in der oberen rechten Ecke des Inspector. Bei neueren Versionen klicken Sie stattdessen auf die &amp;quot;Overrides&amp;quot;-Dropdown-Liste und dann auf &amp;quot;Apply all&amp;quot;.&lt;br /&gt;
* Die Prefab-Komponenten UI zeigt keine Fehler an.&lt;br /&gt;
* Das &amp;quot;Lightmapped prefab validation&amp;quot;-Kontrollkästchen wurde im Hauptfenster von Bakery aktiviert. Diese Einstellung überprüft alle Lightmapped Prefabs in der Szene und benachrichtigt Sie über mögliche Probleme in einem Dialogfeld.&lt;br /&gt;
&lt;br /&gt;
{{note| Lightmaps werden entweder nach der Szene, in der sie gebacken wurden, oder nach der Lightmap Group (falls vorhanden) benannt. Wenn Sie also verschiedene Prefabs in derselben Szene backen, stellen Sie bitte sicher, dass Sie entweder eine anders benannte [[Manual#Bakery_Lightmap_Group_Selector|Lightmap Group]] verwenden oder den [[Manual#Output_path|Output Path]] ändern.}}&lt;br /&gt;
&lt;br /&gt;
{{note| Beim nacheinander Backen von mehreren Prefabs mit identischen Modellen wird empfohlen, die Einstellung [[Manual#Asset_UV_Processing|Asset UV Processing]] auf ''Don't Change'' zu belassen, um eine Veränderung gemeinsam genutzter UVs zu verhindern.}}&lt;br /&gt;
&lt;br /&gt;
{{note| Bakery's Prefab-Workflow wurde implementiert, bevor Unity über die Ansichtsfunktion &amp;quot;Doppelklick auf Prefab&amp;quot; verfügte. Daher werden Lightmaps in der isolierten Prefab-Ansicht möglicherweise nicht korrekt angewendet und die Komponente zeigt möglicherweise die Meldung &amp;quot;This GameObject is not a prefab&amp;quot; an. Es sollte wie erwartet funktionieren, wenn Sie in einer normalen Szene arbeiten.}}&lt;br /&gt;
&lt;br /&gt;
{{note| Wenn Sie zuvor gebackene Prefabs entpacken und von vorhandenen Lightmaps trennen, sollten Sie sicherstellen, dass das BakeryPrefabLightmapData-Objekt, welches die Prefab-weiten Lightmap-/Renderer-Verbindungen enthält, entfernt wurde.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Direct Light ===&lt;br /&gt;
[[File:Directlight.jpg|thumb|Reines direktes Licht mit GI]]&lt;br /&gt;
[[File:Image4.png|thumb|Links: shadow spread = 0.01, rechts: 0.05. Beachten Sie, wie Schatten zunächst scharf sind und mit zunehmender Entfernung allmählich verschwimmen.]]&lt;br /&gt;
Unendliches direktes Licht (z. B. eine Sonne).&lt;br /&gt;
* Color: Farbe.&lt;br /&gt;
* Intensity: Linearer Farbmultiplikator.&lt;br /&gt;
* Shadow spread: Größe der Lichtquelle oder, einfacher ausgedrückt, Unschärfe des Schattens. 0 = maximal scharfe Schatten, 1 = maximal unscharfe Schatten. Technisch gesehen wird hier von einem einzelnen Strahl zu einem breiteren Strahlenkegel interpoliert.&lt;br /&gt;
* Shadow samples: Beeinflusst die Qualität der Schatten. Je kleiner der Wert für Shadow spread ist, desto weniger Samples sind für ein sauberes Bild erforderlich. Für Sonnenschatten liegen die typischen Werte zwischen 1 und 16. Das Setzen der Samples auf 0 deaktiviert das Werfen von Schatten für dieses Licht.&lt;br /&gt;
* Bitmask: Eine Liste von Umschaltflächen, mit denen diese Lichtquelle davon ausgeschlossen werden kann, bestimmte Lightmap Groups zu beeinflussen.&lt;br /&gt;
* Baked contribution: Legt fest, welche Art von Beleuchtungsdaten gebacken werden sollen. Nur sichtbar im Indirect- oder Shadowmask-Modus. Mögliche Werte:&lt;br /&gt;
** Direct and Indirect: Es wird sowohl die direkte, als auch indirekte Beleuchtung vollständig gebacken.&lt;br /&gt;
** Indirect only: Ein Echtzeit-Licht soll einen direkten Beitrag leisten; nur indirekte Beleuchtung wird gebacken.&lt;br /&gt;
** Shadowmask and indirect: Ein Echtzeit-Licht soll einen direkten Beitrag leisten, aber Schatten von statischer Geometrie werden in eine separate Map gebacken. Dynamische und statische Schatten werden miteinander gemischt. Indirekte Beleuchtung wird wie gewohnt gebacken.&lt;br /&gt;
** Direct, Indirect, Shadowmask (nur benutzerdefinierte Beleuchtung): Wie Direct und Indirect, jedoch wird zusätzlich eine Shadowmask erzeugt und für die Verwendung mit benutzerdefinierten Shadern zugewiesen.&lt;br /&gt;
* Denoise shadowmask: Legt fest, ob Denoising auf die Shadowmask dieses Lichts angewendet werden soll. Normalerweise ist dies nicht notwendig, da Schatten in der Regel nicht viel Rauschen aufweisen, aber es kann bei sehr breiten, unscharfen Schatten (großer Shadow spread) hilfreich sein.&lt;br /&gt;
* Indirect intensity: Nicht-physikalischer GI-Multiplikator für dieses Licht. Sollte für eine natürliche Beleuchtung auf 1 eingestellt sein, kann jedoch für stilisiertere Szenen angepasst werden.&lt;br /&gt;
* Anti-alias: Führt Supersampling für den Schatten durch.&lt;br /&gt;
* Texture projection: Projiziert eine multiplikative gekachelte Textur über die Beleuchtung. Kann verwendet werden, um entfernte Wolkenschatten zu simulieren.&lt;br /&gt;
Wenn Texture projection aktiviert ist, kann ihre Skalierung/Verschiebung über die Felder &amp;quot;Tiling&amp;quot; und &amp;quot;Offset&amp;quot; angepasst werden. Alternativ können Sie auf &amp;quot;Tweak projection in Scene View&amp;quot; klicken und die Projektion mit einem zusätzlichen Gizmo visuell verschieben und skalieren. Mit dem Klick auf &amp;quot;Render reference frame&amp;quot; können Sie eine Referenz-PNG-Datei aus der &amp;quot;Perspektive des Lichts&amp;quot; speichern. Dies ist nützlich, um Wolkenschatten über die Szene zu malen.&lt;br /&gt;
&lt;br /&gt;
Sollten für dasselbe GameObject sowohl die Unity- als auch die Bakery-Lichtquelle aktiviert sein, und beide nicht miteinander übereinstimmen, werden zwei Schaltflächen angezeigt:&lt;br /&gt;
* Match lightmapped to real-time: Kopiert allgemeine Einstellungen vom Unity Light zum Bakery Light.&lt;br /&gt;
* Match real-time to lightmapped: Kopiert allgemeine Einstellungen vom Bakery Light zum Unity Light.&lt;br /&gt;
&lt;br /&gt;
{{note| Physikalisch gesehen ist Bakery's &amp;quot;Intensity&amp;quot; für gerichtete Lichtquellen Lux geteilt durch Pi.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Sky Light ===&lt;br /&gt;
[[File:Skylight.jpg|thumb|Reines Himmelslicht mit GI]]&lt;br /&gt;
Unendliches, schattenwerfendes Umgebungslicht (Himmel).&lt;br /&gt;
* Color: Farbe.&lt;br /&gt;
* Intensity: Linearer Farbmultiplikator.&lt;br /&gt;
* Sky texture: Optionales Cubemap-Asset, z. B. ein HDRI-Panorama, um die Lichtfarben aus unterschiedlichen Richtungen zu beeinflussen.&lt;br /&gt;
{{note| Durch Drehen des GameObject wird die Beleuchtung aus der Cubemap entsprechend mitgedreht.}}&lt;br /&gt;
* Samples: Beeinflusst die Qualität der Schatten. Typische Werte liegen zwischen 8 und 32.&lt;br /&gt;
* Hemispherical: Wenn aktiviert, kommt das Licht nur von oben (obere Hemisphäre). Andernfalls kommt es aus allen Richtungen.&lt;br /&gt;
* Bitmask: Eine Liste von Umschaltflächen, mit denen diese Lichtquelle davon ausgeschlossen werden kann, bestimmte Lightmap Groups zu beeinflussen.&lt;br /&gt;
* Baked contribution: Legt fest, welche Art von Beleuchtungsdaten gebacken werden sollen. Nur sichtbar im Indirect- oder Shadowmask-Modus. Mögliche Werte:&lt;br /&gt;
** Direct and Indirect: Es wird sowohl die direkte, als auch indirekte Beleuchtung vollständig gebacken. Dies ist das Standardverhalten und wird für alle Sky Lights empfohlen, da es keine Echtzeitvariante gibt, um sie in Unity zu emulieren.&lt;br /&gt;
** Indirect only: Ein Echtzeit-Licht soll einen direkten Beitrag leisten; nur indirekte Beleuchtung wird gebacken.&lt;br /&gt;
&lt;br /&gt;
Sollten die Einstellungen für das Himmelslicht und die aktuelle Skybox nicht übereinstimmen, werden zwei Schaltflächen angezeigt:&lt;br /&gt;
* Match this light to scene skybox: Kopiert die allgemeinen Einstellungen vom aktiven Skybox-Material zum Bakery Sky Light. Derzeit können nur Skyboxen, die mit den Shadern “Skybox/Cubemap” oder “Skybox/Bakery skybox” ausgestattet sind, abgeglichen werden.&lt;br /&gt;
* Match scene skybox to this light: Kopiert die allgemeinen Einstellungen vom Bakery Sky Light zur Szenen-Skybox.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bakery Light Mesh ===&lt;br /&gt;
[[File:Image29.png|thumb|Links: Samples Near = 0, Samples Far = 4096.&amp;lt;br&amp;gt;&lt;br /&gt;
Mitte: Samples Near = 0, Samples Far = 128.&amp;lt;br&amp;gt;&lt;br /&gt;
Rechts: Samples Near = 16, Samples Far = 128.&amp;lt;br&amp;gt;&lt;br /&gt;
Beachten Sie, wie ähnlich das Erscheinungsbild der Beleuchtung ist, obwohl weniger kombinierte Samples verwendet werden.]]&lt;br /&gt;
Emissives Mesh beliebiger Form. Sollte zusammen mit der Mesh Renderer-Komponente oder mit einer Light-Komponente, die auf Area eingestellt ist, verwendet werden.&lt;br /&gt;
* Color: Farbe.&lt;br /&gt;
* Intensity: Linearer Farbmultiplikator.&lt;br /&gt;
* Cutoff: Maximale Lichtdistanz. Bakery wird zusätzlich den invers-quadratischen Lichtabfall nahe der Grenze abmindern. Dies funktioniert am besten, wenn der Cutoff-Wert genau dort liegt, wo der physikalische Abfall sehr schwach wird. Cutoff kann die Backleistung verbessern, aber Sie können ihn für vollständige Korrektheit auch auf einen sehr hohen (unerreichbaren) Wert einstellen.&lt;br /&gt;
* Self Shadow: Legt fest, ob das Light Mesh selbst Schatten wirft. Diese Einstellung verwendet einen präziseren Beleuchtungsalgorithmus.&lt;br /&gt;
* Samples Near: Beeinflusst die Beleuchtungsqualität in der Nähe des Meshes. Typische Werte liegen zwischen 16 und 64. Diese Einstellung ist nur verfügbar, wenn Self Shadow aktiviert ist.&lt;br /&gt;
* Samples Far: Beeinflusst die Beleuchtungsqualität in der Entfernung vom Mesh. Typische Werte liegen zwischen 4 und 4096.&lt;br /&gt;
&lt;br /&gt;
Bakery verwendet zwei verschiedene Algorithmen für Area Lights, basierend auf der Nähe der zu emittierenden Oberfläche. In der unmittelbaren Nähe der Lichtquelle funktioniert es ähnlich wie der GI-Algorithmus, während das Licht in der Ferne eher als eine Wolke virtueller Punktlichter approximiert wird.&lt;br /&gt;
&lt;br /&gt;
{{note| &amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;Light Meshes erhalten keine eigene Beleuchtung und werden auch nicht ge-lightmapped.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Ein Light Mesh mit vielen Polygonen kann schneller gebacken werden als viele einfache Light Meshes.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Versuchen Sie, den Wert von Samples Near auf 0 zu setzen, falls Sie unscharfe/verrauschte Ergebnisse erhalten. Dann wird nur der Virtual Point Lights-Algorithmus angewendet. Dieser ist auch nützlich bei der Nutzung sehr einfacher Lichter, wo Präzision nicht so wichtig ist (z. B. Fensterlichter an Gebäuden).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;}}&lt;br /&gt;
[[File:Dd99d-QU0AEKFBK.jpg|thumb|Ein gebogenes Light Mesh]]&lt;br /&gt;
* Bitmask: Eine Liste von Umschaltflächen, mit denen diese Lichtquelle davon ausgeschlossen werden kann, bestimmte Lightmap Groups zu beeinflussen.&lt;br /&gt;
* Baked contribution: Legt fest, welche Art von Beleuchtungsdaten gebacken werden sollen. Nur sichtbar im Indirect- oder Shadowmask-Modus. Mögliche Werte:&lt;br /&gt;
** Direct and Indirect: Es wird sowohl die direkte, als auch indirekte Beleuchtung vollständig gebacken. Dies ist das Standardverhalten und wird für alle Light Meshes empfohlen, da es keine Echtzeitvariante gibt, um sie in Unity zu emulieren.&lt;br /&gt;
** Indirect only: Ein Echtzeit-Licht soll einen direkten Beitrag leisten; nur indirekte Beleuchtung wird gebacken.&lt;br /&gt;
** Shadowmask and Indirect: Ein Echtzeit-Licht soll einen direkten Beitrag leisten, aber Schatten von statischer Geometrie werden in eine separate Map gebacken. Dynamische und statische Schatten werden miteinander gemischt. Indirekte Beleuchtung wird wie gewohnt gebacken. Derzeit unterstützen nur die HDRP (und benutzerdefinierte Renderer) gemischte Area Lights.&lt;br /&gt;
** Direct, Indirect, Shadowmask (nur benutzerdefinierte Beleuchtung): Wie Direct und Indirect, jedoch wird zusätzlich eine Shadowmask erzeugt und für die Verwendung mit benutzerdefinierten Shadern zugewiesen.&lt;br /&gt;
* Indirect intensity: Nicht-physikalischer GI-Multiplikator für dieses Licht. Sollte für eine natürliche Beleuchtung auf 1 eingestellt sein, kann jedoch für stilisiertere Szenen angepasst werden.&lt;br /&gt;
* Shadowmask with falloff: Backt den vollständigen Lichtabfall in die Shadowmask ein (nur nützlich bei Verwendung mit benutzerdefinierten Shadern).&lt;br /&gt;
&lt;br /&gt;
Sollten das Material des Meshes und die Lichteinstellungen nicht übereinstimmen, werden zwei Schaltflächen angezeigt:&lt;br /&gt;
* Match light to material: Kopiert die allgemeinen Einstellungen vom unbeleuchteten Material des Meshes oder Area Light zum Bakery Light Mesh.&lt;br /&gt;
* Match material to light: Kopiert die allgemeinen Einstellungen vom Bakery Light Mesh zum unbeleuchteten Material des Meshes oder Area Light.&lt;br /&gt;
&lt;br /&gt;
==== Unterschiede zwischen Light Mesh und emissive Materialien ====&lt;br /&gt;
Emissives Material:&lt;br /&gt;
* Verbreitet Licht während der GI-Berechnung und ist dadurch “kostenlos” - unabhängig davon, wie viele Meshes emissiv sind.&lt;br /&gt;
* Kleine und helle Lichter können, je nach Anzahl des GI sample count, zu ungenauen und verrauschten Ergebnissen führen.&lt;br /&gt;
* Muss aufgrund der Funktionsweise von GI in Bakery Platz in der Lightmap einnehmen, wodurch möglicherweise Platz verschwendet wird. Das bedeutet wiederum auch, dass emissive Objekte gültige UVs benötigen und die Einstellung “Cast shadows” aktiviert sein muss.&lt;br /&gt;
&lt;br /&gt;
Light Mesh:&lt;br /&gt;
* Die Beleuchtung wird für jedes Licht einzeln berechnet und ist daher langsamer als bei emissiven Materialien.&lt;br /&gt;
* Entwickelt, um auch bei kleinen und hellen Lichtquellen, selbst wenn diese sehr weit entfernt sind, saubere Ergebnisse zu erzielen.&lt;br /&gt;
* Nimmt keinen Platz in Lightmaps ein.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Point Light ===&lt;br /&gt;
[[File:Image11.png|thumb|Links: Shadow Spread = 0.5, rechts: Shadow Spread = 1.]]&lt;br /&gt;
Punktlicht, hat keine Fläche. Trotz physikalischer Unmöglichkeit ist es für Spiele nützlich und die einzige Möglichkeit, die Punkt- und Spotlichter von Unity nachzubilden.&lt;br /&gt;
{{note| Spotlichter sind lediglich Punktlichter mit einer zusätzlichen Projektionsmaske.}}&lt;br /&gt;
* Color: Farbe.&lt;br /&gt;
* Intensity: Linearer Farbmultiplikator.&lt;br /&gt;
* Shadow spread: Unschärfe des Schattens. Obwohl Punktlichter keine Fläche besitzen, ist es dennoch oft wünschenswert, von ihnen geworfene, unscharfe Schatten zu bekommen. Zu diesem Zweck werden Schatten so simuliert, als würden sie von einer kugelförmigen Flächenlichtquelle geworfen. Dieser Parameter definiert den Radius einer solchen virtuellen Kugel, was sich direkt auf die Unschärfe auswirkt.&lt;br /&gt;
* Physical falloff: Wenn aktiviert, wird der korrekte invers-quadratische Lichtabfall mit zusätzlicher Abschwächung nahe der Grenze verwendet. Andernfalls wird versucht, den Lichtabfall von Unity nachzuahmen.&lt;br /&gt;
* Falloff min size: Mehr dazu im Artikel [[Point Light Attenuation]].&lt;br /&gt;
* Range: Wenn Physical falloff deaktiviert ist, entspricht dies der Lichtreichweite von Unity. Ist es aktiviert, wird der physikalische Lichtabfall an den Rändern nur leicht abgeschwächt.&lt;br /&gt;
* Samples: Beeinflusst die Qualität der Schatten. Typische Werte liegen zwischen 1 und 512. Das Setzen der Samples auf 0 deaktiviert das Werfen von Schatten für dieses Licht.&lt;br /&gt;
[[File:Image10.png|thumb|Von links nach rechts: Omni, Cookie (default spot texture), Cubemap, IES.]]&lt;br /&gt;
* Projection mask: Art der Maske/des Cookie. Optionen:&lt;br /&gt;
** Omni: keine Maske, vergleichbar mit Unity’s Point Light.&lt;br /&gt;
** Cookie: Projektion einer Cookie-Textur. Zusätzliche Optionen:&lt;br /&gt;
*** Cookie texture: 2D Textur Asset. Bakery enthält die ursprüngliche Spot Light-Textur von Unity (unter dem Namen ftUnitySpotTexture), die Sie zur Nachahmung verwenden können.&lt;br /&gt;
*** Angle: Texturprojektionswinkel (ähnelt Unity’s Spot Light).&lt;br /&gt;
*** Correct distortion: Korrigiert Verzerrungen von Cookies, die bei einer Weitwinkelbetrachtung auf geraden Linien sichtbar sind.&lt;br /&gt;
** Cubemap: Cubemap-Cookie-Projektion. Zusätzliche Optionen:&lt;br /&gt;
*** Projected cubemap: Cubemap Asset.&lt;br /&gt;
** IES: Beleuchtung wird durch Daten aus einer IES-Datei moduliert. Zusätzliche Optionen:&lt;br /&gt;
*** IES file: Datei mit .ies-Endung.&lt;br /&gt;
* Bitmask: Eine Liste von Umschaltflächen, mit denen diese Lichtquelle davon ausgeschlossen werden kann, bestimmte Lightmap Groups zu beeinflussen.&lt;br /&gt;
* Baked contribution: Legt fest, welche Art von Beleuchtungsdaten gebacken werden sollen. Nur sichtbar im Indirect- oder Shadowmask-Modus. Mögliche Werte:&lt;br /&gt;
** Direct and Indirect: Es wird sowohl die direkte, als auch indirekte Beleuchtung vollständig gebacken.&lt;br /&gt;
** Indirect only: Ein Echtzeit-Licht soll einen direkten Beitrag leisten; nur indirekte Beleuchtung wird gebacken.&lt;br /&gt;
** Shadowmask and Indirect: Ein Echtzeit-Licht soll einen direkten Beitrag leisten, aber Schatten von statischer Geometrie werden in eine separate Map gebacken. Dynamische und statische Schatten werden miteinander gemischt. Indirekte Beleuchtung wird wie gewohnt gebacken.&lt;br /&gt;
** Direct, Indirect, Shadowmask (nur benutzerdefinierte Beleuchtung): Wie Direct und Indirect, jedoch wird zusätzlich eine Shadowmask erzeugt und für die Verwendung mit benutzerdefinierten Shadern zugewiesen.&lt;br /&gt;
* Indirect intensity: Nicht-physikalischer GI-Multiplikator für dieses Licht. Sollte für eine natürliche Beleuchtung auf 1 eingestellt sein, kann jedoch für stilisiertere Szenen angepasst werden.&lt;br /&gt;
* Shadowmask with falloff: Backt den vollständigen Lichtabfall (Distanz ausgenommen) in die Shadowmask ein (nur nützlich bei Verwendung mit benutzerdefinierten Shadern).&lt;br /&gt;
* Legacy sampling: Verwende Bakery's ursprüngliche, stärker verzerrte Schattenabtastungsstrategie. Erzeugt rauschfreie Schatten, aber breite Halbschatten können Streifenbildung aufweisen. Wenn diese Option deaktiviert ist, wird eine unverzerrte, aber mehr mit Rausch behaftete Technik verwendet.&lt;br /&gt;
&lt;br /&gt;
Sollten für dasselbe GameObject sowohl die Unity- als auch die Bakery-Lichtquelle aktiviert sein, und beide nicht miteinander übereinstimmen, werden zwei Schaltflächen angezeigt:&lt;br /&gt;
* Match lightmapped to real-time: Kopiert allgemeine Einstellungen vom Unity Light zum Bakery Light.&lt;br /&gt;
* Match real-time to lightmapped: Kopiert allgemeine Einstellungen vom Bakery Light zum Unity Light.&lt;br /&gt;
&lt;br /&gt;
{{note| Physikalisch gesehen ist Bakery's &amp;quot;Intensity&amp;quot; für Punktlichter (Candela/Pi).}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Volume ===&lt;br /&gt;
[[File:Voldemo notlonely.gif|Eine bewegliche Schranktür wird durch ein Bakery Volume beleuchtet (GIF von NOTLonely)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Volumes generieren 3D-Texturen, die Light Probes pro Voxel speichern (sphärische Harmonische der Ordnung L1 und Shadowmasks), wodurch sie einen geeigneten Ersatz für reguläre Unity Light Probes darstellen.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Unity Light Probes&lt;br /&gt;
! Unity LPPV&lt;br /&gt;
! Bakery Volumes&lt;br /&gt;
|-&lt;br /&gt;
| Manuelles Platzieren einzelner Probes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Nein&lt;br /&gt;
|-&lt;br /&gt;
| Interpolieren mehrerer Probes auf einem Objekt&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|-&lt;br /&gt;
| Ist während der Laufzeit verschiebbar&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|-&lt;br /&gt;
| Kann in ein Prefab platziert werden&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|-&lt;br /&gt;
| Vollständige Scripting-API verfügbar&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|-&lt;br /&gt;
| Ringing&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Möglich&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Möglich&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Behoben&lt;br /&gt;
|-&lt;br /&gt;
| Denoising&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|-&lt;br /&gt;
| Laufzeit-Overhead&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | CPU: niedrig; GPU: niedrig.&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | CPU: mittel; GPU: mittel.&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#e4ead3;&amp;quot; | CPU: kein; GPU: mittel.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bakery Volume ist eine Begrenzungsbox, die mit einer Reihe von 3D-Texturen (3 SH-Texturen und bei Bedarf eine Shadowmask) verknüpft ist, wodurch sie sehr einfach zu verwenden und mit Skripten zu modifizieren ist. Volumes können während der Laufzeit ganz einfach ausgetauscht, verschoben, geladen oder entladen oder mit Prefabs verknüpft werden. Sie benötigen außerdem keine Light Probe Groups und die manuelle Platzierung von Probes entfällt; das gesamte Volumen wird stattdessen mit einem einheitlichen Raster aus Voxel-Probes gefüllt. Light/Shadow leaking wird automatisch auf die gleiche Weise behoben wie bei Lightmaps (dünne doppelseitige Wände können jedoch bei großen Voxelgrößen ein Problem darstellen, was jedoch durch die Verwendung unterschiedlicher Volumes auf verschiedenen Seiten vermieden werden kann). Aufgrund der einheitlichen Beschaffenheit von Voxel-Rastern ist es auch möglich, ein Lightmap-ähnliches Denoising auf sie anzuwenden, was bei normalen Light Probes nicht machbar ist. Zusätzlich verwenden Bakery Shaders den [https://drive.google.com/file/d/1MK6Clw93q8ljijRjb4gQOzzaIjn1uF9Y/view Geomerics Sampling-Trick], um &amp;quot;Ringing&amp;quot;-Artefakte, die von sphärischen Harmonischen manchmal bei kontrastreicher HDR-Beleuchtung erzeugt werden, vollständig zu beseitigen.&lt;br /&gt;
&lt;br /&gt;
Dadurch können Volumes eine saubere, detaillierte und hochwertige gebackene Beleuchtung für dynamische Objekte erzeugen (d. h. Beleuchtung, die von statischen Objekten ausgeht und sich auf dynamische Objekte auswirkt, nicht umgekehrt).&lt;br /&gt;
&lt;br /&gt;
Der einzige Nachteil des Volumes-Ansatzes sind die höheren Shading-Kosten pro Pixel. Die Kosten sind ähnlich wie bei LPPV (Skalierung mit der Anzahl der schattierten, vom Volumen betroffenen, Pixel auf dem Bildschirm), aber im Gegensatz zu LPPV werden die Volumen selbst nach dem Backen nicht mehr aktualisiert. Das Mischen mehrerer Volumen kann vermieden werden, indem man sie leicht überlappen lässt.&lt;br /&gt;
&lt;br /&gt;
====Einstellen der Volume Transform====&lt;br /&gt;
[[File:Bvolgizmo.jpg|thumb|Volume Gizmo]]&lt;br /&gt;
Wenn Bakery Volume zu einem GameObject hinzugefügt wird, erscheint in der Szenenansicht ein Begrenzungsrahmen-Gizmo. Durch das Ziehen an den kleinen Quadraten wird es skaliert.&lt;br /&gt;
Es gibt noch andere Möglichkeiten, wie man die Größe und Position der Volume ändern kann:&lt;br /&gt;
* Ziehen Sie ein beliebiges, renderbares GameObject in das Feld &amp;quot;Wrap to object&amp;quot;. Dadurch umschließt das Volume dieses Objekt (und seine untergeordneten Elemente) und ummantelt es.&lt;br /&gt;
* Wenn demselben Objekt ein Box Collider hinzugefügt wurde, werden die Schaltflächen &amp;quot;Set from box collider&amp;quot; und &amp;quot;Set to box collider&amp;quot; angezeigt. Diese können verwendet werden, um Werte schnell zwischen Volume/Collider zu kopieren.&lt;br /&gt;
&lt;br /&gt;
====Auflösung====&lt;br /&gt;
Wenn &amp;quot;Adaptive resolution&amp;quot; aktiviert ist, wird die Anzahl der Voxel durch die &amp;quot;Voxels per unit&amp;quot;-Angabe bestimmt. Durch Deaktivieren kann die Auflösung manuell eingegeben werden. Bei den meisten Spielen mit 1 Einheit = 1 Meter ist 2 ein angemessener Wert für &amp;quot;Voxels per unit&amp;quot;, aber es gibt Fälle (z. B. dynamische Türen), in denen die Verwendung eines kleineren Volumes mit höherer Auflösung vorteilhafter ist.&lt;br /&gt;
&lt;br /&gt;
====Andere Einstellungen====&lt;br /&gt;
* Enable baking: Soll die Volume (neu) berechnet werden? Deaktivieren, um das Überschreiben vorhandener Daten zu verhindern.&lt;br /&gt;
* Denoise: Wende Denoising nach dem Backen der Volume an. Empfohlen für hochauflösende Volumes. Vermeiden Sie die Verwendung der Einstellung bei Volumes mit sehr niedriger Auflösung, die viele Lichter abdecken, da es für den Denoiser schwierig sein wird, den tatsächlichen Inhalt von Rauschen unterscheiden zu können.&lt;br /&gt;
* Global: Weist diese Volume automatisch allen kompatiblen Shadern zu, sofern diese keine Überschreibungen enthalten. Intern ruft es den Befehl Shader.SetGlobalTexture()/SetGlobalVector() auf.&lt;br /&gt;
&lt;br /&gt;
====Benutzung====&lt;br /&gt;
Volumes können mithilfe eines Volume-bewussten Shaders Objekten zugewiesen werden. Bakery wird mit dem &amp;quot;Bakery Standard&amp;quot;-Shader, der Volumes bereits implementiert hat, sowie mit HDRP- und URP-Graphen geliefert. Sehen Sie sich die example_volumes Szenen an, um verschiedene Anwendungsmöglichkeiten einer Volume zu entdecken.&lt;br /&gt;
&lt;br /&gt;
====Hinweise und Tipps====&lt;br /&gt;
* Sehen Sie sich unbedingt die Beispiele an.&lt;br /&gt;
* Falls sich zwei Volumes berühren, lassen Sie sie ein wenig überlappen. Die Größe der Überlappung sollte der Größe des größten dynamischen Objekts entsprechen. Auf diese Weise funktioniert das einfache Wechseln zwischen Volumes nach Bedarf.&lt;br /&gt;
* Platzieren Sie Volumes nur in Bereichen, die dynamische Objekte tatsächlich erreichen können. Verwenden Sie zum Beispiel die Spielerhöhe, um die Höhe der Volume zu begrenzen.&lt;br /&gt;
&lt;br /&gt;
====Drehen von Volumes====&lt;br /&gt;
Volumes können um die Y-Achse gedreht werden, sofern die Einstellung &amp;quot;Rotate around Y&amp;quot; aktiviert ist. Die Drehung ist sehr ressourcenschonend und verwendet nur 2 zusätzliche Daten-Floats (vorberechnete Sinus-/Kosinuswerte des Winkels).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Es gibt eine zusätzliche Option zum Drehen von Volumes während der Laufzeit (unter Experimental -&amp;gt; &amp;quot;Support rotation after bake&amp;quot; und eine ähnliche Einstellung im Bakery Shader). In diesem Fall müssen sie ohne anfängliche Drehung gebacken werden.&lt;br /&gt;
&lt;br /&gt;
In der URP kann solch eine dynamische Drehung mithilfe von BakeryURPVolumeGraphRotatable.shadergraph genutzt werden.&lt;br /&gt;
&lt;br /&gt;
Für globale Volumes wird die dynamische Drehung aktualisiert, wenn die Komponente (wieder) aktiviert oder volume.SetGlobalParams() aufgerufen wird. Bei der Nutzung von lokal gedrehten Volumen ist die manuelle Einstellung der Drehung im Material oder im MaterialPropertyBlock erforderlich:&lt;br /&gt;
{{code|&amp;lt;nowiki&amp;gt;SetMatrix(&amp;quot;_VolumeMatrix&amp;quot;, volume.GetMatrix())&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
====Technische Informationen====&lt;br /&gt;
Volumes können automatisch funktionieren (siehe Beispielszenen), aber es ist auch möglich, ihre Wirkweise per Skript zu steuern.&lt;br /&gt;
&lt;br /&gt;
Volumedaten können über diese öffentlichen Eigenschaften aus der Komponente abgerufen werden:&lt;br /&gt;
* bakedTexture0: Speichert L0-RGB-Koeffizienten und den L1-Z-Rotkanal in den Alphakanal.&lt;br /&gt;
* bakedTexture1: Speichert L1-X-RGB-Koeffizienten und den L1-Z-Grünkanal in den Alphakanal.&lt;br /&gt;
* bakedTexture2: Speichert L1-Y-RGB-Koeffizienten und den L1-Z-Blaukanal in den Alphakanal.&lt;br /&gt;
* bakedMask: Speichert die volumetrische Shadowmask.&lt;br /&gt;
* bounds: Die Begrenzungsbox der Volume.&lt;br /&gt;
&lt;br /&gt;
Alle bakedTexture*-Maps nutzen das RGBAHalf (8 Bytes pro Voxel) Format, während die Shadowmask das Format ARGB32 (4 Bytes pro Voxel) verwendet. Alternativ kann für die Shadowmask auch das Single-channel R8 Format (1 Byte pro Voxel) verwendet werden.&lt;br /&gt;
&lt;br /&gt;
Daher gilt: volume byte size = width*height*depth*3*8 + (nur wenn die Shadowmask verwendet wird) width*height*depth*4 (oder width*height*depth bei einer R8 Shadowmask).&lt;br /&gt;
&lt;br /&gt;
[[Manual#Compress_volumes|Texture compression]] kann für Volumes aktiviert werden, um diese deutlich zu verkleinern.&lt;br /&gt;
&lt;br /&gt;
Zum Samplen von Volumes werden spezielle Shader benötigt, die in Bakery bereits enthalten sind. Um einem benutzerdefinierten Shader Volumes-Funktionen hinzuzufügen, überprüfen Sie bitte die Funktion BakeryVolume_float() in der Datei BakeryDecodeLightmap.hlsl, die in den HDRP/URP-Paketen enthalten ist.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Light Filter ===&lt;br /&gt;
[[File:Output optimized.gif|Buntglas, wie es durch Bakery Real-Time Preview gesehen wird. Die gleichen Ergebnisse werden vom Bakery lightmapper gebacken.]]&lt;br /&gt;
&lt;br /&gt;
Markiert einen Renderer als Light Filter. Light Filter färben alle direkten/indirekten Strahlen mit ihrer Farbe, ähnlich wie optische Filter im realen Leben, wodurch farbige Transparenzen (z. B. Buntglas) entstehen. Der einzige Parameter ist die, für die Tönung, verwendete Textur.&lt;br /&gt;
* Objekte mit Light Filter erhalten weiterhin wie alle anderen Objekte auch Lightmaps.&lt;br /&gt;
* Filter streuen/verwischen keine Strahlen (nutzen Sie hierfür [[Subsurface_scattering|Subsurface Scattering]] oder [[Manual#Backface_GI|Backface GI]]).&lt;br /&gt;
* Filter können farbige Schatten erzeugen. Wenn für das Licht ein [[Manual#Shadowmask|Shadowmask]]-Modus verwendet wird, wird nur der R-Kanal des Ergebnisses gespeichert (da Unity nur einkanalige Masken unterstützt). Für vollständig gebackene Schatten gibt es keine Einschränkungen.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Sector ===&lt;br /&gt;
Lesen Sie den Artikel '''[[Partial_scene_baking|Partial scene baking]]''' für weitere Informationen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Always Render ===&lt;br /&gt;
Wenn dies zu einem Objekt hinzugefügt wird, berücksichtigt Bakery es beim Backen immer, auch wenn sein Renderer deaktiviert ist.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Pack As Single Square ===&lt;br /&gt;
Wenn dies zu einem Objekt hinzugefügt wird, behandelt Bakery die UVs dieses Objekts und die UVs seiner untergeordneten Objekte als ein einziges kombiniertes Quadrat und verschiebt sie während des automatischen Atlas-Packens oder in einer Lightmap Group im Modus Pack Atlas niemals voneinander weg. Die gesamte Hierarchie der untergeordneten Objekte wird als Ganzes gepackt.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Shared LOD UV ===&lt;br /&gt;
Wenn dies zu einer LODGroup hinzugefügt wird, werden alle ähnlich benannten LODs für dieselbe Lightmap markiert. Standardmäßig erhält jedes LOD eine einzigartige Lightmap, die Platz im Atlas einnimmt. Wenn jedoch bekannt ist, dass LODs desselben Objekts ähnliche UV2-Kanäle haben (oder UV1, wenn sie sich nicht überlappen, und UV2 nicht vorhanden ist), können sie demselben Teil des Atlas zugeordnet werden, wodurch Speicherplatz gespart wird.&lt;br /&gt;
Diese Technik ist auch als [https://github.com/laurenth-personal/LODLightmapScripts/ Lightmap Stealing] bekannt.&lt;br /&gt;
&lt;br /&gt;
= Kompatibilität von Materialien =&lt;br /&gt;
=== Albedo und Emission ===&lt;br /&gt;
Bakery unterstützt die meisten Unity Materialien durch die Verwendung des [https://docs.unity3d.com/Manual/MetaPass.html Meta Pass]-Systems. Alle Built-in, Surface, URP und HDRP Shaders verfügen bereits über einen korrekt definierten Meta Pass.&lt;br /&gt;
&lt;br /&gt;
Wenn Sie einen Unlit Shader haben, müssen Sie den Meta Pass manuell hinzufügen, so wie es in der Unity Dokumentation beschrieben wird.&lt;br /&gt;
&lt;br /&gt;
Sollte der Pass nicht vorhanden sein, wird Bakery die Eigenschaften {{codeVar|_MainTex}}, {{codeVar|_BaseColorMap}} oder {{codeVar|_Color}} (wenn keine Textur festgelegt ist) als Materialalbedo und {{codeVar|_EmissionMap}} sowie {{codeVar|_EmissionColor}} als Emissionsfarbe werten.&lt;br /&gt;
&lt;br /&gt;
Damit Emission funkionieren kann, muss der Wert [https://docs.unity3d.com/ScriptReference/Material-globalIlluminationFlags.html Material.globalIlluminationFlags] auf [https://docs.unity3d.com/ScriptReference/MaterialGlobalIlluminationFlags.BakedEmissive.html MaterialGlobalIlluminationFlags.BakedEmissive] gesetzt werden. Die Standard Shader legen diesen Wert automatisch fest.&lt;br /&gt;
&lt;br /&gt;
=== Opacity ===&lt;br /&gt;
[[File:Upload 2019-1-25 0-4-30.png|thumb|Materialparameter in Cutout umgewandelt (Standard)]]&lt;br /&gt;
[[File:Alphacombos dither.jpg|thumb|Halbtransparente Werte, die über die Option Dither Transparency hinzugefügt wurden]]&lt;br /&gt;
[[File:Alphacombos filter.jpg|thumb|Auf rote Flächen angewendete Light Filter-Komponenten, die farbige Schatten erzeugen]]&lt;br /&gt;
Standardmäßig übernimmt Bakery immer die volle Opazität aus dem Alpha-Wert von {{codeVar|_MainTex}}, {{codeVar|_BaseColorMap}} oder {{codeVar|_BaseMap}} und behandelt diese als Cutout (1-Bit Transparenz).&lt;br /&gt;
&lt;br /&gt;
Wenn die Einstellung '''Dither Transparency''' aktiviert ist, werden halbtransparente Werte automatisch in variables blaues Rauschen umgewandelt, das anschließend gefiltert/unscharf gemacht wird, was zu einer teilweisen Transparenz führt (dies war zuvor mit benutzerdefinierten, manuell geditherten Karten möglich, seit Version 1.97 erfolgt dies jedoch automatisch).&lt;br /&gt;
&lt;br /&gt;
Damit Opacity funkionieren kann, muss der [https://docs.unity3d.com/Manual/SL-SubShaderTags.html RenderType Tag] des Shaders einen der folgenden Werte haben:&lt;br /&gt;
* {{codeVar|Transparent}}&lt;br /&gt;
* {{codeVar|TransparentCutout}}&lt;br /&gt;
* {{codeVar|TreeLeaf}}&lt;br /&gt;
&lt;br /&gt;
Sollte eine Eigenschaft namens {{codeVar|_Cutoff}} vorhanden sein, wirkt sich diese auf den Cutout aus (daher funktioniert der Cutoff-Schieberegler des Standard Shaders automatisch).&lt;br /&gt;
&lt;br /&gt;
Ohne Dither Transparency wird, wenn der RenderType des Materials {{codeVar|Transparent}} oder {{codeVar|TreeLeaf}} ist, der Alpha-Wert von {{codeVar|_Color}} zusätzlich den Cutoff-Wert modifizieren: ''finalCutoff = 1 - (1 - cutoff) * alpha''&lt;br /&gt;
&lt;br /&gt;
Für farbige Transparenzeffekte, verwenden Sie die [[Manual#Bakery_Light_Filter|Light Filter]]-Komponente.&lt;br /&gt;
&lt;br /&gt;
Für diffuse Transparenzeffekte, lesen Sie den Abschnitt [[#Backface GI|Backface GI]] und den Artikel über [[Subsurface scattering]].&lt;br /&gt;
&lt;br /&gt;
==== Alpha Meta Pass ====&lt;br /&gt;
Seit v1.9 unterstützt Bakery die Angabe einer benutzerdefinierten shader-basierten Transparenz, wofür jedoch ein kompatibler Shader erforderlich ist. Um die Vorteile des ''Alpha Meta Pass'' nutzen zu können, müssen folgende Schritte durchgeführt werden:&lt;br /&gt;
* Fügen Sie Ihrem Shader die Eigenschaft namens '''BAKERY_META_ALPHA_ENABLE''' hinzu. Beispiel:&lt;br /&gt;
{{code|&amp;lt;nowiki&amp;gt;[HideInInspector] BAKERY_META_ALPHA_ENABLE (&amp;quot;Enable Bakery alpha meta pass&amp;quot;, Float) = 1.0&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
* Stellen Sie sicher, dass der RenderType auf einen der oben genannten Werte gesetzt ist.&lt;br /&gt;
* Deklarieren Sie einen Pass namens '''META_BAKERY'''. &lt;br /&gt;
* Überprüfen Sie in diesem Pass, ob '''unity_MetaFragmentControl.w''' ungleich Null ist. Ist dies der Fall, geben Sie den berechneten Transparenzwert zurück. &lt;br /&gt;
&lt;br /&gt;
Sehen Sie sich als Beispiel die im Paket enthaltene Datei ''Baked_Alpha_meta.shader'' an.&lt;br /&gt;
&lt;br /&gt;
Hinweis: Derzeit muss für den Alpha Meta Pass der Light Probe-Modus auf L1 oder L2 eingestellt sein.&lt;br /&gt;
&lt;br /&gt;
=== Normal mapping ===&lt;br /&gt;
Benutzerdefinierte Oberflächennormalen können in Verbindung mit dem Modus [[#Baked Normal Maps|Baked Normal Maps]] verwendet werden. Leider gibt der Meta Pass von Unity keine Normaleninformationen aus, sodass standardmäßig die Normalen aus einer Textur namens {{codeVar|_BumpMap}} übernommen und zusätzlich durch {{codeVar|_MainTex_ST}} verändert werden.&lt;br /&gt;
&lt;br /&gt;
Es ist jedoch möglich, komplett benutzerdefinierte Shader mit erweiterten Normal Mapping-Funktionen (z. B. Überblenden mehrerer Ebenen) zu erstellen, die mit dem Backen kompatibel sind. Dazu müssen Sie folgendes tun:&lt;br /&gt;
&lt;br /&gt;
1. Fügen Sie Ihrem Shader einen Meta Pass hinzu, so wie es [https://docs.unity3d.com/Manual/MetaPass.html#ExampleMetaPass in der Unity Dokumentation beschrieben] ist.&lt;br /&gt;
&lt;br /&gt;
2. Nennen Sie diesen Pass {{codeVar|&amp;quot;META_BAKERY&amp;quot;}} statt nur {{codeVar|&amp;quot;META&amp;quot;}}.&lt;br /&gt;
&lt;br /&gt;
3. Inkludieren Sie die Datei {{codeVar|&amp;quot;BakeryMetaPass.cginc&amp;quot;}}.&lt;br /&gt;
&lt;br /&gt;
4. Fügen Sie {{codeVar|#pragma vertex vert_bakerymt}} hinzu.&lt;br /&gt;
&lt;br /&gt;
5. Wenn die Variable {{codeVar|unity_MetaFragmentControl.z}} nicht 0 ist, sollte der Shader Normale im Weltkoordinatensystem zurückgeben. Der zurückgegebene Normalwert sollte mit der Funktion {{codeVar|BakeryEncodeNormal}} codiert werden.&lt;br /&gt;
&lt;br /&gt;
Zwei Beispiel-Shader, die diesen erweiterten Meta Pass implementieren, sind im Ordner Assets/Bakery/examples/shaders enthalten.&lt;br /&gt;
&lt;br /&gt;
Sie können BakeryMetaPass.cginc kopieren und an Ihre Bedürfnisse anpassen, z. B. um zusätzliche Daten aus dem Vertex Shader zu übermitteln.&lt;br /&gt;
&lt;br /&gt;
=== Front/back faces ===&lt;br /&gt;
Unabhängig davon, welcher Culling-Modus für den Shader verwendet wird, behandelt Bakery alle Rückflächen als undurchsichtig, was bedeutet, dass direkte Lichtstrahlen eine Rückfläche ebenso wenig durchdringen wie eine Vorderfläche.&lt;br /&gt;
Bei der Verwendung von [[Manual#Backface_GI|Backface GI]] können Rückflächen jedoch teilweise die von einer Vorderfläche empfangene Beleuchtung emittieren.&lt;br /&gt;
&lt;br /&gt;
= &amp;quot;Lightmap Parameters&amp;quot; Assets =&lt;br /&gt;
[[File:Lp.jpg|thumb|Erweiterte Lightmap-Parameter]]&lt;br /&gt;
Ähnlich wie Bakery's [[Manual#Bakery_Lightmap_Group_Selector|Lightmap Groups]] verfügt Unity über [https://docs.unity3d.com/Manual/class-LightmapParameters.html Lightmap-Parameter], die als Assets erstellt und Mesh Renderern zugewiesen werden können. Deren Logik weisen sowohl Unterschiede als auch Gemeinsamkeiten auf:&lt;br /&gt;
* Die Lightmap Group dient in erster Linie dazu, mehrere Objekte in einem Atlas zu gruppieren. Darüber hinaus ermöglicht sie das Überschreiben der Back-Einstellungen für diesen Atlas.&lt;br /&gt;
* Lightmap-Parameter werden hauptsächlich dazu verwendet, um die Back-Einstellungen für ein Objekt zu überschreiben. Sie können jedoch auch das Packing beeinflussen, wenn die Option &amp;quot;Baked Tag&amp;quot; verwendet wird: Objekte mit einem unterschiedlichen Baked Tag teilen sich niemals denselben Atlas.&lt;br /&gt;
&lt;br /&gt;
Da einige Benutzer eher mit dem Lightmap Parameter-Workflow vertraut sind, unterstützt und erweitert Bakery diese:&lt;br /&gt;
* Der Baked Tag wird von Bakery berücksichtigt.&lt;br /&gt;
* Zusätzliche Bakery-spezifische Einstellungen werden in der Lightmap Parameters UI angezeigt. Über die Bedeutung dieser Einstellungen finden Sie im Abschnitt [[Manual#Bakery_Lightmap_Group_Selector|Lightmap Group]] mehr heraus.&lt;br /&gt;
&lt;br /&gt;
= Project Settings =&lt;br /&gt;
Einige globale Einstellungen können unter Project Settings -&amp;gt; Bakery GPU Lightmapper angepasst werden (diese Option ist nur in Unity 2018.3 oder neuer sichtbar; bei älteren Versionen bearbeiten Sie stattdessen BakeryProjectSettings.asset):&lt;br /&gt;
* Mipmap lightmaps: Aktiviert Mipmapping für Lightmap Assets. Kann zu Leaks in UV-Maps führen, da Atlas-Texturen kleiner werden; andererseits reduziert es Lightmap Aliasing in der Ferne. Insgesamt wird empfohlen, für sehr weit entfernte Objekte separat gebackene LODs mit niedrig aufgelösten Lightmaps zu verwenden.&lt;br /&gt;
* Color file format: Format für reguläre HDR color lightmaps. Mögliche Werte:&lt;br /&gt;
** HDR: Radiance HDR format (Standard). Kann mit vielen Bildbearbeitungsprogrammen geöffnet und bearbeitet werden.&lt;br /&gt;
** Asset: Natives Unity Format. Kann eine benutzerdefinierte Mipmap-Anzahl haben.&lt;br /&gt;
* Mask/Direction file format: Format für zusätzliche LDR-Karten, wie Shadowmasks oder Richtungsinformationen. Mögliche Werte:&lt;br /&gt;
** TGA: 8-bit Targa (Standard).&lt;br /&gt;
** PNG: 8-bit PNG. Benötigt weniger Speicherplatz auf der Festplatte als Targa (TGA).&lt;br /&gt;
** Asset: Natives Unity Format. Kann eine benutzerdefinierte Mipmap-Anzahl haben.&lt;br /&gt;
* Compress lightmaps: Legt das Komprimierungsverhalten für Lightmap-Assets fest. Komprimierte Lightmaps benötigen weniger VRAM, können jedoch je nach Art der Komprimierung einige visuelle Artefakte (wie Streifenbildung oder farbige Flecken) aufweisen. (Informationen zu Komprimierungsproblemen auf mobilen Endgeräten finden Sie [[Troubleshooting#I_have_an_Android_project.2C_and_lightmaps_don.27t_look_good|hier]]). Mögliche Werte:&lt;br /&gt;
*** Compress but allow overriding asset: Es werden neue Lightmaps mit aktivierter Komprimierung erstellt. Nach ihrer Erstellung können ihre Komprimierungseinstellungen im Inspector geändert werden. Diese geänderten Werte bleiben nach dem erneuten Backen erhalten (Standard).&lt;br /&gt;
*** Force compress: Lightmaps werden immer komprimiert.&lt;br /&gt;
*** Force no compress: Immer unkomprimierte Lightmaps erstellen.&lt;br /&gt;
* High quality direction: Ermöglicht eine &amp;quot;hohe&amp;quot; Komprimierungsqualität für Richtungskarten. Die tatsächlichen Formate hängen von der (Ziel)plattform ab. Auf dem PC wird beispielsweise DXT1 durch BC7 ersetzt, was zwar eine höhere Qualität liefert, aber den VRAM-Verbrauch verdoppelt.&lt;br /&gt;
* Texel padding (default atlas packer): Legt fest, wie viele leere Texel zwischen den UV-Layouts von Objekten in Lightmap-Atlas-Texturen hinzugefügt werden sollen, wenn der Standard-Atlas Packer verwendet wird.&lt;br /&gt;
* Texel padding (xatlas packer): Wie oben, nur das stattdessen xatlas verwendet wird.&lt;br /&gt;
* Alpha Meta Pass resolution multiplier: Multipliziert die Auflösung des [[Manual#Alpha_Meta_Pass|Alpha Meta Pass]], wodurch präzise shaderbasierte Cutouts beim Backen von niedrig aufgelösten Lightmaps möglich sind.&lt;br /&gt;
* Volume render mode: Welcher [[Manual#Render_mode|Render-Modus]] soll für alle [[Manual#Bakery_Volume|Volumes]] verwendet werden? Auto verwendet den aktuell aktiven Render-Modus (Standard).&lt;br /&gt;
* Delete previous lightmaps before bake: Löscht alle zuvor gerenderten Lightmap-Dateien dieser Szene, bevor neue gebacken werden.&lt;br /&gt;
* Log level: Legt fest, wie viele Informationen während des Backvorgangs in der Konsole ausgegeben werden. Mögliche Werte:&lt;br /&gt;
** 0: es wird nichts ausgegeben.&lt;br /&gt;
** 1: es werden nur Fortschrittsinformationen ausgegeben.&lt;br /&gt;
** 2: es werden nur Warnungen ausgegeben.&lt;br /&gt;
** 3: es wird alles an Informationen ausgegeben.&lt;br /&gt;
* Alternative scale in lightmap: Bewirkt, dass sich die Renderer-Eigenschaft 'Scale in Lightmap' eher wie das integrierte Unity-Verhalten verhält.&lt;br /&gt;
* Align to texture compression blocks with xatlas: Lässt xatlas Maps an 4x4-Blockgrenzen ausrichten, was zu komprimierungsfreundlicheren Ergebnissen führt.&lt;br /&gt;
* Generate smooth positions: Sollen Sample-Positionen angepasst werden, um falsche Schatten auf Low-Poly-Geometrien mit glatten Normalen zu vermeiden? Kann in sehr seltenen Fällen deaktiviert werden, in denen Geometrie mit stark abweichenden Normalen verwendet wird. Lesen Sie [https://ndotl.wordpress.com/2018/08/29/baking-artifact-free-lightmaps/#shadowterm diesen Artikel] für eine technische Erklärung.&lt;br /&gt;
* Smooth positions per-triangle: Sollen glatte/flache Positionen pro Dreieck festgelegt werden? Kann in sehr seltenen Fällen deaktiviert werden, in denen Geometrie mit stark abweichenden Normalen verwendet wird.&lt;br /&gt;
* Use 'Receive GI' values: Berücksichtigt 'Receive Global Illumination'-Werte von Renderern. Ursprünglich wurde dies von Bakery ignoriert.&lt;br /&gt;
* Remove ringing in Legacy light probes: Ermöglicht eine weichere Light Probes-Faltung im Legacy Modus, um Artefakte in kontrastreichen Bereichen zu vermeiden.&lt;br /&gt;
* Always render reflection probes: Automatisch nach jedem Render/Render Light Probes-Vorgang Reflection Probes rendern.&lt;br /&gt;
* Ringing removal for L2 light probes: Wendet De-Ringing auf [[Manual#Light_probe_mode|L2 Light Probes]] an. Je höher der Wert, desto weicher ist die Beleuchtung von Probes. Diese Glättung reduziert [https://docs.unity3d.com/6000.2/Documentation/Manual/light-probes-troubleshooting.html Ringing]-Artefakte (falls vorhanden).&lt;br /&gt;
* Put menu under Tools: Verschiebt den Bakery Menüeintrag under den Tools Menüeintrag.&lt;br /&gt;
&lt;br /&gt;
Falls ein Format auf Asset eingestellt und Mipmapping aktiviert ist, wird eine zusätzliche Einstellung angezeigt:&lt;br /&gt;
* Maximum mipmap count: Legt die maximale Anzahl von Mipmaps fest. Beispiel: Bei einem Wert von 2 verfügt eine 8K-Lightmap nur über zwei zusätzliche Mipmaps: 4K und 2K. Niedrigere Auflösungen werden weggelassen, wodurch das Auftreten von Leak-Artefakten beim Mipmapping begrenzt wird.&lt;br /&gt;
&lt;br /&gt;
= Skinned mesh renderer support =&lt;br /&gt;
&lt;br /&gt;
Bakery unterstützt Skinned Meshes seit v1.65. Es gibt jedoch einige Einschränkungen:&lt;br /&gt;
* Einige Versionen von Unity unterstützen UV1 auf Skinned Meshes nicht und ignorieren daher &amp;quot;Generate lightmap UVs&amp;quot;. Stellen Sie sicher, dass das in Ihrer Szene verwendete Mesh über UV1 verfügt, und verwenden Sie nach Möglichkeit nicht überlappende UV0.&lt;br /&gt;
* Die Anpassung des UV-Paddings funktioniert nicht bei Skinned Meshes (Unity scheint beim Versuch, die Unwrap-Funktion auf sie anzuwenden, abzustürzen);&lt;br /&gt;
* Skinned Meshes können keine pro-Vertex Lightmaps besitzen (die Engine bietet keine Unterstützung für additionalVertexStreams mit skinning).&lt;br /&gt;
&lt;br /&gt;
= Shader Tweaks =&lt;br /&gt;
[[File:Image2.jpg|thumb|Links: standard bilineare Filterung. Rechts: bikubische Filterung.]]&lt;br /&gt;
[[File:Image34.jpg|thumb|Links: beide Schatten sind gebacken.&amp;lt;br&amp;gt;&lt;br /&gt;
Mitte: der sphärische Schatten ist dynamisch, während der andere Schatten statisch ist. Zusammen wurden sie mit Multiplikation kombiniert.&amp;lt;br&amp;gt;&lt;br /&gt;
Rechts: wie in der Mitte, jedoch kombiniert mit dem Standard-Minimum.]]&lt;br /&gt;
Bakery bietet optionale Shader-Modifikationen, die auf Unity Shader angewendet werden können, um das Sampling von Lightmaps zu verbessern und die Echtzeitbeleuchtung besser an Lightmaps anzupassen. Das Menü zur Anpassung der Shader kann über Bakery-&amp;gt;Shader Tweaks aufgerufen werden.&lt;br /&gt;
&lt;br /&gt;
Diese Optionen patchen die Basis-Unity Shader-Includes (aus dem Ordner CGIncludes), die von den meisten integrierten und Drittanbieter-Shadern verwendet werden. Alle vorgenommenen Änderungen werden sich auf alle Projekte, die in Zukunft mit dieser Version des Editors geöffnet werden, auswirken, können jedoch leicht rückgängig gemacht werden. Shader-Optimierungen beeinflussen die Funktionsweise von Standard- und Surface Shadern. HDRP, URP und andere SRPs sind davon nicht betroffen.&lt;br /&gt;
&lt;br /&gt;
Alle verfügbaren Modifikationen werden als Schaltflächen angezeigt. Klicken Sie auf eine Schaltfläche, um die dazugehörige Änderung anzuwenden. Klicken Sie erneut auf die Schaltfläche, um die Änderung rückgängig zu machen. Derzeit verfügbare Optionen:&lt;br /&gt;
&lt;br /&gt;
{{note| Möglicherweise müssen Sie den Unity Editor als Administrator ausführen, damit das patchen von CGIncludes funktioniert.}}&lt;br /&gt;
&lt;br /&gt;
* Use bicubic interpolation for lightmaps: Anstelle der standardmäßigen bilinearen Interpolation wird eine bikubische Interpolation verwendet. Diese Optimierung behebt viele, die von niedrig aufgelösten Lightmaps produzierten gezackten Kanten ziemlich gut. Funktioniert derzeit nur auf DX11 und modernen Konsolen, weshalb andere Plattformen weiterhin bilinear verwenden werden.&lt;br /&gt;
&lt;br /&gt;
* Use multiplication for shadowmask: Kombiniert statische und dynamische Schatten mithilfe von Multiplikation anstelle von Minimum. Aus unbekannten Gründen hat Unity beschlossen, standardmäßig den Minimaloperator zu verwenden - was zu Artefakten führt, die bei der Multiplikation nicht auftreten.&lt;br /&gt;
&lt;br /&gt;
* Use physical light falloff (forward): Ersetzt den gewöhnlichen Lichtabfall von Echtzeit-Punkt/Spotlichtern durch einen physikalisch korrekteren invers-quadratischen Abfall. “Range” wird nur an den Rändern leicht ausgeblichen (entspricht Bakery-Lichter mit aktiviertem Physical Falloff-Kontrollkästchen). Beeinflusst nur den Forward Renderer. Lesen Sie den Artikel [[Point Light Attenuation]] für weitere Details.&lt;br /&gt;
&lt;br /&gt;
* Use physical light falloff (deferred): Wie oben, aber nur der Deferred Renderer wird beeinflusst.&lt;br /&gt;
&lt;br /&gt;
'''Falloff-Optimierungen funktionieren möglicherweise nicht vollständig in Unity-Versionen &amp;gt; 2017. SRPs besitzen standardmäßig einen korrekten Lichtabfall.'''&lt;br /&gt;
&lt;br /&gt;
= Bakery shaders =&lt;br /&gt;
Bakery enthält eigene Shader mit Unterstützung für Vertex-Lightmapping sowie die Richtungsmodi RNM und SH. Außerdem unterstützen sie die Berechnung einer ungefähren gebackenen Spiegelung (Specular) aus Richtungsinformationen. &lt;br /&gt;
Bakery Shader werden für normale Lightmaps, Shadowmasks und den Dominant Direction-Modus '''nicht benötigt''', da diese Funktionen von den meisten Unity Shadern unterstützt werden.&lt;br /&gt;
&lt;br /&gt;
=== Standard render pipeline ===&lt;br /&gt;
'''Bakery/Standard''': Erweitert den regulären Standard Shader von Unity um folgende zusätzliche Optionen:&lt;br /&gt;
* Allow Vertex Lightmaps: Ermöglicht die Verwendung dieses Materials für das [[Vertex Lightmaps|Vertex-Lightmapping]].&lt;br /&gt;
* Allow RNM Lightmaps: Ermöglicht die Verwendung dieses Materials mit dem [[#RNM|RNM directional mode]].&lt;br /&gt;
* Allow SH Lightmaps: Ermöglicht die Verwendung dieses Materials mit dem [[#SH|SH directional mode]].&lt;br /&gt;
{{note| Alle “Allow”-Umschaltflächen aktivieren einen bestimmten Code-Pfad im Shader. Aus Leistungsgründen wird empfohlen, in einem Material nur eine “Allow”-Option zu aktivieren.}}&lt;br /&gt;
* Enable Lightmap Specular: Berechnet gebackene Spiegelungen (Specular) anhand von Daten aus den Richtungsmodi Dominant Direction, RNM oder SH directional. Beachten Sie, dass der Effekt aufgrund fehlender Informationen nur sehr ungefähr ist. Das Ergebnis sollte in etwa vergleichbar sein mit gebackener Spiegelung in Unity 4. Am besten sieht er in Kombination mit starken Normal Maps aus, auf flachen Oberflächen hingegen nicht so gut.&lt;br /&gt;
* Enable VertexLM directional: Wenn Vertex Lightmaps vorhanden sind, gibt dies an, dass Dominant Direction-Daten in Eckpunkten (Vertices) gespeichert sind und verwendet werden sollen.&lt;br /&gt;
* Enable VertexLM SH: Wenn Vertex Lightmaps vorhanden sind, gibt dies an, dass SH-Daten in Eckpunkten (Vertices) gespeichert sind und verwendet werden sollen.&lt;br /&gt;
* Enable VertexLM Shadowmask: Wenn Vertex Lightmaps vorhanden sind, gibt dies an, dass die Shadowmask in Eckpunkten (Vertices) gespeichert ist und verwendet werden soll.&lt;br /&gt;
* Enable MonoSH: Behandelt Directional Maps als MonoSH Maps.&lt;br /&gt;
[[File:Image5.png|thumb|Standard SH Light Probe vs. non-linear]]&lt;br /&gt;
[[File:Shspec.jpg|thumb|SH Spiegelungseffekte]]&lt;br /&gt;
* Non-linear SH: Im SH directional mode kann diese Option den Kontrast verbessern (näher an Ground Truth dran), verlangsamt jedoch den Shader etwas. Dieser Trick basiert auf dem [https://drive.google.com/file/d/1MK6Clw93q8ljijRjb4gQOzzaIjn1uF9Y/view “Reconstructing Diffuse Lighting from Spherical Harmonic Data”]-Papier von Geomerics.&lt;br /&gt;
* Non-linear Light Probe SH: Ähnlich wie Non-linear SH, ist aber für Light Probes bestimmt. Im Falle von Probes besteht der größte Vorteil darin, dass falsche negative Werte beseitigt werden. Dieses Problem tritt häufig in kontrastreichen Szenen mit hellen HDR-Lichtquellen auf und ist eine inhärente Einschränkung sphärischer Harmonien und nicht spezifisch für Bakery (d. h. ähnliche Artefakte können auch bei integrierten Lightmappern auftreten).&lt;br /&gt;
* Force Bicubic Filter: Aktiviert die bikubische Filterung für alle zusätzlichen Maps. Für eine vollständige bikubische Filterung (einschließlich der ersten color map) wird empfohlen, diese auch in den [[#Shader Tweaks|Shader Tweaks]] zu aktivieren.&lt;br /&gt;
&lt;br /&gt;
'''Bakery/Standard Specular''': wie Standard, aber für den Specular Workflow bestimmt.&lt;br /&gt;
&lt;br /&gt;
=== HDRP &amp;amp; URP ===&lt;br /&gt;
Um zusätzliche HDRP/URP-Shader zu extrahieren, öffnen Sie die Datei Bakery_ShaderGraphHDRP.unitypackage oder Bakery_ShaderGraphURP.unitypackage, die im Lieferumfang von Bakery enthalten sind. Im Inneren finden Sie Shader Subgraphs, die Sie in Ihren eigenen Shader Graphs verwenden können, sowie einige Beispielmaterialien.&lt;br /&gt;
&lt;br /&gt;
=== Vergleich der Feature-Unterstützung aller Shader ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Die meisten Unity Shader&lt;br /&gt;
! Die meisten HDRP &amp;amp; URP Shader&lt;br /&gt;
! Bakery Standard&lt;br /&gt;
! HDRP Graphs&lt;br /&gt;
! URP Graphs&lt;br /&gt;
|-&lt;br /&gt;
| HDR color lightmaps&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|-&lt;br /&gt;
| Shadowmask&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja (Seit URP 10.1)&lt;br /&gt;
|-&lt;br /&gt;
| Dominant Direction&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|-&lt;br /&gt;
| RNM&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|-&lt;br /&gt;
| SH&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|-&lt;br /&gt;
| MonoSH&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|-&lt;br /&gt;
| Lightmap specular&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja, für Dominant Direction und SH&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja, für Dominant Direction (siehe Link)&lt;br /&gt;
|-&lt;br /&gt;
| Bicubic filtering&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja,&lt;br /&gt;
mithilfe von [[#Shader Tweaks|Shader Tweaks]]&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja,&lt;br /&gt;
mithilfe von [[#Shader Tweaks|Shader Tweaks]]&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
|-&lt;br /&gt;
| Vertex lightmaps&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Nur eine Farbe, keine per-vertex SH, direction oder Shadowmasks (Shader Graph-Einschränkung)&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Nur eine Farbe, keine per-vertex SH, direction oder Shadowmasks (shader Graph-Einschränkung)&lt;br /&gt;
|-&lt;br /&gt;
| Non-Linear Light Probes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|-&lt;br /&gt;
| Volumes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|-&lt;br /&gt;
| Volume shadowmask&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|-&lt;br /&gt;
| Compressed volumes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{note| Mit Ausnahme von regulären color lightmaps erfordern alle anderen Optionen mindestens Shader Model 3.0.}}&lt;br /&gt;
{{note| Vertex Lightmaps im SH-Modus erfordern aufgrund der Interpolatorbegrenzung mindestens Shader Model 4.0.}}&lt;br /&gt;
{{note| Aktualisierte URP-Graphen mit Unterstützung für Spiegelungen (Specular) aus Dominant Direction können [[Bakery_-_GPU_Lightmapper|von der Haupt-Wiki-Seite]] heruntergeladen werden.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Lesen Sie auch: [[Integrating_Bakery_shader_features_to_custom_shaders| Integrieren von Bakery Shader-Funktionen in eigene Shader]]&lt;br /&gt;
&lt;br /&gt;
= Hinweise zu HDRP/URP =&lt;br /&gt;
Sobald Bakery in ein HDRP- oder URP-Projekt importiert wurde, kann es in der Regel sofort verwendet werden. Es gilt jedoch einige Dinge zu beachten:&lt;br /&gt;
&lt;br /&gt;
* Beispielszenen verwenden sowohl reguläre Standard Shader als auch in einigen Fällen &amp;quot;Bakery Standard&amp;quot;-Shader. HDRP und URP bieten zwar einen automatischen Mechanismus zum Aktualisieren von Projekt-Shadern von Standard auf Lit an, dieser ist jedoch nicht mit Bakery Standard kompatibel. Sie müssen daher manuell alle Materialien, die Bakery Standard verwenden, durch die Materialien aus Bakery_ShaderGraphHDRP.unitypackage oder Bakery_ShaderGraphURP.unitypackage ersetzen.&lt;br /&gt;
&lt;br /&gt;
* In HDRP ist die voreingestellte Lichtintensität des HDRI-Himmels etwas hoch (11) und die Himmelsreflexion wird nicht verdeckt. Zusammen mit dem voreingestellten Eye Adaptation-Effekt kann dies dazu führen, dass einige Beispielszenen kaum sichtbar sind, da sie mit viel geringerer Intensität gebacken wurden. Reduzieren Sie in diesem Fall die Lichtintensität des HDRI-Himmels auf 1. Die HDRI-Einstellungen befinden sich normalerweise in Assets/HDRPDefaultResources/DefaultSettingsVolumeProfile.&lt;br /&gt;
&lt;br /&gt;
* Falls Lichter in den Beispielszenen unter HDRP zu hell scheinen sollten, klicken Sie auf &amp;quot;Match real-time to lightmapped&amp;quot; an der Bakery Light-Komponente, um dies zu beheben.&lt;br /&gt;
&lt;br /&gt;
* Verwenden Sie OpenImageDenoise 2 (empfohlen) oder OptiX 7 als Denoiser in HDRP, da diese für hohe Intensitätswerte besser geeignet sind.&lt;br /&gt;
&lt;br /&gt;
* In HDRP können &amp;quot;distance&amp;quot; und reguläre Shadowmasks in der Light-Komponente gewechselt werden, nicht jedoch in den globalen Einstellungen.&lt;br /&gt;
&lt;br /&gt;
* Verwenden Sie beim Skylight nicht die &amp;quot;Match&amp;quot;-Schaltfläche, da HDRP einen sehr spezifischen prozeduralen Himmelsshader verwendet. Backen Sie das Licht stattdessen [[How_do_I...#How_do_I_use_Skylight_with_a_procedural_sky_shader.3F|auf diese Weise]] in ein HDRI ein.&lt;br /&gt;
&lt;br /&gt;
* Es wird empfohlen, bei Verwendung von HDRP den Light Probe-Modus immer auf L2 oder L1 einzustellen, da der Renderer von HDRP nicht für den Legacy-Modus optimiert ist.&lt;br /&gt;
&lt;br /&gt;
* Die neuesten Versionen von HDRP/URP verfügen über einen eigenen IES-Datei-Importierer. Aufgrund der Inkompatibilität der Asset-Typen trennt Unity die Dateien von den mit älteren Versionen gespeicherten Bakery IES-Lichter, sodass diese stattdessen als normale Punktlichter gerendert werden. Die Dateien können erneut hinzugefügt und die Lichter erneut gespeichert werden.&lt;br /&gt;
&lt;br /&gt;
Bakery's Beispielszenen sind für die Built-in Render Pipeline gebaut worden, weshalb einige Schritte erforderlich sind, um sie korrekt in HDRP/URP zu rendern. Hier sind ein paar Tipps; es wird von einem neuen Projekt mit standardmäßigen HDRP/URP-Einstellungen ausgegangen:&lt;br /&gt;
&lt;br /&gt;
=== Beispielszenen in der HDRP anschauen ===&lt;br /&gt;
* Nach dem Importieren von Bakery konvertieren Sie die Built-in-Materialien zu HDRP-Materialien wie folgt: Edit-&amp;gt;Rendering-&amp;gt;Materials-&amp;gt;Convert All Built-in Materials To HDRP.&lt;br /&gt;
* Importieren Sie Bakery_ShaderGraphHDRP.unitypackage in das Projekt, da dies spezielle ShaderGraphen enthält, die erweiterte Bakery-Funktionen implementieren (nicht erforderlich für klassische color/directional/mask lightmaps).&lt;br /&gt;
* Wählen Sie die Datei DefaultSettingsVolumeProfile.asset aus. Ändern Sie im HDRI Sky-Bereich den Wert Exposure Compensation auf 1. Andernfalls ist das standardmäßige HDRP im Vergleich zu den Beispielszenen zu hell, sodass diese aufgrund dieser Belichtungsanpassung völlig schwarz erscheinen.&lt;br /&gt;
* Bei der Auswahl von Lichtern in den Beispielszenen initialisiert HDRP eigene Lichtdaten. Manchmal kann dies dazu führen, dass das Licht sofort viel heller wird. Klicken Sie auf &amp;quot;Match real-time to lightmapped&amp;quot;, um die Synchronisierung durchzuführen.&lt;br /&gt;
* Stellen Sie den Light Probe-Modus vor dem Rendern von Light Probes auf L2 ein.&lt;br /&gt;
* '''example_directional''': Ändern Sie die Shader zu BakeryDirSpecGraph, um Glanzeffekte zu sehen (oder einfach zum normalen HDRP/Lit für nur diffuses Normal Mapping). Entfernen Sie die Kugel, da derzeit kein ShaderGraph existiert, der per-vertex direction unterstützt.&lt;br /&gt;
* '''example_directional_MonoSH''': Ändern Sie die Shader zu BakerySpecMonoSHGraph (oder BakeryMonoSHGraph für eine etwas günstigere Version ohne Glanzeffekte). Entfernen Sie die Kugel, da derzeit kein ShaderGraph existiert, der per-vertex MonoSH unterstützt.&lt;br /&gt;
* '''example_RNM''': Ändern Sie die Shader zu BakeryRNMGraph.&lt;br /&gt;
* '''example_SH''': Ändern Sie die Shader zu BakerySpecSHGraph (oder BakerySHGraph für eine etwas günstigere Version ohne Glanzeffekte). Entfernen Sie die Kugel, da derzeit kein ShaderGraph existiert, der per-vertex SH unterstützt.&lt;br /&gt;
* '''example_mixed_directional_mode''': Für MonoSH/RNM/SH Planes ist ebenfalls ein anderer Graph erforderlich.&lt;br /&gt;
* '''example_lights''': Ändern Sie den Shader der vertex-lightmapped Kugel zu BakeryVertexColorGraph.&lt;br /&gt;
* '''example_prefabs_bake''': Es sind keine weiteren Anpassungen erforderlich.&lt;br /&gt;
* '''example_sectors''': Es sind keine weiteren Anpassungen erforderlich.&lt;br /&gt;
* '''example_shadowmask''': Wählen Sie das DirectLight aus und klicken Sie auf &amp;quot;Match real-time to lightmapped&amp;quot;, um die Helligkeit anzupassen. Setzen Sie bei allen HDRP-Lichtern den Shadowmask-Modus auf Shadowmask. &lt;br /&gt;
* '''example_sponza_day''': Legen Sie OpenImageDenoise 2 (oder Optix 7, falls nicht unterstützt) als bevorzugten Denoiser fest.&lt;br /&gt;
* '''example_sponza_evening''': Legen Sie OpenImageDenoise 2 (oder Optix 7, falls nicht unterstützt) als bevorzugten Denoiser fest.&lt;br /&gt;
* '''example_subtractive''': HDRP unterstützt den Subtractive-Modus nicht.&lt;br /&gt;
* '''example_volumes_simple''': Ändern Sie den Shader vom Zug zu BakeryVolumeSpecGraph (oder BakeryVolumeGraph für eine etwas günstigere Version ohne Glanzeffekte).&lt;br /&gt;
* '''example_volumes_simple_shadowmask''': Shadowmask Volumes werden derzeit für HDRP nicht unterstützt.&lt;br /&gt;
* '''example_volumes_advanced''': Dasselbe wie example_volumes_simple.&lt;br /&gt;
* '''example_translucency''': Der Großteil der Szene sollte normal erscheinen. Stellen Sie den Shader für das Objekt &amp;quot;Dynamic sphere lit by volume&amp;quot; auf BakeryVolumeGraph ein.&lt;br /&gt;
&lt;br /&gt;
=== Beispielszenen in der URP anschauen ===&lt;br /&gt;
* Nach dem Importieren von Bakery konvertieren Sie die Built-in-Materialien zu URP-Materialien wie folgt: Öffnen Sie den Ordner &amp;quot;content&amp;quot; unter Assets/Bakery/examples/ und wählen Sie alle darin enthaltenen Materialien aus, indem Sie &amp;quot;t:material&amp;quot; im Suchfeld eingeben und den Suchvorgang auf den Ordner beschränken. Klicken Sie dann auf Edit-&amp;gt;Rendering-&amp;gt;Materials-&amp;gt;Convert Selected Built-in Materials To URP.&lt;br /&gt;
* Importieren Sie Bakery_ShaderGraphURP.unitypackage in das Projekt, da dies spezielle ShaderGraphen enthält, die erweiterte Bakery-Funktionen implementieren (nicht erforderlich für klassische color/directional/mask lightmaps).&lt;br /&gt;
* '''example_directional''': Ändern Sie die Shader zu BakeryURPLit und aktivieren Sie &amp;quot;Bakery Lightmapped Specular&amp;quot; (oder einfach zum normalen URP/Lit für nur diffuses Normal Mapping). Entfernen Sie die Kugel, da derzeit kein ShaderGraph existiert, der per-vertex direction unterstützt.&lt;br /&gt;
* '''example_directional_MonoSH''': Ändern Sie die Shader zu BakeryURPLit, stellen Sie den Bakery Mode auf MonoSH ein und aktivieren Sie &amp;quot;Bakery Lightmapped Specular&amp;quot;. Aktivieren Sie außerdem &amp;quot;Per-vertex&amp;quot; an der vertex-lit Kugel.&lt;br /&gt;
* '''example_RNM''': Ändern Sie die Shader zu BakeryURPLit, stellen Sie den Bakery Mode auf RNM ein und aktivieren Sie &amp;quot;Bakery Lightmapped Specular&amp;quot;.&lt;br /&gt;
* '''example_SH''': Ändern Sie die Shader zu BakeryURPLit, stellen Sie den Bakery Mode auf SH ein und aktivieren Sie &amp;quot;Bakery Lightmapped Specular&amp;quot;. Entfernen Sie die Kugel, da derzeit kein ShaderGraph existiert, der per-vertex SH unterstützt.&lt;br /&gt;
* '''example_mixed_directional_mode''': Verwenden Sie hier ebenfalls BakeryURPLit mit einem unterschiedlichen Bakery Mode (MonoSH, RNM, SH). Non-directional / Dominant Direction / Baked Normal Maps können den regulären URP/Lit verwenden.&lt;br /&gt;
* '''example_lights''': Es sind keine weiteren Anpassungen erforderlich.&lt;br /&gt;
* '''example_prefabs_bake''': Es sind keine weiteren Anpassungen erforderlich.&lt;br /&gt;
* '''example_sectors''': Es sind keine weiteren Anpassungen erforderlich.&lt;br /&gt;
* '''example_shadowmask''': Ähnlich wie bei der Built-in Pipeline, müssen Sie die Option Distance Shadowmask im Bakery-Fenster (oder in den Quality Settings des Projekts) deaktivieren, um die tatsächliche gebackene/Echtzeit-Schattenmischung in der Nähe der Kamera sehen zu können.&lt;br /&gt;
* '''example_sponza_day''': Aktivieren Sie Alpha Clipping am Laubmaterial.&lt;br /&gt;
* '''example_sponza_evening''': Dasselbe wie example_sponza_day.&lt;br /&gt;
* '''example_subtractive''': Es sind keine weiteren Anpassungen erforderlich.&lt;br /&gt;
* '''example_volumes_simple''': Ändern Sie den Shader vom Zug zu BakeryURPLit und schalten Sie den Bakery Mode auf Volume. Optional können Sie &amp;quot;Bakery Lightmapped Specular&amp;quot; aktivieren.&lt;br /&gt;
* '''example_volumes_simple_shadowmask''': Dasselbe wie example_volumes_simple, aber mit zusätzlich aktivierter &amp;quot;Volume Shadowmask&amp;quot;.&lt;br /&gt;
* '''example_volumes_advanced''': Dasselbe wie example_volumes_simple.&lt;br /&gt;
* '''example_translucency''': Der Großteil der Szene sollte normal erscheinen. Stellen Sie den Shader für das Objekt &amp;quot;Dynamic sphere lit by volume&amp;quot; auf BakeryURPLit und den Bakery Mode auf Volume ein.&lt;br /&gt;
&lt;br /&gt;
= Aktualisierung von Bakery =&lt;br /&gt;
Bei der Aktualisierung wird empfohlen, die folgenden Schritte auszuführen:&lt;br /&gt;
* Schließen Sie das Bakery-Fenster.&lt;br /&gt;
* Schließen Sie den Unity Editor.&lt;br /&gt;
* Öffnen Sie den Unity Editor erneut und laden Sie Ihr Projekt.&lt;br /&gt;
* Importieren Sie das neue Package.&lt;br /&gt;
&lt;br /&gt;
Beachten Sie, dass der Import ohne vorheriges Schließen von Unity aufgrund gesperrter DLL-Dateien fehlschlagen kann (erkennbar an Konsolenbenachrichtigungen wie &amp;quot;alphabuffergen.dll: Access is denied.&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
Wenn Sie die Bakery-Ordner (Assets/Bakery und Assets/Editor/x64/Bakery) an einen anderen Speicherort verschoben haben, müssen Sie diese möglicherweise vor der Aktualisierung zurückverschieben, um zu verhindern, dass zwei miteinander in Konflikt stehende Kopien des Pakets entstehen.&lt;br /&gt;
&lt;br /&gt;
= Scripting-API =&lt;br /&gt;
&lt;br /&gt;
==Grundlegende Verwendung==&lt;br /&gt;
&lt;br /&gt;
Rendereinstellungen abrufen und ändern:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ftLightmapsStorage storage = ftRenderLightmap.FindRenderSettingsStorage();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Eine vollständige Liste aller verfügbaren Einstellungen können in der Datei ftLightmapsStorage.cs eingesehen werden.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Lightmapper-Instanz abrufen und Einstellungen (neu)laden:&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap bakery = ftRenderLightmap.instance != null ? ftRenderLightmap.instance : new ftRenderLightmap();&lt;br /&gt;
bakery.LoadRenderSettings();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Lightmaps rendern (sowie Probes, wenn sie auf den Modus L1 oder L2 eingestellt sind):&lt;br /&gt;
&amp;lt;pre&amp;gt;bakery.RenderButton(bool showMsgWindows)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Nur Light Probes rendern:&lt;br /&gt;
&amp;lt;pre&amp;gt;bakery.RenderLightProbesButton(bool showMsgWindows)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Nur Reflection Probes rendern:&lt;br /&gt;
&amp;lt;pre&amp;gt;bakery.RenderReflectionProbesButton(bool showMsgWindows)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''showMsgWindows''' gibt an, ob Dialogfelder/Bestätigungsfenster angezeigt werden können. Wird unterdrückt, wenn auf false gesetzt.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Überprüfen, ob gerade ein Backvorgang läuft:&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.bakeInProgress&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Beispiele für die Verwendung finden Sie im [[Community_extensions#Batch_scene_baker|Batch Scene Baker]]-Skript.&lt;br /&gt;
&lt;br /&gt;
==Zusätzliche functions==&lt;br /&gt;
&lt;br /&gt;
Kopiert alle Rendereinstellungen von einem ftLightmapsStorage in einen anderen:&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmapsStorage.CopySettings(ftLightmapsStorage src, ftLightmapsStorage dest)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ruft das globale (projektbezogene) Speicherobjekt ab:&lt;br /&gt;
&amp;lt;pre&amp;gt;ftGlobalStorage gstorage = ftLightmaps.GetGlobalStorage()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Kopiert alle Rendereinstellungen aus ftLightmapsStorage (pro Szene) nach ftGlobalStorage (pro Projekt):&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmapsStorage.CopySettings(ftLightmapsStorage src, ftGlobalStorage dest)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Kopiert alle Rendereinstellungen aus ftLightmapsStorage (pro Projekt) nach ftGlobalStorage (pro Szene):&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmapsStorage.CopySettings(ftGlobalStorage src, ftLightmapsStorage dest)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ruft den Pfad zum Ordner, der die Binärdateien von Bakery enthält, ab:&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmaps.GetEditorPath()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Zusätzliche Variablen==&lt;br /&gt;
&lt;br /&gt;
Ruft den aktuellen Pfad der temporären Dateien ab (es muss zuvor eine ftRenderLightmap-Instanz erstellt worden sein):&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.scenePath&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ruft die Datenkomprimierung des UVGBuffers ab bzw. legt sie fest (LZ4, falls aktiviert; DDS, falls nicht):&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.compressedGBuffer&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ruft die Ausgabe der Lightmap-Datenkomprimierung ab bzw. legt sie fest (LZ4, falls aktiviert; DDS, falls nicht):&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.compressedOutput&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Events==&lt;br /&gt;
&lt;br /&gt;
Skripte können statische Ereignisse in der Klasse ftRenderLightmap abonnieren.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Wird aufgerufen, bevor ein vollständiger Rendervorgang gestartet wird:&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnPreFullRender&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Wird aufgerufen, bevor jede Light Probe im Legacy Light Probe-Modus gerendert wird. ProbeEventArgs ist eine Struktur, die das Feld '''pos''' mit der aktuellen Position der Light Probe enthält:&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler&amp;lt;ProbeEventArgs&amp;gt; OnPreRenderProbe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Wird aufgerufen, nachdem Legacy Light Probes gerendert wurden:&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnFinishedProbes&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Wird aufgerufen, nachdem ein vollständiger Rendervorgang fertiggestellt wurde:&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnFinishedFullRender&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Wird aufgerufen, bevor Reflection Probes gerendert werden:&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnPreReflectionProbeRender&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Wird aufgerufen, nachdem Reflection Probes gerendert wurden:&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnFinishedReflectionProbes&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mr F</name></author>
		
	</entry>
	<entry>
		<id>https://geom.io/bakery/wiki/index.php?title=%E4%BD%BF%E7%94%A8%E6%89%8B%E5%86%8C&amp;diff=1858</id>
		<title>使用手册</title>
		<link rel="alternate" type="text/html" href="https://geom.io/bakery/wiki/index.php?title=%E4%BD%BF%E7%94%A8%E6%89%8B%E5%86%8C&amp;diff=1858"/>
		<updated>2026-01-03T22:12:18Z</updated>

		<summary type="html">&lt;p&gt;Mr F: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
[https://geom.io/bakery/wiki/index.php?title=Manual (Click for English version)]&lt;br /&gt;
&lt;br /&gt;
== 系统要求 ==&lt;br /&gt;
&lt;br /&gt;
使用 Bakery 需要：&lt;br /&gt;
&lt;br /&gt;
Windows（7 或更高版本）电脑。&lt;br /&gt;
&lt;br /&gt;
Nvidia 显卡。最低支持型号为 Kepler（GeForce 650 或更新型号，Quadro 显卡请查看规格）。&lt;br /&gt;
&lt;br /&gt;
64 位 Unity 编辑器。Bakery 已在 5.6 到 6 及更高版本上测试过，同时也在 Tuanjie 1.6.7 上通过测试。&lt;br /&gt;
&lt;br /&gt;
{{note|系统要求仅适用于开发者的电脑，而非目标平台。使用 Bakery 烘焙的光照贴图可以在任何地方使用。}}&lt;br /&gt;
&lt;br /&gt;
== 前提条件 ==&lt;br /&gt;
* 确保你的项目中没有任何脚本编译错误，否则也会导致 Bakery 的脚本无法编译。&lt;br /&gt;
* 确保你的显卡驱动是最新版本，如有需要请[https://www.nvidia.com/Download/index.aspx?lang=en-US 更新]。&lt;br /&gt;
&lt;br /&gt;
'''请使用 Game-Ready（标准）驱动程序，而不是 “Studio” 驱动。'''&lt;br /&gt;
&lt;br /&gt;
== 安装 ==&lt;br /&gt;
&lt;br /&gt;
1. 通过 [https://assetstore.unity.com/packages/tools/level-design/bakery-gpu-lightmapper-122218 Asset Store] 将 Bakery 导入到你的项目中。&lt;br /&gt;
&lt;br /&gt;
2. Unity 会显示要导入的文件列表。如果这是你第一次使用 Bakery，建议直接 点击 Import（导入）。有经验的用户可以取消选中 examples 文件夹，以进行更轻量的安装。&lt;br /&gt;
&lt;br /&gt;
文件将被导入到 `Assets/Bakery` 和 `Assets/Editor/x64/Bakery` 文件夹中。&lt;br /&gt;
这些文件夹之后可以移动。&lt;br /&gt;
&lt;br /&gt;
3. Unity 随后会导入 Bakery 并编译脚本。此时可能会弹出如下窗口：&lt;br /&gt;
&lt;br /&gt;
[[File:Goahead.png]]&lt;br /&gt;
&lt;br /&gt;
此时你应点击 “Go Ahead”（继续）。&lt;br /&gt;
&lt;br /&gt;
现在你应该能在编辑器中看到新增的 Bakery 菜单：&lt;br /&gt;
&lt;br /&gt;
[[File:bmenu.jpg]]&lt;br /&gt;
&lt;br /&gt;
== 快速开始 ==&lt;br /&gt;
&lt;br /&gt;
1. 添加一些模型或基础体，并将其标记为静态（Static）。&lt;br /&gt;
&lt;br /&gt;
'''用于光照贴图的网格必须具有不重叠的 UV2。如果存在 UV2，则会使用 UV2（否则使用 UV1）。如果你的模型没有为光照贴图进行展开，请在资源中勾选 Generate Lightmap UVs（生成光照贴图 UV）。'''&lt;br /&gt;
Unity 的基础体已经具有正确的 UV2。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Staticmarked.jpg|320px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. 选择方向光（Unity 为你创建的那个），并添加 '''Bakery Direct Light''' 组件。&lt;br /&gt;
   {{note|Bakery 和 Unity 使用独立的光源组件。}}&lt;br /&gt;
&lt;br /&gt;
3. Bakery Direct Light 有许多可调选项，但你可以轻松将其与 Unity 光源匹配。点击 '''Match lightmapped to real-time'''。现在 Bakery 光源的颜色应与 Unity 默认的方向光相同，呈黄色调。&lt;br /&gt;
&lt;br /&gt;
[[File:Matching.jpg|640px]]&lt;br /&gt;
&lt;br /&gt;
{{note|Direct Light 组件可能会提示项目未使用线性光强度。问题在于，Unity 默认会对光源颜色应用伽马校正 [https://twitter.com/guycalledfrank/status/1001108508614553600 不正确]。&lt;br /&gt;
可以通过[https://docs.unity3d.com/ScriptReference/Rendering.GraphicsSettings-lightsUseLinearIntensity.html 脚本]启用正确模式。&lt;br /&gt;
这就是 “Fix” 按钮的作用。如果你已经在非线性光强模式下设置了许多光源，并且不想再次更改它们，可以跳过修复。即使你按了 “Fix”，也可以随时撤销此更改。&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. 要获得带阴影的环境光，请创建 Skylight（Bakery-&amp;gt;Create-&amp;gt;Skylight）。&lt;br /&gt;
&lt;br /&gt;
[[File:Menusky.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. 选择 Skylight，为它设置一些偏蓝的颜色，然后点击 '''Match scene skybox to this light'''。   这将使场景的 skybox 与光照完全匹配。&lt;br /&gt;
   {{note|将 Unity 的 skybox 与 Bakery Skylight 匹配是可选的，但对正确性很有用，可以确保可见环境和引擎内的反射探针与烘焙光照一致。目前此选项仅适用于 Standard 渲染管线。}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Skycomp.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. 点击 Bakery-&amp;gt;Render Lightmap。默认情况下，Full Lighting 模式是激活的。它会烘焙所有光源的直接和间接光照贡献。如果你想将实时阴影与烘焙全局光照（GI）结合使用，请将模式更改为 '''Indirect'''。&lt;br /&gt;
&lt;br /&gt;
[[File:Bakerywindow.jpg]]&lt;br /&gt;
&lt;br /&gt;
{{note| Bakery 可能会提示你正在使用旧的 [https://docs.unity3d.com/Manual/LinearLighting.html gamma mode]。如果你在意光照质量，强烈建议使用线性模式。如果你的项目已经在错误的伽马模式下设置好了，并且不想更改，或者是发布到不支持线性模式的移动设备上，也可以忽略此提示。}}&lt;br /&gt;
&lt;br /&gt;
7. 点击 '''Render'''。&lt;br /&gt;
&lt;br /&gt;
8. 完成！现在你应该已经得到烘焙的全局光照（GI）：&lt;br /&gt;
&lt;br /&gt;
[[File:Bakedgi.jpg]]&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 ==&lt;br /&gt;
&lt;br /&gt;
所有渲染设置都可以通过 Bakery-&amp;gt;Render Lightmap 访问。设置会为每个场景单独保存。Bakery 窗口顶部的选项允许你在 Simple（简单）、Advanced（高级）和 Experimental（实验）设置之间切换，每个后续模式都会显示更多可调选项。对于大多数场景，Simple 模式已经足够，是入门的好方法。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render mode ===  &lt;br /&gt;
定义要烘焙的光照贴图类型。  &lt;br /&gt;
&lt;br /&gt;
===== Full Lighting =====&lt;br /&gt;
烘焙所有 Bakery 光源的完整直接光和间接光。&lt;br /&gt;
{{note|在 2017.3 之前的 Unity 版本中，如果同一对象上同时有 Unity 和 Bakery 组件，你需要手动禁用 Unity 组件以避免亮度加倍。在较新版本中，实时效果会自动对烘焙光源禁用，就像内置光照烘焙器一样。}}&lt;br /&gt;
&lt;br /&gt;
===== Indirect =====&lt;br /&gt;
[[File:Image26.png|thumb|Unity 支持的不同渲染模式对比]]&lt;br /&gt;
基础混合模式。它会查看每个光源上的 Baked Contribution 选择器：如果设置为 ''Direct And Indirect''，则光源会像在 Full Lighting 模式下一样被烘焙。如果设置为 ''Indirect Only''，则只会烘焙该光源的间接光照（GI）。在后一种情况下，你应保持对象上的 Unity 光源和 Bakery 光源同时存在，一个提供实时直接光照，另一个提供预计算的全局光照（GI）。&lt;br /&gt;
&lt;br /&gt;
[[File:Indirectonly.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== Shadowmask =====&lt;br /&gt;
[[File:Image21.png|thumb|左：完全烘焙的光照。中：动态光源 + 烘焙 GI。右：胶囊形阴影、凹凸贴图和高光为动态光照，但立方体阴影和 GI 为烘焙光照。]]&lt;br /&gt;
[[File:Image6.png|thumb|当相机足够远离场景，或者动态阴影被禁用时，场景将呈现如下效果]]&lt;br /&gt;
更高级的混合模式。它通过生成两种类型的光照贴图来工作——一种包含烘焙颜色（如 Indirect 模式），另一种包含静态物体的阴影。它有几个优点：&lt;br /&gt;
* 实时阴影只需渲染少量动态对象，而不是整个场景。&lt;br /&gt;
* 实时阴影与烘焙阴影可以正确融合。&lt;br /&gt;
* 实时光源可以渲染凹凸贴图、高光和其他表面效果，同时仍会被高质量烘焙阴影遮挡。&lt;br /&gt;
[https://docs.unity3d.com/Manual/LightMode-Mixed-Shadowmask.html 更多详情]&lt;br /&gt;
&lt;br /&gt;
要启用此行为，你必须在同一对象上同时存在 Unity 光源和 Bakery 光源，并将 Baked Contribution 设置为 ''Shadowmask and Indirect''。未标记的光源将按 Indirect 模式进行烘焙。&lt;br /&gt;
&lt;br /&gt;
[[File:Smask22.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== Distance Shadowmask =====&lt;br /&gt;
此复选框仅在你选择 Shadowmask 时可见，并且只是切换项目 [https://docs.unity3d.com/Manual/LightMode-Mixed-ShadowmaskMode.html Quality Settings] 中同名的设置。&lt;br /&gt;
[https://docs.unity3d.com/Manual/LightMode-Mixed-DistanceShadowmask.html 更多详情]&lt;br /&gt;
{{note|由于缺少对应的脚本 API，该复选框在 Unity 5.6.x 上不可见。你可以在 Window-&amp;gt;Lighting-&amp;gt;Mixed Lighting-&amp;gt;Lighting Mode 中切换该设置。}}&lt;br /&gt;
{{note|在 Unity 版本 &amp;lt; 2017.3 中，由于 API 限制，渲染 Shadowmask 光照贴图会清除光照探针。烘焙后需要重新渲染光照探针。在较新版本中不应发生此问题。}}&lt;br /&gt;
&lt;br /&gt;
===== Subtractive =====&lt;br /&gt;
&lt;br /&gt;
启用 [https://docs.unity3d.com/Manual/LightMode-Mixed-Subtractive.html Subtractive] 光照模式。&lt;br /&gt;
&lt;br /&gt;
此选项对光照贴图本身没有任何特殊作用，实际上它的工作方式与 Full Lighting 相同。&lt;br /&gt;
&lt;br /&gt;
唯一的区别是，它还会将实时 Unity 光源设置为与 Subtractive 模式兼容（因为无法通过 UI 完成此操作）。&lt;br /&gt;
&lt;br /&gt;
你还需要在 [https://docs.unity3d.com/Manual/GlobalIllumination.html#MixedLighting Unity Lighting] 窗口中额外设置全局减法参数（例如全局阴影颜色）。&lt;br /&gt;
&lt;br /&gt;
===== Ambient Occlusion Only =====&lt;br /&gt;
仅烘焙环境光遮蔽（AO）。如果你很清楚自己在做什么，这可能会有用。请确保设置 [[#Ambient_occlusion|AO 选项]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Directional mode ===&lt;br /&gt;
[[File:Image3.png|thumb|不同方向模式的对比]]&lt;br /&gt;
定义了方向信息的烘焙方式。标准光照贴图每个像素只存储单一颜色，而方向光照贴图为着色器提供了关于该像素周围半球内光照变化的提示。这些数据用于在完全烘焙的区域中结合法线贴图。如果将其应用到内置的 [[#Bakery_shaders|Bakery]] 着色器中，还可以产生**近似高光反射**效果。&lt;br /&gt;
&lt;br /&gt;
===== None =====&lt;br /&gt;
不包含方向数据，每个像素仅有单一颜色。&lt;br /&gt;
&lt;br /&gt;
===== Baked Normal Maps =====&lt;br /&gt;
依然没有方向数据，但在渲染光照贴图时会考虑法线贴图。此方式在运行时没有额外开销。由于光照贴图的分辨率通常低于法线贴图，结果可能显得模糊。其他问题包括：由于缺乏 mipmapping，远处可能出现锯齿，以及降噪步骤可能导致细节被涂抹。要了解如何在此模式下使用具有程序化法线的自定义着色器，请参阅 [[#Normal_mapping|Normal Mapping]] 章节。&lt;br /&gt;
&lt;br /&gt;
===== Dominant Direction =====&lt;br /&gt;
此模式类似于 Unity 中 Enlighten 和 Progressive 烘焙器的实现。它与大多数着色器兼容，仅生成一张额外的贴图，运行时开销极小。缺点是凹凸贴图的效果较弱，略显灰暗，与实时光照下的同一物体相比可能差异较大。&lt;br /&gt;
&lt;br /&gt;
===== RNM =====&lt;br /&gt;
基于最初为《Half-Life 2》开发的 [https://steamcdn-a.akamaihd.net/apps/valve/2004/GDC2004_Half-Life2_Shading.pdf Radiosity Normal Mapping] 技术（相关演示文稿），后来被许多游戏采用（如《Mirror's Edge》）。此模式总共生成三张 HDR 贴图，是内存占用最高的模式之一，但运行时开销仍相对较低。该模式比 Dominant Direction 更精确，能更好地再现表面反差，并能正确处理来自不同角度、具有不同颜色的光照对法线贴图的影响。&lt;br /&gt;
&lt;br /&gt;
===== SH =====&lt;br /&gt;
基于论文《[https://media.contentapi.ea.com/content/dam/eacom/frostbite/files/gdc2018-precomputedgiobalilluminationinfrostbite.pdf Precomputed Global Illumination in Frostbite]》。这是最高质量的模式，能提供更好的表面对比度，并准确表现来自不同方向、不同颜色的光照。总共生成四张贴图，其中仅一张为 HDR，因此比 RNM 占用更少内存。运行时开销略高于 RNM。&lt;br /&gt;
&lt;br /&gt;
===== MonoSH =====&lt;br /&gt;
[[File:FY8Ru8hWIAAdYYH.jpg|thumb|Dominant Direction、完整 SH 与 MonoSH 的尺寸/质量对比]]&lt;br /&gt;
与 SH 类似，但使用单色的 L1 方向系数。表面对比度同样良好，虽然无法准确表现来自不同方向的不同颜色光照，但对多数场景来说已经足够。仅生成一张额外贴图，因此显存占用与带宽需求与 Dominant Direction 相近；事实上更低，因为 Dominant Direction 使用 RGBA 贴图，而 MonoSH 只需 RGB。该贴图通过内置的方向光照贴图系统传递，但''在标准着色器下显示不正确''。请务必使用兼容的着色器。&lt;br /&gt;
&lt;br /&gt;
===== 限制 =====&lt;br /&gt;
&lt;br /&gt;
* RNM 和 SH/MonoSH 只能与 [[#Bakery_shaders|Bakery shader]] 一起使用，或者需要对你的着色器进行调整。&lt;br /&gt;
* 在 RNM 和 SH 模式下，不会生成标准的颜色光照贴图。你需要确保场景中所有材质都使用 Bakery Shader，或者使用 [[#Bakery_Lightmap_Group_Selector|Lightmap Groups]] 将 RNM/SH 对象与其他对象分开。&lt;br /&gt;
* RNM 和 SH 贴图是通过 [https://docs.unity3d.com/ScriptReference/MaterialPropertyBlock.html MaterialPropertyBlock] 应用于对象的，因此在 Unity 的 Lighting 窗口中可能无法完全显示。&lt;br /&gt;
* Dominant Direction、RNM 和 SH/MonoSH 模式可能需要为全局光照（GI）和光照网格使用更多采样，以获得相近的质量。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Texels per unit ===&lt;br /&gt;
[[File:Texelscomp.jpg|thumb|1 vs 10 texels per unit]]&lt;br /&gt;
每个世界单位的光照贴图像素（Texels）近似数量。它会影响生成光照贴图的数量和分辨率。&lt;br /&gt;
&lt;br /&gt;
入门示例值：&lt;br /&gt;
&lt;br /&gt;
* 大型户外区域（城市）：1 - 5&lt;br /&gt;
* 中型户外区域（几条小巷）：10 - 20&lt;br /&gt;
* 高质量室内场景：100&lt;br /&gt;
&lt;br /&gt;
假设场景比例大约为 1 单位 = 1 米。在 Unity 中使用这种比例通常是推荐的，以便更好地导航和进行物理模拟。如果你的比例不同，请相应地调整 Texels。&lt;br /&gt;
&lt;br /&gt;
请注意，Texels Per Unit 是基础分辨率，但每个对象还可以通过 Mesh Renderer 上的 &amp;quot;Scale in Lightmap&amp;quot; 选项以及 Bakery 窗口中的 &amp;quot;Scale per map type&amp;quot; 进行额外调整。&lt;br /&gt;
&lt;br /&gt;
{{note| 将 &amp;quot;Scale in Lightmap&amp;quot; 设置为 0 的对象不会被烘焙，但仍会投射阴影并影响全局光照（GI）。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Max resolution ===&lt;br /&gt;
光照贴图的最大尺寸限制。如果对象无法容纳在单张光照贴图中（根据当前的 Texels Per Unit 值），将会分配额外的光照贴图。同样的四个正方形对象可以使用四张 512x512 的贴图，也可以使用一张 1024x1024 的贴图。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bounces ===&lt;br /&gt;
[[File:Image36.png|thumb|注意更多的反弹会为封闭空间带来更多光照。]]&lt;br /&gt;
定义光线在表面上反弹的次数。通常，对于户外场景（例如城市），较低的反弹次数就足够了，而对于封闭场景（室内、洞穴），则需要较高的反弹次数。&lt;br /&gt;
&lt;br /&gt;
虽然滑块最多限制为 5 次反弹，但可以在数字输入框中输入任意反弹次数。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Samples ===&lt;br /&gt;
[[File:Image7.png|thumb|左：Samples = 4，右：Samples = 16。为了演示，去噪功能已关闭。]]&lt;br /&gt;
影响全局光照（GI）的质量。典型值为 16 到 32。&lt;br /&gt;
&lt;br /&gt;
{{note| 可以输入超出滑块最大值的任意数字，但请注意，该数字表示最终光线数量的平方根，例如 32 表示 1024 条光线，64 表示 4096 条光线，依此类推。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GPU Priority ===&lt;br /&gt;
在 GPU 处理光照贴图时，操作系统和其他软件的响应可能会变慢。此选项允许你在烘焙速度和系统响应之间进行平衡。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render ===&lt;br /&gt;
为所有打开的场景烘焙光照贴图。&lt;br /&gt;
如果 [[使用手册#Light_probe_mode|Light Probe Mode]] 设置为 L1 或 L2，也会烘焙 [https://docs.unity3d.com/Manual/LightProbes.html 光照探针]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Render Light Probes ===&lt;br /&gt;
为所有打开的场景烘焙 [https://docs.unity3d.com/Manual/LightProbes.html 光照探针]。&lt;br /&gt;
&lt;br /&gt;
请注意，要在 Shadowmask 模式下对动态对象获得正确的混合光阴影，你还需要启用 [[使用手册#Occlusion_probes|occlusion probes]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Render Reflection Probes ===&lt;br /&gt;
为所有打开的场景烘焙反射探针。此按钮仅为方便起见，会调用引擎内置的反射探针更新功能。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update Skybox Probe ===&lt;br /&gt;
为当前的 skybox 烘焙全局漫反射和反射探针。与 “Render Reflection Probes” 一样，它仅调用引擎内置函数。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Occlusion probes ===&lt;br /&gt;
在渲染光照探针时，允许 Unity 使用当前选择的内置光照烘焙器烘焙遮挡探针（occlusion probes）。遮挡探针是存储在普通光照探针中的附加数据，可以防止动态对象在阴影区域被错误照亮。目前在 Unity 中无法使用自定义遮挡探针，必须调用内置光照烘焙器来完成此操作。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Warnings ===&lt;br /&gt;
这些选项会在按下任意 Render 按钮后对场景进行验证，并显示警告对话框，询问是否继续或停止烘焙过程。&lt;br /&gt;
&lt;br /&gt;
* Suppress all popups（屏蔽所有弹窗）：按下 Render 后不显示任何对话框。&lt;br /&gt;
* UV validation（UV 验证）：检查所有模型是否具有完全正确的光照贴图 UV，特别是 UV 是否位于 0-1 范围内且不重叠。&lt;br /&gt;
* Overwrite check（覆盖检查）：显示哪些光照贴图文件将被覆盖。&lt;br /&gt;
* Memory check（内存检查）：显示大致所需的视频内存量。&lt;br /&gt;
* Sample count check（采样数检查）：检查是否有光源、GI 或 AO 的采样数不合理，可能导致 GPU 超出可用资源。&lt;br /&gt;
* Lightmapped prefab validation（光照贴图预制体验证）：验证光照贴图预制体，并在某些预制体将被覆盖时发出通知。&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 (Advanced) ==&lt;br /&gt;
=== Light probe mode ===&lt;br /&gt;
更改光照探针的烘焙方式。&lt;br /&gt;
&lt;br /&gt;
* Legacy（传统模式）：使用 Render Light Probes 按钮生成探针。点光源和方向光在光照烘焙器中计算，而区域光/天空光/间接光则通过在每个探针位置渲染立方体贴图收集。结果以 [https://docs.unity3d.com/ScriptReference/Rendering.SphericalHarmonicsL2.html L2] 球谐（spherical harmonics）形式存储。缺点是立方体贴图渲染速度慢，并且在游戏中使用的着色器未物理正确表示光照表面，或者项目为移动平台设置时，光照贴图和探针可能不匹配（Unity 可能会裁剪高强度值）。&lt;br /&gt;
&lt;br /&gt;
* L1：在点击 Render 时，光照探针会与光照贴图一起渲染。此选项提供更高的烘焙性能，并保证探针光照与光照贴图匹配。结果以 L1 球谐形式存储（仍可被普通着色器使用）。使用 [[#Bakery_shaders|Bakery shader]] 的 Non-Linear Light Probe SH 选项可以进一步提升结果。&lt;br /&gt;
&lt;br /&gt;
* L2：更高质量（完整 L2 球谐）。与 L1 一样，会自动与光照贴图一起渲染。与 L1 相比，性能影响可忽略不计。应在所有着色器下显示正常。探针对比度/方向性/振铃去除可通过 Project Settings -&amp;gt; Bakery -&amp;gt; “Ringing removal for L2 light probes” 调整。&lt;br /&gt;
&lt;br /&gt;
'''在 Unity 2019.3 中似乎存在一个 bug，如果启用 Occlusion Probes 选项，Legacy 光照探针的颜色无法正确保存。使用 Occlusion Probes 时，默认且推荐使用 L2 模式。'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Asset UV Processing ===&lt;br /&gt;
配置资产的 UV 间距（padding）调整。可选值：&lt;br /&gt;
&lt;br /&gt;
* Don't change（不更改）：不修改资产。&lt;br /&gt;
* Adjust UV padding（调整 UV 间距）：会查找具有自动生成 UV 的模型（资产上启用 “Generate Lightmap UVs”），并进一步调整它们，使每个网格的 UV 岛之间具有适当间距。导入器设置中的全模型 Pack Margin 会被忽略。系统会根据每个网格的面积和光照贴图分辨率计算出最优值。&lt;br /&gt;
* Adjust UV padding for new meshes only（仅调整新网格的 UV 间距）：与上面相同，但会跳过之前至少调整过一次的模型。&lt;br /&gt;
* Remove UV adjustments（移除 UV 调整）：撤销所有之前的 UV 调整，使自动展开的模型恢复到 Unity 原始展开的样子。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser ===&lt;br /&gt;
设置所需的去噪器。可选值：&lt;br /&gt;
&lt;br /&gt;
* Optix 5：使用 OptiX 5.1 AI 去噪器（之前称为 “Legacy denoiser”）。在 GPU 上运行。支持从 [https://en.wikipedia.org/wiki/Kepler_(microarchitecture) Kepler]（通常是 GeForce 6xx）到 [https://en.wikipedia.org/wiki/Turing_(microarchitecture) Turing]（通常是 GeForce 20xx）的所有显卡。不支持 [https://en.wikipedia.org/wiki/Ampere_(microarchitecture) Ampere]（30xx）。OptiX 5.1 使用嵌入的静态训练数据集，因此不受驱动实现影响。&lt;br /&gt;
&lt;br /&gt;
* Optix 6：使用 OptiX 6.0 AI 去噪器（之前为默认选项）。在 GPU 上运行。在 Kepler（6xx）显卡上似乎无法使用，但在更新的显卡上均可运行，包括 Ampere（30xx）。自 6.0 起，OptiX 去噪器的训练数据集存储在驱动中。在 v442.50 之前，其行为类似于 OptiX 5.1；但之后 NVIDIA [https://forums.developer.nvidia.com/t/optix7-denoiser-different-results-with-different-version-of-drivers/117989/2 更改了数据集]，结果可能有所不同。更新后的数据集有时可能产生网格状图案和更亮的边缘（仍可通过 “Denoise: fix bright edges” 修复），但运行速度更快。&lt;br /&gt;
&lt;br /&gt;
* Optix 7：使用 OptiX 7.2 AI 去噪器。行为类似 OptiX 6.0，但在 Ampere（30xx）上可能支持更好。&lt;br /&gt;
&lt;br /&gt;
* OpenImageDenoise：使用 Intel Open Image Denoise 库。在 CPU 上运行（任何支持 SSE 4.1 的 CPU）。可能略慢于 OptiX，但质量可比。&lt;br /&gt;
&lt;br /&gt;
* OpenImageDenoise2：使用 Intel Open Image Denoise 2，CUDA 模式。在 GPU 上运行，性能与 OptiX 6/7 相当，质量与 CPU 版本相同。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Adjust sample positions ===&lt;br /&gt;
寻找最佳采样位置以防止光照泄漏。算法详情可参考 [https://ndotl.wordpress.com/2018/08/29/baking-artifact-free-lightmaps/#leaks 此处]。在某些情况下（通常是大型且多边形极少、法线平滑的几何体），可能会产生不正确的结果，此时可以将其禁用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Unload scenes before render ===&lt;br /&gt;
在烘焙前卸载 Unity 场景以释放显存。复杂场景仅在编辑器中显示就可能占用数 GB 的显存。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Denoise ===&lt;br /&gt;
[[File:Image31.png|thumb|左：未开启 “Denoise”，右：开启 “Denoise”。]]&lt;br /&gt;
如果启用，将应用去噪算法。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Fix Seams ===&lt;br /&gt;
[[File:Image22.png|thumb|左：缝隙（“Fix Seams” 关闭），右：缝隙已修复（“Fix Seams” 开启）。]]&lt;br /&gt;
如果启用，将尝试融合由 UV 不连续造成的缝隙。对平滑几何体很有用，包括 Unity 默认的球体。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Split by scene ===&lt;br /&gt;
如果同时加载多个场景，并且启用此选项，每个场景将拥有自己的一套光照贴图，而不会与其他场景共享。这对于在运行时流式加载场景时限制纹理占用量非常有用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hole filling ===&lt;br /&gt;
[[File:Holefilling.jpg|thumb|“Hole filling” 关闭与开启的对比。]]&lt;br /&gt;
如果 Atlas Packer 设置为 xatlas，将尝试填充每个孔洞，从而生成更高效的贴图集。对于几何体非常复杂的场景，可能会增加场景导出时间，但通常推荐开启。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Min resolution ===&lt;br /&gt;
光照贴图的最小尺寸限制。可用于在生成大量小而完全填充的光照贴图与少量未完全填充的光照贴图之间进行平衡。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Scale per map type ===&lt;br /&gt;
允许你对颜色贴图、Shadowmask 和方向贴图设置不同的分辨率缩放。例如，常见情况是间接光颜色分辨率较低，但 Shadowmask 分辨率较高。请注意，缩放在光照贴图渲染完成后才应用，因此不会节省烘焙时间。如果启用了 “Adjust UV padding”，间距将基于最低分辨率的贴图，以防止像素泄漏。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Checker preview ===&lt;br /&gt;
[[File:Image12.png|thumb|Checker Preview 功能演示。]]&lt;br /&gt;
如果勾选了 “Show checker” 选项，场景视图将在可见对象上渲染棋盘格图案，以展示光照贴图像素大小。这对于在烘焙前确保 Texels Per Unit 和其他影响分辨率的设置使用合理数值非常有用。&lt;br /&gt;
&lt;br /&gt;
启用 Checker Preview 将强制 Bakery 执行贴图集打包。可能需要一些时间，但通常不会超过几秒钟。在修改场景内容后，按下 “Refresh checker” 可重新打包场景以查看更改。&lt;br /&gt;
&lt;br /&gt;
Checker Preview 还使用随机颜色显示场景将如何被分割到不同的光照贴图中。&lt;br /&gt;
&lt;br /&gt;
{{note| 当前 Checker Preview 无法显示地形的正确像素大小。}}&lt;br /&gt;
&lt;br /&gt;
==== Atlas preview ====&lt;br /&gt;
[[File:FN-TmhRXwAE9i2I.png|thumb|Atlas Preview 功能演示]]&lt;br /&gt;
当 Checker Preview 开启时，会显示 Atlas Preview 按钮。点击它将打开一个新窗口，显示未来光照贴图的 UV 布局。点击 &amp;quot;&amp;lt;&amp;quot; 和 &amp;quot;&amp;gt;&amp;quot; 按钮可浏览各个光照贴图。&lt;br /&gt;
这对于在烘焙前检查打包质量和光照贴图数量非常有用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Emissive boost ===&lt;br /&gt;
将任何表面自发光（emission）乘以此数值。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Indirect boost ===&lt;br /&gt;
将所有反弹光照乘以此数值。作用与光源组件上的 Indirect Intensity 相同，但为全局设置。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Backface GI ===&lt;br /&gt;
[[File:Image30.jpg|thumb|Backface GI]]&lt;br /&gt;
[[File:Image35.png|thumb|左：“Backface GI” = 0，右：“Backface GI” = 1。注意阴影区域接收到更多的绿色光照。]]&lt;br /&gt;
决定光线通过前面表面到达背面并被全局光照（GI）反弹的程度。这对于薄的半透明表面（如树叶）尤其有用。取值范围为 0-1。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Ambient occlusion ===&lt;br /&gt;
[[File:Image15.png|thumb|左：AO intensity = 0，右：AO intensity = 1。]]&lt;br /&gt;
一种简单的非物理环境光遮蔽（Ambient Occlusion，AO），可在最终场景光照上叠加以增强美观效果。&lt;br /&gt;
&lt;br /&gt;
* Intensity（强度）：控制 AO 效果的可见度。值为 0 时禁用该效果。&lt;br /&gt;
* Radius（半径）：决定 AO 效果使用的光线距离。较小的值产生局部遮蔽（角落、褶皱），较大的值则更类似 Skylight，从远处物体产生阴影。&lt;br /&gt;
* Samples（采样数）：影响环境光遮蔽的质量。典型值为 4 到 32。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dither transparency ===&lt;br /&gt;
通过自动抖动不透明度贴图来启用半透明阴影。[[使用手册#Opacity|了解 Bakery 如何处理不透明度贴图]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== RTX Mode ===&lt;br /&gt;
启用 RTX 硬件加速。仅 RTX 显卡可受益于此选项。最低支持的驱动版本为 418。&lt;br /&gt;
&lt;br /&gt;
驱动可以在大多数非 RTX Nvidia 显卡上模拟 RTX 模式，但通常会更慢。&lt;br /&gt;
&lt;br /&gt;
在 Ampere（3xxx）或更新的显卡上，RTX 模式 ''必须'' 启用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Export terrain trees ===&lt;br /&gt;
如果启用，绘制在地形上的树木将影响光照。树木本身不会被烘焙。请注意，在烘焙过程中，每棵树都使用最高可能的 LOD 等级。对于多公里范围且模型高度复杂的森林场景，不建议使用此选项。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Terrain optimization ===&lt;br /&gt;
如果启用（默认），地形将使用独立的光线追踪技术以利用其高程图几何结构。否则，它们将像其他普通网格一样处理。地形优化可以显著减少高分辨率地形所需的内存占用。在某些情况下，它还能加快地形烘焙速度，但在其他情况下（尤其是简单低分辨率地形）可能需要禁用该选项。&lt;br /&gt;
&lt;br /&gt;
{{note| 地形优化当前不兼容绘制的地形洞。需禁用此选项才能使其正常工作。}}&lt;br /&gt;
{{note| 地形优化仅支持非 RTX 模式。}}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Light Mesh batch limit ===&lt;br /&gt;
如果该值大于 0，会将多个 Light Mesh 合并为一个，前提是它们具有相同设置并影响相同的 Lightmap Groups，同时将它们的总采样数限制为该值（例如，如果限制为 64，则可以合并 2 个采样数为 32 的灯光，或 4 个采样数为 16 的灯光，等等）。在拥有大量 Light Mesh 的场景中，这可以提升性能。但设置过高时需小心，因为 GPU 在一次处理过多采样时可能触发操作系统驱动超时。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Compress volumes ===&lt;br /&gt;
如果启用，将对体积 3D 贴图应用纹理压缩，并将 Bakery 着色器切换到相应的采样模式。不推荐对分辨率非常低的体积使用此选项。体积大小可能会被调整为 4 的倍数。&lt;br /&gt;
&lt;br /&gt;
注意事项：&lt;br /&gt;
&lt;br /&gt;
* 目前仅支持压缩为 BC6H/BC7 纹理格式（桌面/主机平台）。&lt;br /&gt;
* 体积压缩仅支持 Unity 2020.1 或更高版本。&lt;br /&gt;
* 目前仅标准渲染管线的 Bakery 着色器支持使用压缩体积贴图。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Samples multiplier ===&lt;br /&gt;
将所有阴影和 GI 采样数乘以指定因子。可用于在草稿质量和最终质量之间快速切换。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Tile size ===&lt;br /&gt;
与 [[#GPU Priority|GPU Priority]] 相同，但这里设置的是贴图块（tile）大小。Bakery 会将光照贴图拆分为更小的块，并一次更新一个块。块越小，GPU 工作被中断的次数越多，系统响应性可能更好。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Temp path ===&lt;br /&gt;
临时文件夹。在渲染过程中，Bakery 可能需要几个 GB 的可用空间。将此文件夹放在 SSD 上相比 HDD 可略微加快渲染速度。目前，该文件夹不会自动清理。你可以随时手动删除其内容（渲染时除外），或通过 Bakery -&amp;gt; Utilities -&amp;gt; Clear cache 清理。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Output path ===&lt;br /&gt;
光照贴图文件夹。所有光照贴图，以及 lightprobe 和顶点颜色（vertex color）资源都将保存在此处。该路径相对于你的 Assets 文件夹。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Use scene named output path ===&lt;br /&gt;
如果启用此选项，输出路径将自动设置为与当前活动场景同名的文件夹（Assets/CurrentSceneName/）。这与 Unity 内置光照贴图烘焙器的行为类似。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render Selected Groups ===&lt;br /&gt;
仅烘焙包含所选对象的 Lightmap Groups。&lt;br /&gt;
不仅仅是所选对象会被重新绘制，它们所属的所有 Lightmap Groups 都会被处理。其他光照贴图不会被更新。如果对象不属于某个手动分配的组，则使用相同光照贴图的场景部分将被重新烘焙。&lt;br /&gt;
&lt;br /&gt;
目前，使用 [[Partial_scene_baking|Sectors]] 进行场景部分烘焙更为方便。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Beep on finish ===&lt;br /&gt;
如果启用，Bakery 在烘焙完成时会播放提示音。&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 (Experimental) ==&lt;br /&gt;
=== Unwrapper ===&lt;br /&gt;
如果启用 [[#Asset_UV_Processing|Adjust UV Padding]]，则定义将使用的展开器（unwrapper）。&lt;br /&gt;
&lt;br /&gt;
* Default：使用 Unity 标准展开器。Bakery 会为每个具有不同间距参数的网格调用 [https://docs.unity3d.com/ScriptReference/Unwrapping.GenerateSecondaryUVSet.html Unwrapping.GenerateSecondaryUVSet]。&lt;br /&gt;
* xatlas：使用 [https://github.com/jpcy jpcy] 的 [https://github.com/jpcy/xatlas xatlas]，这是 [https://github.com/castano Ignacio Castaño] 的 [https://github.com/Thekla/thekla_atlas thekla_atlas] 的修改版。thekla_atlas 曾用于游戏《The Witness》（[http://the-witness.net/news/2010/03/graphics-tech-texture-parameterization/ 参见博客文章]）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Atlas Packer ===&lt;br /&gt;
选择在将不同对象的 UV 布局打包到大型光照贴图集时使用的算法。&lt;br /&gt;
* Default：Bakery 在 v1.7 之前使用的原始算法。&lt;br /&gt;
* xatlas：使用 xatlas。&lt;br /&gt;
&lt;br /&gt;
某些功能仅支持特定的贴图集打包器：&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Default&lt;br /&gt;
! xatlas&lt;br /&gt;
|-&lt;br /&gt;
| [[使用手册#Bakery_Lightmap_Group_Selector|Override resolution]]&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
|-&lt;br /&gt;
| 高效 LOD 打包&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
|-&lt;br /&gt;
| [[使用手册#Hole_filling|Hole filling]]&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
请注意，贴图集打包器（Atlas Packer）也可以为每个 Lightmap Group 单独选择。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Export geometry and maps ===&lt;br /&gt;
如果启用，Bakery 会在渲染前将场景导出为其专用格式。如果你确定场景的几何体和贴图以及光照贴图分辨率设置没有改变（例如，你只是调整 GI 或光源设置），可以禁用此选项以加快下一次渲染速度。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update unmodified lights ===&lt;br /&gt;
如果启用，Bakery 会重新计算自上次渲染以来未改变的光源。如果你只是调整某个光源，不想等待其他光源重新渲染，可以禁用此选项。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update modified lights and GI ===&lt;br /&gt;
如果启用，Bakery 会重新计算自上次渲染以来发生变化的 GI 和光源。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== UV padding: increase only ===&lt;br /&gt;
仅在启用 [[#Asset_UV_Processing|Adjust UV padding]] 时可见。默认情况下，模型资源的最佳 UV 间距仅基于当前加载的场景进行计算。如果同一模型有多个实例使用不同的光照贴图分辨率，最小的分辨率将决定间距，以确保 UV 图块之间的间距足够大，防止相互重叠。然而，在两个不同的独立场景中烘焙同一模型时，为新场景优化可能会破坏之前场景中的 UV。勾选此选项可以防止这种情况发生，即永远不减小间距值，从而始终为曾经烘焙过的最低分辨率实例进行优化。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoise: fix bright edges ===&lt;br /&gt;
[[File:Image19.png|thumb|左：去噪后可见明亮边缘；右：已修复。]]&lt;br /&gt;
仅在 [[#Denoise|Denoise]] 启用时可见。有时用于去噪的神经网络可能会在阴影周围产生明亮边缘，就像应用了锐化效果一样。如果启用此选项，Bakery 会尝试将其滤除。启用后，去噪阶段可能会略微变慢。&lt;br /&gt;
&lt;br /&gt;
此功能也可用于滤除“火花”（fireflies），即光照贴图中偶尔出现的亮点。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Post-packing ===&lt;br /&gt;
有时在渲染场景时，Bakery 会将光照贴图拆分为多个子光照贴图，例如在烘焙不同 LOD 或地形时。&lt;br /&gt;
Post-packing 会尝试通过将这些子光照贴图合并到同一纹理中来最小化最终贴图集数量。&lt;br /&gt;
建议保持此选项启用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Combine with Enlighten real-time GI ===&lt;br /&gt;
如果启用，则在按下 Render 按钮时，Bakery 会首先尝试使用 Enlighten 烘焙以计算实时 GI。之后，将进行常规的 Bakery 光照贴图烘焙过程。烘焙 GI 和实时 GI 将协同工作。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bake on remote server ===&lt;br /&gt;
启用网络烘焙（[[Network baking|Network baking]]）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Presets ===&lt;br /&gt;
当前在 Experimental 模式下的 Render/Update 按钮下显示。&lt;br /&gt;
&lt;br /&gt;
* 点击 '''New''' 将所有当前设置保存到预设文件中。&lt;br /&gt;
* 默认情况下，当一个预设处于激活状态时，所有设置都会被灰显，以防止覆盖预设。&lt;br /&gt;
* 点击 '''Modify preset''' 可更改设置并覆盖预设。&lt;br /&gt;
* 可以通过预设字段切换预设。将其设置为 None 可禁用预设使用。&lt;br /&gt;
&lt;br /&gt;
== 组件 ==&lt;br /&gt;
=== Bakery Lightmap Group Selector ===&lt;br /&gt;
指定对象及其所有子对象使用的 '''Lightmap Group'''。&lt;br /&gt;
Lightmap Group 是 Bakery 用来表示共享同一光照贴图的对象集合的术语。每个组都有属性，告诉 Bakery 如何打包对象、哪些光源影响它们，以及结果是烘焙到纹理还是顶点。&lt;br /&gt;
&lt;br /&gt;
默认情况下，所有静态对象会自动打包到多个光照贴图组（贴图集）中，因此通常无需手动管理。手动定义组仅用于特殊用途，例如：&lt;br /&gt;
&lt;br /&gt;
* 指定某些对象使用 [[Vertex Lightmaps|每顶点光照贴图]] 而非纹理。&lt;br /&gt;
* 使用建模软件中的原始未缩放 UV 烘焙光照贴图。&lt;br /&gt;
* 将关卡的特定区域分组以使用单张光照贴图，从而便于资源流式加载或通过脚本在运行时切换不同的烘焙光照。&lt;br /&gt;
* 使用 Render Selected Groups 按钮仅更新已分组的对象。&lt;br /&gt;
&lt;br /&gt;
要手动定义组，可以创建 '''Lightmap Group Assets'''，方法包括使用 Assets-&amp;gt;Create 菜单，或在组件中使用 Create New 按钮。使用 Create New 按钮时，将根据以下表单创建新的资源：&lt;br /&gt;
&lt;br /&gt;
* Name：要创建的 Lightmap Group 资源的名称。&lt;br /&gt;
* Packing Mode：此选择器定义 Lightmap Group 的打包模式，共有 3 种模式：&lt;br /&gt;
** Original UV：对象及其子对象将使用未修改的 UV 进行烘焙，不执行打包。适用于多个网格共享同一已打包 UV 布局的模型。&lt;br /&gt;
** Pack Atlas：对象及其子对象将打包到专用纹理贴图集中。在 v1.3 之前，每个可打包的子对象都需要有此组件，但现在不再需要。每个子对象将作为单独矩形打包，除非 Bakery 自动检测到子对象有非重叠的子对象，在这种情况下，多个对象可以使用同一个矩形。&lt;br /&gt;
** Vertex：对象及其子对象将使用顶点色烘焙光照而非纹理。注意，需要使用自定义着色器才能生效，例如 [[#Bakery_shaders|Bakery Shader]]。文档中也提供了一个简单的着色器（“Bakery/Simple Vertex Lightmapped”）用于演示和参考。[[Vertex Lightmaps|了解更多关于顶点光照贴图的信息]]。&lt;br /&gt;
* Directional mode：允许你覆盖该组的 [[#Directional mode|directional mode]]。选项与全局相同，Auto 将使用全局设置。&lt;br /&gt;
* Resolution：所需的光照贴图分辨率。&lt;br /&gt;
* Auto-resolution：使用 [[使用手册#Texels_per_unit|Texels Per Unit]] 来确定最接近的二次幂分辨率。&lt;br /&gt;
* Atlas packer：为该组选择 [[使用手册#Atlas_Packer|贴图集打包]] 算法。&lt;br /&gt;
* Bitmask：用于排除光源影响光照贴图的开关列表。每个 Bakery 光源也有一个位掩码设置。光源只会影响与其共享至少一个开关的 Lightmap Group。默认设置意味着所有光源影响所有光照贴图。&lt;br /&gt;
&lt;br /&gt;
[[File:Ts.jpg|thumb|Transparent selfshadow关闭 vs 开启：注意一些单面但背向的多边形如何被正确照亮。]]&lt;br /&gt;
&lt;br /&gt;
如果你有一个被分配了“Pack Atlas”模式的 Lightmap Group，组件上将会出现额外设置：&lt;br /&gt;
&lt;br /&gt;
* Override resolution：覆盖该对象及其子对象在光照贴图中占用的分辨率。&lt;br /&gt;
* Resolution：手动定义的分辨率。例如，如果你有一个分辨率为 512 的光照贴图，并且分配给 4 个对象，同时覆盖分辨率设置为 256，Bakery 将生成一个 512x512 的光照贴图，每个对象正好占据 256x256 的区域。&lt;br /&gt;
&lt;br /&gt;
如果你选择一个 Lightmap Group 资产，将会显示额外的实验性设置：&lt;br /&gt;
* [[Subsurface scattering|Subsurface scattering: (点击阅读更多)]]&lt;br /&gt;
* Normal offset：允许你将光线从表面偏移。这很少有用，主要用于实验目的。&lt;br /&gt;
* Transparent selfshadow：从表面后方发射光线，使其不会在自身投射阴影。对于半透明叶片可能有用。&lt;br /&gt;
* Vertex sampling density，(仅当 Packing Mode 设置为 Vertex 时可用）：默认情况下，每个顶点只计算一个值；如果采样密度 &amp;gt; 0，则会在三角形上分散采样并求平均，从而生成超采样、更平滑的结果。&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Lightmapped Prefab ===&lt;br /&gt;
此组件允许预制件存储光照贴图元数据。这样处理后的预制件可以在任意场景中实例化，无论是在编辑器中还是运行时。&lt;br /&gt;
该组件应直接添加到预制件的根对象上。不支持嵌套预制件。由于预制件在烘焙后会被覆盖（类似于按下“Apply”按钮的效果），因此要求预制件没有任何未应用的更改（子对象不应移动，材质和脚本参数应保持不变等）。如果检测到此类更改，组件界面会显示错误，烘焙后不会保存任何元数据。如果启用了 [[#Warnings|Lightmapped prefab validation]] 警告，所有预制件错误也会在烘焙前以对话框形式显示。&lt;br /&gt;
&lt;br /&gt;
光照贴图预制件支持所有 Bakery 功能，例如 LOD、地形、方向光贴图、RNM、SH、顶点模式和 Shadowmask。要使 Shadowmask 生效，光源也必须是同一预制件的一部分。&lt;br /&gt;
&lt;br /&gt;
{{note| 注意，由于 API 限制，预制件 Shadowmask 仅在 Unity 2017.4 或更高版本中可用。}}&lt;br /&gt;
&lt;br /&gt;
烘焙后，一个名为 “BakeryPrefabLightmapData” 的对象会被添加到预制件中。该对象包含一个脚本，存储应用光照贴图所需的所有数据。&lt;br /&gt;
&lt;br /&gt;
此外，光照贴图预制件允许保存当前渲染设置，并使用两个按钮将其加载回任意已打开的场景：&lt;br /&gt;
&lt;br /&gt;
* Save current render settings to prefab：在该预制件上存储当前渲染设置的副本。&lt;br /&gt;
* Load render settings from prefab：将当前渲染设置设置为预制件中存储的设置。&lt;br /&gt;
  [[File:Upload 2019-9-17 10-32-34.png|thumb|应用预制件]]&lt;br /&gt;
&lt;br /&gt;
烘焙光照贴图预制件时，建议检查：&lt;br /&gt;
&lt;br /&gt;
* 预制件已“应用”。在旧版 Unity 中，点击 Inspector 右上角的 “Apply” 按钮。在新版 Unity 中，点击 “Overrides” 列表，然后选择 “Apply All”。&lt;br /&gt;
* 预制件组件 UI 不显示任何错误。&lt;br /&gt;
* [推荐] 在主窗口启用 “Lightmapped prefab validation” 复选框。点击 Render 时不会显示任何关于预制件的警告对话框。&lt;br /&gt;
&lt;br /&gt;
{{note| 光照贴图以其烘焙所在的场景或所使用的 Lightmap Group 命名（如果有）。在同一场景中烘焙不同预制件时，请确保使用不同命名的 [[使用手册#Bakery_Lightmap_Group_Selector|Lightmap Group]] 或更改 [[使用手册#Output_path|输出路径]]。}}&lt;br /&gt;
&lt;br /&gt;
{{note| 当使用相同模型逐个烘焙多个预制件时，建议将 [[使用手册#Asset_UV_Processing|Asset UV Processing]] 设置为“Don't Change”，以防止修改共享模型的 UV。}}&lt;br /&gt;
&lt;br /&gt;
{{note| Bakery 的预制件工作流程是在 Unity 提供“预制件双击进入视图”功能之前实现的。因此，在隔离预制件视图中光照贴图可能无法正确应用，组件可能显示 “This GameObject is not a prefab” 信息。但在普通场景中使用时应能正常工作。}}&lt;br /&gt;
&lt;br /&gt;
{{note| 当解包已烘焙的预制件并取消与现有光照贴图的关联时，请确保删除保存预制件范围光照贴图/渲染器连接的 BakeryPrefabLightmapData 对象。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Direct Light ===&lt;br /&gt;
[[File:Directlight.jpg|thumb|纯直射光 + GI]]&lt;br /&gt;
[[File:Image4.png|thumb|左：“Shadow Spread” = 0.01，右：0.05。注意阴影从锐利逐渐变模糊的效果。]]&lt;br /&gt;
无限远方向光（例如太阳）。&lt;br /&gt;
&lt;br /&gt;
* Color：光的颜色。&lt;br /&gt;
* Intensity：线性色彩乘数。&lt;br /&gt;
* Shadow Spread：光源尺寸，或者简单说，阴影的模糊度。0 = 阴影最锐利，1 = 阴影最模糊。从技术上讲，它在单条光线与更宽光锥之间插值。&lt;br /&gt;
* Shadow Samples：影响阴影质量。Shadow Spread 值越小，所需样本越少即可得到干净图像。太阳阴影的典型值为 1 到 16。设置为 0 时，该光源的阴影将消失。&lt;br /&gt;
* Bitmask：用于排除此光源对特定 Lightmap Groups 影响的开关列表。&lt;br /&gt;
* Baked contribution：确定应烘焙哪类光照数据。仅在 Indirect 或 Shadowmask 模式可见。可选值：&lt;br /&gt;
** Direct and Indirect：直射光与间接光都完全烘焙。&lt;br /&gt;
** Indirect only：实时光提供直射贡献，仅烘焙间接光。&lt;br /&gt;
** Shadowmask and indirect：实时光提供直射贡献，静态几何体的阴影烘焙到单独贴图，动态与静态阴影混合。间接光正常烘焙。&lt;br /&gt;
** Direct, Indirect, Shadowmask（仅自定义光照）：与直射和间接相同，但 Shadowmask 也生成，可与自定义着色器一起使用。&lt;br /&gt;
* Denoise shadowmask：确定是否对该光源的 Shadowmask 应用去噪。通常不需要，因为阴影噪点不明显，但对非常宽且模糊的阴影（大 Shadow Spread）可能有用。&lt;br /&gt;
* Indirect intensity：非物理 GI 乘数。自然光照应为 1，可根据场景风格调整。&lt;br /&gt;
* Anti-alias：对阴影执行超采样。&lt;br /&gt;
* Texture projection：在光照上投射乘法平铺纹理，可用于模拟远处云影。&lt;br /&gt;
当设置了纹理投影时，可以使用“Tiling”和“Offset”字段调整其缩放和偏移。或者，点击 &amp;quot;Tweak projection in Scene View&amp;quot; 并使用额外的 Gizmo 可视化移动和缩放投影。点击“Render reference frame”可保存光源视角的 PNG，这对于在场景上绘制云影很有用。&lt;br /&gt;
&lt;br /&gt;
如果同一对象同时启用了 Unity 和 Bakery 光源且参数不匹配，会出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match lightmapped to real-time：将 Unity 光源的通用设置复制到 Bakery 光源。&lt;br /&gt;
* Match real-time to lightmapped：将 Bakery 光源的通用设置复制到 Unity 光源。&lt;br /&gt;
&lt;br /&gt;
{{note| 从物理角度看，Bakery 的方向光强度（Intensity）等于照度（Lux）除以 π。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Sky Light ===&lt;br /&gt;
[[File:Skylight.jpg|thumb|纯天空光与 GI]]&lt;br /&gt;
无限远的带阴影环境光（天空）。&lt;br /&gt;
&lt;br /&gt;
* Color: 颜色。&lt;br /&gt;
* Intensity: 线性色彩倍增。&lt;br /&gt;
* Sky texture: 可选的立方体贴图资源，例如 HDRI 全景图，用于从不同方向影响光照颜色。&lt;br /&gt;
  {{note| 旋转天空光的 GameObject 会相应旋转立方体贴图的光照。}}&lt;br /&gt;
* Samples: 影响阴影质量。典型值为 8 到 32。&lt;br /&gt;
* Hemispherical: 如果启用，光照仅来自上方（上半球）。否则来自所有方向。&lt;br /&gt;
* Bitmask: 用于排除此光源影响特定 Lightmap Groups 的开关列表。&lt;br /&gt;
* Baked contribution: 决定应烘焙哪种光照数据。仅在 Indirect/Shadowmask 模式下可见。可能值：&lt;br /&gt;
** Direct and Indirect: 直接和间接光照都将完全烘焙。这是默认且推荐的天空光行为，因为在 Unity 中没有实时版本可以模拟它们。&lt;br /&gt;
** Indirect only: 假定实时光源提供直接贡献；仅烘焙间接光照。&lt;br /&gt;
&lt;br /&gt;
如果天空光的设置与当前场景的天空盒不匹配，将出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match this light to scene skybox: 将活动天空盒材质的通用设置复制到 Bakery 天空光。当前仅支持使用 “Skybox/Cubemap” 或 “Skybox/Bakery skybox” 着色器的天空盒。&lt;br /&gt;
* Match scene skybox to this light: 将 Bakery 天空光的通用设置复制到场景天空盒。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bakery Light Mesh ===&lt;br /&gt;
[[File:Image29.png|thumb|Left: Samples Near = 0, Samples Far = 4096.&amp;lt;br&amp;gt;&lt;br /&gt;
Middle: Samples Near = 0, Samples Far = 128.&amp;lt;br&amp;gt;&lt;br /&gt;
Right: Samples Near = 16, Samples Far = 128.&amp;lt;br&amp;gt;&lt;br /&gt;
请注意，光照效果看起来相似，但使用的合并采样数量更少。]]&lt;br /&gt;
任何形状的自发光网格。应与 Mesh Renderer 组件或设置为 Area 模式的 Light 组件一起使用。&lt;br /&gt;
&lt;br /&gt;
* Color：颜色&lt;br /&gt;
* Intensity：线性颜色倍增器&lt;br /&gt;
* Cutoff：最大光照距离。Bakery 会在接近该限制时额外衰减正确的平方反比衰减。当 Cutoff 值刚好对应物理衰减变得非常暗的位置时效果最佳。Cutoff 可提升烘焙性能，也可以设置为非常高（不可达）的值以保证完全正确性。&lt;br /&gt;
* Self Shadow：决定光源网格自身是否投射阴影。此选项同时启用更精确的光照算法。&lt;br /&gt;
* Samples Near：影响靠近网格的光照质量。典型值为 16 到 64，仅当 Self Shadow 开启时可用。&lt;br /&gt;
* Samples Far：影响远离网格的光照质量。典型值为 4 到 4096。&lt;br /&gt;
&lt;br /&gt;
Bakery 基于光源表面距离混合两种不同的区域光算法。靠近光源时，算法类似 GI，而远处光源被近似为虚拟点光云。&lt;br /&gt;
&lt;br /&gt;
{{note| &amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;光源网格自身不会接收光照，也不会被烘焙到光照贴图中。&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;一个拥有大量多边形的光源网格比烘焙多个简单的光源网格要快&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;如果结果总是脏/噪点较多，可以尝试将 Samples Near 设置为 0，这样只使用 VPL 算法。对于不需要精度的简单光源（如建筑物的窗户光），这也非常有用。&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;}}  &lt;br /&gt;
[[File:Dd99d-QU0AEKFBK.jpg|thumb|弯曲的光源网格]]  &lt;br /&gt;
* Bitmask：用于排除此光源影响特定 Lightmap Groups 的开关列表。  &lt;br /&gt;
* Baked contribution：决定烘焙哪种类型的光照数据。仅在 Indirect 或 Shadowmask 模式下可见。可能的值：  &lt;br /&gt;
** Direct and Indirect：完全烘焙直接和间接光贡献。这是默认且推荐的光源网格行为，因为 Unity 中没有实时版本可以模拟它们。  &lt;br /&gt;
** Indirect only：实时光源提供直接光贡献，仅烘焙间接光。  &lt;br /&gt;
** Shadowmask and Indirect：实时光源提供直接光贡献，但静态几何体的阴影会烘焙到单独的贴图。动态和静态阴影将混合在一起。间接光照将照常烘焙。目前仅 HDRP（和自定义渲染器）支持混合区域光。  &lt;br /&gt;
** Direct, Indirect, Shadowmask (custom lighting only)：与 Direct and Indirect 相同，但同时生成 Shadowmask 并分配用于自定义着色器。  &lt;br /&gt;
* Indirect intensity：非物理 GI 倍增器。自然光照应设为 1，但可修改以实现更风格化的场景。  &lt;br /&gt;
* Shadowmask with falloff：将完整光衰减烘焙进 Shadowmask（仅对自定义着色器有用）。  &lt;br /&gt;
&lt;br /&gt;
如果网格材质和光源设置不匹配，将出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match light to material：将网格材质或区域光的通用设置复制到 Bakery 光源。&lt;br /&gt;
* Match material to light：将 Bakery 光源的通用设置复制到网格材质或区域光。&lt;br /&gt;
&lt;br /&gt;
==== Light Mesh 与自发光材质的区别 ====&lt;br /&gt;
自发光材质：&lt;br /&gt;
&lt;br /&gt;
* 在 GI 计算中传播光线，因此是“免费的”，无论有多少网格是自发光的。&lt;br /&gt;
* 小而明亮的光可能会产生不准确或有噪点的结果，这取决于 GI 的采样数量。&lt;br /&gt;
* 由于 Bakery 中 GI 的工作方式，它必须占用光照贴图空间，因此可能会浪费空间。同时，这意味着自发光对象需要有效的 UV，并且必须启用“投射阴影”。&lt;br /&gt;
&lt;br /&gt;
Light Mesh：&lt;br /&gt;
&lt;br /&gt;
* 光照会为每个光源单独计算，因此比自发光材质慢。&lt;br /&gt;
* 设计用于为小而明亮的光提供干净的光照效果，即使距离很远也能保持效果。&lt;br /&gt;
* 不占用光照贴图空间。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Point Light ===&lt;br /&gt;
[[File:Image11.png|thumb|左：“Shadow Spread” = 0.5，右：“Shadow Spread” = 1。]]&lt;br /&gt;
点光源，没有面积。尽管在物理上不可能，但在游戏中很有用，并且是匹配 Unity 点光源和聚光灯的唯一方式。&lt;br /&gt;
{{note| 聚光灯只是带有额外投影遮罩的点光源。}}&lt;br /&gt;
&lt;br /&gt;
* Color: 颜色&lt;br /&gt;
* Intensity: 线性色彩倍增&lt;br /&gt;
* Shadow spread: 阴影模糊度。虽然点光源没有面积，但通常希望它仍能产生模糊阴影。为此，阴影被模拟为从球形区域光源投射。此参数定义了虚拟球体的半径，直接影响阴影模糊度。&lt;br /&gt;
* Physical falloff: 如果启用，将使用正确的平方反比衰减，并在边界附近额外衰减。否则将尝试模拟 Unity 的衰减。&lt;br /&gt;
* Falloff min size: 详见 [[Point Light Attenuation]] 部分。&lt;br /&gt;
* Range: 如果物理衰减被禁用，则等于 Unity 的光源范围；如果启用，只会在边缘轻微衰减物理衰减。&lt;br /&gt;
* Samples: 影响阴影质量。典型值为 1 到 512。设置为 0 将使该光源的阴影消失。&lt;br /&gt;
  [[File:Image10.png|thumb|从左到右：Omni，Cookie（默认聚光灯纹理），Cubemap，IES。]]&lt;br /&gt;
* Projection mask: 遮罩/Cookie 类型。选项：&lt;br /&gt;
** Omni: 无遮罩，相当于 Unity 的点光源。&lt;br /&gt;
** Cookie: 纹理投影遮罩。附加选项：&lt;br /&gt;
*** Cookie texture: 2D 纹理资源。Bakery 包含原始 Unity 聚光灯纹理（名为 ftUnitySpotTexture），可用于模拟。&lt;br /&gt;
*** Angle: 纹理投影角度（类似 Unity 聚光灯）。&lt;br /&gt;
*** Correct distortion: 修正宽角下直线可见的 cookie 失真。&lt;br /&gt;
** Cubemap: 立方体贴图投影遮罩。附加选项：&lt;br /&gt;
*** Projected cubemap: 立方体贴图资源。&lt;br /&gt;
** IES: 光照由 IES 文件数据调制。附加选项：&lt;br /&gt;
*** IES file: .ies 扩展名文件。&lt;br /&gt;
* Bitmask: 用于排除该光源影响特定 Lightmap Groups 的开关列表。&lt;br /&gt;
* Baked contribution: 决定应烘焙哪种类型的光照数据。仅在 Indirect 或 Shadowmask 模式下可见。可能值：&lt;br /&gt;
** Direct and Indirect: 直接光和间接光完全烘焙。&lt;br /&gt;
** Indirect only: 实时光提供直接光，仅烘焙间接光。&lt;br /&gt;
** Shadowmask and Indirect: 实时光提供直接光，但静态几何体阴影烘焙到单独贴图中，动态和静态阴影混合，间接光正常烘焙。&lt;br /&gt;
** Direct, Indirect, Shadowmask (custom lighting only): 与 Direct and Indirect 相同，同时生成 Shadowmask 用于自定义着色器。&lt;br /&gt;
* Indirect intensity: 该光的非物理 GI 倍增。自然光应为 1，可根据风格化场景修改。&lt;br /&gt;
* Shadowmask with falloff: 将完整光衰减（除距离外）烘焙到 Shadowmask（仅自定义着色器有用）。&lt;br /&gt;
* Legacy sampling: 使用 Bakery 原始更偏置的阴影采样策略。产生无噪点阴影，但宽半影可能出现条纹。禁用后使用无偏但更有噪点的技术。&lt;br /&gt;
&lt;br /&gt;
如果同一对象同时启用了 Unity 和 Bakery 光源，且设置不匹配，则会出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match lightmapped to real-time: 将 Unity 光的常用设置复制到 Bakery 光。&lt;br /&gt;
* Match real-time to lightmapped: 将 Bakery 光的常用设置复制到 Unity 光。&lt;br /&gt;
&lt;br /&gt;
{{note| 从物理角度来看，Bakery 点光源的“Intensity”为 Candela 除以 Pi。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Volume ===&lt;br /&gt;
[[File:Voldemo notlonely.gif|由 BakeryVolume 照亮的动态门（动态 GIF，由 NOTLonely 制作）]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
体积（Volumes）生成存储每个体素光探针的 3D 纹理（L1 球面调和和阴影贴图），使其成为常规 Unity 光探针的可行替代方案。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Unity Light Probes&lt;br /&gt;
! Unity LPPV&lt;br /&gt;
! Bakery Volumes&lt;br /&gt;
|-&lt;br /&gt;
| 手动放置每个光探针&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 否&lt;br /&gt;
|-&lt;br /&gt;
| 在一个物体上插值多个光探针&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 运行时可移动&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 可以放入预制件&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 完整脚本 API&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| “Ringing” 伪影&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 可能出现&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 可能出现&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 已修正&lt;br /&gt;
|-&lt;br /&gt;
| 去噪&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 运行时开销&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | CPU：低开销；GPU：低开销&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | CPU：中等开销；GPU：中等开销&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#e4ead3;&amp;quot; | CPU：无开销；GPU：中等开销&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bakery Volume 是一个与一组 3D 纹理（3 个 SH 纹理和一个可选的 shadowmask）关联的边界盒，使其非常易于使用和编程。Volumes 可以在运行时轻松地交换、移动、加载或卸载，也可以与预制件关联。它们不需要任何 Light Probe Groups 或手动探针布置；整个 Volume 都由均匀的探针体素网格填充。光/影泄漏会自动像处理光照贴图一样修复（尽管对于较大的体素尺寸，薄的双面墙可能会出现问题，但可以通过在不同侧使用不同 Volume 避免）。由于体素网格的均匀特性，也可以对其应用类似光照贴图的降噪，这是常规光探针无法做到的。此外，Bakery 着色器使用 [https://drive.google.com/file/d/1MK6Clw93q8ljijRjb4gQOzzaIjn1uF9Y/view Geomerics] 采样技巧，完全消除了高对比度 HDR 光照下 SH 有时会产生的 “ringing” 伪影。&lt;br /&gt;
&lt;br /&gt;
因此，Volumes 可以为动态物体生成干净、精细、高质量的烘焙光照（即来自静态物体并影响动态物体的光照，而不是相反）。&lt;br /&gt;
&lt;br /&gt;
Volume 方法的唯一缺点是每像素着色开销较高。其开销类似于 LPPV（随着屏幕上受体素影响的像素数量而缩放），但与 LPPV 不同的是，一旦烘焙完成，Volumes 本身不会再更新。多个 Volume 的混合可以通过稍微重叠它们来避免。&lt;br /&gt;
&lt;br /&gt;
====设置 Volume 变换====&lt;br /&gt;
[[File:Bvolgizmo.jpg|thumb|Volume 控制柄]]&lt;br /&gt;
当 BakeryVolume 被添加到一个 GameObject 时，场景视图中会出现一个边界盒控制柄。拖动小方块即可缩放它。&lt;br /&gt;
&lt;br /&gt;
还有其他方法可以更改 Volume 的大小和位置：&lt;br /&gt;
&lt;br /&gt;
* 将任何可渲染的 GameObject 拖入 “Wrap to object” 字段。Volume 会包裹该对象（及其子对象），以将它们完全包含在内。&lt;br /&gt;
* 如果同一个对象上添加了 Box Collider，则会出现 “Set from box collider” 和 “Set to box collider” 按钮。可以用它们快速在 Volume 和 Collider 之间复制数值。&lt;br /&gt;
&lt;br /&gt;
====分辨率====&lt;br /&gt;
当启用 “Adaptive resolution” 时，体素数量由 “Voxels per unit” 控制。禁用它可以手动输入分辨率。对于大多数 1 单位 = 1 米 的游戏来说，一个合理的 “Voxels per unit” 值是 2，但在某些情况下（例如动态门）使用较小但更高分辨率的 Volume 会更有利。&lt;br /&gt;
&lt;br /&gt;
====其他设置====&lt;br /&gt;
&lt;br /&gt;
* Enable baking: 是否需要（重新）计算 Volume？禁用可防止覆盖已有数据。&lt;br /&gt;
* Denoise: 在烘焙 Volume 后应用去噪。推荐用于高分辨率 Volume。避免用于覆盖许多光源的低分辨率 Volume，因为去噪器难以区分实际内容和噪声。&lt;br /&gt;
* Global: 自动将此 Volume 分配给所有兼容 Volume 的 Shader，除非它们有覆盖设置。内部会调用 Shader.SetGlobalTexture()/SetGlobalVector()。&lt;br /&gt;
====使用方法====&lt;br /&gt;
Volumes 可以分配给使用 Volume 感知 Shader 的对象。Bakery 自带实现该功能的 “Bakery Standard” Shader，以及 HDRP 和 URP 的 Shader 图。请查看 example_volumes 场景，了解应用 Volume 的各种方式。&lt;br /&gt;
&lt;br /&gt;
====提示====&lt;br /&gt;
&lt;br /&gt;
* 确保查看示例。&lt;br /&gt;
* 如果两个 Volume 相连，让它们略微重叠。重叠大小应等于最大动态对象的尺寸。这样在运行时简单切换 Volume 就能正常工作。&lt;br /&gt;
* 仅在动态对象实际可达的区域放置 Volume。例如，使用玩家高度限制 Volume 的高度。&lt;br /&gt;
&lt;br /&gt;
====旋转 Volumes====&lt;br /&gt;
如果启用 “Rotate around Y” 选项，Volumes 可以绕 Y 轴旋转。旋转开销非常低，只使用 2 个额外的浮点数据（预计算的角度 sin/cos）。&lt;br /&gt;
&lt;br /&gt;
还可以在运行时旋转 Volumes（Experimental -&amp;gt; “Support rotation after bake” 以及 Bakery Shader 中的类似选项），这种情况下 Volume 必须在初始旋转为零时进行烘焙。&lt;br /&gt;
&lt;br /&gt;
在 URP 中，这种动态旋转可以与 `BakeryURPVolumeGraphRotatable.shadergraph` 一起使用。&lt;br /&gt;
&lt;br /&gt;
对于全局 Volume，动态旋转会在组件被（重新）启用或调用 `volume.SetGlobalParams()` 时更新。使用局部旋转 Volume 时，需要手动在材质或 MaterialPropertyBlock 上设置旋转：&lt;br /&gt;
{{code|&amp;lt;nowiki&amp;gt;SetMatrix(&amp;quot;_VolumeMatrix&amp;quot;, volume.GetMatrix())&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
====技术信息====&lt;br /&gt;
Volumes 可以自动工作（查看示例场景），也可以通过脚本控制其使用方式。&lt;br /&gt;
&lt;br /&gt;
可以通过组件的以下公共属性获取 Volume 数据：&lt;br /&gt;
&lt;br /&gt;
* `bakedTexture0`：存储 L0 RGB 系数和 L1 Z 红色通道在 alpha 中。&lt;br /&gt;
* `bakedTexture1`：存储 L1 X RGB 系数和 L1 Z 绿色通道在 alpha 中。&lt;br /&gt;
* `bakedTexture2`：存储 L1 Y RGB 系数和 L1 Z 蓝色通道在 alpha 中。&lt;br /&gt;
* `bakedMask`：存储体积阴影遮罩。&lt;br /&gt;
* `bounds`：Volume 的包围盒。&lt;br /&gt;
&lt;br /&gt;
所有 `bakedTexture*` 使用 RGBAHalf（每体素 8 字节）格式，mask 使用 ARGB32（每体素 4 字节）。阴影遮罩也可以使用单通道 R8 格式（每体素 1 字节）。&lt;br /&gt;
&lt;br /&gt;
因此 Volume 的字节大小 = width * height * depth * 3 * 8 + （仅当使用阴影遮罩时）width * height * depth * 4（或使用 R8 mask 时为 width * height * depth）。&lt;br /&gt;
&lt;br /&gt;
[[使用手册#Compress_volumes|可以对 Volume 启用纹理压缩]]，使其体积显著减小。&lt;br /&gt;
&lt;br /&gt;
采样 Volume 需要特殊 Shader，这些 Shader 已包含在 Bakery 中。要在自定义 Shader 中添加 Volumes，请查看 HDRP/URP 包中包含的 `BakeryVolume_float()` 函数（位于 `BakeryDecodeLightmap.hlsl`）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Light Filter ===&lt;br /&gt;
[[File:Output optimized.gif|彩色玻璃，如在 &amp;quot;Bakery Real-Time Preview&amp;quot; 中所见。Bakery lightmapper 烘焙出的结果相同。]]&lt;br /&gt;
&lt;br /&gt;
将渲染器标记为光过滤器（Light Filter）。过滤器会用其颜色着色所有直接和间接光线，类似于现实中的光学滤镜，从而实现彩色透明效果（例如彩色玻璃）。唯一的参数是用于着色的纹理。&lt;br /&gt;
&lt;br /&gt;
* 光过滤器对象仍然会像其他对象一样接收光照贴图。&lt;br /&gt;
* 过滤器不会散射或模糊光线（如需此效果，请尝试 [[Subsurface_scattering|Subsurface Scattering]] 或 [[使用手册#Backface_GI|Backface GI]]）。&lt;br /&gt;
* 过滤器可以产生带颜色的阴影。如果灯光使用 [[使用手册#Shadowmask|Shadowmask]] 模式，则结果只会保存 R 通道（因为 Unity 仅支持单通道遮罩）。对于完全烘焙的阴影，则没有限制。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Sector ===&lt;br /&gt;
参见 '''[[Partial_scene_baking|Partial scene baking]]'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Always Render ===&lt;br /&gt;
如果添加到一个物体上，Bakery 在烘焙时将始终考虑该物体，即使它的 Renderer 被禁用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
=== Bakery Pack As Single Square ===&lt;br /&gt;
如果添加到一个物体上，Bakery 会将该物体及其子物体的 UV 视为单个组合方块，在自动图集打包或 Lightmap Group 的 Pack Atlas 模式下，它们之间永远不会被移动。整个子层级将作为一个整体打包。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
=== Bakery Shared LOD UV ===&lt;br /&gt;
如果添加到一个 LODGroup 上，将标记所有同名 LOD 共享同一个光照贴图。默认情况下，每个 LOD 网格会获得独立的光照贴图，占用图集空间；但如果已知同一个物体的 LOD 拥有相似的 UV2（或者在没有 UV2 且 UV1 不重叠的情况下），它们可以映射到图集的同一部分，从而节省内存。&lt;br /&gt;
这种技术也称为 [https://github.com/laurenth-personal/LODLightmapScripts/ Lightmap Stealing]。&lt;br /&gt;
&lt;br /&gt;
= 材质兼容性 =&lt;br /&gt;
&lt;br /&gt;
=== 漫反射和发光 ===&lt;br /&gt;
Bakery 利用 [https://docs.unity3d.com/Manual/MetaPass.html Meta Pass] 系统支持大多数 Unity 材质。所有内置、Surface、URP 和 HDRP 着色器都已经定义了正确的 Meta Pass。&lt;br /&gt;
&lt;br /&gt;
如果你使用的是 Unlit 着色器，需要按照 Unity 文档手动添加 Meta Pass。&lt;br /&gt;
&lt;br /&gt;
如果未定义该 Pass，Bakery 将假定 {{codeVar|_MainTex}}、{{codeVar|_BaseColorMap}} 或 {{codeVar|_Color}}（如果未设置纹理）为材质的漫反射（Albedo），并将 {{codeVar|_EmissionMap}} 和 {{codeVar|_EmissionColor}} 作为发光颜色。&lt;br /&gt;
&lt;br /&gt;
为了使发光生效，[https://docs.unity3d.com/ScriptReference/Material-globalIlluminationFlags.html Material.globalIlluminationFlags] 必须设置为 [https://docs.unity3d.com/ScriptReference/MaterialGlobalIlluminationFlags.BakedEmissive.html MaterialGlobalIlluminationFlags.BakedEmissive]。标准着色器会自动设置此值。&lt;br /&gt;
&lt;br /&gt;
=== 不透明度 ===&lt;br /&gt;
[[File:Upload 2019-1-25 0-4-30.png|thumb|材质参数被转换为 Cutout（默认）]]&lt;br /&gt;
[[File:Alphacombos dither.jpg|thumb|通过“Dither Transparency”选项添加半透明值]]&lt;br /&gt;
[[File:Alphacombos filter.jpg|thumb|Light Filter 组件用于红色平面，生成彩色阴影]]&lt;br /&gt;
&lt;br /&gt;
默认情况下，Bakery 始终从 {{codeVar|_MainTex}}、{{codeVar|_BaseColorMap}} 或 {{codeVar|_BaseMap}} 的 alpha 值获取全分辨率的不透明度，并将其视为 Cutout（1 位透明）。&lt;br /&gt;
&lt;br /&gt;
当启用 '''Dither Transparency''' 选项时，半透明值会自动转换为可变蓝噪声，然后被滤波/模糊，产生部分透明效果（以前可以通过自定义手动抖动贴图实现，但从 v1.97 起自动完成）。&lt;br /&gt;
&lt;br /&gt;
为了使不透明度生效，着色器的 [https://docs.unity3d.com/Manual/SL-SubShaderTags.html RenderType 标签] 必须为以下值之一：&lt;br /&gt;
&lt;br /&gt;
* {{codeVar|Transparent}}&lt;br /&gt;
* {{codeVar|TransparentCutout}}&lt;br /&gt;
* {{codeVar|TreeLeaf}}&lt;br /&gt;
&lt;br /&gt;
如果存在名为 {{codeVar|_Cutoff}} 的属性，它将影响 Cutout（因此 Standard 着色器的 Cutoff 滑块会自动生效）。&lt;br /&gt;
&lt;br /&gt;
在没有 Dither Transparency 的情况下，如果材质 RenderType 为 {{codeVar|Transparent}} 或 {{codeVar|TreeLeaf}}，则 {{codeVar|_Color}} 的 alpha 值会额外修改 Cutoff：&lt;br /&gt;
''finalCutoff = 1 - (1 - cutoff) * alpha''&lt;br /&gt;
&lt;br /&gt;
对于彩色透明效果，请使用 [[使用手册#Bakery_Light_Filter|Light Filter]] 组件。&lt;br /&gt;
&lt;br /&gt;
有关漫反射半透明效果，请参考 [[#Backface GI|Backface GI]] 和 [[subsurface scattering]]。&lt;br /&gt;
&lt;br /&gt;
==== Alpha Meta Pass ====&lt;br /&gt;
从 v1.9 起，Bakery 还支持指定基于自定义着色器的透明度，但这需要使用兼容的着色器。要使用 ''Alpha Meta Pass''，需要执行以下步骤：&lt;br /&gt;
&lt;br /&gt;
* 在着色器中添加一个名为 '''BAKERY_META_ALPHA_ENABLE''' 的属性。例如：&lt;br /&gt;
  {{code|&amp;lt;nowiki&amp;gt;[HideInInspector] BAKERY_META_ALPHA_ENABLE (&amp;quot;Enable Bakery alpha meta pass&amp;quot;, Float) = 1.0&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
* 确保 RenderType 标签设置为上文提到的某个值。&lt;br /&gt;
* 声明一个名为 '''META_BAKERY''' 的 Pass。&lt;br /&gt;
* 在该 Pass 中检查 '''unity_MetaFragmentControl.w''' 是否非零，如果是，则返回计算出的透明度值。&lt;br /&gt;
&lt;br /&gt;
示例可参考包内的 ''Baked_Alpha_meta.shader''。&lt;br /&gt;
&lt;br /&gt;
注意：当前 Alpha Meta Pass 需要将 Light Probe Mode 设置为 L1 或 L2。&lt;br /&gt;
&lt;br /&gt;
=== Normal mapping ===&lt;br /&gt;
自定义表面法线可以与 [[#Baked Normal Maps|烘焙法线贴图]] 模式一起使用。不幸的是，Unity 的 Meta Pass 默认不输出法线信息，因此默认情况下，法线取自名为 {{codeVar|_BumpMap}} 的贴图，并通过 {{codeVar|_MainTex_ST}} 进行额外变换。&lt;br /&gt;
&lt;br /&gt;
然而，可以制作完全自定义的着色器，带有高级法线映射功能（例如混合多层法线），并使其兼容烘焙。要实现这一点，需要执行以下步骤：&lt;br /&gt;
&lt;br /&gt;
1. 在着色器中定义一个 Meta Pass，具体方法请参考 [https://docs.unity3d.com/Manual/MetaPass.html#ExampleMetaPassUnity 文档]。&lt;br /&gt;
&lt;br /&gt;
2. 将该 Pass 命名为 {{codeVar|&amp;quot;META_BAKERY&amp;quot;}}，而不仅仅是 {{codeVar|&amp;quot;META&amp;quot;}}。&lt;br /&gt;
&lt;br /&gt;
3. 包含文件 {{codeVar|&amp;quot;BakeryMetaPass.cginc&amp;quot;}}。&lt;br /&gt;
&lt;br /&gt;
4. 添加 {{codeVar|#pragma vertex vert_bakerymt}}。&lt;br /&gt;
&lt;br /&gt;
5. 如果 {{codeVar|unity_MetaFragmentControl.z}} 变量不为 0，着色器应返回世界空间法线。返回的法线应使用 {{codeVar|BakeryEncodeNormal}} 函数编码。&lt;br /&gt;
&lt;br /&gt;
在 Assets/Bakery/examples/shaders 中包含了两个实现了扩展 Meta Pass 的示例着色器。&lt;br /&gt;
&lt;br /&gt;
你也可以复制并修改 BakeryMetaPass.cginc 以满足你的需求，例如从顶点着色器传递额外数据。&lt;br /&gt;
&lt;br /&gt;
=== 正/背面 ===&lt;br /&gt;
无论着色器使用何种剔除模式，Bakery 都将所有背面视为不透明，这意味着任何直接光线都不会穿过背面，就像它不会穿过正面一样。&lt;br /&gt;
然而，如果使用 [[使用手册#Backface_GI|Backface GI]]，背面可以部分发出正面接收到的光照。&lt;br /&gt;
&lt;br /&gt;
= 扩展 Lightmap Parameters 资源 =&lt;br /&gt;
[[File:Lp.jpg|thumb|扩展 Lightmap Parameters]]&lt;br /&gt;
类似于 Bakery 的 [[#Bakery_Lightmap_Group_Selector|Lightmap Group]]，Unity 也有 [https://docs.unity3d.com/Manual/class-LightmapParameters.html Lightmap Parameters]，可以作为资源创建并分配给 Mesh Renderer。它们的逻辑有相似之处也有不同之处：&lt;br /&gt;
&lt;br /&gt;
* Lightmap Group 的主要用途是将多个对象组合到同一个图集。此外，它还允许覆盖该图集的烘焙设置。&lt;br /&gt;
* Lightmap Parameters 主要用于覆盖对象的烘焙设置，但通过使用“Baked Tag”选项，它们也可以影响打包：具有不同 Baked Tag 的对象将永远不会共享同一个图集。&lt;br /&gt;
&lt;br /&gt;
由于有些用户更习惯 Lightmap Parameters 的工作流程，Bakery 现在支持并扩展了它们：&lt;br /&gt;
&lt;br /&gt;
* Bakery 会遵循 Baked Tag 设置。&lt;br /&gt;
* Lightmap Parameters UI 中将显示额外的 Bakery 特定选项。有关其含义，请参考 [[#Bakery_Lightmap_Group_Selector|Lightmap Group]] 部分。&lt;br /&gt;
&lt;br /&gt;
= 项目设置 =&lt;br /&gt;
一些全局设置可以在 Project Settings -&amp;gt; Bakery GPU Lightmapper 中调整（此选项仅在 Unity 2018.3 或更新版本可见；旧版本请编辑 BakeryProjectSettings.asset）：&lt;br /&gt;
&lt;br /&gt;
* Mipmap lightmaps：启用光照贴图的 mipmap。随着图集变小，可能会导致 UV 图块之间的泄漏；另一方面，它可以减少远处高分辨率光照贴图的锯齿。总体上，建议对非常远的物体使用单独烘焙的 LOD 以及较低分辨率的光照贴图。&lt;br /&gt;
* Color file format：常规 HDR 颜色光照贴图的文件格式。可选值：&lt;br /&gt;
**HDR：Radiance HDR 格式（默认）。可用多种图像编辑器打开。&lt;br /&gt;
**Asset：Unity 原生格式。可自定义 mipmap 数量。&lt;br /&gt;
* Mask/Direction file format：额外 LDR 地图的格式，如阴影遮罩或方向数据。可选值：&lt;br /&gt;
**TGA：8 位 Targa（默认）。&lt;br /&gt;
**PNG：8 位 PNG。通常比 TGA 占用更少磁盘空间。&lt;br /&gt;
**Asset：Unity 原生格式。可自定义 mipmap 数量。&lt;br /&gt;
* Compress lightmaps：定义光照贴图资源的压缩行为。压缩光照贴图占用更少的显存，但可能会出现一些视觉伪影（例如色带或色斑），具体取决于压缩类型（移动端压缩问题请参见[[Troubleshooting#I_have_an_Android_project.2C_and_lightmaps_don.27t_look_good|此处]]）。可选值：&lt;br /&gt;
*** Compress but allow overriding asset: 新的光照贴图将在启用压缩的情况下创建。创建后，可以在 Inspector 中更改它们的压缩设置。修改后的值将在重新烘焙后保留（默认）。&lt;br /&gt;
*** Force compress: 始终压缩所有光照贴图。&lt;br /&gt;
*** Force no compress: 始终生成未压缩的光照贴图。&lt;br /&gt;
* High quality direction: 为方向贴图启用“高”质量压缩。实际格式取决于平台。例如在 PC 上，它会从 DXT1 改为 BC7，这提供了更高的质量，但 VRAM 使用量会翻倍。&lt;br /&gt;
* Texel padding (default atlas packer): 定义在使用默认 atlas 打包器时，在光照贴图 atlas 中对象 UV 布局之间添加多少空白 texel。&lt;br /&gt;
* Texel padding (xatlas packer): 同上，但在使用 xatlas 时。&lt;br /&gt;
* Alpha Meta Pass resolution multiplier: 乘以 [[使用手册#Alpha_Meta_Pass|Alpha Meta Pass]] 的分辨率，使在低分辨率光照贴图烘焙时仍能实现精确的基于 Shader 的切割效果。&lt;br /&gt;
* Volume render mode: 为所有 [[使用手册#Bakery_Volume|Volumes]] 使用哪种 [[使用手册#Render_mode|渲染模式]]？Auto 使用当前活动的渲染模式（默认）。&lt;br /&gt;
* Delete previous lightmaps before bake: 在烘焙新光照贴图之前，实际删除该场景中所有之前渲染的光照贴图文件。&lt;br /&gt;
* Log level: 定义烘焙过程中在控制台输出的信息量。可能的值：&lt;br /&gt;
** 0: 不输出任何内容。&lt;br /&gt;
** 1: 仅输出进度信息。&lt;br /&gt;
** 2: 仅输出警告。&lt;br /&gt;
** 3: 输出全部信息。&lt;br /&gt;
* Alternative scale in lightmap: 使渲染器属性 'Scale in Lightmap' 的行为更类似于 Unity 内置的行为。&lt;br /&gt;
* Align to texture compression blocks with xatlas: 使 xatlas 将 chart 对齐到 4x4 块边界，从而获得更适合压缩的结果。&lt;br /&gt;
* Generate smooth positions: 是否应调整采样位置以防止低多边形几何体在平滑法线下产生错误阴影？在使用法线差异极大的几何体时，可在极少数情况下禁用。技术说明见 [https://ndotl.wordpress.com/2018/08/29/baking-artifact-free-lightmaps/#shadowterm 这篇文章]。&lt;br /&gt;
* Smooth positions per-triangle: 是否应按三角形决定平滑/平面位置？在使用法线差异极大的几何体时，可在极少数情况下禁用。&lt;br /&gt;
* Use 'Receive GI' values: 在渲染器上考虑 “Receive Global Illumination” 值。最初 Bakery 会忽略它。&lt;br /&gt;
* Remove ringing in Legacy light probes: 在 Legacy 模式下启用更柔和的光探针卷积，以防止高对比度区域出现伪影。&lt;br /&gt;
* Always render reflection probes: 在每次 Render/Render Light Probes 后自动渲染反射探针。&lt;br /&gt;
* Ringing removal for L2 light probes: 对 [[使用手册#Light_probe_mode|L2 光探针]] 应用去振铃处理。值越高，探针光照越平滑；这种平滑可以减少 [[https://docs.unity3d.com/6000.2/Documentation/Manual/light-probes-troubleshooting.html](https://docs.unity3d.com/6000.2/Documentation/Manual/light-probes-troubleshooting.html) 振铃] 伪影（如果存在）。&lt;br /&gt;
* Put menu under Tools: 将 Bakery 菜单放入 Tools 菜单下。&lt;br /&gt;
&lt;br /&gt;
如果任何格式设置为 Asset 且启用 mipmapping，会显示额外选项：&lt;br /&gt;
&lt;br /&gt;
* Maximum mipmap count: 定义 mipmap 的最大数量。例如，设置为 2，则 8K 光照贴图仅有两个额外 mipmap：4K 和 2K。更低分辨率将被省略，从而在 mipmapping 过程中限制泄漏伪影。&lt;br /&gt;
&lt;br /&gt;
= SkinnedMeshRenderer 支持 =&lt;br /&gt;
Bakery 自 v1.65 起支持蒙皮网格 (skinned meshes)。但是，有一些限制：&lt;br /&gt;
&lt;br /&gt;
* 某些 Unity 版本不支持蒙皮网格的 UV1，并会悄无声息地忽略 “Generate lightmap UVs”。请确保场景中实际使用的网格具有 UV1，并在可能的情况下使用非重叠的 UV0；&lt;br /&gt;
* UV 填充调整在蒙皮网格上不起作用（Unity 在尝试调用 Unwrap 函数时似乎会崩溃）；&lt;br /&gt;
* 蒙皮网格不能使用每顶点光照贴图 (per-vertex lightmaps)（引擎不支持带蒙皮的 additionalVertexStreams）。&lt;br /&gt;
&lt;br /&gt;
= Shader Tweaks =&lt;br /&gt;
[[File:Image2.jpg|thumb|左：默认双线性过滤。右：双三次过滤。]]&lt;br /&gt;
[[File:Image34.jpg|thumb|左：两个阴影都已烘焙。&amp;lt;br&amp;gt;中：球形阴影为动态，另一个阴影为静态。通过相乘组合在一起。&amp;lt;br&amp;gt;右：与中间相同，但使用默认最小值组合。]]&lt;br /&gt;
&lt;br /&gt;
Bakery 提供可选的着色器修改，可以应用到 Unity 着色器上，以改善光照贴图采样并使实时光照更接近光照贴图效果。着色器调整菜单可以通过 Bakery-&amp;gt;Shader Tweaks 访问。&lt;br /&gt;
&lt;br /&gt;
这些选项会修补基础 Unity 着色器包含文件（来自 CGIncludes 文件夹），这些文件被大多数内置和第三方着色器使用。所有修改都会影响使用该版本编辑器打开的所有项目，但也可以轻松恢复。着色器调整会影响标准和表面着色器的工作方式。HDRP、URP 以及其他 SRP 不受影响。&lt;br /&gt;
&lt;br /&gt;
所有可用修改显示为按钮。点击按钮应用修改，按钮将保持按下状态。再次点击按钮即可移除修改。目前可用选项：&lt;br /&gt;
&lt;br /&gt;
{{note| 可能需要以管理员身份运行 Unity 编辑器以使 CGIncludes 修补生效}}&lt;br /&gt;
&lt;br /&gt;
* Use bicubic interpolation for lightmaps: 光照贴图将使用双三次插值代替默认双线性。此调整能很好地修复低分辨率光照贴图的许多锯齿边缘。目前仅适用于 DX11 和现代主机，其他平台仍使用双线性。&lt;br /&gt;
* Use multiplication for shadowmask: 使用相乘代替最小值组合静态和动态阴影。出于未知原因，Unity 默认使用最小值操作符，这会产生一些乘法不存在的伪影。&lt;br /&gt;
* Use physical light falloff (forward): 用更物理正确的平方反比替换实时点光/聚光灯的默认衰减。“Range” 只会在边缘略微淡出（与 Bakery 光源启用 Physical Falloff 复选框效果一致）。仅影响 Forward 渲染器。详情见 [[Point Light Attenuation]]。&lt;br /&gt;
* Use physical light falloff (deferred): 同上，但仅影响 Deferred 渲染器。&lt;br /&gt;
&lt;br /&gt;
'''衰减调整在 Unity &amp;gt;2017 版本上可能无法完全生效。此外，SRP 默认已经使用正确的衰减。'''&lt;br /&gt;
&lt;br /&gt;
= Bakery shaders =&lt;br /&gt;
Bakery 包含了自带着色器，支持顶点光照贴图，以及 RNM 和 SH 方向模式。它还允许从方向数据计算近似烘焙高光。&lt;br /&gt;
对于普通颜色光照贴图、阴影遮罩和 Dominant Direction 模式，Bakery 着色器 '''不是必需的'''，因为这些功能大多数 Unity 着色器本身已经支持。&lt;br /&gt;
&lt;br /&gt;
=== Standard render pipeline ===&lt;br /&gt;
'''Bakery/Standard''': 扩展了普通 Standard 着色器。额外选项：&lt;br /&gt;
&lt;br /&gt;
* Allow Vertex Lightmaps: 允许该材质用于 [[Vertex Lightmaps|顶点光照贴图]]。&lt;br /&gt;
* Allow RNM Lightmaps: 允许该材质用于 [[#RNM|RNM 方向模式]]。&lt;br /&gt;
* Allow SH Lightmaps: 允许该材质用于 [[#SH|SH 方向模式]]。&lt;br /&gt;
  {{note| 所有 “Allow” 选项会在着色器中启用特定的代码路径。为了性能考虑，建议每个材质仅使用一个 “allow” 选项。}}&lt;br /&gt;
* Enable Lightmap Specular: 使用 Dominant Direction、RNM 或 SH 方向模式的数据计算烘焙高光。注意，由于信息有限，该效果仅为近似。如果你曾在 Unity 4 中使用烘焙高光，效果应可比。与高度扰动的法线贴图搭配效果最佳，在平面表面上效果不佳。&lt;br /&gt;
* Enable VertexLM directional: 如果存在顶点光照贴图，指定 Dominant Direction 数据存储在顶点中并应被使用。&lt;br /&gt;
* Enable VertexLM SH: 如果存在顶点光照贴图，指定 SH 数据存储在顶点中并应被使用。&lt;br /&gt;
* Enable VertexLM Shadowmask: 如果存在顶点光照贴图，指定阴影遮罩存储在顶点中并应被使用。&lt;br /&gt;
* Enable MonoSH: 将方向贴图视为 MonoSH 贴图。&lt;br /&gt;
[[File:Image5.png|thumb|Standard SH light probe vs non-linear]]&lt;br /&gt;
[[File:Shspec.jpg|thumb|SH specular effect]]&lt;br /&gt;
* Non-linear SH：在 SH 方向模式下，此选项可以增强对比度（更接近真实效果），但会使着色器稍微变慢。该技巧基于 Geomerics 的论文《[https://drive.google.com/file/d/1MK6Clw93q8ljijRjb4gQOzzaIjn1uF9Y/view Reconstructing Diffuse Lighting from Spherical Harmonic Data]》。&lt;br /&gt;
* Non-linear Light Probe SH：与 Non-linear SH 类似，但用于光照探针。在探针的情况下，最显著的好处是消除错误的负值。这种问题常见于具有高对比度、明亮 HDR 光源的场景中。这是球谐函数的固有限制，而不是 Bakery 特有的问题（即使用 Unity 内置光照贴图器也可能出现类似伪影）。&lt;br /&gt;
* Force Bicubic Filter：为所有附加贴图启用双三次滤波。若要实现完整的双三次滤波（包括第一张颜色贴图），建议同时在 [[#Shader Tweaks|Shader Tweaks]] 中启用该功能。&lt;br /&gt;
&lt;br /&gt;
'''Bakery/Standard Specular'''：与 Standard 相同，但用于高光（Specular）工作流程。&lt;br /&gt;
&lt;br /&gt;
=== HDRP &amp;amp; URP ===&lt;br /&gt;
要提取额外的 HDRP/URP 着色器，请打开 Bakery 自带的 Bakery_ShaderGraphHDRP.unitypackage 或 Bakery_ShaderGraphURP.unitypackage。&lt;br /&gt;
在其中，你会找到可在自己 Shader Graph 中使用的 Shader Subgraph，以及一些示例材质。&lt;br /&gt;
&lt;br /&gt;
=== 各着色器功能支持对比 ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! 大多数 Unity 着色器&lt;br /&gt;
! 大多数 HDRP 和 URP 着色器&lt;br /&gt;
! Bakery Standard&lt;br /&gt;
! Bakery HDRP graphs&lt;br /&gt;
! Bakery URP graphs&lt;br /&gt;
|-&lt;br /&gt;
| HDR color lightmaps&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Shadowmask&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是 (&amp;gt;= URP 10.1)&lt;br /&gt;
|-&lt;br /&gt;
| Dominant Direction&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| RNM&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| SH&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Mo否SH&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Lightmap specular&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持 Dominant Direction 和 SH&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持 Dominant Direction&lt;br /&gt;
|-&lt;br /&gt;
| Bicubic filtering&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是,&lt;br /&gt;
通过 [[#Shader Tweaks|Shader Tweaks]] 支持&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是,&lt;br /&gt;
通过 [[#Shader Tweaks|Shader Tweaks]] 支持&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
|-&lt;br /&gt;
| Vertex lightmaps&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 单一颜色，没有每顶点 SH、方向或阴影遮罩（Shader Graph 限制）&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 单一颜色，没有每顶点 SH、方向或阴影遮罩（Shader Graph 限制）&lt;br /&gt;
|-&lt;br /&gt;
| Non-Linear Light Probes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Volumes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Volume shadowmask&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Compressed volumes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{note| 除了普通颜色光照贴图之外，所有功能都至少需要 Shader Model 3.0 才能运行。}}&lt;br /&gt;
{{note| 使用 SH 模式的顶点光照贴图由于插值器数量限制，至少需要 Shader Model 4.0。}}&lt;br /&gt;
{{note| 含有从 Dominant Direction 生成高光的更新版 URP 图表可在 [[Bakery_-_GPU_Lightmapper|主维基页面]] 下载。}}&lt;br /&gt;
&lt;br /&gt;
另请参阅：[[Integrating_Bakery_shader_features_to_custom_shaders| 将 Bakery 着色器特性集成到自定义着色器中]]&lt;br /&gt;
&lt;br /&gt;
= 关于 HDRP/URP 的说明 =&lt;br /&gt;
将该插件导入到 HDRP 或 URP 项目后，一般即可直接使用，但需要注意以下几点：&lt;br /&gt;
&lt;br /&gt;
* 示例场景中同时使用了普通 Standard 着色器以及部分 “Bakery Standard” 着色器。HDRP 和 URP 提供了将项目着色器从 Standard 升级到 Lit 的机制，但无法从 Bakery Standard 升级。请将 Bakery Standard 材质替换为来自 Bakery_ShaderGraphHDRP.unitypackage 或 Bakery_ShaderGraphURP.unitypackage 中的材质。&lt;br /&gt;
&lt;br /&gt;
* 在 HDRP 中，默认 HDRI 天空亮度较高（11），且天空反射默认不会被遮蔽。再加上默认的自动曝光，可能导致某些示例场景几乎不可见，因为它们使用了更低的亮度进行烘焙。此时可将 HDRI 天空亮度降低到 1。HDRI 设置通常位于 Assets/HDRPDefaultResources/DefaultSettingsVolumeProfile 中。&lt;br /&gt;
&lt;br /&gt;
* 在 HDRP 中，如果示例场景中的灯光过亮，可在 Bakery 灯光组件上点击 “match real-time to lightmapped” 按钮。&lt;br /&gt;
&lt;br /&gt;
* 在 HDRP 中建议使用 OpenImageDenoise 2（最佳）或 OptiX 7 去噪器，因为它们对高亮度值更适合。&lt;br /&gt;
&lt;br /&gt;
* 在 HDRP 中，“distance” 与普通 Shadowmask 的切换可直接在 Light 组件上完成，而不是在全局设置中。&lt;br /&gt;
&lt;br /&gt;
* 不要在 Skylight 上使用 “match” 按钮，因为 HDRP 使用的是非常特定的程序化天空着色器。请改为将其烘焙为 HDRI [[How_do_I...#How_do_I_use_Skylight_with_a_procedural_sky_shader.3F|这种方式]]。&lt;br /&gt;
&lt;br /&gt;
* 建议在使用 HDRP 时始终将 Light Probe Mode 设置为 L2 或 L1，因为 HDRP 的渲染器并未针对 Legacy 模式进行优化。&lt;br /&gt;
&lt;br /&gt;
* 最新版本的 HDRP/URP 自带自己的 IES 文件导入器。由于资源类型不匹配，Unity 会将旧版本 Bakery IES 灯光断开连接，使其显示为普通点光源。它们可以重新连接并重新保存。&lt;br /&gt;
&lt;br /&gt;
Bakery 的示例场景是为内置渲染管线设计的，因此在 HDRP/URP 中正确渲染它们需要一些步骤。以下是一些提示；假设新建项目使用默认的 HDRP/URP 设置：&lt;br /&gt;
&lt;br /&gt;
=== 在 HDRP 中查看示例场景 ===&lt;br /&gt;
&lt;br /&gt;
* 导入 Bakery 后，将标准材质升级为 HDRP：Edit-&amp;gt;Rendering-&amp;gt;Materials-&amp;gt;Convert All Built-in Materials To HDRP。&lt;br /&gt;
* 将 Bakery_ShaderGraphHDRP.unitypackage 导入项目，因为它包含实现高级 Bakery 功能的特殊 Shader Graph（对于经典颜色/方向/遮罩光照贴图不需要）。&lt;br /&gt;
* 选择 DefaultSettingsVolumeProfile.asset。在 HDRI Sky 部分，将 Exposure Compensation 设置为 1。否则，与示例场景相比，默认 HDRP 会过亮，因曝光调整而使场景看起来很暗。&lt;br /&gt;
* 选择示例场景中的灯光时，HDRP 会初始化其自身的灯光数据。有时会导致灯光立即变得更亮。点击 “Match real-time to lightmapped” 以同步。&lt;br /&gt;
* 在渲染光探针前，将 Light Probe Mode 设置为 L2。&lt;br /&gt;
* '''example_directional''': 将 Shader 更改为 BakeryDirSpecGraph 以查看烘焙高光（或仅使用常规 HDRP/Lit 用于仅漫反射法线映射）。删除球体，因为当前没有支持逐顶点方向的 Shader Graph。&lt;br /&gt;
* '''example_directional_MonoSH''': 将 Shader 更改为 BakerySpecMonoSHGraph（或 BakeryMonoSHGraph，用于没有高光的略微低成本版本）。删除球体，因为当前没有支持逐顶点 MonoSH 的 Shader Graph。&lt;br /&gt;
* '''example_RNM''': 将 Shader 更改为 BakeryRNMGraph。&lt;br /&gt;
* '''example_SH''': 将 Shader 更改为 BakerySpecSHGraph（或 BakerySHGraph，用于没有高光的略微低成本版本）。删除球体，因为当前没有支持逐顶点 SH 的 Shader Graph。&lt;br /&gt;
* '''example_mixed_directional_mode''': 对 MonoSH/RNM/SH 平面，同样需要不同的 Graph。&lt;br /&gt;
* '''example_lights''': 将顶点光照球体的 Shader 更改为 BakeryVertexColorGraph。&lt;br /&gt;
* '''example_prefabs_bake''': 无需进一步调整。&lt;br /&gt;
* '''example_sectors''': 无需进一步调整。&lt;br /&gt;
* '''example_shadowmask''': 选择 DirectLight 并点击 “Match real-time to lightmapped” 修正亮度。将所有 HDRP 灯光的 Shadowmask Mode 设置为 Shadowmask。&lt;br /&gt;
* '''example_sponza_day''': 将 OpenImageDenoise 2（或 Optix 7，如果不支持）设置为首选去噪器。&lt;br /&gt;
* '''example_sponza_evening''': 将 OpenImageDenoise 2（或 Optix 7，如果不支持）设置为首选去噪器。&lt;br /&gt;
* '''example_subtractive''': HDRP 不支持减法模式。&lt;br /&gt;
* '''example_volumes_simple''': 将火车 Shader 更改为 BakeryVolumeSpecGraph（或 BakeryVolumeGraph，用于没有高光的略微低成本版本）。&lt;br /&gt;
* '''example_volumes_simple_shadowmask''': HDRP 当前不支持 Shadowmask Volumes。&lt;br /&gt;
* '''example_volumes_advanced''': 与 example_volumes_simple 相同。&lt;br /&gt;
* '''example_translucency''': 场景大部分应显示正常。对于 “Dynamic sphere lit by volume”，将 Shader 设置为 BakeryVolumeGraph。&lt;br /&gt;
&lt;br /&gt;
=== 在 URP 中查看示例场景 ===&lt;br /&gt;
&lt;br /&gt;
* 导入 Bakery 后，将标准材质升级为 URP：打开 Assets/Bakery/examples/content，输入 &amp;quot;t:material&amp;quot; 选择所有材质，并仅在 &amp;quot;content&amp;quot; 文件夹下搜索。点击 Edit-&amp;gt;Rendering-&amp;gt;Materials-&amp;gt;Convert Selected Built-in Materials To URP。&lt;br /&gt;
* 将 Bakery_ShaderGraphURP.unitypackage 导入项目，因为它包含实现高级 Bakery 功能的特殊 Shader Graph（对于经典颜色/方向/遮罩光照贴图不需要）。&lt;br /&gt;
* '''example_directional''': 将 Shader 更改为 BakeryURPLit，启用 &amp;quot;Bakery Lightmapped Specular&amp;quot;（或者仅保持常规 URP/Lit 用于仅漫反射法线映射）。删除球体，因为当前没有支持逐顶点方向的 Shader Graph。&lt;br /&gt;
* '''example_directional_MonoSH''': 将 Shader 更改为 BakeryURPLit，将 Bakery Mode 设置为 MonoSH，启用 &amp;quot;Bakery Lightmapped Specular&amp;quot;。在顶点光照球体上也启用 &amp;quot;Per-vertex&amp;quot;。&lt;br /&gt;
* '''example_RNM''': 将 Shader 更改为 BakeryURPLit，将 Bakery Mode 设置为 RNM，启用 &amp;quot;Bakery Lightmapped Specular&amp;quot;。&lt;br /&gt;
* '''example_SH''': 将 Shader 更改为 BakeryURPLit，将 Bakery Mode 设置为 SH，启用 &amp;quot;Bakery Lightmapped Specular&amp;quot;。删除球体，因为当前没有支持逐顶点 SH 的 Shader Graph。&lt;br /&gt;
* '''example_mixed_directional_mode''': 类似地使用 BakeryURPLit 并设置不同的 Bakery Mode（MonoSH、RNM、SH）。非方向性/主方向/烘焙法线贴图可使用常规 URP/Lit。&lt;br /&gt;
* '''example_lights''': 无需进一步调整。&lt;br /&gt;
* '''example_prefabs_bake''': 无需进一步调整。&lt;br /&gt;
* '''example_sectors''': 无需进一步调整。&lt;br /&gt;
* '''example_shadowmask''': 类似于 Built-in 渲染管线，在 Bakery 窗口（或项目 Quality Settings）中取消选中 Distance Shadowmask，以在摄像机附近查看实际烘焙/实时阴影混合效果。&lt;br /&gt;
* '''example_sponza_day''': 在植被材质上启用 alpha clipping。&lt;br /&gt;
* '''example_sponza_evening''': 同 example_sponza_day。&lt;br /&gt;
* '''example_subtractive''': 无需进一步调整。&lt;br /&gt;
* '''example_volumes_simple''': 将火车 Shader 更改为 BakeryURPLit，并将 Bakery Mode 设置为 Volume。可选启用 &amp;quot;Bakery Lightmapped Specular&amp;quot;。&lt;br /&gt;
* '''example_volumes_simple_shadowmask''': 与 example_volumes_simple 相同，但也启用 &amp;quot;Volume Shadowmask&amp;quot;。&lt;br /&gt;
* '''example_volumes_advanced''': 与 example_volumes_simple 相同。&lt;br /&gt;
* '''example_translucency''': 场景大部分应显示正常。对于 &amp;quot;Dynamic sphere lit by volume&amp;quot;，将 Shader 设置为 BakeryURPLit 并将 Bakery Mode 设置为 Volume。&lt;br /&gt;
&lt;br /&gt;
= 升级 Bakery =&lt;br /&gt;
在升级该资源时，建议遵循以下步骤：&lt;br /&gt;
&lt;br /&gt;
* 关闭 Bakery 窗口。&lt;br /&gt;
* 关闭 Unity。&lt;br /&gt;
* 重新打开 Unity。&lt;br /&gt;
* 导入更新后的包。&lt;br /&gt;
&lt;br /&gt;
请注意，如果不先关闭 Unity，导入可能会失败，因为 DLL 文件被锁定（会出现类似 &amp;quot;alphabuffergen.dll: Access is denied.&amp;quot; 的提示）。&lt;br /&gt;
&lt;br /&gt;
如果你移动过 Bakery 文件夹（Assets/Bakery 和 Assets/Editor/x64/Bakery）到其他位置，可能需要在更新前将它们移回原处，以避免出现两个冲突的包副本。&lt;br /&gt;
&lt;br /&gt;
= 脚本 API =&lt;br /&gt;
&lt;br /&gt;
== 基本用法 ==&lt;br /&gt;
&lt;br /&gt;
获取并修改渲染设置：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ftLightmapsStorage storage = ftRenderLightmap.FindRenderSettingsStorage();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
可以在 ftLightmapsStorage.cs 中查看可用设置的完整列表。&lt;br /&gt;
&lt;br /&gt;
获取 lightmapper 实例并（重新）加载设置：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap bakery = ftRenderLightmap.instance != null ? ftRenderLightmap.instance : new ftRenderLightmap();&lt;br /&gt;
bakery.LoadRenderSettings();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
渲染光照贴图（如果设置为 L1 或 L2 模式，也会渲染探针）：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;bakery.RenderButton(bool showMsgWindows)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
仅渲染光探针：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;bakery.RenderLightProbesButton(bool showMsgWindows)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
仅渲染反射探针：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;bakery.RenderReflectionProbesButton(bool showMsgWindows)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''showMsgWindows''' 指示是否可以显示任何对话框/确认框。如果设置为 false，则抑制显示。&lt;br /&gt;
&lt;br /&gt;
检查烘焙是否正在进行：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.bakeInProgress&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
使用示例请参考 [[Community_extensions#Batch_scene_baker|Batch Scene Baker]] 脚本。&lt;br /&gt;
&lt;br /&gt;
== 额外函数 ==&lt;br /&gt;
&lt;br /&gt;
将一个 ftLightmapsStorage 的所有渲染设置复制到另一个：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmapsStorage.CopySettings(ftLightmapsStorage src, ftLightmapsStorage dest)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
获取全局（每项目）存储对象：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftGlobalStorage gstorage = ftLightmaps.GetGlobalStorage()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
将 ftLightmapsStorage（每场景）的所有渲染设置复制到 ftGlobalStorage（每项目）：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmapsStorage.CopySettings(ftLightmapsStorage src, ftGlobalStorage dest)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
将 ftGlobalStorage（每项目）的所有渲染设置复制到 ftLightmapsStorage（每场景）：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmapsStorage.CopySettings(ftGlobalStorage src, ftLightmapsStorage dest)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
获取包含 Bakery 二进制文件的文件夹路径：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmaps.GetEditorPath()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 额外变量 ==&lt;br /&gt;
&lt;br /&gt;
获取当前临时文件路径（必须先创建 ftRenderLightmap 实例）：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.scenePath&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
获取/设置 UVGBuffer 数据压缩（启用时为 LZ4，否则为 DDS）：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.compressedGBuffer&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
获取/设置输出光照贴图数据压缩（启用时为 LZ4，否则为 DDS）：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.compressedOutput&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 事件 ==&lt;br /&gt;
&lt;br /&gt;
脚本可以订阅 ftRenderLightmap 类中的静态事件。&lt;br /&gt;
&lt;br /&gt;
在完整渲染前调用：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnPreFullRender&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
在 Legacy 光探针模式下，每渲染一个光探针前调用。ProbeEventArgs 是一个结构体，包含 '''pos''' 字段表示当前光探针的位置：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler&amp;lt;ProbeEventArgs&amp;gt; OnPreRenderProbe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
在 Legacy 光探针渲染完成后调用：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnFinishedProbes&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
在完整渲染完成后调用：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnFinishedFullRender&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
在反射探针渲染前调用：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnPreReflectionProbeRender&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
在反射探针渲染完成后调用：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnFinishedReflectionProbes&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mr F</name></author>
		
	</entry>
	<entry>
		<id>https://geom.io/bakery/wiki/index.php?title=%E4%BD%BF%E7%94%A8%E6%89%8B%E5%86%8C&amp;diff=1857</id>
		<title>使用手册</title>
		<link rel="alternate" type="text/html" href="https://geom.io/bakery/wiki/index.php?title=%E4%BD%BF%E7%94%A8%E6%89%8B%E5%86%8C&amp;diff=1857"/>
		<updated>2026-01-03T22:12:13Z</updated>

		<summary type="html">&lt;p&gt;Mr F: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
[https://geom.io/bakery/wiki/index.php?title=Manual (Click for English version)]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 系统要求 ==&lt;br /&gt;
&lt;br /&gt;
使用 Bakery 需要：&lt;br /&gt;
&lt;br /&gt;
Windows（7 或更高版本）电脑。&lt;br /&gt;
&lt;br /&gt;
Nvidia 显卡。最低支持型号为 Kepler（GeForce 650 或更新型号，Quadro 显卡请查看规格）。&lt;br /&gt;
&lt;br /&gt;
64 位 Unity 编辑器。Bakery 已在 5.6 到 6 及更高版本上测试过，同时也在 Tuanjie 1.6.7 上通过测试。&lt;br /&gt;
&lt;br /&gt;
{{note|系统要求仅适用于开发者的电脑，而非目标平台。使用 Bakery 烘焙的光照贴图可以在任何地方使用。}}&lt;br /&gt;
&lt;br /&gt;
== 前提条件 ==&lt;br /&gt;
* 确保你的项目中没有任何脚本编译错误，否则也会导致 Bakery 的脚本无法编译。&lt;br /&gt;
* 确保你的显卡驱动是最新版本，如有需要请[https://www.nvidia.com/Download/index.aspx?lang=en-US 更新]。&lt;br /&gt;
&lt;br /&gt;
'''请使用 Game-Ready（标准）驱动程序，而不是 “Studio” 驱动。'''&lt;br /&gt;
&lt;br /&gt;
== 安装 ==&lt;br /&gt;
&lt;br /&gt;
1. 通过 [https://assetstore.unity.com/packages/tools/level-design/bakery-gpu-lightmapper-122218 Asset Store] 将 Bakery 导入到你的项目中。&lt;br /&gt;
&lt;br /&gt;
2. Unity 会显示要导入的文件列表。如果这是你第一次使用 Bakery，建议直接 点击 Import（导入）。有经验的用户可以取消选中 examples 文件夹，以进行更轻量的安装。&lt;br /&gt;
&lt;br /&gt;
文件将被导入到 `Assets/Bakery` 和 `Assets/Editor/x64/Bakery` 文件夹中。&lt;br /&gt;
这些文件夹之后可以移动。&lt;br /&gt;
&lt;br /&gt;
3. Unity 随后会导入 Bakery 并编译脚本。此时可能会弹出如下窗口：&lt;br /&gt;
&lt;br /&gt;
[[File:Goahead.png]]&lt;br /&gt;
&lt;br /&gt;
此时你应点击 “Go Ahead”（继续）。&lt;br /&gt;
&lt;br /&gt;
现在你应该能在编辑器中看到新增的 Bakery 菜单：&lt;br /&gt;
&lt;br /&gt;
[[File:bmenu.jpg]]&lt;br /&gt;
&lt;br /&gt;
== 快速开始 ==&lt;br /&gt;
&lt;br /&gt;
1. 添加一些模型或基础体，并将其标记为静态（Static）。&lt;br /&gt;
&lt;br /&gt;
'''用于光照贴图的网格必须具有不重叠的 UV2。如果存在 UV2，则会使用 UV2（否则使用 UV1）。如果你的模型没有为光照贴图进行展开，请在资源中勾选 Generate Lightmap UVs（生成光照贴图 UV）。'''&lt;br /&gt;
Unity 的基础体已经具有正确的 UV2。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Staticmarked.jpg|320px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. 选择方向光（Unity 为你创建的那个），并添加 '''Bakery Direct Light''' 组件。&lt;br /&gt;
   {{note|Bakery 和 Unity 使用独立的光源组件。}}&lt;br /&gt;
&lt;br /&gt;
3. Bakery Direct Light 有许多可调选项，但你可以轻松将其与 Unity 光源匹配。点击 '''Match lightmapped to real-time'''。现在 Bakery 光源的颜色应与 Unity 默认的方向光相同，呈黄色调。&lt;br /&gt;
&lt;br /&gt;
[[File:Matching.jpg|640px]]&lt;br /&gt;
&lt;br /&gt;
{{note|Direct Light 组件可能会提示项目未使用线性光强度。问题在于，Unity 默认会对光源颜色应用伽马校正 [https://twitter.com/guycalledfrank/status/1001108508614553600 不正确]。&lt;br /&gt;
可以通过[https://docs.unity3d.com/ScriptReference/Rendering.GraphicsSettings-lightsUseLinearIntensity.html 脚本]启用正确模式。&lt;br /&gt;
这就是 “Fix” 按钮的作用。如果你已经在非线性光强模式下设置了许多光源，并且不想再次更改它们，可以跳过修复。即使你按了 “Fix”，也可以随时撤销此更改。&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. 要获得带阴影的环境光，请创建 Skylight（Bakery-&amp;gt;Create-&amp;gt;Skylight）。&lt;br /&gt;
&lt;br /&gt;
[[File:Menusky.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. 选择 Skylight，为它设置一些偏蓝的颜色，然后点击 '''Match scene skybox to this light'''。   这将使场景的 skybox 与光照完全匹配。&lt;br /&gt;
   {{note|将 Unity 的 skybox 与 Bakery Skylight 匹配是可选的，但对正确性很有用，可以确保可见环境和引擎内的反射探针与烘焙光照一致。目前此选项仅适用于 Standard 渲染管线。}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Skycomp.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. 点击 Bakery-&amp;gt;Render Lightmap。默认情况下，Full Lighting 模式是激活的。它会烘焙所有光源的直接和间接光照贡献。如果你想将实时阴影与烘焙全局光照（GI）结合使用，请将模式更改为 '''Indirect'''。&lt;br /&gt;
&lt;br /&gt;
[[File:Bakerywindow.jpg]]&lt;br /&gt;
&lt;br /&gt;
{{note| Bakery 可能会提示你正在使用旧的 [https://docs.unity3d.com/Manual/LinearLighting.html gamma mode]。如果你在意光照质量，强烈建议使用线性模式。如果你的项目已经在错误的伽马模式下设置好了，并且不想更改，或者是发布到不支持线性模式的移动设备上，也可以忽略此提示。}}&lt;br /&gt;
&lt;br /&gt;
7. 点击 '''Render'''。&lt;br /&gt;
&lt;br /&gt;
8. 完成！现在你应该已经得到烘焙的全局光照（GI）：&lt;br /&gt;
&lt;br /&gt;
[[File:Bakedgi.jpg]]&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 ==&lt;br /&gt;
&lt;br /&gt;
所有渲染设置都可以通过 Bakery-&amp;gt;Render Lightmap 访问。设置会为每个场景单独保存。Bakery 窗口顶部的选项允许你在 Simple（简单）、Advanced（高级）和 Experimental（实验）设置之间切换，每个后续模式都会显示更多可调选项。对于大多数场景，Simple 模式已经足够，是入门的好方法。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render mode ===  &lt;br /&gt;
定义要烘焙的光照贴图类型。  &lt;br /&gt;
&lt;br /&gt;
===== Full Lighting =====&lt;br /&gt;
烘焙所有 Bakery 光源的完整直接光和间接光。&lt;br /&gt;
{{note|在 2017.3 之前的 Unity 版本中，如果同一对象上同时有 Unity 和 Bakery 组件，你需要手动禁用 Unity 组件以避免亮度加倍。在较新版本中，实时效果会自动对烘焙光源禁用，就像内置光照烘焙器一样。}}&lt;br /&gt;
&lt;br /&gt;
===== Indirect =====&lt;br /&gt;
[[File:Image26.png|thumb|Unity 支持的不同渲染模式对比]]&lt;br /&gt;
基础混合模式。它会查看每个光源上的 Baked Contribution 选择器：如果设置为 ''Direct And Indirect''，则光源会像在 Full Lighting 模式下一样被烘焙。如果设置为 ''Indirect Only''，则只会烘焙该光源的间接光照（GI）。在后一种情况下，你应保持对象上的 Unity 光源和 Bakery 光源同时存在，一个提供实时直接光照，另一个提供预计算的全局光照（GI）。&lt;br /&gt;
&lt;br /&gt;
[[File:Indirectonly.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== Shadowmask =====&lt;br /&gt;
[[File:Image21.png|thumb|左：完全烘焙的光照。中：动态光源 + 烘焙 GI。右：胶囊形阴影、凹凸贴图和高光为动态光照，但立方体阴影和 GI 为烘焙光照。]]&lt;br /&gt;
[[File:Image6.png|thumb|当相机足够远离场景，或者动态阴影被禁用时，场景将呈现如下效果]]&lt;br /&gt;
更高级的混合模式。它通过生成两种类型的光照贴图来工作——一种包含烘焙颜色（如 Indirect 模式），另一种包含静态物体的阴影。它有几个优点：&lt;br /&gt;
* 实时阴影只需渲染少量动态对象，而不是整个场景。&lt;br /&gt;
* 实时阴影与烘焙阴影可以正确融合。&lt;br /&gt;
* 实时光源可以渲染凹凸贴图、高光和其他表面效果，同时仍会被高质量烘焙阴影遮挡。&lt;br /&gt;
[https://docs.unity3d.com/Manual/LightMode-Mixed-Shadowmask.html 更多详情]&lt;br /&gt;
&lt;br /&gt;
要启用此行为，你必须在同一对象上同时存在 Unity 光源和 Bakery 光源，并将 Baked Contribution 设置为 ''Shadowmask and Indirect''。未标记的光源将按 Indirect 模式进行烘焙。&lt;br /&gt;
&lt;br /&gt;
[[File:Smask22.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== Distance Shadowmask =====&lt;br /&gt;
此复选框仅在你选择 Shadowmask 时可见，并且只是切换项目 [https://docs.unity3d.com/Manual/LightMode-Mixed-ShadowmaskMode.html Quality Settings] 中同名的设置。&lt;br /&gt;
[https://docs.unity3d.com/Manual/LightMode-Mixed-DistanceShadowmask.html 更多详情]&lt;br /&gt;
{{note|由于缺少对应的脚本 API，该复选框在 Unity 5.6.x 上不可见。你可以在 Window-&amp;gt;Lighting-&amp;gt;Mixed Lighting-&amp;gt;Lighting Mode 中切换该设置。}}&lt;br /&gt;
{{note|在 Unity 版本 &amp;lt; 2017.3 中，由于 API 限制，渲染 Shadowmask 光照贴图会清除光照探针。烘焙后需要重新渲染光照探针。在较新版本中不应发生此问题。}}&lt;br /&gt;
&lt;br /&gt;
===== Subtractive =====&lt;br /&gt;
&lt;br /&gt;
启用 [https://docs.unity3d.com/Manual/LightMode-Mixed-Subtractive.html Subtractive] 光照模式。&lt;br /&gt;
&lt;br /&gt;
此选项对光照贴图本身没有任何特殊作用，实际上它的工作方式与 Full Lighting 相同。&lt;br /&gt;
&lt;br /&gt;
唯一的区别是，它还会将实时 Unity 光源设置为与 Subtractive 模式兼容（因为无法通过 UI 完成此操作）。&lt;br /&gt;
&lt;br /&gt;
你还需要在 [https://docs.unity3d.com/Manual/GlobalIllumination.html#MixedLighting Unity Lighting] 窗口中额外设置全局减法参数（例如全局阴影颜色）。&lt;br /&gt;
&lt;br /&gt;
===== Ambient Occlusion Only =====&lt;br /&gt;
仅烘焙环境光遮蔽（AO）。如果你很清楚自己在做什么，这可能会有用。请确保设置 [[#Ambient_occlusion|AO 选项]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Directional mode ===&lt;br /&gt;
[[File:Image3.png|thumb|不同方向模式的对比]]&lt;br /&gt;
定义了方向信息的烘焙方式。标准光照贴图每个像素只存储单一颜色，而方向光照贴图为着色器提供了关于该像素周围半球内光照变化的提示。这些数据用于在完全烘焙的区域中结合法线贴图。如果将其应用到内置的 [[#Bakery_shaders|Bakery]] 着色器中，还可以产生**近似高光反射**效果。&lt;br /&gt;
&lt;br /&gt;
===== None =====&lt;br /&gt;
不包含方向数据，每个像素仅有单一颜色。&lt;br /&gt;
&lt;br /&gt;
===== Baked Normal Maps =====&lt;br /&gt;
依然没有方向数据，但在渲染光照贴图时会考虑法线贴图。此方式在运行时没有额外开销。由于光照贴图的分辨率通常低于法线贴图，结果可能显得模糊。其他问题包括：由于缺乏 mipmapping，远处可能出现锯齿，以及降噪步骤可能导致细节被涂抹。要了解如何在此模式下使用具有程序化法线的自定义着色器，请参阅 [[#Normal_mapping|Normal Mapping]] 章节。&lt;br /&gt;
&lt;br /&gt;
===== Dominant Direction =====&lt;br /&gt;
此模式类似于 Unity 中 Enlighten 和 Progressive 烘焙器的实现。它与大多数着色器兼容，仅生成一张额外的贴图，运行时开销极小。缺点是凹凸贴图的效果较弱，略显灰暗，与实时光照下的同一物体相比可能差异较大。&lt;br /&gt;
&lt;br /&gt;
===== RNM =====&lt;br /&gt;
基于最初为《Half-Life 2》开发的 [https://steamcdn-a.akamaihd.net/apps/valve/2004/GDC2004_Half-Life2_Shading.pdf Radiosity Normal Mapping] 技术（相关演示文稿），后来被许多游戏采用（如《Mirror's Edge》）。此模式总共生成三张 HDR 贴图，是内存占用最高的模式之一，但运行时开销仍相对较低。该模式比 Dominant Direction 更精确，能更好地再现表面反差，并能正确处理来自不同角度、具有不同颜色的光照对法线贴图的影响。&lt;br /&gt;
&lt;br /&gt;
===== SH =====&lt;br /&gt;
基于论文《[https://media.contentapi.ea.com/content/dam/eacom/frostbite/files/gdc2018-precomputedgiobalilluminationinfrostbite.pdf Precomputed Global Illumination in Frostbite]》。这是最高质量的模式，能提供更好的表面对比度，并准确表现来自不同方向、不同颜色的光照。总共生成四张贴图，其中仅一张为 HDR，因此比 RNM 占用更少内存。运行时开销略高于 RNM。&lt;br /&gt;
&lt;br /&gt;
===== MonoSH =====&lt;br /&gt;
[[File:FY8Ru8hWIAAdYYH.jpg|thumb|Dominant Direction、完整 SH 与 MonoSH 的尺寸/质量对比]]&lt;br /&gt;
与 SH 类似，但使用单色的 L1 方向系数。表面对比度同样良好，虽然无法准确表现来自不同方向的不同颜色光照，但对多数场景来说已经足够。仅生成一张额外贴图，因此显存占用与带宽需求与 Dominant Direction 相近；事实上更低，因为 Dominant Direction 使用 RGBA 贴图，而 MonoSH 只需 RGB。该贴图通过内置的方向光照贴图系统传递，但''在标准着色器下显示不正确''。请务必使用兼容的着色器。&lt;br /&gt;
&lt;br /&gt;
===== 限制 =====&lt;br /&gt;
&lt;br /&gt;
* RNM 和 SH/MonoSH 只能与 [[#Bakery_shaders|Bakery shader]] 一起使用，或者需要对你的着色器进行调整。&lt;br /&gt;
* 在 RNM 和 SH 模式下，不会生成标准的颜色光照贴图。你需要确保场景中所有材质都使用 Bakery Shader，或者使用 [[#Bakery_Lightmap_Group_Selector|Lightmap Groups]] 将 RNM/SH 对象与其他对象分开。&lt;br /&gt;
* RNM 和 SH 贴图是通过 [https://docs.unity3d.com/ScriptReference/MaterialPropertyBlock.html MaterialPropertyBlock] 应用于对象的，因此在 Unity 的 Lighting 窗口中可能无法完全显示。&lt;br /&gt;
* Dominant Direction、RNM 和 SH/MonoSH 模式可能需要为全局光照（GI）和光照网格使用更多采样，以获得相近的质量。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Texels per unit ===&lt;br /&gt;
[[File:Texelscomp.jpg|thumb|1 vs 10 texels per unit]]&lt;br /&gt;
每个世界单位的光照贴图像素（Texels）近似数量。它会影响生成光照贴图的数量和分辨率。&lt;br /&gt;
&lt;br /&gt;
入门示例值：&lt;br /&gt;
&lt;br /&gt;
* 大型户外区域（城市）：1 - 5&lt;br /&gt;
* 中型户外区域（几条小巷）：10 - 20&lt;br /&gt;
* 高质量室内场景：100&lt;br /&gt;
&lt;br /&gt;
假设场景比例大约为 1 单位 = 1 米。在 Unity 中使用这种比例通常是推荐的，以便更好地导航和进行物理模拟。如果你的比例不同，请相应地调整 Texels。&lt;br /&gt;
&lt;br /&gt;
请注意，Texels Per Unit 是基础分辨率，但每个对象还可以通过 Mesh Renderer 上的 &amp;quot;Scale in Lightmap&amp;quot; 选项以及 Bakery 窗口中的 &amp;quot;Scale per map type&amp;quot; 进行额外调整。&lt;br /&gt;
&lt;br /&gt;
{{note| 将 &amp;quot;Scale in Lightmap&amp;quot; 设置为 0 的对象不会被烘焙，但仍会投射阴影并影响全局光照（GI）。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Max resolution ===&lt;br /&gt;
光照贴图的最大尺寸限制。如果对象无法容纳在单张光照贴图中（根据当前的 Texels Per Unit 值），将会分配额外的光照贴图。同样的四个正方形对象可以使用四张 512x512 的贴图，也可以使用一张 1024x1024 的贴图。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bounces ===&lt;br /&gt;
[[File:Image36.png|thumb|注意更多的反弹会为封闭空间带来更多光照。]]&lt;br /&gt;
定义光线在表面上反弹的次数。通常，对于户外场景（例如城市），较低的反弹次数就足够了，而对于封闭场景（室内、洞穴），则需要较高的反弹次数。&lt;br /&gt;
&lt;br /&gt;
虽然滑块最多限制为 5 次反弹，但可以在数字输入框中输入任意反弹次数。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Samples ===&lt;br /&gt;
[[File:Image7.png|thumb|左：Samples = 4，右：Samples = 16。为了演示，去噪功能已关闭。]]&lt;br /&gt;
影响全局光照（GI）的质量。典型值为 16 到 32。&lt;br /&gt;
&lt;br /&gt;
{{note| 可以输入超出滑块最大值的任意数字，但请注意，该数字表示最终光线数量的平方根，例如 32 表示 1024 条光线，64 表示 4096 条光线，依此类推。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GPU Priority ===&lt;br /&gt;
在 GPU 处理光照贴图时，操作系统和其他软件的响应可能会变慢。此选项允许你在烘焙速度和系统响应之间进行平衡。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render ===&lt;br /&gt;
为所有打开的场景烘焙光照贴图。&lt;br /&gt;
如果 [[使用手册#Light_probe_mode|Light Probe Mode]] 设置为 L1 或 L2，也会烘焙 [https://docs.unity3d.com/Manual/LightProbes.html 光照探针]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Render Light Probes ===&lt;br /&gt;
为所有打开的场景烘焙 [https://docs.unity3d.com/Manual/LightProbes.html 光照探针]。&lt;br /&gt;
&lt;br /&gt;
请注意，要在 Shadowmask 模式下对动态对象获得正确的混合光阴影，你还需要启用 [[使用手册#Occlusion_probes|occlusion probes]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Render Reflection Probes ===&lt;br /&gt;
为所有打开的场景烘焙反射探针。此按钮仅为方便起见，会调用引擎内置的反射探针更新功能。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update Skybox Probe ===&lt;br /&gt;
为当前的 skybox 烘焙全局漫反射和反射探针。与 “Render Reflection Probes” 一样，它仅调用引擎内置函数。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Occlusion probes ===&lt;br /&gt;
在渲染光照探针时，允许 Unity 使用当前选择的内置光照烘焙器烘焙遮挡探针（occlusion probes）。遮挡探针是存储在普通光照探针中的附加数据，可以防止动态对象在阴影区域被错误照亮。目前在 Unity 中无法使用自定义遮挡探针，必须调用内置光照烘焙器来完成此操作。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Warnings ===&lt;br /&gt;
这些选项会在按下任意 Render 按钮后对场景进行验证，并显示警告对话框，询问是否继续或停止烘焙过程。&lt;br /&gt;
&lt;br /&gt;
* Suppress all popups（屏蔽所有弹窗）：按下 Render 后不显示任何对话框。&lt;br /&gt;
* UV validation（UV 验证）：检查所有模型是否具有完全正确的光照贴图 UV，特别是 UV 是否位于 0-1 范围内且不重叠。&lt;br /&gt;
* Overwrite check（覆盖检查）：显示哪些光照贴图文件将被覆盖。&lt;br /&gt;
* Memory check（内存检查）：显示大致所需的视频内存量。&lt;br /&gt;
* Sample count check（采样数检查）：检查是否有光源、GI 或 AO 的采样数不合理，可能导致 GPU 超出可用资源。&lt;br /&gt;
* Lightmapped prefab validation（光照贴图预制体验证）：验证光照贴图预制体，并在某些预制体将被覆盖时发出通知。&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 (Advanced) ==&lt;br /&gt;
=== Light probe mode ===&lt;br /&gt;
更改光照探针的烘焙方式。&lt;br /&gt;
&lt;br /&gt;
* Legacy（传统模式）：使用 Render Light Probes 按钮生成探针。点光源和方向光在光照烘焙器中计算，而区域光/天空光/间接光则通过在每个探针位置渲染立方体贴图收集。结果以 [https://docs.unity3d.com/ScriptReference/Rendering.SphericalHarmonicsL2.html L2] 球谐（spherical harmonics）形式存储。缺点是立方体贴图渲染速度慢，并且在游戏中使用的着色器未物理正确表示光照表面，或者项目为移动平台设置时，光照贴图和探针可能不匹配（Unity 可能会裁剪高强度值）。&lt;br /&gt;
&lt;br /&gt;
* L1：在点击 Render 时，光照探针会与光照贴图一起渲染。此选项提供更高的烘焙性能，并保证探针光照与光照贴图匹配。结果以 L1 球谐形式存储（仍可被普通着色器使用）。使用 [[#Bakery_shaders|Bakery shader]] 的 Non-Linear Light Probe SH 选项可以进一步提升结果。&lt;br /&gt;
&lt;br /&gt;
* L2：更高质量（完整 L2 球谐）。与 L1 一样，会自动与光照贴图一起渲染。与 L1 相比，性能影响可忽略不计。应在所有着色器下显示正常。探针对比度/方向性/振铃去除可通过 Project Settings -&amp;gt; Bakery -&amp;gt; “Ringing removal for L2 light probes” 调整。&lt;br /&gt;
&lt;br /&gt;
'''在 Unity 2019.3 中似乎存在一个 bug，如果启用 Occlusion Probes 选项，Legacy 光照探针的颜色无法正确保存。使用 Occlusion Probes 时，默认且推荐使用 L2 模式。'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Asset UV Processing ===&lt;br /&gt;
配置资产的 UV 间距（padding）调整。可选值：&lt;br /&gt;
&lt;br /&gt;
* Don't change（不更改）：不修改资产。&lt;br /&gt;
* Adjust UV padding（调整 UV 间距）：会查找具有自动生成 UV 的模型（资产上启用 “Generate Lightmap UVs”），并进一步调整它们，使每个网格的 UV 岛之间具有适当间距。导入器设置中的全模型 Pack Margin 会被忽略。系统会根据每个网格的面积和光照贴图分辨率计算出最优值。&lt;br /&gt;
* Adjust UV padding for new meshes only（仅调整新网格的 UV 间距）：与上面相同，但会跳过之前至少调整过一次的模型。&lt;br /&gt;
* Remove UV adjustments（移除 UV 调整）：撤销所有之前的 UV 调整，使自动展开的模型恢复到 Unity 原始展开的样子。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser ===&lt;br /&gt;
设置所需的去噪器。可选值：&lt;br /&gt;
&lt;br /&gt;
* Optix 5：使用 OptiX 5.1 AI 去噪器（之前称为 “Legacy denoiser”）。在 GPU 上运行。支持从 [https://en.wikipedia.org/wiki/Kepler_(microarchitecture) Kepler]（通常是 GeForce 6xx）到 [https://en.wikipedia.org/wiki/Turing_(microarchitecture) Turing]（通常是 GeForce 20xx）的所有显卡。不支持 [https://en.wikipedia.org/wiki/Ampere_(microarchitecture) Ampere]（30xx）。OptiX 5.1 使用嵌入的静态训练数据集，因此不受驱动实现影响。&lt;br /&gt;
&lt;br /&gt;
* Optix 6：使用 OptiX 6.0 AI 去噪器（之前为默认选项）。在 GPU 上运行。在 Kepler（6xx）显卡上似乎无法使用，但在更新的显卡上均可运行，包括 Ampere（30xx）。自 6.0 起，OptiX 去噪器的训练数据集存储在驱动中。在 v442.50 之前，其行为类似于 OptiX 5.1；但之后 NVIDIA [https://forums.developer.nvidia.com/t/optix7-denoiser-different-results-with-different-version-of-drivers/117989/2 更改了数据集]，结果可能有所不同。更新后的数据集有时可能产生网格状图案和更亮的边缘（仍可通过 “Denoise: fix bright edges” 修复），但运行速度更快。&lt;br /&gt;
&lt;br /&gt;
* Optix 7：使用 OptiX 7.2 AI 去噪器。行为类似 OptiX 6.0，但在 Ampere（30xx）上可能支持更好。&lt;br /&gt;
&lt;br /&gt;
* OpenImageDenoise：使用 Intel Open Image Denoise 库。在 CPU 上运行（任何支持 SSE 4.1 的 CPU）。可能略慢于 OptiX，但质量可比。&lt;br /&gt;
&lt;br /&gt;
* OpenImageDenoise2：使用 Intel Open Image Denoise 2，CUDA 模式。在 GPU 上运行，性能与 OptiX 6/7 相当，质量与 CPU 版本相同。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Adjust sample positions ===&lt;br /&gt;
寻找最佳采样位置以防止光照泄漏。算法详情可参考 [https://ndotl.wordpress.com/2018/08/29/baking-artifact-free-lightmaps/#leaks 此处]。在某些情况下（通常是大型且多边形极少、法线平滑的几何体），可能会产生不正确的结果，此时可以将其禁用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Unload scenes before render ===&lt;br /&gt;
在烘焙前卸载 Unity 场景以释放显存。复杂场景仅在编辑器中显示就可能占用数 GB 的显存。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Denoise ===&lt;br /&gt;
[[File:Image31.png|thumb|左：未开启 “Denoise”，右：开启 “Denoise”。]]&lt;br /&gt;
如果启用，将应用去噪算法。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Fix Seams ===&lt;br /&gt;
[[File:Image22.png|thumb|左：缝隙（“Fix Seams” 关闭），右：缝隙已修复（“Fix Seams” 开启）。]]&lt;br /&gt;
如果启用，将尝试融合由 UV 不连续造成的缝隙。对平滑几何体很有用，包括 Unity 默认的球体。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Split by scene ===&lt;br /&gt;
如果同时加载多个场景，并且启用此选项，每个场景将拥有自己的一套光照贴图，而不会与其他场景共享。这对于在运行时流式加载场景时限制纹理占用量非常有用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hole filling ===&lt;br /&gt;
[[File:Holefilling.jpg|thumb|“Hole filling” 关闭与开启的对比。]]&lt;br /&gt;
如果 Atlas Packer 设置为 xatlas，将尝试填充每个孔洞，从而生成更高效的贴图集。对于几何体非常复杂的场景，可能会增加场景导出时间，但通常推荐开启。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Min resolution ===&lt;br /&gt;
光照贴图的最小尺寸限制。可用于在生成大量小而完全填充的光照贴图与少量未完全填充的光照贴图之间进行平衡。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Scale per map type ===&lt;br /&gt;
允许你对颜色贴图、Shadowmask 和方向贴图设置不同的分辨率缩放。例如，常见情况是间接光颜色分辨率较低，但 Shadowmask 分辨率较高。请注意，缩放在光照贴图渲染完成后才应用，因此不会节省烘焙时间。如果启用了 “Adjust UV padding”，间距将基于最低分辨率的贴图，以防止像素泄漏。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Checker preview ===&lt;br /&gt;
[[File:Image12.png|thumb|Checker Preview 功能演示。]]&lt;br /&gt;
如果勾选了 “Show checker” 选项，场景视图将在可见对象上渲染棋盘格图案，以展示光照贴图像素大小。这对于在烘焙前确保 Texels Per Unit 和其他影响分辨率的设置使用合理数值非常有用。&lt;br /&gt;
&lt;br /&gt;
启用 Checker Preview 将强制 Bakery 执行贴图集打包。可能需要一些时间，但通常不会超过几秒钟。在修改场景内容后，按下 “Refresh checker” 可重新打包场景以查看更改。&lt;br /&gt;
&lt;br /&gt;
Checker Preview 还使用随机颜色显示场景将如何被分割到不同的光照贴图中。&lt;br /&gt;
&lt;br /&gt;
{{note| 当前 Checker Preview 无法显示地形的正确像素大小。}}&lt;br /&gt;
&lt;br /&gt;
==== Atlas preview ====&lt;br /&gt;
[[File:FN-TmhRXwAE9i2I.png|thumb|Atlas Preview 功能演示]]&lt;br /&gt;
当 Checker Preview 开启时，会显示 Atlas Preview 按钮。点击它将打开一个新窗口，显示未来光照贴图的 UV 布局。点击 &amp;quot;&amp;lt;&amp;quot; 和 &amp;quot;&amp;gt;&amp;quot; 按钮可浏览各个光照贴图。&lt;br /&gt;
这对于在烘焙前检查打包质量和光照贴图数量非常有用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Emissive boost ===&lt;br /&gt;
将任何表面自发光（emission）乘以此数值。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Indirect boost ===&lt;br /&gt;
将所有反弹光照乘以此数值。作用与光源组件上的 Indirect Intensity 相同，但为全局设置。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Backface GI ===&lt;br /&gt;
[[File:Image30.jpg|thumb|Backface GI]]&lt;br /&gt;
[[File:Image35.png|thumb|左：“Backface GI” = 0，右：“Backface GI” = 1。注意阴影区域接收到更多的绿色光照。]]&lt;br /&gt;
决定光线通过前面表面到达背面并被全局光照（GI）反弹的程度。这对于薄的半透明表面（如树叶）尤其有用。取值范围为 0-1。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Ambient occlusion ===&lt;br /&gt;
[[File:Image15.png|thumb|左：AO intensity = 0，右：AO intensity = 1。]]&lt;br /&gt;
一种简单的非物理环境光遮蔽（Ambient Occlusion，AO），可在最终场景光照上叠加以增强美观效果。&lt;br /&gt;
&lt;br /&gt;
* Intensity（强度）：控制 AO 效果的可见度。值为 0 时禁用该效果。&lt;br /&gt;
* Radius（半径）：决定 AO 效果使用的光线距离。较小的值产生局部遮蔽（角落、褶皱），较大的值则更类似 Skylight，从远处物体产生阴影。&lt;br /&gt;
* Samples（采样数）：影响环境光遮蔽的质量。典型值为 4 到 32。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dither transparency ===&lt;br /&gt;
通过自动抖动不透明度贴图来启用半透明阴影。[[使用手册#Opacity|了解 Bakery 如何处理不透明度贴图]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== RTX Mode ===&lt;br /&gt;
启用 RTX 硬件加速。仅 RTX 显卡可受益于此选项。最低支持的驱动版本为 418。&lt;br /&gt;
&lt;br /&gt;
驱动可以在大多数非 RTX Nvidia 显卡上模拟 RTX 模式，但通常会更慢。&lt;br /&gt;
&lt;br /&gt;
在 Ampere（3xxx）或更新的显卡上，RTX 模式 ''必须'' 启用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Export terrain trees ===&lt;br /&gt;
如果启用，绘制在地形上的树木将影响光照。树木本身不会被烘焙。请注意，在烘焙过程中，每棵树都使用最高可能的 LOD 等级。对于多公里范围且模型高度复杂的森林场景，不建议使用此选项。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Terrain optimization ===&lt;br /&gt;
如果启用（默认），地形将使用独立的光线追踪技术以利用其高程图几何结构。否则，它们将像其他普通网格一样处理。地形优化可以显著减少高分辨率地形所需的内存占用。在某些情况下，它还能加快地形烘焙速度，但在其他情况下（尤其是简单低分辨率地形）可能需要禁用该选项。&lt;br /&gt;
&lt;br /&gt;
{{note| 地形优化当前不兼容绘制的地形洞。需禁用此选项才能使其正常工作。}}&lt;br /&gt;
{{note| 地形优化仅支持非 RTX 模式。}}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Light Mesh batch limit ===&lt;br /&gt;
如果该值大于 0，会将多个 Light Mesh 合并为一个，前提是它们具有相同设置并影响相同的 Lightmap Groups，同时将它们的总采样数限制为该值（例如，如果限制为 64，则可以合并 2 个采样数为 32 的灯光，或 4 个采样数为 16 的灯光，等等）。在拥有大量 Light Mesh 的场景中，这可以提升性能。但设置过高时需小心，因为 GPU 在一次处理过多采样时可能触发操作系统驱动超时。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Compress volumes ===&lt;br /&gt;
如果启用，将对体积 3D 贴图应用纹理压缩，并将 Bakery 着色器切换到相应的采样模式。不推荐对分辨率非常低的体积使用此选项。体积大小可能会被调整为 4 的倍数。&lt;br /&gt;
&lt;br /&gt;
注意事项：&lt;br /&gt;
&lt;br /&gt;
* 目前仅支持压缩为 BC6H/BC7 纹理格式（桌面/主机平台）。&lt;br /&gt;
* 体积压缩仅支持 Unity 2020.1 或更高版本。&lt;br /&gt;
* 目前仅标准渲染管线的 Bakery 着色器支持使用压缩体积贴图。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Samples multiplier ===&lt;br /&gt;
将所有阴影和 GI 采样数乘以指定因子。可用于在草稿质量和最终质量之间快速切换。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Tile size ===&lt;br /&gt;
与 [[#GPU Priority|GPU Priority]] 相同，但这里设置的是贴图块（tile）大小。Bakery 会将光照贴图拆分为更小的块，并一次更新一个块。块越小，GPU 工作被中断的次数越多，系统响应性可能更好。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Temp path ===&lt;br /&gt;
临时文件夹。在渲染过程中，Bakery 可能需要几个 GB 的可用空间。将此文件夹放在 SSD 上相比 HDD 可略微加快渲染速度。目前，该文件夹不会自动清理。你可以随时手动删除其内容（渲染时除外），或通过 Bakery -&amp;gt; Utilities -&amp;gt; Clear cache 清理。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Output path ===&lt;br /&gt;
光照贴图文件夹。所有光照贴图，以及 lightprobe 和顶点颜色（vertex color）资源都将保存在此处。该路径相对于你的 Assets 文件夹。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Use scene named output path ===&lt;br /&gt;
如果启用此选项，输出路径将自动设置为与当前活动场景同名的文件夹（Assets/CurrentSceneName/）。这与 Unity 内置光照贴图烘焙器的行为类似。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render Selected Groups ===&lt;br /&gt;
仅烘焙包含所选对象的 Lightmap Groups。&lt;br /&gt;
不仅仅是所选对象会被重新绘制，它们所属的所有 Lightmap Groups 都会被处理。其他光照贴图不会被更新。如果对象不属于某个手动分配的组，则使用相同光照贴图的场景部分将被重新烘焙。&lt;br /&gt;
&lt;br /&gt;
目前，使用 [[Partial_scene_baking|Sectors]] 进行场景部分烘焙更为方便。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Beep on finish ===&lt;br /&gt;
如果启用，Bakery 在烘焙完成时会播放提示音。&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 (Experimental) ==&lt;br /&gt;
=== Unwrapper ===&lt;br /&gt;
如果启用 [[#Asset_UV_Processing|Adjust UV Padding]]，则定义将使用的展开器（unwrapper）。&lt;br /&gt;
&lt;br /&gt;
* Default：使用 Unity 标准展开器。Bakery 会为每个具有不同间距参数的网格调用 [https://docs.unity3d.com/ScriptReference/Unwrapping.GenerateSecondaryUVSet.html Unwrapping.GenerateSecondaryUVSet]。&lt;br /&gt;
* xatlas：使用 [https://github.com/jpcy jpcy] 的 [https://github.com/jpcy/xatlas xatlas]，这是 [https://github.com/castano Ignacio Castaño] 的 [https://github.com/Thekla/thekla_atlas thekla_atlas] 的修改版。thekla_atlas 曾用于游戏《The Witness》（[http://the-witness.net/news/2010/03/graphics-tech-texture-parameterization/ 参见博客文章]）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Atlas Packer ===&lt;br /&gt;
选择在将不同对象的 UV 布局打包到大型光照贴图集时使用的算法。&lt;br /&gt;
* Default：Bakery 在 v1.7 之前使用的原始算法。&lt;br /&gt;
* xatlas：使用 xatlas。&lt;br /&gt;
&lt;br /&gt;
某些功能仅支持特定的贴图集打包器：&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Default&lt;br /&gt;
! xatlas&lt;br /&gt;
|-&lt;br /&gt;
| [[使用手册#Bakery_Lightmap_Group_Selector|Override resolution]]&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
|-&lt;br /&gt;
| 高效 LOD 打包&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
|-&lt;br /&gt;
| [[使用手册#Hole_filling|Hole filling]]&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
请注意，贴图集打包器（Atlas Packer）也可以为每个 Lightmap Group 单独选择。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Export geometry and maps ===&lt;br /&gt;
如果启用，Bakery 会在渲染前将场景导出为其专用格式。如果你确定场景的几何体和贴图以及光照贴图分辨率设置没有改变（例如，你只是调整 GI 或光源设置），可以禁用此选项以加快下一次渲染速度。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update unmodified lights ===&lt;br /&gt;
如果启用，Bakery 会重新计算自上次渲染以来未改变的光源。如果你只是调整某个光源，不想等待其他光源重新渲染，可以禁用此选项。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update modified lights and GI ===&lt;br /&gt;
如果启用，Bakery 会重新计算自上次渲染以来发生变化的 GI 和光源。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== UV padding: increase only ===&lt;br /&gt;
仅在启用 [[#Asset_UV_Processing|Adjust UV padding]] 时可见。默认情况下，模型资源的最佳 UV 间距仅基于当前加载的场景进行计算。如果同一模型有多个实例使用不同的光照贴图分辨率，最小的分辨率将决定间距，以确保 UV 图块之间的间距足够大，防止相互重叠。然而，在两个不同的独立场景中烘焙同一模型时，为新场景优化可能会破坏之前场景中的 UV。勾选此选项可以防止这种情况发生，即永远不减小间距值，从而始终为曾经烘焙过的最低分辨率实例进行优化。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoise: fix bright edges ===&lt;br /&gt;
[[File:Image19.png|thumb|左：去噪后可见明亮边缘；右：已修复。]]&lt;br /&gt;
仅在 [[#Denoise|Denoise]] 启用时可见。有时用于去噪的神经网络可能会在阴影周围产生明亮边缘，就像应用了锐化效果一样。如果启用此选项，Bakery 会尝试将其滤除。启用后，去噪阶段可能会略微变慢。&lt;br /&gt;
&lt;br /&gt;
此功能也可用于滤除“火花”（fireflies），即光照贴图中偶尔出现的亮点。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Post-packing ===&lt;br /&gt;
有时在渲染场景时，Bakery 会将光照贴图拆分为多个子光照贴图，例如在烘焙不同 LOD 或地形时。&lt;br /&gt;
Post-packing 会尝试通过将这些子光照贴图合并到同一纹理中来最小化最终贴图集数量。&lt;br /&gt;
建议保持此选项启用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Combine with Enlighten real-time GI ===&lt;br /&gt;
如果启用，则在按下 Render 按钮时，Bakery 会首先尝试使用 Enlighten 烘焙以计算实时 GI。之后，将进行常规的 Bakery 光照贴图烘焙过程。烘焙 GI 和实时 GI 将协同工作。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bake on remote server ===&lt;br /&gt;
启用网络烘焙（[[Network baking|Network baking]]）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Presets ===&lt;br /&gt;
当前在 Experimental 模式下的 Render/Update 按钮下显示。&lt;br /&gt;
&lt;br /&gt;
* 点击 '''New''' 将所有当前设置保存到预设文件中。&lt;br /&gt;
* 默认情况下，当一个预设处于激活状态时，所有设置都会被灰显，以防止覆盖预设。&lt;br /&gt;
* 点击 '''Modify preset''' 可更改设置并覆盖预设。&lt;br /&gt;
* 可以通过预设字段切换预设。将其设置为 None 可禁用预设使用。&lt;br /&gt;
&lt;br /&gt;
== 组件 ==&lt;br /&gt;
=== Bakery Lightmap Group Selector ===&lt;br /&gt;
指定对象及其所有子对象使用的 '''Lightmap Group'''。&lt;br /&gt;
Lightmap Group 是 Bakery 用来表示共享同一光照贴图的对象集合的术语。每个组都有属性，告诉 Bakery 如何打包对象、哪些光源影响它们，以及结果是烘焙到纹理还是顶点。&lt;br /&gt;
&lt;br /&gt;
默认情况下，所有静态对象会自动打包到多个光照贴图组（贴图集）中，因此通常无需手动管理。手动定义组仅用于特殊用途，例如：&lt;br /&gt;
&lt;br /&gt;
* 指定某些对象使用 [[Vertex Lightmaps|每顶点光照贴图]] 而非纹理。&lt;br /&gt;
* 使用建模软件中的原始未缩放 UV 烘焙光照贴图。&lt;br /&gt;
* 将关卡的特定区域分组以使用单张光照贴图，从而便于资源流式加载或通过脚本在运行时切换不同的烘焙光照。&lt;br /&gt;
* 使用 Render Selected Groups 按钮仅更新已分组的对象。&lt;br /&gt;
&lt;br /&gt;
要手动定义组，可以创建 '''Lightmap Group Assets'''，方法包括使用 Assets-&amp;gt;Create 菜单，或在组件中使用 Create New 按钮。使用 Create New 按钮时，将根据以下表单创建新的资源：&lt;br /&gt;
&lt;br /&gt;
* Name：要创建的 Lightmap Group 资源的名称。&lt;br /&gt;
* Packing Mode：此选择器定义 Lightmap Group 的打包模式，共有 3 种模式：&lt;br /&gt;
** Original UV：对象及其子对象将使用未修改的 UV 进行烘焙，不执行打包。适用于多个网格共享同一已打包 UV 布局的模型。&lt;br /&gt;
** Pack Atlas：对象及其子对象将打包到专用纹理贴图集中。在 v1.3 之前，每个可打包的子对象都需要有此组件，但现在不再需要。每个子对象将作为单独矩形打包，除非 Bakery 自动检测到子对象有非重叠的子对象，在这种情况下，多个对象可以使用同一个矩形。&lt;br /&gt;
** Vertex：对象及其子对象将使用顶点色烘焙光照而非纹理。注意，需要使用自定义着色器才能生效，例如 [[#Bakery_shaders|Bakery Shader]]。文档中也提供了一个简单的着色器（“Bakery/Simple Vertex Lightmapped”）用于演示和参考。[[Vertex Lightmaps|了解更多关于顶点光照贴图的信息]]。&lt;br /&gt;
* Directional mode：允许你覆盖该组的 [[#Directional mode|directional mode]]。选项与全局相同，Auto 将使用全局设置。&lt;br /&gt;
* Resolution：所需的光照贴图分辨率。&lt;br /&gt;
* Auto-resolution：使用 [[使用手册#Texels_per_unit|Texels Per Unit]] 来确定最接近的二次幂分辨率。&lt;br /&gt;
* Atlas packer：为该组选择 [[使用手册#Atlas_Packer|贴图集打包]] 算法。&lt;br /&gt;
* Bitmask：用于排除光源影响光照贴图的开关列表。每个 Bakery 光源也有一个位掩码设置。光源只会影响与其共享至少一个开关的 Lightmap Group。默认设置意味着所有光源影响所有光照贴图。&lt;br /&gt;
&lt;br /&gt;
[[File:Ts.jpg|thumb|Transparent selfshadow关闭 vs 开启：注意一些单面但背向的多边形如何被正确照亮。]]&lt;br /&gt;
&lt;br /&gt;
如果你有一个被分配了“Pack Atlas”模式的 Lightmap Group，组件上将会出现额外设置：&lt;br /&gt;
&lt;br /&gt;
* Override resolution：覆盖该对象及其子对象在光照贴图中占用的分辨率。&lt;br /&gt;
* Resolution：手动定义的分辨率。例如，如果你有一个分辨率为 512 的光照贴图，并且分配给 4 个对象，同时覆盖分辨率设置为 256，Bakery 将生成一个 512x512 的光照贴图，每个对象正好占据 256x256 的区域。&lt;br /&gt;
&lt;br /&gt;
如果你选择一个 Lightmap Group 资产，将会显示额外的实验性设置：&lt;br /&gt;
* [[Subsurface scattering|Subsurface scattering: (点击阅读更多)]]&lt;br /&gt;
* Normal offset：允许你将光线从表面偏移。这很少有用，主要用于实验目的。&lt;br /&gt;
* Transparent selfshadow：从表面后方发射光线，使其不会在自身投射阴影。对于半透明叶片可能有用。&lt;br /&gt;
* Vertex sampling density，(仅当 Packing Mode 设置为 Vertex 时可用）：默认情况下，每个顶点只计算一个值；如果采样密度 &amp;gt; 0，则会在三角形上分散采样并求平均，从而生成超采样、更平滑的结果。&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Lightmapped Prefab ===&lt;br /&gt;
此组件允许预制件存储光照贴图元数据。这样处理后的预制件可以在任意场景中实例化，无论是在编辑器中还是运行时。&lt;br /&gt;
该组件应直接添加到预制件的根对象上。不支持嵌套预制件。由于预制件在烘焙后会被覆盖（类似于按下“Apply”按钮的效果），因此要求预制件没有任何未应用的更改（子对象不应移动，材质和脚本参数应保持不变等）。如果检测到此类更改，组件界面会显示错误，烘焙后不会保存任何元数据。如果启用了 [[#Warnings|Lightmapped prefab validation]] 警告，所有预制件错误也会在烘焙前以对话框形式显示。&lt;br /&gt;
&lt;br /&gt;
光照贴图预制件支持所有 Bakery 功能，例如 LOD、地形、方向光贴图、RNM、SH、顶点模式和 Shadowmask。要使 Shadowmask 生效，光源也必须是同一预制件的一部分。&lt;br /&gt;
&lt;br /&gt;
{{note| 注意，由于 API 限制，预制件 Shadowmask 仅在 Unity 2017.4 或更高版本中可用。}}&lt;br /&gt;
&lt;br /&gt;
烘焙后，一个名为 “BakeryPrefabLightmapData” 的对象会被添加到预制件中。该对象包含一个脚本，存储应用光照贴图所需的所有数据。&lt;br /&gt;
&lt;br /&gt;
此外，光照贴图预制件允许保存当前渲染设置，并使用两个按钮将其加载回任意已打开的场景：&lt;br /&gt;
&lt;br /&gt;
* Save current render settings to prefab：在该预制件上存储当前渲染设置的副本。&lt;br /&gt;
* Load render settings from prefab：将当前渲染设置设置为预制件中存储的设置。&lt;br /&gt;
  [[File:Upload 2019-9-17 10-32-34.png|thumb|应用预制件]]&lt;br /&gt;
&lt;br /&gt;
烘焙光照贴图预制件时，建议检查：&lt;br /&gt;
&lt;br /&gt;
* 预制件已“应用”。在旧版 Unity 中，点击 Inspector 右上角的 “Apply” 按钮。在新版 Unity 中，点击 “Overrides” 列表，然后选择 “Apply All”。&lt;br /&gt;
* 预制件组件 UI 不显示任何错误。&lt;br /&gt;
* [推荐] 在主窗口启用 “Lightmapped prefab validation” 复选框。点击 Render 时不会显示任何关于预制件的警告对话框。&lt;br /&gt;
&lt;br /&gt;
{{note| 光照贴图以其烘焙所在的场景或所使用的 Lightmap Group 命名（如果有）。在同一场景中烘焙不同预制件时，请确保使用不同命名的 [[使用手册#Bakery_Lightmap_Group_Selector|Lightmap Group]] 或更改 [[使用手册#Output_path|输出路径]]。}}&lt;br /&gt;
&lt;br /&gt;
{{note| 当使用相同模型逐个烘焙多个预制件时，建议将 [[使用手册#Asset_UV_Processing|Asset UV Processing]] 设置为“Don't Change”，以防止修改共享模型的 UV。}}&lt;br /&gt;
&lt;br /&gt;
{{note| Bakery 的预制件工作流程是在 Unity 提供“预制件双击进入视图”功能之前实现的。因此，在隔离预制件视图中光照贴图可能无法正确应用，组件可能显示 “This GameObject is not a prefab” 信息。但在普通场景中使用时应能正常工作。}}&lt;br /&gt;
&lt;br /&gt;
{{note| 当解包已烘焙的预制件并取消与现有光照贴图的关联时，请确保删除保存预制件范围光照贴图/渲染器连接的 BakeryPrefabLightmapData 对象。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Direct Light ===&lt;br /&gt;
[[File:Directlight.jpg|thumb|纯直射光 + GI]]&lt;br /&gt;
[[File:Image4.png|thumb|左：“Shadow Spread” = 0.01，右：0.05。注意阴影从锐利逐渐变模糊的效果。]]&lt;br /&gt;
无限远方向光（例如太阳）。&lt;br /&gt;
&lt;br /&gt;
* Color：光的颜色。&lt;br /&gt;
* Intensity：线性色彩乘数。&lt;br /&gt;
* Shadow Spread：光源尺寸，或者简单说，阴影的模糊度。0 = 阴影最锐利，1 = 阴影最模糊。从技术上讲，它在单条光线与更宽光锥之间插值。&lt;br /&gt;
* Shadow Samples：影响阴影质量。Shadow Spread 值越小，所需样本越少即可得到干净图像。太阳阴影的典型值为 1 到 16。设置为 0 时，该光源的阴影将消失。&lt;br /&gt;
* Bitmask：用于排除此光源对特定 Lightmap Groups 影响的开关列表。&lt;br /&gt;
* Baked contribution：确定应烘焙哪类光照数据。仅在 Indirect 或 Shadowmask 模式可见。可选值：&lt;br /&gt;
** Direct and Indirect：直射光与间接光都完全烘焙。&lt;br /&gt;
** Indirect only：实时光提供直射贡献，仅烘焙间接光。&lt;br /&gt;
** Shadowmask and indirect：实时光提供直射贡献，静态几何体的阴影烘焙到单独贴图，动态与静态阴影混合。间接光正常烘焙。&lt;br /&gt;
** Direct, Indirect, Shadowmask（仅自定义光照）：与直射和间接相同，但 Shadowmask 也生成，可与自定义着色器一起使用。&lt;br /&gt;
* Denoise shadowmask：确定是否对该光源的 Shadowmask 应用去噪。通常不需要，因为阴影噪点不明显，但对非常宽且模糊的阴影（大 Shadow Spread）可能有用。&lt;br /&gt;
* Indirect intensity：非物理 GI 乘数。自然光照应为 1，可根据场景风格调整。&lt;br /&gt;
* Anti-alias：对阴影执行超采样。&lt;br /&gt;
* Texture projection：在光照上投射乘法平铺纹理，可用于模拟远处云影。&lt;br /&gt;
当设置了纹理投影时，可以使用“Tiling”和“Offset”字段调整其缩放和偏移。或者，点击 &amp;quot;Tweak projection in Scene View&amp;quot; 并使用额外的 Gizmo 可视化移动和缩放投影。点击“Render reference frame”可保存光源视角的 PNG，这对于在场景上绘制云影很有用。&lt;br /&gt;
&lt;br /&gt;
如果同一对象同时启用了 Unity 和 Bakery 光源且参数不匹配，会出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match lightmapped to real-time：将 Unity 光源的通用设置复制到 Bakery 光源。&lt;br /&gt;
* Match real-time to lightmapped：将 Bakery 光源的通用设置复制到 Unity 光源。&lt;br /&gt;
&lt;br /&gt;
{{note| 从物理角度看，Bakery 的方向光强度（Intensity）等于照度（Lux）除以 π。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Sky Light ===&lt;br /&gt;
[[File:Skylight.jpg|thumb|纯天空光与 GI]]&lt;br /&gt;
无限远的带阴影环境光（天空）。&lt;br /&gt;
&lt;br /&gt;
* Color: 颜色。&lt;br /&gt;
* Intensity: 线性色彩倍增。&lt;br /&gt;
* Sky texture: 可选的立方体贴图资源，例如 HDRI 全景图，用于从不同方向影响光照颜色。&lt;br /&gt;
  {{note| 旋转天空光的 GameObject 会相应旋转立方体贴图的光照。}}&lt;br /&gt;
* Samples: 影响阴影质量。典型值为 8 到 32。&lt;br /&gt;
* Hemispherical: 如果启用，光照仅来自上方（上半球）。否则来自所有方向。&lt;br /&gt;
* Bitmask: 用于排除此光源影响特定 Lightmap Groups 的开关列表。&lt;br /&gt;
* Baked contribution: 决定应烘焙哪种光照数据。仅在 Indirect/Shadowmask 模式下可见。可能值：&lt;br /&gt;
** Direct and Indirect: 直接和间接光照都将完全烘焙。这是默认且推荐的天空光行为，因为在 Unity 中没有实时版本可以模拟它们。&lt;br /&gt;
** Indirect only: 假定实时光源提供直接贡献；仅烘焙间接光照。&lt;br /&gt;
&lt;br /&gt;
如果天空光的设置与当前场景的天空盒不匹配，将出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match this light to scene skybox: 将活动天空盒材质的通用设置复制到 Bakery 天空光。当前仅支持使用 “Skybox/Cubemap” 或 “Skybox/Bakery skybox” 着色器的天空盒。&lt;br /&gt;
* Match scene skybox to this light: 将 Bakery 天空光的通用设置复制到场景天空盒。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bakery Light Mesh ===&lt;br /&gt;
[[File:Image29.png|thumb|Left: Samples Near = 0, Samples Far = 4096.&amp;lt;br&amp;gt;&lt;br /&gt;
Middle: Samples Near = 0, Samples Far = 128.&amp;lt;br&amp;gt;&lt;br /&gt;
Right: Samples Near = 16, Samples Far = 128.&amp;lt;br&amp;gt;&lt;br /&gt;
请注意，光照效果看起来相似，但使用的合并采样数量更少。]]&lt;br /&gt;
任何形状的自发光网格。应与 Mesh Renderer 组件或设置为 Area 模式的 Light 组件一起使用。&lt;br /&gt;
&lt;br /&gt;
* Color：颜色&lt;br /&gt;
* Intensity：线性颜色倍增器&lt;br /&gt;
* Cutoff：最大光照距离。Bakery 会在接近该限制时额外衰减正确的平方反比衰减。当 Cutoff 值刚好对应物理衰减变得非常暗的位置时效果最佳。Cutoff 可提升烘焙性能，也可以设置为非常高（不可达）的值以保证完全正确性。&lt;br /&gt;
* Self Shadow：决定光源网格自身是否投射阴影。此选项同时启用更精确的光照算法。&lt;br /&gt;
* Samples Near：影响靠近网格的光照质量。典型值为 16 到 64，仅当 Self Shadow 开启时可用。&lt;br /&gt;
* Samples Far：影响远离网格的光照质量。典型值为 4 到 4096。&lt;br /&gt;
&lt;br /&gt;
Bakery 基于光源表面距离混合两种不同的区域光算法。靠近光源时，算法类似 GI，而远处光源被近似为虚拟点光云。&lt;br /&gt;
&lt;br /&gt;
{{note| &amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;光源网格自身不会接收光照，也不会被烘焙到光照贴图中。&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;一个拥有大量多边形的光源网格比烘焙多个简单的光源网格要快&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;如果结果总是脏/噪点较多，可以尝试将 Samples Near 设置为 0，这样只使用 VPL 算法。对于不需要精度的简单光源（如建筑物的窗户光），这也非常有用。&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;}}  &lt;br /&gt;
[[File:Dd99d-QU0AEKFBK.jpg|thumb|弯曲的光源网格]]  &lt;br /&gt;
* Bitmask：用于排除此光源影响特定 Lightmap Groups 的开关列表。  &lt;br /&gt;
* Baked contribution：决定烘焙哪种类型的光照数据。仅在 Indirect 或 Shadowmask 模式下可见。可能的值：  &lt;br /&gt;
** Direct and Indirect：完全烘焙直接和间接光贡献。这是默认且推荐的光源网格行为，因为 Unity 中没有实时版本可以模拟它们。  &lt;br /&gt;
** Indirect only：实时光源提供直接光贡献，仅烘焙间接光。  &lt;br /&gt;
** Shadowmask and Indirect：实时光源提供直接光贡献，但静态几何体的阴影会烘焙到单独的贴图。动态和静态阴影将混合在一起。间接光照将照常烘焙。目前仅 HDRP（和自定义渲染器）支持混合区域光。  &lt;br /&gt;
** Direct, Indirect, Shadowmask (custom lighting only)：与 Direct and Indirect 相同，但同时生成 Shadowmask 并分配用于自定义着色器。  &lt;br /&gt;
* Indirect intensity：非物理 GI 倍增器。自然光照应设为 1，但可修改以实现更风格化的场景。  &lt;br /&gt;
* Shadowmask with falloff：将完整光衰减烘焙进 Shadowmask（仅对自定义着色器有用）。  &lt;br /&gt;
&lt;br /&gt;
如果网格材质和光源设置不匹配，将出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match light to material：将网格材质或区域光的通用设置复制到 Bakery 光源。&lt;br /&gt;
* Match material to light：将 Bakery 光源的通用设置复制到网格材质或区域光。&lt;br /&gt;
&lt;br /&gt;
==== Light Mesh 与自发光材质的区别 ====&lt;br /&gt;
自发光材质：&lt;br /&gt;
&lt;br /&gt;
* 在 GI 计算中传播光线，因此是“免费的”，无论有多少网格是自发光的。&lt;br /&gt;
* 小而明亮的光可能会产生不准确或有噪点的结果，这取决于 GI 的采样数量。&lt;br /&gt;
* 由于 Bakery 中 GI 的工作方式，它必须占用光照贴图空间，因此可能会浪费空间。同时，这意味着自发光对象需要有效的 UV，并且必须启用“投射阴影”。&lt;br /&gt;
&lt;br /&gt;
Light Mesh：&lt;br /&gt;
&lt;br /&gt;
* 光照会为每个光源单独计算，因此比自发光材质慢。&lt;br /&gt;
* 设计用于为小而明亮的光提供干净的光照效果，即使距离很远也能保持效果。&lt;br /&gt;
* 不占用光照贴图空间。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Point Light ===&lt;br /&gt;
[[File:Image11.png|thumb|左：“Shadow Spread” = 0.5，右：“Shadow Spread” = 1。]]&lt;br /&gt;
点光源，没有面积。尽管在物理上不可能，但在游戏中很有用，并且是匹配 Unity 点光源和聚光灯的唯一方式。&lt;br /&gt;
{{note| 聚光灯只是带有额外投影遮罩的点光源。}}&lt;br /&gt;
&lt;br /&gt;
* Color: 颜色&lt;br /&gt;
* Intensity: 线性色彩倍增&lt;br /&gt;
* Shadow spread: 阴影模糊度。虽然点光源没有面积，但通常希望它仍能产生模糊阴影。为此，阴影被模拟为从球形区域光源投射。此参数定义了虚拟球体的半径，直接影响阴影模糊度。&lt;br /&gt;
* Physical falloff: 如果启用，将使用正确的平方反比衰减，并在边界附近额外衰减。否则将尝试模拟 Unity 的衰减。&lt;br /&gt;
* Falloff min size: 详见 [[Point Light Attenuation]] 部分。&lt;br /&gt;
* Range: 如果物理衰减被禁用，则等于 Unity 的光源范围；如果启用，只会在边缘轻微衰减物理衰减。&lt;br /&gt;
* Samples: 影响阴影质量。典型值为 1 到 512。设置为 0 将使该光源的阴影消失。&lt;br /&gt;
  [[File:Image10.png|thumb|从左到右：Omni，Cookie（默认聚光灯纹理），Cubemap，IES。]]&lt;br /&gt;
* Projection mask: 遮罩/Cookie 类型。选项：&lt;br /&gt;
** Omni: 无遮罩，相当于 Unity 的点光源。&lt;br /&gt;
** Cookie: 纹理投影遮罩。附加选项：&lt;br /&gt;
*** Cookie texture: 2D 纹理资源。Bakery 包含原始 Unity 聚光灯纹理（名为 ftUnitySpotTexture），可用于模拟。&lt;br /&gt;
*** Angle: 纹理投影角度（类似 Unity 聚光灯）。&lt;br /&gt;
*** Correct distortion: 修正宽角下直线可见的 cookie 失真。&lt;br /&gt;
** Cubemap: 立方体贴图投影遮罩。附加选项：&lt;br /&gt;
*** Projected cubemap: 立方体贴图资源。&lt;br /&gt;
** IES: 光照由 IES 文件数据调制。附加选项：&lt;br /&gt;
*** IES file: .ies 扩展名文件。&lt;br /&gt;
* Bitmask: 用于排除该光源影响特定 Lightmap Groups 的开关列表。&lt;br /&gt;
* Baked contribution: 决定应烘焙哪种类型的光照数据。仅在 Indirect 或 Shadowmask 模式下可见。可能值：&lt;br /&gt;
** Direct and Indirect: 直接光和间接光完全烘焙。&lt;br /&gt;
** Indirect only: 实时光提供直接光，仅烘焙间接光。&lt;br /&gt;
** Shadowmask and Indirect: 实时光提供直接光，但静态几何体阴影烘焙到单独贴图中，动态和静态阴影混合，间接光正常烘焙。&lt;br /&gt;
** Direct, Indirect, Shadowmask (custom lighting only): 与 Direct and Indirect 相同，同时生成 Shadowmask 用于自定义着色器。&lt;br /&gt;
* Indirect intensity: 该光的非物理 GI 倍增。自然光应为 1，可根据风格化场景修改。&lt;br /&gt;
* Shadowmask with falloff: 将完整光衰减（除距离外）烘焙到 Shadowmask（仅自定义着色器有用）。&lt;br /&gt;
* Legacy sampling: 使用 Bakery 原始更偏置的阴影采样策略。产生无噪点阴影，但宽半影可能出现条纹。禁用后使用无偏但更有噪点的技术。&lt;br /&gt;
&lt;br /&gt;
如果同一对象同时启用了 Unity 和 Bakery 光源，且设置不匹配，则会出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match lightmapped to real-time: 将 Unity 光的常用设置复制到 Bakery 光。&lt;br /&gt;
* Match real-time to lightmapped: 将 Bakery 光的常用设置复制到 Unity 光。&lt;br /&gt;
&lt;br /&gt;
{{note| 从物理角度来看，Bakery 点光源的“Intensity”为 Candela 除以 Pi。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Volume ===&lt;br /&gt;
[[File:Voldemo notlonely.gif|由 BakeryVolume 照亮的动态门（动态 GIF，由 NOTLonely 制作）]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
体积（Volumes）生成存储每个体素光探针的 3D 纹理（L1 球面调和和阴影贴图），使其成为常规 Unity 光探针的可行替代方案。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Unity Light Probes&lt;br /&gt;
! Unity LPPV&lt;br /&gt;
! Bakery Volumes&lt;br /&gt;
|-&lt;br /&gt;
| 手动放置每个光探针&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 否&lt;br /&gt;
|-&lt;br /&gt;
| 在一个物体上插值多个光探针&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 运行时可移动&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 可以放入预制件&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 完整脚本 API&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| “Ringing” 伪影&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 可能出现&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 可能出现&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 已修正&lt;br /&gt;
|-&lt;br /&gt;
| 去噪&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 运行时开销&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | CPU：低开销；GPU：低开销&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | CPU：中等开销；GPU：中等开销&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#e4ead3;&amp;quot; | CPU：无开销；GPU：中等开销&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bakery Volume 是一个与一组 3D 纹理（3 个 SH 纹理和一个可选的 shadowmask）关联的边界盒，使其非常易于使用和编程。Volumes 可以在运行时轻松地交换、移动、加载或卸载，也可以与预制件关联。它们不需要任何 Light Probe Groups 或手动探针布置；整个 Volume 都由均匀的探针体素网格填充。光/影泄漏会自动像处理光照贴图一样修复（尽管对于较大的体素尺寸，薄的双面墙可能会出现问题，但可以通过在不同侧使用不同 Volume 避免）。由于体素网格的均匀特性，也可以对其应用类似光照贴图的降噪，这是常规光探针无法做到的。此外，Bakery 着色器使用 [https://drive.google.com/file/d/1MK6Clw93q8ljijRjb4gQOzzaIjn1uF9Y/view Geomerics] 采样技巧，完全消除了高对比度 HDR 光照下 SH 有时会产生的 “ringing” 伪影。&lt;br /&gt;
&lt;br /&gt;
因此，Volumes 可以为动态物体生成干净、精细、高质量的烘焙光照（即来自静态物体并影响动态物体的光照，而不是相反）。&lt;br /&gt;
&lt;br /&gt;
Volume 方法的唯一缺点是每像素着色开销较高。其开销类似于 LPPV（随着屏幕上受体素影响的像素数量而缩放），但与 LPPV 不同的是，一旦烘焙完成，Volumes 本身不会再更新。多个 Volume 的混合可以通过稍微重叠它们来避免。&lt;br /&gt;
&lt;br /&gt;
====设置 Volume 变换====&lt;br /&gt;
[[File:Bvolgizmo.jpg|thumb|Volume 控制柄]]&lt;br /&gt;
当 BakeryVolume 被添加到一个 GameObject 时，场景视图中会出现一个边界盒控制柄。拖动小方块即可缩放它。&lt;br /&gt;
&lt;br /&gt;
还有其他方法可以更改 Volume 的大小和位置：&lt;br /&gt;
&lt;br /&gt;
* 将任何可渲染的 GameObject 拖入 “Wrap to object” 字段。Volume 会包裹该对象（及其子对象），以将它们完全包含在内。&lt;br /&gt;
* 如果同一个对象上添加了 Box Collider，则会出现 “Set from box collider” 和 “Set to box collider” 按钮。可以用它们快速在 Volume 和 Collider 之间复制数值。&lt;br /&gt;
&lt;br /&gt;
====分辨率====&lt;br /&gt;
当启用 “Adaptive resolution” 时，体素数量由 “Voxels per unit” 控制。禁用它可以手动输入分辨率。对于大多数 1 单位 = 1 米 的游戏来说，一个合理的 “Voxels per unit” 值是 2，但在某些情况下（例如动态门）使用较小但更高分辨率的 Volume 会更有利。&lt;br /&gt;
&lt;br /&gt;
====其他设置====&lt;br /&gt;
&lt;br /&gt;
* Enable baking: 是否需要（重新）计算 Volume？禁用可防止覆盖已有数据。&lt;br /&gt;
* Denoise: 在烘焙 Volume 后应用去噪。推荐用于高分辨率 Volume。避免用于覆盖许多光源的低分辨率 Volume，因为去噪器难以区分实际内容和噪声。&lt;br /&gt;
* Global: 自动将此 Volume 分配给所有兼容 Volume 的 Shader，除非它们有覆盖设置。内部会调用 Shader.SetGlobalTexture()/SetGlobalVector()。&lt;br /&gt;
====使用方法====&lt;br /&gt;
Volumes 可以分配给使用 Volume 感知 Shader 的对象。Bakery 自带实现该功能的 “Bakery Standard” Shader，以及 HDRP 和 URP 的 Shader 图。请查看 example_volumes 场景，了解应用 Volume 的各种方式。&lt;br /&gt;
&lt;br /&gt;
====提示====&lt;br /&gt;
&lt;br /&gt;
* 确保查看示例。&lt;br /&gt;
* 如果两个 Volume 相连，让它们略微重叠。重叠大小应等于最大动态对象的尺寸。这样在运行时简单切换 Volume 就能正常工作。&lt;br /&gt;
* 仅在动态对象实际可达的区域放置 Volume。例如，使用玩家高度限制 Volume 的高度。&lt;br /&gt;
&lt;br /&gt;
====旋转 Volumes====&lt;br /&gt;
如果启用 “Rotate around Y” 选项，Volumes 可以绕 Y 轴旋转。旋转开销非常低，只使用 2 个额外的浮点数据（预计算的角度 sin/cos）。&lt;br /&gt;
&lt;br /&gt;
还可以在运行时旋转 Volumes（Experimental -&amp;gt; “Support rotation after bake” 以及 Bakery Shader 中的类似选项），这种情况下 Volume 必须在初始旋转为零时进行烘焙。&lt;br /&gt;
&lt;br /&gt;
在 URP 中，这种动态旋转可以与 `BakeryURPVolumeGraphRotatable.shadergraph` 一起使用。&lt;br /&gt;
&lt;br /&gt;
对于全局 Volume，动态旋转会在组件被（重新）启用或调用 `volume.SetGlobalParams()` 时更新。使用局部旋转 Volume 时，需要手动在材质或 MaterialPropertyBlock 上设置旋转：&lt;br /&gt;
{{code|&amp;lt;nowiki&amp;gt;SetMatrix(&amp;quot;_VolumeMatrix&amp;quot;, volume.GetMatrix())&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
====技术信息====&lt;br /&gt;
Volumes 可以自动工作（查看示例场景），也可以通过脚本控制其使用方式。&lt;br /&gt;
&lt;br /&gt;
可以通过组件的以下公共属性获取 Volume 数据：&lt;br /&gt;
&lt;br /&gt;
* `bakedTexture0`：存储 L0 RGB 系数和 L1 Z 红色通道在 alpha 中。&lt;br /&gt;
* `bakedTexture1`：存储 L1 X RGB 系数和 L1 Z 绿色通道在 alpha 中。&lt;br /&gt;
* `bakedTexture2`：存储 L1 Y RGB 系数和 L1 Z 蓝色通道在 alpha 中。&lt;br /&gt;
* `bakedMask`：存储体积阴影遮罩。&lt;br /&gt;
* `bounds`：Volume 的包围盒。&lt;br /&gt;
&lt;br /&gt;
所有 `bakedTexture*` 使用 RGBAHalf（每体素 8 字节）格式，mask 使用 ARGB32（每体素 4 字节）。阴影遮罩也可以使用单通道 R8 格式（每体素 1 字节）。&lt;br /&gt;
&lt;br /&gt;
因此 Volume 的字节大小 = width * height * depth * 3 * 8 + （仅当使用阴影遮罩时）width * height * depth * 4（或使用 R8 mask 时为 width * height * depth）。&lt;br /&gt;
&lt;br /&gt;
[[使用手册#Compress_volumes|可以对 Volume 启用纹理压缩]]，使其体积显著减小。&lt;br /&gt;
&lt;br /&gt;
采样 Volume 需要特殊 Shader，这些 Shader 已包含在 Bakery 中。要在自定义 Shader 中添加 Volumes，请查看 HDRP/URP 包中包含的 `BakeryVolume_float()` 函数（位于 `BakeryDecodeLightmap.hlsl`）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Light Filter ===&lt;br /&gt;
[[File:Output optimized.gif|彩色玻璃，如在 &amp;quot;Bakery Real-Time Preview&amp;quot; 中所见。Bakery lightmapper 烘焙出的结果相同。]]&lt;br /&gt;
&lt;br /&gt;
将渲染器标记为光过滤器（Light Filter）。过滤器会用其颜色着色所有直接和间接光线，类似于现实中的光学滤镜，从而实现彩色透明效果（例如彩色玻璃）。唯一的参数是用于着色的纹理。&lt;br /&gt;
&lt;br /&gt;
* 光过滤器对象仍然会像其他对象一样接收光照贴图。&lt;br /&gt;
* 过滤器不会散射或模糊光线（如需此效果，请尝试 [[Subsurface_scattering|Subsurface Scattering]] 或 [[使用手册#Backface_GI|Backface GI]]）。&lt;br /&gt;
* 过滤器可以产生带颜色的阴影。如果灯光使用 [[使用手册#Shadowmask|Shadowmask]] 模式，则结果只会保存 R 通道（因为 Unity 仅支持单通道遮罩）。对于完全烘焙的阴影，则没有限制。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Sector ===&lt;br /&gt;
参见 '''[[Partial_scene_baking|Partial scene baking]]'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Always Render ===&lt;br /&gt;
如果添加到一个物体上，Bakery 在烘焙时将始终考虑该物体，即使它的 Renderer 被禁用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
=== Bakery Pack As Single Square ===&lt;br /&gt;
如果添加到一个物体上，Bakery 会将该物体及其子物体的 UV 视为单个组合方块，在自动图集打包或 Lightmap Group 的 Pack Atlas 模式下，它们之间永远不会被移动。整个子层级将作为一个整体打包。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
=== Bakery Shared LOD UV ===&lt;br /&gt;
如果添加到一个 LODGroup 上，将标记所有同名 LOD 共享同一个光照贴图。默认情况下，每个 LOD 网格会获得独立的光照贴图，占用图集空间；但如果已知同一个物体的 LOD 拥有相似的 UV2（或者在没有 UV2 且 UV1 不重叠的情况下），它们可以映射到图集的同一部分，从而节省内存。&lt;br /&gt;
这种技术也称为 [https://github.com/laurenth-personal/LODLightmapScripts/ Lightmap Stealing]。&lt;br /&gt;
&lt;br /&gt;
= 材质兼容性 =&lt;br /&gt;
&lt;br /&gt;
=== 漫反射和发光 ===&lt;br /&gt;
Bakery 利用 [https://docs.unity3d.com/Manual/MetaPass.html Meta Pass] 系统支持大多数 Unity 材质。所有内置、Surface、URP 和 HDRP 着色器都已经定义了正确的 Meta Pass。&lt;br /&gt;
&lt;br /&gt;
如果你使用的是 Unlit 着色器，需要按照 Unity 文档手动添加 Meta Pass。&lt;br /&gt;
&lt;br /&gt;
如果未定义该 Pass，Bakery 将假定 {{codeVar|_MainTex}}、{{codeVar|_BaseColorMap}} 或 {{codeVar|_Color}}（如果未设置纹理）为材质的漫反射（Albedo），并将 {{codeVar|_EmissionMap}} 和 {{codeVar|_EmissionColor}} 作为发光颜色。&lt;br /&gt;
&lt;br /&gt;
为了使发光生效，[https://docs.unity3d.com/ScriptReference/Material-globalIlluminationFlags.html Material.globalIlluminationFlags] 必须设置为 [https://docs.unity3d.com/ScriptReference/MaterialGlobalIlluminationFlags.BakedEmissive.html MaterialGlobalIlluminationFlags.BakedEmissive]。标准着色器会自动设置此值。&lt;br /&gt;
&lt;br /&gt;
=== 不透明度 ===&lt;br /&gt;
[[File:Upload 2019-1-25 0-4-30.png|thumb|材质参数被转换为 Cutout（默认）]]&lt;br /&gt;
[[File:Alphacombos dither.jpg|thumb|通过“Dither Transparency”选项添加半透明值]]&lt;br /&gt;
[[File:Alphacombos filter.jpg|thumb|Light Filter 组件用于红色平面，生成彩色阴影]]&lt;br /&gt;
&lt;br /&gt;
默认情况下，Bakery 始终从 {{codeVar|_MainTex}}、{{codeVar|_BaseColorMap}} 或 {{codeVar|_BaseMap}} 的 alpha 值获取全分辨率的不透明度，并将其视为 Cutout（1 位透明）。&lt;br /&gt;
&lt;br /&gt;
当启用 '''Dither Transparency''' 选项时，半透明值会自动转换为可变蓝噪声，然后被滤波/模糊，产生部分透明效果（以前可以通过自定义手动抖动贴图实现，但从 v1.97 起自动完成）。&lt;br /&gt;
&lt;br /&gt;
为了使不透明度生效，着色器的 [https://docs.unity3d.com/Manual/SL-SubShaderTags.html RenderType 标签] 必须为以下值之一：&lt;br /&gt;
&lt;br /&gt;
* {{codeVar|Transparent}}&lt;br /&gt;
* {{codeVar|TransparentCutout}}&lt;br /&gt;
* {{codeVar|TreeLeaf}}&lt;br /&gt;
&lt;br /&gt;
如果存在名为 {{codeVar|_Cutoff}} 的属性，它将影响 Cutout（因此 Standard 着色器的 Cutoff 滑块会自动生效）。&lt;br /&gt;
&lt;br /&gt;
在没有 Dither Transparency 的情况下，如果材质 RenderType 为 {{codeVar|Transparent}} 或 {{codeVar|TreeLeaf}}，则 {{codeVar|_Color}} 的 alpha 值会额外修改 Cutoff：&lt;br /&gt;
''finalCutoff = 1 - (1 - cutoff) * alpha''&lt;br /&gt;
&lt;br /&gt;
对于彩色透明效果，请使用 [[使用手册#Bakery_Light_Filter|Light Filter]] 组件。&lt;br /&gt;
&lt;br /&gt;
有关漫反射半透明效果，请参考 [[#Backface GI|Backface GI]] 和 [[subsurface scattering]]。&lt;br /&gt;
&lt;br /&gt;
==== Alpha Meta Pass ====&lt;br /&gt;
从 v1.9 起，Bakery 还支持指定基于自定义着色器的透明度，但这需要使用兼容的着色器。要使用 ''Alpha Meta Pass''，需要执行以下步骤：&lt;br /&gt;
&lt;br /&gt;
* 在着色器中添加一个名为 '''BAKERY_META_ALPHA_ENABLE''' 的属性。例如：&lt;br /&gt;
  {{code|&amp;lt;nowiki&amp;gt;[HideInInspector] BAKERY_META_ALPHA_ENABLE (&amp;quot;Enable Bakery alpha meta pass&amp;quot;, Float) = 1.0&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
* 确保 RenderType 标签设置为上文提到的某个值。&lt;br /&gt;
* 声明一个名为 '''META_BAKERY''' 的 Pass。&lt;br /&gt;
* 在该 Pass 中检查 '''unity_MetaFragmentControl.w''' 是否非零，如果是，则返回计算出的透明度值。&lt;br /&gt;
&lt;br /&gt;
示例可参考包内的 ''Baked_Alpha_meta.shader''。&lt;br /&gt;
&lt;br /&gt;
注意：当前 Alpha Meta Pass 需要将 Light Probe Mode 设置为 L1 或 L2。&lt;br /&gt;
&lt;br /&gt;
=== Normal mapping ===&lt;br /&gt;
自定义表面法线可以与 [[#Baked Normal Maps|烘焙法线贴图]] 模式一起使用。不幸的是，Unity 的 Meta Pass 默认不输出法线信息，因此默认情况下，法线取自名为 {{codeVar|_BumpMap}} 的贴图，并通过 {{codeVar|_MainTex_ST}} 进行额外变换。&lt;br /&gt;
&lt;br /&gt;
然而，可以制作完全自定义的着色器，带有高级法线映射功能（例如混合多层法线），并使其兼容烘焙。要实现这一点，需要执行以下步骤：&lt;br /&gt;
&lt;br /&gt;
1. 在着色器中定义一个 Meta Pass，具体方法请参考 [https://docs.unity3d.com/Manual/MetaPass.html#ExampleMetaPassUnity 文档]。&lt;br /&gt;
&lt;br /&gt;
2. 将该 Pass 命名为 {{codeVar|&amp;quot;META_BAKERY&amp;quot;}}，而不仅仅是 {{codeVar|&amp;quot;META&amp;quot;}}。&lt;br /&gt;
&lt;br /&gt;
3. 包含文件 {{codeVar|&amp;quot;BakeryMetaPass.cginc&amp;quot;}}。&lt;br /&gt;
&lt;br /&gt;
4. 添加 {{codeVar|#pragma vertex vert_bakerymt}}。&lt;br /&gt;
&lt;br /&gt;
5. 如果 {{codeVar|unity_MetaFragmentControl.z}} 变量不为 0，着色器应返回世界空间法线。返回的法线应使用 {{codeVar|BakeryEncodeNormal}} 函数编码。&lt;br /&gt;
&lt;br /&gt;
在 Assets/Bakery/examples/shaders 中包含了两个实现了扩展 Meta Pass 的示例着色器。&lt;br /&gt;
&lt;br /&gt;
你也可以复制并修改 BakeryMetaPass.cginc 以满足你的需求，例如从顶点着色器传递额外数据。&lt;br /&gt;
&lt;br /&gt;
=== 正/背面 ===&lt;br /&gt;
无论着色器使用何种剔除模式，Bakery 都将所有背面视为不透明，这意味着任何直接光线都不会穿过背面，就像它不会穿过正面一样。&lt;br /&gt;
然而，如果使用 [[使用手册#Backface_GI|Backface GI]]，背面可以部分发出正面接收到的光照。&lt;br /&gt;
&lt;br /&gt;
= 扩展 Lightmap Parameters 资源 =&lt;br /&gt;
[[File:Lp.jpg|thumb|扩展 Lightmap Parameters]]&lt;br /&gt;
类似于 Bakery 的 [[#Bakery_Lightmap_Group_Selector|Lightmap Group]]，Unity 也有 [https://docs.unity3d.com/Manual/class-LightmapParameters.html Lightmap Parameters]，可以作为资源创建并分配给 Mesh Renderer。它们的逻辑有相似之处也有不同之处：&lt;br /&gt;
&lt;br /&gt;
* Lightmap Group 的主要用途是将多个对象组合到同一个图集。此外，它还允许覆盖该图集的烘焙设置。&lt;br /&gt;
* Lightmap Parameters 主要用于覆盖对象的烘焙设置，但通过使用“Baked Tag”选项，它们也可以影响打包：具有不同 Baked Tag 的对象将永远不会共享同一个图集。&lt;br /&gt;
&lt;br /&gt;
由于有些用户更习惯 Lightmap Parameters 的工作流程，Bakery 现在支持并扩展了它们：&lt;br /&gt;
&lt;br /&gt;
* Bakery 会遵循 Baked Tag 设置。&lt;br /&gt;
* Lightmap Parameters UI 中将显示额外的 Bakery 特定选项。有关其含义，请参考 [[#Bakery_Lightmap_Group_Selector|Lightmap Group]] 部分。&lt;br /&gt;
&lt;br /&gt;
= 项目设置 =&lt;br /&gt;
一些全局设置可以在 Project Settings -&amp;gt; Bakery GPU Lightmapper 中调整（此选项仅在 Unity 2018.3 或更新版本可见；旧版本请编辑 BakeryProjectSettings.asset）：&lt;br /&gt;
&lt;br /&gt;
* Mipmap lightmaps：启用光照贴图的 mipmap。随着图集变小，可能会导致 UV 图块之间的泄漏；另一方面，它可以减少远处高分辨率光照贴图的锯齿。总体上，建议对非常远的物体使用单独烘焙的 LOD 以及较低分辨率的光照贴图。&lt;br /&gt;
* Color file format：常规 HDR 颜色光照贴图的文件格式。可选值：&lt;br /&gt;
**HDR：Radiance HDR 格式（默认）。可用多种图像编辑器打开。&lt;br /&gt;
**Asset：Unity 原生格式。可自定义 mipmap 数量。&lt;br /&gt;
* Mask/Direction file format：额外 LDR 地图的格式，如阴影遮罩或方向数据。可选值：&lt;br /&gt;
**TGA：8 位 Targa（默认）。&lt;br /&gt;
**PNG：8 位 PNG。通常比 TGA 占用更少磁盘空间。&lt;br /&gt;
**Asset：Unity 原生格式。可自定义 mipmap 数量。&lt;br /&gt;
* Compress lightmaps：定义光照贴图资源的压缩行为。压缩光照贴图占用更少的显存，但可能会出现一些视觉伪影（例如色带或色斑），具体取决于压缩类型（移动端压缩问题请参见[[Troubleshooting#I_have_an_Android_project.2C_and_lightmaps_don.27t_look_good|此处]]）。可选值：&lt;br /&gt;
*** Compress but allow overriding asset: 新的光照贴图将在启用压缩的情况下创建。创建后，可以在 Inspector 中更改它们的压缩设置。修改后的值将在重新烘焙后保留（默认）。&lt;br /&gt;
*** Force compress: 始终压缩所有光照贴图。&lt;br /&gt;
*** Force no compress: 始终生成未压缩的光照贴图。&lt;br /&gt;
* High quality direction: 为方向贴图启用“高”质量压缩。实际格式取决于平台。例如在 PC 上，它会从 DXT1 改为 BC7，这提供了更高的质量，但 VRAM 使用量会翻倍。&lt;br /&gt;
* Texel padding (default atlas packer): 定义在使用默认 atlas 打包器时，在光照贴图 atlas 中对象 UV 布局之间添加多少空白 texel。&lt;br /&gt;
* Texel padding (xatlas packer): 同上，但在使用 xatlas 时。&lt;br /&gt;
* Alpha Meta Pass resolution multiplier: 乘以 [[使用手册#Alpha_Meta_Pass|Alpha Meta Pass]] 的分辨率，使在低分辨率光照贴图烘焙时仍能实现精确的基于 Shader 的切割效果。&lt;br /&gt;
* Volume render mode: 为所有 [[使用手册#Bakery_Volume|Volumes]] 使用哪种 [[使用手册#Render_mode|渲染模式]]？Auto 使用当前活动的渲染模式（默认）。&lt;br /&gt;
* Delete previous lightmaps before bake: 在烘焙新光照贴图之前，实际删除该场景中所有之前渲染的光照贴图文件。&lt;br /&gt;
* Log level: 定义烘焙过程中在控制台输出的信息量。可能的值：&lt;br /&gt;
** 0: 不输出任何内容。&lt;br /&gt;
** 1: 仅输出进度信息。&lt;br /&gt;
** 2: 仅输出警告。&lt;br /&gt;
** 3: 输出全部信息。&lt;br /&gt;
* Alternative scale in lightmap: 使渲染器属性 'Scale in Lightmap' 的行为更类似于 Unity 内置的行为。&lt;br /&gt;
* Align to texture compression blocks with xatlas: 使 xatlas 将 chart 对齐到 4x4 块边界，从而获得更适合压缩的结果。&lt;br /&gt;
* Generate smooth positions: 是否应调整采样位置以防止低多边形几何体在平滑法线下产生错误阴影？在使用法线差异极大的几何体时，可在极少数情况下禁用。技术说明见 [https://ndotl.wordpress.com/2018/08/29/baking-artifact-free-lightmaps/#shadowterm 这篇文章]。&lt;br /&gt;
* Smooth positions per-triangle: 是否应按三角形决定平滑/平面位置？在使用法线差异极大的几何体时，可在极少数情况下禁用。&lt;br /&gt;
* Use 'Receive GI' values: 在渲染器上考虑 “Receive Global Illumination” 值。最初 Bakery 会忽略它。&lt;br /&gt;
* Remove ringing in Legacy light probes: 在 Legacy 模式下启用更柔和的光探针卷积，以防止高对比度区域出现伪影。&lt;br /&gt;
* Always render reflection probes: 在每次 Render/Render Light Probes 后自动渲染反射探针。&lt;br /&gt;
* Ringing removal for L2 light probes: 对 [[使用手册#Light_probe_mode|L2 光探针]] 应用去振铃处理。值越高，探针光照越平滑；这种平滑可以减少 [[https://docs.unity3d.com/6000.2/Documentation/Manual/light-probes-troubleshooting.html](https://docs.unity3d.com/6000.2/Documentation/Manual/light-probes-troubleshooting.html) 振铃] 伪影（如果存在）。&lt;br /&gt;
* Put menu under Tools: 将 Bakery 菜单放入 Tools 菜单下。&lt;br /&gt;
&lt;br /&gt;
如果任何格式设置为 Asset 且启用 mipmapping，会显示额外选项：&lt;br /&gt;
&lt;br /&gt;
* Maximum mipmap count: 定义 mipmap 的最大数量。例如，设置为 2，则 8K 光照贴图仅有两个额外 mipmap：4K 和 2K。更低分辨率将被省略，从而在 mipmapping 过程中限制泄漏伪影。&lt;br /&gt;
&lt;br /&gt;
= SkinnedMeshRenderer 支持 =&lt;br /&gt;
Bakery 自 v1.65 起支持蒙皮网格 (skinned meshes)。但是，有一些限制：&lt;br /&gt;
&lt;br /&gt;
* 某些 Unity 版本不支持蒙皮网格的 UV1，并会悄无声息地忽略 “Generate lightmap UVs”。请确保场景中实际使用的网格具有 UV1，并在可能的情况下使用非重叠的 UV0；&lt;br /&gt;
* UV 填充调整在蒙皮网格上不起作用（Unity 在尝试调用 Unwrap 函数时似乎会崩溃）；&lt;br /&gt;
* 蒙皮网格不能使用每顶点光照贴图 (per-vertex lightmaps)（引擎不支持带蒙皮的 additionalVertexStreams）。&lt;br /&gt;
&lt;br /&gt;
= Shader Tweaks =&lt;br /&gt;
[[File:Image2.jpg|thumb|左：默认双线性过滤。右：双三次过滤。]]&lt;br /&gt;
[[File:Image34.jpg|thumb|左：两个阴影都已烘焙。&amp;lt;br&amp;gt;中：球形阴影为动态，另一个阴影为静态。通过相乘组合在一起。&amp;lt;br&amp;gt;右：与中间相同，但使用默认最小值组合。]]&lt;br /&gt;
&lt;br /&gt;
Bakery 提供可选的着色器修改，可以应用到 Unity 着色器上，以改善光照贴图采样并使实时光照更接近光照贴图效果。着色器调整菜单可以通过 Bakery-&amp;gt;Shader Tweaks 访问。&lt;br /&gt;
&lt;br /&gt;
这些选项会修补基础 Unity 着色器包含文件（来自 CGIncludes 文件夹），这些文件被大多数内置和第三方着色器使用。所有修改都会影响使用该版本编辑器打开的所有项目，但也可以轻松恢复。着色器调整会影响标准和表面着色器的工作方式。HDRP、URP 以及其他 SRP 不受影响。&lt;br /&gt;
&lt;br /&gt;
所有可用修改显示为按钮。点击按钮应用修改，按钮将保持按下状态。再次点击按钮即可移除修改。目前可用选项：&lt;br /&gt;
&lt;br /&gt;
{{note| 可能需要以管理员身份运行 Unity 编辑器以使 CGIncludes 修补生效}}&lt;br /&gt;
&lt;br /&gt;
* Use bicubic interpolation for lightmaps: 光照贴图将使用双三次插值代替默认双线性。此调整能很好地修复低分辨率光照贴图的许多锯齿边缘。目前仅适用于 DX11 和现代主机，其他平台仍使用双线性。&lt;br /&gt;
* Use multiplication for shadowmask: 使用相乘代替最小值组合静态和动态阴影。出于未知原因，Unity 默认使用最小值操作符，这会产生一些乘法不存在的伪影。&lt;br /&gt;
* Use physical light falloff (forward): 用更物理正确的平方反比替换实时点光/聚光灯的默认衰减。“Range” 只会在边缘略微淡出（与 Bakery 光源启用 Physical Falloff 复选框效果一致）。仅影响 Forward 渲染器。详情见 [[Point Light Attenuation]]。&lt;br /&gt;
* Use physical light falloff (deferred): 同上，但仅影响 Deferred 渲染器。&lt;br /&gt;
&lt;br /&gt;
'''衰减调整在 Unity &amp;gt;2017 版本上可能无法完全生效。此外，SRP 默认已经使用正确的衰减。'''&lt;br /&gt;
&lt;br /&gt;
= Bakery shaders =&lt;br /&gt;
Bakery 包含了自带着色器，支持顶点光照贴图，以及 RNM 和 SH 方向模式。它还允许从方向数据计算近似烘焙高光。&lt;br /&gt;
对于普通颜色光照贴图、阴影遮罩和 Dominant Direction 模式，Bakery 着色器 '''不是必需的'''，因为这些功能大多数 Unity 着色器本身已经支持。&lt;br /&gt;
&lt;br /&gt;
=== Standard render pipeline ===&lt;br /&gt;
'''Bakery/Standard''': 扩展了普通 Standard 着色器。额外选项：&lt;br /&gt;
&lt;br /&gt;
* Allow Vertex Lightmaps: 允许该材质用于 [[Vertex Lightmaps|顶点光照贴图]]。&lt;br /&gt;
* Allow RNM Lightmaps: 允许该材质用于 [[#RNM|RNM 方向模式]]。&lt;br /&gt;
* Allow SH Lightmaps: 允许该材质用于 [[#SH|SH 方向模式]]。&lt;br /&gt;
  {{note| 所有 “Allow” 选项会在着色器中启用特定的代码路径。为了性能考虑，建议每个材质仅使用一个 “allow” 选项。}}&lt;br /&gt;
* Enable Lightmap Specular: 使用 Dominant Direction、RNM 或 SH 方向模式的数据计算烘焙高光。注意，由于信息有限，该效果仅为近似。如果你曾在 Unity 4 中使用烘焙高光，效果应可比。与高度扰动的法线贴图搭配效果最佳，在平面表面上效果不佳。&lt;br /&gt;
* Enable VertexLM directional: 如果存在顶点光照贴图，指定 Dominant Direction 数据存储在顶点中并应被使用。&lt;br /&gt;
* Enable VertexLM SH: 如果存在顶点光照贴图，指定 SH 数据存储在顶点中并应被使用。&lt;br /&gt;
* Enable VertexLM Shadowmask: 如果存在顶点光照贴图，指定阴影遮罩存储在顶点中并应被使用。&lt;br /&gt;
* Enable MonoSH: 将方向贴图视为 MonoSH 贴图。&lt;br /&gt;
[[File:Image5.png|thumb|Standard SH light probe vs non-linear]]&lt;br /&gt;
[[File:Shspec.jpg|thumb|SH specular effect]]&lt;br /&gt;
* Non-linear SH：在 SH 方向模式下，此选项可以增强对比度（更接近真实效果），但会使着色器稍微变慢。该技巧基于 Geomerics 的论文《[https://drive.google.com/file/d/1MK6Clw93q8ljijRjb4gQOzzaIjn1uF9Y/view Reconstructing Diffuse Lighting from Spherical Harmonic Data]》。&lt;br /&gt;
* Non-linear Light Probe SH：与 Non-linear SH 类似，但用于光照探针。在探针的情况下，最显著的好处是消除错误的负值。这种问题常见于具有高对比度、明亮 HDR 光源的场景中。这是球谐函数的固有限制，而不是 Bakery 特有的问题（即使用 Unity 内置光照贴图器也可能出现类似伪影）。&lt;br /&gt;
* Force Bicubic Filter：为所有附加贴图启用双三次滤波。若要实现完整的双三次滤波（包括第一张颜色贴图），建议同时在 [[#Shader Tweaks|Shader Tweaks]] 中启用该功能。&lt;br /&gt;
&lt;br /&gt;
'''Bakery/Standard Specular'''：与 Standard 相同，但用于高光（Specular）工作流程。&lt;br /&gt;
&lt;br /&gt;
=== HDRP &amp;amp; URP ===&lt;br /&gt;
要提取额外的 HDRP/URP 着色器，请打开 Bakery 自带的 Bakery_ShaderGraphHDRP.unitypackage 或 Bakery_ShaderGraphURP.unitypackage。&lt;br /&gt;
在其中，你会找到可在自己 Shader Graph 中使用的 Shader Subgraph，以及一些示例材质。&lt;br /&gt;
&lt;br /&gt;
=== 各着色器功能支持对比 ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! 大多数 Unity 着色器&lt;br /&gt;
! 大多数 HDRP 和 URP 着色器&lt;br /&gt;
! Bakery Standard&lt;br /&gt;
! Bakery HDRP graphs&lt;br /&gt;
! Bakery URP graphs&lt;br /&gt;
|-&lt;br /&gt;
| HDR color lightmaps&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Shadowmask&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是 (&amp;gt;= URP 10.1)&lt;br /&gt;
|-&lt;br /&gt;
| Dominant Direction&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| RNM&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| SH&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Mo否SH&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Lightmap specular&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持 Dominant Direction 和 SH&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持 Dominant Direction&lt;br /&gt;
|-&lt;br /&gt;
| Bicubic filtering&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是,&lt;br /&gt;
通过 [[#Shader Tweaks|Shader Tweaks]] 支持&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是,&lt;br /&gt;
通过 [[#Shader Tweaks|Shader Tweaks]] 支持&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
|-&lt;br /&gt;
| Vertex lightmaps&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 单一颜色，没有每顶点 SH、方向或阴影遮罩（Shader Graph 限制）&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 单一颜色，没有每顶点 SH、方向或阴影遮罩（Shader Graph 限制）&lt;br /&gt;
|-&lt;br /&gt;
| Non-Linear Light Probes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Volumes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Volume shadowmask&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Compressed volumes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{note| 除了普通颜色光照贴图之外，所有功能都至少需要 Shader Model 3.0 才能运行。}}&lt;br /&gt;
{{note| 使用 SH 模式的顶点光照贴图由于插值器数量限制，至少需要 Shader Model 4.0。}}&lt;br /&gt;
{{note| 含有从 Dominant Direction 生成高光的更新版 URP 图表可在 [[Bakery_-_GPU_Lightmapper|主维基页面]] 下载。}}&lt;br /&gt;
&lt;br /&gt;
另请参阅：[[Integrating_Bakery_shader_features_to_custom_shaders| 将 Bakery 着色器特性集成到自定义着色器中]]&lt;br /&gt;
&lt;br /&gt;
= 关于 HDRP/URP 的说明 =&lt;br /&gt;
将该插件导入到 HDRP 或 URP 项目后，一般即可直接使用，但需要注意以下几点：&lt;br /&gt;
&lt;br /&gt;
* 示例场景中同时使用了普通 Standard 着色器以及部分 “Bakery Standard” 着色器。HDRP 和 URP 提供了将项目着色器从 Standard 升级到 Lit 的机制，但无法从 Bakery Standard 升级。请将 Bakery Standard 材质替换为来自 Bakery_ShaderGraphHDRP.unitypackage 或 Bakery_ShaderGraphURP.unitypackage 中的材质。&lt;br /&gt;
&lt;br /&gt;
* 在 HDRP 中，默认 HDRI 天空亮度较高（11），且天空反射默认不会被遮蔽。再加上默认的自动曝光，可能导致某些示例场景几乎不可见，因为它们使用了更低的亮度进行烘焙。此时可将 HDRI 天空亮度降低到 1。HDRI 设置通常位于 Assets/HDRPDefaultResources/DefaultSettingsVolumeProfile 中。&lt;br /&gt;
&lt;br /&gt;
* 在 HDRP 中，如果示例场景中的灯光过亮，可在 Bakery 灯光组件上点击 “match real-time to lightmapped” 按钮。&lt;br /&gt;
&lt;br /&gt;
* 在 HDRP 中建议使用 OpenImageDenoise 2（最佳）或 OptiX 7 去噪器，因为它们对高亮度值更适合。&lt;br /&gt;
&lt;br /&gt;
* 在 HDRP 中，“distance” 与普通 Shadowmask 的切换可直接在 Light 组件上完成，而不是在全局设置中。&lt;br /&gt;
&lt;br /&gt;
* 不要在 Skylight 上使用 “match” 按钮，因为 HDRP 使用的是非常特定的程序化天空着色器。请改为将其烘焙为 HDRI [[How_do_I...#How_do_I_use_Skylight_with_a_procedural_sky_shader.3F|这种方式]]。&lt;br /&gt;
&lt;br /&gt;
* 建议在使用 HDRP 时始终将 Light Probe Mode 设置为 L2 或 L1，因为 HDRP 的渲染器并未针对 Legacy 模式进行优化。&lt;br /&gt;
&lt;br /&gt;
* 最新版本的 HDRP/URP 自带自己的 IES 文件导入器。由于资源类型不匹配，Unity 会将旧版本 Bakery IES 灯光断开连接，使其显示为普通点光源。它们可以重新连接并重新保存。&lt;br /&gt;
&lt;br /&gt;
Bakery 的示例场景是为内置渲染管线设计的，因此在 HDRP/URP 中正确渲染它们需要一些步骤。以下是一些提示；假设新建项目使用默认的 HDRP/URP 设置：&lt;br /&gt;
&lt;br /&gt;
=== 在 HDRP 中查看示例场景 ===&lt;br /&gt;
&lt;br /&gt;
* 导入 Bakery 后，将标准材质升级为 HDRP：Edit-&amp;gt;Rendering-&amp;gt;Materials-&amp;gt;Convert All Built-in Materials To HDRP。&lt;br /&gt;
* 将 Bakery_ShaderGraphHDRP.unitypackage 导入项目，因为它包含实现高级 Bakery 功能的特殊 Shader Graph（对于经典颜色/方向/遮罩光照贴图不需要）。&lt;br /&gt;
* 选择 DefaultSettingsVolumeProfile.asset。在 HDRI Sky 部分，将 Exposure Compensation 设置为 1。否则，与示例场景相比，默认 HDRP 会过亮，因曝光调整而使场景看起来很暗。&lt;br /&gt;
* 选择示例场景中的灯光时，HDRP 会初始化其自身的灯光数据。有时会导致灯光立即变得更亮。点击 “Match real-time to lightmapped” 以同步。&lt;br /&gt;
* 在渲染光探针前，将 Light Probe Mode 设置为 L2。&lt;br /&gt;
* '''example_directional''': 将 Shader 更改为 BakeryDirSpecGraph 以查看烘焙高光（或仅使用常规 HDRP/Lit 用于仅漫反射法线映射）。删除球体，因为当前没有支持逐顶点方向的 Shader Graph。&lt;br /&gt;
* '''example_directional_MonoSH''': 将 Shader 更改为 BakerySpecMonoSHGraph（或 BakeryMonoSHGraph，用于没有高光的略微低成本版本）。删除球体，因为当前没有支持逐顶点 MonoSH 的 Shader Graph。&lt;br /&gt;
* '''example_RNM''': 将 Shader 更改为 BakeryRNMGraph。&lt;br /&gt;
* '''example_SH''': 将 Shader 更改为 BakerySpecSHGraph（或 BakerySHGraph，用于没有高光的略微低成本版本）。删除球体，因为当前没有支持逐顶点 SH 的 Shader Graph。&lt;br /&gt;
* '''example_mixed_directional_mode''': 对 MonoSH/RNM/SH 平面，同样需要不同的 Graph。&lt;br /&gt;
* '''example_lights''': 将顶点光照球体的 Shader 更改为 BakeryVertexColorGraph。&lt;br /&gt;
* '''example_prefabs_bake''': 无需进一步调整。&lt;br /&gt;
* '''example_sectors''': 无需进一步调整。&lt;br /&gt;
* '''example_shadowmask''': 选择 DirectLight 并点击 “Match real-time to lightmapped” 修正亮度。将所有 HDRP 灯光的 Shadowmask Mode 设置为 Shadowmask。&lt;br /&gt;
* '''example_sponza_day''': 将 OpenImageDenoise 2（或 Optix 7，如果不支持）设置为首选去噪器。&lt;br /&gt;
* '''example_sponza_evening''': 将 OpenImageDenoise 2（或 Optix 7，如果不支持）设置为首选去噪器。&lt;br /&gt;
* '''example_subtractive''': HDRP 不支持减法模式。&lt;br /&gt;
* '''example_volumes_simple''': 将火车 Shader 更改为 BakeryVolumeSpecGraph（或 BakeryVolumeGraph，用于没有高光的略微低成本版本）。&lt;br /&gt;
* '''example_volumes_simple_shadowmask''': HDRP 当前不支持 Shadowmask Volumes。&lt;br /&gt;
* '''example_volumes_advanced''': 与 example_volumes_simple 相同。&lt;br /&gt;
* '''example_translucency''': 场景大部分应显示正常。对于 “Dynamic sphere lit by volume”，将 Shader 设置为 BakeryVolumeGraph。&lt;br /&gt;
&lt;br /&gt;
=== 在 URP 中查看示例场景 ===&lt;br /&gt;
&lt;br /&gt;
* 导入 Bakery 后，将标准材质升级为 URP：打开 Assets/Bakery/examples/content，输入 &amp;quot;t:material&amp;quot; 选择所有材质，并仅在 &amp;quot;content&amp;quot; 文件夹下搜索。点击 Edit-&amp;gt;Rendering-&amp;gt;Materials-&amp;gt;Convert Selected Built-in Materials To URP。&lt;br /&gt;
* 将 Bakery_ShaderGraphURP.unitypackage 导入项目，因为它包含实现高级 Bakery 功能的特殊 Shader Graph（对于经典颜色/方向/遮罩光照贴图不需要）。&lt;br /&gt;
* '''example_directional''': 将 Shader 更改为 BakeryURPLit，启用 &amp;quot;Bakery Lightmapped Specular&amp;quot;（或者仅保持常规 URP/Lit 用于仅漫反射法线映射）。删除球体，因为当前没有支持逐顶点方向的 Shader Graph。&lt;br /&gt;
* '''example_directional_MonoSH''': 将 Shader 更改为 BakeryURPLit，将 Bakery Mode 设置为 MonoSH，启用 &amp;quot;Bakery Lightmapped Specular&amp;quot;。在顶点光照球体上也启用 &amp;quot;Per-vertex&amp;quot;。&lt;br /&gt;
* '''example_RNM''': 将 Shader 更改为 BakeryURPLit，将 Bakery Mode 设置为 RNM，启用 &amp;quot;Bakery Lightmapped Specular&amp;quot;。&lt;br /&gt;
* '''example_SH''': 将 Shader 更改为 BakeryURPLit，将 Bakery Mode 设置为 SH，启用 &amp;quot;Bakery Lightmapped Specular&amp;quot;。删除球体，因为当前没有支持逐顶点 SH 的 Shader Graph。&lt;br /&gt;
* '''example_mixed_directional_mode''': 类似地使用 BakeryURPLit 并设置不同的 Bakery Mode（MonoSH、RNM、SH）。非方向性/主方向/烘焙法线贴图可使用常规 URP/Lit。&lt;br /&gt;
* '''example_lights''': 无需进一步调整。&lt;br /&gt;
* '''example_prefabs_bake''': 无需进一步调整。&lt;br /&gt;
* '''example_sectors''': 无需进一步调整。&lt;br /&gt;
* '''example_shadowmask''': 类似于 Built-in 渲染管线，在 Bakery 窗口（或项目 Quality Settings）中取消选中 Distance Shadowmask，以在摄像机附近查看实际烘焙/实时阴影混合效果。&lt;br /&gt;
* '''example_sponza_day''': 在植被材质上启用 alpha clipping。&lt;br /&gt;
* '''example_sponza_evening''': 同 example_sponza_day。&lt;br /&gt;
* '''example_subtractive''': 无需进一步调整。&lt;br /&gt;
* '''example_volumes_simple''': 将火车 Shader 更改为 BakeryURPLit，并将 Bakery Mode 设置为 Volume。可选启用 &amp;quot;Bakery Lightmapped Specular&amp;quot;。&lt;br /&gt;
* '''example_volumes_simple_shadowmask''': 与 example_volumes_simple 相同，但也启用 &amp;quot;Volume Shadowmask&amp;quot;。&lt;br /&gt;
* '''example_volumes_advanced''': 与 example_volumes_simple 相同。&lt;br /&gt;
* '''example_translucency''': 场景大部分应显示正常。对于 &amp;quot;Dynamic sphere lit by volume&amp;quot;，将 Shader 设置为 BakeryURPLit 并将 Bakery Mode 设置为 Volume。&lt;br /&gt;
&lt;br /&gt;
= 升级 Bakery =&lt;br /&gt;
在升级该资源时，建议遵循以下步骤：&lt;br /&gt;
&lt;br /&gt;
* 关闭 Bakery 窗口。&lt;br /&gt;
* 关闭 Unity。&lt;br /&gt;
* 重新打开 Unity。&lt;br /&gt;
* 导入更新后的包。&lt;br /&gt;
&lt;br /&gt;
请注意，如果不先关闭 Unity，导入可能会失败，因为 DLL 文件被锁定（会出现类似 &amp;quot;alphabuffergen.dll: Access is denied.&amp;quot; 的提示）。&lt;br /&gt;
&lt;br /&gt;
如果你移动过 Bakery 文件夹（Assets/Bakery 和 Assets/Editor/x64/Bakery）到其他位置，可能需要在更新前将它们移回原处，以避免出现两个冲突的包副本。&lt;br /&gt;
&lt;br /&gt;
= 脚本 API =&lt;br /&gt;
&lt;br /&gt;
== 基本用法 ==&lt;br /&gt;
&lt;br /&gt;
获取并修改渲染设置：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ftLightmapsStorage storage = ftRenderLightmap.FindRenderSettingsStorage();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
可以在 ftLightmapsStorage.cs 中查看可用设置的完整列表。&lt;br /&gt;
&lt;br /&gt;
获取 lightmapper 实例并（重新）加载设置：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap bakery = ftRenderLightmap.instance != null ? ftRenderLightmap.instance : new ftRenderLightmap();&lt;br /&gt;
bakery.LoadRenderSettings();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
渲染光照贴图（如果设置为 L1 或 L2 模式，也会渲染探针）：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;bakery.RenderButton(bool showMsgWindows)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
仅渲染光探针：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;bakery.RenderLightProbesButton(bool showMsgWindows)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
仅渲染反射探针：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;bakery.RenderReflectionProbesButton(bool showMsgWindows)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''showMsgWindows''' 指示是否可以显示任何对话框/确认框。如果设置为 false，则抑制显示。&lt;br /&gt;
&lt;br /&gt;
检查烘焙是否正在进行：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.bakeInProgress&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
使用示例请参考 [[Community_extensions#Batch_scene_baker|Batch Scene Baker]] 脚本。&lt;br /&gt;
&lt;br /&gt;
== 额外函数 ==&lt;br /&gt;
&lt;br /&gt;
将一个 ftLightmapsStorage 的所有渲染设置复制到另一个：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmapsStorage.CopySettings(ftLightmapsStorage src, ftLightmapsStorage dest)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
获取全局（每项目）存储对象：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftGlobalStorage gstorage = ftLightmaps.GetGlobalStorage()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
将 ftLightmapsStorage（每场景）的所有渲染设置复制到 ftGlobalStorage（每项目）：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmapsStorage.CopySettings(ftLightmapsStorage src, ftGlobalStorage dest)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
将 ftGlobalStorage（每项目）的所有渲染设置复制到 ftLightmapsStorage（每场景）：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmapsStorage.CopySettings(ftGlobalStorage src, ftLightmapsStorage dest)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
获取包含 Bakery 二进制文件的文件夹路径：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmaps.GetEditorPath()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 额外变量 ==&lt;br /&gt;
&lt;br /&gt;
获取当前临时文件路径（必须先创建 ftRenderLightmap 实例）：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.scenePath&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
获取/设置 UVGBuffer 数据压缩（启用时为 LZ4，否则为 DDS）：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.compressedGBuffer&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
获取/设置输出光照贴图数据压缩（启用时为 LZ4，否则为 DDS）：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.compressedOutput&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 事件 ==&lt;br /&gt;
&lt;br /&gt;
脚本可以订阅 ftRenderLightmap 类中的静态事件。&lt;br /&gt;
&lt;br /&gt;
在完整渲染前调用：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnPreFullRender&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
在 Legacy 光探针模式下，每渲染一个光探针前调用。ProbeEventArgs 是一个结构体，包含 '''pos''' 字段表示当前光探针的位置：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler&amp;lt;ProbeEventArgs&amp;gt; OnPreRenderProbe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
在 Legacy 光探针渲染完成后调用：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnFinishedProbes&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
在完整渲染完成后调用：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnFinishedFullRender&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
在反射探针渲染前调用：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnPreReflectionProbeRender&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
在反射探针渲染完成后调用：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnFinishedReflectionProbes&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mr F</name></author>
		
	</entry>
	<entry>
		<id>https://geom.io/bakery/wiki/index.php?title=Bakery_-_GPU_Lightmapper&amp;diff=1856</id>
		<title>Bakery - GPU Lightmapper</title>
		<link rel="alternate" type="text/html" href="https://geom.io/bakery/wiki/index.php?title=Bakery_-_GPU_Lightmapper&amp;diff=1856"/>
		<updated>2026-01-03T22:11:46Z</updated>

		<summary type="html">&lt;p&gt;Mr F: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[What is Bakery and why use it]]&lt;br /&gt;
&lt;br /&gt;
== Bakery for Unity ==&lt;br /&gt;
* [https://assetstore.unity.com/packages/tools/level-design/bakery-gpu-lightmapper-122218 Asset Store page]&lt;br /&gt;
* [[Github access]]&lt;br /&gt;
* '''[[RTPreview|RTPreview manual]]'''&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
* '''[[Manual|Manual (v1.98)]]'''&lt;br /&gt;
** &amp;lt;small&amp;gt;Also available in different languages:&amp;lt;/small&amp;gt;&lt;br /&gt;
*** &amp;lt;small&amp;gt;[[Benutzerhandbuch]]&amp;lt;/small&amp;gt;&lt;br /&gt;
*** &amp;lt;small&amp;gt;[[使用手册]]&amp;lt;/small&amp;gt;&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
* [https://docs.google.com/document/d/1r-ZFqovUkVXL-1S9ATYqUHL00M5SpiM2Qwjg0eVCJ4Y/edit Changelog]&lt;br /&gt;
* [https://drive.google.com/file/d/1i_zkeB4VBgNOI_-dBqxkdwZ4HCj6tTyA/view?usp=share_link Latest URP graphs (rev 2.0) (12.1.6)]&lt;br /&gt;
* [https://drive.google.com/file/d/1kutq2zwyOGhSw79_rtZNeW5cFOLWzuVr/view?usp=share_link Latest URP graphs (14.0.7)]&lt;br /&gt;
* [https://drive.google.com/file/d/1CIM7_LFaMJ2lxs4eZMZ-KgX8OA7KBt2U/view?usp=sharing Latest URP graphs (15.0.6)]&lt;br /&gt;
* [https://drive.google.com/file/d/1IJIbw2He3c5xa9hdaTVHnqIf5Ewfg0gZ/view?usp=sharing Latest URP graphs (15.0.7)]&lt;br /&gt;
* [https://drive.google.com/file/d/1lmQsDjLnP-HlslQNHffjqj6Bty9iJUzH/view?usp=sharing Latest URP graphs (16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/1mTpG6o9RfjSlq8EBdpQ8kSZVZq3JP4BQ/view?usp=sharing Latest URP graphs (rev 9.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/1fw7OM83pp0jRHqLjpF2WRZYSd1Z1H1Eh/view?usp=sharing Latest URP graphs (rev 12.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/18TU_8MpVdUiSQjCm1JWyg-binr02ZfzZ/view?usp=sharing Latest URP graphs (rev 13.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/15Nga4ld-F0_GzCfkDLrE3Uv1QfIYvIGk/view?usp=sharing Latest URP graphs (rev 14.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/1x6kCNmJzKgOnnQRQx7ol5VSNMq4VwFeU/view?usp=sharing Latest URP graphs (rev 15.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/1RvaSoy4ceOCTQIHs5DvdYlt5gUEkDYG5/view?usp=sharing Latest URP graphs (rev 16.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/1-1_oNZyPptlcUWWjcXzcTv1-b-mPJBsw/view?usp=sharing Latest HDRP graphs (10.4.0)]&lt;br /&gt;
* [https://drive.google.com/file/d/1hYn8FXPf47FsVTgoao0jV0AqxGFN48dH/view?usp=sharing Latest HDRP graphs (11.0.0)]&lt;br /&gt;
* [https://drive.google.com/file/d/1dLlg-GWYbyzvG9jo9srnpnht1S19W6Z2/view Latest HDRP graphs (12.1.6)]&lt;br /&gt;
* [https://drive.google.com/file/d/1RBRS024Dd9ddM-35D1KssOReTrcC8zGn/view?usp=sharing Latest HDRP graphs (14.0.7)]&lt;br /&gt;
* [https://drive.google.com/file/d/1z3jSHNgHALU6r3b6lBXEBvHLlxEmXARZ/view?usp=sharing Latest HDRP graphs (rev 2.0) (14.0.7)]&lt;br /&gt;
* [[FAQ]]&lt;br /&gt;
* [[How do I...]]&lt;br /&gt;
* [[Reporting bugs]]&lt;br /&gt;
* [[Troubleshooting]]&lt;br /&gt;
* [[Community extensions]]&lt;br /&gt;
* [https://discord.gg/dP3SkdM Community Discord]&amp;lt;br&amp;gt;&amp;lt;small&amp;gt;(for support, please contact me on [https://discussions.unity.com/t/bakery-gpu-lightmapper-v1-96-rtpreview-released/704890/7512 Unity forum] / [https://github.com/guycalledfrank/bakery-issues/issues github] / or via email listed [https://assetstore.unity.com/publishers/37453 here]).&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bakery is made by [https://twitter.com/guycalledfrank Mr F]&lt;br /&gt;
&lt;br /&gt;
== Decalery ==&lt;br /&gt;
* '''[[Decalery manual]]'''&lt;br /&gt;
* [[Decalery Github access]]&lt;/div&gt;</summary>
		<author><name>Mr F</name></author>
		
	</entry>
	<entry>
		<id>https://geom.io/bakery/wiki/index.php?title=Bakery_-_GPU_Lightmapper&amp;diff=1855</id>
		<title>Bakery - GPU Lightmapper</title>
		<link rel="alternate" type="text/html" href="https://geom.io/bakery/wiki/index.php?title=Bakery_-_GPU_Lightmapper&amp;diff=1855"/>
		<updated>2026-01-03T22:08:04Z</updated>

		<summary type="html">&lt;p&gt;Mr F: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[What is Bakery and why use it]]&lt;br /&gt;
&lt;br /&gt;
== Bakery for Unity ==&lt;br /&gt;
* [https://assetstore.unity.com/packages/tools/level-design/bakery-gpu-lightmapper-122218 Asset Store page]&lt;br /&gt;
* [[Github access]]&lt;br /&gt;
* '''[[RTPreview|RTPreview manual]]'''&lt;br /&gt;
* '''[[Manual|Manual (v1.98)]]'''&lt;br /&gt;
** Also available in different languages:&lt;br /&gt;
*** [[Benutzerhandbuch]]&lt;br /&gt;
*** [[使用手册]]&lt;br /&gt;
* [https://docs.google.com/document/d/1r-ZFqovUkVXL-1S9ATYqUHL00M5SpiM2Qwjg0eVCJ4Y/edit Changelog]&lt;br /&gt;
* [https://drive.google.com/file/d/1i_zkeB4VBgNOI_-dBqxkdwZ4HCj6tTyA/view?usp=share_link Latest URP graphs (rev 2.0) (12.1.6)]&lt;br /&gt;
* [https://drive.google.com/file/d/1kutq2zwyOGhSw79_rtZNeW5cFOLWzuVr/view?usp=share_link Latest URP graphs (14.0.7)]&lt;br /&gt;
* [https://drive.google.com/file/d/1CIM7_LFaMJ2lxs4eZMZ-KgX8OA7KBt2U/view?usp=sharing Latest URP graphs (15.0.6)]&lt;br /&gt;
* [https://drive.google.com/file/d/1IJIbw2He3c5xa9hdaTVHnqIf5Ewfg0gZ/view?usp=sharing Latest URP graphs (15.0.7)]&lt;br /&gt;
* [https://drive.google.com/file/d/1lmQsDjLnP-HlslQNHffjqj6Bty9iJUzH/view?usp=sharing Latest URP graphs (16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/1mTpG6o9RfjSlq8EBdpQ8kSZVZq3JP4BQ/view?usp=sharing Latest URP graphs (rev 9.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/1fw7OM83pp0jRHqLjpF2WRZYSd1Z1H1Eh/view?usp=sharing Latest URP graphs (rev 12.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/18TU_8MpVdUiSQjCm1JWyg-binr02ZfzZ/view?usp=sharing Latest URP graphs (rev 13.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/15Nga4ld-F0_GzCfkDLrE3Uv1QfIYvIGk/view?usp=sharing Latest URP graphs (rev 14.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/1x6kCNmJzKgOnnQRQx7ol5VSNMq4VwFeU/view?usp=sharing Latest URP graphs (rev 15.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/1RvaSoy4ceOCTQIHs5DvdYlt5gUEkDYG5/view?usp=sharing Latest URP graphs (rev 16.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/1-1_oNZyPptlcUWWjcXzcTv1-b-mPJBsw/view?usp=sharing Latest HDRP graphs (10.4.0)]&lt;br /&gt;
* [https://drive.google.com/file/d/1hYn8FXPf47FsVTgoao0jV0AqxGFN48dH/view?usp=sharing Latest HDRP graphs (11.0.0)]&lt;br /&gt;
* [https://drive.google.com/file/d/1dLlg-GWYbyzvG9jo9srnpnht1S19W6Z2/view Latest HDRP graphs (12.1.6)]&lt;br /&gt;
* [https://drive.google.com/file/d/1RBRS024Dd9ddM-35D1KssOReTrcC8zGn/view?usp=sharing Latest HDRP graphs (14.0.7)]&lt;br /&gt;
* [https://drive.google.com/file/d/1z3jSHNgHALU6r3b6lBXEBvHLlxEmXARZ/view?usp=sharing Latest HDRP graphs (rev 2.0) (14.0.7)]&lt;br /&gt;
* [[FAQ]]&lt;br /&gt;
* [[How do I...]]&lt;br /&gt;
* [[Reporting bugs]]&lt;br /&gt;
* [[Troubleshooting]]&lt;br /&gt;
* [[Community extensions]]&lt;br /&gt;
* [https://discord.gg/dP3SkdM Community Discord]&amp;lt;br&amp;gt;&amp;lt;small&amp;gt;(for support, please contact me on [https://discussions.unity.com/t/bakery-gpu-lightmapper-v1-96-rtpreview-released/704890/7512 Unity forum] / [https://github.com/guycalledfrank/bakery-issues/issues github] / or via email listed [https://assetstore.unity.com/publishers/37453 here]).&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bakery is made by [https://twitter.com/guycalledfrank Mr F]&lt;br /&gt;
&lt;br /&gt;
== Decalery ==&lt;br /&gt;
* '''[[Decalery manual]]'''&lt;br /&gt;
* [[Decalery Github access]]&lt;/div&gt;</summary>
		<author><name>Mr F</name></author>
		
	</entry>
	<entry>
		<id>https://geom.io/bakery/wiki/index.php?title=Bakery_-_GPU_Lightmapper&amp;diff=1854</id>
		<title>Bakery - GPU Lightmapper</title>
		<link rel="alternate" type="text/html" href="https://geom.io/bakery/wiki/index.php?title=Bakery_-_GPU_Lightmapper&amp;diff=1854"/>
		<updated>2026-01-03T22:04:29Z</updated>

		<summary type="html">&lt;p&gt;Mr F: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[What is Bakery and why use it]]&lt;br /&gt;
&lt;br /&gt;
== Bakery for Unity ==&lt;br /&gt;
* [https://assetstore.unity.com/packages/tools/level-design/bakery-gpu-lightmapper-122218 Asset Store page]&lt;br /&gt;
* [[Github access]]&lt;br /&gt;
* '''[[RTPreview|RTPreview manual]]'''&lt;br /&gt;
* '''[[Manual|Manual (v1.98)]]'''&lt;br /&gt;
* [https://docs.google.com/document/d/1r-ZFqovUkVXL-1S9ATYqUHL00M5SpiM2Qwjg0eVCJ4Y/edit Changelog]&lt;br /&gt;
* [https://drive.google.com/file/d/1i_zkeB4VBgNOI_-dBqxkdwZ4HCj6tTyA/view?usp=share_link Latest URP graphs (rev 2.0) (12.1.6)]&lt;br /&gt;
* [https://drive.google.com/file/d/1kutq2zwyOGhSw79_rtZNeW5cFOLWzuVr/view?usp=share_link Latest URP graphs (14.0.7)]&lt;br /&gt;
* [https://drive.google.com/file/d/1CIM7_LFaMJ2lxs4eZMZ-KgX8OA7KBt2U/view?usp=sharing Latest URP graphs (15.0.6)]&lt;br /&gt;
* [https://drive.google.com/file/d/1IJIbw2He3c5xa9hdaTVHnqIf5Ewfg0gZ/view?usp=sharing Latest URP graphs (15.0.7)]&lt;br /&gt;
* [https://drive.google.com/file/d/1lmQsDjLnP-HlslQNHffjqj6Bty9iJUzH/view?usp=sharing Latest URP graphs (16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/1mTpG6o9RfjSlq8EBdpQ8kSZVZq3JP4BQ/view?usp=sharing Latest URP graphs (rev 9.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/1fw7OM83pp0jRHqLjpF2WRZYSd1Z1H1Eh/view?usp=sharing Latest URP graphs (rev 12.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/18TU_8MpVdUiSQjCm1JWyg-binr02ZfzZ/view?usp=sharing Latest URP graphs (rev 13.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/15Nga4ld-F0_GzCfkDLrE3Uv1QfIYvIGk/view?usp=sharing Latest URP graphs (rev 14.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/1x6kCNmJzKgOnnQRQx7ol5VSNMq4VwFeU/view?usp=sharing Latest URP graphs (rev 15.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/1RvaSoy4ceOCTQIHs5DvdYlt5gUEkDYG5/view?usp=sharing Latest URP graphs (rev 16.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/1-1_oNZyPptlcUWWjcXzcTv1-b-mPJBsw/view?usp=sharing Latest HDRP graphs (10.4.0)]&lt;br /&gt;
* [https://drive.google.com/file/d/1hYn8FXPf47FsVTgoao0jV0AqxGFN48dH/view?usp=sharing Latest HDRP graphs (11.0.0)]&lt;br /&gt;
* [https://drive.google.com/file/d/1dLlg-GWYbyzvG9jo9srnpnht1S19W6Z2/view Latest HDRP graphs (12.1.6)]&lt;br /&gt;
* [https://drive.google.com/file/d/1RBRS024Dd9ddM-35D1KssOReTrcC8zGn/view?usp=sharing Latest HDRP graphs (14.0.7)]&lt;br /&gt;
* [https://drive.google.com/file/d/1z3jSHNgHALU6r3b6lBXEBvHLlxEmXARZ/view?usp=sharing Latest HDRP graphs (rev 2.0) (14.0.7)]&lt;br /&gt;
* [[FAQ]]&lt;br /&gt;
* [[How do I...]]&lt;br /&gt;
* [[Reporting bugs]]&lt;br /&gt;
* [[Troubleshooting]]&lt;br /&gt;
* [[Community extensions]]&lt;br /&gt;
* [https://discord.gg/dP3SkdM Community Discord]&amp;lt;br&amp;gt;&amp;lt;small&amp;gt;(for support, please contact me on [https://discussions.unity.com/t/bakery-gpu-lightmapper-v1-96-rtpreview-released/704890/7512 Unity forum] / [https://github.com/guycalledfrank/bakery-issues/issues github] / or via email listed [https://assetstore.unity.com/publishers/37453 here]).&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bakery is made by [https://twitter.com/guycalledfrank Mr F]&lt;br /&gt;
&lt;br /&gt;
== Decalery ==&lt;br /&gt;
* '''[[Decalery manual]]'''&lt;br /&gt;
* [[Decalery Github access]]&lt;/div&gt;</summary>
		<author><name>Mr F</name></author>
		
	</entry>
	<entry>
		<id>https://geom.io/bakery/wiki/index.php?title=Benutzerhandbuch&amp;diff=1853</id>
		<title>Benutzerhandbuch</title>
		<link rel="alternate" type="text/html" href="https://geom.io/bakery/wiki/index.php?title=Benutzerhandbuch&amp;diff=1853"/>
		<updated>2026-01-03T22:03:18Z</updated>

		<summary type="html">&lt;p&gt;Mr F: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!-- This box simply informs German users that a) this Manual was translated from English into German, b) it may be outdated due to frequent updates, c) users should read the original English version for a more up-to-date edition. --&amp;gt;&lt;br /&gt;
{{note| Dieses Benutzerhandbuch wurde aus dem Englischen ins Deutsche übersetzt. Es kann unter Umständen veraltete Informationen enthalten, da Bakery stetig weiterentwickelt wird. Für eine aktuellere Version, lesen Sie bitte die [[Manual|englische Originalfassung]].}}&lt;br /&gt;
&lt;br /&gt;
== Systemanforderungen ==&lt;br /&gt;
Um Bakery nutzen zu können, benötigen Sie:&lt;br /&gt;
* einen PC mit Windows (7 oder höher).&lt;br /&gt;
* eine NVIDIA GPU. Minimal unterstütztes Modell ist Kepler (GeForce 650 oder neuer; Für Quadro-Karten überprüfen Sie bitte die jeweiligen Spezifikationen).&lt;br /&gt;
* einen 64-bit Unity Editor. Bakery wurde auf allen Versionen - von 5.6 bis 6000.X und höher - getestet.&lt;br /&gt;
&lt;br /&gt;
{{note| Die Systemanforderungen gelten nur für die Entwicklerumgebung, nicht für die anvisierte(n) Zielplattform(en). Mit Bakery gebackene Lightmaps können überall verwendet werden.}}&lt;br /&gt;
&lt;br /&gt;
== Bevor Sie beginnen... ==&lt;br /&gt;
* ... stellen Sie bitte sicher, dass Ihr Unity Projekt keine Skriptkompilierungsfehler enthält, da diese auch die Kompilierung von Bakery-Skripten verhindern.&lt;br /&gt;
* ... stellen Sie außerdem sicher, dass Sie den aktuellsten Grafiktreiber für Ihre Karte installiert haben. [https://www.nvidia.com/Download/index.aspx?lang=en-US Aktualisieren Sie Ihren Grafiktreiber], falls nötig.&lt;br /&gt;
&lt;br /&gt;
'''Wichtig: Verwenden Sie den GeForce Game Ready-Treiber (Standard) anstelle des NVIDIA Studio-Treibers.'''&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
1. Importieren Sie Bakery über den [https://assetstore.unity.com/packages/tools/level-design/bakery-gpu-lightmapper-122218 Asset Store] in Ihr Projekt.&lt;br /&gt;
&lt;br /&gt;
2. Unity wird Ihnen eine Liste an Dateien, die zu importieren sind, anzeigen. Wenn Sie Bakery zum ersten Mal verwenden, empfehlen wir Ihnen den einfachen Klick auf '''Import'''. Erfahrene Benutzer möchten zuvor möglicherweise noch den Ordner ''examples'' exkludieren, um eine schlankere Installation zu erhalten.&lt;br /&gt;
&lt;br /&gt;
Die Dateien werden in die Ordner Assets/Bakery und Assets/Editor/x64/Bakery kopiert. Beide Ordner können später verschoben werden.&lt;br /&gt;
&lt;br /&gt;
3. Unity importiert nun Bakery und kompiliert die Skripte. Es wird eventuell folgendes Fenster angezeigt:&lt;br /&gt;
&lt;br /&gt;
[[File:Goahead.png]]&lt;br /&gt;
&lt;br /&gt;
In diesem Fall können Sie einfach auf &amp;quot;Go Ahead&amp;quot; klicken.&lt;br /&gt;
&lt;br /&gt;
Sie sollten jetzt den Menüeintrag von Bakery am oberen Bildschirmrand sehen:&lt;br /&gt;
&lt;br /&gt;
[[File:bmenu.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Schnellstart ==&lt;br /&gt;
&lt;br /&gt;
1. Platzieren Sie ein beliebiges 3D-Modell oder Unity Primitive in Ihre Szene und markieren Sie es als Static.&lt;br /&gt;
&lt;br /&gt;
'''Meshes dürfen für das Lightmapping keine überlappenden UV-Bereiche vorweisen. Der UV2-Kanal wird, sofern vorhanden, verwendet (andernfalls UV1). Sollten Sie Ihre 3D-Modelle nicht für das Lightmapping vorbereitet haben, müssen Sie die Einstellung [https://docs.unity3d.com/Manual/LightingGiUvs-GeneratingLightmappingUVs.html Generate Lightmap UVs] am Asset aktivieren.''' Unity Primitives besitzen bereits valide UV2-Kanäle.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Staticmarked.jpg|320px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Wählen Sie das Directional Light (das, was von Unity bereits erstellt wurde) aus und fügen Sie ihm eine '''Bakery Direct Light'''-Komponente hinzu.&lt;br /&gt;
{{note| Bakery und Unity nutzen jeweils separate Lichtquellen-Komponenten.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Das Bakery Direct Light bietet viele verschiedene Einstellungsmöglichkeiten, aber es ist sehr einfach, die Komponente an das Unity-eigene Licht anzugleichen. Klicken Sie hierfür auf '''Match lightmapped to real-time'''. Nun sollte das Bakery Direct Light die gleiche Lichtfarbe besitzen wie Unity’s Directional Light.&lt;br /&gt;
&lt;br /&gt;
[[File:Matching.jpg|640px]]&lt;br /&gt;
&lt;br /&gt;
{{note| Die Direct Light-Komponente könnte eine Warnung anzeigen, dass das Projekt keine lineare Lichtintensität verwendet. Das Problem besteht darin, dass Unity standardmäßig die Gammakorrektur auf die Farben der Lichtquellen [https://twitter.com/guycalledfrank/status/1001108508614553600 falsch anwendet]. Der richtige Modus kann per [https://docs.unity3d.com/ScriptReference/Rendering.GraphicsSettings-lightsUseLinearIntensity.html Skript] aktiviert werden, was mithilfe der Schaltfläche “Fix” geschiet. Wenn Sie bereits viele Lichtquellen im nicht-linearen Intensitätsmodus eingerichtet haben und diese nicht erneut ändern möchten, können Sie die Korrektur überspringen. Die Änderungen, die durch den “Fix” verursacht wurden, können jederzeit wieder rückgängig gemacht werden.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Um eine Umgebungsbeleuchtung mit Schatten zu erzielen, müssen Sie zuerst ein Skylight erstellen (Bakery-&amp;gt;Create-&amp;gt;Skylight).&lt;br /&gt;
&lt;br /&gt;
[[File:Menusky.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Wählen Sie das Skylight aus, weisen Sie es eine bläuliche Farbe zu und klicken Sie auf '''Match scene skybox to this light'''. Dadurch wird die Beleuchtung der Skybox genau angepasst.&lt;br /&gt;
{{note| Das Anpassen der Skybox an das Bakery Skylight ist optional, aber für die Korrektheit sinnvoll. Damit wird sichergestellt, dass die sichtbare Umgebung und die Reflection Probes in der Engine mit der gebackenen Beleuchtung übereinstimmen. Derzeit funktioniert diese Einstellung nur in der Built-In Render Pipeline von Unity.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Skycomp.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Wählen Sie nun Bakery-&amp;gt;Render Lightmap vom oberen Menü aus. Standardmäßig ist der Full Lighting-Modus aktiviert. Dieser berechnet sowohl direkte als auch indirekte Beleuchtung aller Lichter. Wenn Sie Echtzeit-Schatten mit gebackener Beleuchtung kombinieren möchten, ändern Sie die Einstellung auf '''Indirect'''.&lt;br /&gt;
&lt;br /&gt;
[[File:Bakerywindow.jpg]]&lt;br /&gt;
&lt;br /&gt;
{{note| Bakery könnte sich darüber beschweren, dass Sie den veralteten [https://docs.unity3d.com/Manual/LinearLighting.html Gamma-Modus] verwenden, und Ihnen empfehlen, diesen zu ändern. Wenn Ihnen die Qualität der Beleuchtung wichtig ist, wird die Verwendung des linearen Modus dringend empfohlen. Sie können diese Warnung ignorieren, falls Sie bereits ein großes Projekt mit Gamma-Modus eingerichtet haben und es nicht nachträglich ändern möchten oder wenn Sie für mobile Endgeräte entwickeln, die den linearen Modus nicht unterstützen.}}&lt;br /&gt;
&lt;br /&gt;
7. Klicken Sie auf die Schaltfläche '''Render'''.&lt;br /&gt;
&lt;br /&gt;
8. Fertig! Sie sollten nun gebackene Beleuchtung sehen:&lt;br /&gt;
&lt;br /&gt;
[[File:Bakedgi.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Rendereinstellungen ==&lt;br /&gt;
&lt;br /&gt;
Alle Rendereinstellungen können jederzeit über Bakery-&amp;gt;Render Lightmap eingesehen werden. Diese Einstellungen werden für jede Szene gespeichert. Die oberste Option im Bakery-Fenster ermöglicht es Ihnen, zwischen den Einstellungen Simple, Advanced und Experimental zu wechseln, wobei jeder nachfolgende Modus mehr anpassbare Optionen offenlegt. Der einfache Modus (Simple) reicht für die meisten Szenen aus und ist ein guter Einstieg.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render mode ===&lt;br /&gt;
Legt den Typ der zu backenden Lightmaps fest. &lt;br /&gt;
&lt;br /&gt;
===== Full Lighting =====&lt;br /&gt;
Vollständige direkte und indirekte Beleuchtung für alle Bakery-Lichter.&lt;br /&gt;
{{note| Bei Unity Versionen vor 2017.3 müssen Sie, wenn Sie sowohl Unity- als auch Bakery-Komponenten auf demselben GameObject haben, die Unity-Komponente manuell deaktivieren, um eine doppelte Helligkeit zu vermeiden. In neueren Versionen von Unity werden Echtzeit-Lichteffekte für gebackene Lichter automatisch deaktiviert, so wie es auch bei den integrierten Lightmappern der Fall ist.}}&lt;br /&gt;
&lt;br /&gt;
===== Indirect =====&lt;br /&gt;
[[File:Image26.png|thumb|Vergleich der verschiedenen Render-Modi, die von Unity unterstützt werden]]&lt;br /&gt;
Grundlegender Mixed mode. Es wird die Baked Contribution-Auswahl auf jedem Licht überprüft: Wenn die Einstellung auf ''Direct And Indirect'' gesetzt ist, wird das Licht wie im Full Lighting-Modus gebacken. Ist sie stattdessen auf ''Indirect Only'' gesetzt, wird nur der indirekte Beitrag (GI) dieses Lichts gebacken. Im letzteren Fall sollten Sie sowohl Unity- als auch Bakery-Lichter auf dem GameObject belassen, wobei eines einen direkten Echtzeitbeitrag leistet und das andere für vorab berechnete GI zuständig ist.&lt;br /&gt;
&lt;br /&gt;
[[File:Indirectonly.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== Shadowmask =====&lt;br /&gt;
[[File:Image21.png|thumb|Links: vollständig gebackenes Licht. Mitte: dynamisches Licht mit gebackener Beleuchtung. Rechts: der Schatten der Capsule sowie die Unebenheiten (bump) und Spiegelungen (specular) von Oberflächen sind dynamisch, während der Schatten des Cube und die Beleuchtung gebacken sind.]]&lt;br /&gt;
[[File:Image6.png|thumb|Wenn die Kamera weit genug entfernt ist oder dynamische Schatten deaktiviert sind, sieht dieselbe Szene wie folgt aus]]&lt;br /&gt;
Ein etwas fortgeschrittenerer Mixed mode. Er funktioniert durch die Erzeugung von zwei Arten von Lightmaps - eine mit gebackenen Farben (wie im Indirect mode) und eine weitere mit Schatten von statischen Objekten. Dies hat einige Vorteile:&lt;br /&gt;
* Echtzeit-Schatten können nur von einer Handvoll dynamischer Objekte erzeugt werden, nicht von der gesamten Szene.&lt;br /&gt;
* Echtzeit- und gebackene Schatten verschmelzen ordnungsgemäß miteinander.&lt;br /&gt;
* Echtzeit-Lichter können Bump-, Specular- und andere Oberflächeneffekte wiedergeben, während sie weiterhin durch hochwertige gebackene Schatten verdeckt werden.&lt;br /&gt;
[https://docs.unity3d.com/Manual/LightMode-Mixed-Shadowmask.html Mehr Informationen]&lt;br /&gt;
&lt;br /&gt;
Um dieses Verhalten zu aktivieren, müssen Sie sowohl Unity- als auch Bakery-Lichter auf demselben GameObject haben und Baked Contribution muss auf ''Shadowmask and Indirect'' eingestellt sein. Nicht markierte Lichter werden wie im Indirect mode gebacken.&lt;br /&gt;
&lt;br /&gt;
[[File:Smask22.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== Distance Shadowmask =====&lt;br /&gt;
Dieses Kontrollkästchen ist nur sichtbar, wenn Sie Shadowmask ausgewählt haben. Es schaltet die [https://docs.unity3d.com/Manual/LightMode-Mixed-ShadowmaskMode.html gleichnamige Einstellung] in den Quality Settings des Projekts um.&lt;br /&gt;
[https://docs.unity3d.com/Manual/LightMode-Mixed-DistanceShadowmask.html Mehr Informationen.]&lt;br /&gt;
{{note| Das Kontrollkästchen ist in Unity 5.6.x aufgrund fehlender Skript-API nicht sichtbar. Stattdessen können Sie die Einstellung unter Window-&amp;gt;Lighting-&amp;gt;Mixed Lighting-&amp;gt;Lighting Mode ändern.}}&lt;br /&gt;
{{note| In Versionen von Unity &amp;lt; 2017.3 werden aufgrund von API-Einschränkungen beim Rendern von Shadowmask-Lightmaps in der Szene platzierte Light Probes zurückgesetzt. Diese müssen nach dem Backvorgang erneut berechnet werden. In neueren Versionen sollte dies nicht mehr vorkommen.}}&lt;br /&gt;
&lt;br /&gt;
===== Subtractive =====&lt;br /&gt;
Aktiviert den [https://docs.unity3d.com/Manual/LightMode-Mixed-Subtractive.html Subtractive] Beleuchtungsmodus. &lt;br /&gt;
&lt;br /&gt;
Diese Einstellung hat keine besonderen Auswirkungen auf Lightmaps und funktioniert genau wie Full Lighting.&lt;br /&gt;
&lt;br /&gt;
Der einzige Unterschied besteht darin, dass sie auch Echtzeit-Lichter von Unity für den subtraktiven Modus einrichtet (da dies über die Benutzeroberfläche nicht möglich ist).&lt;br /&gt;
&lt;br /&gt;
Sie müssen zusätzlich globale subtraktive Parameter (wie die globale Schattenfarbe) in Unity’s [https://docs.unity3d.com/Manual/GlobalIllumination.html#MixedLighting Lighting Fenster] einrichten. .&lt;br /&gt;
&lt;br /&gt;
===== Ambient Occlusion Only =====&lt;br /&gt;
Es wird nur die Umgebungsverdeckung (AO) gebacken. Kann nützlich sein, wenn Sie wissen, was Sie tun. Stellen Sie sicher, dass die [[#Ambient_occlusion|AO Einstellungen]] eingerichtet wurden.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Directional mode ===&lt;br /&gt;
[[File:Image3.png|thumb|Vergleich verschiedener Richtungsmodi]]&lt;br /&gt;
Legt fest, wie Richtungsinformationen eingebettet werden. Standardmäßige Lightmaps speichern nur eine einzige Farbe pro Texel, während Lightmaps mit Richtungsinformationen den Shadern einen Hinweis darauf geben, wie sich die Beleuchtung über eine Halbkugel um das Texel herum verändert. Diese Daten sind erforderlich, um vollständig belichtete Bereiche mit Normal Maps zu kombinieren. Durch das Einbinden in den integrierten [[#Bakery_shaders|Bakery Shader]] kann ebenfalls eine ungefähre Spiegelungsreaktion erzeugt werden.&lt;br /&gt;
&lt;br /&gt;
===== None =====&lt;br /&gt;
Keine Richtungsdaten, eine Farbe pro Texel.&lt;br /&gt;
&lt;br /&gt;
===== Baked Normal Maps =====&lt;br /&gt;
Immer noch keine Richtungsdaten, aber Normal Maps werden beim Rendern der Lightmap berücksichtigt. Es gibt keinen zusätzlichen Laufzeit-Overhead. Da Lightmaps in der Regel eine geringere Auflösung als Normal Maps haben, kann das Ergebnis unscharf aussehen. Weitere Probleme sind Aliasing in der Ferne aufgrund fehlendes Mipmapping und eine mögliche Verwischung von Details durch die Rauschunterdrückungsprozedur (Denoising). Um zu erfahren, wie Sie in diesem Modus benutzerdefinierte Shader mit prozeduralen Normalen verwenden können, lesen Sie den Abschnitt [[#Normal_mapping|Normal Mapping]].&lt;br /&gt;
&lt;br /&gt;
===== Dominant Direction =====&lt;br /&gt;
Dieser Modus ähnelt dem, was Enlighten und Progressive in Unity backen. Er ist mit den meisten Shadern kompatibel, generiert nur eine zusätzliche Map und der Laufzeit-Overhead ist minimal. Der Nachteil ist, dass das Bump Mapping eher blass und grau wirkt und sich deutlich von demselben Objekt unter Echtzeitbeleuchtung unterscheiden kann.&lt;br /&gt;
&lt;br /&gt;
===== RNM =====&lt;br /&gt;
Basierend auf der Radiosity Normal Mapping-Technik, die ursprünglich für HL2 ([https://steamcdn-a.akamaihd.net/apps/valve/2004/GDC2004_Half-Life2_Shading.pdf Folien]) entwickelt und später in vielen weiteren Spielen (z. B. Mirror’s Edge) verwendet wurde. Es werden insgesamt 3 HDR-Maps erzeugt und ist damit der Modus mit dem höchsten Speicherbedarf. Der Laufzeit-Overhead ist immer noch relativ gering. Dieser Modus ist außerdem präziser als Dominant Direction. Er ist besser darin, Oberflächenkontraste wiederzugeben und kann mit farbigem Licht umgehen, welches Normal Maps aus verschiedenen Winkeln beeinflusst.&lt;br /&gt;
&lt;br /&gt;
===== SH =====&lt;br /&gt;
Basierend auf dem “Precomputed Global Illumination in Frostbite” [https://media.contentapi.ea.com/content/dam/eacom/frostbite/files/gdc2018-precomputedgiobalilluminationinfrostbite.pdf Papier]. Dies ist der Modus mit der höchsten Qualität, der einen deutlich besseren Oberflächenkontrast bietet und unterschiedlich gefärbtes Licht aus verschiedenen Richtungen darstellen kann. Erzeugt insgesamt 4 Maps, von denen nur eine HDR ist, und benötigt daher weniger Speicherplatz als RNM. Der Laufzeit-Overhead ist etwas höher als bei RNM.&lt;br /&gt;
&lt;br /&gt;
===== MonoSH =====&lt;br /&gt;
[[File:FY8Ru8hWIAAdYYH.jpg|thumb|Größen/Qualitätsvergleich von Dominant Direction, SH und MonoSH]]&lt;br /&gt;
Wie SH, jedoch unter Verwendung monochromatischer L1-Richtungskoeffizienten. Ähnlich guter Oberflächenkontrast, obwohl unterschiedliche Farben, die aus verschiedenen Richtungen auf ein Texel fallen, nicht genau wiedergegeben werden; für viele Szenen jedoch ausreichend. Es wird nur eine zusätzliche Map generiert, sodass die VRAM-Nutzung/Bandbreite ähnlich ist wie bei Dominant Direction; tatsächlich ist sie sogar noch geringer, da Dominant Direction RGBA-kodierte Maps verwendet, während MonoSH nur RGB benötigt. Die Map wird über das integrierte Richtungs-Lightmap-System gespeist, ''sieht jedoch mit Standard Shadern nicht korrekt aus''. Achten Sie darauf, einen kompatiblen Shader zu verwenden.&lt;br /&gt;
&lt;br /&gt;
===== Einschränkungen =====&lt;br /&gt;
&lt;br /&gt;
* RNM und SH/MonoSH können nur mit dem [[#Bakery_shaders|Bakery Shader]] verwendet werden oder benötigen Anpassungen an Ihren Shadern.&lt;br /&gt;
* Im RNM- und SH-Modus werden keine Standard-Farb-Lightmaps erstellt. Sie müssen entweder den Bakery Shader für alle Materialien in der Szene verwenden oder [[#Bakery_Lightmap_Group_Selector|Lightmap Groups]] einsetzen, um RNM/SH-Objekte von den übrigen zu trennen.&lt;br /&gt;
* RNM- und SH-Maps werden mithilfe von [https://docs.unity3d.com/ScriptReference/MaterialPropertyBlock.html MaterialPropertyBlock] auf Objekte angewendet und werden daher möglicherweise nicht vollständig im Lighting Fenster von Unity angezeigt.&lt;br /&gt;
* Die Modi Dominant Direction, RNM and SH/MonoSH erfordern möglicherweise etwas mehr Samples für GI und Light Meshes, um eine vergleichbare Qualität erzielen zu können.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Texels per unit ===&lt;br /&gt;
[[File:Texelscomp.jpg|thumb|1 vs 10 Texels pro Welteinheit]]&lt;br /&gt;
Ungefähre Anzahl der Lightmap-Texel pro Welteinheit. Beeinflusst die Anzahl und Auflösung der generierten Lightmaps.&lt;br /&gt;
&lt;br /&gt;
Beispielwerte für den Einstieg:&lt;br /&gt;
* Großer Außenbereich (z. B. eine Stadt): 1 - 5&lt;br /&gt;
* Mittlerer Außenbereich (einige Gassen): 10 - 20&lt;br /&gt;
* Hochwertige Innenbeleuchtung: 100&lt;br /&gt;
&lt;br /&gt;
Es wird davon ausgegangen, dass der Maßstab der Szene ungefähr 1 Einheit = 1 Meter beträgt. Eine solche Skalierung wird im Allgemeinen bei der Arbeit in Unity empfohlen, um eine bessere Navigation und Physiksimulation zu erzielen. Wenn Ihre Skalierung anders ist, multiplizieren Sie die Texel entsprechend.&lt;br /&gt;
&lt;br /&gt;
Beachten Sie, dass Texels per unit die Basisauflösung ist, aber jedes Objekt noch zusätzlich mit [https://docs.unity3d.com/Manual/class-MeshRenderer.html Scale in Lightmap] in den Mesh Renderern sowie mit [[#Scale per map type|Scale per map type]] im Bakery-Fenster angepasst werden kann.&lt;br /&gt;
&lt;br /&gt;
{{note| Objekte, bei denen Scale in Lightmap auf 0 gesetzt ist, werden nicht gebacken, werfen jedoch weiterhin Schatten und beeinflussen GI.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Max resolution ===&lt;br /&gt;
Maximale Größe der Lightmap. Falls nicht alle Objekte in eine einzelne Lightmap passen (bei gegebenem Texels Per Unit-Wert), werden zusätzliche Lightmaps zugewiesen. Dieselben vier quadratischen Objekte können vier 512x512-Maps oder eine 1024x1024-Map belegen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bounces ===&lt;br /&gt;
[[File:Image36.png|thumb|Beachten Sie, wie mehr Reflexionen zu mehr Licht in geschlossenen Räume führen.]]&lt;br /&gt;
Legt fest, wie oft Lichtstrahlen von Oberflächen reflektiert werden sollen. In der Regel sind niedrige Werte für Außenbereiche (z. B. eine Stadt) ausreichend, während für geschlossene Bereiche (Innenräume, Höhlen) höhere Werte erforderlich sind.&lt;br /&gt;
&lt;br /&gt;
Der Schieberegler ist zwar auf 5 Reflektierungen begrenzt, es ist jedoch möglich, eine beliebige Anzahl von Reflektierungen in das Zahlenfeld einzugeben.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Samples ===&lt;br /&gt;
[[File:Image7.png|thumb|Links: samples = 4, rechts: samples = 16. Zur Veranschaulichung wurde die Rauschunterdrückung (Denoising) deaktiviert.]]&lt;br /&gt;
Beeinflusst die Qualität von GI. Typische Werte liegen zwischen 16 und 32.&lt;br /&gt;
&lt;br /&gt;
{{note| Es ist möglich, eine beliebige Zahl einzugeben, die über dem maximalen Schiebereglerwert liegt. Beachten Sie jedoch, dass diese Zahl die Quadratwurzel der endgültigen Strahlanzahl darstellt - d. h. 32 entspricht 1024 Strahlen, 64 entspricht 4096 Strahlen usw.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GPU Priority ===&lt;br /&gt;
Während die GPU an Lightmaps arbeitet, können das Betriebssystem und andere Software weniger reaktiv werden. Mit dieser Option können Sie ein Gleichgewicht zwischen der Baking-Geschwindigkeit und der Reaktionsfähigkeit des Systems herstellen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render ===&lt;br /&gt;
Backt Lightmaps für alle geöffneten Szenen.&lt;br /&gt;
Wenn [[Manual#Light_probe_mode|Light Probe Mode]] auf L1 oder L2 eingestellt ist, werden auch Light Probes mitgebacken.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Render Light Probes ===&lt;br /&gt;
Backt [https://docs.unity3d.com/Manual/LightProbes.html Light Probes] für alle geöffneten Szenen.&lt;br /&gt;
&lt;br /&gt;
Beachten Sie, dass Sie für korrekte Mixed light Schatten auf dynamischen Objekten im Shadowmask-Modus auch [[Manual#Occlusion_probes|Okklusionsproben]] aktivieren müssen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Render Reflection Probes ===&lt;br /&gt;
Backt [https://docs.unity3d.com/Manual/class-ReflectionProbe.html Reflection Probes] für alle geöffneten Szenen. Diese Schaltfläche dient lediglich der Benutzerfreundlichkeit und ruft die interne Aktualisierungsroutine der Engine für Reflection Probes auf.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update Skybox Probe ===&lt;br /&gt;
Backt globale Diffuse- und Reflection Probes für die aktuelle Skybox. Wie bei &amp;quot;Render Reflection Probes&amp;quot; werden lediglich integrierte Engine-Funktionen aufgerufen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Occlusion probes ===&lt;br /&gt;
Lässt Unity beim Rendern von Light Probes Okklusionsproben mit dem aktuell ausgewählten integrierten Lightmapper backen. Okklusionsproben sind zusätzliche Daten, die in regulären Light Probes gespeichert werden und verhindern, dass dynamische Objekte in schattigen Bereichen beleuchtet werden. Derzeit gibt es keine Möglichkeit, benutzerdefinierte Okklusionsproben in Unity zu erstellen, weshalb Unity’s eigene Lightmapper aufgerufen werden müssen, um diese Aufgabe zu erledigen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Warnings ===&lt;br /&gt;
Diese Optionen validieren die Szene, nachdem eine der Render-Schaltflächen gedrückt wurde, und zeigen Warnungsdialogfelder an, in denen Sie gefragt werden, ob Sie den Backvorgang fortsetzen oder beenden möchten.&lt;br /&gt;
* Suppress all popups: Nach dem Drücken von Render werden keine Dialogfelder mehr angezeigt.&lt;br /&gt;
* UV validation: Überprüft, ob alle Modelle vollständig korrekte Lightmapping UVs aufweisen – insbesondere, ob sie im Bereich von 0 bis 1 liegen und sich nicht überlappen.&lt;br /&gt;
* Overwrite check: Teilt mit, ob und welche Lightmap-Dateien überschrieben werden.&lt;br /&gt;
* Memory check: Gibt einen sehr ungefähren Wert für den benötigten Videospeicher an.&lt;br /&gt;
* Sample count check: Überprüft, ob Lichter, GI oder AO unangemessene Sample-Werte aufweisen, die dazu führen könnten, dass die GPU ihre verfügbaren Ressourcen überschreitet.&lt;br /&gt;
* Lightmapped prefab validation: Validiert Lightmapped Prefabs und benachrichtigt Sie, falls Prefabs überschrieben werden.&lt;br /&gt;
&lt;br /&gt;
== Erweiterte Rendereinstellungen ==&lt;br /&gt;
=== Light probe mode ===&lt;br /&gt;
Ändert die Art und Weise, wie Light Probes gebacken werden.&lt;br /&gt;
&lt;br /&gt;
* Legacy: Verwenden Sie die Schaltfläche Render Light Probes, um Probes zu rendern. Punkt- und direktionale Lichter werden innerhalb des Lightmappers berechnet, während Flächen-/Himmels-/indirekte Beleuchtung durch das Rendern einer Cubemap an jeder Probenposition erfasst wird. Die Ergebnisse werden als [https://docs.unity3d.com/ScriptReference/Rendering.SphericalHarmonicsL2.html sphärische Harmonische der Ordnung L2] gespeichert. Die Nachteile sind eine langsame Cubemap-Rendering-Leistung und mögliche Abweichungen zwischen Lightmaps und Probes in Fällen, in denen Shader in Ihrem Spiel beleuchtete Oberflächen nicht physikalisch darstellen können oder Ihr Projekt für mobile Endgeräte eingerichtet ist (Unity kann hohe Intensitätswerte wegschneiden).&lt;br /&gt;
&lt;br /&gt;
* L1: Light Probes werden zusammen mit Lightmaps gerendert, wenn Sie auf Render klicken. Diese Einstellung bietet eine überlegendere Backleistung und garantiert, dass die Beleuchtung der Proben mit den Lightmaps übereinstimmen. Ergebnisse werden als sphärische Harmonische der Ordnung L1 gespeichert (und können weiterhin von regulären Shadern verwendet werden). Durch Anwendung der Einstellung Non-Linear Light Probe SH im [[#Bakery_shaders|Bakery Shader]] können die Ergebnisse weiter verbessert werden.&lt;br /&gt;
&lt;br /&gt;
* L2: überragende Qualität (vollständige sphärische Harmonische der Ordnung L2). Wie bei L1, werden sie automatisch zusammen mit Lightmaps gerendert. Vernachlässigbare Auswirkungen auf die Leistung im Vergleich zu L1. Sollte mit allen Shadern gut aussehen. Kontrast/Direktionalität/Ringing-Entfernung der Proben kann über Project Settings -&amp;gt; Bakery -&amp;gt; &amp;quot;Ringing removal for L2 light probes&amp;quot; angepasst werden.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Es scheint einen Fehler in Unity 2019.3 zu geben, der verhindert, dass Legacy Light Probe-Farben ordnungsgemäß gespeichert werden, falls die Einstellung [[Manual#Occlusion_probes|Occlusion probes]] aktiviert ist. Der L2-Modus ist jetzt der Standardmodus und wird bei Verwendung von Okklusionsproben empfohlen.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Asset UV Processing ===&lt;br /&gt;
Konfiguriert die UV Padding-Anpassung für Assets. Mögliche Werte:&lt;br /&gt;
* Don't change: Es werden keine Änderungen an Assets vorgenommen.&lt;br /&gt;
* Adjust UV padding: Sucht nach Modellen mit automatisch generierten UVs (“Generate Lightmap UVs” auf dem Asset) und passt diese weiter an, um ein korrektes Padding zwischen den UV-Inseln pro Mesh zu erzielen. Die modellweite Pack Margin in den Importeinstellungen wird ignoriert. Stattdessen werden optimale Werte berechnet, basierend auf der Fläche jedes Meshes und der Auflösung der Lightmap.&lt;br /&gt;
* Adjust UV padding for new meshes only: Wie oben, jedoch werden alle Modelle übersprungen, die zuvor mindestens einmal angepasst wurden.&lt;br /&gt;
* Remove UV adjustments: Hebt alle vorherigen UV-Anpassungen auf und lässt automatisch unwrappte Modelle so aussehen, wie Unity sie ursprünglich unwrappt hat.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser ===&lt;br /&gt;
Legt den gewünschten Denoiser fest. Mögliche Werte:&lt;br /&gt;
* Optix 5: Verwendet den OptiX 5.1 AI-Denoiser (früher bekannt als &amp;quot;Legacy denoiser&amp;quot;). Läuft auf der GPU. Unterstützt auf allen Grafikkarten von [https://en.wikipedia.org/wiki/Kepler_(microarchitecture) Kepler] (GeForce 6xx) bis [https://en.wikipedia.org/wiki/Turing_(microarchitecture) Turing] (Geforce 20xx). Nicht unterstützt auf [https://en.wikipedia.org/wiki/Ampere_(microarchitecture) Ampere] (30xx)-Grafikkarten. OptiX 5.1 verwendet einen statischen Trainingsdatensatz, der darin eingebettet ist, sodass er nicht von der Treiberimplementierung beeinflusst wird.&lt;br /&gt;
* Optix 6: Verwendet den OptiX 6.0 AI-Denoiser (war zuvor die Standardeinstellung). Läuft auf der GPU. Scheint auf Kepler (6xx)-GPUs nicht zu funktionieren, läuft dafür aber auf neueren Modellen - einschließlich Ampere (30xx). Seit Version 6.0 befindet sich der Trainingsdatensatz für den OptiX Denoiser im Grafikkartentreiber. Das Verhalten war vor Treiberversion 442.50 ähnlich wie bei OptiX 5.1; nach diesem Treiber hat NVIDIA jedoch [https://forums.developer.nvidia.com/t/optix7-denoiser-different-results-with-different-version-of-drivers/117989/2 den Datensatz geändert], sodass die Ergebnisse unterschiedlicher ausfallen können. Der aktualisierte Datensatz kann manchmal gitterartige Muster und hellere Kanten erzeugen (die jedoch mit [[Manual#Denoise:_fix_bright_edges|&amp;quot;Denoise: fix bright edges&amp;quot;]] behoben werden können), läuft aber schneller.&lt;br /&gt;
* Optix 7: Verwendet den OptiX 7.2 AI-Denoiser. Verhält sich ähnlich wie OptiX 6.0, wird jedoch möglicherweise besser von Ampere (30xx) unterstützt.&lt;br /&gt;
* OpenImageDenoise: Verwendet Intel Open Image Denoise. Läuft auf der CPU (jede CPU, die SSE 4.1 unterstützt). Kann etwas langsamer als OptiX sein, aber die Qualität ist vergleichbar.&lt;br /&gt;
* OpenImageDenoise2: Verwendet Intel Open Image Denoise 2 im CUDA-Modus. Läuft auf der GPU, die Leistung ist vergleichbar mit OptiX 6/7 und die Qualität ist identisch mit der CPU-Version.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Adjust sample positions ===&lt;br /&gt;
Findet die besten Positionen für die Proben, um Beleuchtungslecks zu vermeiden. Die Details des Algorithmus werden [https://ndotl.wordpress.com/2018/08/29/baking-artifact-free-lightmaps/#leaks hier] beschrieben. In einigen Fällen (in der Regel bei großen Geometrien mit sehr niedriger Polygonanzahl und glatten Normalen) kann es zu falschen Ergebnissen kommen. In diesem Fall können Sie die Funktion deaktivieren.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Unload scenes before render ===&lt;br /&gt;
Entlädt Szenen vor dem Backen, um Videospeicher freizugeben. Komplexere Szenen können allein durch die Anzeige im Editor mehrere Gigabyte VRAM beanspruchen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Denoise ===&lt;br /&gt;
[[File:Image31.png|thumb|Links: Denoising deaktiviert, rechts: Denoising aktiviert.]]&lt;br /&gt;
Wenn aktiviert, wird der Entrauschungsalgorithmus angewendet. Bakery verwendet [https://developer.nvidia.com/optix-denoiser NVIDIA’s AI-Denoiser (OptiX)] oder Intel's Open Image Denoise (falls ausgewählt).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Fix Seams ===&lt;br /&gt;
[[File:Image22.png|thumb|Left: Übergänge, right: Übergänge sind geglättet.]]&lt;br /&gt;
Wenn aktiviert, wird versucht, durch UV-Diskontinuitäten entstandene Übergänge zu glätten. Nützlich für glatte Geometrien - einschließlich der Standardkugel von Unity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Split by scene ===&lt;br /&gt;
Wenn mehrere Szenen gleichzeitig geladen werden und diese Option aktiviert ist, verfügt jede Szene über einen eigenen Satz Lightmaps, der nicht mit anderen geteilt wird. Dies kann hilfreich sein, um die Anzahl der geladenen Texturen zu begrenzen, wenn Szenen während der Laufzeit gestreamed werden.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hole filling ===&lt;br /&gt;
[[File:Holefilling.jpg|thumb|Lochfüllung aus vs. ein.]]&lt;br /&gt;
Wenn [[Manual#Atlas_Packer|Atlas Packer]] auf xatlas eingestellt ist, wird versucht, jedes Loch zu füllen, was zu effizienteren Atlas-Texturen führt. Bei Szenen mit sehr komplexer Geometrie kann dies die Exportzeit der Szene verlängern, ist aber ansonsten empfehlenswert.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Min resolution ===&lt;br /&gt;
Mindestgröße für Lightmaps. Kann verwendet werden, um zwischen vielen kleinen, aber vollständig belegten Lightmaps und wenigen unvollständig gefüllten Lightmaps abzuwägen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Scale per map type ===&lt;br /&gt;
Ermöglicht es Ihnen, die Auflösung von Color/Shadowmask/Direction-Maps unterschiedlich zu skalieren. Ein häufiger Fall wäre beispielsweise eine indirekte Färbung mit niedriger Auflösung, aber einer sehr detaillierten Shadowmask. Beachten Sie, dass die Skalierung erst nach dem Rendern der Lightmaps angewendet wird, sodass keine Zeit beim Baking eingespart wird. Wenn “Adjust UV padding” aktiviert ist, basiert das Padding auf der Map mit der niedrigsten Auflösung, um Texel-Leaking zu verhindern.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Checker preview ===&lt;br /&gt;
[[File:Image12.png|thumb|Checker preview in Aktion]]&lt;br /&gt;
Wenn das Kontrollkästchen Show checker aktiviert ist, rendert die Scene View ein Schachbrettmuster über alle sichtbaren Objekte, um die Größe der Lightmap-Texel anzuzeigen. Dies ist nützlich, um sicherzustellen, dass Sie vor dem Backen angemessene Werte für Texels Per Unit und andere Einstellungen, die sich auf die Auflösung auswirken, verwenden.&lt;br /&gt;
&lt;br /&gt;
Durch das Aktivieren der Checker preview wird Bakery gezwungen, Atlas Packing durchzuführen. Dies kann einige Sekunden dauern. Klicken Sie auf Refresh checker, um die Szene nach einer vorgenommenen Änderung neu zu atlasieren und die Änderungen anzuzeigen.&lt;br /&gt;
&lt;br /&gt;
Checker preview verwendet ebenfalls zufällige Farben, um zu zeigen, wie die Szene in verschiedene Lightmaps aufgeteilt sein wird.&lt;br /&gt;
&lt;br /&gt;
{{note| Checker preview zeigt derzeit keine korrekten Texel-Größen für Terrains an.}}&lt;br /&gt;
&lt;br /&gt;
==== Atlas preview ====&lt;br /&gt;
[[File:FN-TmhRXwAE9i2I.png|thumb|Atlas preview in Aktion]]&lt;br /&gt;
Die Schaltfläche Atlas preview ist sichtbar, wenn die Checker preview aktiviert ist. Durch Anklicken öffnet sich ein neues Fenster, in dem die UV-Layouts zukünftiger Lightmaps angezeigt werden. Sie können mithilfe der &amp;quot;&amp;lt;&amp;quot; und &amp;quot;&amp;gt;&amp;quot; Schaltflächen zwischen den Lightmaps wechseln.&lt;br /&gt;
Dies kann nützlich sein, um vor dem Backen die Packungsqualität und die Anzahl der Lightmaps zu überprüfen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Emissive boost ===&lt;br /&gt;
Multipliziert jede Oberflächenemission mit dieser Zahl.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Indirect boost ===&lt;br /&gt;
Multipliziert alle reflektierten Lichtstrahlen mit diesem Wert. Entspricht der Indirect Intensity-Einstellung bei Licht-Komponenten, gilt jedoch global.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Backface GI ===&lt;br /&gt;
[[File:Image30.jpg|thumb|Backface GI]]&lt;br /&gt;
[[File:Image35.png|thumb|Links: backface GI = 0, rechts: backface GI = 1. Beachten Sie, wie schattige Bereiche mehr grünes Licht erhalten.]]&lt;br /&gt;
Bestimmt, wie viel Licht durch die Vorderfläche zur Rückfläche gelangt und dann von GI reflektiert wird. Dies ist besonders nützlich für dünne, durchscheinende Oberflächen wie Blätter. Die Werte liegen im Bereich von 0 bis 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Ambient occlusion ===&lt;br /&gt;
[[File:Image15.png|thumb|Left: AO intensity = 0. Right: AO intensity = 1.]]&lt;br /&gt;
Einfache nicht-physikalische Umgebungsverdeckung, die Sie aus ästhetischen Gründen über die endgültige Szenenbeleuchtung legen können.&lt;br /&gt;
* Intensity: Steuert die Sichtbarkeit des AO-Effekts. Ein Wert von 0 deaktiviert den Effekt.&lt;br /&gt;
* Radius: Legt die im AO-Effekt verwendete Strahlungsentfernung fest. Kleinere Werte führen zu lokalisierten Verdunkelungen (Ecken, Falten), während höhere Werte eher einem Skylight ähneln und Schatten von weiter entfernten Objekten erzeugen.&lt;br /&gt;
* Samples: Beeinflusst die Qualität der Umgebungsverdeckung. Typische Werte liegen zwischen 4 und 32.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dither transparency ===&lt;br /&gt;
Aktiviert halbtransparente Schatten durch das automatische Dithering von Alpha-Texturen. Lernen Sie, [[Manual#Opacity|wie Bakery Opacity Maps interpretiert]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== RTX Mode ===&lt;br /&gt;
Aktiviert die RTX-Hardwarebeschleunigung. Nur RTX-GPUs profitieren von dieser Einstellung. Die minimal unterstützte Treiberversion ist 418.&lt;br /&gt;
&lt;br /&gt;
Treiber können den RTX-Modus auf den meisten Nicht-RTX NVIDIA-Karten emulieren, aber das Ergebnis ist in der Regel langsamer.&lt;br /&gt;
&lt;br /&gt;
Der RTX-Modus '''muss''' auf Ampere (3xxx) oder neueren Karten aktiviert sein.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Export terrain trees ===&lt;br /&gt;
Wenn diese Einstellung aktiviert ist, beeinflussen Bäume auf Terrain die Beleuchtung. Die Bäume selbst werden nicht gebacken. Beachten Sie, dass beim Backen für jeden Baum die höchstmögliche LOD-Stufe verwendet wird. Daher wird es nicht empfohlen, diese Einstellung für die Darstellung von mehreren Kilometern großen Wäldern mit hochdetaillierten Modellen zu verwenden.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Terrain optimization ===&lt;br /&gt;
Wenn aktiviert (Standard), verwenden Terrains eine separate Raytracing-Technik, um die Vorteile ihrer Höhenfeldgeometrie zu nutzen. Andernfalls werden sie wie jedes andere Mesh behandelt. Terrain optimization reduziert den Speicherbedarf für hochauflösende Landschaften erheblich. In einigen Fällen kann es auch das Backen des Terrains beschleunigen, in anderen Fällen (insbesondere bei einfachen Landschaften mit niedriger Auflösung) kann es sinnvoll sein, sie zu deaktivieren.&lt;br /&gt;
&lt;br /&gt;
{{note| Terrain Optimization ist derzeit nicht mit Terrainlöchern kompatibel. Deaktivieren Sie die Einstellung, damit sie funktionieren.}}&lt;br /&gt;
{{note| Terrain Optimization wird nur im Nicht-RTX-Modus unterstützt.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Light Mesh batch limit ===&lt;br /&gt;
Wenn dieser Wert über 0 liegt, werden mehrere [[Manual#Bakery_Light_Mesh|Light Meshes]] zu einem zusammengefasst, vorausgesetzt, sie haben identische Einstellungen und wirken sich auf dieselben [[Manual#Bakery_Lightmap_Group_Selector|Lightmap Groups]] aus, wobei ihre Gesamtzahl an Samples jedoch auf diesen Wert begrenzt wird (d. h. wenn das Limit 64 beträgt, können 2 Lichter mit Samples=32 oder 4 Lichter mit Samples=16 usw. zusammengefasst werden). Dies erhöht die Leistung in Szenen mit vielen Light Meshes. Achten Sie darauf, diesen Wert nicht zu hoch einzustellen, da ansonsten die GPU bei der Verarbeitung zu vieler Samples gleichzeitig das Zeitlimit des Betriebssystemtreibers erreichen könnte.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Compress volumes ===&lt;br /&gt;
Wenn aktiviert, wird die Texturkomprimierung auf 3D-Volumen-Texturen angewendet und die Bakery Shader werden auf einen entsprechenden Abtastmodus umgeschaltet. Nicht empfohlen für Volumes mit sehr niedriger Auflösung. Die Volumengröße kann auf ein Vielfaches von 4 erhöht werden.&lt;br /&gt;
&lt;br /&gt;
Anmerkungen:&lt;br /&gt;
* Derzeit kann nur in die Texturenformate BC6H/BC7 (Desktop/Konsolen) komprimiert werden.&lt;br /&gt;
* Die Volumenkomprimierung wird nur in Unity 2020.1 oder neuer unterstützt.&lt;br /&gt;
* Derzeit unterstützt nur der Bakery Shader für die Built-In Render Pipeline die Verwendung komprimierter Volumes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Samples multiplier ===&lt;br /&gt;
Multipliziert alle Schatten- und GI-Samples mit dem angegebenen Faktor. Verwenden Sie diese Einstellung, um schnell zwischen Entwurfs- und Endqualität zu wechseln.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Tile size ===&lt;br /&gt;
Wie bei der [[#GPU Priority|GPU Priority]], jedoch legen Sie anstelle der abstrakten Priorität die Kachelgröße fest. Bakery teilt Lightmaps in kleinere Kacheln auf und aktualisiert diese nacheinander. Eine kleinere Größe bedeutet mehr Unterbrechungen in der GPU-Arbeit und kann das System reaktionsfähiger machen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Temp path ===&lt;br /&gt;
Ordner für temporäre Dateien. Bakery benötigt während des Renderns möglicherweise einige Gigabyte freien Speicherplatz. Wenn sich dieser Ordner auf einer SSD befindet, kann das Rendern im Vergleich zu einer HDD etwas schneller erfolgen. Derzeit wird dieser Ordner nicht automatisch bereinigt. Sie können den Inhalt jederzeit (außer während des Renderns) manuell oder über Bakery -&amp;gt; Utilities -&amp;gt; Clear cache löschen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Output path ===&lt;br /&gt;
Ordner für Lightmaps. Hier werden alle Lightmap-, Light Probe- und Vertex-Color Assets gespeichert. Dieser Pfad ist relativ zu Ihrem Assets Ordner.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Use scene named output path ===&lt;br /&gt;
Wenn diese Einstellung aktiviert ist, wird der Ausgabepfad automatisch auf einen Ordner mit dem gleichen Namen wie die aktuell aktive Szene gesetzt (Assets/AktuellerSzenenName/). Dies ähnelt dem Verhalten der integrierten Unity Lightmapper.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render Selected Groups ===&lt;br /&gt;
Backt nur [[#Bakery_Lightmap_Group_Selector|Lightmap Groups]], die ausgewählte Objekte enthalten.&lt;br /&gt;
Nicht nur ausgewählte Objekte werden neu gezeichnet, sondern auch alle Lightmap Groups, zu denen sie gehören. Andere Lightmaps werden nicht aktualisiert. Falls Objekte nicht zu einer manuell zugewiesenen Gruppe gehören, wird ein Teil der Szene, der dieselbe Lightmap verwendet, neu berechnet.&lt;br /&gt;
&lt;br /&gt;
Derzeit ist es praktischer, [[Partial_scene_baking|Sektoren für das teilweise Backen von Szenen zu verwenden]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Beep on finish ===&lt;br /&gt;
Wenn diese Einstellung aktiviert ist, gibt Bakery nach Abschluss des Backvorgangs einen Ton aus.&lt;br /&gt;
&lt;br /&gt;
== Experimentelle Rendereinstellungen ==&lt;br /&gt;
=== Unwrapper ===&lt;br /&gt;
Definiert den zu verwendenden Unwrapper, wenn [[#Asset_UV_Processing|Adjust UV Padding]] aktiviert ist.&lt;br /&gt;
* Default: Standard Unity Unwrapper. Bakery ruft [https://docs.unity3d.com/ScriptReference/Unwrapping.GenerateSecondaryUVSet.html Unwrapping.GenerateSecondaryUVSet] für jedes Mesh mit unterschiedlichen Padding-Parametern auf.&lt;br /&gt;
* xatlas: Verwendet [https://github.com/jpcy/xatlas xatlas] von [https://github.com/jpcy jpcy] - eine modifizierte Version von [https://github.com/Thekla/thekla_atlas thekla_atlas] des Entwicklers [https://github.com/castano Ignacio Castaño]. thekla_atlas wurde im Spiel The Witness ([http://the-witness.net/news/2010/03/graphics-tech-texture-parameterization/ Blog post]) eingesetzt.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Atlas Packer ===&lt;br /&gt;
Wählt den Algorithmus aus, der beim Packen verschiedener Objekt-UV-Layouts in große Lightmap-Atlas-Texturen verwendet werden soll.&lt;br /&gt;
* Default: Originalalgorithmus, den Bakery vor Version 1.7 verwendet hat.&lt;br /&gt;
* xatlas: Verwendet xatlas.&lt;br /&gt;
&lt;br /&gt;
Einige Funktionen werden nur mit einem Atlas Packer unterstützt:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Default&lt;br /&gt;
! xatlas&lt;br /&gt;
|-&lt;br /&gt;
| [[Manual#Bakery_Lightmap_Group_Selector|Override resolution]]&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
|-&lt;br /&gt;
| Efficient LOD packing&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|-&lt;br /&gt;
| [[Manual#Hole_filling|Hole filling]]&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Beachten Sie, dass der Atlas Packer auch für jede Lightmap Group separat ausgewählt werden kann.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Export geometry and maps ===&lt;br /&gt;
Wenn diese Einstellung aktiviert ist, exportiert Bakery die Szene vor dem Rendern in ein für Bakery passendes Format. Falls Sie sich sicher sind, dass die Geometrie und Texturen in der Szene sowie die Einstellungen für die Lightmap-Auflösung nicht geändert wurden (z. B. wenn Sie nur GI- oder Lichteinstellungen angepasst haben), können Sie dieses Kontrollkästchen deaktivieren, um das nächste Rendern zu beschleunigen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update unmodified lights ===&lt;br /&gt;
Wenn diese Einstellung aktiviert ist, berechnet Bakery die Lichtquellen neu, die sich seit dem letzten Rendern nicht verändert haben. Falls Sie nur eine Lichtquelle anpassen und nicht warten möchten, bis alle anderen Lichtquellen neu gerendert werden, können Sie dieses Kontrollkästchen deaktivieren.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update modified lights and GI ===&lt;br /&gt;
Wenn diese Einstellung aktiviert ist, berechnet Bakery GI und die Lichter, die seit dem letzten Rendern geändert wurden, neu.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== UV padding: increase only ===&lt;br /&gt;
Nur sichtbar wenn [[#Asset_UV_Processing|Adjust UV padding]] aktiviert ist. Standardmäßig wird das optimale UV-Padding für ein Modell-Asset nur auf der Grundlage der aktuell geladenen Szenen berechnet. Falls mehrere Instanzen desselben Modells unterschiedliche Lightmap-Auflösungen verwenden, bestimmt die kleinste davon das Padding, sodass der Abstand zwischen den UV-Flächen groß genug ist, um ein Überlappen zu verhindern. Jedoch kann das Backen desselben Modells in zwei verschiedenen isolierten Szenen dazu führen, dass die UVs in den vorherigen Szenen beschädigt werden, während sie für die neue Szene optimiert werden. Dieses Kontrollkästchen verhindert ein solches Verhalten, indem es den Padding-Wert niemals verringert, sodass er immer für die Instanz mit der niedrigsten Auflösung optimiert wird, die jemals gebacken wurde.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoise: fix bright edges ===&lt;br /&gt;
[[File:Image19.png|thumb|Links: Nach der Rauschunterdrückung ist ein heller Rand sichtbar; Rechts: behoben.]]&lt;br /&gt;
Nur sichtbar wenn [[#Denoise|Denoise]] aktiviert ist. Manchmal kann das zur Rauschunterdrückung verwendete neuronale Netz helle Kanten um Schatten herum erzeugen, als wäre ein Schärfeeffekt angewendet worden. Wenn diese Option aktiviert ist, versucht Bakery, diese herauszufiltern. Die Denoising-Phase kann bei Aktivierung etwas langsamer werden.&lt;br /&gt;
&lt;br /&gt;
Diese Funktion kann auch zum Filtern von &amp;quot;fireflies&amp;quot; verwendet werden, d. h. gelegentlich auftretende helle Punkte auf der Lightmap.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Post-packing ===&lt;br /&gt;
Manchmal kann Bakery beim Rendern einer Szene die Lightmap in mehrere Sub-Lightmaps aufteilen, z. B. beim Backen verschiedener LODs oder Terrains.&lt;br /&gt;
Post-packing versucht, die endgültige Atlasanzahl zu minimieren, indem diese Sub-Lightmaps zu einer Textur kombiniert werden.&lt;br /&gt;
Es wird empfohlen, diese Einstellung aktiviert zu lassen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Combine with Enlighten real-time GI ===&lt;br /&gt;
Wenn diese Einstellung aktiviert ist, wird beim Klicken der Schaltfläche Render zunächst versucht, mit Enlighten zu backen, um Echtzeit-GI zu berechnen. Danach erfolgt der reguläre Bakery-Lightmapping-Prozess. Sowohl gebackene als auch Echtzeit-GI werden dann zusammen verwendet.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bake on remote server ===&lt;br /&gt;
Aktiviert [[Network baking|Backen über das Netzwerk]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Presets ===&lt;br /&gt;
Wird derzeit unter den Schaltflächen Render/Update angezeigt, wenn sich die Einstellungen im Experimental-Modus befinden.&lt;br /&gt;
* Klicken Sie auf '''New''', um alle aktuellen Einstellungen in einer Voreinstellungsdatei zu speichern.&lt;br /&gt;
* Standardmäßig sind alle Einstellungen ausgegraut, wenn eine Voreinstellung aktiv ist, um ein Überschreiben der Voreinstellung zu verhindern.&lt;br /&gt;
* Klicken Sie auf '''Modify preset''', um die Einstellungen zu ändern und die Voreinstellungsdatei zu überschreiben.&lt;br /&gt;
* Voreinstellungsdateien können über das Voreinstellungsfeld ausgetauscht werden. Deaktivieren Sie die Verwendung von Voreinstellungen, indem Sie die Einstellung auf None setzen.&lt;br /&gt;
&lt;br /&gt;
== Komponenten ==&lt;br /&gt;
=== Bakery Lightmap Group Selector ===&lt;br /&gt;
&lt;br /&gt;
Legt fest, welche '''Lightmap Group''' für das Objekt und alle seine untergeordneten Objekte verwendet werden soll.&lt;br /&gt;
Lightmap Group ist ein Begriff, den Bakery für eine Sammlung von Objekten verwendet, die sich eine Lightmap teilen. Groups haben Eigenschaften, die Bakery mitteilen, wie die Objekte gepackt werden sollen, welche Lichter sie beeinflussen sollen und ob das Ergebnis in eine Textur oder in Eckpunkte (Vertices) gebacken werden soll.&lt;br /&gt;
Standardmäßig werden alle statischen Objekte automatisch in mehrere Lightmap Groups (Atlas-Texturen) gepackt, sodass Sie sich keine Gedanken darüber machen müssen. Die manuelle Definition von Gruppen sollte nur für spezielle Zwecke verwendet werden - zum Beispiel:&lt;br /&gt;
* Markieren von Objekten, damit diese [[Vertex Lightmaps|Per-vertex Lightmaps]] statt Texturen verwenden.&lt;br /&gt;
* Backen einer Lightmap unter Verwendung exakter, nicht skalierter UVs, so wie sie in einer Modellierungssoftware vorhanden waren.&lt;br /&gt;
* Gruppierung bestimmter Bereiche des Levels, um eine einzige Lightmap zu verwenden und damit das Streaming von Ressourcen zu erleichtern oder um während der Laufzeit mittels Skripte zwischen verschiedenen gebackenen Beleuchtungen zu wechseln.&lt;br /&gt;
* Verwenden der Using Render Selected Groups-Schaltfläche, um nur gruppierte Objekte zu aktualisieren.&lt;br /&gt;
&lt;br /&gt;
Um eine Gruppe manuell zu definieren, müssen Sie ein '''Lightmap Group Assets''' erstellen - entweder über das Assets-&amp;gt;Create Menü, oder mithilfe der Create New-Schaltfläche auf der Komponente. Wenn die Schaltfläche Create New verwendet wurde, wird ein neues Asset mit folgenden Eigenschaften erstellt:&lt;br /&gt;
* Name: Name des zu erstellenden Lightmap Group Asset.&lt;br /&gt;
* Packing mode: Dieser Selektor definiert den Packmodus der Lightmap Group. Es gibt 3 Modi:&lt;br /&gt;
** Original UV: Das Objekt und seine untergeordneten Objekte werden mit unveränderten UVs gebacken. Packing wird nicht vorgenommen. Dies ist nützlich für Modelle, bei denen mehrere Meshes dasselbe bereits gepackte UV-Layout verwenden.&lt;br /&gt;
** Pack Atlas: Das Objekt und seine untergeordneten Objekte werden in einen eigenen Texturatlas gepackt. Vor Version 1.3 musste jedes packbare untergeordnete Objekt über die Komponente verfügen, aber das ist nun nicht mehr erforderlich. Jedes untergeordnete Objekt wird als eigenes Rechteck gepackt - es sei denn, Bakery erkennt automatisch, dass ein untergeordnetes Objekt nicht überlappende untergeordnete Objekte hat. In diesem Fall können mehrere Objekte ein einziges Rechteck verwenden.&lt;br /&gt;
** Vertex: Das Objekt und seine untergeordneten Objekte verwenden anstelle von Texturen eine vertex-farbige gebackene Beleuchtung. Beachten Sie, dass Sie dafür einen benutzerdefinierten Shader benötigen - beispielsweise den [[#Bakery_shaders|Bakery Shader]]. Ein einfacher Shader (&amp;quot;Bakery/Simple Vertex Lightmapped&amp;quot;) ist bereits zu Demonstrationszwecken und als Referenz enthalten. [[Vertex Lightmaps|Lernen Sie mehr über Vertex Lightmaps.]]&lt;br /&gt;
* Directional mode: Ermöglicht es Ihnen, den [[#Directional mode|Directional Mode]] für die Gruppe zu überschreiben. Die Optionen sind identisch - mit Ausnahme von Auto, das einfach die globale Einstellung verwendet.&lt;br /&gt;
* Resolution: Gewünschte Auflösung der Lightmap.&lt;br /&gt;
* Auto-resolution: [[Manual#Texels_per_unit|Texels Per Unit]] verwenden, um die nächstgelegene Zweierpotenz (power of two) zu bestimmen.&lt;br /&gt;
* Atlas packer: Zu verwendender [[Manual#Atlas_Packer|Atlas Packing]]-Algorithmus für diese Gruppe.&lt;br /&gt;
* Bitmask: Eine Liste von Umschaltflächen, die verwendet werden können, um bestimmte Lichtquellen von der Beeinflussung der Lightmap auszuschließen. Jede Bakery-Lichtquelle verfügt auch über eine Bitmask-Einstellung. Lichter wirken sich nur auf Lightmap Groups aus, mit denen sie mindestens eine dieser Umschaltflächen gemeinsam haben. Die Standardeinstellung bedeutet, dass alle Lichter alle Lightmaps beeinflussen können.&lt;br /&gt;
&lt;br /&gt;
[[File:Ts.jpg|thumb|Transparenter Selbstschatten AUS vs. EIN: Beachten Sie, wie einige einseitige, aber nach hinten gerichtete Polygone nun korrekt beleuchtet werden]]&lt;br /&gt;
&lt;br /&gt;
Falls Sie eine Lightmap Group mit einem ihr zugewiesenem Pack Atlas-Modus haben, werden zusätzliche Einstellungen auf der Komponente angezeigt:&lt;br /&gt;
* Override resolution: Überschreibt die Auflösung, die dieses Objekt und seine untergeordneten Objekte in der Lightmap einnehmen.&lt;br /&gt;
* Resolution: Manuell festgelegte Auflösung. Wenn Sie beispielsweise eine Lightmap mit einer Auflösung von 512 haben, die vier Objekten mit einer überschriebenen Auflösung von 256 zugewiesen ist, generiert Bakery eine einzige Lightmap mit einer Größe von 512x512, wobei jedes Objekt genau 256x256 Flächen einnimmt.&lt;br /&gt;
&lt;br /&gt;
Wenn Sie ein Lightmap Group Asset auswählen, werden zusätzliche experimentelle Einstellungen angezeigt:&lt;br /&gt;
* [[Subsurface scattering|Subsurface scattering: (Klicken, um mehr zu erfahren)]]&lt;br /&gt;
* Normal offset: Erlaubt es Ihnen, Strahlen von der Oberfläche zu versetzen. Dies ist selten nützlich und dient hauptsächlich zu Versuchszwecken.&lt;br /&gt;
* Transparent selfshadow: Strahlen hinter der Oberfläche werfen, damit diese keine Schatten auf sich selbst wirft. Kann z. B. für durchscheinendes Laub hilfreich sein.&lt;br /&gt;
* Vertex sampling density (nur wenn Packing Mode auf Vertex eingestellt ist): Standardmäßig berechnet das Per-Vertex-Backen nur 1 Wert für jeden Vertex. Falls die Abtastdichte über 0 ist, wird stattdessen der Durchschnitt vieler über Dreiecke verteilter Abtastwerte gebildet, was zu supersamplierten, glatteren Ergebnissen führt.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Lightmapped Prefab ===&lt;br /&gt;
Diese Komponente erlaubt Prefabs das Speichern von Lightmapping-Metadaten. Solche Prefabs können dann, sowohl im Editor als auch während der Laufzeit, in jeder Szene instanziiert werden.&lt;br /&gt;
Die Komponente sollte direkt zum Wurzelobjekt des Prefabs hinzugefügt werden. Verschachtelte Prefabs werden nicht unterstützt. Da das Prefab nach dem Backen überschrieben wird (genauso wie beim Klick auf die Schaltfläche “Apply”), darf das Prefab keine unangewendeten Änderungen enthalten (untergeordnete Objekte dürfen nicht verschoben werden, Materialien und Skriptparameter müssen unverändert bleiben usw). Sollten solche Änderungen erkannt werden, wird in der Benutzeroberfläche der Komponente eine Fehlermeldung angezeigt und nach dem Backen werden keine Metadaten gespeichert. Falls die Warnung zur [[#Warnings|Lightmapped prefab validation]] aktiviert ist, werden eventuell vorhandene Prefab-Fehler vor dem Backen in einem Dialogfeld angezeigt.&lt;br /&gt;
&lt;br /&gt;
Lightmapped Prefabs unterstützen alle Bakery-Funktionen, wie LODs, Terrains, Directional Lightmaps, RNM, SH, Per-Vertex-Modi und Shadowmasks. Damit Shadowmasks funktionieren, müssen Lichter ebenfalls Teil desselben Prefabs sein.&lt;br /&gt;
&lt;br /&gt;
{{note| Beachten Sie, dass Shadowmasks von Prefabs aufgrund von API-Einschränkungen nur mit Unity 2017.4 oder neuer funktionieren.}}&lt;br /&gt;
&lt;br /&gt;
Nach dem Backen wird ein Objekt namens “BakeryPrefabLightmapData” zum Prefab hinzugefügt. Dieses Objekt enthält ein Skript mit allen erforderlichen Daten zum Anwenden der Lightmaps.&lt;br /&gt;
&lt;br /&gt;
Darüber hinaus ermöglicht Lightmapped Prefab das Speichern der aktuellen Rendereinstellungen und das Laden dieser Einstellungen in jede derzeit geöffnete Szene mithilfe zweier Schaltflächen:&lt;br /&gt;
* Save current render settings to prefab: Speichert eine Kopie der aktuellen Rendereinstellungen auf dieses Prefab.&lt;br /&gt;
* Load render settings from prefab: Setzt die aktuellen Rendereinstellungen auf die vom Prefab gespeicherten Werte.&lt;br /&gt;
[[File:Upload 2019-9-17 10-32-34.png|thumb|Anwenden des Prefabs]]&lt;br /&gt;
Beim Backen eines Lightmapped Prefabs wird empfohlen, Folgendes zu überprüfen:&lt;br /&gt;
* Das Prefab wurde &amp;quot;Angewendet&amp;quot;. Klicken Sie hierfür bei älteren Unity Versionen auf die Schaltfläche &amp;quot;Apply&amp;quot; in der oberen rechten Ecke des Inspector. Bei neueren Versionen klicken Sie stattdessen auf die &amp;quot;Overrides&amp;quot;-Dropdown-Liste und dann auf &amp;quot;Apply all&amp;quot;.&lt;br /&gt;
* Die Prefab-Komponenten UI zeigt keine Fehler an.&lt;br /&gt;
* Das &amp;quot;Lightmapped prefab validation&amp;quot;-Kontrollkästchen wurde im Hauptfenster von Bakery aktiviert. Diese Einstellung überprüft alle Lightmapped Prefabs in der Szene und benachrichtigt Sie über mögliche Probleme in einem Dialogfeld.&lt;br /&gt;
&lt;br /&gt;
{{note| Lightmaps werden entweder nach der Szene, in der sie gebacken wurden, oder nach der Lightmap Group (falls vorhanden) benannt. Wenn Sie also verschiedene Prefabs in derselben Szene backen, stellen Sie bitte sicher, dass Sie entweder eine anders benannte [[Manual#Bakery_Lightmap_Group_Selector|Lightmap Group]] verwenden oder den [[Manual#Output_path|Output Path]] ändern.}}&lt;br /&gt;
&lt;br /&gt;
{{note| Beim nacheinander Backen von mehreren Prefabs mit identischen Modellen wird empfohlen, die Einstellung [[Manual#Asset_UV_Processing|Asset UV Processing]] auf ''Don't Change'' zu belassen, um eine Veränderung gemeinsam genutzter UVs zu verhindern.}}&lt;br /&gt;
&lt;br /&gt;
{{note| Bakery's Prefab-Workflow wurde implementiert, bevor Unity über die Ansichtsfunktion &amp;quot;Doppelklick auf Prefab&amp;quot; verfügte. Daher werden Lightmaps in der isolierten Prefab-Ansicht möglicherweise nicht korrekt angewendet und die Komponente zeigt möglicherweise die Meldung &amp;quot;This GameObject is not a prefab&amp;quot; an. Es sollte wie erwartet funktionieren, wenn Sie in einer normalen Szene arbeiten.}}&lt;br /&gt;
&lt;br /&gt;
{{note| Wenn Sie zuvor gebackene Prefabs entpacken und von vorhandenen Lightmaps trennen, sollten Sie sicherstellen, dass das BakeryPrefabLightmapData-Objekt, welches die Prefab-weiten Lightmap-/Renderer-Verbindungen enthält, entfernt wurde.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Direct Light ===&lt;br /&gt;
[[File:Directlight.jpg|thumb|Reines direktes Licht mit GI]]&lt;br /&gt;
[[File:Image4.png|thumb|Links: shadow spread = 0.01, rechts: 0.05. Beachten Sie, wie Schatten zunächst scharf sind und mit zunehmender Entfernung allmählich verschwimmen.]]&lt;br /&gt;
Unendliches direktes Licht (z. B. eine Sonne).&lt;br /&gt;
* Color: Farbe.&lt;br /&gt;
* Intensity: Linearer Farbmultiplikator.&lt;br /&gt;
* Shadow spread: Größe der Lichtquelle oder, einfacher ausgedrückt, Unschärfe des Schattens. 0 = maximal scharfe Schatten, 1 = maximal unscharfe Schatten. Technisch gesehen wird hier von einem einzelnen Strahl zu einem breiteren Strahlenkegel interpoliert.&lt;br /&gt;
* Shadow samples: Beeinflusst die Qualität der Schatten. Je kleiner der Wert für Shadow spread ist, desto weniger Samples sind für ein sauberes Bild erforderlich. Für Sonnenschatten liegen die typischen Werte zwischen 1 und 16. Das Setzen der Samples auf 0 deaktiviert das Werfen von Schatten für dieses Licht.&lt;br /&gt;
* Bitmask: Eine Liste von Umschaltflächen, mit denen diese Lichtquelle davon ausgeschlossen werden kann, bestimmte Lightmap Groups zu beeinflussen.&lt;br /&gt;
* Baked contribution: Legt fest, welche Art von Beleuchtungsdaten gebacken werden sollen. Nur sichtbar im Indirect- oder Shadowmask-Modus. Mögliche Werte:&lt;br /&gt;
** Direct and Indirect: Es wird sowohl die direkte, als auch indirekte Beleuchtung vollständig gebacken.&lt;br /&gt;
** Indirect only: Ein Echtzeit-Licht soll einen direkten Beitrag leisten; nur indirekte Beleuchtung wird gebacken.&lt;br /&gt;
** Shadowmask and indirect: Ein Echtzeit-Licht soll einen direkten Beitrag leisten, aber Schatten von statischer Geometrie werden in eine separate Map gebacken. Dynamische und statische Schatten werden miteinander gemischt. Indirekte Beleuchtung wird wie gewohnt gebacken.&lt;br /&gt;
** Direct, Indirect, Shadowmask (nur benutzerdefinierte Beleuchtung): Wie Direct und Indirect, jedoch wird zusätzlich eine Shadowmask erzeugt und für die Verwendung mit benutzerdefinierten Shadern zugewiesen.&lt;br /&gt;
* Denoise shadowmask: Legt fest, ob Denoising auf die Shadowmask dieses Lichts angewendet werden soll. Normalerweise ist dies nicht notwendig, da Schatten in der Regel nicht viel Rauschen aufweisen, aber es kann bei sehr breiten, unscharfen Schatten (großer Shadow spread) hilfreich sein.&lt;br /&gt;
* Indirect intensity: Nicht-physikalischer GI-Multiplikator für dieses Licht. Sollte für eine natürliche Beleuchtung auf 1 eingestellt sein, kann jedoch für stilisiertere Szenen angepasst werden.&lt;br /&gt;
* Anti-alias: Führt Supersampling für den Schatten durch.&lt;br /&gt;
* Texture projection: Projiziert eine multiplikative gekachelte Textur über die Beleuchtung. Kann verwendet werden, um entfernte Wolkenschatten zu simulieren.&lt;br /&gt;
Wenn Texture projection aktiviert ist, kann ihre Skalierung/Verschiebung über die Felder &amp;quot;Tiling&amp;quot; und &amp;quot;Offset&amp;quot; angepasst werden. Alternativ können Sie auf &amp;quot;Tweak projection in Scene View&amp;quot; klicken und die Projektion mit einem zusätzlichen Gizmo visuell verschieben und skalieren. Mit dem Klick auf &amp;quot;Render reference frame&amp;quot; können Sie eine Referenz-PNG-Datei aus der &amp;quot;Perspektive des Lichts&amp;quot; speichern. Dies ist nützlich, um Wolkenschatten über die Szene zu malen.&lt;br /&gt;
&lt;br /&gt;
Sollten für dasselbe GameObject sowohl die Unity- als auch die Bakery-Lichtquelle aktiviert sein, und beide nicht miteinander übereinstimmen, werden zwei Schaltflächen angezeigt:&lt;br /&gt;
* Match lightmapped to real-time: Kopiert allgemeine Einstellungen vom Unity Light zum Bakery Light.&lt;br /&gt;
* Match real-time to lightmapped: Kopiert allgemeine Einstellungen vom Bakery Light zum Unity Light.&lt;br /&gt;
&lt;br /&gt;
{{note| Physikalisch gesehen ist Bakery's &amp;quot;Intensity&amp;quot; für gerichtete Lichtquellen Lux geteilt durch Pi.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Sky Light ===&lt;br /&gt;
[[File:Skylight.jpg|thumb|Reines Himmelslicht mit GI]]&lt;br /&gt;
Unendliches, schattenwerfendes Umgebungslicht (Himmel).&lt;br /&gt;
* Color: Farbe.&lt;br /&gt;
* Intensity: Linearer Farbmultiplikator.&lt;br /&gt;
* Sky texture: Optionales Cubemap-Asset, z. B. ein HDRI-Panorama, um die Lichtfarben aus unterschiedlichen Richtungen zu beeinflussen.&lt;br /&gt;
{{note| Durch Drehen des GameObject wird die Beleuchtung aus der Cubemap entsprechend mitgedreht.}}&lt;br /&gt;
* Samples: Beeinflusst die Qualität der Schatten. Typische Werte liegen zwischen 8 und 32.&lt;br /&gt;
* Hemispherical: Wenn aktiviert, kommt das Licht nur von oben (obere Hemisphäre). Andernfalls kommt es aus allen Richtungen.&lt;br /&gt;
* Bitmask: Eine Liste von Umschaltflächen, mit denen diese Lichtquelle davon ausgeschlossen werden kann, bestimmte Lightmap Groups zu beeinflussen.&lt;br /&gt;
* Baked contribution: Legt fest, welche Art von Beleuchtungsdaten gebacken werden sollen. Nur sichtbar im Indirect- oder Shadowmask-Modus. Mögliche Werte:&lt;br /&gt;
** Direct and Indirect: Es wird sowohl die direkte, als auch indirekte Beleuchtung vollständig gebacken. Dies ist das Standardverhalten und wird für alle Sky Lights empfohlen, da es keine Echtzeitvariante gibt, um sie in Unity zu emulieren.&lt;br /&gt;
** Indirect only: Ein Echtzeit-Licht soll einen direkten Beitrag leisten; nur indirekte Beleuchtung wird gebacken.&lt;br /&gt;
&lt;br /&gt;
Sollten die Einstellungen für das Himmelslicht und die aktuelle Skybox nicht übereinstimmen, werden zwei Schaltflächen angezeigt:&lt;br /&gt;
* Match this light to scene skybox: Kopiert die allgemeinen Einstellungen vom aktiven Skybox-Material zum Bakery Sky Light. Derzeit können nur Skyboxen, die mit den Shadern “Skybox/Cubemap” oder “Skybox/Bakery skybox” ausgestattet sind, abgeglichen werden.&lt;br /&gt;
* Match scene skybox to this light: Kopiert die allgemeinen Einstellungen vom Bakery Sky Light zur Szenen-Skybox.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bakery Light Mesh ===&lt;br /&gt;
[[File:Image29.png|thumb|Links: Samples Near = 0, Samples Far = 4096.&amp;lt;br&amp;gt;&lt;br /&gt;
Mitte: Samples Near = 0, Samples Far = 128.&amp;lt;br&amp;gt;&lt;br /&gt;
Rechts: Samples Near = 16, Samples Far = 128.&amp;lt;br&amp;gt;&lt;br /&gt;
Beachten Sie, wie ähnlich das Erscheinungsbild der Beleuchtung ist, obwohl weniger kombinierte Samples verwendet werden.]]&lt;br /&gt;
Emissives Mesh beliebiger Form. Sollte zusammen mit der Mesh Renderer-Komponente oder mit einer Light-Komponente, die auf Area eingestellt ist, verwendet werden.&lt;br /&gt;
* Color: Farbe.&lt;br /&gt;
* Intensity: Linearer Farbmultiplikator.&lt;br /&gt;
* Cutoff: Maximale Lichtdistanz. Bakery wird zusätzlich den invers-quadratischen Lichtabfall nahe der Grenze abmindern. Dies funktioniert am besten, wenn der Cutoff-Wert genau dort liegt, wo der physikalische Abfall sehr schwach wird. Cutoff kann die Backleistung verbessern, aber Sie können ihn für vollständige Korrektheit auch auf einen sehr hohen (unerreichbaren) Wert einstellen.&lt;br /&gt;
* Self Shadow: Legt fest, ob das Light Mesh selbst Schatten wirft. Diese Einstellung verwendet einen präziseren Beleuchtungsalgorithmus.&lt;br /&gt;
* Samples Near: Beeinflusst die Beleuchtungsqualität in der Nähe des Meshes. Typische Werte liegen zwischen 16 und 64. Diese Einstellung ist nur verfügbar, wenn Self Shadow aktiviert ist.&lt;br /&gt;
* Samples Far: Beeinflusst die Beleuchtungsqualität in der Entfernung vom Mesh. Typische Werte liegen zwischen 4 und 4096.&lt;br /&gt;
&lt;br /&gt;
Bakery verwendet zwei verschiedene Algorithmen für Area Lights, basierend auf der Nähe der zu emittierenden Oberfläche. In der unmittelbaren Nähe der Lichtquelle funktioniert es ähnlich wie der GI-Algorithmus, während das Licht in der Ferne eher als eine Wolke virtueller Punktlichter approximiert wird.&lt;br /&gt;
&lt;br /&gt;
{{note| &amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;Light Meshes erhalten keine eigene Beleuchtung und werden auch nicht ge-lightmapped.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Ein Light Mesh mit vielen Polygonen kann schneller gebacken werden als viele einfache Light Meshes.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Versuchen Sie, den Wert von Samples Near auf 0 zu setzen, falls Sie unscharfe/verrauschte Ergebnisse erhalten. Dann wird nur der Virtual Point Lights-Algorithmus angewendet. Dieser ist auch nützlich bei der Nutzung sehr einfacher Lichter, wo Präzision nicht so wichtig ist (z. B. Fensterlichter an Gebäuden).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;}}&lt;br /&gt;
[[File:Dd99d-QU0AEKFBK.jpg|thumb|Ein gebogenes Light Mesh]]&lt;br /&gt;
* Bitmask: Eine Liste von Umschaltflächen, mit denen diese Lichtquelle davon ausgeschlossen werden kann, bestimmte Lightmap Groups zu beeinflussen.&lt;br /&gt;
* Baked contribution: Legt fest, welche Art von Beleuchtungsdaten gebacken werden sollen. Nur sichtbar im Indirect- oder Shadowmask-Modus. Mögliche Werte:&lt;br /&gt;
** Direct and Indirect: Es wird sowohl die direkte, als auch indirekte Beleuchtung vollständig gebacken. Dies ist das Standardverhalten und wird für alle Light Meshes empfohlen, da es keine Echtzeitvariante gibt, um sie in Unity zu emulieren.&lt;br /&gt;
** Indirect only: Ein Echtzeit-Licht soll einen direkten Beitrag leisten; nur indirekte Beleuchtung wird gebacken.&lt;br /&gt;
** Shadowmask and Indirect: Ein Echtzeit-Licht soll einen direkten Beitrag leisten, aber Schatten von statischer Geometrie werden in eine separate Map gebacken. Dynamische und statische Schatten werden miteinander gemischt. Indirekte Beleuchtung wird wie gewohnt gebacken. Derzeit unterstützen nur die HDRP (und benutzerdefinierte Renderer) gemischte Area Lights.&lt;br /&gt;
** Direct, Indirect, Shadowmask (nur benutzerdefinierte Beleuchtung): Wie Direct und Indirect, jedoch wird zusätzlich eine Shadowmask erzeugt und für die Verwendung mit benutzerdefinierten Shadern zugewiesen.&lt;br /&gt;
* Indirect intensity: Nicht-physikalischer GI-Multiplikator für dieses Licht. Sollte für eine natürliche Beleuchtung auf 1 eingestellt sein, kann jedoch für stilisiertere Szenen angepasst werden.&lt;br /&gt;
* Shadowmask with falloff: Backt den vollständigen Lichtabfall in die Shadowmask ein (nur nützlich bei Verwendung mit benutzerdefinierten Shadern).&lt;br /&gt;
&lt;br /&gt;
Sollten das Material des Meshes und die Lichteinstellungen nicht übereinstimmen, werden zwei Schaltflächen angezeigt:&lt;br /&gt;
* Match light to material: Kopiert die allgemeinen Einstellungen vom unbeleuchteten Material des Meshes oder Area Light zum Bakery Light Mesh.&lt;br /&gt;
* Match material to light: Kopiert die allgemeinen Einstellungen vom Bakery Light Mesh zum unbeleuchteten Material des Meshes oder Area Light.&lt;br /&gt;
&lt;br /&gt;
==== Unterschiede zwischen Light Mesh und emissive Materialien ====&lt;br /&gt;
Emissives Material:&lt;br /&gt;
* Verbreitet Licht während der GI-Berechnung und ist dadurch “kostenlos” - unabhängig davon, wie viele Meshes emissiv sind.&lt;br /&gt;
* Kleine und helle Lichter können, je nach Anzahl des GI sample count, zu ungenauen und verrauschten Ergebnissen führen.&lt;br /&gt;
* Muss aufgrund der Funktionsweise von GI in Bakery Platz in der Lightmap einnehmen, wodurch möglicherweise Platz verschwendet wird. Das bedeutet wiederum auch, dass emissive Objekte gültige UVs benötigen und die Einstellung “Cast shadows” aktiviert sein muss.&lt;br /&gt;
&lt;br /&gt;
Light Mesh:&lt;br /&gt;
* Die Beleuchtung wird für jedes Licht einzeln berechnet und ist daher langsamer als bei emissiven Materialien.&lt;br /&gt;
* Entwickelt, um auch bei kleinen und hellen Lichtquellen, selbst wenn diese sehr weit entfernt sind, saubere Ergebnisse zu erzielen.&lt;br /&gt;
* Nimmt keinen Platz in Lightmaps ein.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Point Light ===&lt;br /&gt;
[[File:Image11.png|thumb|Links: Shadow Spread = 0.5, rechts: Shadow Spread = 1.]]&lt;br /&gt;
Punktlicht, hat keine Fläche. Trotz physikalischer Unmöglichkeit ist es für Spiele nützlich und die einzige Möglichkeit, die Punkt- und Spotlichter von Unity nachzubilden.&lt;br /&gt;
{{note| Spotlichter sind lediglich Punktlichter mit einer zusätzlichen Projektionsmaske.}}&lt;br /&gt;
* Color: Farbe.&lt;br /&gt;
* Intensity: Linearer Farbmultiplikator.&lt;br /&gt;
* Shadow spread: Unschärfe des Schattens. Obwohl Punktlichter keine Fläche besitzen, ist es dennoch oft wünschenswert, von ihnen geworfene, unscharfe Schatten zu bekommen. Zu diesem Zweck werden Schatten so simuliert, als würden sie von einer kugelförmigen Flächenlichtquelle geworfen. Dieser Parameter definiert den Radius einer solchen virtuellen Kugel, was sich direkt auf die Unschärfe auswirkt.&lt;br /&gt;
* Physical falloff: Wenn aktiviert, wird der korrekte invers-quadratische Lichtabfall mit zusätzlicher Abschwächung nahe der Grenze verwendet. Andernfalls wird versucht, den Lichtabfall von Unity nachzuahmen.&lt;br /&gt;
* Falloff min size: Mehr dazu im Artikel [[Point Light Attenuation]].&lt;br /&gt;
* Range: Wenn Physical falloff deaktiviert ist, entspricht dies der Lichtreichweite von Unity. Ist es aktiviert, wird der physikalische Lichtabfall an den Rändern nur leicht abgeschwächt.&lt;br /&gt;
* Samples: Beeinflusst die Qualität der Schatten. Typische Werte liegen zwischen 1 und 512. Das Setzen der Samples auf 0 deaktiviert das Werfen von Schatten für dieses Licht.&lt;br /&gt;
[[File:Image10.png|thumb|Von links nach rechts: Omni, Cookie (default spot texture), Cubemap, IES.]]&lt;br /&gt;
* Projection mask: Art der Maske/des Cookie. Optionen:&lt;br /&gt;
** Omni: keine Maske, vergleichbar mit Unity’s Point Light.&lt;br /&gt;
** Cookie: Projektion einer Cookie-Textur. Zusätzliche Optionen:&lt;br /&gt;
*** Cookie texture: 2D Textur Asset. Bakery enthält die ursprüngliche Spot Light-Textur von Unity (unter dem Namen ftUnitySpotTexture), die Sie zur Nachahmung verwenden können.&lt;br /&gt;
*** Angle: Texturprojektionswinkel (ähnelt Unity’s Spot Light).&lt;br /&gt;
*** Correct distortion: Korrigiert Verzerrungen von Cookies, die bei einer Weitwinkelbetrachtung auf geraden Linien sichtbar sind.&lt;br /&gt;
** Cubemap: Cubemap-Cookie-Projektion. Zusätzliche Optionen:&lt;br /&gt;
*** Projected cubemap: Cubemap Asset.&lt;br /&gt;
** IES: Beleuchtung wird durch Daten aus einer IES-Datei moduliert. Zusätzliche Optionen:&lt;br /&gt;
*** IES file: Datei mit .ies-Endung.&lt;br /&gt;
* Bitmask: Eine Liste von Umschaltflächen, mit denen diese Lichtquelle davon ausgeschlossen werden kann, bestimmte Lightmap Groups zu beeinflussen.&lt;br /&gt;
* Baked contribution: Legt fest, welche Art von Beleuchtungsdaten gebacken werden sollen. Nur sichtbar im Indirect- oder Shadowmask-Modus. Mögliche Werte:&lt;br /&gt;
** Direct and Indirect: Es wird sowohl die direkte, als auch indirekte Beleuchtung vollständig gebacken.&lt;br /&gt;
** Indirect only: Ein Echtzeit-Licht soll einen direkten Beitrag leisten; nur indirekte Beleuchtung wird gebacken.&lt;br /&gt;
** Shadowmask and Indirect: Ein Echtzeit-Licht soll einen direkten Beitrag leisten, aber Schatten von statischer Geometrie werden in eine separate Map gebacken. Dynamische und statische Schatten werden miteinander gemischt. Indirekte Beleuchtung wird wie gewohnt gebacken.&lt;br /&gt;
** Direct, Indirect, Shadowmask (nur benutzerdefinierte Beleuchtung): Wie Direct und Indirect, jedoch wird zusätzlich eine Shadowmask erzeugt und für die Verwendung mit benutzerdefinierten Shadern zugewiesen.&lt;br /&gt;
* Indirect intensity: Nicht-physikalischer GI-Multiplikator für dieses Licht. Sollte für eine natürliche Beleuchtung auf 1 eingestellt sein, kann jedoch für stilisiertere Szenen angepasst werden.&lt;br /&gt;
* Shadowmask with falloff: Backt den vollständigen Lichtabfall (Distanz ausgenommen) in die Shadowmask ein (nur nützlich bei Verwendung mit benutzerdefinierten Shadern).&lt;br /&gt;
* Legacy sampling: Verwende Bakery's ursprüngliche, stärker verzerrte Schattenabtastungsstrategie. Erzeugt rauschfreie Schatten, aber breite Halbschatten können Streifenbildung aufweisen. Wenn diese Option deaktiviert ist, wird eine unverzerrte, aber mehr mit Rausch behaftete Technik verwendet.&lt;br /&gt;
&lt;br /&gt;
Sollten für dasselbe GameObject sowohl die Unity- als auch die Bakery-Lichtquelle aktiviert sein, und beide nicht miteinander übereinstimmen, werden zwei Schaltflächen angezeigt:&lt;br /&gt;
* Match lightmapped to real-time: Kopiert allgemeine Einstellungen vom Unity Light zum Bakery Light.&lt;br /&gt;
* Match real-time to lightmapped: Kopiert allgemeine Einstellungen vom Bakery Light zum Unity Light.&lt;br /&gt;
&lt;br /&gt;
{{note| Physikalisch gesehen ist Bakery's &amp;quot;Intensity&amp;quot; für Punktlichter (Candela/Pi).}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Volume ===&lt;br /&gt;
[[File:Voldemo notlonely.gif|Eine bewegliche Schranktür wird durch ein Bakery Volume beleuchtet (GIF von NOTLonely)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Volumes generieren 3D-Texturen, die Light Probes pro Voxel speichern (sphärische Harmonische der Ordnung L1 und Shadowmasks), wodurch sie einen geeigneten Ersatz für reguläre Unity Light Probes darstellen.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Unity Light Probes&lt;br /&gt;
! Unity LPPV&lt;br /&gt;
! Bakery Volumes&lt;br /&gt;
|-&lt;br /&gt;
| Manuelles Platzieren einzelner Probes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Nein&lt;br /&gt;
|-&lt;br /&gt;
| Interpolieren mehrerer Probes auf einem Objekt&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|-&lt;br /&gt;
| Ist während der Laufzeit verschiebbar&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|-&lt;br /&gt;
| Kann in ein Prefab platziert werden&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|-&lt;br /&gt;
| Vollständige Scripting-API verfügbar&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|-&lt;br /&gt;
| Ringing&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Möglich&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Möglich&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Behoben&lt;br /&gt;
|-&lt;br /&gt;
| Denoising&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|-&lt;br /&gt;
| Laufzeit-Overhead&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | CPU: niedrig; GPU: niedrig.&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | CPU: mittel; GPU: mittel.&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#e4ead3;&amp;quot; | CPU: kein; GPU: mittel.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bakery Volume ist eine Begrenzungsbox, die mit einer Reihe von 3D-Texturen (3 SH-Texturen und bei Bedarf eine Shadowmask) verknüpft ist, wodurch sie sehr einfach zu verwenden und mit Skripten zu modifizieren ist. Volumes können während der Laufzeit ganz einfach ausgetauscht, verschoben, geladen oder entladen oder mit Prefabs verknüpft werden. Sie benötigen außerdem keine Light Probe Groups und die manuelle Platzierung von Probes entfällt; das gesamte Volumen wird stattdessen mit einem einheitlichen Raster aus Voxel-Probes gefüllt. Light/Shadow leaking wird automatisch auf die gleiche Weise behoben wie bei Lightmaps (dünne doppelseitige Wände können jedoch bei großen Voxelgrößen ein Problem darstellen, was jedoch durch die Verwendung unterschiedlicher Volumes auf verschiedenen Seiten vermieden werden kann). Aufgrund der einheitlichen Beschaffenheit von Voxel-Rastern ist es auch möglich, ein Lightmap-ähnliches Denoising auf sie anzuwenden, was bei normalen Light Probes nicht machbar ist. Zusätzlich verwenden Bakery Shaders den [https://drive.google.com/file/d/1MK6Clw93q8ljijRjb4gQOzzaIjn1uF9Y/view Geomerics Sampling-Trick], um &amp;quot;Ringing&amp;quot;-Artefakte, die von sphärischen Harmonischen manchmal bei kontrastreicher HDR-Beleuchtung erzeugt werden, vollständig zu beseitigen.&lt;br /&gt;
&lt;br /&gt;
Dadurch können Volumes eine saubere, detaillierte und hochwertige gebackene Beleuchtung für dynamische Objekte erzeugen (d. h. Beleuchtung, die von statischen Objekten ausgeht und sich auf dynamische Objekte auswirkt, nicht umgekehrt).&lt;br /&gt;
&lt;br /&gt;
Der einzige Nachteil des Volumes-Ansatzes sind die höheren Shading-Kosten pro Pixel. Die Kosten sind ähnlich wie bei LPPV (Skalierung mit der Anzahl der schattierten, vom Volumen betroffenen, Pixel auf dem Bildschirm), aber im Gegensatz zu LPPV werden die Volumen selbst nach dem Backen nicht mehr aktualisiert. Das Mischen mehrerer Volumen kann vermieden werden, indem man sie leicht überlappen lässt.&lt;br /&gt;
&lt;br /&gt;
====Einstellen der Volume Transform====&lt;br /&gt;
[[File:Bvolgizmo.jpg|thumb|Volume Gizmo]]&lt;br /&gt;
Wenn Bakery Volume zu einem GameObject hinzugefügt wird, erscheint in der Szenenansicht ein Begrenzungsrahmen-Gizmo. Durch das Ziehen an den kleinen Quadraten wird es skaliert.&lt;br /&gt;
Es gibt noch andere Möglichkeiten, wie man die Größe und Position der Volume ändern kann:&lt;br /&gt;
* Ziehen Sie ein beliebiges, renderbares GameObject in das Feld &amp;quot;Wrap to object&amp;quot;. Dadurch umschließt das Volume dieses Objekt (und seine untergeordneten Elemente) und ummantelt es.&lt;br /&gt;
* Wenn demselben Objekt ein Box Collider hinzugefügt wurde, werden die Schaltflächen &amp;quot;Set from box collider&amp;quot; und &amp;quot;Set to box collider&amp;quot; angezeigt. Diese können verwendet werden, um Werte schnell zwischen Volume/Collider zu kopieren.&lt;br /&gt;
&lt;br /&gt;
====Auflösung====&lt;br /&gt;
Wenn &amp;quot;Adaptive resolution&amp;quot; aktiviert ist, wird die Anzahl der Voxel durch die &amp;quot;Voxels per unit&amp;quot;-Angabe bestimmt. Durch Deaktivieren kann die Auflösung manuell eingegeben werden. Bei den meisten Spielen mit 1 Einheit = 1 Meter ist 2 ein angemessener Wert für &amp;quot;Voxels per unit&amp;quot;, aber es gibt Fälle (z. B. dynamische Türen), in denen die Verwendung eines kleineren Volumes mit höherer Auflösung vorteilhafter ist.&lt;br /&gt;
&lt;br /&gt;
====Andere Einstellungen====&lt;br /&gt;
* Enable baking: Soll die Volume (neu) berechnet werden? Deaktivieren, um das Überschreiben vorhandener Daten zu verhindern.&lt;br /&gt;
* Denoise: Wende Denoising nach dem Backen der Volume an. Empfohlen für hochauflösende Volumes. Vermeiden Sie die Verwendung der Einstellung bei Volumes mit sehr niedriger Auflösung, die viele Lichter abdecken, da es für den Denoiser schwierig sein wird, den tatsächlichen Inhalt von Rauschen unterscheiden zu können.&lt;br /&gt;
* Global: Weist diese Volume automatisch allen kompatiblen Shadern zu, sofern diese keine Überschreibungen enthalten. Intern ruft es den Befehl Shader.SetGlobalTexture()/SetGlobalVector() auf.&lt;br /&gt;
&lt;br /&gt;
====Benutzung====&lt;br /&gt;
Volumes können mithilfe eines Volume-bewussten Shaders Objekten zugewiesen werden. Bakery wird mit dem &amp;quot;Bakery Standard&amp;quot;-Shader, der Volumes bereits implementiert hat, sowie mit HDRP- und URP-Graphen geliefert. Sehen Sie sich die example_volumes Szenen an, um verschiedene Anwendungsmöglichkeiten einer Volume zu entdecken.&lt;br /&gt;
&lt;br /&gt;
====Hinweise und Tipps====&lt;br /&gt;
* Sehen Sie sich unbedingt die Beispiele an.&lt;br /&gt;
* Falls sich zwei Volumes berühren, lassen Sie sie ein wenig überlappen. Die Größe der Überlappung sollte der Größe des größten dynamischen Objekts entsprechen. Auf diese Weise funktioniert das einfache Wechseln zwischen Volumes nach Bedarf.&lt;br /&gt;
* Platzieren Sie Volumes nur in Bereichen, die dynamische Objekte tatsächlich erreichen können. Verwenden Sie zum Beispiel die Spielerhöhe, um die Höhe der Volume zu begrenzen.&lt;br /&gt;
&lt;br /&gt;
====Drehen von Volumes====&lt;br /&gt;
Volumes können um die Y-Achse gedreht werden, sofern die Einstellung &amp;quot;Rotate around Y&amp;quot; aktiviert ist. Die Drehung ist sehr ressourcenschonend und verwendet nur 2 zusätzliche Daten-Floats (vorberechnete Sinus-/Kosinuswerte des Winkels).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Es gibt eine zusätzliche Option zum Drehen von Volumes während der Laufzeit (unter Experimental -&amp;gt; &amp;quot;Support rotation after bake&amp;quot; und eine ähnliche Einstellung im Bakery Shader). In diesem Fall müssen sie ohne anfängliche Drehung gebacken werden.&lt;br /&gt;
&lt;br /&gt;
In der URP kann solch eine dynamische Drehung mithilfe von BakeryURPVolumeGraphRotatable.shadergraph genutzt werden.&lt;br /&gt;
&lt;br /&gt;
Für globale Volumes wird die dynamische Drehung aktualisiert, wenn die Komponente (wieder) aktiviert oder volume.SetGlobalParams() aufgerufen wird. Bei der Nutzung von lokal gedrehten Volumen ist die manuelle Einstellung der Drehung im Material oder im MaterialPropertyBlock erforderlich:&lt;br /&gt;
{{code|&amp;lt;nowiki&amp;gt;SetMatrix(&amp;quot;_VolumeMatrix&amp;quot;, volume.GetMatrix())&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
====Technische Informationen====&lt;br /&gt;
Volumes können automatisch funktionieren (siehe Beispielszenen), aber es ist auch möglich, ihre Wirkweise per Skript zu steuern.&lt;br /&gt;
&lt;br /&gt;
Volumedaten können über diese öffentlichen Eigenschaften aus der Komponente abgerufen werden:&lt;br /&gt;
* bakedTexture0: Speichert L0-RGB-Koeffizienten und den L1-Z-Rotkanal in den Alphakanal.&lt;br /&gt;
* bakedTexture1: Speichert L1-X-RGB-Koeffizienten und den L1-Z-Grünkanal in den Alphakanal.&lt;br /&gt;
* bakedTexture2: Speichert L1-Y-RGB-Koeffizienten und den L1-Z-Blaukanal in den Alphakanal.&lt;br /&gt;
* bakedMask: Speichert die volumetrische Shadowmask.&lt;br /&gt;
* bounds: Die Begrenzungsbox der Volume.&lt;br /&gt;
&lt;br /&gt;
Alle bakedTexture*-Maps nutzen das RGBAHalf (8 Bytes pro Voxel) Format, während die Shadowmask das Format ARGB32 (4 Bytes pro Voxel) verwendet. Alternativ kann für die Shadowmask auch das Single-channel R8 Format (1 Byte pro Voxel) verwendet werden.&lt;br /&gt;
&lt;br /&gt;
Daher gilt: volume byte size = width*height*depth*3*8 + (nur wenn die Shadowmask verwendet wird) width*height*depth*4 (oder width*height*depth bei einer R8 Shadowmask).&lt;br /&gt;
&lt;br /&gt;
[[Manual#Compress_volumes|Texture compression]] kann für Volumes aktiviert werden, um diese deutlich zu verkleinern.&lt;br /&gt;
&lt;br /&gt;
Zum Samplen von Volumes werden spezielle Shader benötigt, die in Bakery bereits enthalten sind. Um einem benutzerdefinierten Shader Volumes-Funktionen hinzuzufügen, überprüfen Sie bitte die Funktion BakeryVolume_float() in der Datei BakeryDecodeLightmap.hlsl, die in den HDRP/URP-Paketen enthalten ist.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Light Filter ===&lt;br /&gt;
[[File:Output optimized.gif|Buntglas, wie es durch Bakery Real-Time Preview gesehen wird. Die gleichen Ergebnisse werden vom Bakery lightmapper gebacken.]]&lt;br /&gt;
&lt;br /&gt;
Markiert einen Renderer als Light Filter. Light Filter färben alle direkten/indirekten Strahlen mit ihrer Farbe, ähnlich wie optische Filter im realen Leben, wodurch farbige Transparenzen (z. B. Buntglas) entstehen. Der einzige Parameter ist die, für die Tönung, verwendete Textur.&lt;br /&gt;
* Objekte mit Light Filter erhalten weiterhin wie alle anderen Objekte auch Lightmaps.&lt;br /&gt;
* Filter streuen/verwischen keine Strahlen (nutzen Sie hierfür [[Subsurface_scattering|Subsurface Scattering]] oder [[Manual#Backface_GI|Backface GI]]).&lt;br /&gt;
* Filter können farbige Schatten erzeugen. Wenn für das Licht ein [[Manual#Shadowmask|Shadowmask]]-Modus verwendet wird, wird nur der R-Kanal des Ergebnisses gespeichert (da Unity nur einkanalige Masken unterstützt). Für vollständig gebackene Schatten gibt es keine Einschränkungen.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Sector ===&lt;br /&gt;
Lesen Sie den Artikel '''[[Partial_scene_baking|Partial scene baking]]''' für weitere Informationen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Always Render ===&lt;br /&gt;
Wenn dies zu einem Objekt hinzugefügt wird, berücksichtigt Bakery es beim Backen immer, auch wenn sein Renderer deaktiviert ist.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Pack As Single Square ===&lt;br /&gt;
Wenn dies zu einem Objekt hinzugefügt wird, behandelt Bakery die UVs dieses Objekts und die UVs seiner untergeordneten Objekte als ein einziges kombiniertes Quadrat und verschiebt sie während des automatischen Atlas-Packens oder in einer Lightmap Group im Modus Pack Atlas niemals voneinander weg. Die gesamte Hierarchie der untergeordneten Objekte wird als Ganzes gepackt.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Shared LOD UV ===&lt;br /&gt;
Wenn dies zu einer LODGroup hinzugefügt wird, werden alle ähnlich benannten LODs für dieselbe Lightmap markiert. Standardmäßig erhält jedes LOD eine einzigartige Lightmap, die Platz im Atlas einnimmt. Wenn jedoch bekannt ist, dass LODs desselben Objekts ähnliche UV2-Kanäle haben (oder UV1, wenn sie sich nicht überlappen, und UV2 nicht vorhanden ist), können sie demselben Teil des Atlas zugeordnet werden, wodurch Speicherplatz gespart wird.&lt;br /&gt;
Diese Technik ist auch als [https://github.com/laurenth-personal/LODLightmapScripts/ Lightmap Stealing] bekannt.&lt;br /&gt;
&lt;br /&gt;
= Kompatibilität von Materialien =&lt;br /&gt;
=== Albedo und Emission ===&lt;br /&gt;
Bakery unterstützt die meisten Unity Materialien durch die Verwendung des [https://docs.unity3d.com/Manual/MetaPass.html Meta Pass]-Systems. Alle Built-in, Surface, URP und HDRP Shaders verfügen bereits über einen korrekt definierten Meta Pass.&lt;br /&gt;
&lt;br /&gt;
Wenn Sie einen Unlit Shader haben, müssen Sie den Meta Pass manuell hinzufügen, so wie es in der Unity Dokumentation beschrieben wird.&lt;br /&gt;
&lt;br /&gt;
Sollte der Pass nicht vorhanden sein, wird Bakery die Eigenschaften {{codeVar|_MainTex}}, {{codeVar|_BaseColorMap}} oder {{codeVar|_Color}} (wenn keine Textur festgelegt ist) als Materialalbedo und {{codeVar|_EmissionMap}} sowie {{codeVar|_EmissionColor}} als Emissionsfarbe werten.&lt;br /&gt;
&lt;br /&gt;
Damit Emission funkionieren kann, muss der Wert [https://docs.unity3d.com/ScriptReference/Material-globalIlluminationFlags.html Material.globalIlluminationFlags] auf [https://docs.unity3d.com/ScriptReference/MaterialGlobalIlluminationFlags.BakedEmissive.html MaterialGlobalIlluminationFlags.BakedEmissive] gesetzt werden. Die Standard Shader legen diesen Wert automatisch fest.&lt;br /&gt;
&lt;br /&gt;
=== Opacity ===&lt;br /&gt;
[[File:Upload 2019-1-25 0-4-30.png|thumb|Materialparameter in Cutout umgewandelt (Standard)]]&lt;br /&gt;
[[File:Alphacombos dither.jpg|thumb|Halbtransparente Werte, die über die Option Dither Transparency hinzugefügt wurden]]&lt;br /&gt;
[[File:Alphacombos filter.jpg|thumb|Auf rote Flächen angewendete Light Filter-Komponenten, die farbige Schatten erzeugen]]&lt;br /&gt;
Standardmäßig übernimmt Bakery immer die volle Opazität aus dem Alpha-Wert von {{codeVar|_MainTex}}, {{codeVar|_BaseColorMap}} oder {{codeVar|_BaseMap}} und behandelt diese als Cutout (1-Bit Transparenz).&lt;br /&gt;
&lt;br /&gt;
Wenn die Einstellung '''Dither Transparency''' aktiviert ist, werden halbtransparente Werte automatisch in variables blaues Rauschen umgewandelt, das anschließend gefiltert/unscharf gemacht wird, was zu einer teilweisen Transparenz führt (dies war zuvor mit benutzerdefinierten, manuell geditherten Karten möglich, seit Version 1.97 erfolgt dies jedoch automatisch).&lt;br /&gt;
&lt;br /&gt;
Damit Opacity funkionieren kann, muss der [https://docs.unity3d.com/Manual/SL-SubShaderTags.html RenderType Tag] des Shaders einen der folgenden Werte haben:&lt;br /&gt;
* {{codeVar|Transparent}}&lt;br /&gt;
* {{codeVar|TransparentCutout}}&lt;br /&gt;
* {{codeVar|TreeLeaf}}&lt;br /&gt;
&lt;br /&gt;
Sollte eine Eigenschaft namens {{codeVar|_Cutoff}} vorhanden sein, wirkt sich diese auf den Cutout aus (daher funktioniert der Cutoff-Schieberegler des Standard Shaders automatisch).&lt;br /&gt;
&lt;br /&gt;
Ohne Dither Transparency wird, wenn der RenderType des Materials {{codeVar|Transparent}} oder {{codeVar|TreeLeaf}} ist, der Alpha-Wert von {{codeVar|_Color}} zusätzlich den Cutoff-Wert modifizieren: ''finalCutoff = 1 - (1 - cutoff) * alpha''&lt;br /&gt;
&lt;br /&gt;
Für farbige Transparenzeffekte, verwenden Sie die [[Manual#Bakery_Light_Filter|Light Filter]]-Komponente.&lt;br /&gt;
&lt;br /&gt;
Für diffuse Transparenzeffekte, lesen Sie den Abschnitt [[#Backface GI|Backface GI]] und den Artikel über [[Subsurface scattering]].&lt;br /&gt;
&lt;br /&gt;
==== Alpha Meta Pass ====&lt;br /&gt;
Seit v1.9 unterstützt Bakery die Angabe einer benutzerdefinierten shader-basierten Transparenz, wofür jedoch ein kompatibler Shader erforderlich ist. Um die Vorteile des ''Alpha Meta Pass'' nutzen zu können, müssen folgende Schritte durchgeführt werden:&lt;br /&gt;
* Fügen Sie Ihrem Shader die Eigenschaft namens '''BAKERY_META_ALPHA_ENABLE''' hinzu. Beispiel:&lt;br /&gt;
{{code|&amp;lt;nowiki&amp;gt;[HideInInspector] BAKERY_META_ALPHA_ENABLE (&amp;quot;Enable Bakery alpha meta pass&amp;quot;, Float) = 1.0&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
* Stellen Sie sicher, dass der RenderType auf einen der oben genannten Werte gesetzt ist.&lt;br /&gt;
* Deklarieren Sie einen Pass namens '''META_BAKERY'''. &lt;br /&gt;
* Überprüfen Sie in diesem Pass, ob '''unity_MetaFragmentControl.w''' ungleich Null ist. Ist dies der Fall, geben Sie den berechneten Transparenzwert zurück. &lt;br /&gt;
&lt;br /&gt;
Sehen Sie sich als Beispiel die im Paket enthaltene Datei ''Baked_Alpha_meta.shader'' an.&lt;br /&gt;
&lt;br /&gt;
Hinweis: Derzeit muss für den Alpha Meta Pass der Light Probe-Modus auf L1 oder L2 eingestellt sein.&lt;br /&gt;
&lt;br /&gt;
=== Normal mapping ===&lt;br /&gt;
Benutzerdefinierte Oberflächennormalen können in Verbindung mit dem Modus [[#Baked Normal Maps|Baked Normal Maps]] verwendet werden. Leider gibt der Meta Pass von Unity keine Normaleninformationen aus, sodass standardmäßig die Normalen aus einer Textur namens {{codeVar|_BumpMap}} übernommen und zusätzlich durch {{codeVar|_MainTex_ST}} verändert werden.&lt;br /&gt;
&lt;br /&gt;
Es ist jedoch möglich, komplett benutzerdefinierte Shader mit erweiterten Normal Mapping-Funktionen (z. B. Überblenden mehrerer Ebenen) zu erstellen, die mit dem Backen kompatibel sind. Dazu müssen Sie folgendes tun:&lt;br /&gt;
&lt;br /&gt;
1. Fügen Sie Ihrem Shader einen Meta Pass hinzu, so wie es [https://docs.unity3d.com/Manual/MetaPass.html#ExampleMetaPass in der Unity Dokumentation beschrieben] ist.&lt;br /&gt;
&lt;br /&gt;
2. Nennen Sie diesen Pass {{codeVar|&amp;quot;META_BAKERY&amp;quot;}} statt nur {{codeVar|&amp;quot;META&amp;quot;}}.&lt;br /&gt;
&lt;br /&gt;
3. Inkludieren Sie die Datei {{codeVar|&amp;quot;BakeryMetaPass.cginc&amp;quot;}}.&lt;br /&gt;
&lt;br /&gt;
4. Fügen Sie {{codeVar|#pragma vertex vert_bakerymt}} hinzu.&lt;br /&gt;
&lt;br /&gt;
5. Wenn die Variable {{codeVar|unity_MetaFragmentControl.z}} nicht 0 ist, sollte der Shader Normale im Weltkoordinatensystem zurückgeben. Der zurückgegebene Normalwert sollte mit der Funktion {{codeVar|BakeryEncodeNormal}} codiert werden.&lt;br /&gt;
&lt;br /&gt;
Zwei Beispiel-Shader, die diesen erweiterten Meta Pass implementieren, sind im Ordner Assets/Bakery/examples/shaders enthalten.&lt;br /&gt;
&lt;br /&gt;
Sie können BakeryMetaPass.cginc kopieren und an Ihre Bedürfnisse anpassen, z. B. um zusätzliche Daten aus dem Vertex Shader zu übermitteln.&lt;br /&gt;
&lt;br /&gt;
=== Front/back faces ===&lt;br /&gt;
Unabhängig davon, welcher Culling-Modus für den Shader verwendet wird, behandelt Bakery alle Rückflächen als undurchsichtig, was bedeutet, dass direkte Lichtstrahlen eine Rückfläche ebenso wenig durchdringen wie eine Vorderfläche.&lt;br /&gt;
Bei der Verwendung von [[Manual#Backface_GI|Backface GI]] können Rückflächen jedoch teilweise die von einer Vorderfläche empfangene Beleuchtung emittieren.&lt;br /&gt;
&lt;br /&gt;
= &amp;quot;Lightmap Parameters&amp;quot; Assets =&lt;br /&gt;
[[File:Lp.jpg|thumb|Erweiterte Lightmap-Parameter]]&lt;br /&gt;
Ähnlich wie Bakery's [[Manual#Bakery_Lightmap_Group_Selector|Lightmap Groups]] verfügt Unity über [https://docs.unity3d.com/Manual/class-LightmapParameters.html Lightmap-Parameter], die als Assets erstellt und Mesh Renderern zugewiesen werden können. Deren Logik weisen sowohl Unterschiede als auch Gemeinsamkeiten auf:&lt;br /&gt;
* Die Lightmap Group dient in erster Linie dazu, mehrere Objekte in einem Atlas zu gruppieren. Darüber hinaus ermöglicht sie das Überschreiben der Back-Einstellungen für diesen Atlas.&lt;br /&gt;
* Lightmap-Parameter werden hauptsächlich dazu verwendet, um die Back-Einstellungen für ein Objekt zu überschreiben. Sie können jedoch auch das Packing beeinflussen, wenn die Option &amp;quot;Baked Tag&amp;quot; verwendet wird: Objekte mit einem unterschiedlichen Baked Tag teilen sich niemals denselben Atlas.&lt;br /&gt;
&lt;br /&gt;
Da einige Benutzer eher mit dem Lightmap Parameter-Workflow vertraut sind, unterstützt und erweitert Bakery diese:&lt;br /&gt;
* Der Baked Tag wird von Bakery berücksichtigt.&lt;br /&gt;
* Zusätzliche Bakery-spezifische Einstellungen werden in der Lightmap Parameters UI angezeigt. Über die Bedeutung dieser Einstellungen finden Sie im Abschnitt [[Manual#Bakery_Lightmap_Group_Selector|Lightmap Group]] mehr heraus.&lt;br /&gt;
&lt;br /&gt;
= Project Settings =&lt;br /&gt;
Einige globale Einstellungen können unter Project Settings -&amp;gt; Bakery GPU Lightmapper angepasst werden (diese Option ist nur in Unity 2018.3 oder neuer sichtbar; bei älteren Versionen bearbeiten Sie stattdessen BakeryProjectSettings.asset):&lt;br /&gt;
* Mipmap lightmaps: Aktiviert Mipmapping für Lightmap Assets. Kann zu Leaks in UV-Maps führen, da Atlas-Texturen kleiner werden; andererseits reduziert es Lightmap Aliasing in der Ferne. Insgesamt wird empfohlen, für sehr weit entfernte Objekte separat gebackene LODs mit niedrig aufgelösten Lightmaps zu verwenden.&lt;br /&gt;
* Color file format: Format für reguläre HDR color lightmaps. Mögliche Werte:&lt;br /&gt;
** HDR: Radiance HDR format (Standard). Kann mit vielen Bildbearbeitungsprogrammen geöffnet und bearbeitet werden.&lt;br /&gt;
** Asset: Natives Unity Format. Kann eine benutzerdefinierte Mipmap-Anzahl haben.&lt;br /&gt;
* Mask/Direction file format: Format für zusätzliche LDR-Karten, wie Shadowmasks oder Richtungsinformationen. Mögliche Werte:&lt;br /&gt;
** TGA: 8-bit Targa (Standard).&lt;br /&gt;
** PNG: 8-bit PNG. Benötigt weniger Speicherplatz auf der Festplatte als Targa (TGA).&lt;br /&gt;
** Asset: Natives Unity Format. Kann eine benutzerdefinierte Mipmap-Anzahl haben.&lt;br /&gt;
* Compress lightmaps: Legt das Komprimierungsverhalten für Lightmap-Assets fest. Komprimierte Lightmaps benötigen weniger VRAM, können jedoch je nach Art der Komprimierung einige visuelle Artefakte (wie Streifenbildung oder farbige Flecken) aufweisen. (Informationen zu Komprimierungsproblemen auf mobilen Endgeräten finden Sie [[Troubleshooting#I_have_an_Android_project.2C_and_lightmaps_don.27t_look_good|hier]]). Mögliche Werte:&lt;br /&gt;
*** Compress but allow overriding asset: Es werden neue Lightmaps mit aktivierter Komprimierung erstellt. Nach ihrer Erstellung können ihre Komprimierungseinstellungen im Inspector geändert werden. Diese geänderten Werte bleiben nach dem erneuten Backen erhalten (Standard).&lt;br /&gt;
*** Force compress: Lightmaps werden immer komprimiert.&lt;br /&gt;
*** Force no compress: Immer unkomprimierte Lightmaps erstellen.&lt;br /&gt;
* High quality direction: Ermöglicht eine &amp;quot;hohe&amp;quot; Komprimierungsqualität für Richtungskarten. Die tatsächlichen Formate hängen von der (Ziel)plattform ab. Auf dem PC wird beispielsweise DXT1 durch BC7 ersetzt, was zwar eine höhere Qualität liefert, aber den VRAM-Verbrauch verdoppelt.&lt;br /&gt;
* Texel padding (default atlas packer): Legt fest, wie viele leere Texel zwischen den UV-Layouts von Objekten in Lightmap-Atlas-Texturen hinzugefügt werden sollen, wenn der Standard-Atlas Packer verwendet wird.&lt;br /&gt;
* Texel padding (xatlas packer): Wie oben, nur das stattdessen xatlas verwendet wird.&lt;br /&gt;
* Alpha Meta Pass resolution multiplier: Multipliziert die Auflösung des [[Manual#Alpha_Meta_Pass|Alpha Meta Pass]], wodurch präzise shaderbasierte Cutouts beim Backen von niedrig aufgelösten Lightmaps möglich sind.&lt;br /&gt;
* Volume render mode: Welcher [[Manual#Render_mode|Render-Modus]] soll für alle [[Manual#Bakery_Volume|Volumes]] verwendet werden? Auto verwendet den aktuell aktiven Render-Modus (Standard).&lt;br /&gt;
* Delete previous lightmaps before bake: Löscht alle zuvor gerenderten Lightmap-Dateien dieser Szene, bevor neue gebacken werden.&lt;br /&gt;
* Log level: Legt fest, wie viele Informationen während des Backvorgangs in der Konsole ausgegeben werden. Mögliche Werte:&lt;br /&gt;
** 0: es wird nichts ausgegeben.&lt;br /&gt;
** 1: es werden nur Fortschrittsinformationen ausgegeben.&lt;br /&gt;
** 2: es werden nur Warnungen ausgegeben.&lt;br /&gt;
** 3: es wird alles an Informationen ausgegeben.&lt;br /&gt;
* Alternative scale in lightmap: Bewirkt, dass sich die Renderer-Eigenschaft 'Scale in Lightmap' eher wie das integrierte Unity-Verhalten verhält.&lt;br /&gt;
* Align to texture compression blocks with xatlas: Lässt xatlas Maps an 4x4-Blockgrenzen ausrichten, was zu komprimierungsfreundlicheren Ergebnissen führt.&lt;br /&gt;
* Generate smooth positions: Sollen Sample-Positionen angepasst werden, um falsche Schatten auf Low-Poly-Geometrien mit glatten Normalen zu vermeiden? Kann in sehr seltenen Fällen deaktiviert werden, in denen Geometrie mit stark abweichenden Normalen verwendet wird. Lesen Sie [https://ndotl.wordpress.com/2018/08/29/baking-artifact-free-lightmaps/#shadowterm diesen Artikel] für eine technische Erklärung.&lt;br /&gt;
* Smooth positions per-triangle: Sollen glatte/flache Positionen pro Dreieck festgelegt werden? Kann in sehr seltenen Fällen deaktiviert werden, in denen Geometrie mit stark abweichenden Normalen verwendet wird.&lt;br /&gt;
* Use 'Receive GI' values: Berücksichtigt 'Receive Global Illumination'-Werte von Renderern. Ursprünglich wurde dies von Bakery ignoriert.&lt;br /&gt;
* Remove ringing in Legacy light probes: Ermöglicht eine weichere Light Probes-Faltung im Legacy Modus, um Artefakte in kontrastreichen Bereichen zu vermeiden.&lt;br /&gt;
* Always render reflection probes: Automatisch nach jedem Render/Render Light Probes-Vorgang Reflection Probes rendern.&lt;br /&gt;
* Ringing removal for L2 light probes: Wendet De-Ringing auf [[Manual#Light_probe_mode|L2 Light Probes]] an. Je höher der Wert, desto weicher ist die Beleuchtung von Probes. Diese Glättung reduziert [https://docs.unity3d.com/6000.2/Documentation/Manual/light-probes-troubleshooting.html Ringing]-Artefakte (falls vorhanden).&lt;br /&gt;
* Put menu under Tools: Verschiebt den Bakery Menüeintrag under den Tools Menüeintrag.&lt;br /&gt;
&lt;br /&gt;
Falls ein Format auf Asset eingestellt und Mipmapping aktiviert ist, wird eine zusätzliche Einstellung angezeigt:&lt;br /&gt;
* Maximum mipmap count: Legt die maximale Anzahl von Mipmaps fest. Beispiel: Bei einem Wert von 2 verfügt eine 8K-Lightmap nur über zwei zusätzliche Mipmaps: 4K und 2K. Niedrigere Auflösungen werden weggelassen, wodurch das Auftreten von Leak-Artefakten beim Mipmapping begrenzt wird.&lt;br /&gt;
&lt;br /&gt;
= Skinned mesh renderer support =&lt;br /&gt;
&lt;br /&gt;
Bakery unterstützt Skinned Meshes seit v1.65. Es gibt jedoch einige Einschränkungen:&lt;br /&gt;
* Einige Versionen von Unity unterstützen UV1 auf Skinned Meshes nicht und ignorieren daher &amp;quot;Generate lightmap UVs&amp;quot;. Stellen Sie sicher, dass das in Ihrer Szene verwendete Mesh über UV1 verfügt, und verwenden Sie nach Möglichkeit nicht überlappende UV0.&lt;br /&gt;
* Die Anpassung des UV-Paddings funktioniert nicht bei Skinned Meshes (Unity scheint beim Versuch, die Unwrap-Funktion auf sie anzuwenden, abzustürzen);&lt;br /&gt;
* Skinned Meshes können keine pro-Vertex Lightmaps besitzen (die Engine bietet keine Unterstützung für additionalVertexStreams mit skinning).&lt;br /&gt;
&lt;br /&gt;
= Shader Tweaks =&lt;br /&gt;
[[File:Image2.jpg|thumb|Links: standard bilineare Filterung. Rechts: bikubische Filterung.]]&lt;br /&gt;
[[File:Image34.jpg|thumb|Links: beide Schatten sind gebacken.&amp;lt;br&amp;gt;&lt;br /&gt;
Mitte: der sphärische Schatten ist dynamisch, während der andere Schatten statisch ist. Zusammen wurden sie mit Multiplikation kombiniert.&amp;lt;br&amp;gt;&lt;br /&gt;
Rechts: wie in der Mitte, jedoch kombiniert mit dem Standard-Minimum.]]&lt;br /&gt;
Bakery bietet optionale Shader-Modifikationen, die auf Unity Shader angewendet werden können, um das Sampling von Lightmaps zu verbessern und die Echtzeitbeleuchtung besser an Lightmaps anzupassen. Das Menü zur Anpassung der Shader kann über Bakery-&amp;gt;Shader Tweaks aufgerufen werden.&lt;br /&gt;
&lt;br /&gt;
Diese Optionen patchen die Basis-Unity Shader-Includes (aus dem Ordner CGIncludes), die von den meisten integrierten und Drittanbieter-Shadern verwendet werden. Alle vorgenommenen Änderungen werden sich auf alle Projekte, die in Zukunft mit dieser Version des Editors geöffnet werden, auswirken, können jedoch leicht rückgängig gemacht werden. Shader-Optimierungen beeinflussen die Funktionsweise von Standard- und Surface Shadern. HDRP, URP und andere SRPs sind davon nicht betroffen.&lt;br /&gt;
&lt;br /&gt;
Alle verfügbaren Modifikationen werden als Schaltflächen angezeigt. Klicken Sie auf eine Schaltfläche, um die dazugehörige Änderung anzuwenden. Klicken Sie erneut auf die Schaltfläche, um die Änderung rückgängig zu machen. Derzeit verfügbare Optionen:&lt;br /&gt;
&lt;br /&gt;
{{note| Möglicherweise müssen Sie den Unity Editor als Administrator ausführen, damit das patchen von CGIncludes funktioniert.}}&lt;br /&gt;
&lt;br /&gt;
* Use bicubic interpolation for lightmaps: Anstelle der standardmäßigen bilinearen Interpolation wird eine bikubische Interpolation verwendet. Diese Optimierung behebt viele, die von niedrig aufgelösten Lightmaps produzierten gezackten Kanten ziemlich gut. Funktioniert derzeit nur auf DX11 und modernen Konsolen, weshalb andere Plattformen weiterhin bilinear verwenden werden.&lt;br /&gt;
&lt;br /&gt;
* Use multiplication for shadowmask: Kombiniert statische und dynamische Schatten mithilfe von Multiplikation anstelle von Minimum. Aus unbekannten Gründen hat Unity beschlossen, standardmäßig den Minimaloperator zu verwenden - was zu Artefakten führt, die bei der Multiplikation nicht auftreten.&lt;br /&gt;
&lt;br /&gt;
* Use physical light falloff (forward): Ersetzt den gewöhnlichen Lichtabfall von Echtzeit-Punkt/Spotlichtern durch einen physikalisch korrekteren invers-quadratischen Abfall. “Range” wird nur an den Rändern leicht ausgeblichen (entspricht Bakery-Lichter mit aktiviertem Physical Falloff-Kontrollkästchen). Beeinflusst nur den Forward Renderer. Lesen Sie den Artikel [[Point Light Attenuation]] für weitere Details.&lt;br /&gt;
&lt;br /&gt;
* Use physical light falloff (deferred): Wie oben, aber nur der Deferred Renderer wird beeinflusst.&lt;br /&gt;
&lt;br /&gt;
'''Falloff-Optimierungen funktionieren möglicherweise nicht vollständig in Unity-Versionen &amp;gt; 2017. SRPs besitzen standardmäßig einen korrekten Lichtabfall.'''&lt;br /&gt;
&lt;br /&gt;
= Bakery shaders =&lt;br /&gt;
Bakery enthält eigene Shader mit Unterstützung für Vertex-Lightmapping sowie die Richtungsmodi RNM und SH. Außerdem unterstützen sie die Berechnung einer ungefähren gebackenen Spiegelung (Specular) aus Richtungsinformationen. &lt;br /&gt;
Bakery Shader werden für normale Lightmaps, Shadowmasks und den Dominant Direction-Modus '''nicht benötigt''', da diese Funktionen von den meisten Unity Shadern unterstützt werden.&lt;br /&gt;
&lt;br /&gt;
=== Standard render pipeline ===&lt;br /&gt;
'''Bakery/Standard''': Erweitert den regulären Standard Shader von Unity um folgende zusätzliche Optionen:&lt;br /&gt;
* Allow Vertex Lightmaps: Ermöglicht die Verwendung dieses Materials für das [[Vertex Lightmaps|Vertex-Lightmapping]].&lt;br /&gt;
* Allow RNM Lightmaps: Ermöglicht die Verwendung dieses Materials mit dem [[#RNM|RNM directional mode]].&lt;br /&gt;
* Allow SH Lightmaps: Ermöglicht die Verwendung dieses Materials mit dem [[#SH|SH directional mode]].&lt;br /&gt;
{{note| Alle “Allow”-Umschaltflächen aktivieren einen bestimmten Code-Pfad im Shader. Aus Leistungsgründen wird empfohlen, in einem Material nur eine “Allow”-Option zu aktivieren.}}&lt;br /&gt;
* Enable Lightmap Specular: Berechnet gebackene Spiegelungen (Specular) anhand von Daten aus den Richtungsmodi Dominant Direction, RNM oder SH directional. Beachten Sie, dass der Effekt aufgrund fehlender Informationen nur sehr ungefähr ist. Das Ergebnis sollte in etwa vergleichbar sein mit gebackener Spiegelung in Unity 4. Am besten sieht er in Kombination mit starken Normal Maps aus, auf flachen Oberflächen hingegen nicht so gut.&lt;br /&gt;
* Enable VertexLM directional: Wenn Vertex Lightmaps vorhanden sind, gibt dies an, dass Dominant Direction-Daten in Eckpunkten (Vertices) gespeichert sind und verwendet werden sollen.&lt;br /&gt;
* Enable VertexLM SH: Wenn Vertex Lightmaps vorhanden sind, gibt dies an, dass SH-Daten in Eckpunkten (Vertices) gespeichert sind und verwendet werden sollen.&lt;br /&gt;
* Enable VertexLM Shadowmask: Wenn Vertex Lightmaps vorhanden sind, gibt dies an, dass die Shadowmask in Eckpunkten (Vertices) gespeichert ist und verwendet werden soll.&lt;br /&gt;
* Enable MonoSH: Behandelt Directional Maps als MonoSH Maps.&lt;br /&gt;
[[File:Image5.png|thumb|Standard SH Light Probe vs. non-linear]]&lt;br /&gt;
[[File:Shspec.jpg|thumb|SH Spiegelungseffekte]]&lt;br /&gt;
* Non-linear SH: Im SH directional mode kann diese Option den Kontrast verbessern (näher an Ground Truth dran), verlangsamt jedoch den Shader etwas. Dieser Trick basiert auf dem [https://drive.google.com/file/d/1MK6Clw93q8ljijRjb4gQOzzaIjn1uF9Y/view “Reconstructing Diffuse Lighting from Spherical Harmonic Data”]-Papier von Geomerics.&lt;br /&gt;
* Non-linear Light Probe SH: Ähnlich wie Non-linear SH, ist aber für Light Probes bestimmt. Im Falle von Probes besteht der größte Vorteil darin, dass falsche negative Werte beseitigt werden. Dieses Problem tritt häufig in kontrastreichen Szenen mit hellen HDR-Lichtquellen auf und ist eine inhärente Einschränkung sphärischer Harmonien und nicht spezifisch für Bakery (d. h. ähnliche Artefakte können auch bei integrierten Lightmappern auftreten).&lt;br /&gt;
* Force Bicubic Filter: Aktiviert die bikubische Filterung für alle zusätzlichen Maps. Für eine vollständige bikubische Filterung (einschließlich der ersten color map) wird empfohlen, diese auch in den [[#Shader Tweaks|Shader Tweaks]] zu aktivieren.&lt;br /&gt;
&lt;br /&gt;
'''Bakery/Standard Specular''': wie Standard, aber für den Specular Workflow bestimmt.&lt;br /&gt;
&lt;br /&gt;
=== HDRP &amp;amp; URP ===&lt;br /&gt;
Um zusätzliche HDRP/URP-Shader zu extrahieren, öffnen Sie die Datei Bakery_ShaderGraphHDRP.unitypackage oder Bakery_ShaderGraphURP.unitypackage, die im Lieferumfang von Bakery enthalten sind. Im Inneren finden Sie Shader Subgraphs, die Sie in Ihren eigenen Shader Graphs verwenden können, sowie einige Beispielmaterialien.&lt;br /&gt;
&lt;br /&gt;
=== Vergleich der Feature-Unterstützung aller Shader ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Die meisten Unity Shader&lt;br /&gt;
! Die meisten HDRP &amp;amp; URP Shader&lt;br /&gt;
! Bakery Standard&lt;br /&gt;
! HDRP Graphs&lt;br /&gt;
! URP Graphs&lt;br /&gt;
|-&lt;br /&gt;
| HDR color lightmaps&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|-&lt;br /&gt;
| Shadowmask&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja (Seit URP 10.1)&lt;br /&gt;
|-&lt;br /&gt;
| Dominant Direction&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|-&lt;br /&gt;
| RNM&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|-&lt;br /&gt;
| SH&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|-&lt;br /&gt;
| MonoSH&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|-&lt;br /&gt;
| Lightmap specular&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja, für Dominant Direction und SH&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja, für Dominant Direction (siehe Link)&lt;br /&gt;
|-&lt;br /&gt;
| Bicubic filtering&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja,&lt;br /&gt;
mithilfe von [[#Shader Tweaks|Shader Tweaks]]&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja,&lt;br /&gt;
mithilfe von [[#Shader Tweaks|Shader Tweaks]]&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
|-&lt;br /&gt;
| Vertex lightmaps&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Nur eine Farbe, keine per-vertex SH, direction oder Shadowmasks (Shader Graph-Einschränkung)&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Nur eine Farbe, keine per-vertex SH, direction oder Shadowmasks (shader Graph-Einschränkung)&lt;br /&gt;
|-&lt;br /&gt;
| Non-Linear Light Probes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|-&lt;br /&gt;
| Volumes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|-&lt;br /&gt;
| Volume shadowmask&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|-&lt;br /&gt;
| Compressed volumes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{note| Mit Ausnahme von regulären color lightmaps erfordern alle anderen Optionen mindestens Shader Model 3.0.}}&lt;br /&gt;
{{note| Vertex Lightmaps im SH-Modus erfordern aufgrund der Interpolatorbegrenzung mindestens Shader Model 4.0.}}&lt;br /&gt;
{{note| Aktualisierte URP-Graphen mit Unterstützung für Spiegelungen (Specular) aus Dominant Direction können [[Bakery_-_GPU_Lightmapper|von der Haupt-Wiki-Seite]] heruntergeladen werden.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Lesen Sie auch: [[Integrating_Bakery_shader_features_to_custom_shaders| Integrieren von Bakery Shader-Funktionen in eigene Shader]]&lt;br /&gt;
&lt;br /&gt;
= Hinweise zu HDRP/URP =&lt;br /&gt;
Sobald Bakery in ein HDRP- oder URP-Projekt importiert wurde, kann es in der Regel sofort verwendet werden. Es gilt jedoch einige Dinge zu beachten:&lt;br /&gt;
&lt;br /&gt;
* Beispielszenen verwenden sowohl reguläre Standard Shader als auch in einigen Fällen &amp;quot;Bakery Standard&amp;quot;-Shader. HDRP und URP bieten zwar einen automatischen Mechanismus zum Aktualisieren von Projekt-Shadern von Standard auf Lit an, dieser ist jedoch nicht mit Bakery Standard kompatibel. Sie müssen daher manuell alle Materialien, die Bakery Standard verwenden, durch die Materialien aus Bakery_ShaderGraphHDRP.unitypackage oder Bakery_ShaderGraphURP.unitypackage ersetzen.&lt;br /&gt;
&lt;br /&gt;
* In HDRP ist die voreingestellte Lichtintensität des HDRI-Himmels etwas hoch (11) und die Himmelsreflexion wird nicht verdeckt. Zusammen mit dem voreingestellten Eye Adaptation-Effekt kann dies dazu führen, dass einige Beispielszenen kaum sichtbar sind, da sie mit viel geringerer Intensität gebacken wurden. Reduzieren Sie in diesem Fall die Lichtintensität des HDRI-Himmels auf 1. Die HDRI-Einstellungen befinden sich normalerweise in Assets/HDRPDefaultResources/DefaultSettingsVolumeProfile.&lt;br /&gt;
&lt;br /&gt;
* Falls Lichter in den Beispielszenen unter HDRP zu hell scheinen sollten, klicken Sie auf &amp;quot;Match real-time to lightmapped&amp;quot; an der Bakery Light-Komponente, um dies zu beheben.&lt;br /&gt;
&lt;br /&gt;
* Verwenden Sie OpenImageDenoise 2 (empfohlen) oder OptiX 7 als Denoiser in HDRP, da diese für hohe Intensitätswerte besser geeignet sind.&lt;br /&gt;
&lt;br /&gt;
* In HDRP können &amp;quot;distance&amp;quot; und reguläre Shadowmasks in der Light-Komponente gewechselt werden, nicht jedoch in den globalen Einstellungen.&lt;br /&gt;
&lt;br /&gt;
* Verwenden Sie beim Skylight nicht die &amp;quot;Match&amp;quot;-Schaltfläche, da HDRP einen sehr spezifischen prozeduralen Himmelsshader verwendet. Backen Sie das Licht stattdessen [[How_do_I...#How_do_I_use_Skylight_with_a_procedural_sky_shader.3F|auf diese Weise]] in ein HDRI ein.&lt;br /&gt;
&lt;br /&gt;
* Es wird empfohlen, bei Verwendung von HDRP den Light Probe-Modus immer auf L2 oder L1 einzustellen, da der Renderer von HDRP nicht für den Legacy-Modus optimiert ist.&lt;br /&gt;
&lt;br /&gt;
* Die neuesten Versionen von HDRP/URP verfügen über einen eigenen IES-Datei-Importierer. Aufgrund der Inkompatibilität der Asset-Typen trennt Unity die Dateien von den mit älteren Versionen gespeicherten Bakery IES-Lichter, sodass diese stattdessen als normale Punktlichter gerendert werden. Die Dateien können erneut hinzugefügt und die Lichter erneut gespeichert werden.&lt;br /&gt;
&lt;br /&gt;
Bakery's Beispielszenen sind für die Built-in Render Pipeline gebaut worden, weshalb einige Schritte erforderlich sind, um sie korrekt in HDRP/URP zu rendern. Hier sind ein paar Tipps; es wird von einem neuen Projekt mit standardmäßigen HDRP/URP-Einstellungen ausgegangen:&lt;br /&gt;
&lt;br /&gt;
=== Beispielszenen in der HDRP anschauen ===&lt;br /&gt;
* Nach dem Importieren von Bakery konvertieren Sie die Built-in-Materialien zu HDRP-Materialien wie folgt: Edit-&amp;gt;Rendering-&amp;gt;Materials-&amp;gt;Convert All Built-in Materials To HDRP.&lt;br /&gt;
* Importieren Sie Bakery_ShaderGraphHDRP.unitypackage in das Projekt, da dies spezielle ShaderGraphen enthält, die erweiterte Bakery-Funktionen implementieren (nicht erforderlich für klassische color/directional/mask lightmaps).&lt;br /&gt;
* Wählen Sie die Datei DefaultSettingsVolumeProfile.asset aus. Ändern Sie im HDRI Sky-Bereich den Wert Exposure Compensation auf 1. Andernfalls ist das standardmäßige HDRP im Vergleich zu den Beispielszenen zu hell, sodass diese aufgrund dieser Belichtungsanpassung völlig schwarz erscheinen.&lt;br /&gt;
* Bei der Auswahl von Lichtern in den Beispielszenen initialisiert HDRP eigene Lichtdaten. Manchmal kann dies dazu führen, dass das Licht sofort viel heller wird. Klicken Sie auf &amp;quot;Match real-time to lightmapped&amp;quot;, um die Synchronisierung durchzuführen.&lt;br /&gt;
* Stellen Sie den Light Probe-Modus vor dem Rendern von Light Probes auf L2 ein.&lt;br /&gt;
* '''example_directional''': Ändern Sie die Shader zu BakeryDirSpecGraph, um Glanzeffekte zu sehen (oder einfach zum normalen HDRP/Lit für nur diffuses Normal Mapping). Entfernen Sie die Kugel, da derzeit kein ShaderGraph existiert, der per-vertex direction unterstützt.&lt;br /&gt;
* '''example_directional_MonoSH''': Ändern Sie die Shader zu BakerySpecMonoSHGraph (oder BakeryMonoSHGraph für eine etwas günstigere Version ohne Glanzeffekte). Entfernen Sie die Kugel, da derzeit kein ShaderGraph existiert, der per-vertex MonoSH unterstützt.&lt;br /&gt;
* '''example_RNM''': Ändern Sie die Shader zu BakeryRNMGraph.&lt;br /&gt;
* '''example_SH''': Ändern Sie die Shader zu BakerySpecSHGraph (oder BakerySHGraph für eine etwas günstigere Version ohne Glanzeffekte). Entfernen Sie die Kugel, da derzeit kein ShaderGraph existiert, der per-vertex SH unterstützt.&lt;br /&gt;
* '''example_mixed_directional_mode''': Für MonoSH/RNM/SH Planes ist ebenfalls ein anderer Graph erforderlich.&lt;br /&gt;
* '''example_lights''': Ändern Sie den Shader der vertex-lightmapped Kugel zu BakeryVertexColorGraph.&lt;br /&gt;
* '''example_prefabs_bake''': Es sind keine weiteren Anpassungen erforderlich.&lt;br /&gt;
* '''example_sectors''': Es sind keine weiteren Anpassungen erforderlich.&lt;br /&gt;
* '''example_shadowmask''': Wählen Sie das DirectLight aus und klicken Sie auf &amp;quot;Match real-time to lightmapped&amp;quot;, um die Helligkeit anzupassen. Setzen Sie bei allen HDRP-Lichtern den Shadowmask-Modus auf Shadowmask. &lt;br /&gt;
* '''example_sponza_day''': Legen Sie OpenImageDenoise 2 (oder Optix 7, falls nicht unterstützt) als bevorzugten Denoiser fest.&lt;br /&gt;
* '''example_sponza_evening''': Legen Sie OpenImageDenoise 2 (oder Optix 7, falls nicht unterstützt) als bevorzugten Denoiser fest.&lt;br /&gt;
* '''example_subtractive''': HDRP unterstützt den Subtractive-Modus nicht.&lt;br /&gt;
* '''example_volumes_simple''': Ändern Sie den Shader vom Zug zu BakeryVolumeSpecGraph (oder BakeryVolumeGraph für eine etwas günstigere Version ohne Glanzeffekte).&lt;br /&gt;
* '''example_volumes_simple_shadowmask''': Shadowmask Volumes werden derzeit für HDRP nicht unterstützt.&lt;br /&gt;
* '''example_volumes_advanced''': Dasselbe wie example_volumes_simple.&lt;br /&gt;
* '''example_translucency''': Der Großteil der Szene sollte normal erscheinen. Stellen Sie den Shader für das Objekt &amp;quot;Dynamic sphere lit by volume&amp;quot; auf BakeryVolumeGraph ein.&lt;br /&gt;
&lt;br /&gt;
=== Beispielszenen in der URP anschauen ===&lt;br /&gt;
* Nach dem Importieren von Bakery konvertieren Sie die Built-in-Materialien zu URP-Materialien wie folgt: Öffnen Sie den Ordner &amp;quot;content&amp;quot; unter Assets/Bakery/examples/ und wählen Sie alle darin enthaltenen Materialien aus, indem Sie &amp;quot;t:material&amp;quot; im Suchfeld eingeben und den Suchvorgang auf den Ordner beschränken. Klicken Sie dann auf Edit-&amp;gt;Rendering-&amp;gt;Materials-&amp;gt;Convert Selected Built-in Materials To URP.&lt;br /&gt;
* Importieren Sie Bakery_ShaderGraphURP.unitypackage in das Projekt, da dies spezielle ShaderGraphen enthält, die erweiterte Bakery-Funktionen implementieren (nicht erforderlich für klassische color/directional/mask lightmaps).&lt;br /&gt;
* '''example_directional''': Ändern Sie die Shader zu BakeryURPLit und aktivieren Sie &amp;quot;Bakery Lightmapped Specular&amp;quot; (oder einfach zum normalen URP/Lit für nur diffuses Normal Mapping). Entfernen Sie die Kugel, da derzeit kein ShaderGraph existiert, der per-vertex direction unterstützt.&lt;br /&gt;
* '''example_directional_MonoSH''': Ändern Sie die Shader zu BakeryURPLit, stellen Sie den Bakery Mode auf MonoSH ein und aktivieren Sie &amp;quot;Bakery Lightmapped Specular&amp;quot;. Aktivieren Sie außerdem &amp;quot;Per-vertex&amp;quot; an der vertex-lit Kugel.&lt;br /&gt;
* '''example_RNM''': Ändern Sie die Shader zu BakeryURPLit, stellen Sie den Bakery Mode auf RNM ein und aktivieren Sie &amp;quot;Bakery Lightmapped Specular&amp;quot;.&lt;br /&gt;
* '''example_SH''': Ändern Sie die Shader zu BakeryURPLit, stellen Sie den Bakery Mode auf SH ein und aktivieren Sie &amp;quot;Bakery Lightmapped Specular&amp;quot;. Entfernen Sie die Kugel, da derzeit kein ShaderGraph existiert, der per-vertex SH unterstützt.&lt;br /&gt;
* '''example_mixed_directional_mode''': Verwenden Sie hier ebenfalls BakeryURPLit mit einem unterschiedlichen Bakery Mode (MonoSH, RNM, SH). Non-directional / Dominant Direction / Baked Normal Maps können den regulären URP/Lit verwenden.&lt;br /&gt;
* '''example_lights''': Es sind keine weiteren Anpassungen erforderlich.&lt;br /&gt;
* '''example_prefabs_bake''': Es sind keine weiteren Anpassungen erforderlich.&lt;br /&gt;
* '''example_sectors''': Es sind keine weiteren Anpassungen erforderlich.&lt;br /&gt;
* '''example_shadowmask''': Ähnlich wie bei der Built-in Pipeline, müssen Sie die Option Distance Shadowmask im Bakery-Fenster (oder in den Quality Settings des Projekts) deaktivieren, um die tatsächliche gebackene/Echtzeit-Schattenmischung in der Nähe der Kamera sehen zu können.&lt;br /&gt;
* '''example_sponza_day''': Aktivieren Sie Alpha Clipping am Laubmaterial.&lt;br /&gt;
* '''example_sponza_evening''': Dasselbe wie example_sponza_day.&lt;br /&gt;
* '''example_subtractive''': Es sind keine weiteren Anpassungen erforderlich.&lt;br /&gt;
* '''example_volumes_simple''': Ändern Sie den Shader vom Zug zu BakeryURPLit und schalten Sie den Bakery Mode auf Volume. Optional können Sie &amp;quot;Bakery Lightmapped Specular&amp;quot; aktivieren.&lt;br /&gt;
* '''example_volumes_simple_shadowmask''': Dasselbe wie example_volumes_simple, aber mit zusätzlich aktivierter &amp;quot;Volume Shadowmask&amp;quot;.&lt;br /&gt;
* '''example_volumes_advanced''': Dasselbe wie example_volumes_simple.&lt;br /&gt;
* '''example_translucency''': Der Großteil der Szene sollte normal erscheinen. Stellen Sie den Shader für das Objekt &amp;quot;Dynamic sphere lit by volume&amp;quot; auf BakeryURPLit und den Bakery Mode auf Volume ein.&lt;br /&gt;
&lt;br /&gt;
= Aktualisierung von Bakery =&lt;br /&gt;
Bei der Aktualisierung wird empfohlen, die folgenden Schritte auszuführen:&lt;br /&gt;
* Schließen Sie das Bakery-Fenster.&lt;br /&gt;
* Schließen Sie den Unity Editor.&lt;br /&gt;
* Öffnen Sie den Unity Editor erneut und laden Sie Ihr Projekt.&lt;br /&gt;
* Importieren Sie das neue Package.&lt;br /&gt;
&lt;br /&gt;
Beachten Sie, dass der Import ohne vorheriges Schließen von Unity aufgrund gesperrter DLL-Dateien fehlschlagen kann (erkennbar an Konsolenbenachrichtigungen wie &amp;quot;alphabuffergen.dll: Access is denied.&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
Wenn Sie die Bakery-Ordner (Assets/Bakery und Assets/Editor/x64/Bakery) an einen anderen Speicherort verschoben haben, müssen Sie diese möglicherweise vor der Aktualisierung zurückverschieben, um zu verhindern, dass zwei miteinander in Konflikt stehende Kopien des Pakets entstehen.&lt;br /&gt;
&lt;br /&gt;
= Scripting-API =&lt;br /&gt;
&lt;br /&gt;
==Grundlegende Verwendung==&lt;br /&gt;
&lt;br /&gt;
Rendereinstellungen abrufen und ändern:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ftLightmapsStorage storage = ftRenderLightmap.FindRenderSettingsStorage();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Eine vollständige Liste aller verfügbaren Einstellungen können in der Datei ftLightmapsStorage.cs eingesehen werden.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Lightmapper-Instanz abrufen und Einstellungen (neu)laden:&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap bakery = ftRenderLightmap.instance != null ? ftRenderLightmap.instance : new ftRenderLightmap();&lt;br /&gt;
bakery.LoadRenderSettings();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Lightmaps rendern (sowie Probes, wenn sie auf den Modus L1 oder L2 eingestellt sind):&lt;br /&gt;
&amp;lt;pre&amp;gt;bakery.RenderButton(bool showMsgWindows)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Nur Light Probes rendern:&lt;br /&gt;
&amp;lt;pre&amp;gt;bakery.RenderLightProbesButton(bool showMsgWindows)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Nur Reflection Probes rendern:&lt;br /&gt;
&amp;lt;pre&amp;gt;bakery.RenderReflectionProbesButton(bool showMsgWindows)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''showMsgWindows''' gibt an, ob Dialogfelder/Bestätigungsfenster angezeigt werden können. Wird unterdrückt, wenn auf false gesetzt.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Überprüfen, ob gerade ein Backvorgang läuft:&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.bakeInProgress&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Beispiele für die Verwendung finden Sie im [[Community_extensions#Batch_scene_baker|Batch Scene Baker]]-Skript.&lt;br /&gt;
&lt;br /&gt;
==Zusätzliche functions==&lt;br /&gt;
&lt;br /&gt;
Kopiert alle Rendereinstellungen von einem ftLightmapsStorage in einen anderen:&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmapsStorage.CopySettings(ftLightmapsStorage src, ftLightmapsStorage dest)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ruft das globale (projektbezogene) Speicherobjekt ab:&lt;br /&gt;
&amp;lt;pre&amp;gt;ftGlobalStorage gstorage = ftLightmaps.GetGlobalStorage()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Kopiert alle Rendereinstellungen aus ftLightmapsStorage (pro Szene) nach ftGlobalStorage (pro Projekt):&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmapsStorage.CopySettings(ftLightmapsStorage src, ftGlobalStorage dest)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Kopiert alle Rendereinstellungen aus ftLightmapsStorage (pro Projekt) nach ftGlobalStorage (pro Szene):&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmapsStorage.CopySettings(ftGlobalStorage src, ftLightmapsStorage dest)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ruft den Pfad zum Ordner, der die Binärdateien von Bakery enthält, ab:&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmaps.GetEditorPath()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Zusätzliche Variablen==&lt;br /&gt;
&lt;br /&gt;
Ruft den aktuellen Pfad der temporären Dateien ab (es muss zuvor eine ftRenderLightmap-Instanz erstellt worden sein):&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.scenePath&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ruft die Datenkomprimierung des UVGBuffers ab bzw. legt sie fest (LZ4, falls aktiviert; DDS, falls nicht):&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.compressedGBuffer&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ruft die Ausgabe der Lightmap-Datenkomprimierung ab bzw. legt sie fest (LZ4, falls aktiviert; DDS, falls nicht):&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.compressedOutput&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Events==&lt;br /&gt;
&lt;br /&gt;
Skripte können statische Ereignisse in der Klasse ftRenderLightmap abonnieren.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Wird aufgerufen, bevor ein vollständiger Rendervorgang gestartet wird:&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnPreFullRender&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Wird aufgerufen, bevor jede Light Probe im Legacy Light Probe-Modus gerendert wird. ProbeEventArgs ist eine Struktur, die das Feld '''pos''' mit der aktuellen Position der Light Probe enthält:&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler&amp;lt;ProbeEventArgs&amp;gt; OnPreRenderProbe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Wird aufgerufen, nachdem Legacy Light Probes gerendert wurden:&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnFinishedProbes&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Wird aufgerufen, nachdem ein vollständiger Rendervorgang fertiggestellt wurde:&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnFinishedFullRender&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Wird aufgerufen, bevor Reflection Probes gerendert werden:&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnPreReflectionProbeRender&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Wird aufgerufen, nachdem Reflection Probes gerendert wurden:&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnFinishedReflectionProbes&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mr F</name></author>
		
	</entry>
	<entry>
		<id>https://geom.io/bakery/wiki/index.php?title=Benutzerhandbuch&amp;diff=1852</id>
		<title>Benutzerhandbuch</title>
		<link rel="alternate" type="text/html" href="https://geom.io/bakery/wiki/index.php?title=Benutzerhandbuch&amp;diff=1852"/>
		<updated>2026-01-03T20:17:48Z</updated>

		<summary type="html">&lt;p&gt;Mr F: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!-- This box simply informs German users that a) this Manual was translated from English into German, b) it may be outdated due to frequent updates, c) users should read the original English version for a more up-to-date edition. --&amp;gt;&lt;br /&gt;
{{note| Dieses Benutzerhandbuch wurde aus dem Englischen ins Deutsche übersetzt. Es kann unter Umständen veraltete Informationen enthalten, da Bakery stetig weiterentwickelt wird. Für eine aktuellere Version, lesen Sie bitte die [[Manual|englische Originalfassung]].}}&lt;br /&gt;
&lt;br /&gt;
== Systemanforderungen ==&lt;br /&gt;
Um Bakery nutzen zu können, benötigen Sie:&lt;br /&gt;
* Windows (7 oder höher).&lt;br /&gt;
* eine NVIDIA GPU. Minimal unterstütztes Modell ist Kepler (GeForce 650 oder neuer; Für Quadro-Karten überprüfen Sie bitte die jeweiligen Spezifikationen).&lt;br /&gt;
* einen 64-bit Unity Editor. Bakery wurde auf allen Versionen - von 5.6 bis 6000.X und höher - getestet.&lt;br /&gt;
&lt;br /&gt;
{{note| Die Systemanforderungen gelten nur für die Entwicklerumgebung, nicht für die anvisierte(n) Zielplattform(en). Mit Bakery gebackene Lightmaps können überall verwendet werden.}}&lt;br /&gt;
&lt;br /&gt;
== Bevor Sie beginnen... ==&lt;br /&gt;
* ... stellen Sie bitte sicher, dass Ihr Unity Projekt keine Skriptkompilierungsfehler enthält, da diese auch die Kompilierung von Bakery-Skripten verhindern.&lt;br /&gt;
* ... stellen Sie ebenfalls sicher, dass Sie den aktuellsten Grafiktreiber für Ihre Karte installiert haben. [https://www.nvidia.com/Download/index.aspx?lang=en-US Aktualisieren Sie Ihren Grafiktreiber], falls nötig.&lt;br /&gt;
&lt;br /&gt;
'''Wichtig: Verwenden Sie den GeForce Game Ready-Treiber (Standard) anstelle des NVIDIA Studio-Treibers.'''&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
1. Importieren Sie Bakery über den [https://assetstore.unity.com/packages/tools/level-design/bakery-gpu-lightmapper-122218 Asset Store] in Ihr Projekt.&lt;br /&gt;
&lt;br /&gt;
2. Unity wird Ihnen eine Liste an Dateien, die zu importieren sind, anzeigen. Wenn Sie Bakery zum ersten Mal verwenden, empfehlen wir Ihnen den einfachen Klick auf '''Import'''. Erfahrene Benutzer möchten zuvor möglicherweise noch den Ordner ''examples'' exkludieren, um eine schlankere Installation zu erhalten.&lt;br /&gt;
&lt;br /&gt;
Die Dateien werden in die Ordner Assets/Bakery und Assets/Editor/x64/Bakery kopiert. Beide Ordner können später verschoben werden.&lt;br /&gt;
&lt;br /&gt;
3. Unity importiert nun Bakery und kompiliert die Skripte. Es wird eventuell folgendes Fenster angezeigt:&lt;br /&gt;
&lt;br /&gt;
[[File:Goahead.png]]&lt;br /&gt;
&lt;br /&gt;
In diesem Fall können Sie einfach auf &amp;quot;Go Ahead&amp;quot; klicken.&lt;br /&gt;
&lt;br /&gt;
Sie sollten jetzt den Menüeintrag von Bakery am oberen Bildschirmrand sehen:&lt;br /&gt;
&lt;br /&gt;
[[File:bmenu.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Schnellstart ==&lt;br /&gt;
&lt;br /&gt;
1. Platzieren Sie ein beliebiges 3D-Modell oder Unity Primitive in Ihre Szene und markieren Sie es als Static.&lt;br /&gt;
&lt;br /&gt;
'''Meshes dürfen für das Lightmapping keine überlappenden UV-Bereiche vorweisen. Der UV2-Kanal wird, sofern vorhanden, verwendet (andernfalls UV1). Sollten Sie Ihre 3D-Modelle nicht für das Lightmapping vorbereitet haben, müssen Sie die Einstellung [https://docs.unity3d.com/Manual/LightingGiUvs-GeneratingLightmappingUVs.html Generate Lightmap UVs] am Asset aktivieren.''' Unity Primitives besitzen bereits valide UV2-Kanäle.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Staticmarked.jpg|320px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Wählen Sie das Directional Light (das, was von Unity bereits erstellt wurde) aus und fügen Sie ihm eine '''Bakery Direct Light'''-Komponente hinzu.&lt;br /&gt;
{{note| Bakery und Unity nutzen jeweils separate Lichtquellen-Komponenten.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Das Bakery Direct Light bietet viele verschiedene Einstellungsmöglichkeiten, aber es ist sehr einfach, die Komponente an das Unity-eigene Licht anzugleichen. Klicken Sie hierfür auf '''Match lightmapped to real-time'''. Nun sollte das Bakery Direct Light die gleiche Lichtfarbe besitzen wie Unity’s Directional Light.&lt;br /&gt;
&lt;br /&gt;
[[File:Matching.jpg|640px]]&lt;br /&gt;
&lt;br /&gt;
{{note| Die Direct Light-Komponente könnte eine Warnung anzeigen, dass das Projekt keine lineare Lichtintensität verwendet. Das Problem besteht darin, dass Unity standardmäßig die Gammakorrektur auf die Farben der Lichtquellen [https://twitter.com/guycalledfrank/status/1001108508614553600 falsch anwendet]. Der richtige Modus kann per [https://docs.unity3d.com/ScriptReference/Rendering.GraphicsSettings-lightsUseLinearIntensity.html Skript] aktiviert werden, was mithilfe der Schaltfläche “Fix” geschiet. Wenn Sie bereits viele Lichtquellen im nicht-linearen Intensitätsmodus eingerichtet haben und diese nicht erneut ändern möchten, können Sie die Korrektur überspringen. Die Änderungen, die durch den “Fix” verursacht wurden, können jederzeit wieder rückgängig gemacht werden.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Um eine Umgebungsbeleuchtung mit Schatten zu erzielen, müssen Sie zuerst ein Skylight erstellen (Bakery-&amp;gt;Create-&amp;gt;Skylight).&lt;br /&gt;
&lt;br /&gt;
[[File:Menusky.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Wählen Sie das Skylight aus, weisen Sie es eine bläuliche Farbe zu und klicken Sie auf '''Match scene skybox to this light'''. Dadurch wird die Beleuchtung der Skybox genau angepasst.&lt;br /&gt;
{{note| Das Anpassen der Skybox an das Bakery Skylight ist optional, aber für die Korrektheit sinnvoll. Damit wird sichergestellt, dass die sichtbare Umgebung und die Reflection Probes in der Engine mit der gebackenen Beleuchtung übereinstimmen. Derzeit funktioniert diese Einstellung nur in der Built-In Render Pipeline von Unity.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Skycomp.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Wählen Sie nun Bakery-&amp;gt;Render Lightmap vom oberen Menü aus. Standardmäßig ist der Full Lighting-Modus aktiviert. Dieser berechnet sowohl direkte als auch indirekte Beleuchtung aller Lichter. Wenn Sie Echtzeit-Schatten mit gebackener Beleuchtung kombinieren möchten, ändern Sie die Einstellung auf '''Indirect'''.&lt;br /&gt;
&lt;br /&gt;
[[File:Bakerywindow.jpg]]&lt;br /&gt;
&lt;br /&gt;
{{note| Bakery könnte sich darüber beschweren, dass Sie den veralteten [https://docs.unity3d.com/Manual/LinearLighting.html Gamma-Modus] verwenden, und Ihnen empfehlen, diesen zu ändern. Wenn Ihnen die Qualität der Beleuchtung wichtig ist, wird die Verwendung des linearen Modus dringend empfohlen. Sie können diese Warnung ignorieren, falls Sie bereits ein großes Projekt mit Gamma-Modus eingerichtet haben und es nicht nachträglich ändern möchten oder wenn Sie für mobile Endgeräte entwickeln, die den linearen Modus nicht unterstützen.}}&lt;br /&gt;
&lt;br /&gt;
7. Klicken Sie auf die Schaltfläche '''Render'''.&lt;br /&gt;
&lt;br /&gt;
8. Fertig! Sie sollten nun gebackene Beleuchtung sehen:&lt;br /&gt;
&lt;br /&gt;
[[File:Bakedgi.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Rendereinstellungen ==&lt;br /&gt;
&lt;br /&gt;
Alle Rendereinstellungen können jederzeit über Bakery-&amp;gt;Render Lightmap eingesehen werden. Diese Einstellungen werden für jede Szene gespeichert. Die oberste Option im Bakery-Fenster ermöglicht es Ihnen, zwischen den Einstellungen Simple, Advanced und Experimental zu wechseln, wobei jeder nachfolgende Modus mehr anpassbare Optionen offenlegt. Der einfache Modus (Simple) reicht für die meisten Szenen aus und ist ein guter Einstieg.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render mode ===&lt;br /&gt;
Legt den Typ der zu backenden Lightmaps fest. &lt;br /&gt;
&lt;br /&gt;
===== Full Lighting =====&lt;br /&gt;
Vollständige direkte und indirekte Beleuchtung für alle Bakery-Lichter.&lt;br /&gt;
{{note| Bei Unity Versionen vor 2017.3 müssen Sie, wenn Sie sowohl Unity- als auch Bakery-Komponenten auf demselben GameObject haben, die Unity-Komponente manuell deaktivieren, um eine doppelte Helligkeit zu vermeiden. In neueren Versionen von Unity werden Echtzeit-Lichteffekte für gebackene Lichter automatisch deaktiviert, so wie es auch bei den integrierten Lightmappern der Fall ist.}}&lt;br /&gt;
&lt;br /&gt;
===== Indirect =====&lt;br /&gt;
[[File:Image26.png|thumb|Vergleich der verschiedenen Render-Modi, die von Unity unterstützt werden]]&lt;br /&gt;
Grundlegender Mixed mode. Es wird die Baked Contribution-Auswahl auf jedem Licht überprüft: Wenn die Einstellung auf ''Direct And Indirect'' gesetzt ist, wird das Licht wie im Full Lighting-Modus gebacken. Ist sie stattdessen auf ''Indirect Only'' gesetzt, wird nur der indirekte Beitrag (GI) dieses Lichts gebacken. Im letzteren Fall sollten Sie sowohl Unity- als auch Bakery-Lichter auf dem GameObject belassen, wobei eines einen direkten Echtzeitbeitrag leistet und das andere für vorab berechnete GI zuständig ist.&lt;br /&gt;
&lt;br /&gt;
[[File:Indirectonly.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== Shadowmask =====&lt;br /&gt;
[[File:Image21.png|thumb|Links: vollständig gebackenes Licht. Mitte: dynamisches Licht mit gebackener Beleuchtung. Rechts: der Schatten der Capsule sowie die Unebenheiten (bump) und Spiegelungen (specular) von Oberflächen sind dynamisch, während der Schatten des Cube und die Beleuchtung gebacken sind.]]&lt;br /&gt;
[[File:Image6.png|thumb|Wenn die Kamera weit genug entfernt ist oder dynamische Schatten deaktiviert sind, sieht dieselbe Szene wie folgt aus]]&lt;br /&gt;
Ein etwas fortgeschrittenerer Mixed mode. Er funktioniert durch die Erzeugung von zwei Arten von Lightmaps - eine mit gebackenen Farben (wie im Indirect mode) und eine weitere mit Schatten von statischen Objekten. Dies hat einige Vorteile:&lt;br /&gt;
* Echtzeit-Schatten können nur von einer Handvoll dynamischer Objekte erzeugt werden, nicht von der gesamten Szene.&lt;br /&gt;
* Echtzeit- und gebackene Schatten verschmelzen ordnungsgemäß miteinander.&lt;br /&gt;
* Echtzeit-Lichter können Bump-, Specular- und andere Oberflächeneffekte wiedergeben, während sie weiterhin durch hochwertige gebackene Schatten verdeckt werden.&lt;br /&gt;
[https://docs.unity3d.com/Manual/LightMode-Mixed-Shadowmask.html Mehr Informationen]&lt;br /&gt;
&lt;br /&gt;
Um dieses Verhalten zu aktivieren, müssen Sie sowohl Unity- als auch Bakery-Lichter auf demselben GameObject haben und Baked Contribution muss auf ''Shadowmask and Indirect'' eingestellt sein. Nicht markierte Lichter werden wie im Indirect mode gebacken.&lt;br /&gt;
&lt;br /&gt;
[[File:Smask22.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== Distance Shadowmask =====&lt;br /&gt;
Dieses Kontrollkästchen ist nur sichtbar, wenn Sie Shadowmask ausgewählt haben. Es schaltet die [https://docs.unity3d.com/Manual/LightMode-Mixed-ShadowmaskMode.html gleichnamige Einstellung] in den Quality Settings des Projekts um.&lt;br /&gt;
[https://docs.unity3d.com/Manual/LightMode-Mixed-DistanceShadowmask.html Mehr Informationen.]&lt;br /&gt;
{{note| Das Kontrollkästchen ist in Unity 5.6.x aufgrund fehlender Skript-API nicht sichtbar. Stattdessen können Sie die Einstellung unter Window-&amp;gt;Lighting-&amp;gt;Mixed Lighting-&amp;gt;Lighting Mode ändern.}}&lt;br /&gt;
{{note| In Versionen von Unity &amp;lt; 2017.3 werden aufgrund von API-Einschränkungen beim Rendern von Shadowmask-Lightmaps in der Szene platzierte Light Probes zurückgesetzt. Diese müssen nach dem Backvorgang erneut berechnet werden. In neueren Versionen sollte dies nicht mehr vorkommen.}}&lt;br /&gt;
&lt;br /&gt;
===== Subtractive =====&lt;br /&gt;
Aktiviert den [https://docs.unity3d.com/Manual/LightMode-Mixed-Subtractive.html Subtractive] Beleuchtungsmodus. &lt;br /&gt;
&lt;br /&gt;
Diese Einstellung hat keine besonderen Auswirkungen auf Lightmaps und funktioniert genau wie Full Lighting.&lt;br /&gt;
&lt;br /&gt;
Der einzige Unterschied besteht darin, dass sie auch Echtzeit-Lichter von Unity für den subtraktiven Modus einrichtet (da dies über die Benutzeroberfläche nicht möglich ist).&lt;br /&gt;
&lt;br /&gt;
Sie müssen zusätzlich globale subtraktive Parameter (wie die globale Schattenfarbe) in Unity’s [https://docs.unity3d.com/Manual/GlobalIllumination.html#MixedLighting Lighting Fenster] einrichten. .&lt;br /&gt;
&lt;br /&gt;
===== Ambient Occlusion Only =====&lt;br /&gt;
Es wird nur die Umgebungsverdeckung (AO) gebacken. Kann nützlich sein, wenn Sie wissen, was Sie tun. Stellen Sie sicher, dass die [[#Ambient_occlusion|AO Einstellungen]] eingerichtet wurden.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Directional mode ===&lt;br /&gt;
[[File:Image3.png|thumb|Vergleich verschiedener Richtungsmodi]]&lt;br /&gt;
Legt fest, wie Richtungsinformationen eingebettet werden. Standardmäßige Lightmaps speichern nur eine einzige Farbe pro Texel, während Lightmaps mit Richtungsinformationen den Shadern einen Hinweis darauf geben, wie sich die Beleuchtung über eine Halbkugel um das Texel herum verändert. Diese Daten sind erforderlich, um vollständig belichtete Bereiche mit Normal Maps zu kombinieren. Durch das Einbinden in den integrierten [[#Bakery_shaders|Bakery Shader]] kann ebenfalls eine ungefähre Spiegelungsreaktion erzeugt werden.&lt;br /&gt;
&lt;br /&gt;
===== None =====&lt;br /&gt;
Keine Richtungsdaten, eine Farbe pro Texel.&lt;br /&gt;
&lt;br /&gt;
===== Baked Normal Maps =====&lt;br /&gt;
Immer noch keine Richtungsdaten, aber Normal Maps werden beim Rendern der Lightmap berücksichtigt. Es gibt keinen zusätzlichen Laufzeit-Overhead. Da Lightmaps in der Regel eine geringere Auflösung als Normal Maps haben, kann das Ergebnis unscharf aussehen. Weitere Probleme sind Aliasing in der Ferne aufgrund fehlendes Mipmapping und eine mögliche Verwischung von Details durch die Rauschunterdrückungsprozedur (Denoising). Um zu erfahren, wie Sie in diesem Modus benutzerdefinierte Shader mit prozeduralen Normalen verwenden können, lesen Sie den Abschnitt [[#Normal_mapping|Normal Mapping]].&lt;br /&gt;
&lt;br /&gt;
===== Dominant Direction =====&lt;br /&gt;
Dieser Modus ähnelt dem, was Enlighten und Progressive in Unity backen. Er ist mit den meisten Shadern kompatibel, generiert nur eine zusätzliche Map und der Laufzeit-Overhead ist minimal. Der Nachteil ist, dass das Bump Mapping eher blass und grau wirkt und sich deutlich von demselben Objekt unter Echtzeitbeleuchtung unterscheiden kann.&lt;br /&gt;
&lt;br /&gt;
===== RNM =====&lt;br /&gt;
Basierend auf der Radiosity Normal Mapping-Technik, die ursprünglich für HL2 ([https://steamcdn-a.akamaihd.net/apps/valve/2004/GDC2004_Half-Life2_Shading.pdf Folien]) entwickelt und später in vielen weiteren Spielen (z. B. Mirror’s Edge) verwendet wurde. Es werden insgesamt 3 HDR-Maps erzeugt und ist damit der Modus mit dem höchsten Speicherbedarf. Der Laufzeit-Overhead ist immer noch relativ gering. Dieser Modus ist außerdem präziser als Dominant Direction. Er ist besser darin, Oberflächenkontraste wiederzugeben und kann mit farbigem Licht umgehen, welches Normal Maps aus verschiedenen Winkeln beeinflusst.&lt;br /&gt;
&lt;br /&gt;
===== SH =====&lt;br /&gt;
Basierend auf dem “Precomputed Global Illumination in Frostbite” [https://media.contentapi.ea.com/content/dam/eacom/frostbite/files/gdc2018-precomputedgiobalilluminationinfrostbite.pdf Papier]. Dies ist der Modus mit der höchsten Qualität, der einen deutlich besseren Oberflächenkontrast bietet und unterschiedlich gefärbtes Licht aus verschiedenen Richtungen darstellen kann. Erzeugt insgesamt 4 Maps, von denen nur eine HDR ist, und benötigt daher weniger Speicherplatz als RNM. Der Laufzeit-Overhead ist etwas höher als bei RNM.&lt;br /&gt;
&lt;br /&gt;
===== MonoSH =====&lt;br /&gt;
[[File:FY8Ru8hWIAAdYYH.jpg|thumb|Größen/Qualitätsvergleich von Dominant Direction, SH und MonoSH]]&lt;br /&gt;
Wie SH, jedoch unter Verwendung monochromatischer L1-Richtungskoeffizienten. Ähnlich guter Oberflächenkontrast, obwohl unterschiedliche Farben, die aus verschiedenen Richtungen auf ein Texel fallen, nicht genau wiedergegeben werden; für viele Szenen jedoch ausreichend. Es wird nur eine zusätzliche Map generiert, sodass die VRAM-Nutzung/Bandbreite ähnlich ist wie bei Dominant Direction; tatsächlich ist sie sogar noch geringer, da Dominant Direction RGBA-kodierte Maps verwendet, während MonoSH nur RGB benötigt. Die Map wird über das integrierte Richtungs-Lightmap-System gespeist, ''sieht jedoch mit Standard Shadern nicht korrekt aus''. Achten Sie darauf, einen kompatiblen Shader zu verwenden.&lt;br /&gt;
&lt;br /&gt;
===== Einschränkungen =====&lt;br /&gt;
&lt;br /&gt;
* RNM und SH/MonoSH können nur mit dem [[#Bakery_shaders|Bakery Shader]] verwendet werden oder benötigen Anpassungen an Ihren Shadern.&lt;br /&gt;
* Im RNM- und SH-Modus werden keine Standard-Farb-Lightmaps erstellt. Sie müssen entweder den Bakery Shader für alle Materialien in der Szene verwenden oder [[#Bakery_Lightmap_Group_Selector|Lightmap Groups]] einsetzen, um RNM/SH-Objekte von den übrigen zu trennen.&lt;br /&gt;
* RNM- und SH-Maps werden mithilfe von [https://docs.unity3d.com/ScriptReference/MaterialPropertyBlock.html MaterialPropertyBlock] auf Objekte angewendet und werden daher möglicherweise nicht vollständig im Lighting Fenster von Unity angezeigt.&lt;br /&gt;
* Die Modi Dominant Direction, RNM and SH/MonoSH erfordern möglicherweise etwas mehr Samples für GI und Light Meshes, um eine vergleichbare Qualität erzielen zu können.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Texels per unit ===&lt;br /&gt;
[[File:Texelscomp.jpg|thumb|1 vs 10 Texels pro Welteinheit]]&lt;br /&gt;
Ungefähre Anzahl der Lightmap-Texel pro Welteinheit. Beeinflusst die Anzahl und Auflösung der generierten Lightmaps.&lt;br /&gt;
&lt;br /&gt;
Beispielwerte für den Einstieg:&lt;br /&gt;
* Großer Außenbereich (z. B. eine Stadt): 1 - 5&lt;br /&gt;
* Mittlerer Außenbereich (einige Gassen): 10 - 20&lt;br /&gt;
* Hochwertige Innenbeleuchtung: 100&lt;br /&gt;
&lt;br /&gt;
Es wird davon ausgegangen, dass der Maßstab der Szene ungefähr 1 Einheit = 1 Meter beträgt. Eine solche Skalierung wird im Allgemeinen bei der Arbeit in Unity empfohlen, um eine bessere Navigation und Physiksimulation zu erzielen. Wenn Ihre Skalierung anders ist, multiplizieren Sie die Texel entsprechend.&lt;br /&gt;
&lt;br /&gt;
Beachten Sie, dass Texels per unit die Basisauflösung ist, aber jedes Objekt noch zusätzlich mit [https://docs.unity3d.com/Manual/class-MeshRenderer.html Scale in Lightmap] in den Mesh Renderern sowie mit [[#Scale per map type|Scale per map type]] im Bakery Fenster angepasst werden kann.&lt;br /&gt;
&lt;br /&gt;
{{note| Objekte, bei denen Scale in Lightmap auf 0 gesetzt ist, werden nicht gebacken, werfen jedoch weiterhin Schatten und beeinflussen GI.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Max resolution ===&lt;br /&gt;
Maximale Größe der Lightmap. Falls nicht alle Objekte in eine einzelne Lightmap passen (bei gegebenem Texels Per Unit-Wert), werden zusätzliche Lightmaps zugewiesen. Dieselben vier quadratischen Objekte können vier 512x512-Maps oder eine 1024x1024-Map belegen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bounces ===&lt;br /&gt;
[[File:Image36.png|thumb|Beachten Sie, wie mehr Reflexionen zu mehr Licht in geschlossenen Räume führen.]]&lt;br /&gt;
Legt fest, wie oft Lichtstrahlen von Oberflächen reflektiert werden sollen. In der Regel sind niedrige Werte für Außenbereiche (z. B. eine Stadt) ausreichend, während für geschlossene Bereiche (Innenräume, Höhlen) höhere Werte erforderlich sind.&lt;br /&gt;
&lt;br /&gt;
Der Schieberegler ist zwar auf 5 Reflektierungen begrenzt, es ist jedoch möglich, eine beliebige Anzahl von Reflektierungen in das Zahlenfeld einzugeben.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Samples ===&lt;br /&gt;
[[File:Image7.png|thumb|Links: samples = 4, rechts: samples = 16. Zur Veranschaulichung wurde die Rauschunterdrückung (Denoising) deaktiviert.]]&lt;br /&gt;
Beeinflusst die Qualität von GI. Typische Werte liegen zwischen 16 und 32.&lt;br /&gt;
&lt;br /&gt;
{{note| Es ist möglich, eine beliebige Zahl einzugeben, die über dem maximalen Schiebereglerwert liegt. Beachten Sie jedoch, dass diese Zahl die Quadratwurzel der endgültigen Strahlanzahl darstellt - d. h. 32 entspricht 1024 Strahlen, 64 entspricht 4096 Strahlen usw.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GPU Priority ===&lt;br /&gt;
Während die GPU an Lightmaps arbeitet, können das Betriebssystem und andere Software weniger reaktiv werden. Mit dieser Option können Sie ein Gleichgewicht zwischen der Baking-Geschwindigkeit und der Reaktionsfähigkeit des Systems herstellen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render ===&lt;br /&gt;
Backt Lightmaps für alle geöffneten Szenen.&lt;br /&gt;
Wenn [[Manual#Light_probe_mode|Light Probe Mode]] auf L1 oder L2 eingestellt ist, werden auch Light Probes mitgebacken.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Render Light Probes ===&lt;br /&gt;
Backt [https://docs.unity3d.com/Manual/LightProbes.html Light Probes] für alle geöffneten Szenen.&lt;br /&gt;
&lt;br /&gt;
Beachten Sie, dass Sie für korrekte Mixed light Schatten auf dynamischen Objekten im Shadowmask-Modus auch [[Manual#Occlusion_probes|Okklusionsproben]] aktivieren müssen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Render Reflection Probes ===&lt;br /&gt;
Backt [https://docs.unity3d.com/Manual/class-ReflectionProbe.html Reflection Probes] für alle geöffneten Szenen. Diese Schaltfläche dient lediglich der Benutzerfreundlichkeit und ruft die interne Aktualisierungsroutine der Engine für Reflection Probes auf.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update Skybox Probe ===&lt;br /&gt;
Backt globale Diffuse- und Reflection Probes für die aktuelle Skybox. Wie bei &amp;quot;Render Reflection Probes&amp;quot; werden lediglich integrierte Engine-Funktionen aufgerufen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Occlusion probes ===&lt;br /&gt;
Lässt Unity beim Rendern von Light Probes Okklusionsproben mit dem aktuell ausgewählten integrierten Lightmapper backen. Okklusionsproben sind zusätzliche Daten, die in regulären Light Probes gespeichert werden und verhindern, dass dynamische Objekte in schattigen Bereichen beleuchtet werden. Derzeit gibt es keine Möglichkeit, benutzerdefinierte Okklusionsproben in Unity zu erstellen, weshalb Unity’s eigene Lightmapper aufgerufen werden müssen, um diese Aufgabe zu erledigen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Warnings ===&lt;br /&gt;
Diese Optionen validieren die Szene, nachdem eine der Render-Schaltflächen gedrückt wurde, und zeigen Warnungsdialogfelder an, in denen Sie gefragt werden, ob Sie den Backvorgang fortsetzen oder beenden möchten.&lt;br /&gt;
* Suppress all popups: Nach dem Drücken von Render werden keine Dialogfelder mehr angezeigt.&lt;br /&gt;
* UV validation: Überprüft, ob alle Modelle vollständig korrekte Lightmapping UVs aufweisen – insbesondere, ob sie im Bereich von 0 bis 1 liegen und sich nicht überlappen.&lt;br /&gt;
* Overwrite check: Teilt mit, ob und welche Lightmap-Dateien überschrieben werden.&lt;br /&gt;
* Memory check: Gibt einen sehr ungefähren Wert für den benötigten Videospeicher an.&lt;br /&gt;
* Sample count check: Überprüft, ob Lichter, GI oder AO unangemessene Sample-Werte aufweisen, die dazu führen könnten, dass die GPU ihre verfügbaren Ressourcen überschreitet.&lt;br /&gt;
* Lightmapped prefab validation: Validiert Lightmapped Prefabs und benachrichtigt Sie, falls Prefabs überschrieben werden.&lt;br /&gt;
&lt;br /&gt;
== Erweiterte Rendereinstellungen ==&lt;br /&gt;
=== Light probe mode ===&lt;br /&gt;
Ändert die Art und Weise, wie Light Probes gebacken werden.&lt;br /&gt;
&lt;br /&gt;
* Legacy: Verwenden Sie die Schaltfläche Render Light Probes, um Probes zu rendern. Punkt- und direktionale Lichter werden innerhalb des Lightmappers berechnet, während Flächen-/Himmels-/indirekte Beleuchtung durch das Rendern einer Cubemap an jeder Probenposition erfasst wird. Die Ergebnisse werden als [https://docs.unity3d.com/ScriptReference/Rendering.SphericalHarmonicsL2.html sphärische Harmonische der Ordnung L2] gespeichert. Die Nachteile sind eine langsame Cubemap-Rendering-Leistung und mögliche Abweichungen zwischen Lightmaps und Probes in Fällen, in denen Shader in Ihrem Spiel beleuchtete Oberflächen nicht physikalisch darstellen können oder Ihr Projekt für mobile Endgeräte eingerichtet ist (Unity kann hohe Intensitätswerte wegschneiden).&lt;br /&gt;
&lt;br /&gt;
* L1: Light Probes werden zusammen mit Lightmaps gerendert, wenn Sie auf Render klicken. Diese Einstellung bietet eine überlegendere Backleistung und garantiert, dass die Beleuchtung der Proben mit den Lightmaps übereinstimmen. Ergebnisse werden als sphärische Harmonische der Ordnung L1 gespeichert (und können weiterhin von regulären Shadern verwendet werden). Durch Anwendung der Einstellung Non-Linear Light Probe SH im [[#Bakery_shaders|Bakery Shader]] können die Ergebnisse weiter verbessert werden.&lt;br /&gt;
&lt;br /&gt;
* L2: überragende Qualität (vollständige sphärische Harmonische der Ordnung L2). Wie bei L1, werden sie automatisch zusammen mit Lightmaps gerendert. Vernachlässigbare Auswirkungen auf die Leistung im Vergleich zu L1. Sollte mit allen Shadern gut aussehen. Kontrast/Direktionalität/Ringing-Entfernung der Proben kann über Project Settings -&amp;gt; Bakery -&amp;gt; &amp;quot;Ringing removal for L2 light probes&amp;quot; angepasst werden.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Es scheint einen Fehler in Unity 2019.3 zu geben, der verhindert, dass Legacy Light Probe-Farben ordnungsgemäß gespeichert werden, falls die Einstellung [[Manual#Occlusion_probes|Occlusion probes]] aktiviert ist. Der L2-Modus ist jetzt der Standardmodus und wird bei Verwendung von Okklusionsproben empfohlen.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Asset UV Processing ===&lt;br /&gt;
Konfiguriert die UV Padding-Anpassung für Assets. Mögliche Werte:&lt;br /&gt;
* Don't change: Es werden keine Änderungen an Assets vorgenommen.&lt;br /&gt;
* Adjust UV padding: Sucht nach Modellen mit automatisch generierten UVs (“Generate Lightmap UVs” auf dem Asset) und passt diese weiter an, um ein korrektes Padding zwischen den UV-Inseln pro Mesh zu erzielen. Die modellweite Pack Margin in den Importeinstellungen wird ignoriert. Stattdessen werden optimale Werte berechnet, basierend auf der Fläche jedes Meshes und der Auflösung der Lightmap.&lt;br /&gt;
* Adjust UV padding for new meshes only: Wie oben, jedoch werden alle Modelle übersprungen, die zuvor mindestens einmal angepasst wurden.&lt;br /&gt;
* Remove UV adjustments: Hebt alle vorherigen UV-Anpassungen auf und lässt automatisch unwrappte Modelle so aussehen, wie Unity sie ursprünglich unwrappt hat.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser ===&lt;br /&gt;
Legt den gewünschten Denoiser fest. Mögliche Werte:&lt;br /&gt;
* Optix 5: Verwendet den OptiX 5.1 AI-Denoiser (früher bekannt als &amp;quot;Legacy denoiser&amp;quot;). Läuft auf der GPU. Unterstützt auf allen Grafikkarten von [https://en.wikipedia.org/wiki/Kepler_(microarchitecture) Kepler] (GeForce 6xx) bis [https://en.wikipedia.org/wiki/Turing_(microarchitecture) Turing] (Geforce 20xx). Nicht unterstützt auf [https://en.wikipedia.org/wiki/Ampere_(microarchitecture) Ampere] (30xx)-Grafikkarten. OptiX 5.1 verwendet einen statischen Trainingsdatensatz, der darin eingebettet ist, sodass er nicht von der Treiberimplementierung beeinflusst wird.&lt;br /&gt;
* Optix 6: Verwendet den OptiX 6.0 AI-Denoiser (war zuvor die Standardeinstellung). Läuft auf der GPU. Scheint auf Kepler (6xx)-GPUs nicht zu funktionieren, läuft dafür aber auf neueren Modellen - einschließlich Ampere (30xx). Seit Version 6.0 befindet sich der Trainingsdatensatz für den OptiX Denoiser im Grafikkartentreiber. Das Verhalten war vor Treiberversion 442.50 ähnlich wie bei OptiX 5.1; nach diesem Treiber hat NVIDIA jedoch [https://forums.developer.nvidia.com/t/optix7-denoiser-different-results-with-different-version-of-drivers/117989/2 den Datensatz geändert], sodass die Ergebnisse unterschiedlicher ausfallen können. Der aktualisierte Datensatz kann manchmal gitterartige Muster und hellere Kanten erzeugen (die jedoch mit [[Manual#Denoise:_fix_bright_edges|&amp;quot;Denoise: fix bright edges&amp;quot;]] behoben werden können), läuft aber schneller.&lt;br /&gt;
* Optix 7: Verwendet den OptiX 7.2 AI-Denoiser. Verhält sich ähnlich wie OptiX 6.0, wird jedoch möglicherweise besser von Ampere (30xx) unterstützt.&lt;br /&gt;
* OpenImageDenoise: Verwendet Intel Open Image Denoise. Läuft auf der CPU (jede CPU, die SSE 4.1 unterstützt). Kann etwas langsamer als OptiX sein, aber die Qualität ist vergleichbar.&lt;br /&gt;
* OpenImageDenoise2: Verwendet Intel Open Image Denoise 2 im CUDA-Modus. Läuft auf der GPU, die Leistung ist vergleichbar mit OptiX 6/7 und die Qualität ist identisch mit der CPU-Version.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Adjust sample positions ===&lt;br /&gt;
Findet die besten Positionen für die Proben, um Beleuchtungslecks zu vermeiden. Die Details des Algorithmus werden [https://ndotl.wordpress.com/2018/08/29/baking-artifact-free-lightmaps/#leaks hier] beschrieben. In einigen Fällen (in der Regel bei großen Geometrien mit sehr niedriger Polygonanzahl und glatten Normalen) kann es zu falschen Ergebnissen kommen. In diesem Fall können Sie die Funktion deaktivieren.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Unload scenes before render ===&lt;br /&gt;
Entlädt Szenen vor dem Backen, um Videospeicher freizugeben. Komplexere Szenen können allein durch die Anzeige im Editor mehrere Gigabyte VRAM beanspruchen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Denoise ===&lt;br /&gt;
[[File:Image31.png|thumb|Links: Denoising deaktiviert, rechts: Denoising aktiviert.]]&lt;br /&gt;
Wenn aktiviert, wird der Entrauschungsalgorithmus angewendet. Bakery verwendet [https://developer.nvidia.com/optix-denoiser NVIDIA’s AI-Denoiser (OptiX)] oder Intel's Open Image Denoise (falls ausgewählt).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Fix Seams ===&lt;br /&gt;
[[File:Image22.png|thumb|Left: Übergänge, right: Übergänge sind geglättet.]]&lt;br /&gt;
Wenn aktiviert, wird versucht, durch UV-Diskontinuitäten entstandene Übergänge zu glätten. Nützlich für glatte Geometrien - einschließlich der Standardkugel von Unity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Split by scene ===&lt;br /&gt;
Wenn mehrere Szenen gleichzeitig geladen werden und diese Option aktiviert ist, verfügt jede Szene über einen eigenen Satz Lightmaps, der nicht mit anderen geteilt wird. Dies kann hilfreich sein, um die Anzahl der geladenen Texturen zu begrenzen, wenn Szenen während der Laufzeit gestreamed werden.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hole filling ===&lt;br /&gt;
[[File:Holefilling.jpg|thumb|Lochfüllung aus vs. ein.]]&lt;br /&gt;
Wenn [[Manual#Atlas_Packer|Atlas Packer]] auf xatlas eingestellt ist, wird versucht, jedes Loch zu füllen, was zu effizienteren Atlas-Texturen führt. Bei Szenen mit sehr komplexer Geometrie kann dies die Exportzeit der Szene verlängern, ist aber ansonsten empfehlenswert.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Min resolution ===&lt;br /&gt;
Mindestgröße für Lightmaps. Kann verwendet werden, um zwischen vielen kleinen, aber vollständig belegten Lightmaps und wenigen unvollständig gefüllten Lightmaps abzuwägen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Scale per map type ===&lt;br /&gt;
Ermöglicht es Ihnen, die Auflösung von Color/Shadowmask/Direction-Maps unterschiedlich zu skalieren. Ein häufiger Fall wäre beispielsweise eine indirekte Färbung mit niedriger Auflösung, aber einer sehr detaillierten Shadowmask. Beachten Sie, dass die Skalierung erst nach dem Rendern der Lightmaps angewendet wird, sodass keine Zeit beim Baking eingespart wird. Wenn “Adjust UV padding” aktiviert ist, basiert das Padding auf der Map mit der niedrigsten Auflösung, um Texel-Leaking zu verhindern.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Checker preview ===&lt;br /&gt;
[[File:Image12.png|thumb|Checker preview in Aktion]]&lt;br /&gt;
Wenn das Kontrollkästchen Show checker aktiviert ist, rendert die Scene View ein Schachbrettmuster über alle sichtbaren Objekte, um die Größe der Lightmap-Texel anzuzeigen. Dies ist nützlich, um sicherzustellen, dass Sie vor dem Backen angemessene Werte für Texels Per Unit und andere Einstellungen, die sich auf die Auflösung auswirken, verwenden.&lt;br /&gt;
&lt;br /&gt;
Durch das Aktivieren der Checker preview wird Bakery gezwungen, Atlas Packing durchzuführen. Dies kann einige Sekunden dauern. Klicken Sie auf Refresh checker, um die Szene nach einer vorgenommenen Änderung neu zu atlasieren und die Änderungen anzuzeigen.&lt;br /&gt;
&lt;br /&gt;
Checker preview verwendet ebenfalls zufällige Farben, um zu zeigen, wie die Szene in verschiedene Lightmaps aufgeteilt sein wird.&lt;br /&gt;
&lt;br /&gt;
{{note| Checker preview zeigt derzeit keine korrekten Texel-Größen für Terrains an.}}&lt;br /&gt;
&lt;br /&gt;
==== Atlas preview ====&lt;br /&gt;
[[File:FN-TmhRXwAE9i2I.png|thumb|Atlas preview in Aktion]]&lt;br /&gt;
Die Schaltfläche Atlas preview ist sichtbar, wenn die Checker preview aktiviert ist. Durch Anklicken öffnet sich ein neues Fenster, in dem die UV-Layouts zukünftiger Lightmaps angezeigt werden. Sie können mithilfe der &amp;quot;&amp;lt;&amp;quot; und &amp;quot;&amp;gt;&amp;quot; Schaltflächen zwischen den Lightmaps wechseln.&lt;br /&gt;
Dies kann nützlich sein, um vor dem Backen die Packungsqualität und die Anzahl der Lightmaps zu überprüfen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Emissive boost ===&lt;br /&gt;
Multipliziert jede Oberflächenemission mit dieser Zahl.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Indirect boost ===&lt;br /&gt;
Multipliziert alle reflektierten Lichtstrahlen mit diesem Wert. Entspricht der Indirect Intensity-Einstellung bei Licht-Komponenten, gilt jedoch global.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Backface GI ===&lt;br /&gt;
[[File:Image30.jpg|thumb|Backface GI]]&lt;br /&gt;
[[File:Image35.png|thumb|Links: backface GI = 0, rechts: backface GI = 1. Beachten Sie, wie schattige Bereiche mehr grünes Licht erhalten.]]&lt;br /&gt;
Bestimmt, wie viel Licht durch die Vorderfläche zur Rückfläche gelangt und dann von GI reflektiert wird. Dies ist besonders nützlich für dünne, durchscheinende Oberflächen wie Blätter. Die Werte liegen im Bereich von 0 bis 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Ambient occlusion ===&lt;br /&gt;
[[File:Image15.png|thumb|Left: AO intensity = 0. Right: AO intensity = 1.]]&lt;br /&gt;
Einfache nicht-physikalische Umgebungsverdeckung, die Sie aus ästhetischen Gründen über die endgültige Szenenbeleuchtung legen können.&lt;br /&gt;
* Intensity: Steuert die Sichtbarkeit des AO-Effekts. Ein Wert von 0 deaktiviert den Effekt.&lt;br /&gt;
* Radius: Legt die im AO-Effekt verwendete Strahlungsentfernung fest. Kleinere Werte führen zu lokalisierten Verdunkelungen (Ecken, Falten), während höhere Werte eher einem Skylight ähneln und Schatten von weiter entfernten Objekten erzeugen.&lt;br /&gt;
* Samples: Beeinflusst die Qualität der Umgebungsverdeckung. Typische Werte liegen zwischen 4 und 32.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dither transparency ===&lt;br /&gt;
Aktiviert halbtransparente Schatten durch das automatische Dithering von Alpha-Texturen. Lernen Sie, [[Manual#Opacity|wie Bakery Opacity Maps interpretiert]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== RTX Mode ===&lt;br /&gt;
Aktiviert die RTX-Hardwarebeschleunigung. Nur RTX-GPUs profitieren von dieser Einstellung. Die minimal unterstützte Treiberversion ist 418.&lt;br /&gt;
&lt;br /&gt;
Treiber können den RTX-Modus auf den meisten Nicht-RTX NVIDIA-Karten emulieren, aber das Ergebnis ist in der Regel langsamer.&lt;br /&gt;
&lt;br /&gt;
Der RTX-Modus '''muss''' auf Ampere (3xxx) oder neueren Karten aktiviert sein.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Export terrain trees ===&lt;br /&gt;
Wenn diese Einstellung aktiviert ist, beeinflussen Bäume auf Terrain die Beleuchtung. Die Bäume selbst werden nicht gebacken. Beachten Sie, dass beim Backen für jeden Baum die höchstmögliche LOD-Stufe verwendet wird. Daher wird es nicht empfohlen, diese Einstellung für die Darstellung von mehreren Kilometern großen Wäldern mit hochdetaillierten Modellen zu verwenden.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Terrain optimization ===&lt;br /&gt;
Wenn aktiviert (Standard), verwenden Terrains eine separate Raytracing-Technik, um die Vorteile ihrer Höhenfeldgeometrie zu nutzen. Andernfalls werden sie wie jedes andere Mesh behandelt. Terrain optimization reduziert den Speicherbedarf für hochauflösende Landschaften erheblich. In einigen Fällen kann es auch das Backen des Terrains beschleunigen, in anderen Fällen (insbesondere bei einfachen Landschaften mit niedriger Auflösung) kann es sinnvoll sein, sie zu deaktivieren.&lt;br /&gt;
&lt;br /&gt;
{{note| Terrain Optimization ist derzeit nicht mit Terrainlöchern kompatibel. Deaktivieren Sie die Einstellung, damit sie funktionieren.}}&lt;br /&gt;
{{note| Terrain Optimization wird nur im Nicht-RTX-Modus unterstützt.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Light Mesh batch limit ===&lt;br /&gt;
Wenn dieser Wert über 0 liegt, werden mehrere [[Manual#Bakery_Light_Mesh|Light Meshes]] zu einem zusammengefasst, vorausgesetzt, sie haben identische Einstellungen und wirken sich auf dieselben [[Manual#Bakery_Lightmap_Group_Selector|Lightmap Groups]] aus, wobei ihre Gesamtzahl an Samples jedoch auf diesen Wert begrenzt wird (d. h. wenn das Limit 64 beträgt, können 2 Lichter mit Samples=32 oder 4 Lichter mit Samples=16 usw. zusammengefasst werden). Dies erhöht die Leistung in Szenen mit vielen Light Meshes. Achten Sie darauf, diesen Wert nicht zu hoch einzustellen, da ansonsten die GPU bei der Verarbeitung zu vieler Samples gleichzeitig das Zeitlimit des Betriebssystemtreibers erreichen könnte.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Compress volumes ===&lt;br /&gt;
Wenn aktiviert, wird die Texturkomprimierung auf 3D-Volumen-Texturen angewendet und die Bakery Shader werden auf einen entsprechenden Abtastmodus umgeschaltet. Nicht empfohlen für Volumes mit sehr niedriger Auflösung. Die Volumengröße kann auf ein Vielfaches von 4 erhöht werden.&lt;br /&gt;
&lt;br /&gt;
Anmerkungen:&lt;br /&gt;
* Derzeit kann nur in die Texturenformate BC6H/BC7 (Desktop/Konsolen) komprimiert werden.&lt;br /&gt;
* Die Volumenkomprimierung wird nur in Unity 2020.1 oder neuer unterstützt.&lt;br /&gt;
* Derzeit unterstützt nur der Bakery Shader für die Built-In Render Pipeline die Verwendung komprimierter Volumes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Samples multiplier ===&lt;br /&gt;
Multipliziert alle Schatten- und GI-Samples mit dem angegebenen Faktor. Verwenden Sie diese Einstellung, um schnell zwischen Entwurfs- und Endqualität zu wechseln.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Tile size ===&lt;br /&gt;
Wie bei der [[#GPU Priority|GPU Priority]], jedoch legen Sie anstelle der abstrakten Priorität die Kachelgröße fest. Bakery teilt Lightmaps in kleinere Kacheln auf und aktualisiert diese nacheinander. Eine kleinere Größe bedeutet mehr Unterbrechungen in der GPU-Arbeit und kann das System reaktionsfähiger machen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Temp path ===&lt;br /&gt;
Ordner für temporäre Dateien. Bakery benötigt während des Renderns möglicherweise einige Gigabyte freien Speicherplatz. Wenn sich dieser Ordner auf einer SSD befindet, kann das Rendern im Vergleich zu einer HDD etwas schneller erfolgen. Derzeit wird dieser Ordner nicht automatisch bereinigt. Sie können den Inhalt jederzeit (außer während des Renderns) manuell oder über Bakery -&amp;gt; Utilities -&amp;gt; Clear cache löschen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Output path ===&lt;br /&gt;
Ordner für Lightmaps. Hier werden alle Lightmap-, Light Probe- und Vertex-Color Assets gespeichert. Dieser Pfad ist relativ zu Ihrem Assets Ordner.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Use scene named output path ===&lt;br /&gt;
Wenn diese Einstellung aktiviert ist, wird der Ausgabepfad automatisch auf einen Ordner mit dem gleichen Namen wie die aktuell aktive Szene gesetzt (Assets/AktuellerSzenenName/). Dies ähnelt dem Verhalten der integrierten Unity Lightmapper.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render Selected Groups ===&lt;br /&gt;
Backt nur [[#Bakery_Lightmap_Group_Selector|Lightmap Groups]], die ausgewählte Objekte enthalten.&lt;br /&gt;
Nicht nur ausgewählte Objekte werden neu gezeichnet, sondern auch alle Lightmap Groups, zu denen sie gehören. Andere Lightmaps werden nicht aktualisiert. Falls Objekte nicht zu einer manuell zugewiesenen Gruppe gehören, wird ein Teil der Szene, der dieselbe Lightmap verwendet, neu berechnet.&lt;br /&gt;
&lt;br /&gt;
Derzeit ist es praktischer, [[Partial_scene_baking|Sektoren für das teilweise Backen von Szenen zu verwenden]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Beep on finish ===&lt;br /&gt;
Wenn diese Einstellung aktiviert ist, gibt Bakery nach Abschluss des Backvorgangs einen Ton aus.&lt;br /&gt;
&lt;br /&gt;
== Experimentelle Rendereinstellungen ==&lt;br /&gt;
=== Unwrapper ===&lt;br /&gt;
Definiert den zu verwendenden Unwrapper, wenn [[#Asset_UV_Processing|Adjust UV Padding]] aktiviert ist.&lt;br /&gt;
* Default: Standard Unity Unwrapper. Bakery ruft [https://docs.unity3d.com/ScriptReference/Unwrapping.GenerateSecondaryUVSet.html Unwrapping.GenerateSecondaryUVSet] für jedes Mesh mit unterschiedlichen Padding-Parametern auf.&lt;br /&gt;
* xatlas: Verwendet [https://github.com/jpcy/xatlas xatlas] von [https://github.com/jpcy jpcy] - eine modifizierte Version von [https://github.com/Thekla/thekla_atlas thekla_atlas] des Entwicklers [https://github.com/castano Ignacio Castaño]. thekla_atlas wurde im Spiel The Witness ([http://the-witness.net/news/2010/03/graphics-tech-texture-parameterization/ Blog post]) eingesetzt.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Atlas Packer ===&lt;br /&gt;
Wählt den Algorithmus aus, der beim Packen verschiedener Objekt-UV-Layouts in große Lightmap-Atlas-Texturen verwendet werden soll.&lt;br /&gt;
* Default: Originalalgorithmus, den Bakery vor Version 1.7 verwendet hat.&lt;br /&gt;
* xatlas: Verwendet xatlas.&lt;br /&gt;
&lt;br /&gt;
Einige Funktionen werden nur mit einem Atlas Packer unterstützt:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Default&lt;br /&gt;
! xatlas&lt;br /&gt;
|-&lt;br /&gt;
| [[Manual#Bakery_Lightmap_Group_Selector|Override resolution]]&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
|-&lt;br /&gt;
| Efficient LOD packing&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|-&lt;br /&gt;
| [[Manual#Hole_filling|Hole filling]]&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Beachten Sie, dass der Atlas Packer auch für jede Lightmap Group separat ausgewählt werden kann.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Export geometry and maps ===&lt;br /&gt;
Wenn diese Einstellung aktiviert ist, exportiert Bakery die Szene vor dem Rendern in ein für Bakery passendes Format. Falls Sie sich sicher sind, dass die Geometrie und Texturen in der Szene sowie die Einstellungen für die Lightmap-Auflösung nicht geändert wurden (z. B. wenn Sie nur GI- oder Lichteinstellungen angepasst haben), können Sie dieses Kontrollkästchen deaktivieren, um das nächste Rendern zu beschleunigen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update unmodified lights ===&lt;br /&gt;
Wenn diese Einstellung aktiviert ist, berechnet Bakery die Lichtquellen neu, die sich seit dem letzten Rendern nicht verändert haben. Falls Sie nur eine Lichtquelle anpassen und nicht warten möchten, bis alle anderen Lichtquellen neu gerendert werden, können Sie dieses Kontrollkästchen deaktivieren.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update modified lights and GI ===&lt;br /&gt;
Wenn diese Einstellung aktiviert ist, berechnet Bakery GI und die Lichter, die seit dem letzten Rendern geändert wurden, neu.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== UV padding: increase only ===&lt;br /&gt;
Nur sichtbar wenn [[#Asset_UV_Processing|Adjust UV padding]] aktiviert ist. Standardmäßig wird das optimale UV-Padding für ein Modell-Asset nur auf der Grundlage der aktuell geladenen Szenen berechnet. Falls mehrere Instanzen desselben Modells unterschiedliche Lightmap-Auflösungen verwenden, bestimmt die kleinste davon das Padding, sodass der Abstand zwischen den UV-Flächen groß genug ist, um ein Überlappen zu verhindern. Jedoch kann das Backen desselben Modells in zwei verschiedenen isolierten Szenen dazu führen, dass die UVs in den vorherigen Szenen beschädigt werden, während sie für die neue Szene optimiert werden. Dieses Kontrollkästchen verhindert ein solches Verhalten, indem es den Padding-Wert niemals verringert, sodass er immer für die Instanz mit der niedrigsten Auflösung optimiert wird, die jemals gebacken wurde.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoise: fix bright edges ===&lt;br /&gt;
[[File:Image19.png|thumb|Links: Nach der Rauschunterdrückung ist ein heller Rand sichtbar; Rechts: behoben.]]&lt;br /&gt;
Nur sichtbar wenn [[#Denoise|Denoise]] aktiviert ist. Manchmal kann das zur Rauschunterdrückung verwendete neuronale Netz helle Kanten um Schatten herum erzeugen, als wäre ein Schärfeeffekt angewendet worden. Wenn diese Option aktiviert ist, versucht Bakery, diese herauszufiltern. Die Denoising-Phase kann bei Aktivierung etwas langsamer werden.&lt;br /&gt;
&lt;br /&gt;
Diese Funktion kann auch zum Filtern von &amp;quot;fireflies&amp;quot; verwendet werden, d. h. gelegentlich auftretende helle Punkte auf der Lightmap.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Post-packing ===&lt;br /&gt;
Manchmal kann Bakery beim Rendern einer Szene die Lightmap in mehrere Sub-Lightmaps aufteilen, z. B. beim Backen verschiedener LODs oder Terrains.&lt;br /&gt;
Post-packing versucht, die endgültige Atlasanzahl zu minimieren, indem diese Sub-Lightmaps zu einer Textur kombiniert werden.&lt;br /&gt;
Es wird empfohlen, diese Einstellung aktiviert zu lassen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Combine with Enlighten real-time GI ===&lt;br /&gt;
Wenn diese Einstellung aktiviert ist, wird beim Klicken der Schaltfläche Render zunächst versucht, mit Enlighten zu backen, um Echtzeit-GI zu berechnen. Danach erfolgt der reguläre Bakery-Lightmapping-Prozess. Sowohl gebackene als auch Echtzeit-GI werden dann zusammen verwendet.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bake on remote server ===&lt;br /&gt;
Aktiviert [[Network baking|Backen über das Netzwerk]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Presets ===&lt;br /&gt;
Wird derzeit unter den Schaltflächen Render/Update angezeigt, wenn sich die Einstellungen im Experimental-Modus befinden.&lt;br /&gt;
* Klicken Sie auf '''New''', um alle aktuellen Einstellungen in einer Voreinstellungsdatei zu speichern.&lt;br /&gt;
* Standardmäßig sind alle Einstellungen ausgegraut, wenn eine Voreinstellung aktiv ist, um ein Überschreiben der Voreinstellung zu verhindern.&lt;br /&gt;
* Klicken Sie auf '''Modify preset''', um die Einstellungen zu ändern und die Voreinstellungsdatei zu überschreiben.&lt;br /&gt;
* Voreinstellungsdateien können über das Voreinstellungsfeld ausgetauscht werden. Deaktivieren Sie die Verwendung von Voreinstellungen, indem Sie die Einstellung auf None setzen.&lt;br /&gt;
&lt;br /&gt;
== Komponenten ==&lt;br /&gt;
=== Bakery Lightmap Group Selector ===&lt;br /&gt;
&lt;br /&gt;
Legt fest, welche '''Lightmap Group''' für das Objekt und alle seine untergeordneten Objekte verwendet werden soll.&lt;br /&gt;
Lightmap Group ist ein Begriff, den Bakery für eine Sammlung von Objekten verwendet, die sich eine Lightmap teilen. Groups haben Eigenschaften, die Bakery mitteilen, wie die Objekte gepackt werden sollen, welche Lichter sie beeinflussen sollen und ob das Ergebnis in eine Textur oder in Eckpunkte (Vertices) gebacken werden soll.&lt;br /&gt;
Standardmäßig werden alle statischen Objekte automatisch in mehrere Lightmap Groups (Atlas-Texturen) gepackt, sodass Sie sich keine Gedanken darüber machen müssen. Die manuelle Definition von Gruppen sollte nur für spezielle Zwecke verwendet werden - zum Beispiel:&lt;br /&gt;
* Markieren von Objekten, damit diese [[Vertex Lightmaps|Per-vertex Lightmaps]] statt Texturen verwenden.&lt;br /&gt;
* Backen einer Lightmap unter Verwendung exakter, nicht skalierter UVs, so wie sie in einer Modellierungssoftware vorhanden waren.&lt;br /&gt;
* Gruppierung bestimmter Bereiche des Levels, um eine einzige Lightmap zu verwenden und damit das Streaming von Ressourcen zu erleichtern oder um während der Laufzeit mittels Skripte zwischen verschiedenen gebackenen Beleuchtungen zu wechseln.&lt;br /&gt;
* Verwenden der Using Render Selected Groups-Schaltfläche, um nur gruppierte Objekte zu aktualisieren.&lt;br /&gt;
&lt;br /&gt;
Um eine Gruppe manuell zu definieren, müssen Sie ein '''Lightmap Group Assets''' erstellen - entweder über das Assets-&amp;gt;Create Menü, oder mithilfe der Create New-Schaltfläche auf der Komponente. Wenn die Schaltfläche Create New verwendet wurde, wird ein neues Asset mit folgenden Eigenschaften erstellt:&lt;br /&gt;
* Name: Name des zu erstellenden Lightmap Group Asset.&lt;br /&gt;
* Packing mode: Dieser Selektor definiert den Packmodus der Lightmap Group. Es gibt 3 Modi:&lt;br /&gt;
** Original UV: Das Objekt und seine untergeordneten Objekte werden mit unveränderten UVs gebacken. Packing wird nicht vorgenommen. Dies ist nützlich für Modelle, bei denen mehrere Meshes dasselbe bereits gepackte UV-Layout verwenden.&lt;br /&gt;
** Pack Atlas: Das Objekt und seine untergeordneten Objekte werden in einen eigenen Texturatlas gepackt. Vor Version 1.3 musste jedes packbare untergeordnete Objekt über die Komponente verfügen, aber das ist nun nicht mehr erforderlich. Jedes untergeordnete Objekt wird als eigenes Rechteck gepackt - es sei denn, Bakery erkennt automatisch, dass ein untergeordnetes Objekt nicht überlappende untergeordnete Objekte hat. In diesem Fall können mehrere Objekte ein einziges Rechteck verwenden.&lt;br /&gt;
** Vertex: Das Objekt und seine untergeordneten Objekte verwenden anstelle von Texturen eine vertex-farbige gebackene Beleuchtung. Beachten Sie, dass Sie dafür einen benutzerdefinierten Shader benötigen - beispielsweise den [[#Bakery_shaders|Bakery Shader]]. Ein einfacher Shader (&amp;quot;Bakery/Simple Vertex Lightmapped&amp;quot;) ist bereits zu Demonstrationszwecken und als Referenz enthalten. [[Vertex Lightmaps|Lernen Sie mehr über Vertex Lightmaps.]]&lt;br /&gt;
* Directional mode: Ermöglicht es Ihnen, den [[#Directional mode|Directional Mode]] für die Gruppe zu überschreiben. Die Optionen sind identisch - mit Ausnahme von Auto, das einfach die globale Einstellung verwendet.&lt;br /&gt;
* Resolution: Gewünschte Auflösung der Lightmap.&lt;br /&gt;
* Auto-resolution: [[Manual#Texels_per_unit|Texels Per Unit]] verwenden, um die nächstgelegene Zweierpotenz (power of two) zu bestimmen.&lt;br /&gt;
* Atlas packer: Zu verwendender [[Manual#Atlas_Packer|Atlas Packing]]-Algorithmus für diese Gruppe.&lt;br /&gt;
* Bitmask: Eine Liste von Umschaltflächen, die verwendet werden können, um bestimmte Lichtquellen von der Beeinflussung der Lightmap auszuschließen. Jede Bakery-Lichtquelle verfügt auch über eine Bitmask-Einstellung. Lichter wirken sich nur auf Lightmap Groups aus, mit denen sie mindestens eine dieser Umschaltflächen gemeinsam haben. Die Standardeinstellung bedeutet, dass alle Lichter alle Lightmaps beeinflussen können.&lt;br /&gt;
&lt;br /&gt;
[[File:Ts.jpg|thumb|Transparenter Selbstschatten AUS vs. EIN: Beachten Sie, wie einige einseitige, aber nach hinten gerichtete Polygone nun korrekt beleuchtet werden]]&lt;br /&gt;
&lt;br /&gt;
Falls Sie eine Lightmap Group mit einem ihr zugewiesenem Pack Atlas-Modus haben, werden zusätzliche Einstellungen auf der Komponente angezeigt:&lt;br /&gt;
* Override resolution: Überschreibt die Auflösung, die dieses Objekt und seine untergeordneten Objekte in der Lightmap einnehmen.&lt;br /&gt;
* Resolution: Manuell festgelegte Auflösung. Wenn Sie beispielsweise eine Lightmap mit einer Auflösung von 512 haben, die vier Objekten mit einer überschriebenen Auflösung von 256 zugewiesen ist, generiert Bakery eine einzige Lightmap mit einer Größe von 512x512, wobei jedes Objekt genau 256x256 Flächen einnimmt.&lt;br /&gt;
&lt;br /&gt;
Wenn Sie ein Lightmap Group Asset auswählen, werden zusätzliche experimentelle Einstellungen angezeigt:&lt;br /&gt;
* [[Subsurface scattering|Subsurface scattering: (Klicken, um mehr zu erfahren)]]&lt;br /&gt;
* Normal offset: Erlaubt es Ihnen, Strahlen von der Oberfläche zu versetzen. Dies ist selten nützlich und dient hauptsächlich zu Versuchszwecken.&lt;br /&gt;
* Transparent selfshadow: Strahlen hinter der Oberfläche werfen, damit diese keine Schatten auf sich selbst wirft. Kann z. B. für durchscheinendes Laub hilfreich sein.&lt;br /&gt;
* Vertex sampling density (nur wenn Packing Mode auf Vertex eingestellt ist): Standardmäßig berechnet das Per-Vertex-Backen nur 1 Wert für jeden Vertex. Falls die Abtastdichte über 0 ist, wird stattdessen der Durchschnitt vieler über Dreiecke verteilter Abtastwerte gebildet, was zu supersamplierten, glatteren Ergebnissen führt.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Lightmapped Prefab ===&lt;br /&gt;
Diese Komponente erlaubt Prefabs das Speichern von Lightmapping-Metadaten. Solche Prefabs können dann, sowohl im Editor als auch während der Laufzeit, in jeder Szene instanziiert werden.&lt;br /&gt;
Die Komponente sollte direkt zum Wurzelobjekt des Prefabs hinzugefügt werden. Verschachtelte Prefabs werden nicht unterstützt. Da das Prefab nach dem Backen überschrieben wird (genauso wie beim Klick auf die Schaltfläche “Apply”), darf das Prefab keine unangewendeten Änderungen enthalten (untergeordnete Objekte dürfen nicht verschoben werden, Materialien und Skriptparameter müssen unverändert bleiben usw). Sollten solche Änderungen erkannt werden, wird in der Benutzeroberfläche der Komponente eine Fehlermeldung angezeigt und nach dem Backen werden keine Metadaten gespeichert. Falls die Warnung zur [[#Warnings|Lightmapped prefab validation]] aktiviert ist, werden eventuell vorhandene Prefab-Fehler vor dem Backen in einem Dialogfeld angezeigt.&lt;br /&gt;
&lt;br /&gt;
Lightmapped Prefabs unterstützen alle Bakery-Funktionen, wie LODs, Terrains, Directional Lightmaps, RNM, SH, Per-Vertex-Modi und Shadowmasks. Damit Shadowmasks funktionieren, müssen Lichter ebenfalls Teil desselben Prefabs sein.&lt;br /&gt;
&lt;br /&gt;
{{note| Beachten Sie, dass Shadowmasks von Prefabs aufgrund von API-Einschränkungen nur mit Unity 2017.4 oder neuer funktionieren.}}&lt;br /&gt;
&lt;br /&gt;
Nach dem Backen wird ein Objekt namens “BakeryPrefabLightmapData” zum Prefab hinzugefügt. Dieses Objekt enthält ein Skript mit allen erforderlichen Daten zum Anwenden der Lightmaps.&lt;br /&gt;
&lt;br /&gt;
Darüber hinaus ermöglicht Lightmapped Prefab das Speichern der aktuellen Rendereinstellungen und das Laden dieser Einstellungen in jede derzeit geöffnete Szene mithilfe zweier Schaltflächen:&lt;br /&gt;
* Save current render settings to prefab: Speichert eine Kopie der aktuellen Rendereinstellungen auf dieses Prefab.&lt;br /&gt;
* Load render settings from prefab: Setzt die aktuellen Rendereinstellungen auf die vom Prefab gespeicherten Werte.&lt;br /&gt;
[[File:Upload 2019-9-17 10-32-34.png|thumb|Anwenden des Prefabs]]&lt;br /&gt;
Beim Backen eines Lightmapped Prefabs wird empfohlen, Folgendes zu überprüfen:&lt;br /&gt;
* Das Prefab wurde &amp;quot;Angewendet&amp;quot;. Klicken Sie hierfür bei älteren Unity Versionen auf die Schaltfläche &amp;quot;Apply&amp;quot; in der oberen rechten Ecke des Inspector. Bei neueren Versionen klicken Sie stattdessen auf die &amp;quot;Overrides&amp;quot;-Dropdown-Liste und dann auf &amp;quot;Apply all&amp;quot;.&lt;br /&gt;
* Die Prefab-Komponenten UI zeigt keine Fehler an.&lt;br /&gt;
* Das &amp;quot;Lightmapped prefab validation&amp;quot;-Kontrollkästchen wurde im Hauptfenster von Bakery aktiviert. Diese Einstellung überprüft alle Lightmapped Prefabs in der Szene und benachrichtigt Sie über mögliche Probleme in einem Dialogfeld.&lt;br /&gt;
&lt;br /&gt;
{{note| Lightmaps werden entweder nach der Szene, in der sie gebacken wurden, oder nach der Lightmap Group (falls vorhanden) benannt. Wenn Sie also verschiedene Prefabs in derselben Szene backen, stellen Sie bitte sicher, dass Sie entweder eine anders benannte [[Manual#Bakery_Lightmap_Group_Selector|Lightmap Group]] verwenden oder den [[Manual#Output_path|Output Path]] ändern.}}&lt;br /&gt;
&lt;br /&gt;
{{note| Beim nacheinander Backen von mehreren Prefabs mit identischen Modellen wird empfohlen, die Einstellung [[Manual#Asset_UV_Processing|Asset UV Processing]] auf ''Don't Change'' zu belassen, um eine Veränderung gemeinsam genutzter UVs zu verhindern.}}&lt;br /&gt;
&lt;br /&gt;
{{note| Bakery's Prefab-Workflow wurde implementiert, bevor Unity über die Ansichtsfunktion &amp;quot;Doppelklick auf Prefab&amp;quot; verfügte. Daher werden Lightmaps in der isolierten Prefab-Ansicht möglicherweise nicht korrekt angewendet und die Komponente zeigt möglicherweise die Meldung &amp;quot;This GameObject is not a prefab&amp;quot; an. Es sollte wie erwartet funktionieren, wenn Sie in einer normalen Szene arbeiten.}}&lt;br /&gt;
&lt;br /&gt;
{{note| Wenn Sie zuvor gebackene Prefabs entpacken und von vorhandenen Lightmaps trennen, sollten Sie sicherstellen, dass das BakeryPrefabLightmapData-Objekt, welches die Prefab-weiten Lightmap-/Renderer-Verbindungen enthält, entfernt wurde.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Direct Light ===&lt;br /&gt;
[[File:Directlight.jpg|thumb|Reines direktes Licht mit GI]]&lt;br /&gt;
[[File:Image4.png|thumb|Links: shadow spread = 0.01, rechts: 0.05. Beachten Sie, wie Schatten zunächst scharf sind und mit zunehmender Entfernung allmählich verschwimmen.]]&lt;br /&gt;
Unendliches direktes Licht (z. B. eine Sonne).&lt;br /&gt;
* Color: Farbe.&lt;br /&gt;
* Intensity: Linearer Farbmultiplikator.&lt;br /&gt;
* Shadow spread: Größe der Lichtquelle oder, einfacher ausgedrückt, Unschärfe des Schattens. 0 = maximal scharfe Schatten, 1 = maximal unscharfe Schatten. Technisch gesehen wird hier von einem einzelnen Strahl zu einem breiteren Strahlenkegel interpoliert.&lt;br /&gt;
* Shadow samples: Beeinflusst die Qualität der Schatten. Je kleiner der Wert für Shadow spread ist, desto weniger Samples sind für ein sauberes Bild erforderlich. Für Sonnenschatten liegen die typischen Werte zwischen 1 und 16. Das Setzen der Samples auf 0 deaktiviert das Werfen von Schatten für dieses Licht.&lt;br /&gt;
* Bitmask: Eine Liste von Umschaltflächen, mit denen diese Lichtquelle davon ausgeschlossen werden kann, bestimmte Lightmap Groups zu beeinflussen.&lt;br /&gt;
* Baked contribution: Legt fest, welche Art von Beleuchtungsdaten gebacken werden sollen. Nur sichtbar im Indirect- oder Shadowmask-Modus. Mögliche Werte:&lt;br /&gt;
** Direct and Indirect: Es wird sowohl die direkte, als auch indirekte Beleuchtung vollständig gebacken.&lt;br /&gt;
** Indirect only: Ein Echtzeit-Licht soll einen direkten Beitrag leisten; nur indirekte Beleuchtung wird gebacken.&lt;br /&gt;
** Shadowmask and indirect: Ein Echtzeit-Licht soll einen direkten Beitrag leisten, aber Schatten von statischer Geometrie werden in eine separate Map gebacken. Dynamische und statische Schatten werden miteinander gemischt. Indirekte Beleuchtung wird wie gewohnt gebacken.&lt;br /&gt;
** Direct, Indirect, Shadowmask (nur benutzerdefinierte Beleuchtung): Wie Direct und Indirect, jedoch wird zusätzlich eine Shadowmask erzeugt und für die Verwendung mit benutzerdefinierten Shadern zugewiesen.&lt;br /&gt;
* Denoise shadowmask: Legt fest, ob Denoising auf die Shadowmask dieses Lichts angewendet werden soll. Normalerweise ist dies nicht notwendig, da Schatten in der Regel nicht viel Rauschen aufweisen, aber es kann bei sehr breiten, unscharfen Schatten (großer Shadow spread) hilfreich sein.&lt;br /&gt;
* Indirect intensity: Nicht-physikalischer GI-Multiplikator für dieses Licht. Sollte für eine natürliche Beleuchtung auf 1 eingestellt sein, kann jedoch für stilisiertere Szenen angepasst werden.&lt;br /&gt;
* Anti-alias: Führt Supersampling für den Schatten durch.&lt;br /&gt;
* Texture projection: Projiziert eine multiplikative gekachelte Textur über die Beleuchtung. Kann verwendet werden, um entfernte Wolkenschatten zu simulieren.&lt;br /&gt;
Wenn Texture projection aktiviert ist, kann ihre Skalierung/Verschiebung über die Felder &amp;quot;Tiling&amp;quot; und &amp;quot;Offset&amp;quot; angepasst werden. Alternativ können Sie auf &amp;quot;Tweak projection in Scene View&amp;quot; klicken und die Projektion mit einem zusätzlichen Gizmo visuell verschieben und skalieren. Mit dem Klick auf &amp;quot;Render reference frame&amp;quot; können Sie eine Referenz-PNG-Datei aus der &amp;quot;Perspektive des Lichts&amp;quot; speichern. Dies ist nützlich, um Wolkenschatten über die Szene zu malen.&lt;br /&gt;
&lt;br /&gt;
Sollten für dasselbe GameObject sowohl die Unity- als auch die Bakery-Lichtquelle aktiviert sein, und beide nicht miteinander übereinstimmen, werden zwei Schaltflächen angezeigt:&lt;br /&gt;
* Match lightmapped to real-time: Kopiert allgemeine Einstellungen vom Unity Light zum Bakery Light.&lt;br /&gt;
* Match real-time to lightmapped: Kopiert allgemeine Einstellungen vom Bakery Light zum Unity Light.&lt;br /&gt;
&lt;br /&gt;
{{note| Physikalisch gesehen ist Bakery's &amp;quot;Intensity&amp;quot; für gerichtete Lichtquellen Lux geteilt durch Pi.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Sky Light ===&lt;br /&gt;
[[File:Skylight.jpg|thumb|Reines Himmelslicht mit GI]]&lt;br /&gt;
Unendliches, schattenwerfendes Umgebungslicht (Himmel).&lt;br /&gt;
* Color: Farbe.&lt;br /&gt;
* Intensity: Linearer Farbmultiplikator.&lt;br /&gt;
* Sky texture: Optionales Cubemap-Asset, z. B. ein HDRI-Panorama, um die Lichtfarben aus unterschiedlichen Richtungen zu beeinflussen.&lt;br /&gt;
{{note| Durch Drehen des GameObject wird die Beleuchtung aus der Cubemap entsprechend mitgedreht.}}&lt;br /&gt;
* Samples: Beeinflusst die Qualität der Schatten. Typische Werte liegen zwischen 8 und 32.&lt;br /&gt;
* Hemispherical: Wenn aktiviert, kommt das Licht nur von oben (obere Hemisphäre). Andernfalls kommt es aus allen Richtungen.&lt;br /&gt;
* Bitmask: Eine Liste von Umschaltflächen, mit denen diese Lichtquelle davon ausgeschlossen werden kann, bestimmte Lightmap Groups zu beeinflussen.&lt;br /&gt;
* Baked contribution: Legt fest, welche Art von Beleuchtungsdaten gebacken werden sollen. Nur sichtbar im Indirect- oder Shadowmask-Modus. Mögliche Werte:&lt;br /&gt;
** Direct and Indirect: Es wird sowohl die direkte, als auch indirekte Beleuchtung vollständig gebacken. Dies ist das Standardverhalten und wird für alle Sky Lights empfohlen, da es keine Echtzeitvariante gibt, um sie in Unity zu emulieren.&lt;br /&gt;
** Indirect only: Ein Echtzeit-Licht soll einen direkten Beitrag leisten; nur indirekte Beleuchtung wird gebacken.&lt;br /&gt;
&lt;br /&gt;
Sollten die Einstellungen für das Himmelslicht und die aktuelle Skybox nicht übereinstimmen, werden zwei Schaltflächen angezeigt:&lt;br /&gt;
* Match this light to scene skybox: Kopiert die allgemeinen Einstellungen vom aktiven Skybox-Material zum Bakery Sky Light. Derzeit können nur Skyboxen, die mit den Shadern “Skybox/Cubemap” oder “Skybox/Bakery skybox” ausgestattet sind, abgeglichen werden.&lt;br /&gt;
* Match scene skybox to this light: Kopiert die allgemeinen Einstellungen vom Bakery Sky Light zur Szenen-Skybox.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bakery Light Mesh ===&lt;br /&gt;
[[File:Image29.png|thumb|Links: Samples Near = 0, Samples Far = 4096.&amp;lt;br&amp;gt;&lt;br /&gt;
Mitte: Samples Near = 0, Samples Far = 128.&amp;lt;br&amp;gt;&lt;br /&gt;
Rechts: Samples Near = 16, Samples Far = 128.&amp;lt;br&amp;gt;&lt;br /&gt;
Beachten Sie, wie ähnlich das Erscheinungsbild der Beleuchtung ist, obwohl weniger kombinierte Samples verwendet werden.]]&lt;br /&gt;
Emissives Mesh beliebiger Form. Sollte zusammen mit der Mesh Renderer-Komponente oder mit einer Light-Komponente, die auf Area eingestellt ist, verwendet werden.&lt;br /&gt;
* Color: Farbe.&lt;br /&gt;
* Intensity: Linearer Farbmultiplikator.&lt;br /&gt;
* Cutoff: Maximale Lichtdistanz. Bakery wird zusätzlich den invers-quadratischen Lichtabfall nahe der Grenze vermindern. Dies funktioniert am besten, wenn der Cutoff-Wert genau dort liegt, wo der physikalische Abfall sehr schwach wird. Cutoff kann die Backleistung verbessern, aber Sie können ihn für vollständige Korrektheit auch auf einen sehr hohen (unerreichbaren) Wert einstellen.&lt;br /&gt;
* Self Shadow: Legt fest, ob das Light Mesh selbst Schatten wirft. Diese Einstellung verwendet einen präziseren Beleuchtungsalgorithmus.&lt;br /&gt;
* Samples Near: Beeinflusst die Beleuchtungsqualität in der Nähe des Meshes. Typische Werte liegen zwischen 16 und 64. Diese Einstellung ist nur verfügbar, wenn Self Shadow aktiviert ist.&lt;br /&gt;
* Samples Far: Beeinflusst die Beleuchtungsqualität in der Entfernung vom Mesh. Typische Werte liegen zwischen 4 und 4096.&lt;br /&gt;
&lt;br /&gt;
Bakery verwendet zwei verschiedene Algorithmen für Area Lights, basierend auf der Nähe der zu emittierenden Oberfläche. In der unmittelbaren Nähe der Lichtquelle funktioniert es ähnlich wie der GI-Algorithmus, während das Licht in der Ferne eher als eine Wolke virtueller Punktlichter approximiert wird.&lt;br /&gt;
&lt;br /&gt;
{{note| &amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;Light Meshes erhalten keine eigene Beleuchtung und werden auch nicht ge-lightmapped.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Ein Light Mesh mit vielen Polygonen kann schneller gebacken werden als viele einfache Light Meshes.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Versuchen Sie, den Wert von Samples Near auf 0 zu setzen, falls Sie unscharfe/verrauschte Ergebnisse erhalten. Dann wird nur der Virtual Point Lights-Algorithmus angewendet. Dieser ist auch nützlich bei der Nutzung sehr einfacher Lichter, wo Präzision nicht so wichtig ist (z. B. Fensterlichter an Gebäuden).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;}}&lt;br /&gt;
[[File:Dd99d-QU0AEKFBK.jpg|thumb|Ein gebogenes Light Mesh]]&lt;br /&gt;
* Bitmask: Eine Liste von Umschaltflächen, mit denen diese Lichtquelle davon ausgeschlossen werden kann, bestimmte Lightmap Groups zu beeinflussen.&lt;br /&gt;
* Baked contribution: Legt fest, welche Art von Beleuchtungsdaten gebacken werden sollen. Nur sichtbar im Indirect- oder Shadowmask-Modus. Mögliche Werte:&lt;br /&gt;
** Direct and Indirect: Es wird sowohl die direkte, als auch indirekte Beleuchtung vollständig gebacken. Dies ist das Standardverhalten und wird für alle Light Meshes empfohlen, da es keine Echtzeitvariante gibt, um sie in Unity zu emulieren.&lt;br /&gt;
** Indirect only: Ein Echtzeit-Licht soll einen direkten Beitrag leisten; nur indirekte Beleuchtung wird gebacken.&lt;br /&gt;
** Shadowmask and Indirect: Ein Echtzeit-Licht soll einen direkten Beitrag leisten, aber Schatten von statischer Geometrie werden in eine separate Map gebacken. Dynamische und statische Schatten werden miteinander gemischt. Indirekte Beleuchtung wird wie gewohnt gebacken. Derzeit unterstützen nur die HDRP (und benutzerdefinierte Renderer) gemischte Area Lights.&lt;br /&gt;
** Direct, Indirect, Shadowmask (nur benutzerdefinierte Beleuchtung): Wie Direct und Indirect, jedoch wird zusätzlich eine Shadowmask erzeugt und für die Verwendung mit benutzerdefinierten Shadern zugewiesen.&lt;br /&gt;
* Indirect intensity: Nicht-physikalischer GI-Multiplikator für dieses Licht. Sollte für eine natürliche Beleuchtung auf 1 eingestellt sein, kann jedoch für stilisiertere Szenen angepasst werden.&lt;br /&gt;
* Shadowmask with falloff: Backt den vollständigen Lichtabfall in die Shadowmask ein (nur nützlich bei Verwendung mit benutzerdefinierten Shadern).&lt;br /&gt;
&lt;br /&gt;
Sollten das Material des Meshes und die Lichteinstellungen nicht übereinstimmen, werden zwei Schaltflächen angezeigt:&lt;br /&gt;
* Match light to material: Kopiert die allgemeinen Einstellungen vom unbeleuchteten Material des Meshes oder Area Light zum Bakery Light Mesh.&lt;br /&gt;
* Match material to light: Kopiert die allgemeinen Einstellungen vom Bakery Light Mesh zum unbeleuchteten Material des Meshes oder Area Light.&lt;br /&gt;
&lt;br /&gt;
==== Unterschiede zwischen Light Mesh und emissive Materialien ====&lt;br /&gt;
Emissives Material:&lt;br /&gt;
* Verbreitet Licht während der GI-Berechnung und ist dadurch “kostenlos” - unabhängig davon, wie viele Meshes emissiv sind.&lt;br /&gt;
* Kleine und helle Lichter können, je nach Anzahl des GI sample count, zu ungenauen und verrauschten Ergebnissen führen.&lt;br /&gt;
* Muss aufgrund der Funktionsweise von GI in Bakery Platz in der Lightmap einnehmen, wodurch möglicherweise Platz verschwendet wird. Das bedeutet wiederum auch, dass emissive Objekte gültige UVs benötigen und die Einstellung “Cast shadows” aktiviert sein muss.&lt;br /&gt;
&lt;br /&gt;
Light Mesh:&lt;br /&gt;
* Die Beleuchtung wird für jedes Licht einzeln berechnet und ist daher langsamer als bei emissiven Materialien.&lt;br /&gt;
* Entwickelt, um auch bei kleinen und hellen Lichtquellen, selbst wenn diese sehr weit entfernt sind, saubere Ergebnisse zu erzielen.&lt;br /&gt;
* Nimmt keinen Platz in Lightmaps ein.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Point Light ===&lt;br /&gt;
[[File:Image11.png|thumb|Links: Shadow Spread = 0.5, rechts: Shadow Spread = 1.]]&lt;br /&gt;
Punktlicht, hat keine Fläche. Trotz physikalischer Unmöglichkeit ist es für Spiele nützlich und die einzige Möglichkeit, die Punkt- und Spotlichter von Unity nachzubilden.&lt;br /&gt;
{{note| Spotlichter sind lediglich Punktlichter mit einer zusätzlichen Projektionsmaske.}}&lt;br /&gt;
* Color: Farbe.&lt;br /&gt;
* Intensity: Linearer Farbmultiplikator.&lt;br /&gt;
* Shadow spread: Unschärfe des Schattens. Obwohl Punktlichter keine Fläche besitzen, ist es dennoch oft wünschenswert, von ihnen geworfene, unscharfe Schatten zu bekommen. Zu diesem Zweck werden Schatten so simuliert, als würden sie von einer kugelförmigen Flächenlichtquelle geworfen. Dieser Parameter definiert den Radius einer solchen virtuellen Kugel, was sich direkt auf die Unschärfe auswirkt.&lt;br /&gt;
* Physical falloff: Wenn aktiviert, wird der korrekte invers-quadratische Lichtabfall mit zusätzlicher Abschwächung nahe der Grenze verwendet. Andernfalls wird versucht, den Lichtabfall von Unity nachzuahmen.&lt;br /&gt;
* Falloff min size: Mehr dazu im Artikel [[Point Light Attenuation]].&lt;br /&gt;
* Range: Wenn Physical falloff deaktiviert ist, entspricht dies der Lichtreichweite von Unity. Ist es aktiviert, wird der physikalische Lichtabfall an den Rändern nur leicht abgeschwächt.&lt;br /&gt;
* Samples: Beeinflusst die Qualität der Schatten. Typische Werte liegen zwischen 1 und 512. Das Setzen der Samples auf 0 deaktiviert das Werfen von Schatten für dieses Licht.&lt;br /&gt;
[[File:Image10.png|thumb|Von links nach rechts: Omni, Cookie (default spot texture), Cubemap, IES.]]&lt;br /&gt;
* Projection mask: Art der Maske/des Cookie. Optionen:&lt;br /&gt;
** Omni: keine Maske, vergleichbar mit Unity’s Point Light.&lt;br /&gt;
** Cookie: Projektion einer Cookie-Textur. Zusätzliche Optionen:&lt;br /&gt;
*** Cookie texture: 2D Textur Asset. Bakery enthält die ursprüngliche Spot Light-Textur von Unity (unter dem Namen ftUnitySpotTexture), die Sie zur Nachahmung verwenden können.&lt;br /&gt;
*** Angle: Texturprojektionswinkel (ähnelt Unity’s Spot Light).&lt;br /&gt;
*** Correct distortion: Korrigiert Verzerrungen von Cookies, die bei einer Weitwinkelbetrachtung auf geraden Linien sichtbar sind.&lt;br /&gt;
** Cubemap: Cubemap-Cookie-Projektion. Zusätzliche Optionen:&lt;br /&gt;
*** Projected cubemap: Cubemap Asset.&lt;br /&gt;
** IES: Beleuchtung wird durch Daten aus einer IES-Datei moduliert. Zusätzliche Optionen:&lt;br /&gt;
*** IES file: Datei mit .ies-Endung.&lt;br /&gt;
* Bitmask: Eine Liste von Umschaltflächen, mit denen diese Lichtquelle davon ausgeschlossen werden kann, bestimmte Lightmap Groups zu beeinflussen.&lt;br /&gt;
* Baked contribution: Legt fest, welche Art von Beleuchtungsdaten gebacken werden sollen. Nur sichtbar im Indirect- oder Shadowmask-Modus. Mögliche Werte:&lt;br /&gt;
** Direct and Indirect: Es wird sowohl die direkte, als auch indirekte Beleuchtung vollständig gebacken.&lt;br /&gt;
** Indirect only: Ein Echtzeit-Licht soll einen direkten Beitrag leisten; nur indirekte Beleuchtung wird gebacken.&lt;br /&gt;
** Shadowmask and Indirect: Ein Echtzeit-Licht soll einen direkten Beitrag leisten, aber Schatten von statischer Geometrie werden in eine separate Map gebacken. Dynamische und statische Schatten werden miteinander gemischt. Indirekte Beleuchtung wird wie gewohnt gebacken.&lt;br /&gt;
** Direct, Indirect, Shadowmask (nur benutzerdefinierte Beleuchtung): Wie Direct und Indirect, jedoch wird zusätzlich eine Shadowmask erzeugt und für die Verwendung mit benutzerdefinierten Shadern zugewiesen.&lt;br /&gt;
* Indirect intensity: Nicht-physikalischer GI-Multiplikator für dieses Licht. Sollte für eine natürliche Beleuchtung auf 1 eingestellt sein, kann jedoch für stilisiertere Szenen angepasst werden.&lt;br /&gt;
* Shadowmask with falloff: Backt den vollständigen Lichtabfall (Distanz ausgenommen) in die Shadowmask ein (nur nützlich bei Verwendung mit benutzerdefinierten Shadern).&lt;br /&gt;
* Legacy sampling: Verwende Bakery's ursprüngliche, stärker verzerrte Schattenabtastungsstrategie. Erzeugt rauschfreie Schatten, aber breite Halbschatten können Streifenbildung aufweisen. Wenn diese Option deaktiviert ist, wird eine unverzerrte, aber mehr mit Rausch behaftete Technik verwendet.&lt;br /&gt;
&lt;br /&gt;
Sollten für dasselbe GameObject sowohl die Unity- als auch die Bakery-Lichtquelle aktiviert sein, und beide nicht miteinander übereinstimmen, werden zwei Schaltflächen angezeigt:&lt;br /&gt;
* Match lightmapped to real-time: Kopiert allgemeine Einstellungen vom Unity Light zum Bakery Light.&lt;br /&gt;
* Match real-time to lightmapped: Kopiert allgemeine Einstellungen vom Bakery Light zum Unity Light.&lt;br /&gt;
&lt;br /&gt;
{{note| Physikalisch gesehen ist Bakery's &amp;quot;Intensity&amp;quot; für Punktlichter (Candela/Pi).}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Volume ===&lt;br /&gt;
[[File:Voldemo notlonely.gif|Eine bewegliche Schranktür wird durch ein Bakery Volume beleuchtet (GIF von NOTLonely)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Volumes generieren 3D-Texturen, die Light Probes pro Voxel speichern (sphärische Harmonische der Ordnung L1 und Shadowmasks), wodurch sie einen geeigneten Ersatz für reguläre Unity Light Probes darstellen.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Unity Light Probes&lt;br /&gt;
! Unity LPPV&lt;br /&gt;
! Bakery Volumes&lt;br /&gt;
|-&lt;br /&gt;
| Manuelles Platzieren einzelner Probes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Nein&lt;br /&gt;
|-&lt;br /&gt;
| Interpolieren mehrerer Probes auf einem Objekt&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|-&lt;br /&gt;
| Ist während der Laufzeit verschiebbar&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|-&lt;br /&gt;
| Kann in ein Prefab platziert werden&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|-&lt;br /&gt;
| Vollständige Scripting-API verfügbar&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|-&lt;br /&gt;
| Ringing&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Möglich&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Möglich&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Behoben&lt;br /&gt;
|-&lt;br /&gt;
| Denoising&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|-&lt;br /&gt;
| Laufzeit-Overhead&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | CPU: niedrig; GPU: niedrig.&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | CPU: mittel; GPU: mittel.&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#e4ead3;&amp;quot; | CPU: kein; GPU: mittel.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bakery Volume ist eine Begrenzungsbox, die mit einer Reihe von 3D-Texturen (3 SH-Texturen und bei Bedarf eine Shadowmask) verknüpft ist, wodurch sie sehr einfach zu verwenden und mit Skripten zu modifizieren ist. Volumes können während der Laufzeit ganz einfach ausgetauscht, verschoben, geladen oder entladen oder mit Prefabs verknüpft werden. Sie benötigen außerdem keine Light Probe Groups und die manuelle Platzierung von Probes entfällt; das gesamte Volumen wird stattdessen mit einem einheitlichen Raster aus Voxel-Probes gefüllt. Light/Shadow leaking wird automatisch auf die gleiche Weise behoben wie bei Lightmaps (dünne doppelseitige Wände können jedoch bei großen Voxelgrößen ein Problem darstellen, was jedoch durch die Verwendung unterschiedlicher Volumes auf verschiedenen Seiten vermieden werden kann). Aufgrund der einheitlichen Beschaffenheit von Voxel-Rastern ist es auch möglich, ein Lightmap-ähnliches Denoising auf sie anzuwenden, was bei normalen Light Probes nicht machbar ist. Zusätzlich verwenden Bakery Shaders den [https://drive.google.com/file/d/1MK6Clw93q8ljijRjb4gQOzzaIjn1uF9Y/view Geomerics Sampling-Trick], um &amp;quot;Ringing&amp;quot;-Artefakte, die von sphärischen Harmonischen manchmal bei kontrastreicher HDR-Beleuchtung erzeugt werden, vollständig zu beseitigen.&lt;br /&gt;
&lt;br /&gt;
Dadurch können Volumes eine saubere, detaillierte und hochwertige gebackene Beleuchtung für dynamische Objekte erzeugen (d. h. Beleuchtung, die von statischen Objekten ausgeht und sich auf dynamische Objekte auswirkt, nicht umgekehrt).&lt;br /&gt;
&lt;br /&gt;
Der einzige Nachteil des Volumes-Ansatzes sind die höheren Shading-Kosten pro Pixel. Die Kosten sind ähnlich wie bei LPPV (Skalierung mit der Anzahl der schattierten, vom Volumen betroffenen, Pixel auf dem Bildschirm), aber im Gegensatz zu LPPV werden die Volumen selbst nach dem Backen nicht mehr aktualisiert. Das Mischen mehrerer Volumen kann vermieden werden, indem man sie leicht überlappen lässt.&lt;br /&gt;
&lt;br /&gt;
====Einstellen der Volume Transform====&lt;br /&gt;
[[File:Bvolgizmo.jpg|thumb|Volume Gizmo]]&lt;br /&gt;
Wenn Bakery Volume zu einem GameObject hinzugefügt wird, erscheint in der Szenenansicht ein Begrenzungsrahmen-Gizmo. Durch das Ziehen an den kleinen Quadraten wird es skaliert.&lt;br /&gt;
Es gibt noch andere Möglichkeiten, wie man die Größe und Position der Volume ändern kann:&lt;br /&gt;
* Ziehen Sie ein beliebiges, renderbares GameObject in das Feld &amp;quot;Wrap to object&amp;quot;. Dadurch umschließt das Volume dieses Objekt (und seine untergeordneten Elemente) und ummantelt es.&lt;br /&gt;
* Wenn demselben Objekt ein Box Collider hinzugefügt wurde, werden die Schaltflächen &amp;quot;Set from box collider&amp;quot; und &amp;quot;Set to box collider&amp;quot; angezeigt. Diese können verwendet werden, um Werte schnell zwischen Volume/Collider zu kopieren.&lt;br /&gt;
&lt;br /&gt;
====Auflösung====&lt;br /&gt;
Wenn &amp;quot;Adaptive resolution&amp;quot; aktiviert ist, wird die Anzahl der Voxel durch die &amp;quot;Voxels per unit&amp;quot;-Angabe bestimmt. Durch Deaktivieren kann die Auflösung manuell eingegeben werden. Bei den meisten Spielen mit 1 Einheit = 1 Meter ist 2 ein angemessener Wert für &amp;quot;Voxels per unit&amp;quot;, aber es gibt Fälle (z. B. dynamische Türen), in denen die Verwendung eines kleineren Volumes mit höherer Auflösung vorteilhafter ist.&lt;br /&gt;
&lt;br /&gt;
====Andere Einstellungen====&lt;br /&gt;
* Enable baking: Soll die Volume (neu) berechnet werden? Deaktivieren, um das Überschreiben vorhandener Daten zu verhindern.&lt;br /&gt;
* Denoise: Wende Denoising nach dem Backen der Volume an. Empfohlen für hochauflösende Volumes. Vermeiden Sie die Verwendung der Einstellung bei Volumes mit sehr niedriger Auflösung, die viele Lichter abdecken, da es für den Denoiser schwierig sein wird, den tatsächlichen Inhalt von Rauschen unterscheiden zu können.&lt;br /&gt;
* Global: Weist diese Volume automatisch allen kompatiblen Shadern zu, sofern diese keine Überschreibungen enthalten. Intern ruft es den Befehl Shader.SetGlobalTexture()/SetGlobalVector() auf.&lt;br /&gt;
&lt;br /&gt;
====Benutzung====&lt;br /&gt;
Volumes können mithilfe eines Volume-bewussten Shaders Objekten zugewiesen werden. Bakery wird mit dem &amp;quot;Bakery Standard&amp;quot;-Shader, der Volumes bereits implementiert hat, sowie mit HDRP- und URP-Graphen geliefert. Sehen Sie sich die example_volumes Szenen an, um verschiedene Anwendungsmöglichkeiten einer Volume zu entdecken.&lt;br /&gt;
&lt;br /&gt;
====Hinweise und Tipps====&lt;br /&gt;
* Sehen Sie sich unbedingt die Beispiele an.&lt;br /&gt;
* Falls sich zwei Volumes berühren, lassen Sie sie ein wenig überlappen. Die Größe der Überlappung sollte der Größe des größten dynamischen Objekts entsprechen. Auf diese Weise funktioniert das einfache Wechseln zwischen Volumes nach Bedarf.&lt;br /&gt;
* Platzieren Sie Volumes nur in Bereichen, die dynamische Objekte tatsächlich erreichen können. Verwenden Sie zum Beispiel die Spielerhöhe, um die Höhe der Volume zu begrenzen.&lt;br /&gt;
&lt;br /&gt;
====Drehen von Volumes====&lt;br /&gt;
Volumes können um die Y-Achse gedreht werden, sofern die Einstellung &amp;quot;Rotate around Y&amp;quot; aktiviert ist. Die Drehung ist sehr ressourcenschonend und verwendet nur 2 zusätzliche Daten-Floats (vorberechnete Sinus-/Kosinuswerte des Winkels).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Es gibt eine zusätzliche Option zum Drehen von Volumes während der Laufzeit (unter Experimental -&amp;gt; &amp;quot;Support rotation after bake&amp;quot; und eine ähnliche Einstellung im Bakery Shader). In diesem Fall müssen sie ohne anfängliche Drehung gebacken werden.&lt;br /&gt;
&lt;br /&gt;
In der URP kann solch eine dynamische Drehung mithilfe von BakeryURPVolumeGraphRotatable.shadergraph genutzt werden.&lt;br /&gt;
&lt;br /&gt;
Für globale Volumes wird die dynamische Drehung aktualisiert, wenn die Komponente (wieder) aktiviert oder volume.SetGlobalParams() aufgerufen wird. Bei der Nutzung von lokal gedrehten Volumen ist die manuelle Einstellung der Drehung im Material oder im MaterialPropertyBlock erforderlich:&lt;br /&gt;
{{code|&amp;lt;nowiki&amp;gt;SetMatrix(&amp;quot;_VolumeMatrix&amp;quot;, volume.GetMatrix())&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
====Technische Informationen====&lt;br /&gt;
Volumes können automatisch funktionieren (siehe Beispielszenen), aber es ist auch möglich, ihre Wirkweise per Skript zu steuern.&lt;br /&gt;
&lt;br /&gt;
Volumedaten können über diese öffentlichen Eigenschaften aus der Komponente abgerufen werden:&lt;br /&gt;
* bakedTexture0: Speichert L0-RGB-Koeffizienten und den L1-Z-Rotkanal in den Alphakanal.&lt;br /&gt;
* bakedTexture1: Speichert L1-X-RGB-Koeffizienten und den L1-Z-Grünkanal in den Alphakanal.&lt;br /&gt;
* bakedTexture2: Speichert L1-Y-RGB-Koeffizienten und den L1-Z-Blaukanal in den Alphakanal.&lt;br /&gt;
* bakedMask: Speichert die volumetrische Shadowmask.&lt;br /&gt;
* bounds: Die Begrenzungsbox der Volume.&lt;br /&gt;
&lt;br /&gt;
Alle bakedTexture*-Maps nutzen das RGBAHalf (8 Bytes pro Voxel) Format, während die Shadowmask das Format ARGB32 (4 Bytes pro Voxel) verwendet. Alternativ kann für die Shadowmask auch das Single-channel R8 Format (1 Byte pro Voxel) verwendet werden.&lt;br /&gt;
&lt;br /&gt;
Daher gilt: volume byte size = width*height*depth*3*8 + (nur wenn die Shadowmask verwendet wird) width*height*depth*4 (oder width*height*depth bei einer R8 Shadowmask).&lt;br /&gt;
&lt;br /&gt;
[[Manual#Compress_volumes|Texture compression]] kann für Volumes aktiviert werden, um diese deutlich zu verkleinern.&lt;br /&gt;
&lt;br /&gt;
Zum Samplen von Volumes werden spezielle Shader benötigt, die in Bakery bereits enthalten sind. Um einem benutzerdefinierten Shader Volumes-Funktionen hinzuzufügen, überprüfen Sie bitte die Funktion BakeryVolume_float() in der Datei BakeryDecodeLightmap.hlsl, die in den HDRP/URP-Paketen enthalten ist.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Light Filter ===&lt;br /&gt;
[[File:Output optimized.gif|Buntglas, wie es durch Bakery Real-Time Preview gesehen wird. Die gleichen Ergebnisse werden vom Bakery lightmapper gebacken.]]&lt;br /&gt;
&lt;br /&gt;
Markiert einen Renderer als Light Filter. Light Filter färben alle direkten/indirekten Strahlen mit ihrer Farbe, ähnlich wie optische Filter im realen Leben, wodurch farbige Transparenzen (z. B. Buntglas) entstehen. Der einzige Parameter ist die, für die Tönung, verwendete Textur.&lt;br /&gt;
* Objekte mit Light Filter erhalten weiterhin wie alle anderen Objekte auch Lightmaps.&lt;br /&gt;
* Filter streuen/verwischen keine Strahlen (nutzen Sie hierfür [[Subsurface_scattering|Subsurface Scattering]] oder [[Manual#Backface_GI|Backface GI]]).&lt;br /&gt;
* Filter können farbige Schatten erzeugen. Wenn für das Licht ein [[Manual#Shadowmask|Shadowmask]]-Modus verwendet wird, wird nur der R-Kanal des Ergebnisses gespeichert (da Unity nur einkanalige Masken unterstützt). Für vollständig gebackene Schatten gibt es keine Einschränkungen.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Sector ===&lt;br /&gt;
Lesen Sie den Artikel '''[[Partial_scene_baking|Partial scene baking]]''' für weitere Informationen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Always Render ===&lt;br /&gt;
Wenn dies zu einem Objekt hinzugefügt wird, berücksichtigt Bakery es beim Backen immer, auch wenn sein Renderer deaktiviert ist.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Pack As Single Square ===&lt;br /&gt;
Wenn dies zu einem Objekt hinzugefügt wird, behandelt Bakery die UVs dieses Objekts und die UVs seiner untergeordneten Objekte als ein einziges kombiniertes Quadrat und verschiebt sie während des automatischen Atlas-Packens oder in einer Lightmap Group im Modus Pack Atlas niemals voneinander weg. Die gesamte Hierarchie der untergeordneten Objekte wird als Ganzes gepackt.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Shared LOD UV ===&lt;br /&gt;
Wenn dies zu einer LODGroup hinzugefügt wird, werden alle ähnlich benannten LODs für dieselbe Lightmap markiert. Standardmäßig erhält jedes LOD eine einzigartige Lightmap, die Platz im Atlas einnimmt. Wenn jedoch bekannt ist, dass LODs desselben Objekts ähnliche UV2-Kanäle haben (oder UV1, wenn sie sich nicht überlappen, und UV2 nicht vorhanden ist), können sie demselben Teil des Atlas zugeordnet werden, wodurch Speicherplatz gespart wird.&lt;br /&gt;
Diese Technik ist auch als [https://github.com/laurenth-personal/LODLightmapScripts/ Lightmap Stealing] bekannt.&lt;br /&gt;
&lt;br /&gt;
= Kompatibilität von Materialien =&lt;br /&gt;
=== Albedo und Emission ===&lt;br /&gt;
Bakery unterstützt die meisten Unity Materialien durch die Verwendung des [https://docs.unity3d.com/Manual/MetaPass.html Meta Pass]-Systems. Alle Built-in, Surface, URP und HDRP Shaders verfügen bereits über einen korrekt definierten Meta Pass.&lt;br /&gt;
&lt;br /&gt;
Wenn Sie einen Unlit Shader haben, müssen Sie den Meta Pass manuell hinzufügen, so wie es in der Unity Dokumentation beschrieben wird.&lt;br /&gt;
&lt;br /&gt;
Sollte der Pass nicht vorhanden sein, wird Bakery die Eigenschaften {{codeVar|_MainTex}}, {{codeVar|_BaseColorMap}} oder {{codeVar|_Color}} (wenn keine Textur festgelegt ist) als Materialalbedo und {{codeVar|_EmissionMap}} sowie {{codeVar|_EmissionColor}} als Emissionsfarbe werten.&lt;br /&gt;
&lt;br /&gt;
Damit Emission funkionieren kann, muss der Wert [https://docs.unity3d.com/ScriptReference/Material-globalIlluminationFlags.html Material.globalIlluminationFlags] auf [https://docs.unity3d.com/ScriptReference/MaterialGlobalIlluminationFlags.BakedEmissive.html MaterialGlobalIlluminationFlags.BakedEmissive] gesetzt werden. Die Standard Shader legen diesen Wert automatisch fest.&lt;br /&gt;
&lt;br /&gt;
=== Opacity ===&lt;br /&gt;
[[File:Upload 2019-1-25 0-4-30.png|thumb|Materialparameter in Cutout umgewandelt (Standard)]]&lt;br /&gt;
[[File:Alphacombos dither.jpg|thumb|Halbtransparente Werte, die über die Option Dither Transparency hinzugefügt wurden]]&lt;br /&gt;
[[File:Alphacombos filter.jpg|thumb|Auf rote Flächen angewendete Light Filter-Komponenten, die farbige Schatten erzeugen]]&lt;br /&gt;
Standardmäßig übernimmt Bakery immer die volle Opazität aus dem Alpha-Wert von {{codeVar|_MainTex}}, {{codeVar|_BaseColorMap}} oder {{codeVar|_BaseMap}} und behandelt diese als Cutout (1-Bit Transparenz).&lt;br /&gt;
&lt;br /&gt;
Wenn die Einstellung '''Dither Transparency''' aktiviert ist, werden halbtransparente Werte automatisch in variables blaues Rauschen umgewandelt, das anschließend gefiltert/unscharf gemacht wird, was zu einer teilweisen Transparenz führt (dies war zuvor mit benutzerdefinierten, manuell geditherten Karten möglich, seit Version 1.97 erfolgt dies jedoch automatisch).&lt;br /&gt;
&lt;br /&gt;
Damit Opacity funkionieren kann, muss der [https://docs.unity3d.com/Manual/SL-SubShaderTags.html RenderType Tag] des Shaders einen der folgenden Werte haben:&lt;br /&gt;
* {{codeVar|Transparent}}&lt;br /&gt;
* {{codeVar|TransparentCutout}}&lt;br /&gt;
* {{codeVar|TreeLeaf}}&lt;br /&gt;
&lt;br /&gt;
Sollte eine Eigenschaft namens {{codeVar|_Cutoff}} vorhanden sein, wirkt sich diese auf den Cutout aus (daher funktioniert der Cutoff-Schieberegler des Standard Shaders automatisch).&lt;br /&gt;
&lt;br /&gt;
Ohne Dither Transparency wird, wenn der RenderType des Materials {{codeVar|Transparent}} oder {{codeVar|TreeLeaf}} ist, der Alpha-Wert von {{codeVar|_Color}} zusätzlich den Cutoff-Wert modifizieren: ''finalCutoff = 1 - (1 - cutoff) * alpha''&lt;br /&gt;
&lt;br /&gt;
Für farbige Transparenzeffekte, verwenden Sie die [[Manual#Bakery_Light_Filter|Light Filter]]-Komponente.&lt;br /&gt;
&lt;br /&gt;
Für diffuse Transparenzeffekte, lesen Sie den Abschnitt [[#Backface GI|Backface GI]] und den Artikel über [[Subsurface scattering]].&lt;br /&gt;
&lt;br /&gt;
==== Alpha Meta Pass ====&lt;br /&gt;
Seit v1.9 unterstützt Bakery die Angabe einer benutzerdefinierten shader-basierten Transparenz, wofür jedoch ein kompatibler Shader erforderlich ist. Um die Vorteile des ''Alpha Meta Pass'' nutzen zu können, müssen folgende Schritte durchgeführt werden:&lt;br /&gt;
* Fügen Sie Ihrem Shader die Eigenschaft namens '''BAKERY_META_ALPHA_ENABLE''' hinzu. Beispiel:&lt;br /&gt;
{{code|&amp;lt;nowiki&amp;gt;[HideInInspector] BAKERY_META_ALPHA_ENABLE (&amp;quot;Enable Bakery alpha meta pass&amp;quot;, Float) = 1.0&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
* Stellen Sie sicher, dass der RenderType auf einen der oben genannten Werte gesetzt ist.&lt;br /&gt;
* Deklarieren Sie einen Pass namens '''META_BAKERY'''. &lt;br /&gt;
* Überprüfen Sie in diesem Pass, ob '''unity_MetaFragmentControl.w''' ungleich Null ist. Ist dies der Fall, geben Sie den berechneten Transparenzwert zurück. &lt;br /&gt;
&lt;br /&gt;
Sehen Sie sich als Beispiel die im Paket enthaltene Datei ''Baked_Alpha_meta.shader'' an.&lt;br /&gt;
&lt;br /&gt;
Hinweis: Derzeit muss für den Alpha Meta Pass der Light Probe-Modus auf L1 oder L2 eingestellt sein.&lt;br /&gt;
&lt;br /&gt;
=== Normal mapping ===&lt;br /&gt;
Benutzerdefinierte Oberflächennormalen können in Verbindung mit dem Modus [[#Baked Normal Maps|Baked Normal Maps]] verwendet werden. Leider gibt der Meta Pass von Unity keine Normaleninformationen aus, sodass standardmäßig die Normalen aus einer Textur namens {{codeVar|_BumpMap}} übernommen und zusätzlich durch {{codeVar|_MainTex_ST}} verändert werden.&lt;br /&gt;
&lt;br /&gt;
Es ist jedoch möglich, komplett benutzerdefinierte Shader mit erweiterten Normal Mapping-Funktionen (z. B. Überblenden mehrerer Ebenen) zu erstellen, die mit dem Backen kompatibel sind. Dazu müssen Sie folgendes tun:&lt;br /&gt;
&lt;br /&gt;
1. Fügen Sie Ihrem Shader einen Meta Pass hinzu, so wie es [https://docs.unity3d.com/Manual/MetaPass.html#ExampleMetaPass in der Unity Dokumentation beschrieben] ist.&lt;br /&gt;
&lt;br /&gt;
2. Nennen Sie diesen Pass {{codeVar|&amp;quot;META_BAKERY&amp;quot;}} statt nur {{codeVar|&amp;quot;META&amp;quot;}}.&lt;br /&gt;
&lt;br /&gt;
3. Inkludieren Sie die Datei {{codeVar|&amp;quot;BakeryMetaPass.cginc&amp;quot;}}.&lt;br /&gt;
&lt;br /&gt;
4. Fügen Sie {{codeVar|#pragma vertex vert_bakerymt}} hinzu.&lt;br /&gt;
&lt;br /&gt;
5. Wenn die Variabel {{codeVar|unity_MetaFragmentControl.z}} nicht 0 ist, sollte der Shader Normale im Weltkoordinatensystem zurückgeben. Der zurückgegebene Normalwert sollte mit der Funktion {{codeVar|BakeryEncodeNormal}} codiert werden.&lt;br /&gt;
&lt;br /&gt;
Zwei Beispiel-Shader, die diesen erweiterten Meta Pass implementieren, sind im Ordner Assets/Bakery/examples/shaders enthalten.&lt;br /&gt;
&lt;br /&gt;
Sie können BakeryMetaPass.cginc kopieren und an Ihre Bedürfnisse anpassen, z. B. um zusätzliche Daten aus dem Vertex Shader zu übermitteln.&lt;br /&gt;
&lt;br /&gt;
=== Front/back faces ===&lt;br /&gt;
Unabhängig davon, welcher Culling-Modus für den Shader verwendet wird, behandelt Bakery alle Rückflächen als undurchsichtig, was bedeutet, dass direkte Lichtstrahlen eine Rückfläche ebenso wenig durchdringen wie eine Vorderfläche.&lt;br /&gt;
Bei der Verwendung von [[Manual#Backface_GI|Backface GI]] können Rückflächen jedoch teilweise die von einer Vorderfläche empfangene Beleuchtung emittieren.&lt;br /&gt;
&lt;br /&gt;
= &amp;quot;Lightmap Parameters&amp;quot; Assets =&lt;br /&gt;
[[File:Lp.jpg|thumb|Erweiterte Lightmap-Parameter]]&lt;br /&gt;
Ähnlich wie Bakery's [[Manual#Bakery_Lightmap_Group_Selector|Lightmap Groups]] verfügt Unity über [https://docs.unity3d.com/Manual/class-LightmapParameters.html Lightmap-Parameter], die als Assets erstellt und Mesh Renderern zugewiesen werden können. Deren Logik weisen sowohl Unterschiede als auch Gemeinsamkeiten auf:&lt;br /&gt;
* Die Lightmap Group dient in erster Linie dazu, mehrere Objekte in einem Atlas zu gruppieren. Darüber hinaus ermöglicht sie das Überschreiben der Back-Einstellungen für diesen Atlas.&lt;br /&gt;
* Lightmap-Parameter werden hauptsächlich dazu verwendet, um die Back-Einstellungen für ein Objekt zu überschreiben. Sie können jedoch auch das Packing beeinflussen, wenn die Option &amp;quot;Baked Tag&amp;quot; verwendet wird: Objekte mit einem unterschiedlichen Baked Tag teilen sich niemals denselben Atlas.&lt;br /&gt;
&lt;br /&gt;
Da einige Benutzer eher mit dem Lightmap Parameter-Workflow vertraut sind, unterstützt und erweitert Bakery diese:&lt;br /&gt;
* Der Baked Tag wird von Bakery berücksichtigt.&lt;br /&gt;
* Zusätzliche Bakery-spezifische Einstellungen werden in der Lightmap Parameters UI angezeigt. Über die Bedeutung dieser Einstellungen finden Sie im Abschnitt [[Manual#Bakery_Lightmap_Group_Selector|Lightmap Group]] mehr heraus.&lt;br /&gt;
&lt;br /&gt;
= Project Settings =&lt;br /&gt;
Einige globale Einstellungen können unter Project Settings -&amp;gt; Bakery GPU Lightmapper angepasst werden (diese Option ist nur in Unity 2018.3 oder neuer sichtbar; bei älteren Versionen bearbeiten Sie stattdessen BakeryProjectSettings.asset):&lt;br /&gt;
* Mipmap lightmaps: Aktiviert Mipmapping für Lightmap Assets. Kann zu Leaks in UV-Maps führen, da Atlas-Texturen kleiner werden; andererseits reduziert es Lightmap Aliasing in der Ferne. Insgesamt wird empfohlen, für sehr weit entfernte Objekte separat gebackene LODs mit niedrig aufgelösten Lightmaps zu verwenden.&lt;br /&gt;
* Color file format: Format für reguläre HDR color lightmaps. Mögliche Werte:&lt;br /&gt;
** HDR: Radiance HDR format (Standard). Kann mit vielen Bildbearbeitungsprogrammen geöffnet und bearbeitet werden.&lt;br /&gt;
** Asset: Natives Unity Format. Kann eine benutzerdefinierte Mipmap-Anzahl haben.&lt;br /&gt;
* Mask/Direction file format: Format für zusätzliche LDR-Karten, wie Shadowmasks oder Richtungsinformationen. Mögliche Werte:&lt;br /&gt;
** TGA: 8-bit Targa (Standard).&lt;br /&gt;
** PNG: 8-bit PNG. Benötigt weniger Speicherplatz auf der Festplatte als Targa (TGA).&lt;br /&gt;
** Asset: Natives Unity Format. Kann eine benutzerdefinierte Mipmap-Anzahl haben.&lt;br /&gt;
* Compress lightmaps: Legt das Komprimierungsverhalten für Lightmap-Assets fest. Komprimierte Lightmaps benötigen weniger VRAM, können jedoch je nach Art der Komprimierung einige visuelle Artefakte (wie Streifenbildung oder farbige Flecken) aufweisen. (Informationen zu Komprimierungsproblemen auf mobilen Endgeräten finden Sie [[Troubleshooting#I_have_an_Android_project.2C_and_lightmaps_don.27t_look_good|hier]]). Mögliche Werte:&lt;br /&gt;
*** Compress but allow overriding asset: Es werden neue Lightmaps mit aktivierter Komprimierung erstellt. Nach ihrer Erstellung können ihre Komprimierungseinstellungen im Inspector geändert werden. Diese geänderten Werte bleiben nach dem erneuten Backen erhalten (Standard).&lt;br /&gt;
*** Force compress: Lightmaps werden immer komprimiert.&lt;br /&gt;
*** Force no compress: Immer unkomprimierte Lightmaps erstellen.&lt;br /&gt;
* High quality direction: Ermöglicht eine &amp;quot;hohe&amp;quot; Komprimierungsqualität für Richtungskarten. Die tatsächlichen Formate hängen von der (Ziel)plattform ab. Auf dem PC wird beispielsweise DXT1 durch BC7 ersetzt, was zwar eine höhere Qualität liefert, aber den VRAM-Verbrauch verdoppelt.&lt;br /&gt;
* Texel padding (default atlas packer): Legt fest, wie viele leere Texel zwischen den UV-Layouts von Objekten in Lightmap-Atlas-Texturen hinzugefügt werden sollen, wenn der Standard-Atlas Packer verwendet wird.&lt;br /&gt;
* Texel padding (xatlas packer): Wie oben, nur das stattdessen xatlas verwendet wird.&lt;br /&gt;
* Alpha Meta Pass resolution multiplier: Multipliziert die Auflösung des [[Manual#Alpha_Meta_Pass|Alpha Meta Pass]], wodurch präzise shaderbasierte Cutouts beim Backen von niedrig aufgelösten Lightmaps möglich sind.&lt;br /&gt;
* Volume render mode: Welcher [[Manual#Render_mode|Render-Modus]] soll für alle [[Manual#Bakery_Volume|Volumes]] verwendet werden? Auto verwendet den aktuell aktiven Render-Modus (Standard).&lt;br /&gt;
* Delete previous lightmaps before bake: Löscht alle zuvor gerenderten Lightmap-Dateien dieser Szene, bevor neue gebacken werden.&lt;br /&gt;
* Log level: Legt fest, wie viele Informationen während des Backvorgangs in der Konsole ausgegeben werden. Mögliche Werte:&lt;br /&gt;
** 0: es wird nichts ausgegeben.&lt;br /&gt;
** 1: es werden nur Fortschrittsinformationen ausgegeben.&lt;br /&gt;
** 2: es werden nur Warnungen ausgegeben.&lt;br /&gt;
** 3: es wird alles an Informationen ausgegeben.&lt;br /&gt;
* Alternative scale in lightmap: Bewirkt, dass sich die Renderer-Eigenschaft 'Scale in Lightmap' eher wie das integrierte Unity-Verhalten verhält.&lt;br /&gt;
* Align to texture compression blocks with xatlas: Lässt xatlas Maps an 4x4-Blockgrenzen ausrichten, was zu komprimierungsfreundlicheren Ergebnissen führt.&lt;br /&gt;
* Generate smooth positions: Sollen Sample-Positionen angepasst werden, um falsche Schatten auf Low-Poly-Geometrien mit glatten Normalen zu vermeiden? Kann in sehr seltenen Fällen deaktiviert werden, in denen Geometrie mit stark abweichenden Normalen verwendet wird. Lesen Sie [https://ndotl.wordpress.com/2018/08/29/baking-artifact-free-lightmaps/#shadowterm diesen Artikel] für eine technische Erklärung.&lt;br /&gt;
* Smooth positions per-triangle: Sollen glatte/flache Positionen pro Dreieck festgelegt werden? Kann in sehr seltenen Fällen deaktiviert werden, in denen Geometrie mit stark abweichenden Normalen verwendet wird.&lt;br /&gt;
* Use 'Receive GI' values: Berücksichtigt 'Receive Global Illumination'-Werte von Renderern. Ursprünglich wurde dies von Bakery ignoriert.&lt;br /&gt;
* Remove ringing in Legacy light probes: Ermöglicht eine weichere Light Probes-Faltung im Legacy Modus, um Artefakte in kontrastreichen Bereichen zu vermeiden.&lt;br /&gt;
* Always render reflection probes: Automatisch nach jedem Render/Render Light Probes-Vorgang Reflection Probes rendern.&lt;br /&gt;
* Ringing removal for L2 light probes: Wendet De-Ringing auf [[Manual#Light_probe_mode|L2 Light Probes]] an. Je höher der Wert, desto weicher ist die Beleuchtung von Probes. Diese Glättung reduziert [https://docs.unity3d.com/6000.2/Documentation/Manual/light-probes-troubleshooting.html Ringing]-Artefakte (falls vorhanden).&lt;br /&gt;
* Put menu under Tools: Verschiebt den Bakery Menüeintrag under den Tools Menüeintrag.&lt;br /&gt;
&lt;br /&gt;
Falls ein Format auf Asset eingestellt und Mipmapping aktiviert ist, wird eine zusätzliche Einstellung angezeigt:&lt;br /&gt;
* Maximum mipmap count: Legt die maximale Anzahl von Mipmaps fest. Beispiel: Bei einem Wert von 2 verfügt eine 8K-Lightmap nur über zwei zusätzliche Mipmaps: 4K und 2K. Niedrigere Auflösungen werden weggelassen, wodurch das Auftreten von Leak-Artefakten beim Mipmapping begrenzt wird.&lt;br /&gt;
&lt;br /&gt;
= Skinned mesh renderer support =&lt;br /&gt;
&lt;br /&gt;
Bakery unterstützt Skinned Meshes seit v1.65. Es gibt jedoch einige Einschränkungen:&lt;br /&gt;
* Einige Versionen von Unity unterstützen UV1 auf Skinned Meshes nicht und ignorieren daher &amp;quot;Generate lightmap UVs&amp;quot;. Stellen Sie sicher, dass das in Ihrer Szene verwendete Mesh über UV1 verfügt, und verwenden Sie nach Möglichkeit nicht überlappende UV0.&lt;br /&gt;
* Die Anpassung des UV-Paddings funktioniert nicht bei Skinned Meshes (Unity scheint beim Versuch, die Unwrap-Funktion auf sie anzuwenden, abzustürzen);&lt;br /&gt;
* Skinned Meshes können keine pro-Vertex Lightmaps besitzen (die Engine bietet keine Unterstützung für additionalVertexStreams mit skinning).&lt;br /&gt;
&lt;br /&gt;
= Shader Tweaks =&lt;br /&gt;
[[File:Image2.jpg|thumb|Links: standard bilineare Filterung. Rechts: bikubische Filterung.]]&lt;br /&gt;
[[File:Image34.jpg|thumb|Links: beide Schatten sind gebacken.&amp;lt;br&amp;gt;&lt;br /&gt;
Mitte: der sphärische Schatten ist dynamisch, während der andere Schatten statisch ist. Zusammen wurden sie mit Multiplikation kombiniert.&amp;lt;br&amp;gt;&lt;br /&gt;
Rechts: wie in der Mitte, jedoch kombiniert mit dem Standard-Minimum.]]&lt;br /&gt;
Bakery bietet optionale Shader-Modifikationen, die auf Unity Shader angewendet werden können, um das Sampling von Lightmaps zu verbessern und die Echtzeitbeleuchtung besser an Lightmaps anzupassen. Das Menü zur Anpassung der Shader kann über Bakery-&amp;gt;Shader Tweaks aufgerufen werden.&lt;br /&gt;
&lt;br /&gt;
Diese Optionen patchen die Basis-Unity Shader-Includes (aus dem Ordner CGIncludes), die von den meisten integrierten und Drittanbieter-Shadern verwendet werden. Alle vorgenommenen Änderungen werden sich auf alle Projekte, die in Zukunft mit dieser Version des Editors geöffnet werden, auswirken, können jedoch leicht rückgängig gemacht werden. Shader-Optimierungen beeinflussen die Funktionsweise von Standard- und Surface Shadern. HDRP, URP und andere SRPs sind davon nicht betroffen.&lt;br /&gt;
&lt;br /&gt;
Alle verfügbaren Modifikationen werden als Schaltflächen angezeigt. Klicken Sie auf die Schaltfläche, um die Änderung anzuwenden. Klicken Sie erneut auf die Schaltfläche, um die Änderung rückgängig zu machen. Derzeit verfügbare Optionen:&lt;br /&gt;
&lt;br /&gt;
{{note| Möglicherweise müssen Sie den Unity Editor als Administrator ausführen, damit das patchen von CGIncludes funktioniert.}}&lt;br /&gt;
&lt;br /&gt;
* Use bicubic interpolation for lightmaps: Anstelle der standardmäßigen bilinearen Interpolation wird eine bikubische Interpolation verwendet. Diese Optimierung behebt viele, die von niedrig aufgelösten Lightmaps produzierten gezackten Kanten ziemlich gut. Funktioniert derzeit nur auf DX11 und modernen Konsolen, weshalb andere Plattformen weiterhin bilinear verwenden werden.&lt;br /&gt;
&lt;br /&gt;
* Use multiplication for shadowmask: Kombiniert statische und dynamische Schatten mithilfe von Multiplikation anstelle von Minimum. Aus unbekannten Gründen hat Unity beschlossen, standardmäßig den Minimaloperator zu verwenden - was zu Artefakten führt, die bei der Multiplikation nicht auftreten.&lt;br /&gt;
&lt;br /&gt;
* Use physical light falloff (forward): Ersetzt die Standardabfall von Echtzeit-Punkt/Spotlichtern durch einen physikalisch korrekteren invers-quadratischen Abfall. “Range” wird nur an den Rändern leicht ausgeblichen (entspricht Bakery-Lichter mit aktiviertem Physical Falloff-Kontrollkästchen). Beeinflusst nur den Forward Renderer. Lesen Sie den Artikel [[Point Light Attenuation]] für weitere Details.&lt;br /&gt;
&lt;br /&gt;
* Use physical light falloff (deferred): wie oben, aber nur der Deferred Renderer wird beeinflusst.&lt;br /&gt;
&lt;br /&gt;
'''Falloff-Optimierungen funktionieren möglicherweise nicht vollständig in Unity-Versionen &amp;gt; 2017. SRPs besitzen standardmäßig einen korrekten Lichtabfall.'''&lt;br /&gt;
&lt;br /&gt;
= Bakery shaders =&lt;br /&gt;
Bakery enthält eigene Shader mit Unterstützung für Vertex-Lightmapping sowie die Richtungsmodi RNM und SH. Außerdem unterstützen sie die Berechnung einer ungefähren gebackenen Spiegelung (Specular) aus Richtungsinformationen. &lt;br /&gt;
Bakery Shader werden für normale Lightmaps, Shadowmasks und den Dominant Direction-Modus '''nicht benötigt''', da diese Funktionen ohnehin von den meisten Unity Shadern unterstützt werden.&lt;br /&gt;
&lt;br /&gt;
=== Standard render pipeline ===&lt;br /&gt;
'''Bakery/Standard''': Erweitert den regulären Standard Shader von Unity um folgende zusätzliche Optionen:&lt;br /&gt;
* Allow Vertex Lightmaps: Ermöglicht die Verwendung dieses Materials für das [[Vertex Lightmaps|Vertex-Lightmapping]].&lt;br /&gt;
* Allow RNM Lightmaps: Ermöglicht die Verwendung dieses Materials mit dem [[#RNM|RNM directional mode]].&lt;br /&gt;
* Allow SH Lightmaps: Ermöglicht die Verwendung dieses Materials mit dem [[#SH|SH directional mode]].&lt;br /&gt;
{{note| Alle “Allow”-Umschaltflächen aktivieren einen bestimmten Codepfad im Shader. Aus Leistungsgründen wird empfohlen, in einem Material nur eine “Allow”-Option zu aktivieren.}}&lt;br /&gt;
* Enable Lightmap Specular: Berechnet gebackene Spiegelungen (Specular) anhand von Daten aus den Richtungsmodi Dominant Direction, RNM oder SH directional. Beachten Sie, dass der Effekt aufgrund fehlender Informationen nur sehr ungefähr ist. Das Ergebnis sollte in etwa vergleichbar sein mit gebackener Spiegelung in Unity 4. Am besten sieht er in Kombination mit starken Normal Maps aus, auf flachen Oberflächen hingegen nicht so gut.&lt;br /&gt;
* Enable VertexLM directional: Wenn Vertex-Lightmaps vorhanden sind, gibt dies an, dass Dominant Direction-Daten in Eckpunkten (Vertices) gespeichert sind und verwendet werden sollen.&lt;br /&gt;
* Enable VertexLM SH: Wenn Vertex-Lightmaps vorhanden sind, gibt dies an, dass SH-Daten in Eckpunkten (Vertices) gespeichert sind und verwendet werden sollen.&lt;br /&gt;
* Enable VertexLM Shadowmask: Wenn Vertex-Lightmaps vorhanden sind, gibt dies an, dass die Shadowmask in Eckpunkten (Vertices) gespeichert ist und verwendet werden soll.&lt;br /&gt;
* Enable MonoSH: Behandelt Directional Maps als MonoSH Maps.&lt;br /&gt;
[[File:Image5.png|thumb|Standard SH Light Probe vs. non-linear]]&lt;br /&gt;
[[File:Shspec.jpg|thumb|SH Spiegelungseffekte]]&lt;br /&gt;
* Non-linear SH: Im SH directional mode kann diese Option den Kontrast verbessern (näher an Ground Truth), verlangsamt jedoch den Shader etwas. Dieser Trick basiert auf dem [https://drive.google.com/file/d/1MK6Clw93q8ljijRjb4gQOzzaIjn1uF9Y/view “Reconstructing Diffuse Lighting from Spherical Harmonic Data”]-Papier von Geomerics.&lt;br /&gt;
* Non-linear Light Probe SH: Ähnlich wie Non-linear SH, ist aber für Light Probes bestimmt. Im Falle von Probes besteht der größte Vorteil darin, dass falsche negative Werte beseitigt werden. Dieses Problem tritt häufig in kontrastreichen Szenen mit hellen HDR-Lichtquellen auf und ist eine inhärente Einschränkung sphärischer Harmonien und nicht spezifisch für Bakery (d. h. ähnliche Artefakte können auch bei integrierten Lightmappern auftreten).&lt;br /&gt;
* Force Bicubic Filter: Aktiviert die bikubische Filterung für alle zusätzlichen Maps. Für eine vollständige bikubische Filterung (einschließlich der ersten color map) wird empfohlen, diese auch in den [[#Shader Tweaks|Shader Tweaks]] zu aktivieren.&lt;br /&gt;
&lt;br /&gt;
'''Bakery/Standard Specular''': wie Standard, aber für den Specular Workflow bestimmt.&lt;br /&gt;
&lt;br /&gt;
=== HDRP &amp;amp; URP ===&lt;br /&gt;
To extract additional HDRP/URP shaders, open Bakery_ShaderGraphHDRP.unitypackage or Bakery_ShaderGraphURP.unitypackage included with Bakery. Inside you will find Shader Subgraphs that you can use in your own Shader Graphs as well as some example materials.&lt;br /&gt;
&lt;br /&gt;
=== Vergleich Feature-Unterstützung aller Shader ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Die meisten Unity Shader&lt;br /&gt;
! Die meisten HDRP &amp;amp; URP Shader&lt;br /&gt;
! Bakery Standard&lt;br /&gt;
! HDRP Graphs&lt;br /&gt;
! URP Graphs&lt;br /&gt;
|-&lt;br /&gt;
| HDR color lightmaps&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|-&lt;br /&gt;
| Shadowmask&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja (Seit URP 10.1)&lt;br /&gt;
|-&lt;br /&gt;
| Dominant Direction&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|-&lt;br /&gt;
| RNM&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|-&lt;br /&gt;
| SH&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|-&lt;br /&gt;
| MonoSH&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|-&lt;br /&gt;
| Lightmap specular&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja, für Dominant Direction und SH&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja, für Dominant Direction (siehe Link)&lt;br /&gt;
|-&lt;br /&gt;
| Bicubic filtering&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja,&lt;br /&gt;
mithilfe von [[#Shader Tweaks|Shader Tweaks]]&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja,&lt;br /&gt;
mithilfe von [[#Shader Tweaks|Shader Tweaks]]&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
|-&lt;br /&gt;
| Vertex lightmaps&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Nur eine Farbe, keine per-vertex SH, direction oder Shadowmasks (Shader Graph-Einschränkung)&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Nur eine Farbe, keine per-vertex SH, direction oder Shadowmasks (shader Graph-Einschränkung)&lt;br /&gt;
|-&lt;br /&gt;
| Non-Linear Light Probes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|-&lt;br /&gt;
| Volumes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|-&lt;br /&gt;
| Volume shadowmask&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|-&lt;br /&gt;
| Compressed volumes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{note| Mit Ausnahme von regulären color lightmaps erfordern alle anderen Optionen mindestens Shader Model 3.0.}}&lt;br /&gt;
{{note| Vertex Lightmaps im SH-Modus erfordern aufgrund der Interpolatorbegrenzung mindestens Shader Model 4.0.}}&lt;br /&gt;
{{note| Aktualisierte URP-Graphen mit Unterstützung für Spiegelungen (Specular) aus Dominant Direction können [[Bakery_-_GPU_Lightmapper|von der Haupt-Wiki-Seite]] heruntergeladen werden.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Lesen Sie auch: [[Integrating_Bakery_shader_features_to_custom_shaders| Integrieren von Bakery Shader-Funktionen in eigene Shader]]&lt;br /&gt;
&lt;br /&gt;
= Hinweise zu HDRP/URP =&lt;br /&gt;
Sobald Bakery in ein HDRP- oder URP-Projekt importiert wurde, kann es in der Regel sofort verwendet werden. Es gilt jedoch einige Dinge zu beachten:&lt;br /&gt;
&lt;br /&gt;
* Beispielszenen verwenden sowohl reguläre Standard Shader als auch in einigen Fällen &amp;quot;Bakery Standard&amp;quot;-Shader. HDRP und URP bieten zwar einen automatischen Mechanismus zum Aktualisieren von Projekt-Shadern von Standard auf Lit an, dieser ist jedoch nicht mit Bakery Standard kompatibel. Sie müssen daher manuell alle Materialien, die Bakery Standard verwenden, durch die Materialien aus Bakery_ShaderGraphHDRP.unitypackage oder Bakery_ShaderGraphURP.unitypackage ersetzen.&lt;br /&gt;
&lt;br /&gt;
* In HDRP ist die voreingestellte Lichtintensität des HDRI-Himmels etwas hoch (11) und die Himmelsreflexion wird nicht verdeckt. Zusammen mit dem voreingestellten Eye Adaptation-Effekt kann dies dazu führen, dass einige Beispielszenen kaum sichtbar sind, da sie mit viel geringerer Intensität gebacken wurden. Reduzieren Sie in diesem Fall die Lichtintensität des HDRI-Himmels auf 1. Die HDRI-Einstellungen befinden sich normalerweise in Assets/HDRPDefaultResources/DefaultSettingsVolumeProfile.&lt;br /&gt;
&lt;br /&gt;
* Falls Lichter in den Beispielszenen unter HDRP zu hell scheinen sollten, klicken Sie auf &amp;quot;Match real-time to lightmapped&amp;quot; an der Bakery Light-Komponente, um dies zu beheben.&lt;br /&gt;
&lt;br /&gt;
* Verwenden Sie OpenImageDenoise 2 (empfohlen) oder OptiX 7 als Denoiser in HDRP, da diese für hohe Intensitätswerte besser geeignet sind.&lt;br /&gt;
&lt;br /&gt;
* In HDRP können &amp;quot;distance&amp;quot; und reguläre Shadowmasks in der Light-Komponente gewechselt werden, nicht jedoch in den globalen Einstellungen.&lt;br /&gt;
&lt;br /&gt;
* Verwenden Sie beim Skylight nicht die &amp;quot;Match&amp;quot;-Schaltflächen, da HDRP einen sehr spezifischen prozeduralen Himmelsshader verwendet. Backen Sie das Licht stattdessen [[How_do_I...#How_do_I_use_Skylight_with_a_procedural_sky_shader.3F|auf diese Weise]] in ein HDRI ein.&lt;br /&gt;
&lt;br /&gt;
* Es wird empfohlen, bei Verwendung von HDRP den Light Probe-Modus immer auf L2 oder L1 einzustellen, da der Renderer von HDRP nicht für den Legacy-Modus optimiert ist.&lt;br /&gt;
&lt;br /&gt;
* Die neuesten Versionen von HDRP/URP verfügen über einen eigenen IES-Datei-Importierer. Aufgrund der Inkompatibilität der Asset-Typen trennt Unity die Dateien von den mit älteren Versionen gespeicherten Bakery IES-Lichter, sodass diese stattdessen als normale Punktlichter gerendert werden. Die Dateien können erneut hinzugefügt und die Lichter erneut gespeichert werden.&lt;br /&gt;
&lt;br /&gt;
Bakery's Beispielszenen sind für die Built-in Render Pipeline gebaut worden, weshalb einige Schritte erforderlich sind, um sie korrekt in HDRP/URP zu rendern. Hier sind ein paar Tipps; es wird von einem neuen Projekt mit standardmäßigen HDRP/URP-Einstellungen ausgegangen:&lt;br /&gt;
&lt;br /&gt;
=== Beispielszenen in der HDRP anschauen ===&lt;br /&gt;
* Nach dem Importieren von Bakery konvertieren Sie die Built-in-Materialien zu HDRP-Materialien wie folgt: Edit-&amp;gt;Rendering-&amp;gt;Materials-&amp;gt;Convert All Built-in Materials To HDRP.&lt;br /&gt;
* Importieren Sie Bakery_ShaderGraphHDRP.unitypackage in das Projekt, da es spezielle ShaderGraphen enthält, die erweiterte Bakery-Funktionen implementieren (nicht erforderlich für klassische color/directional/mask lightmaps).&lt;br /&gt;
* Wählen Sie die Datei DefaultSettingsVolumeProfile.asset aus. Ändern Sie im HDRI Sky-Bereich den Wert Exposure Compensation auf 1. Andernfalls ist das standardmäßige HDRP im Vergleich zu den Beispielszenen zu hell, sodass diese aufgrund dieser Belichtungsanpassung völlig schwarz erscheinen.&lt;br /&gt;
* Bei der Auswahl von Lichtern in den Beispielszenen initialisiert HDRP eigene Lichtdaten. Manchmal kann dies dazu führen, dass das Licht sofort viel heller wird. Klicken Sie auf &amp;quot;Match real-time to lightmapped&amp;quot;, um die Synchronisierung durchzuführen.&lt;br /&gt;
* Stellen Sie den Light Probe-Modus vor dem Rendern von Lichtproben auf L2 ein.&lt;br /&gt;
* '''example_directional''': Ändern Sie die Shader zu BakeryDirSpecGraph, um Glanzeffekte zu sehen (oder einfach zum normalen HDRP/Lit für nur diffuses Normal Mapping). Löschen Sie die Kugel, da derzeit kein ShaderGraph existiert, der per-vertex direction unterstützt.&lt;br /&gt;
* '''example_directional_MonoSH''': Ändern Sie die Shader zu BakerySpecMonoSHGraph (oder BakeryMonoSHGraph für eine etwas günstigere Version ohne Glanzeffekte). Löschen Sie die Kugel, da derzeit kein ShaderGraph existiert, der per-vertex MonoSH unterstützt.&lt;br /&gt;
* '''example_RNM''': Ändern Sie die Shader zu BakeryRNMGraph.&lt;br /&gt;
* '''example_SH''': Ändern Sie die Shader zu BakerySpecSHGraph (oder BakerySHGraph für eine etwas günstigere Version ohne Glanzeffekte). Löschen Sie die Kugel, da derzeit kein ShaderGraph existiert, der per-vertex SH unterstützt.&lt;br /&gt;
* '''example_mixed_directional_mode''': similarly a different graph is needed for MonoSH/RNM/SH planes.&lt;br /&gt;
* '''example_lights''': Ändern Sie den Shader der vertex-lightmapped Kugel zu BakeryVertexColorGraph.&lt;br /&gt;
* '''example_prefabs_bake''': Es sind keine weiteren Anpassungen erforderlich.&lt;br /&gt;
* '''example_sectors''': Es sind keine weiteren Anpassungen erforderlich.&lt;br /&gt;
* '''example_shadowmask''': Wählen Sie das DirectLight aus und klicken Sie auf &amp;quot;Match real-time to lightmapped&amp;quot;, um die Helligkeit anzupassen. Setzen Sie bei allen HDRP-Lichtern den Shadowmask-Modus auf Shadowmask. &lt;br /&gt;
* '''example_sponza_day''': Legen Sie OpenImageDenoise 2 (oder Optix 7, falls nicht unterstützt) als bevorzugten Denoiser fest.&lt;br /&gt;
* '''example_sponza_evening''': Legen Sie OpenImageDenoise 2 (oder Optix 7, falls nicht unterstützt) als bevorzugten Denoiser fest.&lt;br /&gt;
* '''example_subtractive''': HDRP unterstützt den Subtractive-Modus nicht.&lt;br /&gt;
* '''example_volumes_simple''': Ändern Sie den Shader vom Zug zu BakeryVolumeSpecGraph (oder BakeryVolumeGraph für eine etwas günstigere Version ohne Glanzeffekte).&lt;br /&gt;
* '''example_volumes_simple_shadowmask''': Shadowmask Volumes werden derzeit für HDRP nicht unterstützt.&lt;br /&gt;
* '''example_volumes_advanced''': Dasselbe wie bei example_volumes_simple.&lt;br /&gt;
* '''example_translucency''': most of the scene should appear fine. For the &amp;quot;Dynamic sphere lit by volume&amp;quot;, set shader to BakeryVolumeGraph.&lt;br /&gt;
&lt;br /&gt;
=== Beispielszenen in der URP anschauen ===&lt;br /&gt;
* Nach dem Importieren von Bakery konvertieren Sie die Built-in-Materialien zu URP-Materialien wie folgt: Öffnen Sie den Ordner &amp;quot;content&amp;quot; unter Assets/Bakery/examples/ und wählen Sie alle darin enthaltenen Materialien aus, indem Sie &amp;quot;t:material&amp;quot; im Suchfeld eingeben und den Suchvorgang auf den Ordner beschränken. Klicken Sie dann auf Edit-&amp;gt;Rendering-&amp;gt;Materials-&amp;gt;Convert Selected Built-in Materials To URP.&lt;br /&gt;
* Import Bakery_ShaderGraphURP.unitypackage into the project, as it contains special shader graphs implementing advanced Bakery features (not required for classic color/directional/mask lightmaps).&lt;br /&gt;
* '''example_directional''': change shaders to BakeryURPLit, enable &amp;quot;Bakery Lightmapped Specular&amp;quot; (or just keep regular URP/Lit for diffuse-only normal mapping). Delete the sphere, as there is currently no shader graph supporting per-vertex direction.&lt;br /&gt;
* '''example_directional_MonoSH''': change shaders to BakeryURPLit, set Bakery Mode to MonoSH, enable &amp;quot;Bakery Lightmapped Specular&amp;quot;. On the vertex-lit sphere also enable &amp;quot;Per-vertex&amp;quot;.&lt;br /&gt;
* '''example_RNM''': change shaders to BakeryURPLit, set Bakery Mode to RNM, enable &amp;quot;Bakery Lightmapped Specular&amp;quot;.&lt;br /&gt;
* '''example_SH''': change shaders to BakeryURPLit, set Bakery Mode to SH, enable &amp;quot;Bakery Lightmapped Specular&amp;quot;. Delete the sphere, as there is currently no shader graph supporting per-vertex SH.&lt;br /&gt;
* '''example_mixed_directional_mode''': similarly use BakeryURPLit with a different Bakery Mode (MonoSH, RNM, SH). Non-directional / dominant direction / baked normap maps can use regular URP/Lit.&lt;br /&gt;
* '''example_lights''': Es sind keine weiteren Anpassungen erforderlich.&lt;br /&gt;
* '''example_prefabs_bake''': Es sind keine weiteren Anpassungen erforderlich.&lt;br /&gt;
* '''example_sectors''': Es sind keine weiteren Anpassungen erforderlich.&lt;br /&gt;
* '''example_shadowmask''': similarly to the Built-in pipeline, uncheck Distance Shadowmask in Bakery window (or project Quality Settings) to see actual baked/real-time shadow mixing near the camera.&lt;br /&gt;
* '''example_sponza_day''': Aktivieren Sie Alpha clipping am Laubmaterial.&lt;br /&gt;
* '''example_sponza_evening''': Dasselbe wie bei example_sponza_day.&lt;br /&gt;
* '''example_subtractive''': Es sind keine weiteren Anpassungen erforderlich.&lt;br /&gt;
* '''example_volumes_simple''': Ändern Sie den Shader vom Zug zu BakeryURPLit und schalten Sie den Bakery Mode auf Volume. Optional können Sie &amp;quot;Bakery Lightmapped Specular&amp;quot; aktivieren.&lt;br /&gt;
* '''example_volumes_simple_shadowmask''': same as example_volumes_simple, but also enable &amp;quot;Volume Shadowmask&amp;quot;.&lt;br /&gt;
* '''example_volumes_advanced''': same as with example_volumes_simple.&lt;br /&gt;
* '''example_translucency''': most of the scene should appear fine. For the &amp;quot;Dynamic sphere lit by volume&amp;quot;, set shader to BakeryURPLit and Bakery Mode to Volume.&lt;br /&gt;
&lt;br /&gt;
= Aktualisierung von Bakery =&lt;br /&gt;
Bei der Aktualisierung wird empfohlen, die folgenden Schritte auszuführen:&lt;br /&gt;
* Schließen Sie das Bakery-Fenster.&lt;br /&gt;
* Schließen Sie den Unity Editor.&lt;br /&gt;
* Öffnen Sie den Unity Editor erneut und laden Sie Ihr Projekt.&lt;br /&gt;
* Importieren Sie das neue Package.&lt;br /&gt;
&lt;br /&gt;
Beachten Sie, dass der Import ohne vorheriges Schließen von Unity aufgrund gesperrter DLL-Dateien fehlschlagen kann (erkennbar an Konsolenbenachrichtigungen wie &amp;quot;alphabuffergen.dll: Access is denied.&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
Wenn Sie die Bakery-Ordner (Assets/Bakery und Assets/Editor/x64/Bakery) an einen anderen Speicherort verschoben haben, müssen Sie diese möglicherweise vor der Aktualisierung zurückverschieben, um zu verhindern, dass zwei miteinander in Konflikt stehende Kopien des Pakets entstehen.&lt;br /&gt;
&lt;br /&gt;
= Scripting-API =&lt;br /&gt;
&lt;br /&gt;
==Grundlegende Verwendung==&lt;br /&gt;
&lt;br /&gt;
Get and modify render settings:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ftLightmapsStorage storage = ftRenderLightmap.FindRenderSettingsStorage();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Eine vollständige Liste aller verfügbaren Einstellungen können in der Datei ftLightmapsStorage.cs eingesehen werden.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Get lightmapper instance and (re)load settings:&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap bakery = ftRenderLightmap.instance != null ? ftRenderLightmap.instance : new ftRenderLightmap();&lt;br /&gt;
bakery.LoadRenderSettings();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Render lightmaps (also probes if they're set to L1 or L2 mode):&lt;br /&gt;
&amp;lt;pre&amp;gt;bakery.RenderButton(bool showMsgWindows)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Render light probes only:&lt;br /&gt;
&amp;lt;pre&amp;gt;bakery.RenderLightProbesButton(bool showMsgWindows)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Render reflection probes only:&lt;br /&gt;
&amp;lt;pre&amp;gt;bakery.RenderReflectionProbesButton(bool showMsgWindows)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''showMsgWindows''' tells if any dialog boxes/confirmations can be shown. Supressed, if set to false.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Check if baking is in progress:&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.bakeInProgress&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For usage example check [[Community_extensions#Batch_scene_baker|Batch Scene Baker]] script.&lt;br /&gt;
&lt;br /&gt;
==Additional functions==&lt;br /&gt;
&lt;br /&gt;
Copies all render settings from one ftLightmapsStorage to another:&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmapsStorage.CopySettings(ftLightmapsStorage src, ftLightmapsStorage dest)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Gets global (per-project) storage object:&lt;br /&gt;
&amp;lt;pre&amp;gt;ftGlobalStorage gstorage = ftLightmaps.GetGlobalStorage()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copies all render settings from ftLightmapsStorage (per-scene) to ftGlobalStorage  (per-project):&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmapsStorage.CopySettings(ftLightmapsStorage src, ftGlobalStorage dest)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copies all render settings from ftGlobalStorage (per-project) to ftLightmapsStorage (per-scene):&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmapsStorage.CopySettings(ftGlobalStorage src, ftLightmapsStorage dest)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Gets the path to the folder containing Bakery binaries:&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmaps.GetEditorPath()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Additional variables==&lt;br /&gt;
&lt;br /&gt;
Gets the current temporary files path (ftRenderLightmap instance must be created first):&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.scenePath&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Gets/sets UVGBuffer data compression (LZ4, if enabled, DDS if not):&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.compressedGBuffer&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Gets/sets output lightmap data compression (LZ4, if enabled, DDS if not):&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.compressedOutput&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Events==&lt;br /&gt;
&lt;br /&gt;
Scripts can subscribe to static events in ftRenderLightmap class.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Called before full Render:&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnPreFullRender&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Called before each light probe is rendered in Legacy light probe mode. ProbeEventArgs is a struct containing '''pos''' field with current light probe position:&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler&amp;lt;ProbeEventArgs&amp;gt; OnPreRenderProbe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Called after Legacy light probes were rendered:&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnFinishedProbes&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Called after full Render was finished:&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnFinishedFullRender&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Called before reflection probes are rendered:&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnPreReflectionProbeRender&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Called after reflection probes were rendered:&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnFinishedReflectionProbes&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mr F</name></author>
		
	</entry>
	<entry>
		<id>https://geom.io/bakery/wiki/index.php?title=Benutzerhandbuch&amp;diff=1851</id>
		<title>Benutzerhandbuch</title>
		<link rel="alternate" type="text/html" href="https://geom.io/bakery/wiki/index.php?title=Benutzerhandbuch&amp;diff=1851"/>
		<updated>2026-01-03T12:06:01Z</updated>

		<summary type="html">&lt;p&gt;Mr F: Created page with &amp;quot;== Systemanforderungen == Um Bakery nutzen zu können, benötigen Sie: * Windows (7 oder höher). * eine NVIDIA GPU. Minimal unterstütztes Modell ist Kepler (GeForce 650 oder...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Systemanforderungen ==&lt;br /&gt;
Um Bakery nutzen zu können, benötigen Sie:&lt;br /&gt;
* Windows (7 oder höher).&lt;br /&gt;
* eine NVIDIA GPU. Minimal unterstütztes Modell ist Kepler (GeForce 650 oder neuer; Für Quadro-Karten überprüfen Sie bitte die jeweiligen Spezifikationen).&lt;br /&gt;
* einen 64-bit Unity Editor. Bakery wurde auf allen Versionen - von 5.6 bis 6000.X oder höher - getestet.&lt;br /&gt;
&lt;br /&gt;
{{note|Die Systemanforderungen gelten nur für die Entwicklerumgebung, nicht für die anvisierte(n) Zielplattform(en). Mit Bakery gebackene Lightmaps können überall verwendet werden.}}&lt;br /&gt;
&lt;br /&gt;
== Bevor Sie beginnen... ==&lt;br /&gt;
* ... stellen Sie bitte sicher, dass Ihr Unity Projekt keine Skriptkompilierungsfehler enthält, da diese auch die Kompilierung von Bakery-Skripten verhindern.&lt;br /&gt;
* ... stellen Sie ebenfalls sicher, dass Sie den aktuellsten Grafiktreiber für Ihre Karte installiert haben. [https://www.nvidia.com/Download/index.aspx?lang=en-US Aktualisieren Sie Ihren Grafiktreiber], falls nötig.&lt;br /&gt;
&lt;br /&gt;
'''Wichtig: Verwenden Sie den GeForce Game Ready-Treiber (Standard) anstelle des NVIDIA Studio-Treibers.'''&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
1. Importieren Sie Bakery über den [https://assetstore.unity.com/packages/tools/level-design/bakery-gpu-lightmapper-122218 Asset Store] in Ihr Projekt.&lt;br /&gt;
&lt;br /&gt;
2. Unity wird Ihnen eine Liste an Dateien, die zu importieren sind, anzeigen. Wenn Sie Bakery zum ersten Mal verwenden, empfehlen wir Ihnen den einfachen Klick auf '''Import'''. Erfahrene Benutzer möchten zuvor möglicherweise noch den Ordner ''examples'' exkludieren, um eine schlankere Installation zu erhalten.&lt;br /&gt;
&lt;br /&gt;
Die Dateien werden in die Ordner Assets/Bakery und Assets/Editor/x64/Bakery kopiert. Beide Ordner können später verschoben werden.&lt;br /&gt;
&lt;br /&gt;
3. Unity importiert nun Bakery und kompiliert die Skripte. Es wird eventuell folgendes Fenster angezeigt:&lt;br /&gt;
&lt;br /&gt;
[[File:Goahead.png]]&lt;br /&gt;
&lt;br /&gt;
In diesem Fall können Sie einfach auf &amp;quot;Go Ahead&amp;quot; klicken.&lt;br /&gt;
&lt;br /&gt;
Sie sollten jetzt den Menüeintrag Bakery am oberen Bildschirmrand sehen:&lt;br /&gt;
&lt;br /&gt;
[[File:bmenu.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Schnellstart ==&lt;br /&gt;
&lt;br /&gt;
1. Platzieren Sie ein beliebiges 3D-Modell oder Unity Primitive in Ihre Szene und markieren Sie es als Static.&lt;br /&gt;
&lt;br /&gt;
'''Meshes dürfen für das Lightmapping keine überlappenden UV-Bereiche vorweisen. Der UV2-Kanal wird, sofern vorhanden, verwendet (andernfalls UV1). Sollten Sie Ihre 3D-Modelle nicht für das Lightmapping vorbereitet haben, müssen Sie die Einstellung [https://docs.unity3d.com/Manual/LightingGiUvs-GeneratingLightmappingUVs.html Generate Lightmap UVs] am Asset aktivieren.''' Unity Primitives besitzen bereits valide UV2-Kanäle.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Staticmarked.jpg|320px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Wählen Sie das Directional Light (das, was von Unity bereits erstellt wurde) aus und fügen Sie ihm eine '''Bakery Direct Light'''-Komponente hinzu.&lt;br /&gt;
{{note| Bakery und Unity nutzen jeweils separate Lichtquellen-Komponenten.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Das Bakery Direct Light bietet viele verschiedene Einstellungsmöglichkeiten, aber es ist sehr einfach, die Komponente an das Unity-eigene Licht anzugleichen. Klicken Sie hierfür auf '''Match lightmapped to real-time'''. Nun sollte das Bakery Direct Light die gleiche Lichtfarbe besitzen wie Unity’s Directional Light.&lt;br /&gt;
&lt;br /&gt;
[[File:Matching.jpg|640px]]&lt;br /&gt;
&lt;br /&gt;
{{note| Die Direct Light-Komponente könnte eine Warnung anzeigen, dass das Projekt keine lineare Lichtintensität verwendet. Das Problem besteht darin, dass Unity standardmäßig die Gammakorrektur auf die Farben der Lichtquellen [https://twitter.com/guycalledfrank/status/1001108508614553600 falsch anwendet]. Der richtige Modus kann per [https://docs.unity3d.com/ScriptReference/Rendering.GraphicsSettings-lightsUseLinearIntensity.html Skript] aktiviert werden, was mithilfe der Schaltfläche “Fix” geschiet. Wenn Sie bereits viele Lichtquellen im nicht-linearen Intensitätsmodus eingerichtet haben und diese nicht erneut ändern möchten, können Sie die Korrektur überspringen. Die Änderungen, die durch den “Fix” verursacht wurden, können jederzeit wieder rückgängig gemacht werden.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Um eine Umgebungsbeleuchtung mit Schatten zu erzielen, müssen Sie zuerst ein Skylight erstellen (Bakery-&amp;gt;Create-&amp;gt;Skylight).&lt;br /&gt;
&lt;br /&gt;
[[File:Menusky.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Wählen Sie das Skylight aus, weisen Sie es eine bläuliche Farbe zu und klicken Sie auf '''Match scene skybox to this light'''. Dadurch wird die Beleuchtung der Skybox genau angepasst.&lt;br /&gt;
{{note| Das Anpassen der Skybox an das Bakery Skylight ist optional, aber für die Korrektheit sinnvoll. Damit wird sichergestellt, dass die sichtbare Umgebung und die Reflection Probes in der Engine mit der gebackenen Beleuchtung übereinstimmen. Derzeit funktioniert diese Einstellung nur in der Built-In Render Pipeline von Unity.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Skycomp.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Wählen Sie nun Bakery-&amp;gt;Render Lightmap vom oberen Menü aus. Standardmäßig ist der Full Lighting-Modus aktiviert. Dieser berechnet sowohl direkte als auch indirekte Beleuchtung aller Lichter. Wenn Sie Echtzeit-Schatten mit gebackener Beleuchtung kombinieren möchten, ändern Sie die Einstellung auf '''Indirect'''.&lt;br /&gt;
&lt;br /&gt;
[[File:Bakerywindow.jpg]]&lt;br /&gt;
&lt;br /&gt;
{{note| Bakery könnte sich darüber beschweren, dass Sie den veralteten [https://docs.unity3d.com/Manual/LinearLighting.html Gamma-Modus] verwenden, und Ihnen empfehlen, diesen zu ändern. Wenn Ihnen die Qualität der Beleuchtung wichtig ist, wird die Verwendung des linearen Modus dringend empfohlen. Sie können diese Warnung ignorieren, falls Sie bereits ein großes Projekt mit Gamma-Modus eingerichtet haben und es nicht nachträglich ändern möchten oder wenn Sie für mobile Endgeräte entwickeln, die den linearen Modus nicht unterstützen.}}&lt;br /&gt;
&lt;br /&gt;
7. Klicken Sie auf die Schaltfläche '''Render'''.&lt;br /&gt;
&lt;br /&gt;
8. Fertig! Sie sollten nun gebackene Beleuchtung sehen:&lt;br /&gt;
&lt;br /&gt;
[[File:Bakedgi.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Render-Einstellungen ==&lt;br /&gt;
&lt;br /&gt;
Alle Render-Einstellungen können jederzeit über Bakery-&amp;gt;Render Lightmap eingesehen werden. Diese Einstellungen werden für jede Szene gespeichert. Die oberste Option im Bakery-Fenster ermöglicht es Ihnen, zwischen den Einstellungen Simple, Advanced und Experimental zu wechseln, wobei jeder nachfolgende Modus mehr anpassbare Optionen offenlegt. Der einfache Modus (Simple) reicht für die meisten Szenen aus und ist ein guter Einstieg.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render mode ===&lt;br /&gt;
Legt den Typ der zu backenden Lightmaps fest. &lt;br /&gt;
&lt;br /&gt;
===== Full Lighting =====&lt;br /&gt;
Vollständige direkte und indirekte Beleuchtung für alle Bakery-Lichter.&lt;br /&gt;
{{note| Bei Unity Versionen vor 2017.3 müssen Sie, wenn Sie sowohl Unity- als auch Bakery-Komponenten auf demselben GameObject haben, die Unity-Komponente manuell deaktivieren, um eine doppelte Helligkeit zu vermeiden. In neueren Versionen von Unity werden Echtzeit-Lichteffekte für gebackene Lichter automatisch deaktiviert, so wie es auch bei den integrierten Lightmappern der Fall ist.}}&lt;br /&gt;
&lt;br /&gt;
===== Indirect =====&lt;br /&gt;
[[File:Image26.png|thumb|Vergleich der verschiedenen Render-Modi, die von Unity unterstützt werden]]&lt;br /&gt;
Grundlegender Mixed mode. Es wird die Baked Contribution-Auswahl auf jedem Licht überprüft: Wenn die Einstellung auf ''Direct And Indirect'' gesetzt ist, wird das Licht wie im Full Lighting-Modus gebacken. Ist sie stattdessen auf ''Indirect Only'' gesetzt, wird nur der indirekte Beitrag (GI) dieses Lichts gebacken. Im letzteren Fall sollten Sie sowohl Unity- als auch Bakery-Lichter auf dem GameObject belassen, wobei eines einen direkten Echtzeitbeitrag leistet und das andere für vorab berechnete GI zuständig ist.&lt;br /&gt;
&lt;br /&gt;
[[File:Indirectonly.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== Shadowmask =====&lt;br /&gt;
[[File:Image21.png|thumb|Links: vollständig gebackenes Licht. Mitte: dynamisches Licht mit gebackener Beleuchtung. Rechts: der Schatten der Capsule sowie die Unebenheiten (bump) und Spiegelungen (specular) von Oberflächen sind dynamisch, während der Schatten des Cube und die Beleuchtung gebacken sind.]]&lt;br /&gt;
[[File:Image6.png|thumb|Wenn die Kamera weit genug entfernt ist oder dynamische Schatten deaktiviert sind, sieht dieselbe Szene wie folgt aus]]&lt;br /&gt;
Ein etwas fortgeschrittenerer Mixed mode. Er funktioniert durch die Erzeugung von zwei Arten von Lightmaps - eine mit gebackenen Farben (wie im Indirect mode) und eine weitere mit Schatten von statischen Objekten. Dies hat einige Vorteile:&lt;br /&gt;
* Echtzeit-Schatten können nur von einer Handvoll dynamischer Objekte erzeugt werden, nicht von der gesamten Szene.&lt;br /&gt;
* Echtzeit- und gebackene Schatten verschmelzen ordnungsgemäß miteinander.&lt;br /&gt;
* Echtzeit-Lichter können Bump-, Specular- und andere Oberflächeneffekte wiedergeben, während sie weiterhin durch hochwertige gebackene Schatten verdeckt werden.&lt;br /&gt;
[https://docs.unity3d.com/Manual/LightMode-Mixed-Shadowmask.html Mehr Informationen]&lt;br /&gt;
&lt;br /&gt;
Um dieses Verhalten zu aktivieren, müssen Sie sowohl Unity- als auch Bakery-Lichter auf demselben GameObject haben und Baked Contribution muss auf ''Shadowmask and Indirect'' eingestellt sein. Nicht markierte Lichter werden wie im Indirect mode gebacken.&lt;br /&gt;
&lt;br /&gt;
[[File:Smask22.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== Distance Shadowmask =====&lt;br /&gt;
Dieses Kontrollkästchen ist nur sichtbar, wenn Sie Shadowmask ausgewählt haben. Es schaltet die [https://docs.unity3d.com/Manual/LightMode-Mixed-ShadowmaskMode.html gleichnamige Einstellung] in den Quality Settings des Projekts um.&lt;br /&gt;
[https://docs.unity3d.com/Manual/LightMode-Mixed-DistanceShadowmask.html Mehr Informationen.]&lt;br /&gt;
{{note| Das Kontrollkästchen ist in Unity 5.6.x aufgrund fehlender Skript-API nicht sichtbar. Stattdessen können Sie die Einstellung unter Window-&amp;gt;Lighting-&amp;gt;Mixed Lighting-&amp;gt;Lighting Mode ändern.}}&lt;br /&gt;
{{note| In Versionen von Unity &amp;lt; 2017.3 werden aufgrund von API-Einschränkungen beim Rendern von Shadowmask-Lightmaps in der Szene platzierte Light Probes zurückgesetzt. Diese müssen nach dem Backvorgang erneut berechnet werden. In neueren Versionen sollte dies nicht mehr vorkommen.}}&lt;br /&gt;
&lt;br /&gt;
===== Subtractive =====&lt;br /&gt;
Aktiviert den [https://docs.unity3d.com/Manual/LightMode-Mixed-Subtractive.html Subtractive] Beleuchtungsmodus. &lt;br /&gt;
&lt;br /&gt;
Diese Einstellung hat keine besonderen Auswirkungen auf Lightmaps und funktioniert genau wie Full Lighting.&lt;br /&gt;
&lt;br /&gt;
Der einzige Unterschied besteht darin, dass sie auch Echtzeit-Lichter von Unity für den subtraktiven Modus einrichtet (da dies über die Benutzeroberfläche nicht möglich ist).&lt;br /&gt;
&lt;br /&gt;
Sie müssen zusätzlich globale subtraktive Parameter (wie die globale Schattenfarbe) in Unity’s [https://docs.unity3d.com/Manual/GlobalIllumination.html#MixedLighting Lighting Fenster] einrichten. .&lt;br /&gt;
&lt;br /&gt;
===== Ambient Occlusion Only =====&lt;br /&gt;
Es wird nur die Umgebungsverdeckung (AO) gebacken. Kann nützlich sein, wenn Sie wissen, was Sie tun. Stellen Sie sicher, dass die [[#Ambient_occlusion|AO Einstellungen]] eingerichtet wurden.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Directional mode ===&lt;br /&gt;
[[File:Image3.png|thumb|Vergleich verschiedener Richtungsmodi]]&lt;br /&gt;
Legt fest, wie Richtungsinformationen eingebettet werden. Standardmäßige Lightmaps speichern nur eine einzige Farbe pro Texel, während Lightmaps mit Richtungsinformationen den Shadern einen Hinweis darauf geben, wie sich die Beleuchtung über eine Halbkugel um das Texel herum verändert. Diese Daten sind erforderlich, um vollständig belichtete Bereiche mit Normal Maps zu kombinieren. Durch das Einbinden in den integrierten [[#Bakery_shaders|Bakery Shader]] kann ebenfalls eine ungefähre Spiegelungsreaktion erzeugt werden.&lt;br /&gt;
&lt;br /&gt;
===== None =====&lt;br /&gt;
Keine Richtungsdaten, eine Farbe pro Texel.&lt;br /&gt;
&lt;br /&gt;
===== Baked Normal Maps =====&lt;br /&gt;
Immer noch keine Richtungsdaten, aber Normal Maps werden beim Rendern der Lightmap berücksichtigt. Es gibt keinen zusätzlichen Laufzeit-Overhead. Da Lightmaps in der Regel eine geringere Auflösung als Normal Maps haben, kann das Ergebnis unscharf aussehen. Weitere Probleme sind Aliasing in der Ferne aufgrund fehlendes Mipmapping und eine mögliche Verwischung von Details durch die Rauschunterdrückungsprozedur (Denoising). Um zu erfahren, wie Sie in diesem Modus benutzerdefinierte Shader mit prozeduralen Normalen verwenden können, lesen Sie den Abschnitt [[#Normal_mapping|Normal Mapping]].&lt;br /&gt;
&lt;br /&gt;
===== Dominant Direction =====&lt;br /&gt;
Dieser Modus ähnelt dem, was Enlighten und Progressive in Unity backen. Er ist mit den meisten Shadern kompatibel, generiert nur eine zusätzliche Map und der Laufzeit-Overhead ist minimal. Der Nachteil ist, dass das Bump Mapping eher blass und grau wirkt und sich deutlich von demselben Objekt unter Echtzeitbeleuchtung unterscheiden kann.&lt;br /&gt;
&lt;br /&gt;
===== RNM =====&lt;br /&gt;
Basierend auf der Radiosity Normal Mapping-Technik, die ursprünglich für HL2 ([https://steamcdn-a.akamaihd.net/apps/valve/2004/GDC2004_Half-Life2_Shading.pdf Folien]) entwickelt und später in vielen weiteren Spielen (z. B. Mirror’s Edge) verwendet wurde. Es werden insgesamt 3 HDR-Maps erzeugt und ist damit der Modus mit dem höchsten Speicherbedarf. Der Laufzeit-Overhead ist immer noch relativ gering. Dieser Modus ist außerdem präziser als Dominant Direction. Er ist besser darin, Oberflächenkontraste wiederzugeben und kann mit farbigem Licht umgehen, welches Normal Maps aus verschiedenen Winkeln beeinflusst.&lt;br /&gt;
&lt;br /&gt;
===== SH =====&lt;br /&gt;
Basierend auf dem “Precomputed Global Illumination in Frostbite” [https://media.contentapi.ea.com/content/dam/eacom/frostbite/files/gdc2018-precomputedgiobalilluminationinfrostbite.pdf Papier]. Dies ist der Modus mit der höchsten Qualität, der einen deutlich besseren Oberflächenkontrast bietet und unterschiedlich gefärbtes Licht aus verschiedenen Richtungen darstellen kann. Erzeugt insgesamt 4 Maps, von denen nur eine HDR ist, und benötigt daher weniger Speicherplatz als RNM. Der Laufzeit-Overhead ist etwas höher als bei RNM.&lt;br /&gt;
&lt;br /&gt;
===== MonoSH =====&lt;br /&gt;
[[File:FY8Ru8hWIAAdYYH.jpg|thumb|Größen/Qualitätsvergleich von Dominant Direction, SH und MonoSH]]&lt;br /&gt;
Wie SH, jedoch unter Verwendung monochromatischer L1-Richtungskoeffizienten. Ähnlich guter Oberflächenkontrast, obwohl unterschiedliche Farben, die aus verschiedenen Richtungen auf ein Texel fallen, nicht genau wiedergegeben werden; für viele Szenen jedoch ausreichend. Es wird nur eine zusätzliche Map generiert, sodass die VRAM-Nutzung/Bandbreite ähnlich ist wie bei Dominant Direction; tatsächlich ist sie sogar noch geringer, da Dominant Direction RGBA-kodierte Maps verwendet, während MonoSH nur RGB benötigt. Die Map wird über das integrierte Richtungs-Lightmap-System gespeist, ''sieht jedoch mit Standard Shadern nicht korrekt aus''. Achten Sie darauf, einen kompatiblen Shader zu verwenden.&lt;br /&gt;
&lt;br /&gt;
===== Einschränkungen =====&lt;br /&gt;
&lt;br /&gt;
* RNM und SH/MonoSH können nur mit dem [[#Bakery_shaders|Bakery Shader]] verwendet werden oder benötigen Anpassungen an Ihren Shadern.&lt;br /&gt;
* Im RNM- und SH-Modus werden keine Standard-Farb-Lightmaps erstellt. Sie müssen entweder den Bakery Shader für alle Materialien in der Szene verwenden oder [[#Bakery_Lightmap_Group_Selector|Lightmap Groups]] einsetzen, um RNM/SH-Objekte von den übrigen zu trennen.&lt;br /&gt;
* RNM- und SH-Maps werden mithilfe von [https://docs.unity3d.com/ScriptReference/MaterialPropertyBlock.html MaterialPropertyBlock] auf Objekte angewendet und werden daher möglicherweise nicht vollständig im Lighting Fenster von Unity angezeigt.&lt;br /&gt;
* Die Modi Dominant Direction, RNM and SH/MonoSH erfordern möglicherweise etwas mehr Samples für GI und Light Meshes, um eine vergleichbare Qualität erzielen zu können.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Texels per unit ===&lt;br /&gt;
[[File:Texelscomp.jpg|thumb|1 vs 10 texels per unit]]&lt;br /&gt;
Ungefähre Anzahl der Lightmap-Texel pro Welteinheit. Beeinflusst die Anzahl und Auflösung der generierten Lightmaps.&lt;br /&gt;
&lt;br /&gt;
Beispielwerte für den Einstieg:&lt;br /&gt;
* Großer Außenbereich (z. B. eine Stadt): 1 - 5&lt;br /&gt;
* Mittlerer Außenbereich (einige Gassen): 10-20&lt;br /&gt;
* Hochwertige Innenbeleuchtung: 100&lt;br /&gt;
&lt;br /&gt;
Es wird davon ausgegangen, dass der Maßstab der Szene ungefähr 1 Einheit = 1 Meter beträgt. Eine solche Skalierung wird im Allgemeinen bei der Arbeit in Unity empfohlen, um eine bessere Navigation und Physiksimulation zu erzielen. Wenn Ihre Skalierung anders ist, multiplizieren Sie die Texel entsprechend.&lt;br /&gt;
&lt;br /&gt;
Beachten Sie, dass Texels per unit die Basisauflösung ist, aber jedes Objekt noch zusätzlich mit [https://docs.unity3d.com/Manual/class-MeshRenderer.html Scale in Lightmap] in den Mesh Renderern sowie mit [[#Scale per map type|Scale per map type]] im Bakery Fenster angepasst werden kann.&lt;br /&gt;
&lt;br /&gt;
{{note| Objekte, bei denen Scale in Lightmap auf 0 gesetzt ist, werden nicht gebacken, werfen jedoch weiterhin Schatten und beeinflussen GI.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Max resolution ===&lt;br /&gt;
Maximale Größe der Lightmap. Falls alle Objekte nicht in eine einzelne Lightmap passen (bei gegebenem Texels Per Unit-Wert), werden zusätzliche Lightmaps zugewiesen. Dieselben vier quadratischen Objekte können vier 512x512-Maps oder eine 1024x1024-Map belegen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bounces ===&lt;br /&gt;
[[File:Image36.png|thumb|Note how more bounces bring more light to closed spaces.]]&lt;br /&gt;
Legt fest, wie oft Lichtstrahlen von Oberflächen reflektiert werden sollen. In der Regel sind niedrige Werte für Außenbereiche (z. B. eine Stadt) ausreichend, während für geschlossene Bereiche (Innenräume, Höhlen) höhere Werte erforderlich sind.&lt;br /&gt;
&lt;br /&gt;
Der Schieberegler ist zwar auf 5 Reflektierungen begrenzt, es ist jedoch möglich, eine beliebige Anzahl von Reflektierungen in das Zahlenfeld einzugeben.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Samples ===&lt;br /&gt;
[[File:Image7.png|thumb|Links: samples = 4, rechts: samples = 16. Zur Veranschaulichung wurde die Rauschunterdrückung (Denoising) deaktiviert.]]&lt;br /&gt;
Beeinflusst die Qualität von GI. Typische Werte liegen zwischen 16 und 32.&lt;br /&gt;
&lt;br /&gt;
{{note| Es ist möglich, eine beliebige Zahl einzugeben, die über dem maximalen Schiebereglerwert liegt. Beachten Sie jedoch, dass diese Zahl die Quadratwurzel der endgültigen Strahlanzahl darstellt - d. h. 32 entspricht 1024 Strahlen, 64 entspricht 4096 Strahlen usw.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GPU Priority ===&lt;br /&gt;
Während die GPU an Lightmaps arbeitet, können das Betriebssystem und andere Software weniger reaktiv werden. Mit dieser Option können Sie ein Gleichgewicht zwischen der Baking-Geschwindigkeit und der Reaktionsfähigkeit des Systems herstellen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render ===&lt;br /&gt;
Backt Lightmaps für alle geöffneten Szenen.&lt;br /&gt;
Wenn [[Manual#Light_probe_mode|Light Probe Mode]] auf L1 oder L2 eingestellt ist, werden auch Light Probes mitgebacken.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Render Light Probes ===&lt;br /&gt;
Backt [https://docs.unity3d.com/Manual/LightProbes.html Light Probes] für alle geöffneten Szenen.&lt;br /&gt;
&lt;br /&gt;
Beachten Sie, dass Sie für korrekte Mixed light Schatten auf dynamischen Objekten im Shadowmask-Modus auch [[Manual#Occlusion_probes|Okklusionsproben]] aktivieren müssen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Render Reflection Probes ===&lt;br /&gt;
Backt [https://docs.unity3d.com/Manual/class-ReflectionProbe.html Reflection Probes] für alle geöffneten Szenen. Diese Schaltfläche dient lediglich der Benutzerfreundlichkeit und ruft die interne Aktualisierungsroutine der Engine für Reflection Probes auf.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update Skybox Probe ===&lt;br /&gt;
Backt globale Diffuse- und Reflection Probes für die aktuelle Skybox. Wie bei &amp;quot;Render Reflection Probes&amp;quot; werden lediglich integrierte Engine-Funktionen aufgerufen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Occlusion probes ===&lt;br /&gt;
Lässt Unity beim Rendern von Light Probes Okklusionsproben mit dem aktuell ausgewählten integrierten Lightmapper backen. Okklusionsproben sind zusätzliche Daten, die in regulären Light Probes gespeichert werden und verhindern, dass dynamische Objekte in schattigen Bereichen beleuchtet werden. Derzeit gibt es keine Möglichkeit, benutzerdefinierte Okklusionsproben in Unity zu erstellen, weshalb Unity’s eigene Lightmapper aufgerufen werden müssen, um diese Aufgabe zu erledigen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Warnings ===&lt;br /&gt;
Diese Optionen validieren die Szene, nachdem eine der Render-Schaltflächen gedrückt wurde, und zeigen Warnungsdialogfelder an, in denen Sie gefragt werden, ob Sie den Backvorgang fortsetzen oder beenden möchten.&lt;br /&gt;
* Suppress all popups: Nach dem Drücken von Render werden keine Dialogfelder mehr angezeigt.&lt;br /&gt;
* UV validation: Überprüft, ob alle Modelle vollständig korrekte Lightmapping UVs aufweisen – insbesondere, ob sie im Bereich von 0 bis 1 liegen und sich nicht überlappen.&lt;br /&gt;
* Overwrite check: Teilt mit, ob und welche Lightmap-Dateien überschrieben werden.&lt;br /&gt;
* Memory check: Gibt einen sehr ungefähren Wert für den benötigten Videospeicher an.&lt;br /&gt;
* Sample count check: Überprüft, ob Lichter, GI oder AO unangemessene Sample-Werte aufweisen, die dazu führen könnten, dass die GPU ihre verfügbaren Ressourcen überschreitet.&lt;br /&gt;
* Lightmapped prefab validation: Validiert Lightmapped Prefabs und benachrichtigt Sie, falls Prefabs überschrieben werden.&lt;br /&gt;
&lt;br /&gt;
== Erweiterte Rendereinstellungen ==&lt;br /&gt;
=== Light probe mode ===&lt;br /&gt;
Ändert die Art und Weise, wie Light Probes gebacken werden.&lt;br /&gt;
&lt;br /&gt;
* Legacy: Verwenden Sie die Schaltfläche Render Light Probes, um Probes zu rendern. Punkt- und direktionale Lichter werden innerhalb des Lightmappers berechnet, während Flächen-/Himmels-/indirekte Beleuchtung durch das Rendern einer Cubemap an jeder Probenposition erfasst wird. Die Ergebnisse werden als [https://docs.unity3d.com/ScriptReference/Rendering.SphericalHarmonicsL2.html sphärische Harmonische der Ordnung L2] gespeichert. Die Nachteile sind eine langsame Cubemap-Rendering-Leistung und mögliche Abweichungen zwischen Lightmaps und Probes in Fällen, in denen Shader in Ihrem Spiel beleuchtete Oberflächen nicht physikalisch darstellen können oder Ihr Projekt für mobile Endgeräte eingerichtet ist (Unity kann hohe Intensitätswerte wegschneiden).&lt;br /&gt;
&lt;br /&gt;
* L1: Light Probes werden zusammen mit Lightmaps gerendert, wenn Sie auf Render klicken. Diese Einstellung bietet eine überlegendere Backleistung und garantiert, dass die Beleuchtung der Proben mit den Lightmaps übereinstimmen. Ergebnisse werden als sphärische Harmonische der Ordnung L1 gespeichert (und können weiterhin von regulären Shadern verwendet werden). Durch Anwendung der Einstellung Non-Linear Light Probe SH im [[#Bakery_shaders|Bakery Shader]] können die Ergebnisse weiter verbessert werden.&lt;br /&gt;
&lt;br /&gt;
* L2: überragende Qualität (vollständige sphärische Harmonische der Ordnung L2). Wie bei L1, werden sie automatisch zusammen mit Lightmaps gerendert. Vernachlässigbare Auswirkungen auf die Leistung im Vergleich zu L1. Sollte mit allen Shadern gut aussehen. Kontrast/Direktionalität/Ringing-Entfernung der Proben kann über Project Settings -&amp;gt; Bakery -&amp;gt; &amp;quot;Ringing removal for L2 light probes&amp;quot; angepasst werden.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Es scheint einen Fehler in Unity 2019.3 zu geben, der verhindert, dass Legacy Light Probe-Farben ordnungsgemäß gespeichert werden, falls die Einstellung [[Manual#Occlusion_probes|Occlusion probes]] aktiviert ist. Der L2-Modus ist jetzt der Standardmodus und wird bei Verwendung von Okklusionsproben empfohlen.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Asset UV Processing ===&lt;br /&gt;
Konfiguriert die UV Padding-Anpassung für Assets. Mögliche Werte:&lt;br /&gt;
* Don't change: Es werden keine Änderungen an Assets vorgenommen.&lt;br /&gt;
* Adjust UV padding: Sucht nach Modellen mit automatisch generierten UVs (“Generate Lightmap UVs” auf dem Asset) und passt diese weiter an, um ein korrektes Padding zwischen den UV-Inseln pro Mesh zu erzielen. Die modellweite Pack Margin in den Importeinstellungen wird ignoriert. Stattdessen werden optimale Werte berechnet, basierend auf der Fläche jedes Meshes und der Auflösung der Lightmap.&lt;br /&gt;
* Adjust UV padding for new meshes only: Wie oben, jedoch werden alle Modelle übersprungen, die zuvor mindestens einmal angepasst wurden.&lt;br /&gt;
* Remove UV adjustments: Hebt alle vorherigen UV-Anpassungen auf und lässt automatisch unwrappte Modelle so aussehen, wie Unity sie ursprünglich unwrappt hat.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser ===&lt;br /&gt;
Legt den gewünschten Denoiser fest. Mögliche Werte:&lt;br /&gt;
* Optix 5: Verwendet den OptiX 5.1 AI-Denoiser (früher bekannt als &amp;quot;Legacy denoiser&amp;quot;). Läuft auf der GPU. Unterstützt auf allen Grafikkarten von [https://en.wikipedia.org/wiki/Kepler_(microarchitecture) Kepler] (GeForce 6xx) bis [https://en.wikipedia.org/wiki/Turing_(microarchitecture) Turing] (Geforce 20xx). Nicht unterstützt auf [https://en.wikipedia.org/wiki/Ampere_(microarchitecture) Ampere] (30xx)-Grafikkarten. OptiX 5.1 verwendet einen statischen Trainingsdatensatz, der darin eingebettet ist, sodass er nicht von der Treiberimplementierung beeinflusst wird.&lt;br /&gt;
* Optix 6: Verwendet den OptiX 6.0 AI-Denoiser (war zuvor die Standardeinstellung). Läuft auf der GPU. Scheint auf Kepler (6xx)-GPUs nicht zu funktionieren, läuft dafür aber auf neueren Modellen - einschließlich Ampere (30xx). Seit Version 6.0 befindet sich der Trainingsdatensatz für den OptiX Denoiser im Grafikkartentreiber. Das Verhalten war vor Treiberversion 442.50 ähnlich wie bei OptiX 5.1; nach diesem Treiber hat NVIDIA jedoch [https://forums.developer.nvidia.com/t/optix7-denoiser-different-results-with-different-version-of-drivers/117989/2 den Datensatz geändert], sodass die Ergebnisse unterschiedlicher ausfallen können. Der aktualisierte Datensatz kann manchmal gitterartige Muster und hellere Kanten erzeugen (die jedoch mit [[Manual#Denoise:_fix_bright_edges|&amp;quot;Denoise: fix bright edges&amp;quot;]] behoben werden können), läuft aber schneller.&lt;br /&gt;
* Optix 7: Verwendet den OptiX 7.2 AI-Denoiser. Verhält sich ähnlich wie OptiX 6.0, wird jedoch möglicherweise besser von Ampere (30xx) unterstützt.&lt;br /&gt;
* OpenImageDenoise: Verwendet Intel Open Image Denoise. Läuft auf der CPU (jede CPU, die SSE 4.1 unterstützt). Kann etwas langsamer als OptiX sein, aber die Qualität ist vergleichbar.&lt;br /&gt;
* OpenImageDenoise2: Verwendet Intel Open Image Denoise 2 im CUDA-Modus. Läuft auf der GPU, die Leistung ist vergleichbar mit OptiX 6/7 und die Qualität ist identisch mit der CPU-Version.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Adjust sample positions ===&lt;br /&gt;
Findet die besten Positionen für die Proben, um Beleuchtungslecks zu vermeiden. Die Details des Algorithmus werden [https://ndotl.wordpress.com/2018/08/29/baking-artifact-free-lightmaps/#leaks hier] beschrieben. In einigen Fällen (in der Regel bei großen Geometrien mit sehr niedriger Polygonanzahl und glatten Normalen) kann es zu falschen Ergebnissen kommen. In diesem Fall können Sie die Funktion deaktivieren.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Unload scenes before render ===&lt;br /&gt;
Entlädt Szenen vor dem Backen, um Videospeicher freizugeben. Komplexere Szenen können allein durch die Anzeige im Editor mehrere Gigabyte VRAM beanspruchen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Denoise ===&lt;br /&gt;
[[File:Image31.png|thumb|Links: denoising deaktiviert, rechts: denoising aktiviert.]]&lt;br /&gt;
Wenn aktiviert, wird der Entrauschungsalgorithmus angewendet. Bakery verwendet [https://developer.nvidia.com/optix-denoiser NVIDIA’s AI-Denoiser (OptiX)] oder Intel's Open Image Denoise (falls ausgewählt).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Fix Seams ===&lt;br /&gt;
[[File:Image22.png|thumb|Left: seams, right: seams are fixed.]]&lt;br /&gt;
Wenn aktiviert, wird versucht, durch UV-Diskontinuitäten entstandene Übergänge zu glätten. Nützlich für glatte Geometrien - einschließlich der Standardkugel von Unity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Split by scene ===&lt;br /&gt;
Wenn mehrere Szenen gleichzeitig geladen werden und diese Option aktiviert ist, verfügt jede Szene über einen eigenen Satz Lightmaps, der nicht mit anderen geteilt wird. Dies kann hilfreich sein, um die Anzahl der geladenen Texturen zu begrenzen, wenn Szenen während der Laufzeit gestreamed werden.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hole filling ===&lt;br /&gt;
[[File:Holefilling.jpg|thumb|Lochfüllung aus vs. ein.]]&lt;br /&gt;
Wenn [[Manual#Atlas_Packer|Atlas Packer]] auf xatlas eingestellt ist, wird versucht, jedes Loch zu füllen, was zu effizienteren Atlas-Texturen führt. Bei Szenen mit sehr komplexer Geometrie kann dies die Exportzeit der Szene verlängern, ist aber ansonsten empfehlenswert.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Min resolution ===&lt;br /&gt;
Mindestgröße für Lightmaps. Kann verwendet werden, um zwischen vielen kleinen, aber vollständig belegten Lightmaps und wenigen unvollständig gefüllten Lightmaps abzuwägen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Scale per map type ===&lt;br /&gt;
Ermöglicht es Ihnen, die Auflösung von Color/Shadowmask/Direction-Maps unterschiedlich zu skalieren. Ein häufiger Fall wäre beispielsweise eine indirekte Färbung mit niedriger Auflösung, aber einer sehr detaillierten Shadowmask. Beachten Sie, dass die Skalierung erst nach dem Rendern der Lightmaps angewendet wird, sodass keine Zeit beim Baking eingespart wird. Wenn “Adjust UV padding” aktiviert ist, basiert das Padding auf der Map mit der niedrigsten Auflösung, um Texel-Leaking zu verhindern.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Checker preview ===&lt;br /&gt;
[[File:Image12.png|thumb|Checker preview in Aktion]]&lt;br /&gt;
Wenn das Kontrollkästchen Show checker aktiviert ist, rendert die Scene View ein Schachbrettmuster über alle sichtbaren Objekte, um die Größe der Lightmap-Texel anzuzeigen. Dies ist nützlich, um sicherzustellen, dass Sie vor dem Backen angemessene Werte für Texels Per Unit und andere Einstellungen, die sich auf die Auflösung auswirken, verwenden.&lt;br /&gt;
&lt;br /&gt;
Durch das Aktivieren der Checker preview wird Bakery gezwungen, Atlas Packing durchzuführen. Dies kann einige Sekunden dauern. Klicken Sie auf Refresh checker, um die Szene nach einer vorgenommenen Änderung neu zu atlasieren und die Änderungen anzuzeigen.&lt;br /&gt;
&lt;br /&gt;
Checker preview verwendet ebenfalls zufällige Farben, um zu zeigen, wie die Szene in verschiedene Lightmaps aufgeteilt sein wird.&lt;br /&gt;
&lt;br /&gt;
{{note| Checker preview zeigt derzeit keine korrekten Texel-Größen für Terrains an.}}&lt;br /&gt;
&lt;br /&gt;
==== Atlas preview ====&lt;br /&gt;
[[File:FN-TmhRXwAE9i2I.png|thumb|Atlas preview in Aktion]]&lt;br /&gt;
Die Schaltfläche Atlas preview ist sichtbar, wenn die Checker preview aktiviert ist. Durch Anklicken öffnet sich ein neues Fenster, in dem die UV-Layouts zukünftiger Lightmaps angezeigt werden. Sie können mithilfe der &amp;quot;&amp;lt;&amp;quot; und &amp;quot;&amp;gt;&amp;quot; Schaltflächen zwischen den Lightmaps wechseln.&lt;br /&gt;
Dies kann nützlich sein, um vor dem Backen die Packungsqualität und die Anzahl der Lightmaps zu überprüfen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Emissive boost ===&lt;br /&gt;
Multipliziert jede Oberflächenemission mit dieser Zahl.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Indirect boost ===&lt;br /&gt;
Multipliziert alle reflektierten Lichtstrahlen mit diesem Wert. Entspricht der Indirect Intensity-Einstellung bei Licht-Komponenten, gilt jedoch global.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Backface GI ===&lt;br /&gt;
[[File:Image30.jpg|thumb|Backface GI]]&lt;br /&gt;
[[File:Image35.png|thumb|Links: backface GI = 0, rechts: backface GI = 1. Beachten Sie, wie schattige Bereiche mehr grünes Licht erhalten.]]&lt;br /&gt;
Bestimmt, wie viel Licht durch die Vorderfläche zur Rückfläche gelangt und dann von GI reflektiert wird. Dies ist besonders nützlich für dünne, durchscheinende Oberflächen wie Blätter. Die Werte liegen im Bereich von 0 bis 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Ambient occlusion ===&lt;br /&gt;
[[File:Image15.png|thumb|Left: AO intensity = 0. Right: AO intensity = 1.]]&lt;br /&gt;
Einfache nicht-physikalische Umgebungsverdeckung, die Sie aus ästhetischen Gründen über die endgültige Szenenbeleuchtung legen können.&lt;br /&gt;
* Intensity: Steuert die Sichtbarkeit des AO-Effekts. Ein Wert von 0 deaktiviert den Effekt.&lt;br /&gt;
* Radius: Legt die im AO-Effekt verwendete Strahlungsentfernung fest. Kleinere Werte führen zu lokalisierten Verdunkelungen (Ecken, Falten), während höhere Werte eher einem Skylight ähneln und Schatten von weiter entfernten Objekten erzeugen.&lt;br /&gt;
* Samples: Beeinflusst die Qualität der Umgebungsverdeckung. Typische Werte liegen zwischen 4 und 32.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dither transparency ===&lt;br /&gt;
Aktiviert halbtransparente Schatten durch das automatische Dithering von Alpha-Texturen. Lernen Sie, [[Manual#Opacity|wie Bakery Opacity Maps interpretiert]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== RTX Mode ===&lt;br /&gt;
Aktiviert die RTX-Hardwarebeschleunigung. Nur RTX-GPUs profitieren von dieser Einstellung. Die minimal unterstützte Treiberversion ist 418.&lt;br /&gt;
&lt;br /&gt;
Treiber können den RTX-Modus auf den meisten Nicht-RTX NVIDIA-Karten emulieren, aber das Ergebnis ist in der Regel langsamer.&lt;br /&gt;
&lt;br /&gt;
Der RTX-Modus '''muss''' auf Ampere (3xxx) oder neueren Karten aktiviert sein.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Export terrain trees ===&lt;br /&gt;
Wenn diese Einstellung aktiviert ist, beeinflussen Bäume auf Terrain die Beleuchtung. Die Bäume selbst werden nicht gebacken. Beachten Sie, dass beim Backen für jeden Baum die höchstmögliche LOD-Stufe verwendet wird. Daher wird es nicht empfohlen, diese Einstellung für die Darstellung von mehreren Kilometern großen Wäldern mit hochdetaillierten Modellen zu verwenden.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Terrain optimization ===&lt;br /&gt;
Wenn aktiviert (Standard), verwenden Terrains eine separate Raytracing-Technik, um die Vorteile ihrer Höhenfeldgeometrie zu nutzen. Andernfalls werden sie wie jedes andere Mesh behandelt. Terrain optimization reduziert den Speicherbedarf für hochauflösende Landschaften erheblich. In einigen Fällen kann es auch das Backen des Terrains beschleunigen, in anderen Fällen (insbesondere bei einfachen Landschaften mit niedriger Auflösung) kann es sinnvoll sein, sie zu deaktivieren.&lt;br /&gt;
&lt;br /&gt;
{{note| Terrain Optimization ist derzeit nicht mit Terrainlöchern kompatibel. Deaktivieren Sie die Einstellung, damit sie funktionieren.}}&lt;br /&gt;
{{note| Terrain Optimization wird nur im Nicht-RTX-Modus unterstützt.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Light Mesh batch limit ===&lt;br /&gt;
Wenn dieser Wert über 0 liegt, werden mehrere [[Manual#Bakery_Light_Mesh|Light Meshes]] zu einem zusammengefasst, vorausgesetzt, sie haben identische Einstellungen und wirken sich auf dieselben [[Manual#Bakery_Lightmap_Group_Selector|Lightmap Groups]] aus, wobei ihre Gesamtzahl an Samples jedoch auf diesen Wert begrenzt wird (d. h. wenn das Limit 64 beträgt, können 2 Lichter mit Samples=32 oder 4 Lichter mit Samples=16 usw. zusammengefasst werden). Dies erhöht die Leistung in Szenen mit vielen Light Meshes. Achten Sie darauf, diesen Wert nicht zu hoch einzustellen, da ansonsten die GPU bei der Verarbeitung zu vieler Samples gleichzeitig das Zeitlimit des Betriebssystemtreibers erreichen könnte.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Compress volumes ===&lt;br /&gt;
Wenn aktiviert, wird die Texturkomprimierung auf 3D-Volumen-Texturen angewendet und die Bakery Shader werden auf einen entsprechenden Abtastmodus umgeschaltet. Nicht empfohlen für Volumes mit sehr niedriger Auflösung. Die Volumengröße kann auf ein Vielfaches von 4 erhöht werden.&lt;br /&gt;
&lt;br /&gt;
Anmerkungen:&lt;br /&gt;
* Derzeit kann nur in die Texturenformate BC6H/BC7 (Desktop/Konsolen) komprimiert werden.&lt;br /&gt;
* Die Volumenkomprimierung wird nur in Unity 2020.1 oder neuer unterstützt.&lt;br /&gt;
* Derzeit unterstützt nur der Bakery Shader für die Built-In Render Pipeline die Verwendung komprimierter Volumes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Samples multiplier ===&lt;br /&gt;
Multipliziert alle Schatten- und GI-Samples mit dem angegebenen Faktor. Verwenden Sie diese Einstellung, um schnell zwischen Entwurfs- und Endqualität zu wechseln.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Tile size ===&lt;br /&gt;
Wie bei der [[#GPU Priority|GPU Priority]], jedoch legen Sie anstelle der abstrakten Priorität die Kachelgröße fest. Bakery teilt Lightmaps in kleinere Kacheln auf und aktualisiert diese nacheinander. Eine kleinere Größe bedeutet mehr Unterbrechungen in der GPU-Arbeit und kann das System reaktionsfähiger machen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Temp path ===&lt;br /&gt;
Ordner für temporäre Dateien. Bakery benötigt während des Renderns möglicherweise einige Gigabyte freien Speicherplatz. Wenn sich dieser Ordner auf einer SSD befindet, kann das Rendern im Vergleich zu einer HDD etwas schneller erfolgen. Derzeit wird dieser Ordner nicht automatisch bereinigt. Sie können den Inhalt jederzeit (außer während des Renderns) manuell oder über Bakery -&amp;gt; Utilities -&amp;gt; Clear cache löschen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Output path ===&lt;br /&gt;
Ordner für Lightmaps. Hier werden alle Lightmap-, Light Probe- und Vertex-Color Assets gespeichert. Dieser Pfad ist relativ zu Ihrem Assets Ordner.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Use scene named output path ===&lt;br /&gt;
Wenn diese Einstellung aktiviert ist, wird der Ausgabepfad automatisch auf einen Ordner mit dem gleichen Namen wie die aktuell aktive Szene gesetzt (Assets/AktuellerSzenenName/). Dies ähnelt dem Verhalten der integrierten Unity Lightmapper.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render Selected Groups ===&lt;br /&gt;
Backt nur [[#Bakery_Lightmap_Group_Selector|Lightmap Groups]], die ausgewählte Objekte enthalten.&lt;br /&gt;
Nicht nur ausgewählte Objekte werden neu gezeichnet, sondern auch alle Lightmap Groups, zu denen sie gehören. Andere Lightmaps werden nicht aktualisiert. Falls Objekte nicht zu einer manuell zugewiesenen Gruppe gehören, wird ein Teil der Szene, der dieselbe Lightmap verwendet, neu berechnet.&lt;br /&gt;
&lt;br /&gt;
Derzeit ist es praktischer, [[Partial_scene_baking|Sektoren für das teilweise Backen von Szenen zu verwenden]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Beep on finish ===&lt;br /&gt;
Wenn diese Einstellung aktiviert ist, gibt Bakery nach Abschluss des Backvorgangs einen Ton aus.&lt;br /&gt;
&lt;br /&gt;
== Experimentelle Rendereinstellungen ==&lt;br /&gt;
=== Unwrapper ===&lt;br /&gt;
Definiert den zu verwendenden Unwrapper, wenn [[#Asset_UV_Processing|Adjust UV Padding]] aktiviert ist.&lt;br /&gt;
* Default: Standard Unity Unwrapper. Bakery ruft [https://docs.unity3d.com/ScriptReference/Unwrapping.GenerateSecondaryUVSet.html Unwrapping.GenerateSecondaryUVSet] für jedes Mesh mit unterschiedlichen Padding-Parametern auf.&lt;br /&gt;
* xatlas: Verwendet [https://github.com/jpcy/xatlas xatlas] von [https://github.com/jpcy jpcy] - eine modifizierte Version von [https://github.com/Thekla/thekla_atlas thekla_atlas] des Entwicklers [https://github.com/castano Ignacio Castaño]. thekla_atlas wurde im Spiel The Witness ([http://the-witness.net/news/2010/03/graphics-tech-texture-parameterization/ Blog post]) eingesetzt.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Atlas Packer ===&lt;br /&gt;
Wählt den Algorithmus aus, der beim Packen verschiedener Objekt-UV-Layouts in große Lightmap-Atlas-Texturen verwendet werden soll.&lt;br /&gt;
* Default: Originalalgorithmus, den Bakery vor Version 1.7 verwendet hat.&lt;br /&gt;
* xatlas: Verwendet xatlas.&lt;br /&gt;
&lt;br /&gt;
Einige Funktionen werden nur mit einem Atlas Packer unterstützt:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Default&lt;br /&gt;
! xatlas&lt;br /&gt;
|-&lt;br /&gt;
| [[Manual#Bakery_Lightmap_Group_Selector|Override resolution]]&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
|-&lt;br /&gt;
| Efficient LOD packing&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|-&lt;br /&gt;
| [[Manual#Hole_filling|Hole filling]]&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Beachten Sie, dass der Atlas Packer auch für jede Lightmap Group separat ausgewählt werden kann.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Export geometry and maps ===&lt;br /&gt;
Wenn diese Einstellung aktiviert ist, exportiert Bakery die Szene vor dem Rendern in ein für Bakery passendes Format. Falls Sie sich sicher sind, dass die Geometrie und Texturen in der Szene sowie die Einstellungen für die Lightmap-Auflösung nicht geändert wurden (z. B. wenn Sie nur GI- oder Lichteinstellungen angepasst haben), können Sie dieses Kontrollkästchen deaktivieren, um das nächste Rendern zu beschleunigen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update unmodified lights ===&lt;br /&gt;
Wenn diese Einstellung aktiviert ist, berechnet Bakery die Lichtquellen neu, die sich seit dem letzten Rendern nicht verändert haben. Falls Sie nur eine Lichtquelle anpassen und nicht warten möchten, bis alle anderen Lichtquellen neu gerendert werden, können Sie dieses Kontrollkästchen deaktivieren.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update modified lights and GI ===&lt;br /&gt;
Wenn diese Einstellung aktiviert ist, berechnet Bakery GI und die Lichter, die seit dem letzten Rendern geändert wurden, neu.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== UV padding: increase only ===&lt;br /&gt;
Nur sichtbar wenn [[#Asset_UV_Processing|Adjust UV padding]] aktiviert ist. Standardmäßig wird das optimale UV-Padding für ein Modell-Asset nur auf der Grundlage der aktuell geladenen Szenen berechnet. Falls mehrere Instanzen desselben Modells unterschiedliche Lightmap-Auflösungen verwenden, bestimmt die kleinste davon das Padding, sodass der Abstand zwischen den UV-Flächen groß genug ist, um ein Überlappen zu verhindern. Jedoch kann das Backen desselben Modells in zwei verschiedenen isolierten Szenen dazu führen, dass die UVs in den vorherigen Szenen beschädigt werden, während sie für die neue Szene optimiert werden. Dieses Kontrollkästchen verhindert ein solches Verhalten, indem es den Padding-Wert niemals verringert, sodass er immer für die Instanz mit der niedrigsten Auflösung optimiert wird, die jemals gebacken wurde.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoise: fix bright edges ===&lt;br /&gt;
[[File:Image19.png|thumb|Links: Nach der Rauschunterdrückung ist ein heller Rand sichtbar; Rechts: behoben.]]&lt;br /&gt;
Nur sichtbar wenn [[#Denoise|Denoise]] aktiviert ist. Manchmal kann das zur Rauschunterdrückung verwendete neuronale Netz helle Kanten um Schatten herum erzeugen, als wäre ein Schärfeeffekt angewendet worden. Wenn diese Option aktiviert ist, versucht Bakery, diese herauszufiltern. Die Denoising-Phase kann bei Aktivierung etwas langsamer werden.&lt;br /&gt;
&lt;br /&gt;
Diese Funktion kann auch zum Filtern von &amp;quot;fireflies&amp;quot; verwendet werden, d. h. gelegentlich auftretende helle Punkte auf der Lightmap.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Post-packing ===&lt;br /&gt;
Manchmal kann Bakery beim Rendern einer Szene die Lightmap in mehrere Sub-Lightmaps aufteilen, z. B. beim Backen verschiedener LODs oder Terrains.&lt;br /&gt;
Post-packing versucht, die endgültige Atlasanzahl zu minimieren, indem diese Sub-Lightmaps zu einer Textur kombiniert werden.&lt;br /&gt;
Es wird empfohlen, diese Einstellung aktiviert zu lassen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Combine with Enlighten real-time GI ===&lt;br /&gt;
Wenn diese Einstellung aktiviert ist, wird beim Klicken der Schaltfläche Render zunächst versucht, mit Enlighten zu backen, um Echtzeit-GI zu berechnen. Danach erfolgt der reguläre Bakery-Lightmapping-Prozess. Sowohl gebackene als auch Echtzeit-GI werden dann zusammen verwendet.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bake on remote server ===&lt;br /&gt;
Aktiviert [[Network baking|Backen über das Netzwerk]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Presets ===&lt;br /&gt;
Wird derzeit unter den Schaltflächen Render/Update angezeigt, wenn sich die Einstellungen im Experimental-Modus befinden.&lt;br /&gt;
* Klicken Sie auf '''New''', um alle aktuellen Einstellungen in einer Voreinstellungsdatei zu speichern.&lt;br /&gt;
* Standardmäßig sind alle Einstellungen ausgegraut, wenn eine Voreinstellung aktiv ist, um ein Überschreiben der Voreinstellung zu verhindern.&lt;br /&gt;
* Klicken Sie auf '''Modify preset''', um die Einstellungen zu ändern und die Voreinstellungsdatei zu überschreiben.&lt;br /&gt;
* Voreinstellungsdateien können über das Voreinstellungsfeld ausgetauscht werden. Deaktivieren Sie die Verwendung von Voreinstellungen, indem Sie die Einstellung auf None setzen.&lt;br /&gt;
&lt;br /&gt;
== Komponenten ==&lt;br /&gt;
=== Bakery Lightmap Group Selector ===&lt;br /&gt;
&lt;br /&gt;
Legt fest, welche '''Lightmap Group''' für das Objekt und alle seine untergeordneten Objekte verwendet werden soll.&lt;br /&gt;
Lightmap Group ist ein Begriff, den Bakery für eine Sammlung von Objekten verwendet, die sich eine Lightmap teilen. Groups haben Eigenschaften, die Bakery mitteilen, wie die Objekte gepackt werden sollen, welche Lichter sie beeinflussen sollen und ob das Ergebnis in eine Textur oder in Eckpunkte (Vertices) gebacken werden soll.&lt;br /&gt;
Standardmäßig werden alle statischen Objekte automatisch in mehrere Lightmap Groups (Atlas-Texturen) gepackt, sodass Sie sich keine Gedanken darüber machen müssen. Die manuelle Definition von Gruppen sollte nur für spezielle Zwecke verwendet werden - zum Beispiel:&lt;br /&gt;
* Markieren von Objekten, damit diese [[Vertex Lightmaps|Per-vertex Lightmaps]] statt Texturen verwenden.&lt;br /&gt;
* Backen einer Lightmap unter Verwendung exakter, nicht skalierter UVs, so wie sie in einer Modellierungssoftware vorhanden waren.&lt;br /&gt;
* Gruppierung bestimmter Bereiche des Levels, um eine einzige Lightmap zu verwenden und damit das Streaming von Ressourcen zu erleichtern oder um während der Laufzeit mittels Skripte zwischen verschiedenen gebackenen Beleuchtungen zu wechseln.&lt;br /&gt;
* Verwenden der Using Render Selected Groups-Schaltfläche, um nur gruppierte Objekte zu aktualisieren.&lt;br /&gt;
&lt;br /&gt;
Um eine Gruppe manuell zu definieren, müssen Sie ein '''Lightmap Group Assets''' erstellen - entweder über das Assets-&amp;gt;Create Menü, oder mithilfe der Create New-Schaltfläche auf der Komponente. Wenn die Schaltfläche Create New verwendet wurde, wird ein neues Asset mit folgenden Eigenschaften erstellt:&lt;br /&gt;
* Name: Name des zu erstellenden Lightmap Group Asset.&lt;br /&gt;
* Packing mode: Dieser Selektor definiert den Packmodus der Lightmap Group. Es gibt 3 Modi:&lt;br /&gt;
** Original UV: Das Objekt und seine untergeordneten Objekte werden mit unveränderten UVs gebacken. Packing wird nicht vorgenommen. Dies ist nützlich für Modelle, bei denen mehrere Meshes dasselbe bereits gepackte UV-Layout verwenden.&lt;br /&gt;
** Pack Atlas: Das Objekt und seine untergeordneten Objekte werden in einen eigenen Texturatlas gepackt. Vor Version 1.3 musste jedes packbare untergeordnete Objekt über die Komponente verfügen, aber das ist nun nicht mehr erforderlich. Jedes untergeordnete Objekt wird als eigenes Rechteck gepackt - es sei denn, Bakery erkennt automatisch, dass ein untergeordnetes Objekt nicht überlappende untergeordnete Objekte hat. In diesem Fall können mehrere Objekte ein einziges Rechteck verwenden.&lt;br /&gt;
** Vertex: Das Objekt und seine untergeordneten Objekte verwenden anstelle von Texturen eine vertex-farbige gebackene Beleuchtung. Beachten Sie, dass Sie dafür einen benutzerdefinierten Shader benötigen - beispielsweise den [[#Bakery_shaders|Bakery Shader]]. Ein einfacher Shader (&amp;quot;Bakery/Simple Vertex Lightmapped&amp;quot;) ist bereits zu Demonstrationszwecken und als Referenz enthalten. [[Vertex Lightmaps|Lernen Sie mehr über Vertex Lightmaps.]]&lt;br /&gt;
* Directional mode: Ermöglicht es Ihnen, den [[#Directional mode|Directional Mode]] für die Gruppe zu überschreiben. Die Optionen sind identisch - mit Ausnahme von Auto, das einfach die globale Einstellung verwendet.&lt;br /&gt;
* Resolution: Gewünschte Auflösung der Lightmap.&lt;br /&gt;
* Auto-resolution: [[Manual#Texels_per_unit|Texels Per Unit]] verwenden, um die nächstgelegene Zweierpotenz (power of two) zu bestimmen.&lt;br /&gt;
* Atlas packer: Zu verwendender [[Manual#Atlas_Packer|Atlas Packing]]-Algorithmus für diese Gruppe.&lt;br /&gt;
* Bitmask: Eine Liste von Umschaltflächen, die verwendet werden können, um bestimmte Lichtquellen von der Beeinflussung der Lightmap auszuschließen. Jede Bakery-Lichtquelle verfügt auch über eine Bitmask-Einstellung. Lichter wirken sich nur auf Lightmap Groups aus, mit denen sie mindestens eine dieser Umschaltflächen gemeinsam haben. Die Standardeinstellung bedeutet, dass alle Lichter alle Lightmaps beeinflussen können.&lt;br /&gt;
&lt;br /&gt;
[[File:Ts.jpg|thumb|Transparenter Selbstschatten AUS vs. EIN: Beachten Sie, wie einige einseitige, aber nach hinten gerichtete Polygone nun korrekt beleuchtet werden]]&lt;br /&gt;
&lt;br /&gt;
Falls Sie eine Lightmap Group mit einem ihr zugewiesenem Pack Atlas-Modus haben, werden zusätzliche Einstellungen auf der Komponente angezeigt:&lt;br /&gt;
* Override resolution: Überschreibt die Auflösung, die dieses Objekt und seine untergeordneten Objekte in der Lightmap einnehmen.&lt;br /&gt;
* Resolution: Manuell festgelegte Auflösung. Wenn Sie beispielsweise eine Lightmap mit einer Auflösung von 512 haben, die vier Objekten mit einer überschriebenen Auflösung von 256 zugewiesen ist, generiert Bakery eine einzige Lightmap mit einer Größe von 512x512, wobei jedes Objekt genau 256x256 Flächen einnimmt.&lt;br /&gt;
&lt;br /&gt;
Wenn Sie ein Lightmap Group Asset auswählen, werden zusätzliche experimentelle Einstellungen angezeigt:&lt;br /&gt;
* [[Subsurface scattering|Subsurface scattering: (Klicken, um mehr zu erfahren)]]&lt;br /&gt;
* Normal offset: Erlaubt es Ihnen, Strahlen von der Oberfläche zu versetzen. Dies ist selten nützlich und dient hauptsächlich zu Versuchszwecken.&lt;br /&gt;
* Transparent selfshadow: Strahlen hinter der Oberfläche werfen, damit diese keine Schatten auf sich selbst wirft. Kann z. B. für durchscheinendes Laub hilfreich sein.&lt;br /&gt;
* Vertex sampling density (nur wenn Packing Mode auf Vertex eingestellt ist): Standardmäßig berechnet das Per-Vertex-Backen nur 1 Wert für jeden Vertex. Falls die Abtastdichte über 0 ist, wird stattdessen der Durchschnitt vieler über Dreiecke verteilter Abtastwerte gebildet, was zu supersamplierten, glatteren Ergebnissen führt.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Lightmapped Prefab ===&lt;br /&gt;
Diese Komponente erlaubt Prefabs das Speichern von Lightmapping-Metadaten. Solche Prefabs können dann, sowohl im Editor als auch während der Laufzeit, in jeder Szene instanziiert werden.&lt;br /&gt;
Die Komponente sollte direkt zum Wurzelobjekt des Prefabs hinzugefügt werden. Verschachtelte Prefabs werden nicht unterstützt. Da das Prefab nach dem Backen überschrieben wird (genauso wie beim Klick auf die Schaltfläche “Apply”), darf das Prefab keine unangewendeten Änderungen enthalten (untergeordnete Objekte dürfen nicht verschoben werden, Materialien und Skriptparameter müssen unverändert bleiben usw). Sollten solche Änderungen erkannt werden, wird in der Benutzeroberfläche der Komponente eine Fehlermeldung angezeigt und nach dem Backen werden keine Metadaten gespeichert. Falls die Warnung zur [[#Warnings|Lightmapped prefab validation]] aktiviert ist, werden eventuell vorhandene Prefab-Fehler vor dem Backen in einem Dialogfeld angezeigt.&lt;br /&gt;
&lt;br /&gt;
Lightmapped Prefabs unterstützen alle Bakery-Funktionen, wie LODs, Terrains, Directional Lightmaps, RNM, SH, Per-Vertex-Modi und Shadowmasks. Damit Shadowmasks funktionieren, müssen Lichter ebenfalls Teil desselben Prefabs sein.&lt;br /&gt;
&lt;br /&gt;
{{note| Beachten Sie, dass Shadowmasks von Prefabs aufgrund von API-Einschränkungen nur mit Unity 2017.4 oder neuer funktionieren.}}&lt;br /&gt;
&lt;br /&gt;
Nach dem Backen wird ein Objekt namens “BakeryPrefabLightmapData” zum Prefab hinzugefügt. Dieses Objekt enthält ein Skript mit allen erforderlichen Daten zum Anwenden der Lightmaps.&lt;br /&gt;
&lt;br /&gt;
Darüber hinaus ermöglicht Lightmapped Prefab das Speichern der aktuellen Render-Einstellungen und das Laden dieser Einstellungen in jede derzeit geöffnete Szene mithilfe zweier Schaltflächen:&lt;br /&gt;
* Save current render settings to prefab: Speichert eine Kopie der aktuellen Render-Einstellungen auf dieses Prefab.&lt;br /&gt;
* Load render settings from prefab: Setzt die aktuellen Render-Einstellungen auf die vom Prefab gespeicherten Werte.&lt;br /&gt;
[[File:Upload 2019-9-17 10-32-34.png|thumb|Anwenden des Prefabs]]&lt;br /&gt;
Beim Backen eines Lightmapped Prefabs wird empfohlen, Folgendes zu überprüfen:&lt;br /&gt;
* Das Prefab wurde &amp;quot;Angewendet&amp;quot;. Klicken Sie hierfür bei älteren Unity Versionen auf die Schaltfläche &amp;quot;Apply&amp;quot; in der oberen rechten Ecke des Inspector. Bei neueren Versionen klicken Sie stattdessen auf die &amp;quot;Overrides&amp;quot;-Dropdown-Liste und dann auf &amp;quot;Apply all&amp;quot;.&lt;br /&gt;
* Die Prefab-Komponenten UI zeigt keine Fehler an.&lt;br /&gt;
* Das &amp;quot;Lightmapped prefab validation&amp;quot;-Kontrollkästchen wurde im Hauptfenster von Bakery aktiviert. Diese Einstellung überprüft alle Lightmapped Prefabs in der Szene und benachrichtigt Sie über mögliche Probleme in einem Dialogfeld.&lt;br /&gt;
&lt;br /&gt;
{{note| Lightmaps werden entweder nach der Szene, in der sie gebacken wurden, oder nach der Lightmap Group (falls vorhanden) benannt. Wenn Sie also verschiedene Prefabs in derselben Szene backen, stellen Sie bitte sicher, dass Sie entweder eine anders benannte [[Manual#Bakery_Lightmap_Group_Selector|Lightmap Group]] verwenden oder den [[Manual#Output_path|Output Path]] ändern.}}&lt;br /&gt;
&lt;br /&gt;
{{note| Beim nacheinander Backen von mehreren Prefabs mit identischen Modellen wird empfohlen, die Einstellung [[Manual#Asset_UV_Processing|Asset UV Processing]] auf ''Don't Change'' zu belassen, um eine Veränderung gemeinsam genutzter UVs zu verhindern.}}&lt;br /&gt;
&lt;br /&gt;
{{note| Bakery's Prefab-Workflow wurde implementiert, bevor Unity über die Ansichtsfunktion &amp;quot;Doppelklick auf Prefab&amp;quot; verfügte. Daher werden Lightmaps in der isolierten Prefab-Ansicht möglicherweise nicht korrekt angewendet und die Komponente zeigt möglicherweise die Meldung &amp;quot;This GameObject is not a prefab&amp;quot; an. Es sollte wie erwartet funktionieren, wenn Sie in einer normalen Szene arbeiten.}}&lt;br /&gt;
&lt;br /&gt;
{{note|Wenn Sie zuvor gebackene Prefabs entpacken und von vorhandenen Lightmaps trennen, sollten Sie sicherstellen, dass das BakeryPrefabLightmapData-Objekt, welches die Prefab-weiten Lightmap-/Renderer-Verbindungen enthält, entfernt wurde.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Direct Light ===&lt;br /&gt;
[[File:Directlight.jpg|thumb|Reines direktes Licht mit GI]]&lt;br /&gt;
[[File:Image4.png|thumb|Links: shadow spread = 0.01, rechts: 0.05. Beachten Sie, wie Schatten zunächst scharf sind und mit zunehmender Entfernung allmählich verschwimmen.]]&lt;br /&gt;
Unendliches direktes Licht (z. B. eine Sonne).&lt;br /&gt;
* Color: Farbe.&lt;br /&gt;
* Intensity: Linearer Farbmultiplikator.&lt;br /&gt;
* Shadow spread: Größe der Lichtquelle oder, einfacher ausgedrückt, Unschärfe des Schattens. 0 = maximal scharfe Schatten, 1 = maximal unscharfe Schatten. Technisch gesehen wird hier von einem einzelnen Strahl zu einem breiteren Strahlenkegel interpoliert.&lt;br /&gt;
* Shadow samples: Beeinflusst die Qualität der Schatten. Je kleiner der Wert für Shadow spread ist, desto weniger Samples sind für ein sauberes Bild erforderlich. Für Sonnenschatten liegen die typischen Werte zwischen 1 und 16. Das Setzen der Samples auf 0 deaktiviert das Werfen von Schatten für dieses Licht.&lt;br /&gt;
* Bitmask: Eine Liste von Umschaltflächen, mit denen diese Lichtquelle davon ausgeschlossen werden kann, bestimmte Lightmap Groups zu beeinflussen.&lt;br /&gt;
* Baked contribution: Legt fest, welche Art von Beleuchtungsdaten gebacken werden sollen. Nur sichtbar im Indirect- oder Shadowmask-Modus. Mögliche Werte:&lt;br /&gt;
** Direct and Indirect: Es wird sowohl die direkte, als auch indirekte Beleuchtung vollständig gebacken.&lt;br /&gt;
** Indirect only: Ein Echtzeit-Licht soll einen direkten Beitrag leisten; nur indirekte Beleuchtung wird gebacken.&lt;br /&gt;
** Shadowmask and indirect: Ein Echtzeit-Licht soll einen direkten Beitrag leisten, aber Schatten von statischer Geometrie werden in eine separate Map gebacken. Dynamische und statische Schatten werden miteinander gemischt. Indirekte Beleuchtung wird wie gewohnt gebacken.&lt;br /&gt;
** Direct, Indirect, Shadowmask (nur benutzerdefinierte Beleuchtung): Wie Direct und Indirect, jedoch wird zusätzlich eine Shadowmask erzeugt und für die Verwendung mit benutzerdefinierten Shadern zugewiesen.&lt;br /&gt;
* Denoise shadowmask: Legt fest, ob Denoising auf die Shadowmask dieses Lichts angewendet werden soll. Normalerweise ist dies nicht notwendig, da Schatten in der Regel nicht viel Rauschen aufweisen, aber es kann bei sehr breiten, unscharfen Schatten (großer Shadow spread) hilfreich sein.&lt;br /&gt;
* Indirect intensity: Nicht-physikalischer GI-Multiplikator für dieses Licht. Sollte für eine natürliche Beleuchtung auf 1 eingestellt sein, kann jedoch für stilisiertere Szenen angepasst werden.&lt;br /&gt;
* Anti-alias: Führt Supersampling für den Schatten durch.&lt;br /&gt;
* Texture projection: Projiziert eine multiplikative gekachelte Textur über die Beleuchtung. Kann verwendet werden, um entfernte Wolkenschatten zu simulieren.&lt;br /&gt;
Wenn Texture projection aktiviert ist, kann ihre Skalierung/Verschiebung über die Felder &amp;quot;Tiling&amp;quot; und &amp;quot;Offset&amp;quot; angepasst werden. Alternativ können Sie auf &amp;quot;Tweak projection in Scene View&amp;quot; klicken und die Projektion mit einem zusätzlichen Gizmo visuell verschieben und skalieren. Mit dem Klick auf &amp;quot;Render reference frame&amp;quot; können Sie eine Referenz-PNG-Datei aus der &amp;quot;Perspektive des Lichts&amp;quot; speichern. Dies ist nützlich, um Wolkenschatten über die Szene zu malen.&lt;br /&gt;
&lt;br /&gt;
Sollten für dasselbe GameObject sowohl die Unity- als auch die Bakery-Lichtquelle aktiviert sein, und beide nicht miteinander übereinstimmen, werden zwei Schaltflächen angezeigt:&lt;br /&gt;
* Match lightmapped to real-time: Kopiert allgemeine Einstellungen vom Unity Light zum Bakery Light.&lt;br /&gt;
* Match real-time to lightmapped: Kopiert allgemeine Einstellungen vom Bakery Light zum Unity Light.&lt;br /&gt;
&lt;br /&gt;
{{note| Physikalisch gesehen ist Bakery's &amp;quot;Intensity&amp;quot; für gerichtete Lichtquellen Lux geteilt durch Pi.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Sky Light ===&lt;br /&gt;
[[File:Skylight.jpg|thumb|Reines Himmelslicht mit GI]]&lt;br /&gt;
Unendliches, schattenwerfendes Umgebungslicht (Himmel).&lt;br /&gt;
* Color: Farbe.&lt;br /&gt;
* Intensity: Linearer Farbmultiplikator.&lt;br /&gt;
* Sky texture: Optionales Cubemap-Asset, z. B. ein HDRI-Panorama, um die Lichtfarben aus unterschiedlichen Richtungen zu beeinflussen.&lt;br /&gt;
{{note| Durch Drehen des GameObject wird die Beleuchtung aus der Cubemap entsprechend mitgedreht.}}&lt;br /&gt;
* Samples: Beeinflusst die Qualität der Schatten. Typische Werte liegen zwischen 8 und 32.&lt;br /&gt;
* Hemispherical: Wenn aktiviert, kommt das Licht nur von oben (obere Hemisphäre). Andernfalls kommt es aus allen Richtungen.&lt;br /&gt;
* Bitmask: Eine Liste von Umschaltflächen, mit denen diese Lichtquelle davon ausgeschlossen werden kann, bestimmte Lightmap Groups zu beeinflussen.&lt;br /&gt;
* Baked contribution: Legt fest, welche Art von Beleuchtungsdaten gebacken werden sollen. Nur sichtbar im Indirect- oder Shadowmask-Modus. Mögliche Werte:&lt;br /&gt;
** Direct and Indirect: Es wird sowohl die direkte, als auch indirekte Beleuchtung vollständig gebacken. Dies ist das Standardverhalten und wird für alle Sky Lights empfohlen, da es keine Echtzeitvariante gibt, um sie in Unity zu emulieren.&lt;br /&gt;
** Indirect only: Ein Echtzeit-Licht soll einen direkten Beitrag leisten; nur indirekte Beleuchtung wird gebacken.&lt;br /&gt;
&lt;br /&gt;
Sollten die Einstellungen für das Himmelslicht und die aktuelle Skybox nicht übereinstimmen, werden zwei Schaltflächen angezeigt:&lt;br /&gt;
* Match this light to scene skybox: Kopiert die allgemeinen Einstellungen vom aktiven Skybox-Material zum Bakery Sky Light. Derzeit können nur Skyboxen, die mit den Shadern “Skybox/Cubemap” oder “Skybox/Bakery skybox” ausgestattet sind, abgeglichen werden.&lt;br /&gt;
* Match scene skybox to this light: Kopiert die allgemeinen Einstellungen vom Bakery Sky Light zur Szenen-Skybox.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bakery Light Mesh ===&lt;br /&gt;
[[File:Image29.png|thumb|Links: Samples Near = 0, Samples Far = 4096.&amp;lt;br&amp;gt;&lt;br /&gt;
Mitte: Samples Near = 0, Samples Far = 128.&amp;lt;br&amp;gt;&lt;br /&gt;
Rechts: Samples Near = 16, Samples Far = 128.&amp;lt;br&amp;gt;&lt;br /&gt;
Note how the lighting appearance is similar, yet less combined samples are used.]]&lt;br /&gt;
Emissives Mesh beliebiger Form. Sollte zusammen mit der Mesh Renderer-Komponente oder mit einer Light-Komponente, die auf Area eingestellt ist, verwendet werden.&lt;br /&gt;
* Color: Farbe.&lt;br /&gt;
* Intensity: Linearer Farbmultiplikator.&lt;br /&gt;
* Cutoff: Maximale Lichtdistanz. Bakery wird zusätzlich den invers-quadratischen Lichtabfall nahe der Grenze vermindern. Dies funktioniert am besten, wenn der Cutoff-Wert genau dort liegt, wo der physikalische Abfall sehr schwach wird. Cutoff kann die Backleistung verbessern, aber Sie können ihn für vollständige Korrektheit auch auf einen sehr hohen (unerreichbaren) Wert einstellen.&lt;br /&gt;
* Self Shadow: Legt fest, ob das Light Mesh selbst Schatten wirft. Diese Einstellung verwendet einen präziseren Beleuchtungsalgorithmus.&lt;br /&gt;
* Samples Near: Beeinflusst die Beleuchtungsqualität in der Nähe des Meshes. Typische Werte liegen zwischen 16 und 64. Diese Einstellung ist nur verfügbar, wenn Self Shadow aktiviert ist.&lt;br /&gt;
* Samples Far: Beeinflusst die Beleuchtungsqualität in der Entfernung vom Mesh. Typische Werte liegen zwischen 4 und 4096.&lt;br /&gt;
&lt;br /&gt;
Bakery verwendet zwei verschiedene Algorithmen für Area Lights, basierend auf der Nähe der zu emittierenden Oberfläche. In der unmittelbaren Nähe der Lichtquelle funktioniert es ähnlich wie der GI-Algorithmus, während das Licht in der Ferne eher als eine Wolke virtueller Punktlichter approximiert wird.&lt;br /&gt;
&lt;br /&gt;
{{note| &amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;Light Meshes erhalten keine eigene Beleuchtung und werden auch nicht ge-lightmapped.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Ein Light Mesh mit vielen Polygonen kann schneller gebacken werden als viele einfache Light Meshes.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Versuchen Sie, den Wert von Samples Near auf 0 zu setzen, falls Sie unscharfe/verrauschte Ergebnisse erhalten. Dann wird nur der Virtual Point Lights-Algorithmus angewendet. Dieser ist auch nützlich bei der Nutzung sehr einfacher Lichter, wo Präzision nicht so wichtig ist (z. B. Fensterlichter an Gebäuden).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;}}&lt;br /&gt;
[[File:Dd99d-QU0AEKFBK.jpg|thumb|Ein gebogenes Light Mesh]]&lt;br /&gt;
* Bitmask: Eine Liste von Umschaltflächen, mit denen diese Lichtquelle davon ausgeschlossen werden kann, bestimmte Lightmap Groups zu beeinflussen.&lt;br /&gt;
* Baked contribution: Legt fest, welche Art von Beleuchtungsdaten gebacken werden sollen. Nur sichtbar im Indirect- oder Shadowmask-Modus. Mögliche Werte:&lt;br /&gt;
** Direct and Indirect: Es wird sowohl die direkte, als auch indirekte Beleuchtung vollständig gebacken. Dies ist das Standardverhalten und wird für alle Light Meshes empfohlen, da es keine Echtzeitvariante gibt, um sie in Unity zu emulieren.&lt;br /&gt;
** Indirect only: Ein Echtzeit-Licht soll einen direkten Beitrag leisten; nur indirekte Beleuchtung wird gebacken.&lt;br /&gt;
** Shadowmask and Indirect: Ein Echtzeit-Licht soll einen direkten Beitrag leisten, aber Schatten von statischer Geometrie werden in eine separate Map gebacken. Dynamische und statische Schatten werden miteinander gemischt. Indirekte Beleuchtung wird wie gewohnt gebacken. Derzeit unterstützen nur die HDRP (und benutzerdefinierte Renderer) gemischte Area Lights.&lt;br /&gt;
** Direct, Indirect, Shadowmask (nur benutzerdefinierte Beleuchtung): Wie Direct und Indirect, jedoch wird zusätzlich eine Shadowmask erzeugt und für die Verwendung mit benutzerdefinierten Shadern zugewiesen.&lt;br /&gt;
* Indirect intensity: Nicht-physikalischer GI-Multiplikator für dieses Licht. Sollte für eine natürliche Beleuchtung auf 1 eingestellt sein, kann jedoch für stilisiertere Szenen angepasst werden.&lt;br /&gt;
* Shadowmask with falloff: Backt den vollständigen Lichtabfall in die Shadowmask ein (nur nützlich bei Verwendung mit benutzerdefinierten Shadern).&lt;br /&gt;
&lt;br /&gt;
Sollten das Material des Meshes und die Lichteinstellungen nicht übereinstimmen, werden zwei Schaltflächen angezeigt:&lt;br /&gt;
* Match light to material: Kopiert die allgemeinen Einstellungen vom unbeleuchteten Material des Meshes oder Area Light zum Bakery Light Mesh.&lt;br /&gt;
* Match material to light: Kopiert die allgemeinen Einstellungen vom Bakery Light Mesh zum unbeleuchteten Material des Meshes oder Area Light.&lt;br /&gt;
&lt;br /&gt;
==== Unterschiede zwischen Light Mesh und emissive Materialien ====&lt;br /&gt;
Emissives Material:&lt;br /&gt;
* Verbreitet Licht während der GI-Berechnung und ist dadurch “kostenlos” - unabhängig davon, wie viele Meshes emissiv sind.&lt;br /&gt;
* Kleine und helle Lichter können, je nach Anzahl des GI sample count, zu ungenauen und verrauschten Ergebnissen führen.&lt;br /&gt;
* Muss aufgrund der Funktionsweise von GI in Bakery Platz in der Lightmap einnehmen, wodurch möglicherweise Platz verschwendet wird. Das bedeutet wiederum auch, dass emissive Objekte gültige UVs benötigen und die Einstellung “Cast shadows” aktiviert sein muss.&lt;br /&gt;
&lt;br /&gt;
Light Mesh:&lt;br /&gt;
* Die Beleuchtung wird für jedes Licht einzeln berechnet und ist daher langsamer als bei emissiven Materialien.&lt;br /&gt;
* Entwickelt, um auch bei kleinen und hellen Lichtquellen, selbst wenn diese sehr weit entfernt sind, saubere Ergebnisse zu erzielen.&lt;br /&gt;
* Nimmt keinen Platz in Lightmaps ein.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Point Light ===&lt;br /&gt;
[[File:Image11.png|thumb|Links: Shadow Spread = 0.5, rechts: Shadow Spread = 1.]]&lt;br /&gt;
Punktlicht, hat keine Fläche. Trotz physikalischer Unmöglichkeit ist es für Spiele nützlich und die einzige Möglichkeit, die Punkt- und Spotlichter von Unity nachzubilden.&lt;br /&gt;
{{note|Spotlichter sind lediglich Punktlichter mit einer zusätzlichen Projektionsmaske.}}&lt;br /&gt;
* Color: Farbe.&lt;br /&gt;
* Intensity: Linearer Farbmultiplikator.&lt;br /&gt;
* Shadow spread: Unschärfe des Schattens. Obwohl Punktlichter keine Fläche besitzen, ist es dennoch oft wünschenswert, von ihnen geworfene, unscharfe Schatten zu bekommen. Zu diesem Zweck werden Schatten so simuliert, als würden sie von einer kugelförmigen Flächenlichtquelle geworfen. Dieser Parameter definiert den Radius einer solchen virtuellen Kugel, was sich direkt auf die Unschärfe auswirkt.&lt;br /&gt;
* Physical falloff: Wenn aktiviert, wird der korrekte invers-quadratische Lichtabfall mit zusätzlicher Abschwächung nahe der Grenze verwendet. Andernfalls wird versucht, den Lichtabfall von Unity nachzuahmen.&lt;br /&gt;
* Falloff min size: Mehr dazu im Abschnitt [[Point Light Attenuation]].&lt;br /&gt;
* Range: Wenn Physical falloff deaktiviert ist, entspricht dies der Lichtreichweite von Unity. Ist es aktiviert, wird der physikalische Lichtabfall an den Rändern nur leicht abgeschwächt.&lt;br /&gt;
* Samples: Beeinflusst die Qualität der Schatten. Typische Werte liegen zwischen 1 und 512. Das Setzen der Samples auf 0 deaktiviert das Werfen von Schatten für dieses Licht.&lt;br /&gt;
[[File:Image10.png|thumb|Von links nach rechts: Omni, Cookie (default spot texture), Cubemap, IES.]]&lt;br /&gt;
* Projection mask: Art der Maske/des Cookie. Optionen:&lt;br /&gt;
** Omni: keine Maske, vergleichbar mit Unity’s Point Light.&lt;br /&gt;
** Cookie: Projektion einer Cookie-Textur. Zusätzliche Optionen:&lt;br /&gt;
*** Cookie texture: 2D Textur Asset. Bakery enthält die ursprüngliche Spot Light-Textur von Unity (unter dem Namen ftUnitySpotTexture), die Sie zur Nachahmung verwenden können.&lt;br /&gt;
*** Angle: Texturprojektionswinkel (ähnelt Unity’s Spot Light).&lt;br /&gt;
*** Correct distortion: Korrigiert Verzerrungen von Cookies, die bei einer Weitwinkelbetrachtung auf geraden Linien sichtbar sind.&lt;br /&gt;
** Cubemap: Cubemap-Cookie-Projektion. Zusätzliche Optionen:&lt;br /&gt;
*** Projected cubemap: Cubemap Asset.&lt;br /&gt;
** IES: Beleuchtung wird durch Daten aus einer IES-Datei moduliert. Zusätzliche Optionen:&lt;br /&gt;
*** IES file: Datei mit .ies-Endung.&lt;br /&gt;
* Bitmask: Eine Liste von Umschaltflächen, mit denen diese Lichtquelle davon ausgeschlossen werden kann, bestimmte Lightmap Groups zu beeinflussen.&lt;br /&gt;
* Baked contribution: Legt fest, welche Art von Beleuchtungsdaten gebacken werden sollen. Nur sichtbar im Indirect- oder Shadowmask-Modus. Mögliche Werte:&lt;br /&gt;
** Direct and Indirect: Es wird sowohl die direkte, als auch indirekte Beleuchtung vollständig gebacken.&lt;br /&gt;
** Indirect only: Ein Echtzeit-Licht soll einen direkten Beitrag leisten; nur indirekte Beleuchtung wird gebacken.&lt;br /&gt;
** Shadowmask and Indirect: Ein Echtzeit-Licht soll einen direkten Beitrag leisten, aber Schatten von statischer Geometrie werden in eine separate Map gebacken. Dynamische und statische Schatten werden miteinander gemischt. Indirekte Beleuchtung wird wie gewohnt gebacken.&lt;br /&gt;
** Direct, Indirect, Shadowmask (nur benutzerdefinierte Beleuchtung): Wie Direct und Indirect, jedoch wird zusätzlich eine Shadowmask erzeugt und für die Verwendung mit benutzerdefinierten Shadern zugewiesen.&lt;br /&gt;
* Indirect intensity: Nicht-physikalischer GI-Multiplikator für dieses Licht. Sollte für eine natürliche Beleuchtung auf 1 eingestellt sein, kann jedoch für stilisiertere Szenen angepasst werden.&lt;br /&gt;
* Shadowmask with falloff: Backt den vollständigen Lichtabfall (Distanz ausgenommen) in die Shadowmask ein (nur nützlich bei Verwendung mit benutzerdefinierten Shadern).&lt;br /&gt;
* Legacy sampling: Verwende Bakery's ursprüngliche, stärker verzerrte Schattenabtastungsstrategie. Erzeugt rauschfreie Schatten, aber breite Halbschatten können Streifenbildung aufweisen. Wenn diese Option deaktiviert ist, wird eine unverzerrte, aber mehr mit Rausch behaftete Technik verwendet.&lt;br /&gt;
&lt;br /&gt;
Sollten für dasselbe GameObject sowohl die Unity- als auch die Bakery-Lichtquelle aktiviert sein, und beide nicht miteinander übereinstimmen, werden zwei Schaltflächen angezeigt:&lt;br /&gt;
* Match lightmapped to real-time: Kopiert allgemeine Einstellungen vom Unity Light zum Bakery Light.&lt;br /&gt;
* Match real-time to lightmapped: Kopiert allgemeine Einstellungen vom Bakery Light zum Unity Light.&lt;br /&gt;
&lt;br /&gt;
{{note| Physikalisch gesehen ist Bakery's &amp;quot;Intensity&amp;quot; für Punktlichter (Candela/Pi).}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Volume ===&lt;br /&gt;
[[File:Voldemo notlonely.gif|Eine bewegliche Schranktür wird durch ein Bakery Volume beleuchtet (GIF von NOTLonely)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Volumes generieren 3D-Texturen, die Light Probes pro Voxel speichern (sphärische Harmonische der Ordnung L1 und Shadowmasks), wodurch sie einen geeigneten Ersatz für reguläre Unity Light Probes darstellen.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Unity Light Probes&lt;br /&gt;
! Unity LPPV&lt;br /&gt;
! Bakery Volumes&lt;br /&gt;
|-&lt;br /&gt;
| Manuelles Platzieren einzelner Probes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Nein&lt;br /&gt;
|-&lt;br /&gt;
| Interpolieren mehrerer Probes auf einem Objekt&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|-&lt;br /&gt;
| Ist während der Laufzeit verschiebbar&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|-&lt;br /&gt;
| Kann in ein Prefab platziert werden&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|-&lt;br /&gt;
| Vollständige Scripting-API verfügbar&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|-&lt;br /&gt;
| Ringing&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Möglich&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Möglich&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Behoben&lt;br /&gt;
|-&lt;br /&gt;
| Denoising&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|-&lt;br /&gt;
| Laufzeit-Overhead&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | CPU: niedrig; GPU: niedrig.&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | CPU: mittel; GPU: mittel.&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#e4ead3;&amp;quot; | CPU: kein; GPU: mittel.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bakery Volume ist eine Begrenzungsbox, die mit einer Reihe von 3D-Texturen (3 SH-Texturen und bei Bedarf eine Shadowmask) verknüpft ist, wodurch sie sehr einfach zu verwenden und mit Skripten zu modifizieren ist. Volumes können während der Laufzeit ganz einfach ausgetauscht, verschoben, geladen oder entladen oder mit Prefabs verknüpft werden. Sie benötigen außerdem keine Light Probe Groups und die manuelle Platzierung von Probes entfällt; das gesamte Volumen wird stattdessen mit einem einheitlichen Raster aus Voxel-Probes gefüllt. Light/Shadow leaking wird automatisch auf die gleiche Weise behoben wie bei Lightmaps (dünne doppelseitige Wände können jedoch bei großen Voxelgrößen ein Problem darstellen, was jedoch durch die Verwendung unterschiedlicher Volumes auf verschiedenen Seiten vermieden werden kann). Aufgrund der einheitlichen Beschaffenheit von Voxel-Rastern ist es auch möglich, ein Lightmap-ähnliches Denoising auf sie anzuwenden, was bei normalen Light Probes nicht machbar ist. Zusätzlich verwenden Bakery Shaders den [https://drive.google.com/file/d/1MK6Clw93q8ljijRjb4gQOzzaIjn1uF9Y/view Geomerics Sampling-Trick], um &amp;quot;Ringing&amp;quot;-Artefakte, die von sphärischen Harmonischen manchmal bei kontrastreicher HDR-Beleuchtung erzeugt werden, vollständig zu beseitigen.&lt;br /&gt;
&lt;br /&gt;
Dadurch können Volumes eine saubere, detaillierte und hochwertige gebackene Beleuchtung für dynamische Objekte erzeugen (d. h. Beleuchtung, die von statischen Objekten ausgeht und sich auf dynamische Objekte auswirkt, nicht umgekehrt).&lt;br /&gt;
&lt;br /&gt;
Der einzige Nachteil des Volumes-Ansatzes sind die höheren Shading-Kosten pro Pixel. Die Kosten sind ähnlich wie bei LPPV (Skalierung mit der Anzahl der schattierten, vom Volumen betroffenen, Pixel auf dem Bildschirm), aber im Gegensatz zu LPPV werden die Volumen selbst nach dem Backen nicht mehr aktualisiert. Das Mischen mehrerer Volumen kann vermieden werden, indem man sie leicht überlappen lässt.&lt;br /&gt;
&lt;br /&gt;
====Einstellen der Volume Transform====&lt;br /&gt;
[[File:Bvolgizmo.jpg|thumb|Volume Gizmo]]&lt;br /&gt;
Wenn Bakery Volume zu einem GameObject hinzugefügt wird, erscheint in der Szenenansicht ein Begrenzungsrahmen-Gizmo. Durch das Ziehen an den kleinen Quadraten wird es skaliert.&lt;br /&gt;
Es gibt noch andere Möglichkeiten, wie man die Größe und Position der Volume ändern kann:&lt;br /&gt;
* Ziehen Sie ein beliebiges, renderbares GameObject in das Feld &amp;quot;Wrap to object&amp;quot;. Dadurch umschließt das Volume dieses Objekt (und seine untergeordneten Elemente) und ummantelt es.&lt;br /&gt;
* Wenn demselben Objekt ein Box Collider hinzugefügt wurde, werden die Schaltflächen &amp;quot;Set from box collider&amp;quot; und &amp;quot;Set to box collider&amp;quot; angezeigt. Diese können verwendet werden, um Werte schnell zwischen Volume/Collider zu kopieren.&lt;br /&gt;
&lt;br /&gt;
====Auflösung====&lt;br /&gt;
Wenn &amp;quot;Adaptive resolution&amp;quot; aktiviert ist, wird die Anzahl der Voxel durch die &amp;quot;Voxels per unit&amp;quot;-Angabe bestimmt. Durch Deaktivieren kann die Auflösung manuell eingegeben werden. Bei den meisten Spielen mit 1 Einheit = 1 Meter ist 2 ein angemessener Wert für &amp;quot;Voxels per unit&amp;quot;, aber es gibt Fälle (z. B. dynamische Türen), in denen die Verwendung eines kleineren Volumes mit höherer Auflösung vorteilhafter ist.&lt;br /&gt;
&lt;br /&gt;
====Andere Einstellungen====&lt;br /&gt;
* Enable baking: Soll die Volume (neu) berechnet werden? Deaktivieren, um das Überschreiben vorhandener Daten zu verhindern.&lt;br /&gt;
* Denoise: Wende Denoising nach dem Backen der Volume an. Empfohlen für hochauflösende Volumes. Vermeiden Sie die Verwendung der Einstellung bei Volumes mit sehr niedriger Auflösung, die viele Lichter abdecken, da es für den Denoiser schwierig sein wird, den tatsächlichen Inhalt von Rauschen unterscheiden zu können.&lt;br /&gt;
* Global: Weist diese Volume automatisch allen kompatiblen Shadern zu, sofern diese keine Überschreibungen enthalten. Intern ruft es den Befehl Shader.SetGlobalTexture()/SetGlobalVector() auf.&lt;br /&gt;
&lt;br /&gt;
====Benutzung====&lt;br /&gt;
Volumes können mithilfe eines Volume-bewussten Shaders Objekten zugewiesen werden. Bakery wird mit dem &amp;quot;Bakery Standard&amp;quot;-Shader, der Volumes bereits implementiert hat, sowie mit HDRP- und URP-Graphen geliefert. Sehen Sie sich die example_volumes Szenen an, um verschiedene Anwendungsmöglichkeiten einer Volume zu entdecken.&lt;br /&gt;
&lt;br /&gt;
====Hinweise und Tipps====&lt;br /&gt;
* Sehen Sie sich unbedingt die Beispiele an.&lt;br /&gt;
* Falls sich zwei Volumes berühren, lassen Sie sie ein wenig überlappen. Die Größe der Überlappung sollte der Größe des größten dynamischen Objekts entsprechen. Auf diese Weise funktioniert das einfache Wechseln zwischen Volumes nach Bedarf.&lt;br /&gt;
* Platzieren Sie Volumes nur in Bereichen, die dynamische Objekte tatsächlich erreichen können. Verwenden Sie zum Beispiel die Spielerhöhe, um die Höhe der Volume zu begrenzen.&lt;br /&gt;
&lt;br /&gt;
====Drehen von Volumes====&lt;br /&gt;
Volumes können um die Y-Achse gedreht werden, sofern die Einstellung &amp;quot;Rotate around Y&amp;quot; aktiviert ist. Die Drehung ist sehr ressourcenschonend und verwendet nur 2 zusätzliche Daten-Floats (vorberechnete Sinus-/Kosinuswerte des Winkels).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Es gibt eine zusätzliche Option zum Drehen von Volumes während der Laufzeit (unter Experimental -&amp;gt; &amp;quot;Support rotation after bake&amp;quot; und eine ähnliche Einstellung im Bakery Shader). In diesem Fall müssen sie ohne anfängliche Drehung gebacken werden.&lt;br /&gt;
&lt;br /&gt;
In der URP kann solch eine dynamische Drehung mithilfe von BakeryURPVolumeGraphRotatable.shadergraph genutzt werden.&lt;br /&gt;
&lt;br /&gt;
Für globale Volumes wird die dynamische Drehung aktualisiert, wenn die Komponente (wieder) aktiviert oder volume.SetGlobalParams() aufgerufen wird. Bei der Nutzung von lokal gedrehten Volumen ist die manuelle Einstellung der Drehung im Material oder im MaterialPropertyBlock erforderlich:&lt;br /&gt;
{{code|&amp;lt;nowiki&amp;gt;SetMatrix(&amp;quot;_VolumeMatrix&amp;quot;, volume.GetMatrix())&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
====Technische Informationen====&lt;br /&gt;
Volumes können automatisch funktionieren (siehe Beispielszenen), aber es ist auch möglich, ihre Wirkweise per Skript zu steuern.&lt;br /&gt;
&lt;br /&gt;
Volumedaten können über diese öffentlichen Eigenschaften aus der Komponente abgerufen werden:&lt;br /&gt;
* bakedTexture0: Speichert L0-RGB-Koeffizienten und den L1-Z-Rotkanal in den Alphakanal.&lt;br /&gt;
* bakedTexture1: Speichert L1-X-RGB-Koeffizienten und den L1-Z-Grünkanal in den Alphakanal.&lt;br /&gt;
* bakedTexture2: Speichert L1-Y-RGB-Koeffizienten und den L1-Z-Blaukanal in den Alphakanal.&lt;br /&gt;
* bakedMask: Speichert die volumetrische Shadowmask.&lt;br /&gt;
* bounds: Die Begrenzungsbox der Volume.&lt;br /&gt;
&lt;br /&gt;
Alle bakedTexture*-Maps nutzen das RGBAHalf (8 Bytes pro Voxel) Format, während die Shadowmask das Format ARGB32 (4 Bytes pro Voxel) verwendet. Alternativ kann für die Shadowmask auch das Single-channel R8 Format (1 Byte pro Voxel) verwendet werden.&lt;br /&gt;
&lt;br /&gt;
Daher gilt: volume byte size = width*height*depth*3*8 + (nur wenn die Shadowmask verwendet wird) width*height*depth*4 (oder width*height*depth bei einer R8 Shadowmask).&lt;br /&gt;
&lt;br /&gt;
[[Manual#Compress_volumes|Texture compression]] kann für Volumes aktiviert werden, um diese deutlich zu verkleinern.&lt;br /&gt;
&lt;br /&gt;
Zum Samplen von Volumes werden spezielle Shader benötigt, die in Bakery bereits enthalten sind. Um einem benutzerdefinierten Shader Volumes-Funktionen hinzuzufügen, überprüfen Sie bitte die Funktion BakeryVolume_float() in der Datei BakeryDecodeLightmap.hlsl, die in den HDRP/URP-Paketen enthalten ist.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Light Filter ===&lt;br /&gt;
[[File:Output optimized.gif|Buntglas, wie es durch Bakery Real-Time Preview gesehen wird. Die gleichen Ergebnisse werden vom Bakery lightmapper gebacken.]]&lt;br /&gt;
&lt;br /&gt;
Markiert einen Renderer als Light Filter. Light Filter färben alle direkten/indirekten Strahlen mit ihrer Farbe, ähnlich wie optische Filter im realen Leben, wodurch farbige Transparenzen (z. B. Buntglas) entstehen. Der einzige Parameter ist die, für die Tönung, verwendete Textur.&lt;br /&gt;
* Objekte mit Light Filter erhalten weiterhin wie alle anderen Objekte auch Lightmaps.&lt;br /&gt;
* Filter streuen/verwischen keine Strahlen (nutzen Sie hierfür [[Subsurface_scattering|Subsurface Scattering]] oder [[Manual#Backface_GI|Backface GI]]).&lt;br /&gt;
* Filter können farbige Schatten erzeugen. Wenn für das Licht ein [[Manual#Shadowmask|Shadowmask]]-Modus verwendet wird, wird nur der R-Kanal des Ergebnisses gespeichert (da Unity nur einkanalige Masken unterstützt). Für vollständig gebackene Schatten gibt es keine Einschränkungen.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Sector ===&lt;br /&gt;
Lesen Sie den Artikel '''[[Partial_scene_baking|Partial scene baking]]''' für weitere Informationen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Always Render ===&lt;br /&gt;
Wenn dies zu einem Objekt hinzugefügt wird, berücksichtigt Bakery es beim Backen immer, auch wenn sein Renderer deaktiviert ist.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Pack As Single Square ===&lt;br /&gt;
Wenn dies zu einem Objekt hinzugefügt wird, behandelt Bakery die UVs dieses Objekts und die UVs seiner untergeordneten Objekte als ein einziges kombiniertes Quadrat und verschiebt sie während des automatischen Atlas-Packens oder in einer Lightmap Group im Modus Pack Atlas niemals voneinander weg. Die gesamte Hierarchie der untergeordneten Objekte wird als Ganzes gepackt.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Shared LOD UV ===&lt;br /&gt;
Wenn dies zu einer LODGroup hinzugefügt wird, werden alle ähnlich benannten LODs für dieselbe Lightmap markiert. Standardmäßig erhält jedes LOD eine einzigartige Lightmap, die Platz im Atlas einnimmt. Wenn jedoch bekannt ist, dass LODs desselben Objekts ähnliche UV2-Kanäle haben (oder UV1, wenn sie sich nicht überlappen, und UV2 nicht vorhanden ist), können sie demselben Teil des Atlas zugeordnet werden, wodurch Speicherplatz gespart wird.&lt;br /&gt;
Diese Technik ist auch als [https://github.com/laurenth-personal/LODLightmapScripts/ Lightmap Stealing] bekannt.&lt;br /&gt;
&lt;br /&gt;
= Kompatibilität von Materialien =&lt;br /&gt;
=== Albedo und Emission ===&lt;br /&gt;
Bakery unterstützt die meisten Unity Materialien durch die Verwendung des [https://docs.unity3d.com/Manual/MetaPass.html Meta Pass]-Systems. Alle Built-in, Surface, URP und HDRP Shaders verfügen bereits über einen korrekt definierten Meta Pass.&lt;br /&gt;
&lt;br /&gt;
Wenn Sie einen Unlit Shader haben, müssen Sie den Meta Pass manuell hinzufügen, so wie es in der Unity Dokumentation beschrieben wird.&lt;br /&gt;
&lt;br /&gt;
Sollte der Pass nicht vorhanden sein, wird Bakery die Eigenschaften {{codeVar|_MainTex}}, {{codeVar|_BaseColorMap}} oder {{codeVar|_Color}} (wenn keine Textur festgelegt ist) als Materialalbedo und {{codeVar|_EmissionMap}} sowie {{codeVar|_EmissionColor}} als Emissionsfarbe werten.&lt;br /&gt;
&lt;br /&gt;
Damit Emission funkionieren kann, muss der Wert [https://docs.unity3d.com/ScriptReference/Material-globalIlluminationFlags.html Material.globalIlluminationFlags] auf [https://docs.unity3d.com/ScriptReference/MaterialGlobalIlluminationFlags.BakedEmissive.html MaterialGlobalIlluminationFlags.BakedEmissive] gesetzt werden. Die Standard Shader legen diesen Wert automatisch fest.&lt;br /&gt;
&lt;br /&gt;
=== Opacity ===&lt;br /&gt;
[[File:Upload 2019-1-25 0-4-30.png|thumb|Materialparameter in Cutout umgewandelt (Standard)]]&lt;br /&gt;
[[File:Alphacombos dither.jpg|thumb|Halbtransparente Werte, die über die Option Dither Transparency hinzugefügt wurden]]&lt;br /&gt;
[[File:Alphacombos filter.jpg|thumb|Auf rote Flächen angewendete Light Filter-Komponenten, die farbige Schatten erzeugen]]&lt;br /&gt;
Standardmäßig übernimmt Bakery immer die volle Opazität aus dem Alpha-Wert von {{codeVar|_MainTex}}, {{codeVar|_BaseColorMap}} oder {{codeVar|_BaseMap}} und behandelt diese als Cutout (1-Bit Transparenz).&lt;br /&gt;
&lt;br /&gt;
Wenn die Einstellung '''Dither Transparency''' aktiviert ist, werden halbtransparente Werte automatisch in variables blaues Rauschen umgewandelt, das anschließend gefiltert/unscharf gemacht wird, was zu einer teilweisen Transparenz führt (dies war zuvor mit benutzerdefinierten, manuell geditherten Karten möglich, seit Version 1.97 erfolgt dies jedoch automatisch).&lt;br /&gt;
&lt;br /&gt;
Damit Opacity funkionieren kann, muss der [https://docs.unity3d.com/Manual/SL-SubShaderTags.html RenderType Tag] des Shaders einen der folgenden Werte haben:&lt;br /&gt;
* {{codeVar|Transparent}}&lt;br /&gt;
* {{codeVar|TransparentCutout}}&lt;br /&gt;
* {{codeVar|TreeLeaf}}&lt;br /&gt;
&lt;br /&gt;
Sollte eine Eigenschaft namens {{codeVar|_Cutoff}} vorhanden sein, wirkt sich diese auf den Cutout aus (daher funktioniert der Cutoff-Schieberegler vom Standard Shader automatiscc).&lt;br /&gt;
&lt;br /&gt;
Ohne Dither Transparency wird, wenn der RenderType des Materials {{codeVar|Transparent}} oder {{codeVar|TreeLeaf}} ist, der Alpha-Wert von {{codeVar|_Color}} zusätzlich den Cutoff-Wert modifizieren: ''finalCutoff = 1 - (1 - cutoff) * alpha''&lt;br /&gt;
&lt;br /&gt;
Für farbige Transparenz verwenden Sie die [[Manual#Bakery_Light_Filter|Light Filter]]-Komponente.&lt;br /&gt;
&lt;br /&gt;
Für diffuse Transparenzeffekte, lesen Sie den Abschnitt [[#Backface GI|Backface GI]] und den Artikel über [[subsurface scattering]].&lt;br /&gt;
&lt;br /&gt;
==== Alpha Meta Pass ====&lt;br /&gt;
Seit v1.9 unterstützt Bakery die Angabe einer benutzerdefinierten Shader-basierten Transparenz, wofür jedoch ein kompatibler Shader erforderlich ist. Um die Vorteile des ''Alpha Meta Pass'' nutzen zu können, müssen folgende Schritte durchgeführt werden:&lt;br /&gt;
* Fügen Sie Ihrem Shader die Eigenschaft namens '''BAKERY_META_ALPHA_ENABLE''' hinzu. Beispiel:&lt;br /&gt;
{{code|&amp;lt;nowiki&amp;gt;[HideInInspector] BAKERY_META_ALPHA_ENABLE (&amp;quot;Enable Bakery alpha meta pass&amp;quot;, Float) = 1.0&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
* Stellen Sie sicher, dass der RenderType auf einen der oben genannten Werte gesetzt ist.&lt;br /&gt;
* Deklarieren Sie einen Pass namens '''META_BAKERY'''. &lt;br /&gt;
* Überprüfen Sie in diesem Pass, ob '''unity_MetaFragmentControl.w''' ungleich Null ist. Ist dies der Fall, geben Sie den berechneten Transparenzwert zurück. &lt;br /&gt;
&lt;br /&gt;
Sehen Sie sich als Beispiel die im Paket enthaltene Datei ''Baked_Alpha_meta.shader'' an.&lt;br /&gt;
&lt;br /&gt;
Hinweis: Derzeit muss für den Alpha Meta Pass der Light Probe-Modus auf L1 oder L2 eingestellt sein.&lt;br /&gt;
&lt;br /&gt;
=== Normal mapping ===&lt;br /&gt;
Benutzerdefinierte Oberflächennormalen können in Verbindung mit dem Modus [[#Baked Normal Maps|Baked Normal Maps]] verwendet werden. Leider gibt der Meta Pass von Unity keine Normaleninformationen aus, sodass standardmäßig die Normalen aus einer Textur namens {{codeVar|_BumpMap}} übernommen und zusätzlich durch {{codeVar|_MainTex_ST}} transformiert werden.&lt;br /&gt;
&lt;br /&gt;
Es ist jedoch möglich, komplette benutzerdefinierte Shader mit erweiterten Normal-Mapping-Funktionen (z. B. Überblenden mehrerer Ebenen) zu erstellen, die mit dem Backen kompatibel sind. Dazu müssen Sie folgendes tun:&lt;br /&gt;
&lt;br /&gt;
1. Fügen Sie Ihrem Shader einen Meta Pass hinzu, so wie es [https://docs.unity3d.com/Manual/MetaPass.html#ExampleMetaPass in der Unity Dokumentation beschrieben] ist.&lt;br /&gt;
&lt;br /&gt;
2. Nennen Sie diesen Pass {{codeVar|&amp;quot;META_BAKERY&amp;quot;}} statt nur {{codeVar|&amp;quot;META&amp;quot;}}.&lt;br /&gt;
&lt;br /&gt;
3. Inkludieren Sie die Datei {{codeVar|&amp;quot;BakeryMetaPass.cginc&amp;quot;}}.&lt;br /&gt;
&lt;br /&gt;
4. Fügen Sie {{codeVar|#pragma vertex vert_bakerymt}} hinzu.&lt;br /&gt;
&lt;br /&gt;
5. Wenn die Variabel {{codeVar|unity_MetaFragmentControl.z}} nicht 0 ist, sollte der Shader Normale im Weltkoordinatensystem zurückgeben. Der zurückgegebene Normalwert sollte mit der Funktion {{codeVar|BakeryEncodeNormal}} codiert werden.&lt;br /&gt;
&lt;br /&gt;
Zwei Beispiel-Shader, die diesen erweiterten Meta Pass implementieren, sind im Ordner Assets/Bakery/examples/shaders enthalten.&lt;br /&gt;
&lt;br /&gt;
Sie können BakeryMetaPass.cginc kopieren und an Ihre Bedürfnisse anpassen, z. B. um zusätzliche Daten aus dem Vertex Shader zu übermitteln.&lt;br /&gt;
&lt;br /&gt;
=== Front/back faces ===&lt;br /&gt;
Unabhängig davon, welcher Culling-Modus für den Shader verwendet wird, behandelt Bakery alle Rückflächen als undurchsichtig, was bedeutet, dass direkte Lichtstrahlen eine Rückfläche ebenso wenig durchdringen wie eine Vorderfläche.&lt;br /&gt;
Bei Verwendung von [[Manual#Backface_GI|Backface GI]] können Rückflächen jedoch teilweise die von einer Vorderfläche empfangene Beleuchtung emittieren.&lt;br /&gt;
&lt;br /&gt;
= &amp;quot;Lightmap Parameters&amp;quot; Assets =&lt;br /&gt;
[[File:Lp.jpg|thumb|Erweiterte Lightmap-Parameter]]&lt;br /&gt;
Similar to Bakery's [[Manual#Bakery_Lightmap_Group_Selector|Lightmap Groups]], Unity has [https://docs.unity3d.com/Manual/class-LightmapParameters.html Lightmap Parameters] that can be created as assets and assigned to Mesh Renderers. Their logic has differences and similarities:&lt;br /&gt;
* Lightmap Group's primary usage is to group multiple objects in one atlas. Additionally it allows overriding baking settings for this atlas.&lt;br /&gt;
* Lightmap Parameters are primarily used to override baking settings for an object. But additionally they can influence packing by using the &amp;quot;Baked Tag&amp;quot; option: objects with a different Baked Tag will never share the same atlas.&lt;br /&gt;
&lt;br /&gt;
Since some users are more used to the Lightmap Parameters workflow, Bakery now supports and extends them:&lt;br /&gt;
* Baked Tag is respected by Bakery.&lt;br /&gt;
* Additional Bakery-specific options will be shown in the Lightmap Parameters UI. Refer to the [[Manual#Bakery_Lightmap_Group_Selector|Lightmap Group]] section for their meaning.&lt;br /&gt;
&lt;br /&gt;
= Project Settings =&lt;br /&gt;
Some global settings can be tweaked in Project Settings -&amp;gt; Bakery GPU Lightmapper (this option is only visible in Unity 2018.3 or newer; for older versions, edit BakeryProjectSettings.asset instead):&lt;br /&gt;
* Mipmap lightmaps: enables mipmapping on lightmap assets. Can cause leaks across UV charts as atlases get smaller; on the other hand, it reduces high resolution lightmap aliasing in the distance. Overall it is recommended to use separately baked LODs with lower resolution lightmaps for very distant objects instead.&lt;br /&gt;
* Color file format: format for regular HDR color lightmaps. Possible values:&lt;br /&gt;
** HDR: Radiance HDR format (default). Can be opened in many image editors.&lt;br /&gt;
** Asset: native Unity format. Can have custom mipmap count.&lt;br /&gt;
* Mask/Direction file format: format for additional LDR maps, such as shadowmasks or directional data. Possible values:&lt;br /&gt;
** TGA: 8-bit Targa (default).&lt;br /&gt;
** PNG: 8-bit PNG. Usually takes less space on disk compared to TGA.&lt;br /&gt;
** Asset: native Unity format. Can have custom mipmap count.&lt;br /&gt;
* Compress lightmaps: defines lightmap asset compression behaviour. Compressed lightmaps take less VRAM, but may exhibit some visual artifacts (such as banding or colored blotches) depending on the type of compression (for mobile compression issues [[Troubleshooting#I_have_an_Android_project.2C_and_lightmaps_don.27t_look_good|see this]]). Possible values:&lt;br /&gt;
*** Compress but allow overriding asset: new lightmaps will be created with compression enabled. After they are created, it is possible to change their compression settings in Inspector. These modified values will be kept after rebaking (default).&lt;br /&gt;
*** Force compress: always compress all lightmaps.&lt;br /&gt;
*** Force no compress: always produce uncompressed lightmaps.&lt;br /&gt;
* High quality direction: enables &amp;quot;high&amp;quot; quality compression for directional maps. Actual formats depend on platform. On PC, for example, it will change it from DXT1 to BC7, which gives higher quality, but doubles the VRAM usage.&lt;br /&gt;
* Texel padding (default atlas packer): defines how many empty texels to add between objects' UV layouts in lightmap atlases, when using the default atlas packer.&lt;br /&gt;
* Texel padding (xatlas packer): same, but when using xatlas.&lt;br /&gt;
* Alpha Meta Pass resolution multiplier: multiplies resolution of the [[Manual#Alpha_Meta_Pass|Alpha Meta Pass]] allowing to have precise shader-based cutouts while baking low resolution lightmaps.&lt;br /&gt;
* Volume render mode: which [[Manual#Render_mode|render mode]] to use for all [[Manual#Bakery_Volume|Volumes]]? Auto uses current active render mode (default).&lt;br /&gt;
* Delete previous lightmaps before bake: actually delete all previously rendered lightmap files from this scene before baking new ones.&lt;br /&gt;
* Log level: defines how much information is printed to console during the bake. Possible values:&lt;br /&gt;
** 0: do not print anything.&lt;br /&gt;
** 1: only print progress information.&lt;br /&gt;
** 2: only print warnings.&lt;br /&gt;
** 3: print everything.&lt;br /&gt;
* Alternative scale in lightmap: makes 'Scale in Lightmap' renderer property act more similar to built-in Unity behaviour.&lt;br /&gt;
* Align to texture compression blocks with xatlas: makes xatlas align charts to 4x4 block boundaries, which gives more compression-friendly results.&lt;br /&gt;
* Generate smooth positions: should sample positions be adjusted to prevent incorrect shadowing on low-poly geometry with smooth normals? Can be disabled in very rare cases when using geometry with wildly mismatching normals. See [https://ndotl.wordpress.com/2018/08/29/baking-artifact-free-lightmaps/#shadowterm  this article] for technical explanation.&lt;br /&gt;
* Smooth positions per-triangle: should smooth/flat position be decided per-triangle? Can be disabled in very rare cases when using geometry with wildly mismatching normals.&lt;br /&gt;
* Use 'Receive GI' values: take 'Receive Global Illumination' values into account on renderers. Originally Bakery ignored it.&lt;br /&gt;
* Remove ringing in Legacy light probes: enables softer light probe convolution in Legacy mode to prevent artifacts in high-contrast areas.&lt;br /&gt;
* Always render reflection probes: automatically render reflection probes after every Render/Render Light Probes.&lt;br /&gt;
* Ringing removal for L2 light probes: applies de-ringing to [[Manual#Light_probe_mode|L2 light probes]]. The higher the value, the smoother the probe lighting is; this smoothing reduces [https://docs.unity3d.com/6000.2/Documentation/Manual/light-probes-troubleshooting.html ringing] artifacts (if present).&lt;br /&gt;
* Put menu under Tools: puts Bakery menu under the Tools menu.&lt;br /&gt;
&lt;br /&gt;
If any format is set to Asset, and mipmapping is enabled, an additional option is shown:&lt;br /&gt;
* Maximum mipmap count: defines maximum amount of mipmaps. For example, if set to 2, a 8K lightmap will only have two additional mipmaps: 4K and 2K. Lower resolutions will be omitted, thus limiting leaking artifacts during mipmapping.&lt;br /&gt;
&lt;br /&gt;
= Skinned mesh renderer support =&lt;br /&gt;
&lt;br /&gt;
Bakery supports skinned meshes since v1.65. However, there are some limitations:&lt;br /&gt;
* Some versions of Unity do not support UV1 on skinned meshes and silently ignore &amp;quot;Generate lightmap UVs&amp;quot;. Make sure the actual mesh used in your scene has UV1 and use non-overlapping UV0 if possible;&lt;br /&gt;
* UV padding adjustment does not work on skinned meshes (Unity seems to crash when attempting to call Unwrap function on them);&lt;br /&gt;
* Skinned meshes can't have per-vertex lightmaps (engine has no support for additionalVertexStreams with skinning).&lt;br /&gt;
&lt;br /&gt;
= Shader Tweaks =&lt;br /&gt;
[[File:Image2.jpg|thumb|Left: default bilinear filtering. Right: bicubic filtering.]]&lt;br /&gt;
[[File:Image34.jpg|thumb|Left: both shadows are baked.&amp;lt;br&amp;gt;&lt;br /&gt;
Center: spherical shadow is dynamic, and other shadow is static. Combined together with multiplication.&amp;lt;br&amp;gt;&lt;br /&gt;
Right: same as center, but combined with default minimum.]]&lt;br /&gt;
Bakery offers optional shader modifications that can be applied to Unity shaders to improve lightmap sampling and match real-time lighting closer to lightmaps. Shader tweaking menu can be accessed via Bakery-&amp;gt;Shader Tweaks.&lt;br /&gt;
&lt;br /&gt;
These options will patch base Unity shader includes (from the CGIncludes folder) that are used by most built-in and third party shaders. All modifications will affect all projects opened with this version of editor, but can be also easily reverted back. Shader tweaks affect the way standard and surface shaders work. HDRP, URP and other SRPs are not affected.&lt;br /&gt;
&lt;br /&gt;
All available modifications are shown as buttons. Press the button to apply modification, and it will remain pressed. Un-press the button to remove the modification. Currently available options:&lt;br /&gt;
&lt;br /&gt;
{{note| You may need to run Unity editor as admin to make CGIncludes patching work}}&lt;br /&gt;
&lt;br /&gt;
* Use bicubic interpolation for lightmaps: bicubic interpolation will be used instead of default bilinear. This tweak fixes many jagged edges of low resolution lightmaps pretty well. Currently it only works on DX11 and modern consoles, while other platforms will remain using bilinear.&lt;br /&gt;
&lt;br /&gt;
* Use multiplication for shadowmask: combine static and dynamic shadows using multiplication instead of minimum. For reasons unknown Unity decided to use minimum operator by default, and it produces artifacts that are not present with multiplication.&lt;br /&gt;
&lt;br /&gt;
* Use physical light falloff (forward): replace default attenuation of real-time point/spot lights with a more physically correct inverse-squared. “Range” will only slightly fade it out near the edge (matches Bakery lights with Physical Falloff checkbox). Only affects forward renderer. See [[Point Light Attenuation]] for more details.&lt;br /&gt;
&lt;br /&gt;
* Use physical light falloff (deferred): same as above, but only affects deferred renderer.&lt;br /&gt;
&lt;br /&gt;
'''Falloff tweaks may not fully work on &amp;gt; 2017 Unity versions. Also, SRPs have correct falloff by default.'''&lt;br /&gt;
&lt;br /&gt;
= Bakery shaders =&lt;br /&gt;
Bakery includes its own shaders with support for vertex lightmapping, as well as RNM and SH directional modes. It also allows approximate baked specular to be calculated from directional data. &lt;br /&gt;
Bakery shader is '''not required''' for regular color lightmaps, shadow masks and Dominant Direction mode, as these features are supported by most Unity shaders anyway.&lt;br /&gt;
&lt;br /&gt;
=== Standard render pipeline ===&lt;br /&gt;
'''Bakery/Standard''': extends regular Standard shader. Additional options:&lt;br /&gt;
* Allow Vertex Lightmaps: allows this material to be used with [[Vertex Lightmaps|vertex lightmapping]].&lt;br /&gt;
* Allow RNM Lightmaps: allows this material to be used with [[#RNM|RNM directional mode]].&lt;br /&gt;
* Allow SH Lightmaps: allows this material to be used with [[#SH|SH directional mode]].&lt;br /&gt;
{{note| All “Allow” toggles enable a certain code path in the shader. It is recommended to only use one “allow” option in a material for performance reasons.}}&lt;br /&gt;
* Enable Lightmap Specular: calculates baked specular using data from Dominant Direction, RNM or SH directional modes. Note that due to the lack of information, the effect is very approximate. If you ever used baked specular in Unity 4, it should be comparable. It looks best together with highly perturbed normal maps, not so good on flat surfaces.&lt;br /&gt;
* Enable VertexLM directional: if vertex lightmaps are present, specifies that Dominant Direction data is stored in vertices and should be used.&lt;br /&gt;
* Enable VertexLM SH: if vertex lightmaps are present, specifies that SH data is stored in vertices and should be used.&lt;br /&gt;
* Enable VertexLM Shadowmask: if vertex lightmaps are present, specifies that shadow mask is stored in vertices and should be used.&lt;br /&gt;
* Enable MonoSH: treat directional maps as MonoSH maps.&lt;br /&gt;
[[File:Image5.png|thumb|Standard SH light probe vs non-linear]]&lt;br /&gt;
[[File:Shspec.jpg|thumb|SH specular effect]]&lt;br /&gt;
* Non-linear SH: in SH directional mode this option can enhance contrast (closer to ground truth), but it makes the shader a bit slower. This trick is based on [https://drive.google.com/file/d/1MK6Clw93q8ljijRjb4gQOzzaIjn1uF9Y/view “Reconstructing Diffuse Lighting from Spherical Harmonic Data”] paper by Geomerics.&lt;br /&gt;
* Non-linear Light Probe SH: similar to Non-linear SH, but works for light probes instead. In case of probes the most notable benefit is getting rid of incorrect negative values. This problem often happens in high-contrast scenes with bright HDR light sources. It’s an inherent limitation of spherical harmonics and not specific to Bakery (i.e. you can get similar artifacts with built-in lightmappers as well).&lt;br /&gt;
* Force Bicubic Filter: enables bicubic filtering for all additional maps. For complete bicubic filtering (including the first color map) it is recommended to also enable it in [[#Shader Tweaks|Shader Tweaks]].&lt;br /&gt;
&lt;br /&gt;
'''Bakery/Standard Specular''': same as Standard, but for specular workflow.&lt;br /&gt;
&lt;br /&gt;
=== HDRP &amp;amp; URP ===&lt;br /&gt;
To extract additional HDRP/URP shaders, open Bakery_ShaderGraphHDRP.unitypackage or Bakery_ShaderGraphURP.unitypackage included with Bakery. Inside you will find Shader Subgraphs that you can use in your own Shader Graphs as well as some example materials.&lt;br /&gt;
&lt;br /&gt;
=== Feature support across shaders ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Die meisten Unity Shader&lt;br /&gt;
! Die meisten HDRP &amp;amp; URP Shader&lt;br /&gt;
! Bakery Standard&lt;br /&gt;
! HDRP Graphs&lt;br /&gt;
! URP Graphs&lt;br /&gt;
|-&lt;br /&gt;
| HDR color lightmaps&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|-&lt;br /&gt;
| Shadowmask&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja (Seit URP 10.1)&lt;br /&gt;
|-&lt;br /&gt;
| Dominant Direction&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|-&lt;br /&gt;
| RNM&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|-&lt;br /&gt;
| SH&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|-&lt;br /&gt;
| MonoSH&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|-&lt;br /&gt;
| Lightmap specular&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja für Dominant Direction und SH&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja für Dominant Direction (siehe Link)&lt;br /&gt;
|-&lt;br /&gt;
| Bicubic filtering&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja,&lt;br /&gt;
mithilfe von [[#Shader Tweaks|Shader Tweaks]]&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja,&lt;br /&gt;
mithilfe von [[#Shader Tweaks|Shader Tweaks]]&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
|-&lt;br /&gt;
| Vertex lightmaps&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Single color, no per-vertex SH, direction or shadowmasks (shader graph limitation)&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Single color, no per-vertex SH, direction or shadowmasks (shader graph limitation)&lt;br /&gt;
|-&lt;br /&gt;
| Non-Linear Light Probes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|-&lt;br /&gt;
| Volumes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|-&lt;br /&gt;
| Volume shadowmask&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|-&lt;br /&gt;
| Compressed volumes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Nein&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Ja&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{note| Everything except for regular color lightmaps requires at least Shader Model 3.0 to work.}}&lt;br /&gt;
{{note| Vertex Lightmaps with SH mode require at least Shader Model 4.0 due to interpolator limit.}}&lt;br /&gt;
{{note| Updated URP graphs with specular from Dominant Direction can be downloaded [[Bakery_-_GPU_Lightmapper|from the main wiki page]].}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
See also: [[Integrating_Bakery_shader_features_to_custom_shaders| Integrating Bakery shader features to custom shaders]]&lt;br /&gt;
&lt;br /&gt;
= Notes on HDRP/URP =&lt;br /&gt;
Once the package is imported into an HDRP or URP project, in general it can be used right away, but there are some things to note:&lt;br /&gt;
&lt;br /&gt;
* Example scenes use both regular Standard and, in some cases, &amp;quot;Bakery Standard&amp;quot; shaders. HDRP and URP provide a mechanism to update project shaders from Standard to Lit, but they cannot upgrade from Bakery Standard. Replace Bakery Standard materials with the ones coming from Bakery_ShaderGraphHDRP.unitypackage or Bakery_ShaderGraphURP.unitypackage.&lt;br /&gt;
&lt;br /&gt;
* In HDRP, the default HDRI sky intensity is high (11) and sky reflection is not being occluded by default. Together with default eye adaption it may result in some example scenes being hardly visible, as they are baked using much lower intensities. Reduce HDRI sky intensity to 1 in this case. HDRI settings are usually located in Assets/HDRPDefaultResources/DefaultSettingsVolumeProfile.&lt;br /&gt;
&lt;br /&gt;
* In HDRP, if lights in example scenes are too bright, click &amp;quot;match real-time to lightmapped&amp;quot; on Bakery light components.&lt;br /&gt;
&lt;br /&gt;
* Use OpenImageDenoise 2 (best) or OptiX 7 denoiser in HDRP, as it is better suited for high intensity values.&lt;br /&gt;
&lt;br /&gt;
* In HDRP &amp;quot;distance&amp;quot; and regular Shadowmask can be switched on the Light component itself, not in global settings.&lt;br /&gt;
&lt;br /&gt;
* Don't use &amp;quot;match&amp;quot; buttons on the Skylight, as HDRP uses a very specific procedural sky shader. Instead, bake it into a HDRI [[How_do_I...#How_do_I_use_Skylight_with_a_procedural_sky_shader.3F|this way]].&lt;br /&gt;
&lt;br /&gt;
* It is recommended to always set Light Probe Mode to L2 or L1 when using HDRP, as HDRP's renderer is not optimized for the Legacy mode.&lt;br /&gt;
&lt;br /&gt;
* Newest version of HDRP/URP have their own IES file importer. Because of the asset type mismatch, Unity will unplug them from Bakery IES lights saved using older versions, meaning they will appear as regular point lights instead. They can be plugged back and re-saved.&lt;br /&gt;
&lt;br /&gt;
Bakery's example scenes are designed for the Built-in rendering pipeline, so there are a few steps to properly render them in HDRP/URP. Here are some tips; a fresh project with default HDRP/URP settings is assumed:&lt;br /&gt;
&lt;br /&gt;
=== Viewing example scenes on HDRP ===&lt;br /&gt;
* After importing Bakery, upgrade standard materials to HDRP: Edit-&amp;gt;Rendering-&amp;gt;Materials-&amp;gt;Convert All Built-in Materials To HDRP.&lt;br /&gt;
* Import Bakery_ShaderGraphHDRP.unitypackage into the project, as it contains special shader graphs implementing advanced Bakery features (not required for classic color/directional/mask lightmaps).&lt;br /&gt;
* Select DefaultSettingsVolumeProfile.asset. In HDRI Sky section, change Exposure Compensation to 1. Otherwise the default HDRP will be too bright compared to example scenes, and they will appear black due to this exposure adjustment.&lt;br /&gt;
* When selecting lights in example scenes, HDRP will initialize its own light data. Sometimes it may result in the light immediately becoming much brighter. Click &amp;quot;Match real-time to lightmapped&amp;quot; to synchronize.&lt;br /&gt;
* Set Light Probe Mode to L2 before rendering light probes.&lt;br /&gt;
* '''example_directional''': change shaders to BakeryDirSpecGraph to see baked highlights (or just regular HDRP/Lit for diffuse-only normal mapping). Delete the sphere, as there is currently no shader graph supporting per-vertex direction.&lt;br /&gt;
* '''example_directional_MonoSH''': change shaders to BakerySpecMonoSHGraph (or BakeryMonoSHGraph for a slightly cheaper version without highlights). Delete the sphere, as there is currently no shader graph supporting per-vertex MonoSH.&lt;br /&gt;
* '''example_RNM''': change shaders to BakeryRNMGraph.&lt;br /&gt;
* '''example_SH''': change shaders to BakerySpecSHGraph (or BakerySHGraph for a slightly cheaper version without highlights). Delete the sphere, as there is currently no shader graph supporting per-vertex SH.&lt;br /&gt;
* '''example_mixed_directional_mode''': similarly a different graph is needed for MonoSH/RNM/SH planes.&lt;br /&gt;
* '''example_lights''': change the shader of the vertex-lightmapped sphere to BakeryVertexColorGraph.&lt;br /&gt;
* '''example_prefabs_bake''': no further adjustments needed.&lt;br /&gt;
* '''example_sectors''': no further adjustments needed.&lt;br /&gt;
* '''example_shadowmask''': Select the DirectLight and click &amp;quot;Match real-time to lightmapped&amp;quot; to fix brightness. Set Shadowmask Mode to Shadowmask on all HDRP lights. &lt;br /&gt;
* '''example_sponza_day''': set OpenImageDenoise 2 (or Optix 7, if unsupported) as preferred denoiser.&lt;br /&gt;
* '''example_sponza_evening''': set OpenImageDenoise 2 (or Optix 7, if unsupported) as preferred denoiser.&lt;br /&gt;
* '''example_subtractive''': HDRP doesn't support the subtractive mode.&lt;br /&gt;
* '''example_volumes_simple''': change train shader to BakeryVolumeSpecGraph (or BakeryVolumeGraph for a slightly cheaper version without highlights).&lt;br /&gt;
* '''example_volumes_simple_shadowmask''': shadowmask volumes are not currently supported for HDRP.&lt;br /&gt;
* '''example_volumes_advanced''': same as with example_volumes_simple.&lt;br /&gt;
* '''example_translucency''': most of the scene should appear fine. For the &amp;quot;Dynamic sphere lit by volume&amp;quot;, set shader to BakeryVolumeGraph.&lt;br /&gt;
&lt;br /&gt;
=== Viewing example scenes on URP ===&lt;br /&gt;
* After importing Bakery, upgrade standard materials to URP: open Assets/Bakery/examples/content, select all materials by typing &amp;quot;t:material&amp;quot; and choosing to only search the &amp;quot;content&amp;quot; folder below. Click Edit-&amp;gt;Rendering-&amp;gt;Materials-&amp;gt;Convert Selected Built-in Materials To URP.&lt;br /&gt;
* Import Bakery_ShaderGraphURP.unitypackage into the project, as it contains special shader graphs implementing advanced Bakery features (not required for classic color/directional/mask lightmaps).&lt;br /&gt;
* '''example_directional''': change shaders to BakeryURPLit, enable &amp;quot;Bakery Lightmapped Specular&amp;quot; (or just keep regular URP/Lit for diffuse-only normal mapping). Delete the sphere, as there is currently no shader graph supporting per-vertex direction.&lt;br /&gt;
* '''example_directional_MonoSH''': change shaders to BakeryURPLit, set Bakery Mode to MonoSH, enable &amp;quot;Bakery Lightmapped Specular&amp;quot;. On the vertex-lit sphere also enable &amp;quot;Per-vertex&amp;quot;.&lt;br /&gt;
* '''example_RNM''': change shaders to BakeryURPLit, set Bakery Mode to RNM, enable &amp;quot;Bakery Lightmapped Specular&amp;quot;.&lt;br /&gt;
* '''example_SH''': change shaders to BakeryURPLit, set Bakery Mode to SH, enable &amp;quot;Bakery Lightmapped Specular&amp;quot;. Delete the sphere, as there is currently no shader graph supporting per-vertex SH.&lt;br /&gt;
* '''example_mixed_directional_mode''': similarly use BakeryURPLit with a different Bakery Mode (MonoSH, RNM, SH). Non-directional / dominant direction / baked normap maps can use regular URP/Lit.&lt;br /&gt;
* '''example_lights''': no further adjustments needed.&lt;br /&gt;
* '''example_prefabs_bake''': no further adjustments needed.&lt;br /&gt;
* '''example_sectors''': no further adjustments needed.&lt;br /&gt;
* '''example_shadowmask''': similarly to the Built-in pipeline, uncheck Distance Shadowmask in Bakery window (or project Quality Settings) to see actual baked/real-time shadow mixing near the camera.&lt;br /&gt;
* '''example_sponza_day''': enable alpha clipping on the foliage material.&lt;br /&gt;
* '''example_sponza_evening''': same as example_sponza_day.&lt;br /&gt;
* '''example_subtractive''': no further adjustments needed.&lt;br /&gt;
* '''example_volumes_simple''': change train shader to BakeryURPLit and set Bakery Mode to Volume. Optionally enable &amp;quot;Bakery Lightmapped Specular&amp;quot;.&lt;br /&gt;
* '''example_volumes_simple_shadowmask''': same as example_volumes_simple, but also enable &amp;quot;Volume Shadowmask&amp;quot;.&lt;br /&gt;
* '''example_volumes_advanced''': same as with example_volumes_simple.&lt;br /&gt;
* '''example_translucency''': most of the scene should appear fine. For the &amp;quot;Dynamic sphere lit by volume&amp;quot;, set shader to BakeryURPLit and Bakery Mode to Volume.&lt;br /&gt;
&lt;br /&gt;
= Upgrading Bakery =&lt;br /&gt;
When it comes to upgrading the asset, it is recommended to follow these steps:&lt;br /&gt;
* Close Bakery windows.&lt;br /&gt;
* Close Unity.&lt;br /&gt;
* Open it again.&lt;br /&gt;
* Import the updated package.&lt;br /&gt;
&lt;br /&gt;
Note that without first closing Unity importing may fail because of locked DLL files (printing messages like &amp;quot;alphabuffergen.dll: Access is denied.&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
If you moved Bakery folders (Assets/Bakery and Assets/Editor/x64/Bakery) to other locations, you might need to move them back before updating to prevent getting two conflicting copies of the package.&lt;br /&gt;
&lt;br /&gt;
= Scripting API =&lt;br /&gt;
&lt;br /&gt;
==Basic usage==&lt;br /&gt;
&lt;br /&gt;
Get and modify render settings:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ftLightmapsStorage storage = ftRenderLightmap.FindRenderSettingsStorage();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Full list of available settings can be seen in ftLightmapsStorage.cs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Get lightmapper instance and (re)load settings:&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap bakery = ftRenderLightmap.instance != null ? ftRenderLightmap.instance : new ftRenderLightmap();&lt;br /&gt;
bakery.LoadRenderSettings();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Render lightmaps (also probes if they're set to L1 or L2 mode):&lt;br /&gt;
&amp;lt;pre&amp;gt;bakery.RenderButton(bool showMsgWindows)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Render light probes only:&lt;br /&gt;
&amp;lt;pre&amp;gt;bakery.RenderLightProbesButton(bool showMsgWindows)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Render reflection probes only:&lt;br /&gt;
&amp;lt;pre&amp;gt;bakery.RenderReflectionProbesButton(bool showMsgWindows)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''showMsgWindows''' tells if any dialog boxes/confirmations can be shown. Supressed, if set to false.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Check if baking is in progress:&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.bakeInProgress&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For usage example check [[Community_extensions#Batch_scene_baker|Batch Scene Baker]] script.&lt;br /&gt;
&lt;br /&gt;
==Additional functions==&lt;br /&gt;
&lt;br /&gt;
Copies all render settings from one ftLightmapsStorage to another:&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmapsStorage.CopySettings(ftLightmapsStorage src, ftLightmapsStorage dest)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Gets global (per-project) storage object:&lt;br /&gt;
&amp;lt;pre&amp;gt;ftGlobalStorage gstorage = ftLightmaps.GetGlobalStorage()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copies all render settings from ftLightmapsStorage (per-scene) to ftGlobalStorage  (per-project):&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmapsStorage.CopySettings(ftLightmapsStorage src, ftGlobalStorage dest)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copies all render settings from ftGlobalStorage (per-project) to ftLightmapsStorage (per-scene):&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmapsStorage.CopySettings(ftGlobalStorage src, ftLightmapsStorage dest)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Gets the path to the folder containing Bakery binaries:&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmaps.GetEditorPath()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Additional variables==&lt;br /&gt;
&lt;br /&gt;
Gets the current temporary files path (ftRenderLightmap instance must be created first):&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.scenePath&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Gets/sets UVGBuffer data compression (LZ4, if enabled, DDS if not):&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.compressedGBuffer&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Gets/sets output lightmap data compression (LZ4, if enabled, DDS if not):&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.compressedOutput&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Events==&lt;br /&gt;
&lt;br /&gt;
Scripts can subscribe to static events in ftRenderLightmap class.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Called before full Render:&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnPreFullRender&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Called before each light probe is rendered in Legacy light probe mode. ProbeEventArgs is a struct containing '''pos''' field with current light probe position:&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler&amp;lt;ProbeEventArgs&amp;gt; OnPreRenderProbe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Called after Legacy light probes were rendered:&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnFinishedProbes&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Called after full Render was finished:&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnFinishedFullRender&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Called before reflection probes are rendered:&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnPreReflectionProbeRender&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Called after reflection probes were rendered:&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnFinishedReflectionProbes&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mr F</name></author>
		
	</entry>
	<entry>
		<id>https://geom.io/bakery/wiki/index.php?title=Manual&amp;diff=1850</id>
		<title>Manual</title>
		<link rel="alternate" type="text/html" href="https://geom.io/bakery/wiki/index.php?title=Manual&amp;diff=1850"/>
		<updated>2026-01-02T12:56:03Z</updated>

		<summary type="html">&lt;p&gt;Mr F: /* Bakery Lightmapped Prefab */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== System requirements ==&lt;br /&gt;
To use Bakery you'll need:&lt;br /&gt;
* Windows (7 or higher) PC.&lt;br /&gt;
* Nvidia GPU. Minimum supported model is Kepler (GeForce 650 or newer. For Quadro cards check the specs).&lt;br /&gt;
* 64-bit Unity editor. Bakery was tested on all versions from 5.6 to 6 or higher.&lt;br /&gt;
&lt;br /&gt;
{{note|System requirements are for developer machine, not target platform. You can use lightmaps baked with Bakery anywhere.}}&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
* Make sure your project does not have any script compilation errors, as it will prevent Bakery scripts from compiling as well.&lt;br /&gt;
* Make sure you have the latest GPU driver. [https://www.nvidia.com/Download/index.aspx?lang=en-US Update it] if needed.&lt;br /&gt;
&lt;br /&gt;
'''Use the Game-Ready (standard) driver, not the &amp;quot;Studio&amp;quot; one.'''&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
1. Import Bakery to your project via [https://assetstore.unity.com/packages/tools/level-design/bakery-gpu-lightmapper-122218 Asset Store].&lt;br /&gt;
&lt;br /&gt;
2. Unity will show a list of files to import. If it's your first time using Bakery, it is recommended you just '''click Import'''. Experienced users may want to untick the ''examples'' folder for a more lightweight installation.&lt;br /&gt;
&lt;br /&gt;
Files will be imported to Assets/Bakery and Assets/Editor/x64/Bakery. These folders can be moved later.&lt;br /&gt;
&lt;br /&gt;
3. Unity will then import Bakery and compile the scripts. It may show a window like this:&lt;br /&gt;
&lt;br /&gt;
[[File:Goahead.png]]&lt;br /&gt;
&lt;br /&gt;
In which case you should click &amp;quot;Go Ahead&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
You should now see Bakery menu added to the editor:&lt;br /&gt;
&lt;br /&gt;
[[File:bmenu.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Quickstart ==&lt;br /&gt;
&lt;br /&gt;
1. Add some model or primitive and mark it as Static.&lt;br /&gt;
&lt;br /&gt;
'''Meshes must have non-overlapping UV for lightmapping. UV2 is used if present (otherwise UV1). If you did not unwrap models for lightmapping, make sure to check [https://docs.unity3d.com/Manual/LightingGiUvs-GeneratingLightmappingUVs.html Generate Lightmap UVs] on the asset.''' Unity primitives already have correct UV2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Staticmarked.jpg|320px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Select Directional Light (the one Unity created for you) and add '''Bakery Direct Light''' component to it.&lt;br /&gt;
{{note| Bakery and Unity use separate light source components.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Bakery Direct Light has many options to tweak, but you can easily match it to Unity light. Click '''Match lightmapped to real-time'''. Now Bakery light should have the same yellowish color as Unity’s default Directional.&lt;br /&gt;
&lt;br /&gt;
[[File:Matching.jpg|640px]]&lt;br /&gt;
&lt;br /&gt;
{{note| Direct Light component may complain about project not using linear light intensity. The problem is that by default Unity applies gamma correction to light source colors [https://twitter.com/guycalledfrank/status/1001108508614553600 incorrectly]. Correct mode can be enabled by [https://docs.unity3d.com/ScriptReference/Rendering.GraphicsSettings-lightsUseLinearIntensity.html scripting], and that’s what the “Fix” button does. If you already have many light sources set up in non-linear intensity mode, and you don’t want to change them again, you may skip fixing. Even if you press “Fix”, you can always revert the change anytime.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. To get shadowed ambient lighting, create Skylight (Bakery-&amp;gt;Create-&amp;gt;Skylight).&lt;br /&gt;
&lt;br /&gt;
[[File:Menusky.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Select Skylight, give it some bluish color and click '''Match scene skybox to this light'''. This will make scene skybox match lighting exactly.&lt;br /&gt;
{{note| Matching Unity skybox to Bakery skylight is optional but useful for correctness, as to ensure that visible environment and in-engine reflection probes match baked lighting. Currently this option only works for Standard render pipeline.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Skycomp.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Click Bakery-&amp;gt;Render Lightmap. By default, Full Lighting mode is active. It will bake both direct and indirect contribution from all lights. If you want to combine real-time shadows with baked GI, change it to '''Indirect'''.&lt;br /&gt;
&lt;br /&gt;
[[File:Bakerywindow.jpg]]&lt;br /&gt;
&lt;br /&gt;
{{note| Bakery may complain that you are using old [https://docs.unity3d.com/Manual/LinearLighting.html gamma mode] and suggest to change it. If you care about quality of lighting, using Linear mode is highly recommended. You may ignore it if you already have a big project set up with incorrect gamma and don’t want to change it or when shipping to mobile devices that don't support it.}}&lt;br /&gt;
&lt;br /&gt;
7. Click '''Render'''.&lt;br /&gt;
&lt;br /&gt;
8. Done! You should now have baked GI:&lt;br /&gt;
&lt;br /&gt;
[[File:Bakedgi.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Render settings ==&lt;br /&gt;
&lt;br /&gt;
All render settings can be accessed via Bakery-&amp;gt;Render Lightmap. Settings are saved for every scene. The topmost option in Bakery window allows you to switch between Simple, Advanced and Experimental settings, each succeeding mode revealing more tweakable options. Simple mode is enough for most scenes and it's a good way to get started.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render mode ===&lt;br /&gt;
Defines the type of lightmaps to bake. &lt;br /&gt;
&lt;br /&gt;
===== Full Lighting =====&lt;br /&gt;
Complete direct and indirect lighting for all Bakery lights.&lt;br /&gt;
{{note| On pre-2017.3 Unity versions if you have both Unity and Bakery components on the same object, you will need to disable Unity ones manually to avoid double brightness. On newer versions real-time effects are automatically disabled for baked lights, as with built-in lightmappers.}}&lt;br /&gt;
&lt;br /&gt;
===== Indirect =====&lt;br /&gt;
[[File:Image26.png|thumb|Comparison of different render modes supported by Unity]]&lt;br /&gt;
Basic mixed mode. It will look at the Baked Contribution selector on every light: if it’s set to ''Direct And Indirect'', the light is baked as in Full Lighting mode. If it’s set to ''Indirect Only'', only indirect contribution (GI) from this light is baked. In latter case you should keep both Unity and Bakery lights on the object, one giving real-time direct contribution, and another for precomputed GI.&lt;br /&gt;
&lt;br /&gt;
[[File:Indirectonly.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== Shadowmask =====&lt;br /&gt;
[[File:Image21.png|thumb|Left: completely baked light. Center: dynamic light with baked GI. Right: capsule shadow, bump and specular are dynamic, but cube shadow and GI are baked.]]&lt;br /&gt;
[[File:Image6.png|thumb|When camera gets far away enough or if dynamic shadows are disabled, the same scene will look like this]]&lt;br /&gt;
A more advanced mixed mode. It works by generating two types of lightmaps - one with baked color (as in Indirect mode), and another with shadows from static objects. It has several benefits:&lt;br /&gt;
* Real-time shadows can render only a handful of dynamic objects, instead of the whole scene.&lt;br /&gt;
* Real-time and baked shadows blend together properly.&lt;br /&gt;
* Real-time lights can render bump, specular and other surface effects, while still being occluded by high-quality baked shadows.&lt;br /&gt;
[https://docs.unity3d.com/Manual/LightMode-Mixed-Shadowmask.html More details]&lt;br /&gt;
&lt;br /&gt;
To enable this behaviour, you must have both Unity and Bakery lights on the same object, with Baked Contribution set to ''Shadowmask and Indirect''. Unmarked lights will be baked as in Indirect mode.&lt;br /&gt;
&lt;br /&gt;
[[File:Smask22.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== Distance Shadowmask =====&lt;br /&gt;
This checkbox is only visible if you chose shadowmask and simply toggles [https://docs.unity3d.com/Manual/LightMode-Mixed-ShadowmaskMode.html equally named setting] in project’s Quality Settings.&lt;br /&gt;
[https://docs.unity3d.com/Manual/LightMode-Mixed-DistanceShadowmask.html More details.]&lt;br /&gt;
{{note| Checkbox is not visible on Unity 5.6.x due to the lack of corresponding scripting API. Instead you can toggle it in Window-&amp;gt;Lighting-&amp;gt;Mixed Lighting-&amp;gt;Lighting Mode.}}&lt;br /&gt;
{{note| On Unity versions &amp;lt; 2017.3 rendering Shadowmask lightmaps will clear the light probes due to API limitations. They will need to be re-rendered again after bake. It shouldn’t happen on newer versions.}}&lt;br /&gt;
&lt;br /&gt;
===== Subtractive =====&lt;br /&gt;
Enables [https://docs.unity3d.com/Manual/LightMode-Mixed-Subtractive.html Subtractive] lighting mode. &lt;br /&gt;
&lt;br /&gt;
This option does not do anything special to lightmaps and, in fact, works just like Full Lighting.&lt;br /&gt;
&lt;br /&gt;
The only difference is that it also sets up real-time Unity lights to work with Subtractive mode (as it cannot be done through UI).&lt;br /&gt;
&lt;br /&gt;
You will need to additionally set up global subtractive parameters (like the global shadow color) in [https://docs.unity3d.com/Manual/GlobalIllumination.html#MixedLighting Unity lighting window].&lt;br /&gt;
&lt;br /&gt;
===== Ambient Occlusion Only =====&lt;br /&gt;
Only bakes AO. May be useful if you know what you're doing. Make sure to set up [[#Ambient_occlusion|AO options]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Directional mode ===&lt;br /&gt;
[[File:Image3.png|thumb|Comparison of different directional modes]]&lt;br /&gt;
Defines how directional information is baked. Standard lightmaps only store a single color per texel, while directional lightmaps give shaders a hint of how lighting changes over a hemisphere around the texel. This data is required to combine fully lightmapped areas with normal maps. Plugging it into the built-in [[#Bakery_shaders|Bakery shader]] can also produce approximate specular response.&lt;br /&gt;
&lt;br /&gt;
===== None =====&lt;br /&gt;
No directional data, single color per texel.&lt;br /&gt;
&lt;br /&gt;
===== Baked Normal Maps =====&lt;br /&gt;
Still no directional data, but normal maps are taken into account when rendering the lightmap. There is no additional runtime overhead. Since lightmaps usually have lower resolution than normal maps, the result may look blurry. Other problems include aliasing at distance due to lack of mipmapping and denoising step potentially smudging the detail. To learn how to use custom shaders with procedural normals in this mode, read [[#Normal_mapping|Normal Mapping]] section.&lt;br /&gt;
&lt;br /&gt;
===== Dominant Direction =====&lt;br /&gt;
This mode is similar to what Enlighten and Progressive bake in Unity. It is compatible will most shaders, only generates one additional map and the runtime overhead is minimal. The downside is that bump-mapping looks rather faint and gray-ish and can be quite different comparing to the same object under real-time lighting.&lt;br /&gt;
&lt;br /&gt;
===== RNM =====&lt;br /&gt;
Based on Radiosity Normal Mapping technique originally invented for HL2 ([https://steamcdn-a.akamaihd.net/apps/valve/2004/GDC2004_Half-Life2_Shading.pdf slides]) and later used in many games (e.g. Mirror’s Edge). It generates 3 HDR maps in total, being the most memory-demanding mode of all. Runtime overhead is still relatively low. This mode is more precise than Dominant Direction. It is better at reproducing surface contrast and handling colored lights affecting normal maps from different angles.&lt;br /&gt;
&lt;br /&gt;
===== SH =====&lt;br /&gt;
Based on “Precomputed Global Illumination in Frostbite” [https://media.contentapi.ea.com/content/dam/eacom/frostbite/files/gdc2018-precomputedgiobalilluminationinfrostbite.pdf paper]. This is the highest quality mode, giving much better surface contrast and representing differently colored lighting coming from different directions. Generates 4 maps in total, only one of them being HDR, therefore takes less memory than RNM. Runtime overhead is slightly higher than that of RNM.&lt;br /&gt;
&lt;br /&gt;
===== MonoSH =====&lt;br /&gt;
[[File:FY8Ru8hWIAAdYYH.jpg|thumb|Size/quality comparison of Dominant Direction, full SH and MonoSH]]&lt;br /&gt;
Same as SH, but using a monochromatic L1 directional coefficients. Similarly good surface contrast, although not accurately representing different colors shining from different directions at one texel; but good enough for many scenes. Only generates one additional map, so the VRAM usage/bandwidth is similar to Dominant Direction; in fact it's even smaller, due to Dominant Direction using RGBA maps, while MonoSH only needing RGB. The map is fed via the built-in directional lightmap system, but ''won't look correct with standard shaders''. Make sure to use a compatible shader.&lt;br /&gt;
&lt;br /&gt;
===== Limitations =====&lt;br /&gt;
&lt;br /&gt;
* RNM and SH/MonoSH can be only used with [[#Bakery_shaders|Bakery shader]] or require adjustments to your shaders.&lt;br /&gt;
* In RNM and SH modes, standard color lightmaps are not created. You need to either have Bakery shader on all materials in the scene, or use [[#Bakery_Lightmap_Group_Selector|Lightmap Groups]] to separate RNM/SH objects from the rest.&lt;br /&gt;
* RNM and SH maps are applied to objects using [https://docs.unity3d.com/ScriptReference/MaterialPropertyBlock.html MaterialPropertyBlock] and so may be not shown completely in Unity’s Lighting window.&lt;br /&gt;
* Dominant Direction, RNM and SH/MonoSH modes may require slightly more samples for GI and Light Meshes to get comparable quality.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Texels per unit ===&lt;br /&gt;
[[File:Texelscomp.jpg|thumb|1 vs 10 texels per unit]]&lt;br /&gt;
Approximate amount of lightmap texels per world unit. Affects the amount and resolution of generated lightmaps.&lt;br /&gt;
&lt;br /&gt;
Example values to get you started:&lt;br /&gt;
* Large outdoor area (a city): 1 - 5&lt;br /&gt;
* Medium outdoor area (a few alleys): 10-20&lt;br /&gt;
* High quality interior: 100&lt;br /&gt;
&lt;br /&gt;
It is assumed that scene scale is roughly 1 unit = 1 meter. Such scale is generally recommended when working in Unity for better navigation and for physics simulation. If your scale is different, multiply Texels accordingly.&lt;br /&gt;
&lt;br /&gt;
Keep in mind that Texels Per Unit is base resolution, but every object can be additionally tweaked using [https://docs.unity3d.com/Manual/class-MeshRenderer.html Scale in Lightmap] option on Mesh Renderers as well as [[#Scale per map type|Scale per map type]] in Bakery window.&lt;br /&gt;
&lt;br /&gt;
{{note| Objects with Scale in Lightmap set to 0 will not be baked, but will still cast shadows and affect GI.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Max resolution ===&lt;br /&gt;
Maximum lightmap size limit. If objects can't fit in a single lightmap (given current Texels Per Unit value), additional lightmaps will be allocated. Same 4 square objects can take four 512x512 maps or one 1024x1024.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bounces ===&lt;br /&gt;
[[File:Image36.png|thumb|Note how more bounces bring more light to closed spaces.]]&lt;br /&gt;
Defines how many times light rays should bounce off surfaces. Usually lower values are sufficient for outdoor scenes (e.g. a city), while higher values are required for more closed scenes (interiors, caves).&lt;br /&gt;
&lt;br /&gt;
While the slider is limited by 5 bounces, it is possible to type any amount of bounces into the number field.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Samples ===&lt;br /&gt;
[[File:Image7.png|thumb|Left: samples = 4, right: samples = 16. Denoising is off for illustrative purposes.]]&lt;br /&gt;
Affects quality of GI. Typical values are from 16 to 32.&lt;br /&gt;
&lt;br /&gt;
{{note| It is possible to type in any number, beyond the maximum slider value, but be aware that this number represents a square root of the final ray count, i.e. 32 is 1024 rays, 64 is 4096 rays, etc.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GPU Priority ===&lt;br /&gt;
While GPU is working on lightmaps, OS and other software may become less responsive. This option allows you to balance between baking speed and system responsiveness.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render ===&lt;br /&gt;
Bakes lightmaps for all opened scenes.&lt;br /&gt;
If [[Manual#Light_probe_mode|Light Probe Mode]] is set to L1 or L2, also bakes light probes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Render Light Probes ===&lt;br /&gt;
Bakes [https://docs.unity3d.com/Manual/LightProbes.html light probes] for all opened scenes.&lt;br /&gt;
&lt;br /&gt;
Note that to get correct mixed light shadowing on dynamic objects in Shadowmask mode you also need to enable [[Manual#Occlusion_probes|occlusion probes]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Render Reflection Probes ===&lt;br /&gt;
Bakes [https://docs.unity3d.com/Manual/class-ReflectionProbe.html reflection probes] for all opened scenes. This button is just for convenience and will call built-in engine reflection probe update.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update Skybox Probe ===&lt;br /&gt;
Bakes global diffuse and reflection probe for the current skybox. As with &amp;quot;Render Reflection Probes&amp;quot;, it just calls built-in engine functions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Occlusion probes ===&lt;br /&gt;
When rendering light probes, lets Unity bake occlusion probes using currently selected built-in lightmapper. Occlusion probes is additional data stored inside regular light probes, and it prevents dynamic objects from getting lit in shadowed areas. Currently there is no way to use custom occlusion probes in Unity, and it has to call its own lightmappers instead to do the job.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Warnings ===&lt;br /&gt;
These options will validate the scene after one of the Render buttons is pressed and show warning dialog boxes asking to continue or stop the baking process.&lt;br /&gt;
* Suppress all popups: don't show any dialog boxes after pressing Render.&lt;br /&gt;
* UV validation: will check if all models have fully correct lightmapping UVs - specifically if they lie within 0-1 range and don’t overlap.&lt;br /&gt;
* Overwrite check: will tell which lightmap files are going to be overwritten.&lt;br /&gt;
* Memory check: will tell a very approximate amount of video memory required.&lt;br /&gt;
* Sample count check: will check if any lights, GI or AO have unreasonable sample counts that can make GPU go out of available resources.&lt;br /&gt;
* Lightmapped prefab validation: validates Lightmapped Prefabs and notifies if some prefabs are going to be overwritten.&lt;br /&gt;
&lt;br /&gt;
== Advanced render settings ==&lt;br /&gt;
=== Light probe mode ===&lt;br /&gt;
Changes the way light probes are baked.&lt;br /&gt;
&lt;br /&gt;
* Legacy:  use Render Light Probes button to generate the probes. Point and directional lights are calculated within the lightmapper, while area/sky/indirect lighting is gathered by rendering a cubemap at each probe position. Results are stored as [https://docs.unity3d.com/ScriptReference/Rendering.SphericalHarmonicsL2.html L2 spherical harmonics]. The downsides are slow cubemap rendering performance and possible mismatch between lightmaps and probes in cases where shaders in your game do not physically represent lit surfaces or your project is set up for mobile (Unity can clip high intensity values away).&lt;br /&gt;
&lt;br /&gt;
* L1: light probes will be rendered together with lightmaps when you click Render. This option provides superior baking performance and will guarantee that probe lighting matches the lightmaps. Results are stored as L1 spherical harmonics (can be still used by regular shaders). Results can be further improved by using Non-Linear Light Probe SH option in [[#Bakery_shaders|Bakery shader]].&lt;br /&gt;
&lt;br /&gt;
* L2: superior quality (full L2 spherical harmonics). As with L1, automatically rendered together with lightmaps. Negligible performance impact compared to L1. Should look OK with all shaders. Probe contrast/directionality/ringing removal can be tweaked via Project Settings -&amp;gt; Bakery -&amp;gt; &amp;quot;Ringing removal for L2 light probes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''There seems to be a bug in Unity 2019.3 preventing Legacy light probe colors from being properly saved IF [[Manual#Occlusion_probes|occlusion probes]] option is enabled. L2 mode is now default and recommended when using occlusion probes.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Asset UV Processing ===&lt;br /&gt;
Configures UV padding adjustment for assets. Possible values:&lt;br /&gt;
* Don't change: don't touch the assets.&lt;br /&gt;
* Adjust UV padding: will look for models with auto-generated UVs (“Generate Lightmap UVs” on the asset) and adjust them further to have proper padding between UV islands per-mesh. Model-wide Pack Margin in importer settings is ignored. Optimal values are calculated instead, given area of each mesh and lightmap resolution.&lt;br /&gt;
* Adjust UV padding for new meshes only: same, but skips any models that were previously adjusted at least once.&lt;br /&gt;
* Remove UV adjustments: reverts all previous UV adjustments, makes auto-unwrapped models look they way Unity originally unwrapped them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser ===&lt;br /&gt;
Sets the desired denoiser. Possible values:&lt;br /&gt;
* Optix 5: uses OptiX 5.1 AI denoiser (previously known as &amp;quot;Legacy denoiser&amp;quot;). Runs on the GPU. Supported on everything from [https://en.wikipedia.org/wiki/Kepler_(microarchitecture) Kepler] (typically GeForce 6xx) to [https://en.wikipedia.org/wiki/Turing_(microarchitecture) Turing] (typically Geforce 20xx). Not supported on [https://en.wikipedia.org/wiki/Ampere_(microarchitecture) Ampere] (30xx). OptiX 5.1 uses a static training dataset which is embedded into it, meaning it is not affected by the driver implementation.&lt;br /&gt;
* Optix 6: uses OptiX 6.0 AI denoiser (previously the default option). Runs on the GPU. Seems to fail on Kepler (6xx) GPUs, but runs on everything newer, including Ampere (30xx). Since 6.0 the training dataset for the OptiX denoiser is in the driver. Before driver v442.50 its behaviour was similar to OptiX 5.1; however, after it NVIDIA has [https://forums.developer.nvidia.com/t/optix7-denoiser-different-results-with-different-version-of-drivers/117989/2 changed the dataset], and results can be different. The updated dataset may sometimes produce grid-like patterns and more bright edges (still fixable with [[Manual#Denoise:_fix_bright_edges|&amp;quot;Denoise: fix bright edges&amp;quot;]]), but it runs faster.&lt;br /&gt;
* Optix 7: uses OptiX 7.2 AI denoiser. Behaves similarly to OptiX 6.0, but might be better supported on Ampere (30xx).&lt;br /&gt;
* OpenImageDenoise: uses Intel Open Image Denoise library. Runs on the CPU (any CPU that supports SSE 4.1). Can be slightly slower than OptiX, but the quality is comparable.&lt;br /&gt;
* OpenImageDenoise2: uses Intel Open Image Denoise 2, CUDA mode. Runs on the GPU, performance is comparable to OptiX 6/7, quality is identical to the CPU version.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Adjust sample positions ===&lt;br /&gt;
Find best sample positions to prevent lighting leaks. Details of the algorithm are outlined [https://ndotl.wordpress.com/2018/08/29/baking-artifact-free-lightmaps/#leaks here]. In some cases (usually large and very low poly geometry with smooth normals) it may produce incorrect results, in which case you can disable it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Unload scenes before render ===&lt;br /&gt;
Unloads Unity scenes before baking to free up video memory. Complex scenes can take a few gigabytes of VRAM by simply being shown in editor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Denoise ===&lt;br /&gt;
[[File:Image31.png|thumb|Left: denoising off, right: denoising on.]]&lt;br /&gt;
If enabled, will apply denoising algorithm. Bakery uses [https://developer.nvidia.com/optix-denoiser Nvidia’s AI denoiser (OptiX)] or Intel's Open Image Denoise (if selected).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Fix Seams ===&lt;br /&gt;
[[File:Image22.png|thumb|Left: seams, right: seams are fixed.]]&lt;br /&gt;
If enabled, will attempt to blend seams created by UV discontinuities. Useful for smooth geometry, including Unity’s default sphere.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Split by scene ===&lt;br /&gt;
If multiple scenes are loaded at once, and this option is enabled, each scene will have its own set of lightmaps, not shared with others. It can be useful for limiting the amount of textures loaded when scenes are streamed at runtime.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hole filling ===&lt;br /&gt;
[[File:Holefilling.jpg|thumb|Hole filling off vs on.]]&lt;br /&gt;
If [[Manual#Atlas_Packer|Atlas Packer]] is set to xatlas, will try to fill every hole, resulting in more efficient atlases. For scenes with very complex geometry it can increase scene export time, but otherwise recommended.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Min resolution ===&lt;br /&gt;
Minimum lightmap size limit. Can be used to balance between many small but fully occupied lightmaps vs few incompletely filled.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Scale per map type ===&lt;br /&gt;
Allows you to scale the resolution of color/shadowmask/direction maps differently. For example, a common case would be to have low resolution indirect color but highly detailed shadowmask. Note that scaling is applied after the lightmaps are rendered, so it won’t save baking time. If “Adjust UV padding” is on, padding will be based on the lowest resolution map to prevent texel leaking.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Checker preview ===&lt;br /&gt;
[[File:Image12.png|thumb|Checker preview in action]]&lt;br /&gt;
If Show checker checkbox is on, Scene View will render a checkerboard pattern on top of visible objects to demonstrate lightmap texel size. This is useful to make sure you are using adequate values for Texels Per Unit and other resolution-affecting settings before you bake.&lt;br /&gt;
&lt;br /&gt;
Enabling checker preview will force Bakery to perform atlas packing. It can take some time, but shouldn’t be longer than a few seconds. Press Refresh checker to re-atlas the scene after you changed something to see changes.&lt;br /&gt;
&lt;br /&gt;
Checker preview also uses random colors to show how the scene will be split into different lightmaps.&lt;br /&gt;
&lt;br /&gt;
{{note| Checker preview currently does not show correct texel sizes for Terrains.}}&lt;br /&gt;
&lt;br /&gt;
==== Atlas preview ====&lt;br /&gt;
[[File:FN-TmhRXwAE9i2I.png|thumb|Atlas preview in action]]&lt;br /&gt;
Atlas preview button is visible when Checker preview is on. Clicking it will open a new window where the UV layouts of future lightmaps are shown. Click &amp;quot;&amp;lt;&amp;quot; &amp;quot;&amp;gt;&amp;quot; buttons to browse the lightmaps.&lt;br /&gt;
This is useful for checking out packing quality and lightmap count before baking.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Emissive boost ===&lt;br /&gt;
Multiplies any surface emission by this number.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Indirect boost ===&lt;br /&gt;
Multiplies all bounced lighting by this number. Same as Indirect Intensity on light components, but global.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Backface GI ===&lt;br /&gt;
[[File:Image30.jpg|thumb|Backface GI]]&lt;br /&gt;
[[File:Image35.png|thumb|Left: backface GI = 0, right: backface GI = 1. Note how shadowed areas receive more green lighting.]]&lt;br /&gt;
Determines how much light is passed through front faces to back faces and then bounced off by GI. This is especially useful for thin translucent surfaces like leaves. Values are in 0-1 range.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Ambient occlusion ===&lt;br /&gt;
[[File:Image15.png|thumb|Left: AO intensity = 0. Right: AO intensity = 1.]]&lt;br /&gt;
Simple non-physical ambient occlusion you can apply over final scene lighting for aesthetic purposes.&lt;br /&gt;
* Intensity: controls visibility of the AO effect. Value of 0 disables the effect.&lt;br /&gt;
* Radius: determines the ray distance used in the AO effect. Smaller values give localized occlusion (corners, wrinkles), while larger values make it more similar to Skylight, giving shadows from distant objects.&lt;br /&gt;
* Samples: affects the quality of ambient occlusion. Typical values are from 4 to 32.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dither transparency ===&lt;br /&gt;
Enables semi-transparent shadows by automatically dithering alpha textures. See [[Manual#Opacity|how Bakery interprets opacity maps]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== RTX Mode ===&lt;br /&gt;
Enables RTX hardware acceleration. Only RTX GPUs will benefit from this option. Minimum supported driver version is 418.&lt;br /&gt;
&lt;br /&gt;
Drivers can emulate RTX mode on most non-RTX Nvidia cards, but the result is usually slower.&lt;br /&gt;
&lt;br /&gt;
RTX mode '''must''' be enabled on Ampere (3xxx) or newer cards.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Export terrain trees ===&lt;br /&gt;
If enabled, painted terrain trees will affect lighting. Trees themselves will not be baked. Note that highest possible LOD level is used for every tree during baking. It is not recommended to use this option for rendering multi-kilometer forests with highly detailed models.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Terrain optimization ===&lt;br /&gt;
If enabled (default), Terrains use separate ray tracing technique to take advantage of their heightfield geometry. Otherwise they are treated like any other mesh. Terrain optimization significantly reduces memory footprint required for high-resolution landscapes. In some cases it can also make terrain baking faster, in other cases (especially with simple low-resolution landscapes) it might make sense to disable it.&lt;br /&gt;
&lt;br /&gt;
{{note| Terrain Optimization is not currently compatible with painted terrain holes. Disable it to make them work.}}&lt;br /&gt;
{{note| Terrain Optimization is only supported in non-RTX mode.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Light Mesh batch limit ===&lt;br /&gt;
If this value is above 0, combines many [[Manual#Bakery_Light_Mesh|Light Meshes]] into one, given they have identical settings and affect the same [[Manual#Bakery_Lightmap_Group_Selector|Lightmap Groups]], but limiting their total sample count to this value (I.e. if the limit is 64, it can combine 2 lights with samples=32 or 4 lights with samples=16, etc). This will increase performance in scenes with many Light Meshes. Be careful setting this value too high, as the GPU may hit the OS driver timeout while processing too many samples at once.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Compress volumes ===&lt;br /&gt;
If enabled, applies texture compression to volume 3D textures and switches Bakery shaders to a corresponding sampling mode. Not recommended for very low resolution volumes. Volume size may be increased to be a multiple of 4.&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
* Currently it can only compress to BC6H/BC7 texture formats (desktop/consoles).&lt;br /&gt;
* Volume compression is only supported on Unity 2020.1 or newer.&lt;br /&gt;
* Currently only Bakery shader for the standard rendering pipeline supports using compressed volumes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Samples multiplier ===&lt;br /&gt;
Multiplies all shadow and GI samples by the specified factor. Use it to quickly change between draft and final quality.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Tile size ===&lt;br /&gt;
Same as [[#GPU Priority|GPU Priority]], but instead of abstract priority you set tile size. Bakery splits lightmaps into smaller tiles and updates one at a time. Smaller size means more GPU work interruptions, and can make system more responsive.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Temp path ===&lt;br /&gt;
Temporary files folder. Bakery may require a few gigabytes of free space during rendering. Having this folder on SSD can make rendering slightly faster comparing to HDD. At the moment, this folder is not cleaned automatically. You can delete its contents anytime (except during rendering) manually or via Bakery -&amp;gt; Utilities -&amp;gt; Clear cache.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Output path ===&lt;br /&gt;
Lightmap folder. This is where all lightmap, and also lightprobe and vertex color assets will be saved. This path is relative to your Assets folder.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Use scene named output path ===&lt;br /&gt;
If this option is enabled, output path will be automatically set to a folder with the same name as the currently active scene (Assets/CurrentSceneName/). This is similar to how built-in Unity lightmappers behave.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render Selected Groups ===&lt;br /&gt;
Only bakes [[#Bakery_Lightmap_Group_Selector|Lightmap Groups]] containing selected objects.&lt;br /&gt;
Not only selected objects will be redrawn, but all Lightmap Groups they belong to. Other lightmaps will not be updated. If objects are not a part of some manually assigned group, then a part of the scene using the same lightmap will be rebaked.&lt;br /&gt;
&lt;br /&gt;
Currently it is more convenient to use [[Partial_scene_baking|Sectors for partial scene baking]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Beep on finish ===&lt;br /&gt;
If enabled, Bakery will play a sound when the bake is finished.&lt;br /&gt;
&lt;br /&gt;
== Experimental render settings ==&lt;br /&gt;
=== Unwrapper ===&lt;br /&gt;
If [[#Asset_UV_Processing|Adjust UV Padding]] is enabled, defines the unwrapper that will be used.&lt;br /&gt;
* Default: standard Unity unwrapper. Bakery will call [https://docs.unity3d.com/ScriptReference/Unwrapping.GenerateSecondaryUVSet.html Unwrapping.GenerateSecondaryUVSet] for every mesh with different padding parameters.&lt;br /&gt;
* xatlas: uses [https://github.com/jpcy/xatlas xatlas] by [https://github.com/jpcy jpcy], a modified version of [https://github.com/Thekla/thekla_atlas thekla_atlas] by [https://github.com/castano Ignacio Castaño]. thekla_atlas was used in The Witness ([http://the-witness.net/news/2010/03/graphics-tech-texture-parameterization/ blog post]).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Atlas Packer ===&lt;br /&gt;
Selects the algorithm to use when packing different object UV layouts into large lightmap atlases.&lt;br /&gt;
* Default: original algorithm Bakery used before v1.7.&lt;br /&gt;
* xatlas: uses xatlas.&lt;br /&gt;
&lt;br /&gt;
Some features are only supported with one atlas packer:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Default&lt;br /&gt;
! xatlas&lt;br /&gt;
|-&lt;br /&gt;
| [[Manual#Bakery_Lightmap_Group_Selector|Override resolution]]&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
|-&lt;br /&gt;
| Efficient LOD packing&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Manual#Hole_filling|Hole filling]]&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that atlas packer can be also chosen separately for every Lightmap Group.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Export geometry and maps ===&lt;br /&gt;
If enabled, Bakery will export the scene to its format before rendering. If you are sure that geometry and textures of the scene and lightmap resolution settings were not changed (e.g. you are only tweaking GI or light settings), you can disable this checkbox to make next rendering faster.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update unmodified lights ===&lt;br /&gt;
If enabled, Bakery will recalculate light sources that didn’t change since last rendering. If you are only tweaking one light and don’t want to wait for other lights to re-render, you can disable this checkbox.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update modified lights and GI ===&lt;br /&gt;
If enabled, Bakery will recalculate GI and lights that were changed since last rendering.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== UV padding: increase only ===&lt;br /&gt;
Only visible if [[#Asset_UV_Processing|Adjust UV padding]] is on. By default, optimal UV padding for a model asset is calculated only based on currently loaded scenes. If there are multiple instances of the same model using different lightmap resolution, the smallest one will define padding, so spacing between UV charts is large enough to prevent them from leaking over each other. However, baking the same model in 2 different isolated scenes will possibly break UVs in previous scenes while optimizing for the new one. This checkbox allows to prevent such behaviour by never decreasing the padding value, so it will be always optimized for the lowest resolution instance ever baked.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoise: fix bright edges ===&lt;br /&gt;
[[File:Image19.png|thumb|Left: a bright edge is visible after denoising; Right: fixed.]]&lt;br /&gt;
Only visible if [[#Denoise|Denoise]] is on. Sometimes the neural net used for denoising may produce bright edges around shadows, like if a sharpening effect was applied. If this option is enabled, Bakery will try to filter them away. Denoising stage may get slightly slower, when enabled.&lt;br /&gt;
&lt;br /&gt;
This feature may also be used to filter &amp;quot;fireflies&amp;quot;, i.e. occasional bright dots from the lightmap.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Post-packing ===&lt;br /&gt;
Sometimes when rendering a scene, Bakery can split the lightmap into multiple sub-lightmaps, e.g. when baking different LODs or terrains.&lt;br /&gt;
Post-packing tries to minimize final atlas count by combining these sub-lightmaps in one texture.&lt;br /&gt;
It is recommended to keep this option enabled.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Combine with Enlighten real-time GI ===&lt;br /&gt;
If enabled, then when the Render button is pressed, it will first try to bake with Enlighten to calculate real-time GI. After that, regular Bakery lightmapping process will happen. Both baked and real-time GI will work together.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bake on remote server ===&lt;br /&gt;
Enables [[Network baking|network baking]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Presets ===&lt;br /&gt;
Currently shown under Render/Update buttons when settings are in Experimental mode.&lt;br /&gt;
* Click '''New''' to save all current settings to a preset file.&lt;br /&gt;
* By default, when a preset is active, all settings are grayed out to prevent overwriting the preset.&lt;br /&gt;
* Click '''Modify preset''' to be able to change settings and overwrite the preset.&lt;br /&gt;
* Presets can be swapped via the preset field. Disable preset usage by setting it to None.&lt;br /&gt;
&lt;br /&gt;
== Components ==&lt;br /&gt;
=== Bakery Lightmap Group Selector ===&lt;br /&gt;
&lt;br /&gt;
Specifies which '''Lightmap Group''' to use for the object and all of its children.&lt;br /&gt;
Lightmap Group is a term Bakery uses for a collection of objects sharing one lightmap. Groups have properties telling Bakery how to pack the objects, which lights should affect them, should the result be baked into a texture or vertices.&lt;br /&gt;
By default all static objects are automatically packed into multiple lightmaps groups (atlases), so you don’t have to worry. Defining groups manually should be only used for special purposes, for example:&lt;br /&gt;
* Marking certain objects use [[Vertex Lightmaps|per-vertex lightmap]] instead of textures.&lt;br /&gt;
* Baking a lightmap using exact unscaled UVs as they were in a modeling package.&lt;br /&gt;
* Grouping certain areas of the level to use single lightmap to facilitate resource streaming or to switch different baked lighting at runtime via scripts.&lt;br /&gt;
* Using Render Selected Groups button to only update grouped objects.&lt;br /&gt;
&lt;br /&gt;
To manually define a group, you create '''Lightmap Group Assets''', either by using Assets-&amp;gt;Create menu, or using the Create New button in the component. When using the Create New button, new asset will be created based on these forms:&lt;br /&gt;
* Name: name of the Lightmap Group Asset to create.&lt;br /&gt;
* Packing mode: this selector defines the packing mode of the Lightmap Group. There are 3 modes:&lt;br /&gt;
** Original UV: object and its children will be baked with unmodified UVs. No packing is performed. This is useful for models when multiple meshes share the same already packed UV layout.&lt;br /&gt;
** Pack Atlas: object and its children are packed into a dedicated texture atlas. Before v1.3 every packable child needed to have the component, but it’s no longer necessary. Every child will be packed as its own rectangle, except when Bakery auto-detects a child having non-overlapping sub-children, in which case multiple objects can use a single rectangle.&lt;br /&gt;
** Vertex: object and its children will use vertex-colored baked lighting instead of textures. Note that you’ll need a custom shader for this to work, like [[#Bakery_shaders|Bakery Shader]]. One simple shader (&amp;quot;Bakery/Simple Vertex Lightmapped&amp;quot;) is also included for demonstration and reference. [[Vertex Lightmaps|Learn more about vertex lightmaps.]]&lt;br /&gt;
* Directional mode: allows you to override [[#Directional mode|directional mode]] on the group. Options are the same except for Auto, which will simply use the global setting.&lt;br /&gt;
* Resolution: desired lightmap resolution.&lt;br /&gt;
* Auto-resolution: use [[Manual#Texels_per_unit|Texels Per Unit]] to determine closest power-of-two resolution.&lt;br /&gt;
* Atlas packer: select [[Manual#Atlas_Packer|atlas packing]] algorithm for this group.&lt;br /&gt;
* Bitmask: a list of toggles used to exclude light sources from affecting the lightmap. Every Bakery light source also has a bitmask setting. Lights only affects Lightmap Groups with which they share at least one of these toggles. Default settings mean all lights affect all lightmaps.&lt;br /&gt;
&lt;br /&gt;
[[File:Ts.jpg|thumb|Transparent selfshadow OFF vs ON: note how some single-sided but back-facing polygons become properly lit]]&lt;br /&gt;
&lt;br /&gt;
If you have a Lightmap Group with the Pack Atlas mode assigned, additional settings will appear on the component:&lt;br /&gt;
* Override resolution: override the resolution this object and its children occupy in the lightmap.&lt;br /&gt;
* Resolution: manually defined resolution. For example, if you have a lightmap with a resolution of 512 and it is assigned to 4 objects with override resolution set to 256, Bakery will generate a single 512x512 lightmap where each object takes exactly 256x256 square.&lt;br /&gt;
&lt;br /&gt;
If you select a Lightmap Group asset, additional experimental settings will be visible:&lt;br /&gt;
* [[Subsurface scattering|Subsurface scattering: (click to read more)]]&lt;br /&gt;
* Normal offset: allows you to offset rays from the surface. This is rarely useful and mostly present for experimental purposes.&lt;br /&gt;
* Transparent selfshadow: start rays behind the surface so it doesn't cast shadows on self. Might be useful for translucent foliage.&lt;br /&gt;
* Vertex sampling density (only if Packing Mode is set to Vertex): by default per-vertex bakes only compute 1 value for every vertex; if sampling density is &amp;gt; 0, it will instead average many samples scattered across triangles, yielding super-sampled, smoother results.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Lightmapped Prefab ===&lt;br /&gt;
This component allows prefabs to store lightmapping metadata. Such prefabs can be then instantiated in any scene, both in editor and at runtime.&lt;br /&gt;
The component should be added directly to the root object of the prefab. Nested prefabs are not supported. Because the prefab is going to be overwritten after bake (the same way as when the “Apply” button is pressed), it is required that the prefab does not have any unapplied changes (child objects shouldn’t be moved, materials and script parameters should be unchanged, etc). If such changes are detected, an error will be printed in the component UI and no metadata will be saved after bake. If [[#Warnings|Lightmapped prefab validation]] warning is enabled, all prefab errors will be also shown in a dialog box before the bake.&lt;br /&gt;
&lt;br /&gt;
Lightmapped prefabs support all Bakery features, such as LODs, terrains, directional lightmaps, RNM, SH, per-vertex modes and shadowmasks. For shadowmasks to work, you need lights to also be a part of the same prefab.&lt;br /&gt;
&lt;br /&gt;
{{note| Note that prefab shadowmasks only work on Unity 2017.4 or newer due to API limitations.}}&lt;br /&gt;
&lt;br /&gt;
After baking, an object named “BakeryPrefabLightmapData” will be added to prefab. This object holds a script with all necessary data to apply the lightmaps.&lt;br /&gt;
&lt;br /&gt;
Additionally, Lightmapped Prefab allows to save current render settings and load them back to any currently open scene, using two buttons:&lt;br /&gt;
* Save current render settings to prefab: stores a copy of current Render Settings on  this prefab.&lt;br /&gt;
* Load render settings from prefab: sets current Render Settings to those stored on the prefab.&lt;br /&gt;
[[File:Upload 2019-9-17 10-32-34.png|thumb|Applying the prefab]]&lt;br /&gt;
When baking a Lightmapped Prefab, it is recommended to check that:&lt;br /&gt;
* Prefab is &amp;quot;Applied&amp;quot;. On older Unity versions, click &amp;quot;Apply&amp;quot; button on the top right corner on the Inspector. On newer versions click the &amp;quot;Overrides&amp;quot; list and then &amp;quot;Apply all&amp;quot;.&lt;br /&gt;
* Prefab component UI does not show any errors.&lt;br /&gt;
* &amp;quot;Lightmapped prefab validation&amp;quot; checkbox is enabled in the main window. This option will validate all Lightmapped Prefabs in the scene and notify about any potential issues with a dialog box.&lt;br /&gt;
&lt;br /&gt;
{{note| Lightmaps are named after the scene they are baked in or a Lightmap Group they use (if any). When baking different prefabs in the same scene, make sure to either use a differently named [[Manual#Bakery_Lightmap_Group_Selector|Lightmap Group]] or change the [[Manual#Output_path|Output Path]].}}&lt;br /&gt;
&lt;br /&gt;
{{note| When baking multiple prefabs using identical models one by one, it is recommended to set [[Manual#Asset_UV_Processing|Asset UV Processing]] to ''Don't Change'', to prevent alteration of shared model UVs.}}&lt;br /&gt;
&lt;br /&gt;
{{note| Bakery's prefab workflow was implemented before Unity had a &amp;quot;double-click into prefab&amp;quot; view feature. Thus, lightmaps may be not correctly applied in the isolated prefab view, and the component may show a &amp;quot;This GameObject is not a prefab&amp;quot; message. It should work as expected when working in a normal scene.}}&lt;br /&gt;
&lt;br /&gt;
{{note|When unpacking previously baked prefabs and unlinking them from existing lightmaps, make sure to remove the BakeryPrefabLightmapData object which holds the prefab-wide lightmap/renderer connections.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Direct Light ===&lt;br /&gt;
[[File:Directlight.jpg|thumb|Pure direct light with GI]]&lt;br /&gt;
[[File:Image4.png|thumb|Left: shadow spread = 0.01, right: 0.05. Note how shadows start sharp and get gradually blurrier with distance.]]&lt;br /&gt;
Infinitely distant directional light (e.g. Sun).&lt;br /&gt;
* Color: color.&lt;br /&gt;
* Intensity: linear color multiplier.&lt;br /&gt;
* Shadow spread: size of the light source or, simply put, shadow blurriness. 0 = max sharp shadows, 1 = max blurred shadows. Technically it interpolates from a single ray to a wider cone of rays.&lt;br /&gt;
* Shadow samples: affect shadows quality. The smaller the Shadow Spread value, the less samples are needed for a clean image. Typical values for sun shadows are from 1 to 16. Setting samples to 0 will make shadows from this light disappear.&lt;br /&gt;
* Bitmask: a list of toggles used to exclude this light source from affecting particular Lightmap Groups.&lt;br /&gt;
* Baked contribution: determines what kind of lighting data should be baked. Only visible in Indirect or Shadowmask modes. Possible values:&lt;br /&gt;
** Direct and Indirect: both direct and indirect contribution will be completely baked.&lt;br /&gt;
** Indirect only: a realtime light is supposed to provide direct contribution; only indirect lighting is baked.&lt;br /&gt;
** Shadowmask and indirect: a realtime light is supposed to provide direct contribution, but shadows from static geometry will be baked to a separate map. Dynamic and static shadows will be mixed together. Indirect lighting will be baked as usual.&lt;br /&gt;
** Direct, Indirect, Shadowmask (custom lighting only): same as Direct and Indirect, but the Shadowmask is also produced and assigned to use with custom shaders.&lt;br /&gt;
* Denoise shadowmask: determines if denoising should be applied to this light’s shadowmask. Usually it’s not necessary as shadows don’t exhibit much noise, but can be useful for very wide blurry shadows (large shadow spread).&lt;br /&gt;
* Indirect intensity: non-physical GI multiplier for this light. Should be 1 for natural lighting, but can be modified for more stylized scenes.&lt;br /&gt;
* Anti-alias: performs super-sampling for the shadow.&lt;br /&gt;
* Texture projection: projects a multiplicative tiled texture over lighting. Can be used to emulate distant cloud shadows.&lt;br /&gt;
When texture projection is set, its scale/offset can be manipulated using &amp;quot;Tiling&amp;quot; and &amp;quot;Offset&amp;quot; fields. Alternatively, click &amp;quot;Tweak projection in Scene View&amp;quot; and use additional gizmo to move and scale the projection visually. Click &amp;quot;Render reference frame&amp;quot; to save a PNG of &amp;quot;light's point of view&amp;quot;. This is useful to paint cloud shadows over the scene.&lt;br /&gt;
&lt;br /&gt;
If the same object has both Unity and Bakery light sources enabled, and they don’t match, two buttons will appear:&lt;br /&gt;
* Match lightmapped to real-time: copy common settings from Unity light to Bakery light.&lt;br /&gt;
* Match real-time to lightmapped: copy common settings from Bakery light to Unity light.&lt;br /&gt;
&lt;br /&gt;
{{note| In physical terms, Bakery's &amp;quot;Intensity&amp;quot; for directional lights is Lux divided by Pi.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Sky Light ===&lt;br /&gt;
[[File:Skylight.jpg|thumb|Pure sky light with GI]]&lt;br /&gt;
Infinitely distant shadowed ambient light (sky).&lt;br /&gt;
* Color: color.&lt;br /&gt;
* Intensity: linear color multiplier.&lt;br /&gt;
* Sky texture: optional cubemap asset, e.g. HDRI panorama to affect lighting colors from different directions.&lt;br /&gt;
{{note| Rotating sky light’s GameObject will rotate lighting from the cubemap accordingly.}}&lt;br /&gt;
* Samples: affects shadows quality. Typical values are from 8 to 32.&lt;br /&gt;
* Hemispherical: if enabled, lighting will only come from above (upper hemisphere). Otherwise from all directions.&lt;br /&gt;
* Bitmask: a list of toggles used to exclude this light source from affecting particular Lightmap Groups.&lt;br /&gt;
* Baked contribution: determines what kind of lighting data should be baked. Only visible in Indirect or Shadowmask modes. Possible values:&lt;br /&gt;
** Direct and Indirect: both direct and indirect contribution will be completely baked. This is the default and recommended behaviour for all Sky Lights, as there is no real-time version to emulate them in Unity.&lt;br /&gt;
** Indirect only: a realtime light is supposed to provide direct contribution; only indirect lighting is baked.&lt;br /&gt;
&lt;br /&gt;
If sky light’s settings and current scene skybox don’t match, two buttons will appear:&lt;br /&gt;
* Match this light to scene skybox: copy common settings from active skybox material to Bakery sky light. Currently it can only match skyboxes using the “Skybox/Cubemap” or “Skybox/Bakery skybox” shaders.&lt;br /&gt;
* Match scene skybox to this light: copy common settings from Bakery sky light to scene skybox.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bakery Light Mesh ===&lt;br /&gt;
[[File:Image29.png|thumb|Left: Samples Near = 0, Samples Far = 4096.&amp;lt;br&amp;gt;&lt;br /&gt;
Middle: Samples Near = 0, Samples Far = 128.&amp;lt;br&amp;gt;&lt;br /&gt;
Right: Samples Near = 16, Samples Far = 128.&amp;lt;br&amp;gt;&lt;br /&gt;
Note how the lighting appearance is similar, yet less combined samples are used.]]&lt;br /&gt;
Emissive mesh of any shape. Should be used together with the Mesh Renderer component or with a Light component set to Area mode.&lt;br /&gt;
* Color: color&lt;br /&gt;
* Intensity: linear color multiplier.&lt;br /&gt;
* Cutoff: maximum lighting distance. Bakery will additionally attenuate correct inverse-squared falloff near the limit. It works best when cutoff value is just where physical falloff gets very dim. Cutoff can improve baking performance, but you also can set it to a very high (unreachable) value for complete correctness.&lt;br /&gt;
* Self Shadow: determines if light mesh itself casts shadows. This option also enables a more precise lighting algorithm.&lt;br /&gt;
* Samples Near: affect lighting quality near the mesh. Typical values are from 16 to 64. This option is only available when Self Shadow is on.&lt;br /&gt;
* Samples Far: affects lighting quality far away from the mesh. Typical values are from 4 to 4096.&lt;br /&gt;
&lt;br /&gt;
Bakery mixes two different algorithms for area lights based on emissive surface proximity. Close to the light it works similar to the GI algorithm, while at a distance the light is approximated as a cloud of virtual point lights.&lt;br /&gt;
&lt;br /&gt;
{{note| &amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;Light Meshes don’t receive lighting on their own and don’t get lightmapped.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;One Light Mesh with many polygons is faster to bake than many simple Light Meshes.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;If you keep getting dirty/noisy results, try setting Samples Near to 0. Then only the VPL algorithm is used. It is also useful for very simple lights where precision is not important (e.g. window lights on a building).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;}}&lt;br /&gt;
[[File:Dd99d-QU0AEKFBK.jpg|thumb|A curved Light Mesh]]&lt;br /&gt;
* Bitmask: a list of toggles used to exclude this light source from affecting particular Lightmap Groups.&lt;br /&gt;
* Baked contribution: determines what kind of lighting data should be baked. Only visible in Indirect or Shadowmask modes. Possible values:&lt;br /&gt;
** Direct and Indirect: both direct and indirect contribution will be completely baked. This is the default and recommended behaviour for all Light Meshes, as there is no real-time version to emulate them in Unity.&lt;br /&gt;
** Indirect only: a realtime light is supposed to provide direct contribution; only indirect lighting is baked.&lt;br /&gt;
** Shadowmask and Indirect: a realtime light is supposed to provide direct contribution, but shadows from static geometry will be baked to a separate map. Dynamic and static shadows will be mixed together. Indirect lighting will be baked as usual. Currently only HDRP (and custom renderers) support mixed area lights.&lt;br /&gt;
** Direct, Indirect, Shadowmask (custom lighting only): same as Direct and Indirect, but the Shadowmask is also produced and assigned to use with custom shaders.&lt;br /&gt;
* Indirect intensity: non-physical GI multiplier for this light. Should be 1 for natural lighting, but can be modified for more stylized scenes.&lt;br /&gt;
* Shadowmask with falloff: bakes complete light attenuation into the shadowmask (only useful with custom shaders).&lt;br /&gt;
&lt;br /&gt;
If mesh material and light settings do not match, two buttons will appear:&lt;br /&gt;
* Match light to material:  copy common settings from unlit mesh material or area light to Bakery light.&lt;br /&gt;
* Match material to light: copy common settings from Bakery light to unlit mesh material or area light.&lt;br /&gt;
&lt;br /&gt;
==== Differences between Light Mesh and emissive materials ====&lt;br /&gt;
Emissive material:&lt;br /&gt;
* Propagates light during GI calculation, therefore is “free”, no matter how many meshes are emissive.&lt;br /&gt;
* Small and bright lights can give inaccurate noisy results, depending on GI sample count.&lt;br /&gt;
* Has to occupy space in lightmap due to the way GI in Bakery works, therefore possibly wasting it. Also it means that emissive objects require valid UVs and have “Cast shadows” enabled..&lt;br /&gt;
&lt;br /&gt;
Light Mesh:&lt;br /&gt;
* Lighting is calculated separately for each light, therefore is slower than emissive materials.&lt;br /&gt;
* Designed to give clean results for small and bright lights, even very far away from them.&lt;br /&gt;
* Doesn’t take space in lightmaps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Point Light ===&lt;br /&gt;
[[File:Image11.png|thumb|Left: Shadow Spread = 0.5, right: Shadow Spread = 1.]]&lt;br /&gt;
Point light, doesn’t have area. Despite physical impossibility it is useful for games and the only way to match Unity’s point and spot lights.&lt;br /&gt;
{{note|Spot lights are just point lights with additional projection mask.}}&lt;br /&gt;
* Color: color.&lt;br /&gt;
* Intensity: linear color multiplier.&lt;br /&gt;
* Shadow spread: shadow blurriness. Although point lights don’t have area, it is often desired to still have blurred shadows from them. For this purpose shadows are simulated as if they were cast from a spherical area light. This parameter defines the radius of such virtual sphere, directly affecting blurriness.&lt;br /&gt;
* Physical falloff: if enabled, will use correct inverse-squared falloff with additional attenuation near the limit. Otherwise will try to mimic Unity’s falloff.&lt;br /&gt;
* Falloff min size: learn more in [[Point Light Attenuation]] section.&lt;br /&gt;
* Range: if physical falloff is disabled, equals to Unity’s light range. If it’s enabled, will only slightly fade away physical falloff at the edge.&lt;br /&gt;
* Samples: affects shadows quality. Typical values are from 1 to 512. Setting samples to 0 will make shadows from this light disappear.&lt;br /&gt;
[[File:Image10.png|thumb|Left to right: Omni, Cookie (default spot texture), Cubemap, IES.]]&lt;br /&gt;
* Projection mask: type of mask/cookie. Options:&lt;br /&gt;
** Omni: no mask, equals to Unity’s Point Light.&lt;br /&gt;
** Cookie: cookie texture projection. Additional options:&lt;br /&gt;
*** Cookie texture: 2D texture asset. Bakery includes the original Unity’s Spot Light texture (named ftUnitySpotTexture) that you can use to mimic it.&lt;br /&gt;
*** Angle: texture projection angle (similar to Unity’s Spot Light).&lt;br /&gt;
*** Correct distortion: corrects cookie distortion visible on straight lines at wide angles.&lt;br /&gt;
** Cubemap: cubemap cookie projection. Additional options:&lt;br /&gt;
*** Projected cubemap: cubemap asset.&lt;br /&gt;
** IES: lighting is modulated by the IES file data. Additional options:&lt;br /&gt;
*** IES file: file with .ies extension.&lt;br /&gt;
* Bitmask: a list of toggles used to exclude this light source from affecting particular Lightmap Groups.&lt;br /&gt;
* Baked contribution: determines what kind of lighting data should be baked. Only visible in Indirect or Shadowmask modes. Possible values:&lt;br /&gt;
** Direct and Indirect: both direct and indirect contribution will be completely baked.&lt;br /&gt;
** Indirect only: a realtime light is supposed to provide direct contribution; only indirect lighting is baked.&lt;br /&gt;
** Shadowmask and Indirect: a realtime light is supposed to provide direct contribution, but shadows from static geometry will be baked to a separate map. Dynamic and static shadows will be mixed together. Indirect lighting will be baked as usual.&lt;br /&gt;
** Direct, Indirect, Shadowmask (custom lighting only): same as Direct and Indirect, but the Shadowmask is also produced and assigned to use with custom shaders.&lt;br /&gt;
* Indirect intensity: non-physical GI multiplier for this light. Should be 1 for natural lighting, but can be modified for more stylized scenes.&lt;br /&gt;
* Shadowmask with falloff: bakes complete light attenuation (except for distance) into the shadowmask (only useful with custom shaders).&lt;br /&gt;
* Legacy sampling: use Bakery's original more biased shadow sampling strategy. Produces noise-free shadows, but wide penumbras can exhibit banding. If disabled, an unbiased, but noisier technique is used.&lt;br /&gt;
&lt;br /&gt;
If the same object has both Unity and Bakery light sources enabled, and they don’t match, two buttons will appear:&lt;br /&gt;
* Match lightmapped to real-time: copy common settings from Unity light to Bakery light.&lt;br /&gt;
* Match real-time to lightmapped: copy common settings from Bakery light to Unity light.&lt;br /&gt;
&lt;br /&gt;
{{note| In physical terms, Bakery's &amp;quot;Intensity&amp;quot; for points lights is (Candela/Pi).}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Volume ===&lt;br /&gt;
[[File:Voldemo notlonely.gif|A dynamic door being lit by a BakeryVolume (animated GIF by NOTLonely)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Volumes generate 3D textures that store light probes per voxel (L1 spherical harmonics and shadowmasks) making them a viable replacement for regular Unity light probes.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Unity Light Probes&lt;br /&gt;
! Unity LPPV&lt;br /&gt;
! Bakery Volumes&lt;br /&gt;
|-&lt;br /&gt;
| Manually placing each probe&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | No&lt;br /&gt;
|-&lt;br /&gt;
| Interpolate multiple probes on one object&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Movable at runtime&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Can put in a prefab&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Full scripting API&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Ringing&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Possible&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Possible&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Fixed&lt;br /&gt;
|-&lt;br /&gt;
| Denoising&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Runtime overhead&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | CPU: low; GPU: low.&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | CPU: medium; GPU: medium.&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#e4ead3;&amp;quot; | CPU: none; GPU: medium.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bakery Volume is a bounding box linked to a set of 3D textures (3 SH textures and one shadowmask, if needed), making it very easy to use and script. Volumes can be trivially swapped, moved, loaded or unloaded at runtime or linked to prefabs. They also do not need any Light Probe Groups and manual probe placement; the whole volume is filled with a uniform grid of probe voxels. Light/shadow leaking is automatically fixed the same way it is done for lightmaps (although thin double-sided walls may be a problem with large voxel size, but it can be avoided by using different volumes on different sides). Because of the uniform nature of voxel grids, it is also possible to apply lightmap-like denoising to them, which is not possible with regular light probes. Additionally, Bakery shaders use the [https://drive.google.com/file/d/1MK6Clw93q8ljijRjb4gQOzzaIjn1uF9Y/view Geomerics sampling trick] to completely get rid of the &amp;quot;ringing&amp;quot; artifact spherical harmonics can sometimes produce with high-contrast HDR lighting.&lt;br /&gt;
&lt;br /&gt;
Because of that, Volumes can produce clean, detailed, high-quality baked lighting for dynamic objects (that is, the lighting that comes from the static objects and affects dynamic objects, not the other way around).&lt;br /&gt;
&lt;br /&gt;
The only downside of the Volume approach is the higher per-pixel shading cost. The cost is similar to LPPV (scaling with the amount of shaded volume-affected pixels on the screen) but unlike LPPV, the Volumes themselves are never updated once they are baked. Multiple volume blending can be avoided by slightly overlapping them instead.&lt;br /&gt;
&lt;br /&gt;
====Setting volume transform====&lt;br /&gt;
[[File:Bvolgizmo.jpg|thumb|Volume gizmo]]&lt;br /&gt;
When BakeryVolume is added to a GameObject, a bounding box gizmo will appear in scene view. Dragging it by the little squares will scale it.&lt;br /&gt;
There are also other ways to change volume size and position:&lt;br /&gt;
* Drag any renderable GameObject into &amp;quot;Wrap to object&amp;quot; field. The volume will wrap around this object (and its children) to encapsulate them.&lt;br /&gt;
* If there is a Box Collider added to the same object, &amp;quot;Set from box collider&amp;quot; and &amp;quot;Set to box collider&amp;quot; buttons will appear. These can be used to quickly copy values between Volume/Collider.&lt;br /&gt;
&lt;br /&gt;
====Resolution====&lt;br /&gt;
When &amp;quot;Adaptive resolution&amp;quot; is enabled, the amount of voxels is governed by &amp;quot;Voxels per unit&amp;quot;. Disabling it allows to manually enter the resolution. For most games with 1 unit = 1 meter, a reasonable &amp;quot;Voxels per unit&amp;quot; value is 2, but there are cases (e.g. dynamic doors) when using a smaller, but higher resolution volume is beneficial.&lt;br /&gt;
&lt;br /&gt;
====Other settings====&lt;br /&gt;
* Enable baking: should the volume be (re)computed? Disable to prevent overwriting existing data.&lt;br /&gt;
* Denoise: apply denoising after baking the volume. Recommended for high-resolution volumes. Avoid using for very low-resolution volumes covering many lights, as it will be hard for denoisers to tell actual content from noise.&lt;br /&gt;
* Global: automatically assign this volume to all volume-compatible shaders, unless they have overrides. Internally it will call Shader.SetGlobalTexture()/SetGlobalVector().&lt;br /&gt;
&lt;br /&gt;
====Usage====&lt;br /&gt;
Volumes can be assigned to objects using a volume-aware shader. Bakery comes with &amp;quot;Bakery Standard&amp;quot; shader that implements it, as well as a HDRP and URP graphs. See example_volumes scenes for various ways of applying a volume.&lt;br /&gt;
&lt;br /&gt;
====Hints====&lt;br /&gt;
* Make sure to check the examples.&lt;br /&gt;
* If two volumes connect, make them overlap a bit. The size of the overlap should be equal to the size of the largest dynamic object. This way simply switching between volumes on the go will work.&lt;br /&gt;
* Only place volumes around areas dynamic objects can actually reach. E.g. use player height to limit volume height.&lt;br /&gt;
&lt;br /&gt;
====Rotating volumes====&lt;br /&gt;
Volumes can be rotated around Y axis, if &amp;quot;Rotate around Y&amp;quot; option is enabled. Rotation is very cheap and only uses 2 extra floats of data (precomputed sin/cos of the angle).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There is also an additional option to rotate volumes at runtime (Experimental -&amp;gt; &amp;quot;Support rotation after bake&amp;quot; and a similar option in Bakery Shader), in which case they need to be baked with zero initial rotation.&lt;br /&gt;
&lt;br /&gt;
In URP such dynamic rotation can be used with BakeryURPVolumeGraphRotatable.shadergraph.&lt;br /&gt;
&lt;br /&gt;
For global volumes dynamic rotation will be updated when the component is (re)enabled or volume.SetGlobalParams() is called. Using local rotated volumes requires manually setting the rotation on the material or the MaterialPropertyBlock:&lt;br /&gt;
{{code|&amp;lt;nowiki&amp;gt;SetMatrix(&amp;quot;_VolumeMatrix&amp;quot;, volume.GetMatrix())&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
====Technical information====&lt;br /&gt;
Volumes can work automatically (check example scenes), but it is also possible to script the way they are used.&lt;br /&gt;
&lt;br /&gt;
Volume data can be retrieved from the component via these public properties:&lt;br /&gt;
* bakedTexture0: stores L0 RGB coefficients and L1 Z red channel in alpha.&lt;br /&gt;
* bakedTexture1: stores L1 X RGB coefficients and L1 Z green channel in alpha.&lt;br /&gt;
* bakedTexture2: stores L1 Y RGB coefficients and L1 Z blue channel in alpha.&lt;br /&gt;
* bakedMask: stores the volumetric shadowmask.&lt;br /&gt;
* bounds: the bounding box of the volume.&lt;br /&gt;
&lt;br /&gt;
All bakedTexture* maps use RGBAHalf (8 bytes per voxel) format and the mask is ARGB32 (4 bytes per voxel). Shadowmask can also use single-channel R8 format (1 byte per voxel).&lt;br /&gt;
&lt;br /&gt;
Therefore volume byte size = width*height*depth*3*8 + (only if the shadowmask is used) width*height*depth*4 (or width*height*depth with an R8 mask).&lt;br /&gt;
&lt;br /&gt;
[[Manual#Compress_volumes|Texture compression]] can be enabled on volumes to make them much smaller.&lt;br /&gt;
&lt;br /&gt;
To sample the volume, a special shader is needed, and these are included in Bakery. To add volumes to a custom shader, check BakeryVolume_float() function in BakeryDecodeLightmap.hlsl which is included in HDRP/URP packages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Light Filter ===&lt;br /&gt;
[[File:Output optimized.gif|Stained glass, as seen in Bakery Real-Time Preview. Same results are baked by the Bakery lightmapper.]]&lt;br /&gt;
&lt;br /&gt;
Marks a renderer as a Light Filter. Filters tint all direct/indirect rays with their color, similar to real-life optical filters, allowing for colored transparencies (e.g. stained glass). The only parameter is the texture used for tinting.&lt;br /&gt;
* Light Filter objects still receive lightmaps like everything else.&lt;br /&gt;
* Filters don't scatter/blur rays (for that try [[Subsurface_scattering|Subsurface Scattering]] or [[Manual#Backface_GI|Backface GI]]).&lt;br /&gt;
* Filters can produce color-tinted shadows. If [[Manual#Shadowmask|Shadowmask]] mode is used on the light, only R channel of the result will be saved (as Unity only supports single-channel masks). For fully baked shadows there are no limitations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Sector ===&lt;br /&gt;
See '''[[Partial_scene_baking|Partial scene baking]]'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Always Render ===&lt;br /&gt;
If added to an object, Bakery will always take it into account when baking, even if its renderer is disabled.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Pack As Single Square ===&lt;br /&gt;
If added to an object, Bakery will treat UVs of this object and its children as a single combined square and never move them away from each other during automatic atlas packing or in a Lightmap Group with Pack Atlas mode. Whole children hierarchy will be packed as one.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Shared LOD UV ===&lt;br /&gt;
If added to a LODGroup, will mark all similarly-named LODs as sharing the same lightmap. By default, every LOD mesh receives a unique lightmap, taking space in the atlas; If, however, it is known that LODs of the same object have similar UV2 (or UV1, if it's non-overlapping, and UV2 is not present), they can map to the same part of the atlas, saving memory.&lt;br /&gt;
This technique is also known as [https://github.com/laurenth-personal/LODLightmapScripts/ Lightmap Stealing].&lt;br /&gt;
&lt;br /&gt;
= Material compatibility =&lt;br /&gt;
=== Albedo and emission ===&lt;br /&gt;
Bakery supports most Unity materials by utilizing the [https://docs.unity3d.com/Manual/MetaPass.html Meta Pass] system. All built-in, surface, URP and HDRP shaders already have a correct meta pass defined.&lt;br /&gt;
&lt;br /&gt;
If you have an Unlit shader, add meta pass manually, as described in Unity docs.&lt;br /&gt;
&lt;br /&gt;
If the pass is not present, Bakery will assume {{codeVar|_MainTex}}, {{codeVar|_BaseColorMap}} or {{codeVar|_Color}} (if no texture is set) properties as material albedo and {{codeVar|_EmissionMap}} and {{codeVar|_EmissionColor}} as emissive color.&lt;br /&gt;
&lt;br /&gt;
In order for emission to work, [https://docs.unity3d.com/ScriptReference/Material-globalIlluminationFlags.html Material.globalIlluminationFlags] must be set to [https://docs.unity3d.com/ScriptReference/MaterialGlobalIlluminationFlags.BakedEmissive.html MaterialGlobalIlluminationFlags.BakedEmissive]. Standard shaders set this value automatically.&lt;br /&gt;
&lt;br /&gt;
=== Opacity ===&lt;br /&gt;
[[File:Upload 2019-1-25 0-4-30.png|thumb|Material parameters converted to cutout (default)]]&lt;br /&gt;
[[File:Alphacombos dither.jpg|thumb|Semi-transparent values added via Dither Transparency option]]&lt;br /&gt;
[[File:Alphacombos filter.jpg|thumb|Light Filter components used on red planes, producing colored shadows]]&lt;br /&gt;
By default, Bakery always takes full resolution opacity from the alpha value of {{codeVar|_MainTex}}, {{codeVar|_BaseColorMap}} or {{codeVar|_BaseMap}} and treats it as cutout (1 bit tranparency).&lt;br /&gt;
&lt;br /&gt;
When '''Dither Transparency''' option is enabled, semi-transparent values are automatically converted to variable blue noise, which is then filtered/blurred, resulting in partial transparency (it was previously possible using custom manually dithered maps, but since v1.97 it is automatic).&lt;br /&gt;
&lt;br /&gt;
In order for opacity to work, [https://docs.unity3d.com/Manual/SL-SubShaderTags.html RenderType tag] of the shader must be one of these values:&lt;br /&gt;
* {{codeVar|Transparent}}&lt;br /&gt;
* {{codeVar|TransparentCutout}}&lt;br /&gt;
* {{codeVar|TreeLeaf}}&lt;br /&gt;
&lt;br /&gt;
If a property named {{codeVar|_Cutoff}} is present, it will affect the cutout (therefore Standard shader cutoff slider works automatically).&lt;br /&gt;
&lt;br /&gt;
Without Dither Transparency, if material RenderType is {{codeVar|Transparent}} or {{codeVar|TreeLeaf}}, then alpha value of {{codeVar|_Color}} will additionally modify the cutoff: ''finalCutoff = 1 - (1 - cutoff) * alpha''&lt;br /&gt;
&lt;br /&gt;
For colored transparency, use the [[Manual#Bakery_Light_Filter|Light Filter]] component.&lt;br /&gt;
&lt;br /&gt;
For diffuse translucency effects read about [[#Backface GI|Backface GI]] and [[subsurface scattering]].&lt;br /&gt;
&lt;br /&gt;
==== Alpha Meta Pass ====&lt;br /&gt;
Since v1.9 Bakery also supports specifying custom shader-based transparency, but it requires a compatible shader. To take advantage of ''Alpha Meta Pass'', following steps must be taken:&lt;br /&gt;
* Add a property named '''BAKERY_META_ALPHA_ENABLE''' to the shader. For example:&lt;br /&gt;
{{code|&amp;lt;nowiki&amp;gt;[HideInInspector] BAKERY_META_ALPHA_ENABLE (&amp;quot;Enable Bakery alpha meta pass&amp;quot;, Float) = 1.0&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
* Make sure that RenderType tag is set to one of the values above.&lt;br /&gt;
* Declare a pass named '''META_BAKERY'''. &lt;br /&gt;
* In that pass check if '''unity_MetaFragmentControl.w''' is non-zero, in which case, return the computed transparency value. &lt;br /&gt;
&lt;br /&gt;
See ''Baked_Alpha_meta.shader'' included in the package as an example.&lt;br /&gt;
&lt;br /&gt;
Note: currently Alpha Meta Pass requires Light Probe Mode to be set to L1 or L2.&lt;br /&gt;
&lt;br /&gt;
=== Normal mapping ===&lt;br /&gt;
Custom surface normals can be used in conjunction with [[#Baked Normal Maps|Baked Normal Maps]] mode. Unfortunately, Unity's Meta Pass does not output normal information, so by default normals are taken from a texture named {{codeVar|_BumpMap}}, additionally transformed by {{codeVar|_MainTex_ST}}.&lt;br /&gt;
&lt;br /&gt;
It is however possible to make completely custom shaders with advanced normal mapping features (e.g. blending multiple layers) compatible with baking. To do that you'll need:&lt;br /&gt;
&lt;br /&gt;
1. Define a Meta Pass in your shader, just [https://docs.unity3d.com/Manual/MetaPass.html#ExampleMetaPass as described in Unity docs].&lt;br /&gt;
&lt;br /&gt;
2. Name it {{codeVar|&amp;quot;META_BAKERY&amp;quot;}}, instead of just {{codeVar|&amp;quot;META&amp;quot;}}.&lt;br /&gt;
&lt;br /&gt;
3. Include {{codeVar|&amp;quot;BakeryMetaPass.cginc&amp;quot;}}.&lt;br /&gt;
&lt;br /&gt;
4. Add {{codeVar|#pragma vertex vert_bakerymt}}&lt;br /&gt;
&lt;br /&gt;
5. If {{codeVar|unity_MetaFragmentControl.z}} variable is not 0, shader should return world-space normal. Returned normal should be encoded using {{codeVar|BakeryEncodeNormal}} function.&lt;br /&gt;
&lt;br /&gt;
Two example shaders implementing this extended Meta Pass are included in Assets/Bakery/examples/shaders.&lt;br /&gt;
&lt;br /&gt;
You can copy and modify BakeryMetaPass.cginc to suit your needs, e.g. pass additional data from the vertex shader.&lt;br /&gt;
&lt;br /&gt;
=== Front/back faces ===&lt;br /&gt;
No matter what culling mode is used on the shader, Bakery treats all back-faces as opaque, meaning any direct light ray will not pass through a back-face, just as it will not pass through a front-face.&lt;br /&gt;
However, back-faces can partially emit lighting received by a front-face, if you use [[Manual#Backface_GI|Backface GI]].&lt;br /&gt;
&lt;br /&gt;
= &amp;quot;Lightmap Parameters&amp;quot; assets =&lt;br /&gt;
[[File:Lp.jpg|thumb|Extended Lightmap Parameters]]&lt;br /&gt;
Similar to Bakery's [[Manual#Bakery_Lightmap_Group_Selector|Lightmap Groups]], Unity has [https://docs.unity3d.com/Manual/class-LightmapParameters.html Lightmap Parameters] that can be created as assets and assigned to Mesh Renderers. Their logic has differences and similarities:&lt;br /&gt;
* Lightmap Group's primary usage is to group multiple objects in one atlas. Additionally it allows overriding baking settings for this atlas.&lt;br /&gt;
* Lightmap Parameters are primarily used to override baking settings for an object. But additionally they can influence packing by using the &amp;quot;Baked Tag&amp;quot; option: objects with a different Baked Tag will never share the same atlas.&lt;br /&gt;
&lt;br /&gt;
Since some users are more used to the Lightmap Parameters workflow, Bakery now supports and extends them:&lt;br /&gt;
* Baked Tag is respected by Bakery.&lt;br /&gt;
* Additional Bakery-specific options will be shown in the Lightmap Parameters UI. Refer to the [[Manual#Bakery_Lightmap_Group_Selector|Lightmap Group]] section for their meaning.&lt;br /&gt;
&lt;br /&gt;
= Project Settings =&lt;br /&gt;
Some global settings can be tweaked in Project Settings -&amp;gt; Bakery GPU Lightmapper (this option is only visible in Unity 2018.3 or newer; for older versions, edit BakeryProjectSettings.asset instead):&lt;br /&gt;
* Mipmap lightmaps: enables mipmapping on lightmap assets. Can cause leaks across UV charts as atlases get smaller; on the other hand, it reduces high resolution lightmap aliasing in the distance. Overall it is recommended to use separately baked LODs with lower resolution lightmaps for very distant objects instead.&lt;br /&gt;
* Color file format: format for regular HDR color lightmaps. Possible values:&lt;br /&gt;
** HDR: Radiance HDR format (default). Can be opened in many image editors.&lt;br /&gt;
** Asset: native Unity format. Can have custom mipmap count.&lt;br /&gt;
* Mask/Direction file format: format for additional LDR maps, such as shadowmasks or directional data. Possible values:&lt;br /&gt;
** TGA: 8-bit Targa (default).&lt;br /&gt;
** PNG: 8-bit PNG. Usually takes less space on disk compared to TGA.&lt;br /&gt;
** Asset: native Unity format. Can have custom mipmap count.&lt;br /&gt;
* Compress lightmaps: defines lightmap asset compression behaviour. Compressed lightmaps take less VRAM, but may exhibit some visual artifacts (such as banding or colored blotches) depending on the type of compression (for mobile compression issues [[Troubleshooting#I_have_an_Android_project.2C_and_lightmaps_don.27t_look_good|see this]]). Possible values:&lt;br /&gt;
*** Compress but allow overriding asset: new lightmaps will be created with compression enabled. After they are created, it is possible to change their compression settings in Inspector. These modified values will be kept after rebaking (default).&lt;br /&gt;
*** Force compress: always compress all lightmaps.&lt;br /&gt;
*** Force no compress: always produce uncompressed lightmaps.&lt;br /&gt;
* High quality direction: enables &amp;quot;high&amp;quot; quality compression for directional maps. Actual formats depend on platform. On PC, for example, it will change it from DXT1 to BC7, which gives higher quality, but doubles the VRAM usage.&lt;br /&gt;
* Texel padding (default atlas packer): defines how many empty texels to add between objects' UV layouts in lightmap atlases, when using the default atlas packer.&lt;br /&gt;
* Texel padding (xatlas packer): same, but when using xatlas.&lt;br /&gt;
* Alpha Meta Pass resolution multiplier: multiplies resolution of the [[Manual#Alpha_Meta_Pass|Alpha Meta Pass]] allowing to have precise shader-based cutouts while baking low resolution lightmaps.&lt;br /&gt;
* Volume render mode: which [[Manual#Render_mode|render mode]] to use for all [[Manual#Bakery_Volume|Volumes]]? Auto uses current active render mode (default).&lt;br /&gt;
* Delete previous lightmaps before bake: actually delete all previously rendered lightmap files from this scene before baking new ones.&lt;br /&gt;
* Log level: defines how much information is printed to console during the bake. Possible values:&lt;br /&gt;
** 0: do not print anything.&lt;br /&gt;
** 1: only print progress information.&lt;br /&gt;
** 2: only print warnings.&lt;br /&gt;
** 3: print everything.&lt;br /&gt;
* Alternative scale in lightmap: makes 'Scale in Lightmap' renderer property act more similar to built-in Unity behaviour.&lt;br /&gt;
* Align to texture compression blocks with xatlas: makes xatlas align charts to 4x4 block boundaries, which gives more compression-friendly results.&lt;br /&gt;
* Generate smooth positions: should sample positions be adjusted to prevent incorrect shadowing on low-poly geometry with smooth normals? Can be disabled in very rare cases when using geometry with wildly mismatching normals. See [https://ndotl.wordpress.com/2018/08/29/baking-artifact-free-lightmaps/#shadowterm  this article] for technical explanation.&lt;br /&gt;
* Smooth positions per-triangle: should smooth/flat position be decided per-triangle? Can be disabled in very rare cases when using geometry with wildly mismatching normals.&lt;br /&gt;
* Use 'Receive GI' values: take 'Receive Global Illumination' values into account on renderers. Originally Bakery ignored it.&lt;br /&gt;
* Remove ringing in Legacy light probes: enables softer light probe convolution in Legacy mode to prevent artifacts in high-contrast areas.&lt;br /&gt;
* Always render reflection probes: automatically render reflection probes after every Render/Render Light Probes.&lt;br /&gt;
* Ringing removal for L2 light probes: applies de-ringing to [[Manual#Light_probe_mode|L2 light probes]]. The higher the value, the smoother the probe lighting is; this smoothing reduces [https://docs.unity3d.com/6000.2/Documentation/Manual/light-probes-troubleshooting.html ringing] artifacts (if present).&lt;br /&gt;
* Put menu under Tools: puts Bakery menu under the Tools menu.&lt;br /&gt;
&lt;br /&gt;
If any format is set to Asset, and mipmapping is enabled, an additional option is shown:&lt;br /&gt;
* Maximum mipmap count: defines maximum amount of mipmaps. For example, if set to 2, a 8K lightmap will only have two additional mipmaps: 4K and 2K. Lower resolutions will be omitted, thus limiting leaking artifacts during mipmapping.&lt;br /&gt;
&lt;br /&gt;
= Skinned mesh renderer support =&lt;br /&gt;
&lt;br /&gt;
Bakery supports skinned meshes since v1.65. However, there are some limitations:&lt;br /&gt;
* Some versions of Unity do not support UV1 on skinned meshes and silently ignore &amp;quot;Generate lightmap UVs&amp;quot;. Make sure the actual mesh used in your scene has UV1 and use non-overlapping UV0 if possible;&lt;br /&gt;
* UV padding adjustment does not work on skinned meshes (Unity seems to crash when attempting to call Unwrap function on them);&lt;br /&gt;
* Skinned meshes can't have per-vertex lightmaps (engine has no support for additionalVertexStreams with skinning).&lt;br /&gt;
&lt;br /&gt;
= Shader Tweaks =&lt;br /&gt;
[[File:Image2.jpg|thumb|Left: default bilinear filtering. Right: bicubic filtering.]]&lt;br /&gt;
[[File:Image34.jpg|thumb|Left: both shadows are baked.&amp;lt;br&amp;gt;&lt;br /&gt;
Center: spherical shadow is dynamic, and other shadow is static. Combined together with multiplication.&amp;lt;br&amp;gt;&lt;br /&gt;
Right: same as center, but combined with default minimum.]]&lt;br /&gt;
Bakery offers optional shader modifications that can be applied to Unity shaders to improve lightmap sampling and match real-time lighting closer to lightmaps. Shader tweaking menu can be accessed via Bakery-&amp;gt;Shader Tweaks.&lt;br /&gt;
&lt;br /&gt;
These options will patch base Unity shader includes (from the CGIncludes folder) that are used by most built-in and third party shaders. All modifications will affect all projects opened with this version of editor, but can be also easily reverted back. Shader tweaks affect the way standard and surface shaders work. HDRP, URP and other SRPs are not affected.&lt;br /&gt;
&lt;br /&gt;
All available modifications are shown as buttons. Press the button to apply modification, and it will remain pressed. Un-press the button to remove the modification. Currently available options:&lt;br /&gt;
&lt;br /&gt;
{{note| You may need to run Unity editor as admin to make CGIncludes patching work}}&lt;br /&gt;
&lt;br /&gt;
* Use bicubic interpolation for lightmaps: bicubic interpolation will be used instead of default bilinear. This tweak fixes many jagged edges of low resolution lightmaps pretty well. Currently it only works on DX11 and modern consoles, while other platforms will remain using bilinear.&lt;br /&gt;
&lt;br /&gt;
* Use multiplication for shadowmask: combine static and dynamic shadows using multiplication instead of minimum. For reasons unknown Unity decided to use minimum operator by default, and it produces artifacts that are not present with multiplication.&lt;br /&gt;
&lt;br /&gt;
* Use physical light falloff (forward): replace default attenuation of real-time point/spot lights with a more physically correct inverse-squared. “Range” will only slightly fade it out near the edge (matches Bakery lights with Physical Falloff checkbox). Only affects forward renderer. See [[Point Light Attenuation]] for more details.&lt;br /&gt;
&lt;br /&gt;
* Use physical light falloff (deferred): same as above, but only affects deferred renderer.&lt;br /&gt;
&lt;br /&gt;
'''Falloff tweaks may not fully work on &amp;gt; 2017 Unity versions. Also, SRPs have correct falloff by default.'''&lt;br /&gt;
&lt;br /&gt;
= Bakery shaders =&lt;br /&gt;
Bakery includes its own shaders with support for vertex lightmapping, as well as RNM and SH directional modes. It also allows approximate baked specular to be calculated from directional data. &lt;br /&gt;
Bakery shader is '''not required''' for regular color lightmaps, shadow masks and Dominant Direction mode, as these features are supported by most Unity shaders anyway.&lt;br /&gt;
&lt;br /&gt;
=== Standard render pipeline ===&lt;br /&gt;
'''Bakery/Standard''': extends regular Standard shader. Additional options:&lt;br /&gt;
* Allow Vertex Lightmaps: allows this material to be used with [[Vertex Lightmaps|vertex lightmapping]].&lt;br /&gt;
* Allow RNM Lightmaps: allows this material to be used with [[#RNM|RNM directional mode]].&lt;br /&gt;
* Allow SH Lightmaps: allows this material to be used with [[#SH|SH directional mode]].&lt;br /&gt;
{{note| All “Allow” toggles enable a certain code path in the shader. It is recommended to only use one “allow” option in a material for performance reasons.}}&lt;br /&gt;
* Enable Lightmap Specular: calculates baked specular using data from Dominant Direction, RNM or SH directional modes. Note that due to the lack of information, the effect is very approximate. If you ever used baked specular in Unity 4, it should be comparable. It looks best together with highly perturbed normal maps, not so good on flat surfaces.&lt;br /&gt;
* Enable VertexLM directional: if vertex lightmaps are present, specifies that Dominant Direction data is stored in vertices and should be used.&lt;br /&gt;
* Enable VertexLM SH: if vertex lightmaps are present, specifies that SH data is stored in vertices and should be used.&lt;br /&gt;
* Enable VertexLM Shadowmask: if vertex lightmaps are present, specifies that shadow mask is stored in vertices and should be used.&lt;br /&gt;
* Enable MonoSH: treat directional maps as MonoSH maps.&lt;br /&gt;
[[File:Image5.png|thumb|Standard SH light probe vs non-linear]]&lt;br /&gt;
[[File:Shspec.jpg|thumb|SH specular effect]]&lt;br /&gt;
* Non-linear SH: in SH directional mode this option can enhance contrast (closer to ground truth), but it makes the shader a bit slower. This trick is based on [https://drive.google.com/file/d/1MK6Clw93q8ljijRjb4gQOzzaIjn1uF9Y/view “Reconstructing Diffuse Lighting from Spherical Harmonic Data”] paper by Geomerics.&lt;br /&gt;
* Non-linear Light Probe SH: similar to Non-linear SH, but works for light probes instead. In case of probes the most notable benefit is getting rid of incorrect negative values. This problem often happens in high-contrast scenes with bright HDR light sources. It’s an inherent limitation of spherical harmonics and not specific to Bakery (i.e. you can get similar artifacts with built-in lightmappers as well).&lt;br /&gt;
* Force Bicubic Filter: enables bicubic filtering for all additional maps. For complete bicubic filtering (including the first color map) it is recommended to also enable it in [[#Shader Tweaks|Shader Tweaks]].&lt;br /&gt;
&lt;br /&gt;
'''Bakery/Standard Specular''': same as Standard, but for specular workflow.&lt;br /&gt;
&lt;br /&gt;
=== HDRP &amp;amp; URP ===&lt;br /&gt;
To extract additional HDRP/URP shaders, open Bakery_ShaderGraphHDRP.unitypackage or Bakery_ShaderGraphURP.unitypackage included with Bakery. Inside you will find Shader Subgraphs that you can use in your own Shader Graphs as well as some example materials.&lt;br /&gt;
&lt;br /&gt;
=== Feature support across shaders ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Most Unity shaders&lt;br /&gt;
! Most HDRP &amp;amp; URP shaders&lt;br /&gt;
! Bakery Standard&lt;br /&gt;
! HDRP graphs&lt;br /&gt;
! URP graphs&lt;br /&gt;
|-&lt;br /&gt;
| HDR color lightmaps&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Shadowmask&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes (Since URP 10.1)&lt;br /&gt;
|-&lt;br /&gt;
| Dominant Direction&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| RNM&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| SH&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| MonoSH&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Lightmap specular&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes for dominant direction and SH&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes for dominant direction (see link)&lt;br /&gt;
|-&lt;br /&gt;
| Bicubic filtering&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes,&lt;br /&gt;
with [[#Shader Tweaks|Shader Tweaks]]&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes,&lt;br /&gt;
with [[#Shader Tweaks|Shader Tweaks]]&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
|-&lt;br /&gt;
| Vertex lightmaps&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Single color, no per-vertex SH, direction or shadowmasks (shader graph limitation)&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Single color, no per-vertex SH, direction or shadowmasks (shader graph limitation)&lt;br /&gt;
|-&lt;br /&gt;
| Non-Linear Light Probes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Volumes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Volume shadowmask&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Compressed volumes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{note| Everything except for regular color lightmaps requires at least Shader Model 3.0 to work.}}&lt;br /&gt;
{{note| Vertex Lightmaps with SH mode require at least Shader Model 4.0 due to interpolator limit.}}&lt;br /&gt;
{{note| Updated URP graphs with specular from Dominant Direction can be downloaded [[Bakery_-_GPU_Lightmapper|from the main wiki page]].}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
See also: [[Integrating_Bakery_shader_features_to_custom_shaders| Integrating Bakery shader features to custom shaders]]&lt;br /&gt;
&lt;br /&gt;
= Notes on HDRP/URP =&lt;br /&gt;
Once the package is imported into an HDRP or URP project, in general it can be used right away, but there are some things to note:&lt;br /&gt;
&lt;br /&gt;
* Example scenes use both regular Standard and, in some cases, &amp;quot;Bakery Standard&amp;quot; shaders. HDRP and URP provide a mechanism to update project shaders from Standard to Lit, but they cannot upgrade from Bakery Standard. Replace Bakery Standard materials with the ones coming from Bakery_ShaderGraphHDRP.unitypackage or Bakery_ShaderGraphURP.unitypackage.&lt;br /&gt;
&lt;br /&gt;
* In HDRP, the default HDRI sky intensity is high (11) and sky reflection is not being occluded by default. Together with default eye adaption it may result in some example scenes being hardly visible, as they are baked using much lower intensities. Reduce HDRI sky intensity to 1 in this case. HDRI settings are usually located in Assets/HDRPDefaultResources/DefaultSettingsVolumeProfile.&lt;br /&gt;
&lt;br /&gt;
* In HDRP, if lights in example scenes are too bright, click &amp;quot;match real-time to lightmapped&amp;quot; on Bakery light components.&lt;br /&gt;
&lt;br /&gt;
* Use OpenImageDenoise 2 (best) or OptiX 7 denoiser in HDRP, as it is better suited for high intensity values.&lt;br /&gt;
&lt;br /&gt;
* In HDRP &amp;quot;distance&amp;quot; and regular Shadowmask can be switched on the Light component itself, not in global settings.&lt;br /&gt;
&lt;br /&gt;
* Don't use &amp;quot;match&amp;quot; buttons on the Skylight, as HDRP uses a very specific procedural sky shader. Instead, bake it into a HDRI [[How_do_I...#How_do_I_use_Skylight_with_a_procedural_sky_shader.3F|this way]].&lt;br /&gt;
&lt;br /&gt;
* It is recommended to always set Light Probe Mode to L2 or L1 when using HDRP, as HDRP's renderer is not optimized for the Legacy mode.&lt;br /&gt;
&lt;br /&gt;
* Newest version of HDRP/URP have their own IES file importer. Because of the asset type mismatch, Unity will unplug them from Bakery IES lights saved using older versions, meaning they will appear as regular point lights instead. They can be plugged back and re-saved.&lt;br /&gt;
&lt;br /&gt;
Bakery's example scenes are designed for the Built-in rendering pipeline, so there are a few steps to properly render them in HDRP/URP. Here are some tips; a fresh project with default HDRP/URP settings is assumed:&lt;br /&gt;
&lt;br /&gt;
=== Viewing example scenes on HDRP ===&lt;br /&gt;
* After importing Bakery, upgrade standard materials to HDRP: Edit-&amp;gt;Rendering-&amp;gt;Materials-&amp;gt;Convert All Built-in Materials To HDRP.&lt;br /&gt;
* Import Bakery_ShaderGraphHDRP.unitypackage into the project, as it contains special shader graphs implementing advanced Bakery features (not required for classic color/directional/mask lightmaps).&lt;br /&gt;
* Select DefaultSettingsVolumeProfile.asset. In HDRI Sky section, change Exposure Compensation to 1. Otherwise the default HDRP will be too bright compared to example scenes, and they will appear black due to this exposure adjustment.&lt;br /&gt;
* When selecting lights in example scenes, HDRP will initialize its own light data. Sometimes it may result in the light immediately becoming much brighter. Click &amp;quot;Match real-time to lightmapped&amp;quot; to synchronize.&lt;br /&gt;
* Set Light Probe Mode to L2 before rendering light probes.&lt;br /&gt;
* '''example_directional''': change shaders to BakeryDirSpecGraph to see baked highlights (or just regular HDRP/Lit for diffuse-only normal mapping). Delete the sphere, as there is currently no shader graph supporting per-vertex direction.&lt;br /&gt;
* '''example_directional_MonoSH''': change shaders to BakerySpecMonoSHGraph (or BakeryMonoSHGraph for a slightly cheaper version without highlights). Delete the sphere, as there is currently no shader graph supporting per-vertex MonoSH.&lt;br /&gt;
* '''example_RNM''': change shaders to BakeryRNMGraph.&lt;br /&gt;
* '''example_SH''': change shaders to BakerySpecSHGraph (or BakerySHGraph for a slightly cheaper version without highlights). Delete the sphere, as there is currently no shader graph supporting per-vertex SH.&lt;br /&gt;
* '''example_mixed_directional_mode''': similarly a different graph is needed for MonoSH/RNM/SH planes.&lt;br /&gt;
* '''example_lights''': change the shader of the vertex-lightmapped sphere to BakeryVertexColorGraph.&lt;br /&gt;
* '''example_prefabs_bake''': no further adjustments needed.&lt;br /&gt;
* '''example_sectors''': no further adjustments needed.&lt;br /&gt;
* '''example_shadowmask''': Select the DirectLight and click &amp;quot;Match real-time to lightmapped&amp;quot; to fix brightness. Set Shadowmask Mode to Shadowmask on all HDRP lights. &lt;br /&gt;
* '''example_sponza_day''': set OpenImageDenoise 2 (or Optix 7, if unsupported) as preferred denoiser.&lt;br /&gt;
* '''example_sponza_evening''': set OpenImageDenoise 2 (or Optix 7, if unsupported) as preferred denoiser.&lt;br /&gt;
* '''example_subtractive''': HDRP doesn't support the subtractive mode.&lt;br /&gt;
* '''example_volumes_simple''': change train shader to BakeryVolumeSpecGraph (or BakeryVolumeGraph for a slightly cheaper version without highlights).&lt;br /&gt;
* '''example_volumes_simple_shadowmask''': shadowmask volumes are not currently supported for HDRP.&lt;br /&gt;
* '''example_volumes_advanced''': same as with example_volumes_simple.&lt;br /&gt;
* '''example_translucency''': most of the scene should appear fine. For the &amp;quot;Dynamic sphere lit by volume&amp;quot;, set shader to BakeryVolumeGraph.&lt;br /&gt;
&lt;br /&gt;
=== Viewing example scenes on URP ===&lt;br /&gt;
* After importing Bakery, upgrade standard materials to URP: open Assets/Bakery/examples/content, select all materials by typing &amp;quot;t:material&amp;quot; and choosing to only search the &amp;quot;content&amp;quot; folder below. Click Edit-&amp;gt;Rendering-&amp;gt;Materials-&amp;gt;Convert Selected Built-in Materials To URP.&lt;br /&gt;
* Import Bakery_ShaderGraphURP.unitypackage into the project, as it contains special shader graphs implementing advanced Bakery features (not required for classic color/directional/mask lightmaps).&lt;br /&gt;
* '''example_directional''': change shaders to BakeryURPLit, enable &amp;quot;Bakery Lightmapped Specular&amp;quot; (or just keep regular URP/Lit for diffuse-only normal mapping). Delete the sphere, as there is currently no shader graph supporting per-vertex direction.&lt;br /&gt;
* '''example_directional_MonoSH''': change shaders to BakeryURPLit, set Bakery Mode to MonoSH, enable &amp;quot;Bakery Lightmapped Specular&amp;quot;. On the vertex-lit sphere also enable &amp;quot;Per-vertex&amp;quot;.&lt;br /&gt;
* '''example_RNM''': change shaders to BakeryURPLit, set Bakery Mode to RNM, enable &amp;quot;Bakery Lightmapped Specular&amp;quot;.&lt;br /&gt;
* '''example_SH''': change shaders to BakeryURPLit, set Bakery Mode to SH, enable &amp;quot;Bakery Lightmapped Specular&amp;quot;. Delete the sphere, as there is currently no shader graph supporting per-vertex SH.&lt;br /&gt;
* '''example_mixed_directional_mode''': similarly use BakeryURPLit with a different Bakery Mode (MonoSH, RNM, SH). Non-directional / dominant direction / baked normap maps can use regular URP/Lit.&lt;br /&gt;
* '''example_lights''': no further adjustments needed.&lt;br /&gt;
* '''example_prefabs_bake''': no further adjustments needed.&lt;br /&gt;
* '''example_sectors''': no further adjustments needed.&lt;br /&gt;
* '''example_shadowmask''': similarly to the Built-in pipeline, uncheck Distance Shadowmask in Bakery window (or project Quality Settings) to see actual baked/real-time shadow mixing near the camera.&lt;br /&gt;
* '''example_sponza_day''': enable alpha clipping on the foliage material.&lt;br /&gt;
* '''example_sponza_evening''': same as example_sponza_day.&lt;br /&gt;
* '''example_subtractive''': no further adjustments needed.&lt;br /&gt;
* '''example_volumes_simple''': change train shader to BakeryURPLit and set Bakery Mode to Volume. Optionally enable &amp;quot;Bakery Lightmapped Specular&amp;quot;.&lt;br /&gt;
* '''example_volumes_simple_shadowmask''': same as example_volumes_simple, but also enable &amp;quot;Volume Shadowmask&amp;quot;.&lt;br /&gt;
* '''example_volumes_advanced''': same as with example_volumes_simple.&lt;br /&gt;
* '''example_translucency''': most of the scene should appear fine. For the &amp;quot;Dynamic sphere lit by volume&amp;quot;, set shader to BakeryURPLit and Bakery Mode to Volume.&lt;br /&gt;
&lt;br /&gt;
= Upgrading Bakery =&lt;br /&gt;
When it comes to upgrading the asset, it is recommended to follow these steps:&lt;br /&gt;
* Close Bakery windows.&lt;br /&gt;
* Close Unity.&lt;br /&gt;
* Open it again.&lt;br /&gt;
* Import the updated package.&lt;br /&gt;
&lt;br /&gt;
Note that without first closing Unity importing may fail because of locked DLL files (printing messages like &amp;quot;alphabuffergen.dll: Access is denied.&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
If you moved Bakery folders (Assets/Bakery and Assets/Editor/x64/Bakery) to other locations, you might need to move them back before updating to prevent getting two conflicting copies of the package.&lt;br /&gt;
&lt;br /&gt;
= Scripting API =&lt;br /&gt;
&lt;br /&gt;
==Basic usage==&lt;br /&gt;
&lt;br /&gt;
Get and modify render settings:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ftLightmapsStorage storage = ftRenderLightmap.FindRenderSettingsStorage();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Full list of available settings can be seen in ftLightmapsStorage.cs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Get lightmapper instance and (re)load settings:&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap bakery = ftRenderLightmap.instance != null ? ftRenderLightmap.instance : new ftRenderLightmap();&lt;br /&gt;
bakery.LoadRenderSettings();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Render lightmaps (also probes if they're set to L1 or L2 mode):&lt;br /&gt;
&amp;lt;pre&amp;gt;bakery.RenderButton(bool showMsgWindows)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Render light probes only:&lt;br /&gt;
&amp;lt;pre&amp;gt;bakery.RenderLightProbesButton(bool showMsgWindows)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Render reflection probes only:&lt;br /&gt;
&amp;lt;pre&amp;gt;bakery.RenderReflectionProbesButton(bool showMsgWindows)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''showMsgWindows''' tells if any dialog boxes/confirmations can be shown. Supressed, if set to false.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Check if baking is in progress:&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.bakeInProgress&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For usage example check [[Community_extensions#Batch_scene_baker|Batch Scene Baker]] script.&lt;br /&gt;
&lt;br /&gt;
==Additional functions==&lt;br /&gt;
&lt;br /&gt;
Copies all render settings from one ftLightmapsStorage to another:&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmapsStorage.CopySettings(ftLightmapsStorage src, ftLightmapsStorage dest)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Gets global (per-project) storage object:&lt;br /&gt;
&amp;lt;pre&amp;gt;ftGlobalStorage gstorage = ftLightmaps.GetGlobalStorage()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copies all render settings from ftLightmapsStorage (per-scene) to ftGlobalStorage  (per-project):&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmapsStorage.CopySettings(ftLightmapsStorage src, ftGlobalStorage dest)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copies all render settings from ftGlobalStorage (per-project) to ftLightmapsStorage (per-scene):&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmapsStorage.CopySettings(ftGlobalStorage src, ftLightmapsStorage dest)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Gets the path to the folder containing Bakery binaries:&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmaps.GetEditorPath()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Additional variables==&lt;br /&gt;
&lt;br /&gt;
Gets the current temporary files path (ftRenderLightmap instance must be created first):&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.scenePath&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Gets/sets UVGBuffer data compression (LZ4, if enabled, DDS if not):&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.compressedGBuffer&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Gets/sets output lightmap data compression (LZ4, if enabled, DDS if not):&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.compressedOutput&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Events==&lt;br /&gt;
&lt;br /&gt;
Scripts can subscribe to static events in ftRenderLightmap class.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Called before full Render:&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnPreFullRender&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Called before each light probe is rendered in Legacy light probe mode. ProbeEventArgs is a struct containing '''pos''' field with current light probe position:&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler&amp;lt;ProbeEventArgs&amp;gt; OnPreRenderProbe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Called after Legacy light probes were rendered:&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnFinishedProbes&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Called after full Render was finished:&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnFinishedFullRender&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Called before reflection probes are rendered:&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnPreReflectionProbeRender&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Called after reflection probes were rendered:&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnFinishedReflectionProbes&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mr F</name></author>
		
	</entry>
	<entry>
		<id>https://geom.io/bakery/wiki/index.php?title=Troubleshooting&amp;diff=1849</id>
		<title>Troubleshooting</title>
		<link rel="alternate" type="text/html" href="https://geom.io/bakery/wiki/index.php?title=Troubleshooting&amp;diff=1849"/>
		<updated>2025-12-24T16:26:23Z</updated>

		<summary type="html">&lt;p&gt;Mr F: /* Lightmap UVs are wrong when opening previously baked project on a Mac */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a list of common problems, their symptoms and solutions.&lt;br /&gt;
&lt;br /&gt;
=== Shadowmasks are not baked ===&lt;br /&gt;
Check following things:&lt;br /&gt;
* Bakery's [[Manual#Render Mode|Render Mode]] is set to Shadowmask.&lt;br /&gt;
* Masked lights have both Unity and Bakery light components on them.&lt;br /&gt;
* Masked Bakery light components have &amp;quot;Baked contribution&amp;quot; set to &amp;quot;Indirect and shadowmask&amp;quot;.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Shadowmasks are baked, but Unity renders real-time shadows instead ===&lt;br /&gt;
You're in Distance Shadowmask mode, it's expected. Read more about the difference:&lt;br /&gt;
&lt;br /&gt;
https://docs.unity3d.com/Manual/LightMode-Mixed-Shadowmask.html&lt;br /&gt;
&lt;br /&gt;
https://docs.unity3d.com/Manual/LightMode-Mixed-DistanceShadowmask.html&lt;br /&gt;
&lt;br /&gt;
* To switch between two modes, you can use &amp;quot;Distance Shadowmask&amp;quot; checkbox in Bakery main window.&lt;br /&gt;
* If you're on 5.6, go to Window-&amp;gt;Lighting-&amp;gt;Mixed Lighting-&amp;gt;Lighting Mode to switch the mode.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I can't see specular lighting after the bake ===&lt;br /&gt;
Apparently specular lighting was provided by real-time lights before the bake. Now the lighting is baked into static textures and there is no specular. However, you can:&lt;br /&gt;
* Use Reflection Probes. Good option for highly glossy objects.&lt;br /&gt;
* Use mixed lights and only bake GI/[[Manual#Shadowmask|Shadowmasks]]. Specular remains real-time.&lt;br /&gt;
* Bake in [[Manual#Dominant_Direction|Dominant Direction]] or [[Manual#SH|SH]] mode and use [[Manual#Bakery_shaders|Bakery shaders]] with &amp;quot;Lightmapped specular&amp;quot; option. It will give some specular approximation. Looks good on surfaces with medium/high roughness.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Using a version control system I copied the scene to another PC and it doesn't look right ===&lt;br /&gt;
Make sure you followed [[How_do_I...#How_do_I_use_git.2Fcollab.2Fother_version_control_system_with_Bakery.3F|version control guidelines]].&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Baking same asset in one scene breaks its UVs in another scene ===&lt;br /&gt;
The reason here is [[Manual#Asset_UV_Processing|UV padding adjustment]]. It modifies the UVs in the asset, so spacing between UV charts is optimal, meaning they never leak over each other and there is no much wasted space. Unity has a manual Pack Margin option on model assets, but it’s limited since it applies the same exact value for all meshes inside the model, while each mesh can get drastically different size in the final lightmap based on its surface area. Therefore Bakery overrides it with automatically calculated per-mesh (instead of per-model) padding. However, because “optimal” varies depending on baking resolution, it can be problematic to reuse the same asset in isolated scenes with different lightmap size. There are multiple ways to solve it:&lt;br /&gt;
* a) Just disable UV padding adjustment (set to [[Manual#Asset_UV_Processing|Don't Change]]). Results will be similar to built-in baking.&lt;br /&gt;
* b) Generate your own optimal UVs. UV padding adjustment only applies to models with auto-generated UV layout (aka “Generate Lightmap UVs” checkbox) and never touches custom data.&lt;br /&gt;
* c) Set Asset UV Processing to &amp;quot;Adjust UV padding only for new meshes&amp;quot; (currently available in the [[Github_access|github]] version).&lt;br /&gt;
* d) Use [[Manual#UV_padding:_increase_only|UV padding: increase only]] checkbox and first bake the lowest resolution scene, and then the rest.&lt;br /&gt;
* e) Use two different models for different lightmap resolutions, so each will get the most efficient set of UVs.&lt;br /&gt;
* f) Bake both scenes together.&lt;br /&gt;
* g) Lock UVs using [[How_do_I...#Alternative_solution|Save UV padding to asset]]&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser throws error 505 or Unknown error ===&lt;br /&gt;
[https://www.nvidia.com/Download/index.aspx?lang=en-US Update the driver].&lt;br /&gt;
&lt;br /&gt;
If you are using a Kepler GPU, try switching to [[Manual#Legacy_denoiser|legacy denoiser]].&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get an “Out of memory” error ===&lt;br /&gt;
This means rendering needed more video memory from your GPU than it has available.&lt;br /&gt;
&lt;br /&gt;
First, try closing any other graphics-intensive programs (browsers too).&lt;br /&gt;
&lt;br /&gt;
If the problem persists, the most likely reason is that the resolution you selected is unreasonably high for the given scene. Resolution is defined by [[Manual#Texels_per_unit|Texels per Unit]] (this section also has a list of reference values) or set explicitly in [[Manual#Bakery_Lightmap_Group_Selector|Lightmap Groups]]. Reducing it will help. You can always selectively use high resolution for important objects via [https://docs.unity3d.com/Manual/class-MeshRenderer.html Scale in Lightmap].&lt;br /&gt;
&lt;br /&gt;
If you have terrains in your scene, make sure [[Manual#Terrain_optimization|Terrain optimization]] is enabled.&lt;br /&gt;
&lt;br /&gt;
If you have a very high amount of painted trees on your terrain, try disabling the [[Manual#Export_terrain_trees|Export terrain trees]] option.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a “Can't map texture” error ===&lt;br /&gt;
Typically happens if your system went out of RAM (system memory, not video memory) during the scene export process. Your scene could already be taking too much RAM by itself, not leaving enough free memory for Bakery export.&lt;br /&gt;
&lt;br /&gt;
* Try closing any memory-intensive programs before baking.&lt;br /&gt;
* Try reducing [[Manual#Max_resolution|Max Resolution]] from 4096 to 2048.&lt;br /&gt;
* If you are baking very highly detailed (millions of triangles) geometry, try excluding some of it from the bake.&lt;br /&gt;
* Try disabling [[Manual#Export_terrain_trees|Export terrain trees]].&lt;br /&gt;
* Try enabling [[Manual#Terrain_optimization|Terrain optimization]].&lt;br /&gt;
&lt;br /&gt;
This error can also be shown in case of GPU driver crash, in which case Unity editor also won't render anything.&lt;br /&gt;
&lt;br /&gt;
If this error happens at the end of the render process (from the seamfixer app), try increasing the [[Troubleshooting#I_get_a_.22Launch_timeout.22_error|TDR]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a “Can't create texture” or &amp;quot;Can't create rasterizer state&amp;quot; error ===&lt;br /&gt;
Typically errors like this are caused by such chain of events:&lt;br /&gt;
* Some objects in the scene have incorrect lightmapping UVs. Often the UVs contain many large triangles overlapping each other.&lt;br /&gt;
* Scene uses large lightmaps.&lt;br /&gt;
* Bakery tries to rasterize a huge amount of 4k-sized overlapping triangles to prepare the UV GBuffer.&lt;br /&gt;
* This operation takes &amp;gt; 2 seconds, and the driver is reset by Windows due to TDR: https://docs.microsoft.com/en-us/windows-hardware/drivers/display/timeout-detection-and-recovery&lt;br /&gt;
* Consequent GPU operations are failed due to reset.&lt;br /&gt;
&lt;br /&gt;
Solution:&lt;br /&gt;
* Make sure all your objects either have non-overlapping UV2 or enable &amp;quot;Generate lightmapping UVs&amp;quot; on all model assets.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== After importing Bakery I get errors containing “obsolete” and “UnityUpgradable” ===&lt;br /&gt;
Before importing Bakery, make sure you don't have any compilation errors in your project.&lt;br /&gt;
&lt;br /&gt;
Restart Unity, reimport the package. Click “I made a backup, go ahead” if Unity asks.&lt;br /&gt;
&lt;br /&gt;
See [https://docs.unity3d.com/Manual/APIUpdater.html this page] for more details.&lt;br /&gt;
&lt;br /&gt;
It is also known that some versions of Unity Hub have a [https://forum.unity.com/threads/bakery-gpu-lightmapper-v1-6-released.536008/page-63#post-4668227 bug] preventing API updater from running.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a &amp;quot;Can't load&amp;quot; error ===&lt;br /&gt;
If Bakery says it can't load something, make sure you have enough free disk space on the drive used for [[Manual#Temp_path|temporary data]].&lt;br /&gt;
&lt;br /&gt;
Some parts of Bakery can't deal with non-ASCII characters (this is going to be fixed soon). Try naming your scenes and lightmap group assets with ASCII characters. Latin letters and numbers must always work.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a &amp;quot;Launch timeout&amp;quot; error ===&lt;br /&gt;
This error can happen if your GPU took more time than it is allowed by [https://docs.microsoft.com/en-us/windows-hardware/drivers/display/timeout-detection-and-recovery Windows TDR].&lt;br /&gt;
* Try disabling [[Manual#Terrain_optimization|Terrain Optimization]].&lt;br /&gt;
* Try lowering the value of [[Manual#Tile_size|Tile Size]], especially if it's higher than 512, so baking job is split into smaller chunks.&lt;br /&gt;
* Depending on the pass being processed, try lowering the Samples value (e.g. [[Manual#Samples|GI samples]], [[Manual#Bakery_Sky_Light|Skylight samples]], etc).&lt;br /&gt;
* Reduce geometric complexity of the scene, if tile size/samples don't help.&lt;br /&gt;
* As a last resort, [https://docs.microsoft.com/en-us/windows-hardware/drivers/display/tdr-registry-keys disable TDR registry keys]. This will prevent Windows from resetting the driver, but your computer may appear unresponsive during the bake.&lt;br /&gt;
&lt;br /&gt;
[https://substance3d.adobe.com/documentation/spdoc/gpu-drivers-crash-with-long-computations-tdr-crash-128745489.html Additional instructions for changing the timeout (from Substance)]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I have an Android project, and lightmaps don't look good ===&lt;br /&gt;
[[File:Banding.jpg|Android banding artifacts|thumb]]&lt;br /&gt;
[[File:LightmapsTechnicalDetails.png|Lightmap encoding in player settings|thumb]]&lt;br /&gt;
[[File:Astc.jpg|Build texture compression settings|thumb]]&lt;br /&gt;
Sometimes, when working on Android projects, you may encounter banding artifacts, with gradients having discrete steps of different hue.&lt;br /&gt;
This is caused by texture compression and HDR encoding Unity uses for this platform, which often turns out to be &amp;quot;Double LDR&amp;quot; ([https://docs.unity3d.com/Manual/Lightmaps-TechnicalInformation.html see details]). The problem is not exclusive to Bakery and will as well happen with built-in lightmaps.&lt;br /&gt;
&lt;br /&gt;
In Player Settings, set Lightmap Encoding to '''High Quality'''.&lt;br /&gt;
&lt;br /&gt;
If your target devices support ASTC compression, make sure it is enabled in Build settings. PVRTC is also a good choice, although it is mostly supported on iOS devices. ETC compression gives poor results for lightmaps.&lt;br /&gt;
&lt;br /&gt;
If above solutions are not enough, select lightmap assets and set texture compression quality to '''High''' or '''None''' (try both).&lt;br /&gt;
&lt;br /&gt;
Note that setting it to None will use more video memory on the device.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I have a scene baked with MonoSH, and lighting looks pixelated ===&lt;br /&gt;
[[File:Normalq.jpg|MonoSH compressed with low quality encoding|thumb]]&lt;br /&gt;
In some scenes, [[Manual#MonoSH|MonoSH]] lightmaps can look pixelated, if low (or &amp;quot;normal&amp;quot;) quality compression is used (e.g. DXT1). Usually setting Compression = High on the L1 texture fixes the issue.&lt;br /&gt;
&lt;br /&gt;
You can enable all L1 textures to always use High quality compression by toggling Project Settings -&amp;gt; Bakery -&amp;gt; '''High quality direction'''.&lt;br /&gt;
&lt;br /&gt;
Note that depending on the platform, High quality compression can take more memory. On PC it usually doubles by going from DXT1 to BC7 format.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== There are weird square artifacts on my geometry ===&lt;br /&gt;
[[File:Smoothnormals flatshape.jpg|Square artifacts from incorrect normals|thumb]]&lt;br /&gt;
Weird squares may sometimes be seen on models when their shape is too different from their normals. Bakery [https://ndotl.wordpress.com/#shadowterm tries to compensate] starting ray points to take fake normal smoothness into account, but in extreme cases the algorithm can't handle the discrepancy.&lt;br /&gt;
Usually it's enough to just recalculate normals on the model. E.g. in Unity you can select the FBX and change &amp;quot;Normals&amp;quot; to &amp;quot;Calculate&amp;quot; instead of &amp;quot;Import&amp;quot;.&lt;br /&gt;
Alternatively, you can disable the related compensation algorithm, but it’s actually beneficial in most cases. You can toggle it in Project Settings → Bakery → Generate smooth positions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get too many lightmaps ===&lt;br /&gt;
Possible causes are:&lt;br /&gt;
&lt;br /&gt;
* [[Manual#Atlas_Packer|Atlas packer]] is set to ''Default'' or ''Post-packing'' is disabled. Set Atlas Packer to ''xatlas'' and enable Post-packing for best results.&lt;br /&gt;
&lt;br /&gt;
* ''Texels Per Unit'' value is high or ''Max Resolution'' is low. Bakery packs objects from open scenes into multiple lightmap atlases and packs them as rectangles (in a fashion similar to [https://blackpawn.com/texts/lightmaps/default.html this]; unless Hole Filling is enabled) with their size dependent on (surface area * texels per unit). If some object can't fit into existing atlases, a new one is allocated. New atlases are always as large as the Max Resolution parameter, or smaller (but not smaller than ''Min Resolution''), if the estimated surface area of remaining unpacked objects is below some threshold. You can also increase Min Resolution a bit, replacing a bunch of small (but dense) maps with a few large (but possibly with some empty space).&lt;br /&gt;
&lt;br /&gt;
Additionally, increase ''Min Resolution'' to prefer larger combined lightmaps instead of many smaller ones.&lt;br /&gt;
&lt;br /&gt;
If not using post-packing:&lt;br /&gt;
&lt;br /&gt;
* If you bake multiple open scenes and ''Split by scene'' checkbox is on, different scenes will never share the same lightmap, therefore multiplying their count.&lt;br /&gt;
* If ''Terrain optimization'' is on, terrains will always use a separate lightmap.&lt;br /&gt;
Pre-atlasing your scene in your modelling package of choice and using the [https://geom.io/bakery/wiki/index.php?title=Manual#Bakery_Lightmap_Group_Selector Original UV] mode instead of relying on the auto-atlaser can significantly improve packing effectiveness.&lt;br /&gt;
&lt;br /&gt;
Since v1.71 Bakery prints number of future used lightmaps to console when enabling/refreshing Checker Preview. You can experiment with resolution/density settings until the desired value is printed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get jagged shadows ===&lt;br /&gt;
[[File:Softshadows.png|Jagged shadow mitigation|thumb]]&lt;br /&gt;
Apparently you are baking very sharp shadows at low resolution. Try increasing shadow spread parameter on the light ([[Manual#Bakery_Direct_Light|direct]] or [[Manual#Bakery_Point_Light|point]]) and optionally enable [[Manual#Shader_Tweaks|bicubic interpolation]].&lt;br /&gt;
On a [[Manual#Bakery_Direct_Light|Direct Light]] you can also enable the '''Anti-Alias''' option.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Exporting scene - preparing&amp;quot; is taking too long ===&lt;br /&gt;
(Or &amp;quot;Exporting scene - atlasing&amp;quot;)&lt;br /&gt;
* Try setting [[Manual#Atlas_Packer|Atlas Packer]] to Default.&lt;br /&gt;
* Make sure you use reasonable [[Manual#Texels_per_unit|Texels Per Unit]] value.&lt;br /&gt;
* Make sure your meshes are [[Manual#Quickstart|correctly unwrapped]].&lt;br /&gt;
* Possibly disable [[Manual#Asset_UV_Processing|UV Padding Adjustment]].&lt;br /&gt;
&lt;br /&gt;
If you're converting a large existing scene, make sure to follow [[How_do_I...#How_do_I_quickly_port_my_existing_scene_to_Bakery.3F|this guide]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Stuck at &amp;quot;Waiting for Unity to initialize the probes...&amp;quot; ===&lt;br /&gt;
There isn't much Bakery can do about the logic of Unity lighting data asset generation (there is no API in the engine to control it at the moment). Try to focus editor window (especially scene view) to wake Unity up.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Baked prefabs instantiated at runtime in a build have no lightmaps ===&lt;br /&gt;
Because Unity technically has no support for prefabs having lightmaps, it can omit lightmapped shader versions from builds, not realizing they are needed. You can fix it by going to [https://docs.unity3d.com/Manual/class-GraphicsSettings.html?_ga=2.212464724.1917527976.1586930444-1257434621.1522062178#stripping Shader stripping settings] and enabling lightmap modes you use.&lt;br /&gt;
Additionally, try disabling '''Optimize Mesh Data''' in Player Settings, as Unity may omit UV from the build.&lt;br /&gt;
&lt;br /&gt;
{{note|In Shader Stripping settings &amp;quot;Directional&amp;quot; mode only applies to standard Unity directional maps aka [[Manual#Dominant_Direction|Dominant Direction]]. When using Baked Normal Maps, RNM or SH, use &amp;quot;Non-directional&amp;quot; lightmap mode checkboxes.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Speedtrees look fine in the editor, but black in builds ===&lt;br /&gt;
Also related to shader stripping. See the [[Troubleshooting#Baked_prefabs_instantiated_at_runtime_in_a_build_have_no_lightmaps|prefab solution]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Scene is black in build ===&lt;br /&gt;
See advice above. Additionally, if the scene is loaded asynchronously, call ftLightmaps.RefreshFull() when it is fully loaded.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== HDRI produces scattered bright spots (fireflies) ===&lt;br /&gt;
[[File:Fireflies.jpg|thumb|Typical &amp;quot;fireflies&amp;quot;]]&lt;br /&gt;
[[File:Upload 2019-7-3 11-27-22.png|thumb|Removing sun from HDRI]]&lt;br /&gt;
This artefact comes from the fact your HDRI has very bright, yet very small parts, typically sun. Rays will miss it often, producing occasional spots when they don't. This problem is well known in many offline ray tracers as well.&lt;br /&gt;
* Use [[Manual#Bakery_Direct_Light|Direct Light]] for the sun&lt;br /&gt;
* Remove sun from HDRI (also [https://seblagarde.wordpress.com/2016/08/28/siggraph-2016-an-artist-friendly-workflow-for-panoramic-hdri/ recommended by Unity])&lt;br /&gt;
* Possibly downsample/blur the HDRI&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Small emissive (or brightly lit) surfaces produce noise ===&lt;br /&gt;
The issue is similar to the one above and may happen when using very small and very bright emissive surfaces, or small non-emissive surfaces lit by a very intense light. In case of emissive surfaces, you can replace them with [[Manual#Bakery_Light_Mesh|Light Meshes]] to prevent it. See [[Manual#Differences_between_Light_Mesh_and_emissive_materials|Differences between Light Mesh and emissive materials]]. Alternatively, try increasing [[Manual#Samples|GI sample count]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Adjusting UV padding&amp;quot; happens too often and takes too much time ===&lt;br /&gt;
[[Manual#Asset_UV_Processing|UV padding adjustment]] is a feature that optimizes asset UVs based on the size they take in lightmaps. This process will happen for a model if:&lt;br /&gt;
* Option is globally enabled.&lt;br /&gt;
* Asset has &amp;quot;Generate Lightmap UVs&amp;quot; checkbox enabled. Models with custom UVs are not adjusted.&lt;br /&gt;
* Model was not adjusted before or...&lt;br /&gt;
* ... its lightmap size has changed.&lt;br /&gt;
Therefore it can be triggered for all auto-unwrapped models after their geometry or resolution changes.&lt;br /&gt;
UV padding adjustment will try to waste less lightmap resolution and reduce texel leaking, but it is not necessary. If you are doing many experimental/draft bakes, you may consider disabling it (set to &amp;quot;Don't change&amp;quot;), then possibly enabling it back for the final quality bake.&lt;br /&gt;
&lt;br /&gt;
Also note that using xatlas as [[Manual#Unwrapper|Unwrapper]] can be notoriously slower comparing to Default.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser produces bright edges around geometry/shadows ===&lt;br /&gt;
[[File:Bredges.jpg|thumb|Bright edges]]&lt;br /&gt;
Sometimes you may encounter bright edges or spots at high contrast edges caused by the denoising neural net, most notably OptiX 6 and 7.&lt;br /&gt;
* Use OptiX 5 or OpenImageDenoise if you can ([[Manual#Denoiser|denoiser]] option).&lt;br /&gt;
* Try enabling [[Manual#Denoise:_fix_bright_edges|Denoise: Fix bright edges]].&lt;br /&gt;
* Try setting texture compression to None on lightmap assets.&lt;br /&gt;
* Try setting [[Manual#Backface_GI|Backface GI]] to 1, removing dark shadows inside objects. While these shadows are normally not visible, their edges may cause problems for both the denoiser and texture compression.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Light probes are too bright in Subtractive mode ===&lt;br /&gt;
&lt;br /&gt;
[[File:98911466-ae8c5b00-24d5-11eb-8d51-4e764ac0f163.png|thumb|The effect of occlusion probes]]&lt;br /&gt;
&lt;br /&gt;
Light occlusion information is not baked into probes. Solution:&lt;br /&gt;
* Set your Unity directional light to Mixed mode.&lt;br /&gt;
* Enable [[Manual#Occlusion_probes|Occlusion Probes]].&lt;br /&gt;
* Bake&lt;br /&gt;
&lt;br /&gt;
Some versions of Unity may need a scene reload to properly apply the Lighting Data Asset.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Baking produces &amp;quot;Not allowed to access uv2&amp;quot; errors ===&lt;br /&gt;
All lightmapped models must have [https://docs.unity3d.com/Manual/FBXImporter-Model.html Read/Write enabled] on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Whole scene is very bright or black ===&lt;br /&gt;
* Check if your light intensities are in a reasonable range (&amp;lt; 100; or &amp;lt;= 100000 Lux in HDRP).&lt;br /&gt;
* Check the same for indirect intensity on all lights. A multiplication of direct and intensity intensity must not go into thousands, otherwise GI algorithm may overflow.&lt;br /&gt;
* Check if you don't use assets with High mesh compression. When set to High, Unity mesh compression will completely destroy lightmap UVs, only leaving 8 bits for them. This may produce many lightmapping errors including this one.&lt;br /&gt;
* Check if you have any .hdr overrides in the Preset Manager that change the way lightmaps are imported.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery says &amp;quot;Device is not DX11&amp;quot; ===&lt;br /&gt;
Currently Bakery needs Unity editor to be running in DX11 mode to directly exchange texture data, so make sure your editor's window header says &amp;quot;&amp;lt;DX11&amp;gt;&amp;quot;. If it does not, change active graphics API to DX11: &lt;br /&gt;
* Go to Player Settings.&lt;br /&gt;
* If &amp;quot;Auto Graphics API for Windows&amp;quot; is unchecked, you will see a list of APIs.&lt;br /&gt;
* Make sure &amp;quot;Direct3D11&amp;quot; is on top or place it there.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery doesn't work on my 3070/3080/3090 GPU? ===&lt;br /&gt;
1. Please enable [[Manual#RTX_Mode|RTX mode]].&lt;br /&gt;
&lt;br /&gt;
2. If denoiser also fails, please update from [[Github_access|github]] and use OpenImageDenoise option (some instructions are [[Troubleshooting#Denoiser_produces_bright_edges_around_geometry.2Fshadows|here]]).&lt;br /&gt;
&lt;br /&gt;
Updated denoiser (both new OptiX version and OpenImageDenoise) as well as automatic hardware detection will be soon released on the Asset Store.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser produces grid-like patterns ===&lt;br /&gt;
[[File:Gridlike.jpg|thumb|Grid-like denoiser pattern]]&lt;br /&gt;
&lt;br /&gt;
OptiX denoiser might produdce grid-like patterns when fed with very low-precision lightmaps. Low precision is usually caused by either extremely dark or extremely bright lighting. It is recommended to stay within reasonable intensity range (see a similar advice for [[Troubleshooting#Lightmaps_look_black_or_have_bad_quality_in_an_HDRP_scene|HDRP]] above).&lt;br /&gt;
&lt;br /&gt;
* Alternatively use OpenImageDenoise, as it does not produce this pattern.&lt;br /&gt;
&lt;br /&gt;
* This issue also does not affect OptiX 5.1 denoiser (&amp;quot;Legacy denoiser&amp;quot;) as its training dataset is in its own DLL, but affects the non-legacy version (OptiX 6.0) and only on driver versions newer than 442.50, as the training datasets are in the driver ([https://forums.developer.nvidia.com/t/optix7-denoiser-different-results-with-different-version-of-drivers/117989/2 explanation from NVIDIA]).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get &amp;quot;rtcRes == RTC_SUCCESS&amp;quot; error ===&lt;br /&gt;
&lt;br /&gt;
You are using a 3xxx+ GPU with RTX mode disabled. Enable [[Manual#RTX_Mode|RTX mode]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Baking any scene crashes with unknown error ===&lt;br /&gt;
&lt;br /&gt;
There were [https://twitter.com/HarryAlisavakis/status/1331630028665348096 some reports] that Avast antivirus can block Bakery from running, even though Bakery's executables don't trigger any antivirus (including Avast) when [https://twitter.com/guycalledfrank/status/1331640614077796354 scanned via VirusTotal]. Perhaps it just block any executables that were launched 'indirectly', i.e. from another application. In any case, if you have Avast, try adding your project folder to exception list.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Combined meshes (e.g. using Mesh Combine asset) bake incorrectly ===&lt;br /&gt;
&lt;br /&gt;
[[File:Meshcombine.jpg|thumb|Mesh Combine &amp;quot;Regenerate Lightmap UVs&amp;quot; option]]&lt;br /&gt;
&lt;br /&gt;
Most mesh combining assets have an option to regenerate lightmap UVs. Without it, combined UVs will overlap each other. If you are using Mesh Combine, make sure &amp;quot;Regenerate Lightmap UVs&amp;quot; option is enabled in output settings.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a &amp;quot;Can't create vertex buffer&amp;quot; error ===&lt;br /&gt;
&lt;br /&gt;
This error can happen if the scene has more than ~40 million vertices. It is recommended to reduce geometric complexity of the scene, as tracing it would be too slow anyway. The typical cause of going over this limit is trying to bake with large arrays of trees painted on the terrain. In this case try disabling [[Manual#Export_terrain_trees|Export Terrain Trees]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Soft shadows appear like multiple hard shadows ===&lt;br /&gt;
&lt;br /&gt;
[[File:Unknown.png|thumb|Undersampled shadow]]&lt;br /&gt;
&lt;br /&gt;
Increase ''Shadow Samples'' on the light or decrease the ''Shadow Spread''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Lightmaps are black on GTX 650 ===&lt;br /&gt;
&lt;br /&gt;
Apparently newer Nvidia drivers deprecate some CUDA functions on older hardware. It is recommended to use driver version 442 on GTX 650, as it still supported everything Bakery uses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Lightmaps disappear on play ===&lt;br /&gt;
&lt;br /&gt;
* Make sure that '''Project Settings''' -&amp;gt; '''Editor''' -&amp;gt; '''Enter Play Mode Settings''' -&amp;gt; '''Reload Scene''' is turned '''on'''.&lt;br /&gt;
* If that doesn't help, try applying the latest [[Github_access|patch]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a DllNotFoundException ===&lt;br /&gt;
&lt;br /&gt;
* Check if the DLL file mentioned in the error actually exists in your project. If it doesn't, your Bakery installation is incomplete or corrupted; please reinstall it.&lt;br /&gt;
* Check if you're running 64-bit Unity Editor under 64-bit Windows (7 or newer) (as listed in [[Manual#System_requirements|system requirements]]).&lt;br /&gt;
* Make sure you have 64-bit [https://www.microsoft.com/en-us/download/details.aspx?id=48145 Visual C++ Redistributables for Visual Studio 2015] installed. In case if the Microsoft site download is broken, here is a [https://drive.google.com/file/d/1WfRP1A43bCwZflZ_I0wHSGPyC3b-0lqK/view?usp=sharing reupload].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Lightmap UVs are wrong when opening previously baked project on a Mac ===&lt;br /&gt;
&lt;br /&gt;
When Unity reimports model assets, it performs UV unwrapping. If you baked the scene with [[Manual#Unwrapper|Unwrapper]] was set to xatlas, it won't work on a Mac because Bakery's xatlas wrapper library is only compiled for Windows. Rebaking with Default unwrapper should fix it.&lt;br /&gt;
&lt;br /&gt;
You can still keep xatlas as the [[Manual#Atlas_Packer|Atlas Packer]].&lt;br /&gt;
&lt;br /&gt;
''Unwrapper'' is used to generate UVs for individual, isolated meshes, while ''Atlas Packer'' packs big scene-specific atlases out of many unwrapped layouts.&lt;br /&gt;
&lt;br /&gt;
Combining Default unwrapper with xatlas being used as the Atlas Packer and enabling [[Manual#Hole_filling|Hole Filling]] should give pretty good [https://x.com/guycalledfrank/status/1231890428313600000 results] and compensate for any individual mesh unwrapping inefficiencies.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Error message &amp;quot;Failed to load OptiX library&amp;quot; ===&lt;br /&gt;
&lt;br /&gt;
Nvidia driver 590 (and newer) removed support for OptiX 6.0 which Bakery depended on. Bakery v1.98 added support for the new driver, now using OptiX 9.0.&lt;br /&gt;
* Make sure you're using a [[Manual#System_requirements|supported Nvidia GPU]].&lt;br /&gt;
* Update Bakery to v1.98 via the [https://assetstore.unity.com/packages/tools/level-design/bakery-gpu-lightmapper-122218 Asset Store], [[Github_access|github or the built-in patcher]].&lt;br /&gt;
* If you don't want to update Bakery, roll back your GPU driver to any pre-590 version (e.g. [https://www.nvidia.com/en-eu/geforce/drivers/results/257569/ 581.80]).&lt;/div&gt;</summary>
		<author><name>Mr F</name></author>
		
	</entry>
	<entry>
		<id>https://geom.io/bakery/wiki/index.php?title=Troubleshooting&amp;diff=1848</id>
		<title>Troubleshooting</title>
		<link rel="alternate" type="text/html" href="https://geom.io/bakery/wiki/index.php?title=Troubleshooting&amp;diff=1848"/>
		<updated>2025-12-24T16:26:13Z</updated>

		<summary type="html">&lt;p&gt;Mr F: /* Lightmap UVs are wrong when opening previously baked project on a Mac */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a list of common problems, their symptoms and solutions.&lt;br /&gt;
&lt;br /&gt;
=== Shadowmasks are not baked ===&lt;br /&gt;
Check following things:&lt;br /&gt;
* Bakery's [[Manual#Render Mode|Render Mode]] is set to Shadowmask.&lt;br /&gt;
* Masked lights have both Unity and Bakery light components on them.&lt;br /&gt;
* Masked Bakery light components have &amp;quot;Baked contribution&amp;quot; set to &amp;quot;Indirect and shadowmask&amp;quot;.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Shadowmasks are baked, but Unity renders real-time shadows instead ===&lt;br /&gt;
You're in Distance Shadowmask mode, it's expected. Read more about the difference:&lt;br /&gt;
&lt;br /&gt;
https://docs.unity3d.com/Manual/LightMode-Mixed-Shadowmask.html&lt;br /&gt;
&lt;br /&gt;
https://docs.unity3d.com/Manual/LightMode-Mixed-DistanceShadowmask.html&lt;br /&gt;
&lt;br /&gt;
* To switch between two modes, you can use &amp;quot;Distance Shadowmask&amp;quot; checkbox in Bakery main window.&lt;br /&gt;
* If you're on 5.6, go to Window-&amp;gt;Lighting-&amp;gt;Mixed Lighting-&amp;gt;Lighting Mode to switch the mode.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I can't see specular lighting after the bake ===&lt;br /&gt;
Apparently specular lighting was provided by real-time lights before the bake. Now the lighting is baked into static textures and there is no specular. However, you can:&lt;br /&gt;
* Use Reflection Probes. Good option for highly glossy objects.&lt;br /&gt;
* Use mixed lights and only bake GI/[[Manual#Shadowmask|Shadowmasks]]. Specular remains real-time.&lt;br /&gt;
* Bake in [[Manual#Dominant_Direction|Dominant Direction]] or [[Manual#SH|SH]] mode and use [[Manual#Bakery_shaders|Bakery shaders]] with &amp;quot;Lightmapped specular&amp;quot; option. It will give some specular approximation. Looks good on surfaces with medium/high roughness.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Using a version control system I copied the scene to another PC and it doesn't look right ===&lt;br /&gt;
Make sure you followed [[How_do_I...#How_do_I_use_git.2Fcollab.2Fother_version_control_system_with_Bakery.3F|version control guidelines]].&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Baking same asset in one scene breaks its UVs in another scene ===&lt;br /&gt;
The reason here is [[Manual#Asset_UV_Processing|UV padding adjustment]]. It modifies the UVs in the asset, so spacing between UV charts is optimal, meaning they never leak over each other and there is no much wasted space. Unity has a manual Pack Margin option on model assets, but it’s limited since it applies the same exact value for all meshes inside the model, while each mesh can get drastically different size in the final lightmap based on its surface area. Therefore Bakery overrides it with automatically calculated per-mesh (instead of per-model) padding. However, because “optimal” varies depending on baking resolution, it can be problematic to reuse the same asset in isolated scenes with different lightmap size. There are multiple ways to solve it:&lt;br /&gt;
* a) Just disable UV padding adjustment (set to [[Manual#Asset_UV_Processing|Don't Change]]). Results will be similar to built-in baking.&lt;br /&gt;
* b) Generate your own optimal UVs. UV padding adjustment only applies to models with auto-generated UV layout (aka “Generate Lightmap UVs” checkbox) and never touches custom data.&lt;br /&gt;
* c) Set Asset UV Processing to &amp;quot;Adjust UV padding only for new meshes&amp;quot; (currently available in the [[Github_access|github]] version).&lt;br /&gt;
* d) Use [[Manual#UV_padding:_increase_only|UV padding: increase only]] checkbox and first bake the lowest resolution scene, and then the rest.&lt;br /&gt;
* e) Use two different models for different lightmap resolutions, so each will get the most efficient set of UVs.&lt;br /&gt;
* f) Bake both scenes together.&lt;br /&gt;
* g) Lock UVs using [[How_do_I...#Alternative_solution|Save UV padding to asset]]&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser throws error 505 or Unknown error ===&lt;br /&gt;
[https://www.nvidia.com/Download/index.aspx?lang=en-US Update the driver].&lt;br /&gt;
&lt;br /&gt;
If you are using a Kepler GPU, try switching to [[Manual#Legacy_denoiser|legacy denoiser]].&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get an “Out of memory” error ===&lt;br /&gt;
This means rendering needed more video memory from your GPU than it has available.&lt;br /&gt;
&lt;br /&gt;
First, try closing any other graphics-intensive programs (browsers too).&lt;br /&gt;
&lt;br /&gt;
If the problem persists, the most likely reason is that the resolution you selected is unreasonably high for the given scene. Resolution is defined by [[Manual#Texels_per_unit|Texels per Unit]] (this section also has a list of reference values) or set explicitly in [[Manual#Bakery_Lightmap_Group_Selector|Lightmap Groups]]. Reducing it will help. You can always selectively use high resolution for important objects via [https://docs.unity3d.com/Manual/class-MeshRenderer.html Scale in Lightmap].&lt;br /&gt;
&lt;br /&gt;
If you have terrains in your scene, make sure [[Manual#Terrain_optimization|Terrain optimization]] is enabled.&lt;br /&gt;
&lt;br /&gt;
If you have a very high amount of painted trees on your terrain, try disabling the [[Manual#Export_terrain_trees|Export terrain trees]] option.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a “Can't map texture” error ===&lt;br /&gt;
Typically happens if your system went out of RAM (system memory, not video memory) during the scene export process. Your scene could already be taking too much RAM by itself, not leaving enough free memory for Bakery export.&lt;br /&gt;
&lt;br /&gt;
* Try closing any memory-intensive programs before baking.&lt;br /&gt;
* Try reducing [[Manual#Max_resolution|Max Resolution]] from 4096 to 2048.&lt;br /&gt;
* If you are baking very highly detailed (millions of triangles) geometry, try excluding some of it from the bake.&lt;br /&gt;
* Try disabling [[Manual#Export_terrain_trees|Export terrain trees]].&lt;br /&gt;
* Try enabling [[Manual#Terrain_optimization|Terrain optimization]].&lt;br /&gt;
&lt;br /&gt;
This error can also be shown in case of GPU driver crash, in which case Unity editor also won't render anything.&lt;br /&gt;
&lt;br /&gt;
If this error happens at the end of the render process (from the seamfixer app), try increasing the [[Troubleshooting#I_get_a_.22Launch_timeout.22_error|TDR]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a “Can't create texture” or &amp;quot;Can't create rasterizer state&amp;quot; error ===&lt;br /&gt;
Typically errors like this are caused by such chain of events:&lt;br /&gt;
* Some objects in the scene have incorrect lightmapping UVs. Often the UVs contain many large triangles overlapping each other.&lt;br /&gt;
* Scene uses large lightmaps.&lt;br /&gt;
* Bakery tries to rasterize a huge amount of 4k-sized overlapping triangles to prepare the UV GBuffer.&lt;br /&gt;
* This operation takes &amp;gt; 2 seconds, and the driver is reset by Windows due to TDR: https://docs.microsoft.com/en-us/windows-hardware/drivers/display/timeout-detection-and-recovery&lt;br /&gt;
* Consequent GPU operations are failed due to reset.&lt;br /&gt;
&lt;br /&gt;
Solution:&lt;br /&gt;
* Make sure all your objects either have non-overlapping UV2 or enable &amp;quot;Generate lightmapping UVs&amp;quot; on all model assets.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== After importing Bakery I get errors containing “obsolete” and “UnityUpgradable” ===&lt;br /&gt;
Before importing Bakery, make sure you don't have any compilation errors in your project.&lt;br /&gt;
&lt;br /&gt;
Restart Unity, reimport the package. Click “I made a backup, go ahead” if Unity asks.&lt;br /&gt;
&lt;br /&gt;
See [https://docs.unity3d.com/Manual/APIUpdater.html this page] for more details.&lt;br /&gt;
&lt;br /&gt;
It is also known that some versions of Unity Hub have a [https://forum.unity.com/threads/bakery-gpu-lightmapper-v1-6-released.536008/page-63#post-4668227 bug] preventing API updater from running.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a &amp;quot;Can't load&amp;quot; error ===&lt;br /&gt;
If Bakery says it can't load something, make sure you have enough free disk space on the drive used for [[Manual#Temp_path|temporary data]].&lt;br /&gt;
&lt;br /&gt;
Some parts of Bakery can't deal with non-ASCII characters (this is going to be fixed soon). Try naming your scenes and lightmap group assets with ASCII characters. Latin letters and numbers must always work.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a &amp;quot;Launch timeout&amp;quot; error ===&lt;br /&gt;
This error can happen if your GPU took more time than it is allowed by [https://docs.microsoft.com/en-us/windows-hardware/drivers/display/timeout-detection-and-recovery Windows TDR].&lt;br /&gt;
* Try disabling [[Manual#Terrain_optimization|Terrain Optimization]].&lt;br /&gt;
* Try lowering the value of [[Manual#Tile_size|Tile Size]], especially if it's higher than 512, so baking job is split into smaller chunks.&lt;br /&gt;
* Depending on the pass being processed, try lowering the Samples value (e.g. [[Manual#Samples|GI samples]], [[Manual#Bakery_Sky_Light|Skylight samples]], etc).&lt;br /&gt;
* Reduce geometric complexity of the scene, if tile size/samples don't help.&lt;br /&gt;
* As a last resort, [https://docs.microsoft.com/en-us/windows-hardware/drivers/display/tdr-registry-keys disable TDR registry keys]. This will prevent Windows from resetting the driver, but your computer may appear unresponsive during the bake.&lt;br /&gt;
&lt;br /&gt;
[https://substance3d.adobe.com/documentation/spdoc/gpu-drivers-crash-with-long-computations-tdr-crash-128745489.html Additional instructions for changing the timeout (from Substance)]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I have an Android project, and lightmaps don't look good ===&lt;br /&gt;
[[File:Banding.jpg|Android banding artifacts|thumb]]&lt;br /&gt;
[[File:LightmapsTechnicalDetails.png|Lightmap encoding in player settings|thumb]]&lt;br /&gt;
[[File:Astc.jpg|Build texture compression settings|thumb]]&lt;br /&gt;
Sometimes, when working on Android projects, you may encounter banding artifacts, with gradients having discrete steps of different hue.&lt;br /&gt;
This is caused by texture compression and HDR encoding Unity uses for this platform, which often turns out to be &amp;quot;Double LDR&amp;quot; ([https://docs.unity3d.com/Manual/Lightmaps-TechnicalInformation.html see details]). The problem is not exclusive to Bakery and will as well happen with built-in lightmaps.&lt;br /&gt;
&lt;br /&gt;
In Player Settings, set Lightmap Encoding to '''High Quality'''.&lt;br /&gt;
&lt;br /&gt;
If your target devices support ASTC compression, make sure it is enabled in Build settings. PVRTC is also a good choice, although it is mostly supported on iOS devices. ETC compression gives poor results for lightmaps.&lt;br /&gt;
&lt;br /&gt;
If above solutions are not enough, select lightmap assets and set texture compression quality to '''High''' or '''None''' (try both).&lt;br /&gt;
&lt;br /&gt;
Note that setting it to None will use more video memory on the device.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I have a scene baked with MonoSH, and lighting looks pixelated ===&lt;br /&gt;
[[File:Normalq.jpg|MonoSH compressed with low quality encoding|thumb]]&lt;br /&gt;
In some scenes, [[Manual#MonoSH|MonoSH]] lightmaps can look pixelated, if low (or &amp;quot;normal&amp;quot;) quality compression is used (e.g. DXT1). Usually setting Compression = High on the L1 texture fixes the issue.&lt;br /&gt;
&lt;br /&gt;
You can enable all L1 textures to always use High quality compression by toggling Project Settings -&amp;gt; Bakery -&amp;gt; '''High quality direction'''.&lt;br /&gt;
&lt;br /&gt;
Note that depending on the platform, High quality compression can take more memory. On PC it usually doubles by going from DXT1 to BC7 format.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== There are weird square artifacts on my geometry ===&lt;br /&gt;
[[File:Smoothnormals flatshape.jpg|Square artifacts from incorrect normals|thumb]]&lt;br /&gt;
Weird squares may sometimes be seen on models when their shape is too different from their normals. Bakery [https://ndotl.wordpress.com/#shadowterm tries to compensate] starting ray points to take fake normal smoothness into account, but in extreme cases the algorithm can't handle the discrepancy.&lt;br /&gt;
Usually it's enough to just recalculate normals on the model. E.g. in Unity you can select the FBX and change &amp;quot;Normals&amp;quot; to &amp;quot;Calculate&amp;quot; instead of &amp;quot;Import&amp;quot;.&lt;br /&gt;
Alternatively, you can disable the related compensation algorithm, but it’s actually beneficial in most cases. You can toggle it in Project Settings → Bakery → Generate smooth positions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get too many lightmaps ===&lt;br /&gt;
Possible causes are:&lt;br /&gt;
&lt;br /&gt;
* [[Manual#Atlas_Packer|Atlas packer]] is set to ''Default'' or ''Post-packing'' is disabled. Set Atlas Packer to ''xatlas'' and enable Post-packing for best results.&lt;br /&gt;
&lt;br /&gt;
* ''Texels Per Unit'' value is high or ''Max Resolution'' is low. Bakery packs objects from open scenes into multiple lightmap atlases and packs them as rectangles (in a fashion similar to [https://blackpawn.com/texts/lightmaps/default.html this]; unless Hole Filling is enabled) with their size dependent on (surface area * texels per unit). If some object can't fit into existing atlases, a new one is allocated. New atlases are always as large as the Max Resolution parameter, or smaller (but not smaller than ''Min Resolution''), if the estimated surface area of remaining unpacked objects is below some threshold. You can also increase Min Resolution a bit, replacing a bunch of small (but dense) maps with a few large (but possibly with some empty space).&lt;br /&gt;
&lt;br /&gt;
Additionally, increase ''Min Resolution'' to prefer larger combined lightmaps instead of many smaller ones.&lt;br /&gt;
&lt;br /&gt;
If not using post-packing:&lt;br /&gt;
&lt;br /&gt;
* If you bake multiple open scenes and ''Split by scene'' checkbox is on, different scenes will never share the same lightmap, therefore multiplying their count.&lt;br /&gt;
* If ''Terrain optimization'' is on, terrains will always use a separate lightmap.&lt;br /&gt;
Pre-atlasing your scene in your modelling package of choice and using the [https://geom.io/bakery/wiki/index.php?title=Manual#Bakery_Lightmap_Group_Selector Original UV] mode instead of relying on the auto-atlaser can significantly improve packing effectiveness.&lt;br /&gt;
&lt;br /&gt;
Since v1.71 Bakery prints number of future used lightmaps to console when enabling/refreshing Checker Preview. You can experiment with resolution/density settings until the desired value is printed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get jagged shadows ===&lt;br /&gt;
[[File:Softshadows.png|Jagged shadow mitigation|thumb]]&lt;br /&gt;
Apparently you are baking very sharp shadows at low resolution. Try increasing shadow spread parameter on the light ([[Manual#Bakery_Direct_Light|direct]] or [[Manual#Bakery_Point_Light|point]]) and optionally enable [[Manual#Shader_Tweaks|bicubic interpolation]].&lt;br /&gt;
On a [[Manual#Bakery_Direct_Light|Direct Light]] you can also enable the '''Anti-Alias''' option.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Exporting scene - preparing&amp;quot; is taking too long ===&lt;br /&gt;
(Or &amp;quot;Exporting scene - atlasing&amp;quot;)&lt;br /&gt;
* Try setting [[Manual#Atlas_Packer|Atlas Packer]] to Default.&lt;br /&gt;
* Make sure you use reasonable [[Manual#Texels_per_unit|Texels Per Unit]] value.&lt;br /&gt;
* Make sure your meshes are [[Manual#Quickstart|correctly unwrapped]].&lt;br /&gt;
* Possibly disable [[Manual#Asset_UV_Processing|UV Padding Adjustment]].&lt;br /&gt;
&lt;br /&gt;
If you're converting a large existing scene, make sure to follow [[How_do_I...#How_do_I_quickly_port_my_existing_scene_to_Bakery.3F|this guide]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Stuck at &amp;quot;Waiting for Unity to initialize the probes...&amp;quot; ===&lt;br /&gt;
There isn't much Bakery can do about the logic of Unity lighting data asset generation (there is no API in the engine to control it at the moment). Try to focus editor window (especially scene view) to wake Unity up.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Baked prefabs instantiated at runtime in a build have no lightmaps ===&lt;br /&gt;
Because Unity technically has no support for prefabs having lightmaps, it can omit lightmapped shader versions from builds, not realizing they are needed. You can fix it by going to [https://docs.unity3d.com/Manual/class-GraphicsSettings.html?_ga=2.212464724.1917527976.1586930444-1257434621.1522062178#stripping Shader stripping settings] and enabling lightmap modes you use.&lt;br /&gt;
Additionally, try disabling '''Optimize Mesh Data''' in Player Settings, as Unity may omit UV from the build.&lt;br /&gt;
&lt;br /&gt;
{{note|In Shader Stripping settings &amp;quot;Directional&amp;quot; mode only applies to standard Unity directional maps aka [[Manual#Dominant_Direction|Dominant Direction]]. When using Baked Normal Maps, RNM or SH, use &amp;quot;Non-directional&amp;quot; lightmap mode checkboxes.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Speedtrees look fine in the editor, but black in builds ===&lt;br /&gt;
Also related to shader stripping. See the [[Troubleshooting#Baked_prefabs_instantiated_at_runtime_in_a_build_have_no_lightmaps|prefab solution]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Scene is black in build ===&lt;br /&gt;
See advice above. Additionally, if the scene is loaded asynchronously, call ftLightmaps.RefreshFull() when it is fully loaded.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== HDRI produces scattered bright spots (fireflies) ===&lt;br /&gt;
[[File:Fireflies.jpg|thumb|Typical &amp;quot;fireflies&amp;quot;]]&lt;br /&gt;
[[File:Upload 2019-7-3 11-27-22.png|thumb|Removing sun from HDRI]]&lt;br /&gt;
This artefact comes from the fact your HDRI has very bright, yet very small parts, typically sun. Rays will miss it often, producing occasional spots when they don't. This problem is well known in many offline ray tracers as well.&lt;br /&gt;
* Use [[Manual#Bakery_Direct_Light|Direct Light]] for the sun&lt;br /&gt;
* Remove sun from HDRI (also [https://seblagarde.wordpress.com/2016/08/28/siggraph-2016-an-artist-friendly-workflow-for-panoramic-hdri/ recommended by Unity])&lt;br /&gt;
* Possibly downsample/blur the HDRI&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Small emissive (or brightly lit) surfaces produce noise ===&lt;br /&gt;
The issue is similar to the one above and may happen when using very small and very bright emissive surfaces, or small non-emissive surfaces lit by a very intense light. In case of emissive surfaces, you can replace them with [[Manual#Bakery_Light_Mesh|Light Meshes]] to prevent it. See [[Manual#Differences_between_Light_Mesh_and_emissive_materials|Differences between Light Mesh and emissive materials]]. Alternatively, try increasing [[Manual#Samples|GI sample count]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Adjusting UV padding&amp;quot; happens too often and takes too much time ===&lt;br /&gt;
[[Manual#Asset_UV_Processing|UV padding adjustment]] is a feature that optimizes asset UVs based on the size they take in lightmaps. This process will happen for a model if:&lt;br /&gt;
* Option is globally enabled.&lt;br /&gt;
* Asset has &amp;quot;Generate Lightmap UVs&amp;quot; checkbox enabled. Models with custom UVs are not adjusted.&lt;br /&gt;
* Model was not adjusted before or...&lt;br /&gt;
* ... its lightmap size has changed.&lt;br /&gt;
Therefore it can be triggered for all auto-unwrapped models after their geometry or resolution changes.&lt;br /&gt;
UV padding adjustment will try to waste less lightmap resolution and reduce texel leaking, but it is not necessary. If you are doing many experimental/draft bakes, you may consider disabling it (set to &amp;quot;Don't change&amp;quot;), then possibly enabling it back for the final quality bake.&lt;br /&gt;
&lt;br /&gt;
Also note that using xatlas as [[Manual#Unwrapper|Unwrapper]] can be notoriously slower comparing to Default.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser produces bright edges around geometry/shadows ===&lt;br /&gt;
[[File:Bredges.jpg|thumb|Bright edges]]&lt;br /&gt;
Sometimes you may encounter bright edges or spots at high contrast edges caused by the denoising neural net, most notably OptiX 6 and 7.&lt;br /&gt;
* Use OptiX 5 or OpenImageDenoise if you can ([[Manual#Denoiser|denoiser]] option).&lt;br /&gt;
* Try enabling [[Manual#Denoise:_fix_bright_edges|Denoise: Fix bright edges]].&lt;br /&gt;
* Try setting texture compression to None on lightmap assets.&lt;br /&gt;
* Try setting [[Manual#Backface_GI|Backface GI]] to 1, removing dark shadows inside objects. While these shadows are normally not visible, their edges may cause problems for both the denoiser and texture compression.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Light probes are too bright in Subtractive mode ===&lt;br /&gt;
&lt;br /&gt;
[[File:98911466-ae8c5b00-24d5-11eb-8d51-4e764ac0f163.png|thumb|The effect of occlusion probes]]&lt;br /&gt;
&lt;br /&gt;
Light occlusion information is not baked into probes. Solution:&lt;br /&gt;
* Set your Unity directional light to Mixed mode.&lt;br /&gt;
* Enable [[Manual#Occlusion_probes|Occlusion Probes]].&lt;br /&gt;
* Bake&lt;br /&gt;
&lt;br /&gt;
Some versions of Unity may need a scene reload to properly apply the Lighting Data Asset.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Baking produces &amp;quot;Not allowed to access uv2&amp;quot; errors ===&lt;br /&gt;
All lightmapped models must have [https://docs.unity3d.com/Manual/FBXImporter-Model.html Read/Write enabled] on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Whole scene is very bright or black ===&lt;br /&gt;
* Check if your light intensities are in a reasonable range (&amp;lt; 100; or &amp;lt;= 100000 Lux in HDRP).&lt;br /&gt;
* Check the same for indirect intensity on all lights. A multiplication of direct and intensity intensity must not go into thousands, otherwise GI algorithm may overflow.&lt;br /&gt;
* Check if you don't use assets with High mesh compression. When set to High, Unity mesh compression will completely destroy lightmap UVs, only leaving 8 bits for them. This may produce many lightmapping errors including this one.&lt;br /&gt;
* Check if you have any .hdr overrides in the Preset Manager that change the way lightmaps are imported.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery says &amp;quot;Device is not DX11&amp;quot; ===&lt;br /&gt;
Currently Bakery needs Unity editor to be running in DX11 mode to directly exchange texture data, so make sure your editor's window header says &amp;quot;&amp;lt;DX11&amp;gt;&amp;quot;. If it does not, change active graphics API to DX11: &lt;br /&gt;
* Go to Player Settings.&lt;br /&gt;
* If &amp;quot;Auto Graphics API for Windows&amp;quot; is unchecked, you will see a list of APIs.&lt;br /&gt;
* Make sure &amp;quot;Direct3D11&amp;quot; is on top or place it there.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery doesn't work on my 3070/3080/3090 GPU? ===&lt;br /&gt;
1. Please enable [[Manual#RTX_Mode|RTX mode]].&lt;br /&gt;
&lt;br /&gt;
2. If denoiser also fails, please update from [[Github_access|github]] and use OpenImageDenoise option (some instructions are [[Troubleshooting#Denoiser_produces_bright_edges_around_geometry.2Fshadows|here]]).&lt;br /&gt;
&lt;br /&gt;
Updated denoiser (both new OptiX version and OpenImageDenoise) as well as automatic hardware detection will be soon released on the Asset Store.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser produces grid-like patterns ===&lt;br /&gt;
[[File:Gridlike.jpg|thumb|Grid-like denoiser pattern]]&lt;br /&gt;
&lt;br /&gt;
OptiX denoiser might produdce grid-like patterns when fed with very low-precision lightmaps. Low precision is usually caused by either extremely dark or extremely bright lighting. It is recommended to stay within reasonable intensity range (see a similar advice for [[Troubleshooting#Lightmaps_look_black_or_have_bad_quality_in_an_HDRP_scene|HDRP]] above).&lt;br /&gt;
&lt;br /&gt;
* Alternatively use OpenImageDenoise, as it does not produce this pattern.&lt;br /&gt;
&lt;br /&gt;
* This issue also does not affect OptiX 5.1 denoiser (&amp;quot;Legacy denoiser&amp;quot;) as its training dataset is in its own DLL, but affects the non-legacy version (OptiX 6.0) and only on driver versions newer than 442.50, as the training datasets are in the driver ([https://forums.developer.nvidia.com/t/optix7-denoiser-different-results-with-different-version-of-drivers/117989/2 explanation from NVIDIA]).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get &amp;quot;rtcRes == RTC_SUCCESS&amp;quot; error ===&lt;br /&gt;
&lt;br /&gt;
You are using a 3xxx+ GPU with RTX mode disabled. Enable [[Manual#RTX_Mode|RTX mode]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Baking any scene crashes with unknown error ===&lt;br /&gt;
&lt;br /&gt;
There were [https://twitter.com/HarryAlisavakis/status/1331630028665348096 some reports] that Avast antivirus can block Bakery from running, even though Bakery's executables don't trigger any antivirus (including Avast) when [https://twitter.com/guycalledfrank/status/1331640614077796354 scanned via VirusTotal]. Perhaps it just block any executables that were launched 'indirectly', i.e. from another application. In any case, if you have Avast, try adding your project folder to exception list.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Combined meshes (e.g. using Mesh Combine asset) bake incorrectly ===&lt;br /&gt;
&lt;br /&gt;
[[File:Meshcombine.jpg|thumb|Mesh Combine &amp;quot;Regenerate Lightmap UVs&amp;quot; option]]&lt;br /&gt;
&lt;br /&gt;
Most mesh combining assets have an option to regenerate lightmap UVs. Without it, combined UVs will overlap each other. If you are using Mesh Combine, make sure &amp;quot;Regenerate Lightmap UVs&amp;quot; option is enabled in output settings.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a &amp;quot;Can't create vertex buffer&amp;quot; error ===&lt;br /&gt;
&lt;br /&gt;
This error can happen if the scene has more than ~40 million vertices. It is recommended to reduce geometric complexity of the scene, as tracing it would be too slow anyway. The typical cause of going over this limit is trying to bake with large arrays of trees painted on the terrain. In this case try disabling [[Manual#Export_terrain_trees|Export Terrain Trees]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Soft shadows appear like multiple hard shadows ===&lt;br /&gt;
&lt;br /&gt;
[[File:Unknown.png|thumb|Undersampled shadow]]&lt;br /&gt;
&lt;br /&gt;
Increase ''Shadow Samples'' on the light or decrease the ''Shadow Spread''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Lightmaps are black on GTX 650 ===&lt;br /&gt;
&lt;br /&gt;
Apparently newer Nvidia drivers deprecate some CUDA functions on older hardware. It is recommended to use driver version 442 on GTX 650, as it still supported everything Bakery uses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Lightmaps disappear on play ===&lt;br /&gt;
&lt;br /&gt;
* Make sure that '''Project Settings''' -&amp;gt; '''Editor''' -&amp;gt; '''Enter Play Mode Settings''' -&amp;gt; '''Reload Scene''' is turned '''on'''.&lt;br /&gt;
* If that doesn't help, try applying the latest [[Github_access|patch]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a DllNotFoundException ===&lt;br /&gt;
&lt;br /&gt;
* Check if the DLL file mentioned in the error actually exists in your project. If it doesn't, your Bakery installation is incomplete or corrupted; please reinstall it.&lt;br /&gt;
* Check if you're running 64-bit Unity Editor under 64-bit Windows (7 or newer) (as listed in [[Manual#System_requirements|system requirements]]).&lt;br /&gt;
* Make sure you have 64-bit [https://www.microsoft.com/en-us/download/details.aspx?id=48145 Visual C++ Redistributables for Visual Studio 2015] installed. In case if the Microsoft site download is broken, here is a [https://drive.google.com/file/d/1WfRP1A43bCwZflZ_I0wHSGPyC3b-0lqK/view?usp=sharing reupload].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Lightmap UVs are wrong when opening previously baked project on a Mac ===&lt;br /&gt;
&lt;br /&gt;
When Unity reimports model assets, it performs UV unwrapping. If you baked the scene with [[Manual#Unwrapper|Unwrapper]] was set to xatlas, it won't work on a Mac because Bakery's xatlas wrapper library is only compiled for Windows. Rebaking with Default unwrapper should fix it.&lt;br /&gt;
&lt;br /&gt;
You can still keep xatlas as the [[Manual#Atlas_Packer|Atlas Packer]].&lt;br /&gt;
&lt;br /&gt;
''Unwrapper'' is used to generate UVs for individual, isolated meshes, while ''Atlas Packer'' packs big scene-specific atlases out of many unwrapped layouts.&lt;br /&gt;
&lt;br /&gt;
Combining Default unwrapper with xatlas being used as the Atlas Packer and enabling [[Manual#Hole_filling|Hole Filling]] should give pretty good [https://x.com/guycalledfrank/status/1231890428313600000 results] and compensate for any individual mesh unwrapping inefficiencies.&lt;br /&gt;
&lt;br /&gt;
=== Error message &amp;quot;Failed to load OptiX library&amp;quot; ===&lt;br /&gt;
&lt;br /&gt;
Nvidia driver 590 (and newer) removed support for OptiX 6.0 which Bakery depended on. Bakery v1.98 added support for the new driver, now using OptiX 9.0.&lt;br /&gt;
* Make sure you're using a [[Manual#System_requirements|supported Nvidia GPU]].&lt;br /&gt;
* Update Bakery to v1.98 via the [https://assetstore.unity.com/packages/tools/level-design/bakery-gpu-lightmapper-122218 Asset Store], [[Github_access|github or the built-in patcher]].&lt;br /&gt;
* If you don't want to update Bakery, roll back your GPU driver to any pre-590 version (e.g. [https://www.nvidia.com/en-eu/geforce/drivers/results/257569/ 581.80]).&lt;/div&gt;</summary>
		<author><name>Mr F</name></author>
		
	</entry>
	<entry>
		<id>https://geom.io/bakery/wiki/index.php?title=Manual&amp;diff=1847</id>
		<title>Manual</title>
		<link rel="alternate" type="text/html" href="https://geom.io/bakery/wiki/index.php?title=Manual&amp;diff=1847"/>
		<updated>2025-12-24T16:24:49Z</updated>

		<summary type="html">&lt;p&gt;Mr F: /* Prerequisites */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== System requirements ==&lt;br /&gt;
To use Bakery you'll need:&lt;br /&gt;
* Windows (7 or higher) PC.&lt;br /&gt;
* Nvidia GPU. Minimum supported model is Kepler (GeForce 650 or newer. For Quadro cards check the specs).&lt;br /&gt;
* 64-bit Unity editor. Bakery was tested on all versions from 5.6 to 6 or higher.&lt;br /&gt;
&lt;br /&gt;
{{note|System requirements are for developer machine, not target platform. You can use lightmaps baked with Bakery anywhere.}}&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
* Make sure your project does not have any script compilation errors, as it will prevent Bakery scripts from compiling as well.&lt;br /&gt;
* Make sure you have the latest GPU driver. [https://www.nvidia.com/Download/index.aspx?lang=en-US Update it] if needed.&lt;br /&gt;
&lt;br /&gt;
'''Use the Game-Ready (standard) driver, not the &amp;quot;Studio&amp;quot; one.'''&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
1. Import Bakery to your project via [https://assetstore.unity.com/packages/tools/level-design/bakery-gpu-lightmapper-122218 Asset Store].&lt;br /&gt;
&lt;br /&gt;
2. Unity will show a list of files to import. If it's your first time using Bakery, it is recommended you just '''click Import'''. Experienced users may want to untick the ''examples'' folder for a more lightweight installation.&lt;br /&gt;
&lt;br /&gt;
Files will be imported to Assets/Bakery and Assets/Editor/x64/Bakery. These folders can be moved later.&lt;br /&gt;
&lt;br /&gt;
3. Unity will then import Bakery and compile the scripts. It may show a window like this:&lt;br /&gt;
&lt;br /&gt;
[[File:Goahead.png]]&lt;br /&gt;
&lt;br /&gt;
In which case you should click &amp;quot;Go Ahead&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
You should now see Bakery menu added to the editor:&lt;br /&gt;
&lt;br /&gt;
[[File:bmenu.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Quickstart ==&lt;br /&gt;
&lt;br /&gt;
1. Add some model or primitive and mark it as Static.&lt;br /&gt;
&lt;br /&gt;
'''Meshes must have non-overlapping UV for lightmapping. UV2 is used if present (otherwise UV1). If you did not unwrap models for lightmapping, make sure to check [https://docs.unity3d.com/Manual/LightingGiUvs-GeneratingLightmappingUVs.html Generate Lightmap UVs] on the asset.''' Unity primitives already have correct UV2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Staticmarked.jpg|320px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Select Directional Light (the one Unity created for you) and add '''Bakery Direct Light''' component to it.&lt;br /&gt;
{{note| Bakery and Unity use separate light source components.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Bakery Direct Light has many options to tweak, but you can easily match it to Unity light. Click '''Match lightmapped to real-time'''. Now Bakery light should have the same yellowish color as Unity’s default Directional.&lt;br /&gt;
&lt;br /&gt;
[[File:Matching.jpg|640px]]&lt;br /&gt;
&lt;br /&gt;
{{note| Direct Light component may complain about project not using linear light intensity. The problem is that by default Unity applies gamma correction to light source colors [https://twitter.com/guycalledfrank/status/1001108508614553600 incorrectly]. Correct mode can be enabled by [https://docs.unity3d.com/ScriptReference/Rendering.GraphicsSettings-lightsUseLinearIntensity.html scripting], and that’s what the “Fix” button does. If you already have many light sources set up in non-linear intensity mode, and you don’t want to change them again, you may skip fixing. Even if you press “Fix”, you can always revert the change anytime.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. To get shadowed ambient lighting, create Skylight (Bakery-&amp;gt;Create-&amp;gt;Skylight).&lt;br /&gt;
&lt;br /&gt;
[[File:Menusky.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Select Skylight, give it some bluish color and click '''Match scene skybox to this light'''. This will make scene skybox match lighting exactly.&lt;br /&gt;
{{note| Matching Unity skybox to Bakery skylight is optional but useful for correctness, as to ensure that visible environment and in-engine reflection probes match baked lighting. Currently this option only works for Standard render pipeline.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Skycomp.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Click Bakery-&amp;gt;Render Lightmap. By default, Full Lighting mode is active. It will bake both direct and indirect contribution from all lights. If you want to combine real-time shadows with baked GI, change it to '''Indirect'''.&lt;br /&gt;
&lt;br /&gt;
[[File:Bakerywindow.jpg]]&lt;br /&gt;
&lt;br /&gt;
{{note| Bakery may complain that you are using old [https://docs.unity3d.com/Manual/LinearLighting.html gamma mode] and suggest to change it. If you care about quality of lighting, using Linear mode is highly recommended. You may ignore it if you already have a big project set up with incorrect gamma and don’t want to change it or when shipping to mobile devices that don't support it.}}&lt;br /&gt;
&lt;br /&gt;
7. Click '''Render'''.&lt;br /&gt;
&lt;br /&gt;
8. Done! You should now have baked GI:&lt;br /&gt;
&lt;br /&gt;
[[File:Bakedgi.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Render settings ==&lt;br /&gt;
&lt;br /&gt;
All render settings can be accessed via Bakery-&amp;gt;Render Lightmap. Settings are saved for every scene. The topmost option in Bakery window allows you to switch between Simple, Advanced and Experimental settings, each succeeding mode revealing more tweakable options. Simple mode is enough for most scenes and it's a good way to get started.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render mode ===&lt;br /&gt;
Defines the type of lightmaps to bake. &lt;br /&gt;
&lt;br /&gt;
===== Full Lighting =====&lt;br /&gt;
Complete direct and indirect lighting for all Bakery lights.&lt;br /&gt;
{{note| On pre-2017.3 Unity versions if you have both Unity and Bakery components on the same object, you will need to disable Unity ones manually to avoid double brightness. On newer versions real-time effects are automatically disabled for baked lights, as with built-in lightmappers.}}&lt;br /&gt;
&lt;br /&gt;
===== Indirect =====&lt;br /&gt;
[[File:Image26.png|thumb|Comparison of different render modes supported by Unity]]&lt;br /&gt;
Basic mixed mode. It will look at the Baked Contribution selector on every light: if it’s set to ''Direct And Indirect'', the light is baked as in Full Lighting mode. If it’s set to ''Indirect Only'', only indirect contribution (GI) from this light is baked. In latter case you should keep both Unity and Bakery lights on the object, one giving real-time direct contribution, and another for precomputed GI.&lt;br /&gt;
&lt;br /&gt;
[[File:Indirectonly.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== Shadowmask =====&lt;br /&gt;
[[File:Image21.png|thumb|Left: completely baked light. Center: dynamic light with baked GI. Right: capsule shadow, bump and specular are dynamic, but cube shadow and GI are baked.]]&lt;br /&gt;
[[File:Image6.png|thumb|When camera gets far away enough or if dynamic shadows are disabled, the same scene will look like this]]&lt;br /&gt;
A more advanced mixed mode. It works by generating two types of lightmaps - one with baked color (as in Indirect mode), and another with shadows from static objects. It has several benefits:&lt;br /&gt;
* Real-time shadows can render only a handful of dynamic objects, instead of the whole scene.&lt;br /&gt;
* Real-time and baked shadows blend together properly.&lt;br /&gt;
* Real-time lights can render bump, specular and other surface effects, while still being occluded by high-quality baked shadows.&lt;br /&gt;
[https://docs.unity3d.com/Manual/LightMode-Mixed-Shadowmask.html More details]&lt;br /&gt;
&lt;br /&gt;
To enable this behaviour, you must have both Unity and Bakery lights on the same object, with Baked Contribution set to ''Shadowmask and Indirect''. Unmarked lights will be baked as in Indirect mode.&lt;br /&gt;
&lt;br /&gt;
[[File:Smask22.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== Distance Shadowmask =====&lt;br /&gt;
This checkbox is only visible if you chose shadowmask and simply toggles [https://docs.unity3d.com/Manual/LightMode-Mixed-ShadowmaskMode.html equally named setting] in project’s Quality Settings.&lt;br /&gt;
[https://docs.unity3d.com/Manual/LightMode-Mixed-DistanceShadowmask.html More details.]&lt;br /&gt;
{{note| Checkbox is not visible on Unity 5.6.x due to the lack of corresponding scripting API. Instead you can toggle it in Window-&amp;gt;Lighting-&amp;gt;Mixed Lighting-&amp;gt;Lighting Mode.}}&lt;br /&gt;
{{note| On Unity versions &amp;lt; 2017.3 rendering Shadowmask lightmaps will clear the light probes due to API limitations. They will need to be re-rendered again after bake. It shouldn’t happen on newer versions.}}&lt;br /&gt;
&lt;br /&gt;
===== Subtractive =====&lt;br /&gt;
Enables [https://docs.unity3d.com/Manual/LightMode-Mixed-Subtractive.html Subtractive] lighting mode. &lt;br /&gt;
&lt;br /&gt;
This option does not do anything special to lightmaps and, in fact, works just like Full Lighting.&lt;br /&gt;
&lt;br /&gt;
The only difference is that it also sets up real-time Unity lights to work with Subtractive mode (as it cannot be done through UI).&lt;br /&gt;
&lt;br /&gt;
You will need to additionally set up global subtractive parameters (like the global shadow color) in [https://docs.unity3d.com/Manual/GlobalIllumination.html#MixedLighting Unity lighting window].&lt;br /&gt;
&lt;br /&gt;
===== Ambient Occlusion Only =====&lt;br /&gt;
Only bakes AO. May be useful if you know what you're doing. Make sure to set up [[#Ambient_occlusion|AO options]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Directional mode ===&lt;br /&gt;
[[File:Image3.png|thumb|Comparison of different directional modes]]&lt;br /&gt;
Defines how directional information is baked. Standard lightmaps only store a single color per texel, while directional lightmaps give shaders a hint of how lighting changes over a hemisphere around the texel. This data is required to combine fully lightmapped areas with normal maps. Plugging it into the built-in [[#Bakery_shaders|Bakery shader]] can also produce approximate specular response.&lt;br /&gt;
&lt;br /&gt;
===== None =====&lt;br /&gt;
No directional data, single color per texel.&lt;br /&gt;
&lt;br /&gt;
===== Baked Normal Maps =====&lt;br /&gt;
Still no directional data, but normal maps are taken into account when rendering the lightmap. There is no additional runtime overhead. Since lightmaps usually have lower resolution than normal maps, the result may look blurry. Other problems include aliasing at distance due to lack of mipmapping and denoising step potentially smudging the detail. To learn how to use custom shaders with procedural normals in this mode, read [[#Normal_mapping|Normal Mapping]] section.&lt;br /&gt;
&lt;br /&gt;
===== Dominant Direction =====&lt;br /&gt;
This mode is similar to what Enlighten and Progressive bake in Unity. It is compatible will most shaders, only generates one additional map and the runtime overhead is minimal. The downside is that bump-mapping looks rather faint and gray-ish and can be quite different comparing to the same object under real-time lighting.&lt;br /&gt;
&lt;br /&gt;
===== RNM =====&lt;br /&gt;
Based on Radiosity Normal Mapping technique originally invented for HL2 ([https://steamcdn-a.akamaihd.net/apps/valve/2004/GDC2004_Half-Life2_Shading.pdf slides]) and later used in many games (e.g. Mirror’s Edge). It generates 3 HDR maps in total, being the most memory-demanding mode of all. Runtime overhead is still relatively low. This mode is more precise than Dominant Direction. It is better at reproducing surface contrast and handling colored lights affecting normal maps from different angles.&lt;br /&gt;
&lt;br /&gt;
===== SH =====&lt;br /&gt;
Based on “Precomputed Global Illumination in Frostbite” [https://media.contentapi.ea.com/content/dam/eacom/frostbite/files/gdc2018-precomputedgiobalilluminationinfrostbite.pdf paper]. This is the highest quality mode, giving much better surface contrast and representing differently colored lighting coming from different directions. Generates 4 maps in total, only one of them being HDR, therefore takes less memory than RNM. Runtime overhead is slightly higher than that of RNM.&lt;br /&gt;
&lt;br /&gt;
===== MonoSH =====&lt;br /&gt;
[[File:FY8Ru8hWIAAdYYH.jpg|thumb|Size/quality comparison of Dominant Direction, full SH and MonoSH]]&lt;br /&gt;
Same as SH, but using a monochromatic L1 directional coefficients. Similarly good surface contrast, although not accurately representing different colors shining from different directions at one texel; but good enough for many scenes. Only generates one additional map, so the VRAM usage/bandwidth is similar to Dominant Direction; in fact it's even smaller, due to Dominant Direction using RGBA maps, while MonoSH only needing RGB. The map is fed via the built-in directional lightmap system, but ''won't look correct with standard shaders''. Make sure to use a compatible shader.&lt;br /&gt;
&lt;br /&gt;
===== Limitations =====&lt;br /&gt;
&lt;br /&gt;
* RNM and SH/MonoSH can be only used with [[#Bakery_shaders|Bakery shader]] or require adjustments to your shaders.&lt;br /&gt;
* In RNM and SH modes, standard color lightmaps are not created. You need to either have Bakery shader on all materials in the scene, or use [[#Bakery_Lightmap_Group_Selector|Lightmap Groups]] to separate RNM/SH objects from the rest.&lt;br /&gt;
* RNM and SH maps are applied to objects using [https://docs.unity3d.com/ScriptReference/MaterialPropertyBlock.html MaterialPropertyBlock] and so may be not shown completely in Unity’s Lighting window.&lt;br /&gt;
* Dominant Direction, RNM and SH/MonoSH modes may require slightly more samples for GI and Light Meshes to get comparable quality.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Texels per unit ===&lt;br /&gt;
[[File:Texelscomp.jpg|thumb|1 vs 10 texels per unit]]&lt;br /&gt;
Approximate amount of lightmap texels per world unit. Affects the amount and resolution of generated lightmaps.&lt;br /&gt;
&lt;br /&gt;
Example values to get you started:&lt;br /&gt;
* Large outdoor area (a city): 1 - 5&lt;br /&gt;
* Medium outdoor area (a few alleys): 10-20&lt;br /&gt;
* High quality interior: 100&lt;br /&gt;
&lt;br /&gt;
It is assumed that scene scale is roughly 1 unit = 1 meter. Such scale is generally recommended when working in Unity for better navigation and for physics simulation. If your scale is different, multiply Texels accordingly.&lt;br /&gt;
&lt;br /&gt;
Keep in mind that Texels Per Unit is base resolution, but every object can be additionally tweaked using [https://docs.unity3d.com/Manual/class-MeshRenderer.html Scale in Lightmap] option on Mesh Renderers as well as [[#Scale per map type|Scale per map type]] in Bakery window.&lt;br /&gt;
&lt;br /&gt;
{{note| Objects with Scale in Lightmap set to 0 will not be baked, but will still cast shadows and affect GI.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Max resolution ===&lt;br /&gt;
Maximum lightmap size limit. If objects can't fit in a single lightmap (given current Texels Per Unit value), additional lightmaps will be allocated. Same 4 square objects can take four 512x512 maps or one 1024x1024.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bounces ===&lt;br /&gt;
[[File:Image36.png|thumb|Note how more bounces bring more light to closed spaces.]]&lt;br /&gt;
Defines how many times light rays should bounce off surfaces. Usually lower values are sufficient for outdoor scenes (e.g. a city), while higher values are required for more closed scenes (interiors, caves).&lt;br /&gt;
&lt;br /&gt;
While the slider is limited by 5 bounces, it is possible to type any amount of bounces into the number field.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Samples ===&lt;br /&gt;
[[File:Image7.png|thumb|Left: samples = 4, right: samples = 16. Denoising is off for illustrative purposes.]]&lt;br /&gt;
Affects quality of GI. Typical values are from 16 to 32.&lt;br /&gt;
&lt;br /&gt;
{{note| It is possible to type in any number, beyond the maximum slider value, but be aware that this number represents a square root of the final ray count, i.e. 32 is 1024 rays, 64 is 4096 rays, etc.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GPU Priority ===&lt;br /&gt;
While GPU is working on lightmaps, OS and other software may become less responsive. This option allows you to balance between baking speed and system responsiveness.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render ===&lt;br /&gt;
Bakes lightmaps for all opened scenes.&lt;br /&gt;
If [[Manual#Light_probe_mode|Light Probe Mode]] is set to L1 or L2, also bakes light probes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Render Light Probes ===&lt;br /&gt;
Bakes [https://docs.unity3d.com/Manual/LightProbes.html light probes] for all opened scenes.&lt;br /&gt;
&lt;br /&gt;
Note that to get correct mixed light shadowing on dynamic objects in Shadowmask mode you also need to enable [[Manual#Occlusion_probes|occlusion probes]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Render Reflection Probes ===&lt;br /&gt;
Bakes [https://docs.unity3d.com/Manual/class-ReflectionProbe.html reflection probes] for all opened scenes. This button is just for convenience and will call built-in engine reflection probe update.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update Skybox Probe ===&lt;br /&gt;
Bakes global diffuse and reflection probe for the current skybox. As with &amp;quot;Render Reflection Probes&amp;quot;, it just calls built-in engine functions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Occlusion probes ===&lt;br /&gt;
When rendering light probes, lets Unity bake occlusion probes using currently selected built-in lightmapper. Occlusion probes is additional data stored inside regular light probes, and it prevents dynamic objects from getting lit in shadowed areas. Currently there is no way to use custom occlusion probes in Unity, and it has to call its own lightmappers instead to do the job.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Warnings ===&lt;br /&gt;
These options will validate the scene after one of the Render buttons is pressed and show warning dialog boxes asking to continue or stop the baking process.&lt;br /&gt;
* Suppress all popups: don't show any dialog boxes after pressing Render.&lt;br /&gt;
* UV validation: will check if all models have fully correct lightmapping UVs - specifically if they lie within 0-1 range and don’t overlap.&lt;br /&gt;
* Overwrite check: will tell which lightmap files are going to be overwritten.&lt;br /&gt;
* Memory check: will tell a very approximate amount of video memory required.&lt;br /&gt;
* Sample count check: will check if any lights, GI or AO have unreasonable sample counts that can make GPU go out of available resources.&lt;br /&gt;
* Lightmapped prefab validation: validates Lightmapped Prefabs and notifies if some prefabs are going to be overwritten.&lt;br /&gt;
&lt;br /&gt;
== Advanced render settings ==&lt;br /&gt;
=== Light probe mode ===&lt;br /&gt;
Changes the way light probes are baked.&lt;br /&gt;
&lt;br /&gt;
* Legacy:  use Render Light Probes button to generate the probes. Point and directional lights are calculated within the lightmapper, while area/sky/indirect lighting is gathered by rendering a cubemap at each probe position. Results are stored as [https://docs.unity3d.com/ScriptReference/Rendering.SphericalHarmonicsL2.html L2 spherical harmonics]. The downsides are slow cubemap rendering performance and possible mismatch between lightmaps and probes in cases where shaders in your game do not physically represent lit surfaces or your project is set up for mobile (Unity can clip high intensity values away).&lt;br /&gt;
&lt;br /&gt;
* L1: light probes will be rendered together with lightmaps when you click Render. This option provides superior baking performance and will guarantee that probe lighting matches the lightmaps. Results are stored as L1 spherical harmonics (can be still used by regular shaders). Results can be further improved by using Non-Linear Light Probe SH option in [[#Bakery_shaders|Bakery shader]].&lt;br /&gt;
&lt;br /&gt;
* L2: superior quality (full L2 spherical harmonics). As with L1, automatically rendered together with lightmaps. Negligible performance impact compared to L1. Should look OK with all shaders. Probe contrast/directionality/ringing removal can be tweaked via Project Settings -&amp;gt; Bakery -&amp;gt; &amp;quot;Ringing removal for L2 light probes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''There seems to be a bug in Unity 2019.3 preventing Legacy light probe colors from being properly saved IF [[Manual#Occlusion_probes|occlusion probes]] option is enabled. L2 mode is now default and recommended when using occlusion probes.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Asset UV Processing ===&lt;br /&gt;
Configures UV padding adjustment for assets. Possible values:&lt;br /&gt;
* Don't change: don't touch the assets.&lt;br /&gt;
* Adjust UV padding: will look for models with auto-generated UVs (“Generate Lightmap UVs” on the asset) and adjust them further to have proper padding between UV islands per-mesh. Model-wide Pack Margin in importer settings is ignored. Optimal values are calculated instead, given area of each mesh and lightmap resolution.&lt;br /&gt;
* Adjust UV padding for new meshes only: same, but skips any models that were previously adjusted at least once.&lt;br /&gt;
* Remove UV adjustments: reverts all previous UV adjustments, makes auto-unwrapped models look they way Unity originally unwrapped them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser ===&lt;br /&gt;
Sets the desired denoiser. Possible values:&lt;br /&gt;
* Optix 5: uses OptiX 5.1 AI denoiser (previously known as &amp;quot;Legacy denoiser&amp;quot;). Runs on the GPU. Supported on everything from [https://en.wikipedia.org/wiki/Kepler_(microarchitecture) Kepler] (typically GeForce 6xx) to [https://en.wikipedia.org/wiki/Turing_(microarchitecture) Turing] (typically Geforce 20xx). Not supported on [https://en.wikipedia.org/wiki/Ampere_(microarchitecture) Ampere] (30xx). OptiX 5.1 uses a static training dataset which is embedded into it, meaning it is not affected by the driver implementation.&lt;br /&gt;
* Optix 6: uses OptiX 6.0 AI denoiser (previously the default option). Runs on the GPU. Seems to fail on Kepler (6xx) GPUs, but runs on everything newer, including Ampere (30xx). Since 6.0 the training dataset for the OptiX denoiser is in the driver. Before driver v442.50 its behaviour was similar to OptiX 5.1; however, after it NVIDIA has [https://forums.developer.nvidia.com/t/optix7-denoiser-different-results-with-different-version-of-drivers/117989/2 changed the dataset], and results can be different. The updated dataset may sometimes produce grid-like patterns and more bright edges (still fixable with [[Manual#Denoise:_fix_bright_edges|&amp;quot;Denoise: fix bright edges&amp;quot;]]), but it runs faster.&lt;br /&gt;
* Optix 7: uses OptiX 7.2 AI denoiser. Behaves similarly to OptiX 6.0, but might be better supported on Ampere (30xx).&lt;br /&gt;
* OpenImageDenoise: uses Intel Open Image Denoise library. Runs on the CPU (any CPU that supports SSE 4.1). Can be slightly slower than OptiX, but the quality is comparable.&lt;br /&gt;
* OpenImageDenoise2: uses Intel Open Image Denoise 2, CUDA mode. Runs on the GPU, performance is comparable to OptiX 6/7, quality is identical to the CPU version.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Adjust sample positions ===&lt;br /&gt;
Find best sample positions to prevent lighting leaks. Details of the algorithm are outlined [https://ndotl.wordpress.com/2018/08/29/baking-artifact-free-lightmaps/#leaks here]. In some cases (usually large and very low poly geometry with smooth normals) it may produce incorrect results, in which case you can disable it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Unload scenes before render ===&lt;br /&gt;
Unloads Unity scenes before baking to free up video memory. Complex scenes can take a few gigabytes of VRAM by simply being shown in editor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Denoise ===&lt;br /&gt;
[[File:Image31.png|thumb|Left: denoising off, right: denoising on.]]&lt;br /&gt;
If enabled, will apply denoising algorithm. Bakery uses [https://developer.nvidia.com/optix-denoiser Nvidia’s AI denoiser (OptiX)] or Intel's Open Image Denoise (if selected).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Fix Seams ===&lt;br /&gt;
[[File:Image22.png|thumb|Left: seams, right: seams are fixed.]]&lt;br /&gt;
If enabled, will attempt to blend seams created by UV discontinuities. Useful for smooth geometry, including Unity’s default sphere.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Split by scene ===&lt;br /&gt;
If multiple scenes are loaded at once, and this option is enabled, each scene will have its own set of lightmaps, not shared with others. It can be useful for limiting the amount of textures loaded when scenes are streamed at runtime.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hole filling ===&lt;br /&gt;
[[File:Holefilling.jpg|thumb|Hole filling off vs on.]]&lt;br /&gt;
If [[Manual#Atlas_Packer|Atlas Packer]] is set to xatlas, will try to fill every hole, resulting in more efficient atlases. For scenes with very complex geometry it can increase scene export time, but otherwise recommended.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Min resolution ===&lt;br /&gt;
Minimum lightmap size limit. Can be used to balance between many small but fully occupied lightmaps vs few incompletely filled.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Scale per map type ===&lt;br /&gt;
Allows you to scale the resolution of color/shadowmask/direction maps differently. For example, a common case would be to have low resolution indirect color but highly detailed shadowmask. Note that scaling is applied after the lightmaps are rendered, so it won’t save baking time. If “Adjust UV padding” is on, padding will be based on the lowest resolution map to prevent texel leaking.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Checker preview ===&lt;br /&gt;
[[File:Image12.png|thumb|Checker preview in action]]&lt;br /&gt;
If Show checker checkbox is on, Scene View will render a checkerboard pattern on top of visible objects to demonstrate lightmap texel size. This is useful to make sure you are using adequate values for Texels Per Unit and other resolution-affecting settings before you bake.&lt;br /&gt;
&lt;br /&gt;
Enabling checker preview will force Bakery to perform atlas packing. It can take some time, but shouldn’t be longer than a few seconds. Press Refresh checker to re-atlas the scene after you changed something to see changes.&lt;br /&gt;
&lt;br /&gt;
Checker preview also uses random colors to show how the scene will be split into different lightmaps.&lt;br /&gt;
&lt;br /&gt;
{{note| Checker preview currently does not show correct texel sizes for Terrains.}}&lt;br /&gt;
&lt;br /&gt;
==== Atlas preview ====&lt;br /&gt;
[[File:FN-TmhRXwAE9i2I.png|thumb|Atlas preview in action]]&lt;br /&gt;
Atlas preview button is visible when Checker preview is on. Clicking it will open a new window where the UV layouts of future lightmaps are shown. Click &amp;quot;&amp;lt;&amp;quot; &amp;quot;&amp;gt;&amp;quot; buttons to browse the lightmaps.&lt;br /&gt;
This is useful for checking out packing quality and lightmap count before baking.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Emissive boost ===&lt;br /&gt;
Multiplies any surface emission by this number.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Indirect boost ===&lt;br /&gt;
Multiplies all bounced lighting by this number. Same as Indirect Intensity on light components, but global.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Backface GI ===&lt;br /&gt;
[[File:Image30.jpg|thumb|Backface GI]]&lt;br /&gt;
[[File:Image35.png|thumb|Left: backface GI = 0, right: backface GI = 1. Note how shadowed areas receive more green lighting.]]&lt;br /&gt;
Determines how much light is passed through front faces to back faces and then bounced off by GI. This is especially useful for thin translucent surfaces like leaves. Values are in 0-1 range.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Ambient occlusion ===&lt;br /&gt;
[[File:Image15.png|thumb|Left: AO intensity = 0. Right: AO intensity = 1.]]&lt;br /&gt;
Simple non-physical ambient occlusion you can apply over final scene lighting for aesthetic purposes.&lt;br /&gt;
* Intensity: controls visibility of the AO effect. Value of 0 disables the effect.&lt;br /&gt;
* Radius: determines the ray distance used in the AO effect. Smaller values give localized occlusion (corners, wrinkles), while larger values make it more similar to Skylight, giving shadows from distant objects.&lt;br /&gt;
* Samples: affects the quality of ambient occlusion. Typical values are from 4 to 32.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dither transparency ===&lt;br /&gt;
Enables semi-transparent shadows by automatically dithering alpha textures. See [[Manual#Opacity|how Bakery interprets opacity maps]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== RTX Mode ===&lt;br /&gt;
Enables RTX hardware acceleration. Only RTX GPUs will benefit from this option. Minimum supported driver version is 418.&lt;br /&gt;
&lt;br /&gt;
Drivers can emulate RTX mode on most non-RTX Nvidia cards, but the result is usually slower.&lt;br /&gt;
&lt;br /&gt;
RTX mode '''must''' be enabled on Ampere (3xxx) or newer cards.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Export terrain trees ===&lt;br /&gt;
If enabled, painted terrain trees will affect lighting. Trees themselves will not be baked. Note that highest possible LOD level is used for every tree during baking. It is not recommended to use this option for rendering multi-kilometer forests with highly detailed models.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Terrain optimization ===&lt;br /&gt;
If enabled (default), Terrains use separate ray tracing technique to take advantage of their heightfield geometry. Otherwise they are treated like any other mesh. Terrain optimization significantly reduces memory footprint required for high-resolution landscapes. In some cases it can also make terrain baking faster, in other cases (especially with simple low-resolution landscapes) it might make sense to disable it.&lt;br /&gt;
&lt;br /&gt;
{{note| Terrain Optimization is not currently compatible with painted terrain holes. Disable it to make them work.}}&lt;br /&gt;
{{note| Terrain Optimization is only supported in non-RTX mode.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Light Mesh batch limit ===&lt;br /&gt;
If this value is above 0, combines many [[Manual#Bakery_Light_Mesh|Light Meshes]] into one, given they have identical settings and affect the same [[Manual#Bakery_Lightmap_Group_Selector|Lightmap Groups]], but limiting their total sample count to this value (I.e. if the limit is 64, it can combine 2 lights with samples=32 or 4 lights with samples=16, etc). This will increase performance in scenes with many Light Meshes. Be careful setting this value too high, as the GPU may hit the OS driver timeout while processing too many samples at once.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Compress volumes ===&lt;br /&gt;
If enabled, applies texture compression to volume 3D textures and switches Bakery shaders to a corresponding sampling mode. Not recommended for very low resolution volumes. Volume size may be increased to be a multiple of 4.&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
* Currently it can only compress to BC6H/BC7 texture formats (desktop/consoles).&lt;br /&gt;
* Volume compression is only supported on Unity 2020.1 or newer.&lt;br /&gt;
* Currently only Bakery shader for the standard rendering pipeline supports using compressed volumes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Samples multiplier ===&lt;br /&gt;
Multiplies all shadow and GI samples by the specified factor. Use it to quickly change between draft and final quality.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Tile size ===&lt;br /&gt;
Same as [[#GPU Priority|GPU Priority]], but instead of abstract priority you set tile size. Bakery splits lightmaps into smaller tiles and updates one at a time. Smaller size means more GPU work interruptions, and can make system more responsive.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Temp path ===&lt;br /&gt;
Temporary files folder. Bakery may require a few gigabytes of free space during rendering. Having this folder on SSD can make rendering slightly faster comparing to HDD. At the moment, this folder is not cleaned automatically. You can delete its contents anytime (except during rendering) manually or via Bakery -&amp;gt; Utilities -&amp;gt; Clear cache.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Output path ===&lt;br /&gt;
Lightmap folder. This is where all lightmap, and also lightprobe and vertex color assets will be saved. This path is relative to your Assets folder.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Use scene named output path ===&lt;br /&gt;
If this option is enabled, output path will be automatically set to a folder with the same name as the currently active scene (Assets/CurrentSceneName/). This is similar to how built-in Unity lightmappers behave.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render Selected Groups ===&lt;br /&gt;
Only bakes [[#Bakery_Lightmap_Group_Selector|Lightmap Groups]] containing selected objects.&lt;br /&gt;
Not only selected objects will be redrawn, but all Lightmap Groups they belong to. Other lightmaps will not be updated. If objects are not a part of some manually assigned group, then a part of the scene using the same lightmap will be rebaked.&lt;br /&gt;
&lt;br /&gt;
Currently it is more convenient to use [[Partial_scene_baking|Sectors for partial scene baking]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Beep on finish ===&lt;br /&gt;
If enabled, Bakery will play a sound when the bake is finished.&lt;br /&gt;
&lt;br /&gt;
== Experimental render settings ==&lt;br /&gt;
=== Unwrapper ===&lt;br /&gt;
If [[#Asset_UV_Processing|Adjust UV Padding]] is enabled, defines the unwrapper that will be used.&lt;br /&gt;
* Default: standard Unity unwrapper. Bakery will call [https://docs.unity3d.com/ScriptReference/Unwrapping.GenerateSecondaryUVSet.html Unwrapping.GenerateSecondaryUVSet] for every mesh with different padding parameters.&lt;br /&gt;
* xatlas: uses [https://github.com/jpcy/xatlas xatlas] by [https://github.com/jpcy jpcy], a modified version of [https://github.com/Thekla/thekla_atlas thekla_atlas] by [https://github.com/castano Ignacio Castaño]. thekla_atlas was used in The Witness ([http://the-witness.net/news/2010/03/graphics-tech-texture-parameterization/ blog post]).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Atlas Packer ===&lt;br /&gt;
Selects the algorithm to use when packing different object UV layouts into large lightmap atlases.&lt;br /&gt;
* Default: original algorithm Bakery used before v1.7.&lt;br /&gt;
* xatlas: uses xatlas.&lt;br /&gt;
&lt;br /&gt;
Some features are only supported with one atlas packer:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Default&lt;br /&gt;
! xatlas&lt;br /&gt;
|-&lt;br /&gt;
| [[Manual#Bakery_Lightmap_Group_Selector|Override resolution]]&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
|-&lt;br /&gt;
| Efficient LOD packing&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Manual#Hole_filling|Hole filling]]&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that atlas packer can be also chosen separately for every Lightmap Group.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Export geometry and maps ===&lt;br /&gt;
If enabled, Bakery will export the scene to its format before rendering. If you are sure that geometry and textures of the scene and lightmap resolution settings were not changed (e.g. you are only tweaking GI or light settings), you can disable this checkbox to make next rendering faster.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update unmodified lights ===&lt;br /&gt;
If enabled, Bakery will recalculate light sources that didn’t change since last rendering. If you are only tweaking one light and don’t want to wait for other lights to re-render, you can disable this checkbox.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update modified lights and GI ===&lt;br /&gt;
If enabled, Bakery will recalculate GI and lights that were changed since last rendering.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== UV padding: increase only ===&lt;br /&gt;
Only visible if [[#Asset_UV_Processing|Adjust UV padding]] is on. By default, optimal UV padding for a model asset is calculated only based on currently loaded scenes. If there are multiple instances of the same model using different lightmap resolution, the smallest one will define padding, so spacing between UV charts is large enough to prevent them from leaking over each other. However, baking the same model in 2 different isolated scenes will possibly break UVs in previous scenes while optimizing for the new one. This checkbox allows to prevent such behaviour by never decreasing the padding value, so it will be always optimized for the lowest resolution instance ever baked.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoise: fix bright edges ===&lt;br /&gt;
[[File:Image19.png|thumb|Left: a bright edge is visible after denoising; Right: fixed.]]&lt;br /&gt;
Only visible if [[#Denoise|Denoise]] is on. Sometimes the neural net used for denoising may produce bright edges around shadows, like if a sharpening effect was applied. If this option is enabled, Bakery will try to filter them away. Denoising stage may get slightly slower, when enabled.&lt;br /&gt;
&lt;br /&gt;
This feature may also be used to filter &amp;quot;fireflies&amp;quot;, i.e. occasional bright dots from the lightmap.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Post-packing ===&lt;br /&gt;
Sometimes when rendering a scene, Bakery can split the lightmap into multiple sub-lightmaps, e.g. when baking different LODs or terrains.&lt;br /&gt;
Post-packing tries to minimize final atlas count by combining these sub-lightmaps in one texture.&lt;br /&gt;
It is recommended to keep this option enabled.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Combine with Enlighten real-time GI ===&lt;br /&gt;
If enabled, then when the Render button is pressed, it will first try to bake with Enlighten to calculate real-time GI. After that, regular Bakery lightmapping process will happen. Both baked and real-time GI will work together.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bake on remote server ===&lt;br /&gt;
Enables [[Network baking|network baking]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Presets ===&lt;br /&gt;
Currently shown under Render/Update buttons when settings are in Experimental mode.&lt;br /&gt;
* Click '''New''' to save all current settings to a preset file.&lt;br /&gt;
* By default, when a preset is active, all settings are grayed out to prevent overwriting the preset.&lt;br /&gt;
* Click '''Modify preset''' to be able to change settings and overwrite the preset.&lt;br /&gt;
* Presets can be swapped via the preset field. Disable preset usage by setting it to None.&lt;br /&gt;
&lt;br /&gt;
== Components ==&lt;br /&gt;
=== Bakery Lightmap Group Selector ===&lt;br /&gt;
&lt;br /&gt;
Specifies which '''Lightmap Group''' to use for the object and all of its children.&lt;br /&gt;
Lightmap Group is a term Bakery uses for a collection of objects sharing one lightmap. Groups have properties telling Bakery how to pack the objects, which lights should affect them, should the result be baked into a texture or vertices.&lt;br /&gt;
By default all static objects are automatically packed into multiple lightmaps groups (atlases), so you don’t have to worry. Defining groups manually should be only used for special purposes, for example:&lt;br /&gt;
* Marking certain objects use [[Vertex Lightmaps|per-vertex lightmap]] instead of textures.&lt;br /&gt;
* Baking a lightmap using exact unscaled UVs as they were in a modeling package.&lt;br /&gt;
* Grouping certain areas of the level to use single lightmap to facilitate resource streaming or to switch different baked lighting at runtime via scripts.&lt;br /&gt;
* Using Render Selected Groups button to only update grouped objects.&lt;br /&gt;
&lt;br /&gt;
To manually define a group, you create '''Lightmap Group Assets''', either by using Assets-&amp;gt;Create menu, or using the Create New button in the component. When using the Create New button, new asset will be created based on these forms:&lt;br /&gt;
* Name: name of the Lightmap Group Asset to create.&lt;br /&gt;
* Packing mode: this selector defines the packing mode of the Lightmap Group. There are 3 modes:&lt;br /&gt;
** Original UV: object and its children will be baked with unmodified UVs. No packing is performed. This is useful for models when multiple meshes share the same already packed UV layout.&lt;br /&gt;
** Pack Atlas: object and its children are packed into a dedicated texture atlas. Before v1.3 every packable child needed to have the component, but it’s no longer necessary. Every child will be packed as its own rectangle, except when Bakery auto-detects a child having non-overlapping sub-children, in which case multiple objects can use a single rectangle.&lt;br /&gt;
** Vertex: object and its children will use vertex-colored baked lighting instead of textures. Note that you’ll need a custom shader for this to work, like [[#Bakery_shaders|Bakery Shader]]. One simple shader (&amp;quot;Bakery/Simple Vertex Lightmapped&amp;quot;) is also included for demonstration and reference. [[Vertex Lightmaps|Learn more about vertex lightmaps.]]&lt;br /&gt;
* Directional mode: allows you to override [[#Directional mode|directional mode]] on the group. Options are the same except for Auto, which will simply use the global setting.&lt;br /&gt;
* Resolution: desired lightmap resolution.&lt;br /&gt;
* Auto-resolution: use [[Manual#Texels_per_unit|Texels Per Unit]] to determine closest power-of-two resolution.&lt;br /&gt;
* Atlas packer: select [[Manual#Atlas_Packer|atlas packing]] algorithm for this group.&lt;br /&gt;
* Bitmask: a list of toggles used to exclude light sources from affecting the lightmap. Every Bakery light source also has a bitmask setting. Lights only affects Lightmap Groups with which they share at least one of these toggles. Default settings mean all lights affect all lightmaps.&lt;br /&gt;
&lt;br /&gt;
[[File:Ts.jpg|thumb|Transparent selfshadow OFF vs ON: note how some single-sided but back-facing polygons become properly lit]]&lt;br /&gt;
&lt;br /&gt;
If you have a Lightmap Group with the Pack Atlas mode assigned, additional settings will appear on the component:&lt;br /&gt;
* Override resolution: override the resolution this object and its children occupy in the lightmap.&lt;br /&gt;
* Resolution: manually defined resolution. For example, if you have a lightmap with a resolution of 512 and it is assigned to 4 objects with override resolution set to 256, Bakery will generate a single 512x512 lightmap where each object takes exactly 256x256 square.&lt;br /&gt;
&lt;br /&gt;
If you select a Lightmap Group asset, additional experimental settings will be visible:&lt;br /&gt;
* [[Subsurface scattering|Subsurface scattering: (click to read more)]]&lt;br /&gt;
* Normal offset: allows you to offset rays from the surface. This is rarely useful and mostly present for experimental purposes.&lt;br /&gt;
* Transparent selfshadow: start rays behind the surface so it doesn't cast shadows on self. Might be useful for translucent foliage.&lt;br /&gt;
* Vertex sampling density (only if Packing Mode is set to Vertex): by default per-vertex bakes only compute 1 value for every vertex; if sampling density is &amp;gt; 0, it will instead average many samples scattered across triangles, yielding super-sampled, smoother results.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Lightmapped Prefab ===&lt;br /&gt;
This component allows prefabs to store lightmapping metadata. Such prefabs can be then instantiated in any scene, both in editor and at runtime.&lt;br /&gt;
The component should be added directly to the root object of the prefab. Nested prefabs are not supported. Because the prefab is going to be overwritten after bake (the same way as when the “Apply” button is pressed), it is required that the prefab does not have any unapplied changes (child objects shouldn’t be moved, materials and script parameters should be unchanged, etc). If such changes are detected, an error will be printed in the component UI and no metadata will be saved after bake. If [[#Warnings|Lightmapped prefab validation]] warning is enabled, all prefab errors will be also shown in a dialog box before the bake.&lt;br /&gt;
&lt;br /&gt;
Lightmapped prefabs support all Bakery features, such as LODs, terrains, directional lightmaps, RNM, SH, per-vertex modes and shadowmasks. For shadowmasks to work, you need lights to also be a part of the same prefab.&lt;br /&gt;
&lt;br /&gt;
{{note| Note that prefab shadowmasks only work on Unity 2017.4 or newer due to API limitations.}}&lt;br /&gt;
&lt;br /&gt;
After baking, an object named “BakeryPrefabLightmapData” will be added to prefab. This object holds a script with all necessary data to apply the lightmaps.&lt;br /&gt;
&lt;br /&gt;
Additionally, Lightmapped Prefab allows to save current render settings and load them back to any currently open scene, using two buttons:&lt;br /&gt;
* Save current render settings to prefab: stores a copy of current Render Settings on  this prefab.&lt;br /&gt;
* Load render settings from prefab: sets current Render Settings to those stored on the prefab.&lt;br /&gt;
[[File:Upload 2019-9-17 10-32-34.png|thumb|Applying the prefab]]&lt;br /&gt;
When baking a Lightmapped Prefab, it is recommended to check that:&lt;br /&gt;
* Prefab is &amp;quot;Applied&amp;quot;. On older Unity versions, click &amp;quot;Apply&amp;quot; button on the top right corner on the Inspector. On newer versions click the &amp;quot;Overrides&amp;quot; list and then &amp;quot;Apply all&amp;quot;.&lt;br /&gt;
* Prefab component UI does not show any errors.&lt;br /&gt;
* [Recommended] &amp;quot;Lightmapped prefab validation&amp;quot; checkbox is enabled in the main window. Clicking Render you doesn't show any warning dialog boxes about the prefabs.&lt;br /&gt;
&lt;br /&gt;
{{note| Lightmaps are named after the scene they are baked in or a Lightmap Group they use (if any). When baking different prefabs in the same scene, make sure to either use a differently named [[Manual#Bakery_Lightmap_Group_Selector|Lightmap Group]] or change the [[Manual#Output_path|Output Path]].}}&lt;br /&gt;
&lt;br /&gt;
{{note| When baking multiple prefabs using identical models one by one, it is recommended to set [[Manual#Asset_UV_Processing|Asset UV Processing]] to ''Don't Change'', to prevent alteration of shared model UVs.}}&lt;br /&gt;
&lt;br /&gt;
{{note| Bakery's prefab workflow was implemented before Unity had a &amp;quot;double-click into prefab&amp;quot; view feature. Thus, lightmaps may be not correctly applied in the isolated prefab view, and the component may show a &amp;quot;This GameObject is not a prefab&amp;quot; message. It should work as expected when working in a normal scene.}}&lt;br /&gt;
&lt;br /&gt;
{{note|When unpacking previously baked prefabs and unlinking them from existing lightmaps, make sure to remove the BakeryPrefabLightmapData object which holds the prefab-wide lightmap/renderer connections.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Direct Light ===&lt;br /&gt;
[[File:Directlight.jpg|thumb|Pure direct light with GI]]&lt;br /&gt;
[[File:Image4.png|thumb|Left: shadow spread = 0.01, right: 0.05. Note how shadows start sharp and get gradually blurrier with distance.]]&lt;br /&gt;
Infinitely distant directional light (e.g. Sun).&lt;br /&gt;
* Color: color.&lt;br /&gt;
* Intensity: linear color multiplier.&lt;br /&gt;
* Shadow spread: size of the light source or, simply put, shadow blurriness. 0 = max sharp shadows, 1 = max blurred shadows. Technically it interpolates from a single ray to a wider cone of rays.&lt;br /&gt;
* Shadow samples: affect shadows quality. The smaller the Shadow Spread value, the less samples are needed for a clean image. Typical values for sun shadows are from 1 to 16. Setting samples to 0 will make shadows from this light disappear.&lt;br /&gt;
* Bitmask: a list of toggles used to exclude this light source from affecting particular Lightmap Groups.&lt;br /&gt;
* Baked contribution: determines what kind of lighting data should be baked. Only visible in Indirect or Shadowmask modes. Possible values:&lt;br /&gt;
** Direct and Indirect: both direct and indirect contribution will be completely baked.&lt;br /&gt;
** Indirect only: a realtime light is supposed to provide direct contribution; only indirect lighting is baked.&lt;br /&gt;
** Shadowmask and indirect: a realtime light is supposed to provide direct contribution, but shadows from static geometry will be baked to a separate map. Dynamic and static shadows will be mixed together. Indirect lighting will be baked as usual.&lt;br /&gt;
** Direct, Indirect, Shadowmask (custom lighting only): same as Direct and Indirect, but the Shadowmask is also produced and assigned to use with custom shaders.&lt;br /&gt;
* Denoise shadowmask: determines if denoising should be applied to this light’s shadowmask. Usually it’s not necessary as shadows don’t exhibit much noise, but can be useful for very wide blurry shadows (large shadow spread).&lt;br /&gt;
* Indirect intensity: non-physical GI multiplier for this light. Should be 1 for natural lighting, but can be modified for more stylized scenes.&lt;br /&gt;
* Anti-alias: performs super-sampling for the shadow.&lt;br /&gt;
* Texture projection: projects a multiplicative tiled texture over lighting. Can be used to emulate distant cloud shadows.&lt;br /&gt;
When texture projection is set, its scale/offset can be manipulated using &amp;quot;Tiling&amp;quot; and &amp;quot;Offset&amp;quot; fields. Alternatively, click &amp;quot;Tweak projection in Scene View&amp;quot; and use additional gizmo to move and scale the projection visually. Click &amp;quot;Render reference frame&amp;quot; to save a PNG of &amp;quot;light's point of view&amp;quot;. This is useful to paint cloud shadows over the scene.&lt;br /&gt;
&lt;br /&gt;
If the same object has both Unity and Bakery light sources enabled, and they don’t match, two buttons will appear:&lt;br /&gt;
* Match lightmapped to real-time: copy common settings from Unity light to Bakery light.&lt;br /&gt;
* Match real-time to lightmapped: copy common settings from Bakery light to Unity light.&lt;br /&gt;
&lt;br /&gt;
{{note| In physical terms, Bakery's &amp;quot;Intensity&amp;quot; for directional lights is Lux divided by Pi.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Sky Light ===&lt;br /&gt;
[[File:Skylight.jpg|thumb|Pure sky light with GI]]&lt;br /&gt;
Infinitely distant shadowed ambient light (sky).&lt;br /&gt;
* Color: color.&lt;br /&gt;
* Intensity: linear color multiplier.&lt;br /&gt;
* Sky texture: optional cubemap asset, e.g. HDRI panorama to affect lighting colors from different directions.&lt;br /&gt;
{{note| Rotating sky light’s GameObject will rotate lighting from the cubemap accordingly.}}&lt;br /&gt;
* Samples: affects shadows quality. Typical values are from 8 to 32.&lt;br /&gt;
* Hemispherical: if enabled, lighting will only come from above (upper hemisphere). Otherwise from all directions.&lt;br /&gt;
* Bitmask: a list of toggles used to exclude this light source from affecting particular Lightmap Groups.&lt;br /&gt;
* Baked contribution: determines what kind of lighting data should be baked. Only visible in Indirect or Shadowmask modes. Possible values:&lt;br /&gt;
** Direct and Indirect: both direct and indirect contribution will be completely baked. This is the default and recommended behaviour for all Sky Lights, as there is no real-time version to emulate them in Unity.&lt;br /&gt;
** Indirect only: a realtime light is supposed to provide direct contribution; only indirect lighting is baked.&lt;br /&gt;
&lt;br /&gt;
If sky light’s settings and current scene skybox don’t match, two buttons will appear:&lt;br /&gt;
* Match this light to scene skybox: copy common settings from active skybox material to Bakery sky light. Currently it can only match skyboxes using the “Skybox/Cubemap” or “Skybox/Bakery skybox” shaders.&lt;br /&gt;
* Match scene skybox to this light: copy common settings from Bakery sky light to scene skybox.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bakery Light Mesh ===&lt;br /&gt;
[[File:Image29.png|thumb|Left: Samples Near = 0, Samples Far = 4096.&amp;lt;br&amp;gt;&lt;br /&gt;
Middle: Samples Near = 0, Samples Far = 128.&amp;lt;br&amp;gt;&lt;br /&gt;
Right: Samples Near = 16, Samples Far = 128.&amp;lt;br&amp;gt;&lt;br /&gt;
Note how the lighting appearance is similar, yet less combined samples are used.]]&lt;br /&gt;
Emissive mesh of any shape. Should be used together with the Mesh Renderer component or with a Light component set to Area mode.&lt;br /&gt;
* Color: color&lt;br /&gt;
* Intensity: linear color multiplier.&lt;br /&gt;
* Cutoff: maximum lighting distance. Bakery will additionally attenuate correct inverse-squared falloff near the limit. It works best when cutoff value is just where physical falloff gets very dim. Cutoff can improve baking performance, but you also can set it to a very high (unreachable) value for complete correctness.&lt;br /&gt;
* Self Shadow: determines if light mesh itself casts shadows. This option also enables a more precise lighting algorithm.&lt;br /&gt;
* Samples Near: affect lighting quality near the mesh. Typical values are from 16 to 64. This option is only available when Self Shadow is on.&lt;br /&gt;
* Samples Far: affects lighting quality far away from the mesh. Typical values are from 4 to 4096.&lt;br /&gt;
&lt;br /&gt;
Bakery mixes two different algorithms for area lights based on emissive surface proximity. Close to the light it works similar to the GI algorithm, while at a distance the light is approximated as a cloud of virtual point lights.&lt;br /&gt;
&lt;br /&gt;
{{note| &amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;Light Meshes don’t receive lighting on their own and don’t get lightmapped.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;One Light Mesh with many polygons is faster to bake than many simple Light Meshes.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;If you keep getting dirty/noisy results, try setting Samples Near to 0. Then only the VPL algorithm is used. It is also useful for very simple lights where precision is not important (e.g. window lights on a building).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;}}&lt;br /&gt;
[[File:Dd99d-QU0AEKFBK.jpg|thumb|A curved Light Mesh]]&lt;br /&gt;
* Bitmask: a list of toggles used to exclude this light source from affecting particular Lightmap Groups.&lt;br /&gt;
* Baked contribution: determines what kind of lighting data should be baked. Only visible in Indirect or Shadowmask modes. Possible values:&lt;br /&gt;
** Direct and Indirect: both direct and indirect contribution will be completely baked. This is the default and recommended behaviour for all Light Meshes, as there is no real-time version to emulate them in Unity.&lt;br /&gt;
** Indirect only: a realtime light is supposed to provide direct contribution; only indirect lighting is baked.&lt;br /&gt;
** Shadowmask and Indirect: a realtime light is supposed to provide direct contribution, but shadows from static geometry will be baked to a separate map. Dynamic and static shadows will be mixed together. Indirect lighting will be baked as usual. Currently only HDRP (and custom renderers) support mixed area lights.&lt;br /&gt;
** Direct, Indirect, Shadowmask (custom lighting only): same as Direct and Indirect, but the Shadowmask is also produced and assigned to use with custom shaders.&lt;br /&gt;
* Indirect intensity: non-physical GI multiplier for this light. Should be 1 for natural lighting, but can be modified for more stylized scenes.&lt;br /&gt;
* Shadowmask with falloff: bakes complete light attenuation into the shadowmask (only useful with custom shaders).&lt;br /&gt;
&lt;br /&gt;
If mesh material and light settings do not match, two buttons will appear:&lt;br /&gt;
* Match light to material:  copy common settings from unlit mesh material or area light to Bakery light.&lt;br /&gt;
* Match material to light: copy common settings from Bakery light to unlit mesh material or area light.&lt;br /&gt;
&lt;br /&gt;
==== Differences between Light Mesh and emissive materials ====&lt;br /&gt;
Emissive material:&lt;br /&gt;
* Propagates light during GI calculation, therefore is “free”, no matter how many meshes are emissive.&lt;br /&gt;
* Small and bright lights can give inaccurate noisy results, depending on GI sample count.&lt;br /&gt;
* Has to occupy space in lightmap due to the way GI in Bakery works, therefore possibly wasting it. Also it means that emissive objects require valid UVs and have “Cast shadows” enabled..&lt;br /&gt;
&lt;br /&gt;
Light Mesh:&lt;br /&gt;
* Lighting is calculated separately for each light, therefore is slower than emissive materials.&lt;br /&gt;
* Designed to give clean results for small and bright lights, even very far away from them.&lt;br /&gt;
* Doesn’t take space in lightmaps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Point Light ===&lt;br /&gt;
[[File:Image11.png|thumb|Left: Shadow Spread = 0.5, right: Shadow Spread = 1.]]&lt;br /&gt;
Point light, doesn’t have area. Despite physical impossibility it is useful for games and the only way to match Unity’s point and spot lights.&lt;br /&gt;
{{note|Spot lights are just point lights with additional projection mask.}}&lt;br /&gt;
* Color: color.&lt;br /&gt;
* Intensity: linear color multiplier.&lt;br /&gt;
* Shadow spread: shadow blurriness. Although point lights don’t have area, it is often desired to still have blurred shadows from them. For this purpose shadows are simulated as if they were cast from a spherical area light. This parameter defines the radius of such virtual sphere, directly affecting blurriness.&lt;br /&gt;
* Physical falloff: if enabled, will use correct inverse-squared falloff with additional attenuation near the limit. Otherwise will try to mimic Unity’s falloff.&lt;br /&gt;
* Falloff min size: learn more in [[Point Light Attenuation]] section.&lt;br /&gt;
* Range: if physical falloff is disabled, equals to Unity’s light range. If it’s enabled, will only slightly fade away physical falloff at the edge.&lt;br /&gt;
* Samples: affects shadows quality. Typical values are from 1 to 512. Setting samples to 0 will make shadows from this light disappear.&lt;br /&gt;
[[File:Image10.png|thumb|Left to right: Omni, Cookie (default spot texture), Cubemap, IES.]]&lt;br /&gt;
* Projection mask: type of mask/cookie. Options:&lt;br /&gt;
** Omni: no mask, equals to Unity’s Point Light.&lt;br /&gt;
** Cookie: cookie texture projection. Additional options:&lt;br /&gt;
*** Cookie texture: 2D texture asset. Bakery includes the original Unity’s Spot Light texture (named ftUnitySpotTexture) that you can use to mimic it.&lt;br /&gt;
*** Angle: texture projection angle (similar to Unity’s Spot Light).&lt;br /&gt;
*** Correct distortion: corrects cookie distortion visible on straight lines at wide angles.&lt;br /&gt;
** Cubemap: cubemap cookie projection. Additional options:&lt;br /&gt;
*** Projected cubemap: cubemap asset.&lt;br /&gt;
** IES: lighting is modulated by the IES file data. Additional options:&lt;br /&gt;
*** IES file: file with .ies extension.&lt;br /&gt;
* Bitmask: a list of toggles used to exclude this light source from affecting particular Lightmap Groups.&lt;br /&gt;
* Baked contribution: determines what kind of lighting data should be baked. Only visible in Indirect or Shadowmask modes. Possible values:&lt;br /&gt;
** Direct and Indirect: both direct and indirect contribution will be completely baked.&lt;br /&gt;
** Indirect only: a realtime light is supposed to provide direct contribution; only indirect lighting is baked.&lt;br /&gt;
** Shadowmask and Indirect: a realtime light is supposed to provide direct contribution, but shadows from static geometry will be baked to a separate map. Dynamic and static shadows will be mixed together. Indirect lighting will be baked as usual.&lt;br /&gt;
** Direct, Indirect, Shadowmask (custom lighting only): same as Direct and Indirect, but the Shadowmask is also produced and assigned to use with custom shaders.&lt;br /&gt;
* Indirect intensity: non-physical GI multiplier for this light. Should be 1 for natural lighting, but can be modified for more stylized scenes.&lt;br /&gt;
* Shadowmask with falloff: bakes complete light attenuation (except for distance) into the shadowmask (only useful with custom shaders).&lt;br /&gt;
* Legacy sampling: use Bakery's original more biased shadow sampling strategy. Produces noise-free shadows, but wide penumbras can exhibit banding. If disabled, an unbiased, but noisier technique is used.&lt;br /&gt;
&lt;br /&gt;
If the same object has both Unity and Bakery light sources enabled, and they don’t match, two buttons will appear:&lt;br /&gt;
* Match lightmapped to real-time: copy common settings from Unity light to Bakery light.&lt;br /&gt;
* Match real-time to lightmapped: copy common settings from Bakery light to Unity light.&lt;br /&gt;
&lt;br /&gt;
{{note| In physical terms, Bakery's &amp;quot;Intensity&amp;quot; for points lights is (Candela/Pi).}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Volume ===&lt;br /&gt;
[[File:Voldemo notlonely.gif|A dynamic door being lit by a BakeryVolume (animated GIF by NOTLonely)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Volumes generate 3D textures that store light probes per voxel (L1 spherical harmonics and shadowmasks) making them a viable replacement for regular Unity light probes.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Unity Light Probes&lt;br /&gt;
! Unity LPPV&lt;br /&gt;
! Bakery Volumes&lt;br /&gt;
|-&lt;br /&gt;
| Manually placing each probe&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | No&lt;br /&gt;
|-&lt;br /&gt;
| Interpolate multiple probes on one object&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Movable at runtime&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Can put in a prefab&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Full scripting API&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Ringing&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Possible&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Possible&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Fixed&lt;br /&gt;
|-&lt;br /&gt;
| Denoising&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Runtime overhead&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | CPU: low; GPU: low.&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | CPU: medium; GPU: medium.&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#e4ead3;&amp;quot; | CPU: none; GPU: medium.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bakery Volume is a bounding box linked to a set of 3D textures (3 SH textures and one shadowmask, if needed), making it very easy to use and script. Volumes can be trivially swapped, moved, loaded or unloaded at runtime or linked to prefabs. They also do not need any Light Probe Groups and manual probe placement; the whole volume is filled with a uniform grid of probe voxels. Light/shadow leaking is automatically fixed the same way it is done for lightmaps (although thin double-sided walls may be a problem with large voxel size, but it can be avoided by using different volumes on different sides). Because of the uniform nature of voxel grids, it is also possible to apply lightmap-like denoising to them, which is not possible with regular light probes. Additionally, Bakery shaders use the [https://drive.google.com/file/d/1MK6Clw93q8ljijRjb4gQOzzaIjn1uF9Y/view Geomerics sampling trick] to completely get rid of the &amp;quot;ringing&amp;quot; artifact spherical harmonics can sometimes produce with high-contrast HDR lighting.&lt;br /&gt;
&lt;br /&gt;
Because of that, Volumes can produce clean, detailed, high-quality baked lighting for dynamic objects (that is, the lighting that comes from the static objects and affects dynamic objects, not the other way around).&lt;br /&gt;
&lt;br /&gt;
The only downside of the Volume approach is the higher per-pixel shading cost. The cost is similar to LPPV (scaling with the amount of shaded volume-affected pixels on the screen) but unlike LPPV, the Volumes themselves are never updated once they are baked. Multiple volume blending can be avoided by slightly overlapping them instead.&lt;br /&gt;
&lt;br /&gt;
====Setting volume transform====&lt;br /&gt;
[[File:Bvolgizmo.jpg|thumb|Volume gizmo]]&lt;br /&gt;
When BakeryVolume is added to a GameObject, a bounding box gizmo will appear in scene view. Dragging it by the little squares will scale it.&lt;br /&gt;
There are also other ways to change volume size and position:&lt;br /&gt;
* Drag any renderable GameObject into &amp;quot;Wrap to object&amp;quot; field. The volume will wrap around this object (and its children) to encapsulate them.&lt;br /&gt;
* If there is a Box Collider added to the same object, &amp;quot;Set from box collider&amp;quot; and &amp;quot;Set to box collider&amp;quot; buttons will appear. These can be used to quickly copy values between Volume/Collider.&lt;br /&gt;
&lt;br /&gt;
====Resolution====&lt;br /&gt;
When &amp;quot;Adaptive resolution&amp;quot; is enabled, the amount of voxels is governed by &amp;quot;Voxels per unit&amp;quot;. Disabling it allows to manually enter the resolution. For most games with 1 unit = 1 meter, a reasonable &amp;quot;Voxels per unit&amp;quot; value is 2, but there are cases (e.g. dynamic doors) when using a smaller, but higher resolution volume is beneficial.&lt;br /&gt;
&lt;br /&gt;
====Other settings====&lt;br /&gt;
* Enable baking: should the volume be (re)computed? Disable to prevent overwriting existing data.&lt;br /&gt;
* Denoise: apply denoising after baking the volume. Recommended for high-resolution volumes. Avoid using for very low-resolution volumes covering many lights, as it will be hard for denoisers to tell actual content from noise.&lt;br /&gt;
* Global: automatically assign this volume to all volume-compatible shaders, unless they have overrides. Internally it will call Shader.SetGlobalTexture()/SetGlobalVector().&lt;br /&gt;
&lt;br /&gt;
====Usage====&lt;br /&gt;
Volumes can be assigned to objects using a volume-aware shader. Bakery comes with &amp;quot;Bakery Standard&amp;quot; shader that implements it, as well as a HDRP and URP graphs. See example_volumes scenes for various ways of applying a volume.&lt;br /&gt;
&lt;br /&gt;
====Hints====&lt;br /&gt;
* Make sure to check the examples.&lt;br /&gt;
* If two volumes connect, make them overlap a bit. The size of the overlap should be equal to the size of the largest dynamic object. This way simply switching between volumes on the go will work.&lt;br /&gt;
* Only place volumes around areas dynamic objects can actually reach. E.g. use player height to limit volume height.&lt;br /&gt;
&lt;br /&gt;
====Rotating volumes====&lt;br /&gt;
Volumes can be rotated around Y axis, if &amp;quot;Rotate around Y&amp;quot; option is enabled. Rotation is very cheap and only uses 2 extra floats of data (precomputed sin/cos of the angle).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There is also an additional option to rotate volumes at runtime (Experimental -&amp;gt; &amp;quot;Support rotation after bake&amp;quot; and a similar option in Bakery Shader), in which case they need to be baked with zero initial rotation.&lt;br /&gt;
&lt;br /&gt;
In URP such dynamic rotation can be used with BakeryURPVolumeGraphRotatable.shadergraph.&lt;br /&gt;
&lt;br /&gt;
For global volumes dynamic rotation will be updated when the component is (re)enabled or volume.SetGlobalParams() is called. Using local rotated volumes requires manually setting the rotation on the material or the MaterialPropertyBlock:&lt;br /&gt;
{{code|&amp;lt;nowiki&amp;gt;SetMatrix(&amp;quot;_VolumeMatrix&amp;quot;, volume.GetMatrix())&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
====Technical information====&lt;br /&gt;
Volumes can work automatically (check example scenes), but it is also possible to script the way they are used.&lt;br /&gt;
&lt;br /&gt;
Volume data can be retrieved from the component via these public properties:&lt;br /&gt;
* bakedTexture0: stores L0 RGB coefficients and L1 Z red channel in alpha.&lt;br /&gt;
* bakedTexture1: stores L1 X RGB coefficients and L1 Z green channel in alpha.&lt;br /&gt;
* bakedTexture2: stores L1 Y RGB coefficients and L1 Z blue channel in alpha.&lt;br /&gt;
* bakedMask: stores the volumetric shadowmask.&lt;br /&gt;
* bounds: the bounding box of the volume.&lt;br /&gt;
&lt;br /&gt;
All bakedTexture* maps use RGBAHalf (8 bytes per voxel) format and the mask is ARGB32 (4 bytes per voxel). Shadowmask can also use single-channel R8 format (1 byte per voxel).&lt;br /&gt;
&lt;br /&gt;
Therefore volume byte size = width*height*depth*3*8 + (only if the shadowmask is used) width*height*depth*4 (or width*height*depth with an R8 mask).&lt;br /&gt;
&lt;br /&gt;
[[Manual#Compress_volumes|Texture compression]] can be enabled on volumes to make them much smaller.&lt;br /&gt;
&lt;br /&gt;
To sample the volume, a special shader is needed, and these are included in Bakery. To add volumes to a custom shader, check BakeryVolume_float() function in BakeryDecodeLightmap.hlsl which is included in HDRP/URP packages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Light Filter ===&lt;br /&gt;
[[File:Output optimized.gif|Stained glass, as seen in Bakery Real-Time Preview. Same results are baked by the Bakery lightmapper.]]&lt;br /&gt;
&lt;br /&gt;
Marks a renderer as a Light Filter. Filters tint all direct/indirect rays with their color, similar to real-life optical filters, allowing for colored transparencies (e.g. stained glass). The only parameter is the texture used for tinting.&lt;br /&gt;
* Light Filter objects still receive lightmaps like everything else.&lt;br /&gt;
* Filters don't scatter/blur rays (for that try [[Subsurface_scattering|Subsurface Scattering]] or [[Manual#Backface_GI|Backface GI]]).&lt;br /&gt;
* Filters can produce color-tinted shadows. If [[Manual#Shadowmask|Shadowmask]] mode is used on the light, only R channel of the result will be saved (as Unity only supports single-channel masks). For fully baked shadows there are no limitations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Sector ===&lt;br /&gt;
See '''[[Partial_scene_baking|Partial scene baking]]'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Always Render ===&lt;br /&gt;
If added to an object, Bakery will always take it into account when baking, even if its renderer is disabled.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Pack As Single Square ===&lt;br /&gt;
If added to an object, Bakery will treat UVs of this object and its children as a single combined square and never move them away from each other during automatic atlas packing or in a Lightmap Group with Pack Atlas mode. Whole children hierarchy will be packed as one.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Shared LOD UV ===&lt;br /&gt;
If added to a LODGroup, will mark all similarly-named LODs as sharing the same lightmap. By default, every LOD mesh receives a unique lightmap, taking space in the atlas; If, however, it is known that LODs of the same object have similar UV2 (or UV1, if it's non-overlapping, and UV2 is not present), they can map to the same part of the atlas, saving memory.&lt;br /&gt;
This technique is also known as [https://github.com/laurenth-personal/LODLightmapScripts/ Lightmap Stealing].&lt;br /&gt;
&lt;br /&gt;
= Material compatibility =&lt;br /&gt;
=== Albedo and emission ===&lt;br /&gt;
Bakery supports most Unity materials by utilizing the [https://docs.unity3d.com/Manual/MetaPass.html Meta Pass] system. All built-in, surface, URP and HDRP shaders already have a correct meta pass defined.&lt;br /&gt;
&lt;br /&gt;
If you have an Unlit shader, add meta pass manually, as described in Unity docs.&lt;br /&gt;
&lt;br /&gt;
If the pass is not present, Bakery will assume {{codeVar|_MainTex}}, {{codeVar|_BaseColorMap}} or {{codeVar|_Color}} (if no texture is set) properties as material albedo and {{codeVar|_EmissionMap}} and {{codeVar|_EmissionColor}} as emissive color.&lt;br /&gt;
&lt;br /&gt;
In order for emission to work, [https://docs.unity3d.com/ScriptReference/Material-globalIlluminationFlags.html Material.globalIlluminationFlags] must be set to [https://docs.unity3d.com/ScriptReference/MaterialGlobalIlluminationFlags.BakedEmissive.html MaterialGlobalIlluminationFlags.BakedEmissive]. Standard shaders set this value automatically.&lt;br /&gt;
&lt;br /&gt;
=== Opacity ===&lt;br /&gt;
[[File:Upload 2019-1-25 0-4-30.png|thumb|Material parameters converted to cutout (default)]]&lt;br /&gt;
[[File:Alphacombos dither.jpg|thumb|Semi-transparent values added via Dither Transparency option]]&lt;br /&gt;
[[File:Alphacombos filter.jpg|thumb|Light Filter components used on red planes, producing colored shadows]]&lt;br /&gt;
By default, Bakery always takes full resolution opacity from the alpha value of {{codeVar|_MainTex}}, {{codeVar|_BaseColorMap}} or {{codeVar|_BaseMap}} and treats it as cutout (1 bit tranparency).&lt;br /&gt;
&lt;br /&gt;
When '''Dither Transparency''' option is enabled, semi-transparent values are automatically converted to variable blue noise, which is then filtered/blurred, resulting in partial transparency (it was previously possible using custom manually dithered maps, but since v1.97 it is automatic).&lt;br /&gt;
&lt;br /&gt;
In order for opacity to work, [https://docs.unity3d.com/Manual/SL-SubShaderTags.html RenderType tag] of the shader must be one of these values:&lt;br /&gt;
* {{codeVar|Transparent}}&lt;br /&gt;
* {{codeVar|TransparentCutout}}&lt;br /&gt;
* {{codeVar|TreeLeaf}}&lt;br /&gt;
&lt;br /&gt;
If a property named {{codeVar|_Cutoff}} is present, it will affect the cutout (therefore Standard shader cutoff slider works automatically).&lt;br /&gt;
&lt;br /&gt;
Without Dither Transparency, if material RenderType is {{codeVar|Transparent}} or {{codeVar|TreeLeaf}}, then alpha value of {{codeVar|_Color}} will additionally modify the cutoff: ''finalCutoff = 1 - (1 - cutoff) * alpha''&lt;br /&gt;
&lt;br /&gt;
For colored transparency, use the [[Manual#Bakery_Light_Filter|Light Filter]] component.&lt;br /&gt;
&lt;br /&gt;
For diffuse translucency effects read about [[#Backface GI|Backface GI]] and [[subsurface scattering]].&lt;br /&gt;
&lt;br /&gt;
==== Alpha Meta Pass ====&lt;br /&gt;
Since v1.9 Bakery also supports specifying custom shader-based transparency, but it requires a compatible shader. To take advantage of ''Alpha Meta Pass'', following steps must be taken:&lt;br /&gt;
* Add a property named '''BAKERY_META_ALPHA_ENABLE''' to the shader. For example:&lt;br /&gt;
{{code|&amp;lt;nowiki&amp;gt;[HideInInspector] BAKERY_META_ALPHA_ENABLE (&amp;quot;Enable Bakery alpha meta pass&amp;quot;, Float) = 1.0&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
* Make sure that RenderType tag is set to one of the values above.&lt;br /&gt;
* Declare a pass named '''META_BAKERY'''. &lt;br /&gt;
* In that pass check if '''unity_MetaFragmentControl.w''' is non-zero, in which case, return the computed transparency value. &lt;br /&gt;
&lt;br /&gt;
See ''Baked_Alpha_meta.shader'' included in the package as an example.&lt;br /&gt;
&lt;br /&gt;
Note: currently Alpha Meta Pass requires Light Probe Mode to be set to L1 or L2.&lt;br /&gt;
&lt;br /&gt;
=== Normal mapping ===&lt;br /&gt;
Custom surface normals can be used in conjunction with [[#Baked Normal Maps|Baked Normal Maps]] mode. Unfortunately, Unity's Meta Pass does not output normal information, so by default normals are taken from a texture named {{codeVar|_BumpMap}}, additionally transformed by {{codeVar|_MainTex_ST}}.&lt;br /&gt;
&lt;br /&gt;
It is however possible to make completely custom shaders with advanced normal mapping features (e.g. blending multiple layers) compatible with baking. To do that you'll need:&lt;br /&gt;
&lt;br /&gt;
1. Define a Meta Pass in your shader, just [https://docs.unity3d.com/Manual/MetaPass.html#ExampleMetaPass as described in Unity docs].&lt;br /&gt;
&lt;br /&gt;
2. Name it {{codeVar|&amp;quot;META_BAKERY&amp;quot;}}, instead of just {{codeVar|&amp;quot;META&amp;quot;}}.&lt;br /&gt;
&lt;br /&gt;
3. Include {{codeVar|&amp;quot;BakeryMetaPass.cginc&amp;quot;}}.&lt;br /&gt;
&lt;br /&gt;
4. Add {{codeVar|#pragma vertex vert_bakerymt}}&lt;br /&gt;
&lt;br /&gt;
5. If {{codeVar|unity_MetaFragmentControl.z}} variable is not 0, shader should return world-space normal. Returned normal should be encoded using {{codeVar|BakeryEncodeNormal}} function.&lt;br /&gt;
&lt;br /&gt;
Two example shaders implementing this extended Meta Pass are included in Assets/Bakery/examples/shaders.&lt;br /&gt;
&lt;br /&gt;
You can copy and modify BakeryMetaPass.cginc to suit your needs, e.g. pass additional data from the vertex shader.&lt;br /&gt;
&lt;br /&gt;
=== Front/back faces ===&lt;br /&gt;
No matter what culling mode is used on the shader, Bakery treats all back-faces as opaque, meaning any direct light ray will not pass through a back-face, just as it will not pass through a front-face.&lt;br /&gt;
However, back-faces can partially emit lighting received by a front-face, if you use [[Manual#Backface_GI|Backface GI]].&lt;br /&gt;
&lt;br /&gt;
= &amp;quot;Lightmap Parameters&amp;quot; assets =&lt;br /&gt;
[[File:Lp.jpg|thumb|Extended Lightmap Parameters]]&lt;br /&gt;
Similar to Bakery's [[Manual#Bakery_Lightmap_Group_Selector|Lightmap Groups]], Unity has [https://docs.unity3d.com/Manual/class-LightmapParameters.html Lightmap Parameters] that can be created as assets and assigned to Mesh Renderers. Their logic has differences and similarities:&lt;br /&gt;
* Lightmap Group's primary usage is to group multiple objects in one atlas. Additionally it allows overriding baking settings for this atlas.&lt;br /&gt;
* Lightmap Parameters are primarily used to override baking settings for an object. But additionally they can influence packing by using the &amp;quot;Baked Tag&amp;quot; option: objects with a different Baked Tag will never share the same atlas.&lt;br /&gt;
&lt;br /&gt;
Since some users are more used to the Lightmap Parameters workflow, Bakery now supports and extends them:&lt;br /&gt;
* Baked Tag is respected by Bakery.&lt;br /&gt;
* Additional Bakery-specific options will be shown in the Lightmap Parameters UI. Refer to the [[Manual#Bakery_Lightmap_Group_Selector|Lightmap Group]] section for their meaning.&lt;br /&gt;
&lt;br /&gt;
= Project Settings =&lt;br /&gt;
Some global settings can be tweaked in Project Settings -&amp;gt; Bakery GPU Lightmapper (this option is only visible in Unity 2018.3 or newer; for older versions, edit BakeryProjectSettings.asset instead):&lt;br /&gt;
* Mipmap lightmaps: enables mipmapping on lightmap assets. Can cause leaks across UV charts as atlases get smaller; on the other hand, it reduces high resolution lightmap aliasing in the distance. Overall it is recommended to use separately baked LODs with lower resolution lightmaps for very distant objects instead.&lt;br /&gt;
* Color file format: format for regular HDR color lightmaps. Possible values:&lt;br /&gt;
** HDR: Radiance HDR format (default). Can be opened in many image editors.&lt;br /&gt;
** Asset: native Unity format. Can have custom mipmap count.&lt;br /&gt;
* Mask/Direction file format: format for additional LDR maps, such as shadowmasks or directional data. Possible values:&lt;br /&gt;
** TGA: 8-bit Targa (default).&lt;br /&gt;
** PNG: 8-bit PNG. Usually takes less space on disk compared to TGA.&lt;br /&gt;
** Asset: native Unity format. Can have custom mipmap count.&lt;br /&gt;
* Compress lightmaps: defines lightmap asset compression behaviour. Compressed lightmaps take less VRAM, but may exhibit some visual artifacts (such as banding or colored blotches) depending on the type of compression (for mobile compression issues [[Troubleshooting#I_have_an_Android_project.2C_and_lightmaps_don.27t_look_good|see this]]). Possible values:&lt;br /&gt;
*** Compress but allow overriding asset: new lightmaps will be created with compression enabled. After they are created, it is possible to change their compression settings in Inspector. These modified values will be kept after rebaking (default).&lt;br /&gt;
*** Force compress: always compress all lightmaps.&lt;br /&gt;
*** Force no compress: always produce uncompressed lightmaps.&lt;br /&gt;
* High quality direction: enables &amp;quot;high&amp;quot; quality compression for directional maps. Actual formats depend on platform. On PC, for example, it will change it from DXT1 to BC7, which gives higher quality, but doubles the VRAM usage.&lt;br /&gt;
* Texel padding (default atlas packer): defines how many empty texels to add between objects' UV layouts in lightmap atlases, when using the default atlas packer.&lt;br /&gt;
* Texel padding (xatlas packer): same, but when using xatlas.&lt;br /&gt;
* Alpha Meta Pass resolution multiplier: multiplies resolution of the [[Manual#Alpha_Meta_Pass|Alpha Meta Pass]] allowing to have precise shader-based cutouts while baking low resolution lightmaps.&lt;br /&gt;
* Volume render mode: which [[Manual#Render_mode|render mode]] to use for all [[Manual#Bakery_Volume|Volumes]]? Auto uses current active render mode (default).&lt;br /&gt;
* Delete previous lightmaps before bake: actually delete all previously rendered lightmap files from this scene before baking new ones.&lt;br /&gt;
* Log level: defines how much information is printed to console during the bake. Possible values:&lt;br /&gt;
** 0: do not print anything.&lt;br /&gt;
** 1: only print progress information.&lt;br /&gt;
** 2: only print warnings.&lt;br /&gt;
** 3: print everything.&lt;br /&gt;
* Alternative scale in lightmap: makes 'Scale in Lightmap' renderer property act more similar to built-in Unity behaviour.&lt;br /&gt;
* Align to texture compression blocks with xatlas: makes xatlas align charts to 4x4 block boundaries, which gives more compression-friendly results.&lt;br /&gt;
* Generate smooth positions: should sample positions be adjusted to prevent incorrect shadowing on low-poly geometry with smooth normals? Can be disabled in very rare cases when using geometry with wildly mismatching normals. See [https://ndotl.wordpress.com/2018/08/29/baking-artifact-free-lightmaps/#shadowterm  this article] for technical explanation.&lt;br /&gt;
* Smooth positions per-triangle: should smooth/flat position be decided per-triangle? Can be disabled in very rare cases when using geometry with wildly mismatching normals.&lt;br /&gt;
* Use 'Receive GI' values: take 'Receive Global Illumination' values into account on renderers. Originally Bakery ignored it.&lt;br /&gt;
* Remove ringing in Legacy light probes: enables softer light probe convolution in Legacy mode to prevent artifacts in high-contrast areas.&lt;br /&gt;
* Always render reflection probes: automatically render reflection probes after every Render/Render Light Probes.&lt;br /&gt;
* Ringing removal for L2 light probes: applies de-ringing to [[Manual#Light_probe_mode|L2 light probes]]. The higher the value, the smoother the probe lighting is; this smoothing reduces [https://docs.unity3d.com/6000.2/Documentation/Manual/light-probes-troubleshooting.html ringing] artifacts (if present).&lt;br /&gt;
* Put menu under Tools: puts Bakery menu under the Tools menu.&lt;br /&gt;
&lt;br /&gt;
If any format is set to Asset, and mipmapping is enabled, an additional option is shown:&lt;br /&gt;
* Maximum mipmap count: defines maximum amount of mipmaps. For example, if set to 2, a 8K lightmap will only have two additional mipmaps: 4K and 2K. Lower resolutions will be omitted, thus limiting leaking artifacts during mipmapping.&lt;br /&gt;
&lt;br /&gt;
= Skinned mesh renderer support =&lt;br /&gt;
&lt;br /&gt;
Bakery supports skinned meshes since v1.65. However, there are some limitations:&lt;br /&gt;
* Some versions of Unity do not support UV1 on skinned meshes and silently ignore &amp;quot;Generate lightmap UVs&amp;quot;. Make sure the actual mesh used in your scene has UV1 and use non-overlapping UV0 if possible;&lt;br /&gt;
* UV padding adjustment does not work on skinned meshes (Unity seems to crash when attempting to call Unwrap function on them);&lt;br /&gt;
* Skinned meshes can't have per-vertex lightmaps (engine has no support for additionalVertexStreams with skinning).&lt;br /&gt;
&lt;br /&gt;
= Shader Tweaks =&lt;br /&gt;
[[File:Image2.jpg|thumb|Left: default bilinear filtering. Right: bicubic filtering.]]&lt;br /&gt;
[[File:Image34.jpg|thumb|Left: both shadows are baked.&amp;lt;br&amp;gt;&lt;br /&gt;
Center: spherical shadow is dynamic, and other shadow is static. Combined together with multiplication.&amp;lt;br&amp;gt;&lt;br /&gt;
Right: same as center, but combined with default minimum.]]&lt;br /&gt;
Bakery offers optional shader modifications that can be applied to Unity shaders to improve lightmap sampling and match real-time lighting closer to lightmaps. Shader tweaking menu can be accessed via Bakery-&amp;gt;Shader Tweaks.&lt;br /&gt;
&lt;br /&gt;
These options will patch base Unity shader includes (from the CGIncludes folder) that are used by most built-in and third party shaders. All modifications will affect all projects opened with this version of editor, but can be also easily reverted back. Shader tweaks affect the way standard and surface shaders work. HDRP, URP and other SRPs are not affected.&lt;br /&gt;
&lt;br /&gt;
All available modifications are shown as buttons. Press the button to apply modification, and it will remain pressed. Un-press the button to remove the modification. Currently available options:&lt;br /&gt;
&lt;br /&gt;
{{note| You may need to run Unity editor as admin to make CGIncludes patching work}}&lt;br /&gt;
&lt;br /&gt;
* Use bicubic interpolation for lightmaps: bicubic interpolation will be used instead of default bilinear. This tweak fixes many jagged edges of low resolution lightmaps pretty well. Currently it only works on DX11 and modern consoles, while other platforms will remain using bilinear.&lt;br /&gt;
&lt;br /&gt;
* Use multiplication for shadowmask: combine static and dynamic shadows using multiplication instead of minimum. For reasons unknown Unity decided to use minimum operator by default, and it produces artifacts that are not present with multiplication.&lt;br /&gt;
&lt;br /&gt;
* Use physical light falloff (forward): replace default attenuation of real-time point/spot lights with a more physically correct inverse-squared. “Range” will only slightly fade it out near the edge (matches Bakery lights with Physical Falloff checkbox). Only affects forward renderer. See [[Point Light Attenuation]] for more details.&lt;br /&gt;
&lt;br /&gt;
* Use physical light falloff (deferred): same as above, but only affects deferred renderer.&lt;br /&gt;
&lt;br /&gt;
'''Falloff tweaks may not fully work on &amp;gt; 2017 Unity versions. Also, SRPs have correct falloff by default.'''&lt;br /&gt;
&lt;br /&gt;
= Bakery shaders =&lt;br /&gt;
Bakery includes its own shaders with support for vertex lightmapping, as well as RNM and SH directional modes. It also allows approximate baked specular to be calculated from directional data. &lt;br /&gt;
Bakery shader is '''not required''' for regular color lightmaps, shadow masks and Dominant Direction mode, as these features are supported by most Unity shaders anyway.&lt;br /&gt;
&lt;br /&gt;
=== Standard render pipeline ===&lt;br /&gt;
'''Bakery/Standard''': extends regular Standard shader. Additional options:&lt;br /&gt;
* Allow Vertex Lightmaps: allows this material to be used with [[Vertex Lightmaps|vertex lightmapping]].&lt;br /&gt;
* Allow RNM Lightmaps: allows this material to be used with [[#RNM|RNM directional mode]].&lt;br /&gt;
* Allow SH Lightmaps: allows this material to be used with [[#SH|SH directional mode]].&lt;br /&gt;
{{note| All “Allow” toggles enable a certain code path in the shader. It is recommended to only use one “allow” option in a material for performance reasons.}}&lt;br /&gt;
* Enable Lightmap Specular: calculates baked specular using data from Dominant Direction, RNM or SH directional modes. Note that due to the lack of information, the effect is very approximate. If you ever used baked specular in Unity 4, it should be comparable. It looks best together with highly perturbed normal maps, not so good on flat surfaces.&lt;br /&gt;
* Enable VertexLM directional: if vertex lightmaps are present, specifies that Dominant Direction data is stored in vertices and should be used.&lt;br /&gt;
* Enable VertexLM SH: if vertex lightmaps are present, specifies that SH data is stored in vertices and should be used.&lt;br /&gt;
* Enable VertexLM Shadowmask: if vertex lightmaps are present, specifies that shadow mask is stored in vertices and should be used.&lt;br /&gt;
* Enable MonoSH: treat directional maps as MonoSH maps.&lt;br /&gt;
[[File:Image5.png|thumb|Standard SH light probe vs non-linear]]&lt;br /&gt;
[[File:Shspec.jpg|thumb|SH specular effect]]&lt;br /&gt;
* Non-linear SH: in SH directional mode this option can enhance contrast (closer to ground truth), but it makes the shader a bit slower. This trick is based on [https://drive.google.com/file/d/1MK6Clw93q8ljijRjb4gQOzzaIjn1uF9Y/view “Reconstructing Diffuse Lighting from Spherical Harmonic Data”] paper by Geomerics.&lt;br /&gt;
* Non-linear Light Probe SH: similar to Non-linear SH, but works for light probes instead. In case of probes the most notable benefit is getting rid of incorrect negative values. This problem often happens in high-contrast scenes with bright HDR light sources. It’s an inherent limitation of spherical harmonics and not specific to Bakery (i.e. you can get similar artifacts with built-in lightmappers as well).&lt;br /&gt;
* Force Bicubic Filter: enables bicubic filtering for all additional maps. For complete bicubic filtering (including the first color map) it is recommended to also enable it in [[#Shader Tweaks|Shader Tweaks]].&lt;br /&gt;
&lt;br /&gt;
'''Bakery/Standard Specular''': same as Standard, but for specular workflow.&lt;br /&gt;
&lt;br /&gt;
=== HDRP &amp;amp; URP ===&lt;br /&gt;
To extract additional HDRP/URP shaders, open Bakery_ShaderGraphHDRP.unitypackage or Bakery_ShaderGraphURP.unitypackage included with Bakery. Inside you will find Shader Subgraphs that you can use in your own Shader Graphs as well as some example materials.&lt;br /&gt;
&lt;br /&gt;
=== Feature support across shaders ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Most Unity shaders&lt;br /&gt;
! Most HDRP &amp;amp; URP shaders&lt;br /&gt;
! Bakery Standard&lt;br /&gt;
! HDRP graphs&lt;br /&gt;
! URP graphs&lt;br /&gt;
|-&lt;br /&gt;
| HDR color lightmaps&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Shadowmask&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes (Since URP 10.1)&lt;br /&gt;
|-&lt;br /&gt;
| Dominant Direction&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| RNM&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| SH&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| MonoSH&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Lightmap specular&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes for dominant direction and SH&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes for dominant direction (see link)&lt;br /&gt;
|-&lt;br /&gt;
| Bicubic filtering&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes,&lt;br /&gt;
with [[#Shader Tweaks|Shader Tweaks]]&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes,&lt;br /&gt;
with [[#Shader Tweaks|Shader Tweaks]]&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
|-&lt;br /&gt;
| Vertex lightmaps&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Single color, no per-vertex SH, direction or shadowmasks (shader graph limitation)&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Single color, no per-vertex SH, direction or shadowmasks (shader graph limitation)&lt;br /&gt;
|-&lt;br /&gt;
| Non-Linear Light Probes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Volumes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Volume shadowmask&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Compressed volumes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{note| Everything except for regular color lightmaps requires at least Shader Model 3.0 to work.}}&lt;br /&gt;
{{note| Vertex Lightmaps with SH mode require at least Shader Model 4.0 due to interpolator limit.}}&lt;br /&gt;
{{note| Updated URP graphs with specular from Dominant Direction can be downloaded [[Bakery_-_GPU_Lightmapper|from the main wiki page]].}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
See also: [[Integrating_Bakery_shader_features_to_custom_shaders| Integrating Bakery shader features to custom shaders]]&lt;br /&gt;
&lt;br /&gt;
= Notes on HDRP/URP =&lt;br /&gt;
Once the package is imported into an HDRP or URP project, in general it can be used right away, but there are some things to note:&lt;br /&gt;
&lt;br /&gt;
* Example scenes use both regular Standard and, in some cases, &amp;quot;Bakery Standard&amp;quot; shaders. HDRP and URP provide a mechanism to update project shaders from Standard to Lit, but they cannot upgrade from Bakery Standard. Replace Bakery Standard materials with the ones coming from Bakery_ShaderGraphHDRP.unitypackage or Bakery_ShaderGraphURP.unitypackage.&lt;br /&gt;
&lt;br /&gt;
* In HDRP, the default HDRI sky intensity is high (11) and sky reflection is not being occluded by default. Together with default eye adaption it may result in some example scenes being hardly visible, as they are baked using much lower intensities. Reduce HDRI sky intensity to 1 in this case. HDRI settings are usually located in Assets/HDRPDefaultResources/DefaultSettingsVolumeProfile.&lt;br /&gt;
&lt;br /&gt;
* In HDRP, if lights in example scenes are too bright, click &amp;quot;match real-time to lightmapped&amp;quot; on Bakery light components.&lt;br /&gt;
&lt;br /&gt;
* Use OpenImageDenoise 2 (best) or OptiX 7 denoiser in HDRP, as it is better suited for high intensity values.&lt;br /&gt;
&lt;br /&gt;
* In HDRP &amp;quot;distance&amp;quot; and regular Shadowmask can be switched on the Light component itself, not in global settings.&lt;br /&gt;
&lt;br /&gt;
* Don't use &amp;quot;match&amp;quot; buttons on the Skylight, as HDRP uses a very specific procedural sky shader. Instead, bake it into a HDRI [[How_do_I...#How_do_I_use_Skylight_with_a_procedural_sky_shader.3F|this way]].&lt;br /&gt;
&lt;br /&gt;
* It is recommended to always set Light Probe Mode to L2 or L1 when using HDRP, as HDRP's renderer is not optimized for the Legacy mode.&lt;br /&gt;
&lt;br /&gt;
* Newest version of HDRP/URP have their own IES file importer. Because of the asset type mismatch, Unity will unplug them from Bakery IES lights saved using older versions, meaning they will appear as regular point lights instead. They can be plugged back and re-saved.&lt;br /&gt;
&lt;br /&gt;
Bakery's example scenes are designed for the Built-in rendering pipeline, so there are a few steps to properly render them in HDRP/URP. Here are some tips; a fresh project with default HDRP/URP settings is assumed:&lt;br /&gt;
&lt;br /&gt;
=== Viewing example scenes on HDRP ===&lt;br /&gt;
* After importing Bakery, upgrade standard materials to HDRP: Edit-&amp;gt;Rendering-&amp;gt;Materials-&amp;gt;Convert All Built-in Materials To HDRP.&lt;br /&gt;
* Import Bakery_ShaderGraphHDRP.unitypackage into the project, as it contains special shader graphs implementing advanced Bakery features (not required for classic color/directional/mask lightmaps).&lt;br /&gt;
* Select DefaultSettingsVolumeProfile.asset. In HDRI Sky section, change Exposure Compensation to 1. Otherwise the default HDRP will be too bright compared to example scenes, and they will appear black due to this exposure adjustment.&lt;br /&gt;
* When selecting lights in example scenes, HDRP will initialize its own light data. Sometimes it may result in the light immediately becoming much brighter. Click &amp;quot;Match real-time to lightmapped&amp;quot; to synchronize.&lt;br /&gt;
* Set Light Probe Mode to L2 before rendering light probes.&lt;br /&gt;
* '''example_directional''': change shaders to BakeryDirSpecGraph to see baked highlights (or just regular HDRP/Lit for diffuse-only normal mapping). Delete the sphere, as there is currently no shader graph supporting per-vertex direction.&lt;br /&gt;
* '''example_directional_MonoSH''': change shaders to BakerySpecMonoSHGraph (or BakeryMonoSHGraph for a slightly cheaper version without highlights). Delete the sphere, as there is currently no shader graph supporting per-vertex MonoSH.&lt;br /&gt;
* '''example_RNM''': change shaders to BakeryRNMGraph.&lt;br /&gt;
* '''example_SH''': change shaders to BakerySpecSHGraph (or BakerySHGraph for a slightly cheaper version without highlights). Delete the sphere, as there is currently no shader graph supporting per-vertex SH.&lt;br /&gt;
* '''example_mixed_directional_mode''': similarly a different graph is needed for MonoSH/RNM/SH planes.&lt;br /&gt;
* '''example_lights''': change the shader of the vertex-lightmapped sphere to BakeryVertexColorGraph.&lt;br /&gt;
* '''example_prefabs_bake''': no further adjustments needed.&lt;br /&gt;
* '''example_sectors''': no further adjustments needed.&lt;br /&gt;
* '''example_shadowmask''': Select the DirectLight and click &amp;quot;Match real-time to lightmapped&amp;quot; to fix brightness. Set Shadowmask Mode to Shadowmask on all HDRP lights. &lt;br /&gt;
* '''example_sponza_day''': set OpenImageDenoise 2 (or Optix 7, if unsupported) as preferred denoiser.&lt;br /&gt;
* '''example_sponza_evening''': set OpenImageDenoise 2 (or Optix 7, if unsupported) as preferred denoiser.&lt;br /&gt;
* '''example_subtractive''': HDRP doesn't support the subtractive mode.&lt;br /&gt;
* '''example_volumes_simple''': change train shader to BakeryVolumeSpecGraph (or BakeryVolumeGraph for a slightly cheaper version without highlights).&lt;br /&gt;
* '''example_volumes_simple_shadowmask''': shadowmask volumes are not currently supported for HDRP.&lt;br /&gt;
* '''example_volumes_advanced''': same as with example_volumes_simple.&lt;br /&gt;
* '''example_translucency''': most of the scene should appear fine. For the &amp;quot;Dynamic sphere lit by volume&amp;quot;, set shader to BakeryVolumeGraph.&lt;br /&gt;
&lt;br /&gt;
=== Viewing example scenes on URP ===&lt;br /&gt;
* After importing Bakery, upgrade standard materials to URP: open Assets/Bakery/examples/content, select all materials by typing &amp;quot;t:material&amp;quot; and choosing to only search the &amp;quot;content&amp;quot; folder below. Click Edit-&amp;gt;Rendering-&amp;gt;Materials-&amp;gt;Convert Selected Built-in Materials To URP.&lt;br /&gt;
* Import Bakery_ShaderGraphURP.unitypackage into the project, as it contains special shader graphs implementing advanced Bakery features (not required for classic color/directional/mask lightmaps).&lt;br /&gt;
* '''example_directional''': change shaders to BakeryURPLit, enable &amp;quot;Bakery Lightmapped Specular&amp;quot; (or just keep regular URP/Lit for diffuse-only normal mapping). Delete the sphere, as there is currently no shader graph supporting per-vertex direction.&lt;br /&gt;
* '''example_directional_MonoSH''': change shaders to BakeryURPLit, set Bakery Mode to MonoSH, enable &amp;quot;Bakery Lightmapped Specular&amp;quot;. On the vertex-lit sphere also enable &amp;quot;Per-vertex&amp;quot;.&lt;br /&gt;
* '''example_RNM''': change shaders to BakeryURPLit, set Bakery Mode to RNM, enable &amp;quot;Bakery Lightmapped Specular&amp;quot;.&lt;br /&gt;
* '''example_SH''': change shaders to BakeryURPLit, set Bakery Mode to SH, enable &amp;quot;Bakery Lightmapped Specular&amp;quot;. Delete the sphere, as there is currently no shader graph supporting per-vertex SH.&lt;br /&gt;
* '''example_mixed_directional_mode''': similarly use BakeryURPLit with a different Bakery Mode (MonoSH, RNM, SH). Non-directional / dominant direction / baked normap maps can use regular URP/Lit.&lt;br /&gt;
* '''example_lights''': no further adjustments needed.&lt;br /&gt;
* '''example_prefabs_bake''': no further adjustments needed.&lt;br /&gt;
* '''example_sectors''': no further adjustments needed.&lt;br /&gt;
* '''example_shadowmask''': similarly to the Built-in pipeline, uncheck Distance Shadowmask in Bakery window (or project Quality Settings) to see actual baked/real-time shadow mixing near the camera.&lt;br /&gt;
* '''example_sponza_day''': enable alpha clipping on the foliage material.&lt;br /&gt;
* '''example_sponza_evening''': same as example_sponza_day.&lt;br /&gt;
* '''example_subtractive''': no further adjustments needed.&lt;br /&gt;
* '''example_volumes_simple''': change train shader to BakeryURPLit and set Bakery Mode to Volume. Optionally enable &amp;quot;Bakery Lightmapped Specular&amp;quot;.&lt;br /&gt;
* '''example_volumes_simple_shadowmask''': same as example_volumes_simple, but also enable &amp;quot;Volume Shadowmask&amp;quot;.&lt;br /&gt;
* '''example_volumes_advanced''': same as with example_volumes_simple.&lt;br /&gt;
* '''example_translucency''': most of the scene should appear fine. For the &amp;quot;Dynamic sphere lit by volume&amp;quot;, set shader to BakeryURPLit and Bakery Mode to Volume.&lt;br /&gt;
&lt;br /&gt;
= Upgrading Bakery =&lt;br /&gt;
When it comes to upgrading the asset, it is recommended to follow these steps:&lt;br /&gt;
* Close Bakery windows.&lt;br /&gt;
* Close Unity.&lt;br /&gt;
* Open it again.&lt;br /&gt;
* Import the updated package.&lt;br /&gt;
&lt;br /&gt;
Note that without first closing Unity importing may fail because of locked DLL files (printing messages like &amp;quot;alphabuffergen.dll: Access is denied.&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
If you moved Bakery folders (Assets/Bakery and Assets/Editor/x64/Bakery) to other locations, you might need to move them back before updating to prevent getting two conflicting copies of the package.&lt;br /&gt;
&lt;br /&gt;
= Scripting API =&lt;br /&gt;
&lt;br /&gt;
==Basic usage==&lt;br /&gt;
&lt;br /&gt;
Get and modify render settings:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ftLightmapsStorage storage = ftRenderLightmap.FindRenderSettingsStorage();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Full list of available settings can be seen in ftLightmapsStorage.cs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Get lightmapper instance and (re)load settings:&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap bakery = ftRenderLightmap.instance != null ? ftRenderLightmap.instance : new ftRenderLightmap();&lt;br /&gt;
bakery.LoadRenderSettings();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Render lightmaps (also probes if they're set to L1 or L2 mode):&lt;br /&gt;
&amp;lt;pre&amp;gt;bakery.RenderButton(bool showMsgWindows)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Render light probes only:&lt;br /&gt;
&amp;lt;pre&amp;gt;bakery.RenderLightProbesButton(bool showMsgWindows)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Render reflection probes only:&lt;br /&gt;
&amp;lt;pre&amp;gt;bakery.RenderReflectionProbesButton(bool showMsgWindows)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''showMsgWindows''' tells if any dialog boxes/confirmations can be shown. Supressed, if set to false.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Check if baking is in progress:&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.bakeInProgress&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For usage example check [[Community_extensions#Batch_scene_baker|Batch Scene Baker]] script.&lt;br /&gt;
&lt;br /&gt;
==Additional functions==&lt;br /&gt;
&lt;br /&gt;
Copies all render settings from one ftLightmapsStorage to another:&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmapsStorage.CopySettings(ftLightmapsStorage src, ftLightmapsStorage dest)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Gets global (per-project) storage object:&lt;br /&gt;
&amp;lt;pre&amp;gt;ftGlobalStorage gstorage = ftLightmaps.GetGlobalStorage()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copies all render settings from ftLightmapsStorage (per-scene) to ftGlobalStorage  (per-project):&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmapsStorage.CopySettings(ftLightmapsStorage src, ftGlobalStorage dest)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copies all render settings from ftGlobalStorage (per-project) to ftLightmapsStorage (per-scene):&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmapsStorage.CopySettings(ftGlobalStorage src, ftLightmapsStorage dest)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Gets the path to the folder containing Bakery binaries:&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmaps.GetEditorPath()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Additional variables==&lt;br /&gt;
&lt;br /&gt;
Gets the current temporary files path (ftRenderLightmap instance must be created first):&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.scenePath&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Gets/sets UVGBuffer data compression (LZ4, if enabled, DDS if not):&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.compressedGBuffer&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Gets/sets output lightmap data compression (LZ4, if enabled, DDS if not):&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.compressedOutput&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Events==&lt;br /&gt;
&lt;br /&gt;
Scripts can subscribe to static events in ftRenderLightmap class.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Called before full Render:&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnPreFullRender&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Called before each light probe is rendered in Legacy light probe mode. ProbeEventArgs is a struct containing '''pos''' field with current light probe position:&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler&amp;lt;ProbeEventArgs&amp;gt; OnPreRenderProbe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Called after Legacy light probes were rendered:&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnFinishedProbes&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Called after full Render was finished:&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnFinishedFullRender&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Called before reflection probes are rendered:&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnPreReflectionProbeRender&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Called after reflection probes were rendered:&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnFinishedReflectionProbes&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mr F</name></author>
		
	</entry>
	<entry>
		<id>https://geom.io/bakery/wiki/index.php?title=Bakery_-_GPU_Lightmapper&amp;diff=1846</id>
		<title>Bakery - GPU Lightmapper</title>
		<link rel="alternate" type="text/html" href="https://geom.io/bakery/wiki/index.php?title=Bakery_-_GPU_Lightmapper&amp;diff=1846"/>
		<updated>2025-12-24T16:19:33Z</updated>

		<summary type="html">&lt;p&gt;Mr F: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[What is Bakery and why use it]]&lt;br /&gt;
&lt;br /&gt;
== Bakery for Unity ==&lt;br /&gt;
* [https://assetstore.unity.com/packages/tools/level-design/bakery-gpu-lightmapper-122218 Asset Store page]&lt;br /&gt;
* [[Github access]]&lt;br /&gt;
* '''[[RTPreview|RTPreview manual]]'''&lt;br /&gt;
* '''[[Manual|Manual (v1.95)]]'''&lt;br /&gt;
* [https://docs.google.com/document/d/1r-ZFqovUkVXL-1S9ATYqUHL00M5SpiM2Qwjg0eVCJ4Y/edit Changelog]&lt;br /&gt;
* [https://drive.google.com/file/d/1i_zkeB4VBgNOI_-dBqxkdwZ4HCj6tTyA/view?usp=share_link Latest URP graphs (rev 2.0) (12.1.6)]&lt;br /&gt;
* [https://drive.google.com/file/d/1kutq2zwyOGhSw79_rtZNeW5cFOLWzuVr/view?usp=share_link Latest URP graphs (14.0.7)]&lt;br /&gt;
* [https://drive.google.com/file/d/1CIM7_LFaMJ2lxs4eZMZ-KgX8OA7KBt2U/view?usp=sharing Latest URP graphs (15.0.6)]&lt;br /&gt;
* [https://drive.google.com/file/d/1IJIbw2He3c5xa9hdaTVHnqIf5Ewfg0gZ/view?usp=sharing Latest URP graphs (15.0.7)]&lt;br /&gt;
* [https://drive.google.com/file/d/1lmQsDjLnP-HlslQNHffjqj6Bty9iJUzH/view?usp=sharing Latest URP graphs (16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/1mTpG6o9RfjSlq8EBdpQ8kSZVZq3JP4BQ/view?usp=sharing Latest URP graphs (rev 9.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/1fw7OM83pp0jRHqLjpF2WRZYSd1Z1H1Eh/view?usp=sharing Latest URP graphs (rev 12.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/18TU_8MpVdUiSQjCm1JWyg-binr02ZfzZ/view?usp=sharing Latest URP graphs (rev 13.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/15Nga4ld-F0_GzCfkDLrE3Uv1QfIYvIGk/view?usp=sharing Latest URP graphs (rev 14.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/1x6kCNmJzKgOnnQRQx7ol5VSNMq4VwFeU/view?usp=sharing Latest URP graphs (rev 15.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/1RvaSoy4ceOCTQIHs5DvdYlt5gUEkDYG5/view?usp=sharing Latest URP graphs (rev 16.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/1-1_oNZyPptlcUWWjcXzcTv1-b-mPJBsw/view?usp=sharing Latest HDRP graphs (10.4.0)]&lt;br /&gt;
* [https://drive.google.com/file/d/1hYn8FXPf47FsVTgoao0jV0AqxGFN48dH/view?usp=sharing Latest HDRP graphs (11.0.0)]&lt;br /&gt;
* [https://drive.google.com/file/d/1dLlg-GWYbyzvG9jo9srnpnht1S19W6Z2/view Latest HDRP graphs (12.1.6)]&lt;br /&gt;
* [https://drive.google.com/file/d/1RBRS024Dd9ddM-35D1KssOReTrcC8zGn/view?usp=sharing Latest HDRP graphs (14.0.7)]&lt;br /&gt;
* [https://drive.google.com/file/d/1z3jSHNgHALU6r3b6lBXEBvHLlxEmXARZ/view?usp=sharing Latest HDRP graphs (rev 2.0) (14.0.7)]&lt;br /&gt;
* [[FAQ]]&lt;br /&gt;
* [[How do I...]]&lt;br /&gt;
* [[Reporting bugs]]&lt;br /&gt;
* [[Troubleshooting]]&lt;br /&gt;
* [[Community extensions]]&lt;br /&gt;
* [https://discord.gg/dP3SkdM Community Discord]&amp;lt;br&amp;gt;&amp;lt;small&amp;gt;(for support, please contact me on [https://discussions.unity.com/t/bakery-gpu-lightmapper-v1-96-rtpreview-released/704890/7512 Unity forum] / [https://github.com/guycalledfrank/bakery-issues/issues github] / or via email listed [https://assetstore.unity.com/publishers/37453 here]).&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bakery is made by [https://twitter.com/guycalledfrank Mr F]&lt;br /&gt;
&lt;br /&gt;
== Decalery ==&lt;br /&gt;
* '''[[Decalery manual]]'''&lt;br /&gt;
* [[Decalery Github access]]&lt;/div&gt;</summary>
		<author><name>Mr F</name></author>
		
	</entry>
	<entry>
		<id>https://geom.io/bakery/wiki/index.php?title=Troubleshooting&amp;diff=1845</id>
		<title>Troubleshooting</title>
		<link rel="alternate" type="text/html" href="https://geom.io/bakery/wiki/index.php?title=Troubleshooting&amp;diff=1845"/>
		<updated>2025-12-22T01:12:07Z</updated>

		<summary type="html">&lt;p&gt;Mr F: /* &amp;quot;Exporting scene - preparing&amp;quot; is taking too long */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a list of common problems, their symptoms and solutions.&lt;br /&gt;
&lt;br /&gt;
=== Shadowmasks are not baked ===&lt;br /&gt;
Check following things:&lt;br /&gt;
* Bakery's [[Manual#Render Mode|Render Mode]] is set to Shadowmask.&lt;br /&gt;
* Masked lights have both Unity and Bakery light components on them.&lt;br /&gt;
* Masked Bakery light components have &amp;quot;Baked contribution&amp;quot; set to &amp;quot;Indirect and shadowmask&amp;quot;.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Shadowmasks are baked, but Unity renders real-time shadows instead ===&lt;br /&gt;
You're in Distance Shadowmask mode, it's expected. Read more about the difference:&lt;br /&gt;
&lt;br /&gt;
https://docs.unity3d.com/Manual/LightMode-Mixed-Shadowmask.html&lt;br /&gt;
&lt;br /&gt;
https://docs.unity3d.com/Manual/LightMode-Mixed-DistanceShadowmask.html&lt;br /&gt;
&lt;br /&gt;
* To switch between two modes, you can use &amp;quot;Distance Shadowmask&amp;quot; checkbox in Bakery main window.&lt;br /&gt;
* If you're on 5.6, go to Window-&amp;gt;Lighting-&amp;gt;Mixed Lighting-&amp;gt;Lighting Mode to switch the mode.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I can't see specular lighting after the bake ===&lt;br /&gt;
Apparently specular lighting was provided by real-time lights before the bake. Now the lighting is baked into static textures and there is no specular. However, you can:&lt;br /&gt;
* Use Reflection Probes. Good option for highly glossy objects.&lt;br /&gt;
* Use mixed lights and only bake GI/[[Manual#Shadowmask|Shadowmasks]]. Specular remains real-time.&lt;br /&gt;
* Bake in [[Manual#Dominant_Direction|Dominant Direction]] or [[Manual#SH|SH]] mode and use [[Manual#Bakery_shaders|Bakery shaders]] with &amp;quot;Lightmapped specular&amp;quot; option. It will give some specular approximation. Looks good on surfaces with medium/high roughness.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Using a version control system I copied the scene to another PC and it doesn't look right ===&lt;br /&gt;
Make sure you followed [[How_do_I...#How_do_I_use_git.2Fcollab.2Fother_version_control_system_with_Bakery.3F|version control guidelines]].&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Baking same asset in one scene breaks its UVs in another scene ===&lt;br /&gt;
The reason here is [[Manual#Asset_UV_Processing|UV padding adjustment]]. It modifies the UVs in the asset, so spacing between UV charts is optimal, meaning they never leak over each other and there is no much wasted space. Unity has a manual Pack Margin option on model assets, but it’s limited since it applies the same exact value for all meshes inside the model, while each mesh can get drastically different size in the final lightmap based on its surface area. Therefore Bakery overrides it with automatically calculated per-mesh (instead of per-model) padding. However, because “optimal” varies depending on baking resolution, it can be problematic to reuse the same asset in isolated scenes with different lightmap size. There are multiple ways to solve it:&lt;br /&gt;
* a) Just disable UV padding adjustment (set to [[Manual#Asset_UV_Processing|Don't Change]]). Results will be similar to built-in baking.&lt;br /&gt;
* b) Generate your own optimal UVs. UV padding adjustment only applies to models with auto-generated UV layout (aka “Generate Lightmap UVs” checkbox) and never touches custom data.&lt;br /&gt;
* c) Set Asset UV Processing to &amp;quot;Adjust UV padding only for new meshes&amp;quot; (currently available in the [[Github_access|github]] version).&lt;br /&gt;
* d) Use [[Manual#UV_padding:_increase_only|UV padding: increase only]] checkbox and first bake the lowest resolution scene, and then the rest.&lt;br /&gt;
* e) Use two different models for different lightmap resolutions, so each will get the most efficient set of UVs.&lt;br /&gt;
* f) Bake both scenes together.&lt;br /&gt;
* g) Lock UVs using [[How_do_I...#Alternative_solution|Save UV padding to asset]]&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser throws error 505 or Unknown error ===&lt;br /&gt;
[https://www.nvidia.com/Download/index.aspx?lang=en-US Update the driver].&lt;br /&gt;
&lt;br /&gt;
If you are using a Kepler GPU, try switching to [[Manual#Legacy_denoiser|legacy denoiser]].&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get an “Out of memory” error ===&lt;br /&gt;
This means rendering needed more video memory from your GPU than it has available.&lt;br /&gt;
&lt;br /&gt;
First, try closing any other graphics-intensive programs (browsers too).&lt;br /&gt;
&lt;br /&gt;
If the problem persists, the most likely reason is that the resolution you selected is unreasonably high for the given scene. Resolution is defined by [[Manual#Texels_per_unit|Texels per Unit]] (this section also has a list of reference values) or set explicitly in [[Manual#Bakery_Lightmap_Group_Selector|Lightmap Groups]]. Reducing it will help. You can always selectively use high resolution for important objects via [https://docs.unity3d.com/Manual/class-MeshRenderer.html Scale in Lightmap].&lt;br /&gt;
&lt;br /&gt;
If you have terrains in your scene, make sure [[Manual#Terrain_optimization|Terrain optimization]] is enabled.&lt;br /&gt;
&lt;br /&gt;
If you have a very high amount of painted trees on your terrain, try disabling the [[Manual#Export_terrain_trees|Export terrain trees]] option.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a “Can't map texture” error ===&lt;br /&gt;
Typically happens if your system went out of RAM (system memory, not video memory) during the scene export process. Your scene could already be taking too much RAM by itself, not leaving enough free memory for Bakery export.&lt;br /&gt;
&lt;br /&gt;
* Try closing any memory-intensive programs before baking.&lt;br /&gt;
* Try reducing [[Manual#Max_resolution|Max Resolution]] from 4096 to 2048.&lt;br /&gt;
* If you are baking very highly detailed (millions of triangles) geometry, try excluding some of it from the bake.&lt;br /&gt;
* Try disabling [[Manual#Export_terrain_trees|Export terrain trees]].&lt;br /&gt;
* Try enabling [[Manual#Terrain_optimization|Terrain optimization]].&lt;br /&gt;
&lt;br /&gt;
This error can also be shown in case of GPU driver crash, in which case Unity editor also won't render anything.&lt;br /&gt;
&lt;br /&gt;
If this error happens at the end of the render process (from the seamfixer app), try increasing the [[Troubleshooting#I_get_a_.22Launch_timeout.22_error|TDR]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a “Can't create texture” or &amp;quot;Can't create rasterizer state&amp;quot; error ===&lt;br /&gt;
Typically errors like this are caused by such chain of events:&lt;br /&gt;
* Some objects in the scene have incorrect lightmapping UVs. Often the UVs contain many large triangles overlapping each other.&lt;br /&gt;
* Scene uses large lightmaps.&lt;br /&gt;
* Bakery tries to rasterize a huge amount of 4k-sized overlapping triangles to prepare the UV GBuffer.&lt;br /&gt;
* This operation takes &amp;gt; 2 seconds, and the driver is reset by Windows due to TDR: https://docs.microsoft.com/en-us/windows-hardware/drivers/display/timeout-detection-and-recovery&lt;br /&gt;
* Consequent GPU operations are failed due to reset.&lt;br /&gt;
&lt;br /&gt;
Solution:&lt;br /&gt;
* Make sure all your objects either have non-overlapping UV2 or enable &amp;quot;Generate lightmapping UVs&amp;quot; on all model assets.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== After importing Bakery I get errors containing “obsolete” and “UnityUpgradable” ===&lt;br /&gt;
Before importing Bakery, make sure you don't have any compilation errors in your project.&lt;br /&gt;
&lt;br /&gt;
Restart Unity, reimport the package. Click “I made a backup, go ahead” if Unity asks.&lt;br /&gt;
&lt;br /&gt;
See [https://docs.unity3d.com/Manual/APIUpdater.html this page] for more details.&lt;br /&gt;
&lt;br /&gt;
It is also known that some versions of Unity Hub have a [https://forum.unity.com/threads/bakery-gpu-lightmapper-v1-6-released.536008/page-63#post-4668227 bug] preventing API updater from running.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a &amp;quot;Can't load&amp;quot; error ===&lt;br /&gt;
If Bakery says it can't load something, make sure you have enough free disk space on the drive used for [[Manual#Temp_path|temporary data]].&lt;br /&gt;
&lt;br /&gt;
Some parts of Bakery can't deal with non-ASCII characters (this is going to be fixed soon). Try naming your scenes and lightmap group assets with ASCII characters. Latin letters and numbers must always work.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a &amp;quot;Launch timeout&amp;quot; error ===&lt;br /&gt;
This error can happen if your GPU took more time than it is allowed by [https://docs.microsoft.com/en-us/windows-hardware/drivers/display/timeout-detection-and-recovery Windows TDR].&lt;br /&gt;
* Try disabling [[Manual#Terrain_optimization|Terrain Optimization]].&lt;br /&gt;
* Try lowering the value of [[Manual#Tile_size|Tile Size]], especially if it's higher than 512, so baking job is split into smaller chunks.&lt;br /&gt;
* Depending on the pass being processed, try lowering the Samples value (e.g. [[Manual#Samples|GI samples]], [[Manual#Bakery_Sky_Light|Skylight samples]], etc).&lt;br /&gt;
* Reduce geometric complexity of the scene, if tile size/samples don't help.&lt;br /&gt;
* As a last resort, [https://docs.microsoft.com/en-us/windows-hardware/drivers/display/tdr-registry-keys disable TDR registry keys]. This will prevent Windows from resetting the driver, but your computer may appear unresponsive during the bake.&lt;br /&gt;
&lt;br /&gt;
[https://substance3d.adobe.com/documentation/spdoc/gpu-drivers-crash-with-long-computations-tdr-crash-128745489.html Additional instructions for changing the timeout (from Substance)]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I have an Android project, and lightmaps don't look good ===&lt;br /&gt;
[[File:Banding.jpg|Android banding artifacts|thumb]]&lt;br /&gt;
[[File:LightmapsTechnicalDetails.png|Lightmap encoding in player settings|thumb]]&lt;br /&gt;
[[File:Astc.jpg|Build texture compression settings|thumb]]&lt;br /&gt;
Sometimes, when working on Android projects, you may encounter banding artifacts, with gradients having discrete steps of different hue.&lt;br /&gt;
This is caused by texture compression and HDR encoding Unity uses for this platform, which often turns out to be &amp;quot;Double LDR&amp;quot; ([https://docs.unity3d.com/Manual/Lightmaps-TechnicalInformation.html see details]). The problem is not exclusive to Bakery and will as well happen with built-in lightmaps.&lt;br /&gt;
&lt;br /&gt;
In Player Settings, set Lightmap Encoding to '''High Quality'''.&lt;br /&gt;
&lt;br /&gt;
If your target devices support ASTC compression, make sure it is enabled in Build settings. PVRTC is also a good choice, although it is mostly supported on iOS devices. ETC compression gives poor results for lightmaps.&lt;br /&gt;
&lt;br /&gt;
If above solutions are not enough, select lightmap assets and set texture compression quality to '''High''' or '''None''' (try both).&lt;br /&gt;
&lt;br /&gt;
Note that setting it to None will use more video memory on the device.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I have a scene baked with MonoSH, and lighting looks pixelated ===&lt;br /&gt;
[[File:Normalq.jpg|MonoSH compressed with low quality encoding|thumb]]&lt;br /&gt;
In some scenes, [[Manual#MonoSH|MonoSH]] lightmaps can look pixelated, if low (or &amp;quot;normal&amp;quot;) quality compression is used (e.g. DXT1). Usually setting Compression = High on the L1 texture fixes the issue.&lt;br /&gt;
&lt;br /&gt;
You can enable all L1 textures to always use High quality compression by toggling Project Settings -&amp;gt; Bakery -&amp;gt; '''High quality direction'''.&lt;br /&gt;
&lt;br /&gt;
Note that depending on the platform, High quality compression can take more memory. On PC it usually doubles by going from DXT1 to BC7 format.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== There are weird square artifacts on my geometry ===&lt;br /&gt;
[[File:Smoothnormals flatshape.jpg|Square artifacts from incorrect normals|thumb]]&lt;br /&gt;
Weird squares may sometimes be seen on models when their shape is too different from their normals. Bakery [https://ndotl.wordpress.com/#shadowterm tries to compensate] starting ray points to take fake normal smoothness into account, but in extreme cases the algorithm can't handle the discrepancy.&lt;br /&gt;
Usually it's enough to just recalculate normals on the model. E.g. in Unity you can select the FBX and change &amp;quot;Normals&amp;quot; to &amp;quot;Calculate&amp;quot; instead of &amp;quot;Import&amp;quot;.&lt;br /&gt;
Alternatively, you can disable the related compensation algorithm, but it’s actually beneficial in most cases. You can toggle it in Project Settings → Bakery → Generate smooth positions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get too many lightmaps ===&lt;br /&gt;
Possible causes are:&lt;br /&gt;
&lt;br /&gt;
* [[Manual#Atlas_Packer|Atlas packer]] is set to ''Default'' or ''Post-packing'' is disabled. Set Atlas Packer to ''xatlas'' and enable Post-packing for best results.&lt;br /&gt;
&lt;br /&gt;
* ''Texels Per Unit'' value is high or ''Max Resolution'' is low. Bakery packs objects from open scenes into multiple lightmap atlases and packs them as rectangles (in a fashion similar to [https://blackpawn.com/texts/lightmaps/default.html this]; unless Hole Filling is enabled) with their size dependent on (surface area * texels per unit). If some object can't fit into existing atlases, a new one is allocated. New atlases are always as large as the Max Resolution parameter, or smaller (but not smaller than ''Min Resolution''), if the estimated surface area of remaining unpacked objects is below some threshold. You can also increase Min Resolution a bit, replacing a bunch of small (but dense) maps with a few large (but possibly with some empty space).&lt;br /&gt;
&lt;br /&gt;
Additionally, increase ''Min Resolution'' to prefer larger combined lightmaps instead of many smaller ones.&lt;br /&gt;
&lt;br /&gt;
If not using post-packing:&lt;br /&gt;
&lt;br /&gt;
* If you bake multiple open scenes and ''Split by scene'' checkbox is on, different scenes will never share the same lightmap, therefore multiplying their count.&lt;br /&gt;
* If ''Terrain optimization'' is on, terrains will always use a separate lightmap.&lt;br /&gt;
Pre-atlasing your scene in your modelling package of choice and using the [https://geom.io/bakery/wiki/index.php?title=Manual#Bakery_Lightmap_Group_Selector Original UV] mode instead of relying on the auto-atlaser can significantly improve packing effectiveness.&lt;br /&gt;
&lt;br /&gt;
Since v1.71 Bakery prints number of future used lightmaps to console when enabling/refreshing Checker Preview. You can experiment with resolution/density settings until the desired value is printed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get jagged shadows ===&lt;br /&gt;
[[File:Softshadows.png|Jagged shadow mitigation|thumb]]&lt;br /&gt;
Apparently you are baking very sharp shadows at low resolution. Try increasing shadow spread parameter on the light ([[Manual#Bakery_Direct_Light|direct]] or [[Manual#Bakery_Point_Light|point]]) and optionally enable [[Manual#Shader_Tweaks|bicubic interpolation]].&lt;br /&gt;
On a [[Manual#Bakery_Direct_Light|Direct Light]] you can also enable the '''Anti-Alias''' option.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Exporting scene - preparing&amp;quot; is taking too long ===&lt;br /&gt;
(Or &amp;quot;Exporting scene - atlasing&amp;quot;)&lt;br /&gt;
* Try setting [[Manual#Atlas_Packer|Atlas Packer]] to Default.&lt;br /&gt;
* Make sure you use reasonable [[Manual#Texels_per_unit|Texels Per Unit]] value.&lt;br /&gt;
* Make sure your meshes are [[Manual#Quickstart|correctly unwrapped]].&lt;br /&gt;
* Possibly disable [[Manual#Asset_UV_Processing|UV Padding Adjustment]].&lt;br /&gt;
&lt;br /&gt;
If you're converting a large existing scene, make sure to follow [[How_do_I...#How_do_I_quickly_port_my_existing_scene_to_Bakery.3F|this guide]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Stuck at &amp;quot;Waiting for Unity to initialize the probes...&amp;quot; ===&lt;br /&gt;
There isn't much Bakery can do about the logic of Unity lighting data asset generation (there is no API in the engine to control it at the moment). Try to focus editor window (especially scene view) to wake Unity up.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Baked prefabs instantiated at runtime in a build have no lightmaps ===&lt;br /&gt;
Because Unity technically has no support for prefabs having lightmaps, it can omit lightmapped shader versions from builds, not realizing they are needed. You can fix it by going to [https://docs.unity3d.com/Manual/class-GraphicsSettings.html?_ga=2.212464724.1917527976.1586930444-1257434621.1522062178#stripping Shader stripping settings] and enabling lightmap modes you use.&lt;br /&gt;
Additionally, try disabling '''Optimize Mesh Data''' in Player Settings, as Unity may omit UV from the build.&lt;br /&gt;
&lt;br /&gt;
{{note|In Shader Stripping settings &amp;quot;Directional&amp;quot; mode only applies to standard Unity directional maps aka [[Manual#Dominant_Direction|Dominant Direction]]. When using Baked Normal Maps, RNM or SH, use &amp;quot;Non-directional&amp;quot; lightmap mode checkboxes.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Speedtrees look fine in the editor, but black in builds ===&lt;br /&gt;
Also related to shader stripping. See the [[Troubleshooting#Baked_prefabs_instantiated_at_runtime_in_a_build_have_no_lightmaps|prefab solution]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Scene is black in build ===&lt;br /&gt;
See advice above. Additionally, if the scene is loaded asynchronously, call ftLightmaps.RefreshFull() when it is fully loaded.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== HDRI produces scattered bright spots (fireflies) ===&lt;br /&gt;
[[File:Fireflies.jpg|thumb|Typical &amp;quot;fireflies&amp;quot;]]&lt;br /&gt;
[[File:Upload 2019-7-3 11-27-22.png|thumb|Removing sun from HDRI]]&lt;br /&gt;
This artefact comes from the fact your HDRI has very bright, yet very small parts, typically sun. Rays will miss it often, producing occasional spots when they don't. This problem is well known in many offline ray tracers as well.&lt;br /&gt;
* Use [[Manual#Bakery_Direct_Light|Direct Light]] for the sun&lt;br /&gt;
* Remove sun from HDRI (also [https://seblagarde.wordpress.com/2016/08/28/siggraph-2016-an-artist-friendly-workflow-for-panoramic-hdri/ recommended by Unity])&lt;br /&gt;
* Possibly downsample/blur the HDRI&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Small emissive (or brightly lit) surfaces produce noise ===&lt;br /&gt;
The issue is similar to the one above and may happen when using very small and very bright emissive surfaces, or small non-emissive surfaces lit by a very intense light. In case of emissive surfaces, you can replace them with [[Manual#Bakery_Light_Mesh|Light Meshes]] to prevent it. See [[Manual#Differences_between_Light_Mesh_and_emissive_materials|Differences between Light Mesh and emissive materials]]. Alternatively, try increasing [[Manual#Samples|GI sample count]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Adjusting UV padding&amp;quot; happens too often and takes too much time ===&lt;br /&gt;
[[Manual#Asset_UV_Processing|UV padding adjustment]] is a feature that optimizes asset UVs based on the size they take in lightmaps. This process will happen for a model if:&lt;br /&gt;
* Option is globally enabled.&lt;br /&gt;
* Asset has &amp;quot;Generate Lightmap UVs&amp;quot; checkbox enabled. Models with custom UVs are not adjusted.&lt;br /&gt;
* Model was not adjusted before or...&lt;br /&gt;
* ... its lightmap size has changed.&lt;br /&gt;
Therefore it can be triggered for all auto-unwrapped models after their geometry or resolution changes.&lt;br /&gt;
UV padding adjustment will try to waste less lightmap resolution and reduce texel leaking, but it is not necessary. If you are doing many experimental/draft bakes, you may consider disabling it (set to &amp;quot;Don't change&amp;quot;), then possibly enabling it back for the final quality bake.&lt;br /&gt;
&lt;br /&gt;
Also note that using xatlas as [[Manual#Unwrapper|Unwrapper]] can be notoriously slower comparing to Default.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser produces bright edges around geometry/shadows ===&lt;br /&gt;
[[File:Bredges.jpg|thumb|Bright edges]]&lt;br /&gt;
Sometimes you may encounter bright edges or spots at high contrast edges caused by the denoising neural net, most notably OptiX 6 and 7.&lt;br /&gt;
* Use OptiX 5 or OpenImageDenoise if you can ([[Manual#Denoiser|denoiser]] option).&lt;br /&gt;
* Try enabling [[Manual#Denoise:_fix_bright_edges|Denoise: Fix bright edges]].&lt;br /&gt;
* Try setting texture compression to None on lightmap assets.&lt;br /&gt;
* Try setting [[Manual#Backface_GI|Backface GI]] to 1, removing dark shadows inside objects. While these shadows are normally not visible, their edges may cause problems for both the denoiser and texture compression.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Light probes are too bright in Subtractive mode ===&lt;br /&gt;
&lt;br /&gt;
[[File:98911466-ae8c5b00-24d5-11eb-8d51-4e764ac0f163.png|thumb|The effect of occlusion probes]]&lt;br /&gt;
&lt;br /&gt;
Light occlusion information is not baked into probes. Solution:&lt;br /&gt;
* Set your Unity directional light to Mixed mode.&lt;br /&gt;
* Enable [[Manual#Occlusion_probes|Occlusion Probes]].&lt;br /&gt;
* Bake&lt;br /&gt;
&lt;br /&gt;
Some versions of Unity may need a scene reload to properly apply the Lighting Data Asset.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Baking produces &amp;quot;Not allowed to access uv2&amp;quot; errors ===&lt;br /&gt;
All lightmapped models must have [https://docs.unity3d.com/Manual/FBXImporter-Model.html Read/Write enabled] on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Whole scene is very bright or black ===&lt;br /&gt;
* Check if your light intensities are in a reasonable range (&amp;lt; 100; or &amp;lt;= 100000 Lux in HDRP).&lt;br /&gt;
* Check the same for indirect intensity on all lights. A multiplication of direct and intensity intensity must not go into thousands, otherwise GI algorithm may overflow.&lt;br /&gt;
* Check if you don't use assets with High mesh compression. When set to High, Unity mesh compression will completely destroy lightmap UVs, only leaving 8 bits for them. This may produce many lightmapping errors including this one.&lt;br /&gt;
* Check if you have any .hdr overrides in the Preset Manager that change the way lightmaps are imported.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery says &amp;quot;Device is not DX11&amp;quot; ===&lt;br /&gt;
Currently Bakery needs Unity editor to be running in DX11 mode to directly exchange texture data, so make sure your editor's window header says &amp;quot;&amp;lt;DX11&amp;gt;&amp;quot;. If it does not, change active graphics API to DX11: &lt;br /&gt;
* Go to Player Settings.&lt;br /&gt;
* If &amp;quot;Auto Graphics API for Windows&amp;quot; is unchecked, you will see a list of APIs.&lt;br /&gt;
* Make sure &amp;quot;Direct3D11&amp;quot; is on top or place it there.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery doesn't work on my 3070/3080/3090 GPU? ===&lt;br /&gt;
1. Please enable [[Manual#RTX_Mode|RTX mode]].&lt;br /&gt;
&lt;br /&gt;
2. If denoiser also fails, please update from [[Github_access|github]] and use OpenImageDenoise option (some instructions are [[Troubleshooting#Denoiser_produces_bright_edges_around_geometry.2Fshadows|here]]).&lt;br /&gt;
&lt;br /&gt;
Updated denoiser (both new OptiX version and OpenImageDenoise) as well as automatic hardware detection will be soon released on the Asset Store.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser produces grid-like patterns ===&lt;br /&gt;
[[File:Gridlike.jpg|thumb|Grid-like denoiser pattern]]&lt;br /&gt;
&lt;br /&gt;
OptiX denoiser might produdce grid-like patterns when fed with very low-precision lightmaps. Low precision is usually caused by either extremely dark or extremely bright lighting. It is recommended to stay within reasonable intensity range (see a similar advice for [[Troubleshooting#Lightmaps_look_black_or_have_bad_quality_in_an_HDRP_scene|HDRP]] above).&lt;br /&gt;
&lt;br /&gt;
* Alternatively use OpenImageDenoise, as it does not produce this pattern.&lt;br /&gt;
&lt;br /&gt;
* This issue also does not affect OptiX 5.1 denoiser (&amp;quot;Legacy denoiser&amp;quot;) as its training dataset is in its own DLL, but affects the non-legacy version (OptiX 6.0) and only on driver versions newer than 442.50, as the training datasets are in the driver ([https://forums.developer.nvidia.com/t/optix7-denoiser-different-results-with-different-version-of-drivers/117989/2 explanation from NVIDIA]).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get &amp;quot;rtcRes == RTC_SUCCESS&amp;quot; error ===&lt;br /&gt;
&lt;br /&gt;
You are using a 3xxx+ GPU with RTX mode disabled. Enable [[Manual#RTX_Mode|RTX mode]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Baking any scene crashes with unknown error ===&lt;br /&gt;
&lt;br /&gt;
There were [https://twitter.com/HarryAlisavakis/status/1331630028665348096 some reports] that Avast antivirus can block Bakery from running, even though Bakery's executables don't trigger any antivirus (including Avast) when [https://twitter.com/guycalledfrank/status/1331640614077796354 scanned via VirusTotal]. Perhaps it just block any executables that were launched 'indirectly', i.e. from another application. In any case, if you have Avast, try adding your project folder to exception list.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Combined meshes (e.g. using Mesh Combine asset) bake incorrectly ===&lt;br /&gt;
&lt;br /&gt;
[[File:Meshcombine.jpg|thumb|Mesh Combine &amp;quot;Regenerate Lightmap UVs&amp;quot; option]]&lt;br /&gt;
&lt;br /&gt;
Most mesh combining assets have an option to regenerate lightmap UVs. Without it, combined UVs will overlap each other. If you are using Mesh Combine, make sure &amp;quot;Regenerate Lightmap UVs&amp;quot; option is enabled in output settings.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a &amp;quot;Can't create vertex buffer&amp;quot; error ===&lt;br /&gt;
&lt;br /&gt;
This error can happen if the scene has more than ~40 million vertices. It is recommended to reduce geometric complexity of the scene, as tracing it would be too slow anyway. The typical cause of going over this limit is trying to bake with large arrays of trees painted on the terrain. In this case try disabling [[Manual#Export_terrain_trees|Export Terrain Trees]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Soft shadows appear like multiple hard shadows ===&lt;br /&gt;
&lt;br /&gt;
[[File:Unknown.png|thumb|Undersampled shadow]]&lt;br /&gt;
&lt;br /&gt;
Increase ''Shadow Samples'' on the light or decrease the ''Shadow Spread''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Lightmaps are black on GTX 650 ===&lt;br /&gt;
&lt;br /&gt;
Apparently newer Nvidia drivers deprecate some CUDA functions on older hardware. It is recommended to use driver version 442 on GTX 650, as it still supported everything Bakery uses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Lightmaps disappear on play ===&lt;br /&gt;
&lt;br /&gt;
* Make sure that '''Project Settings''' -&amp;gt; '''Editor''' -&amp;gt; '''Enter Play Mode Settings''' -&amp;gt; '''Reload Scene''' is turned '''on'''.&lt;br /&gt;
* If that doesn't help, try applying the latest [[Github_access|patch]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I get a DllNotFoundException ===&lt;br /&gt;
&lt;br /&gt;
* Check if the DLL file mentioned in the error actually exists in your project. If it doesn't, your Bakery installation is incomplete or corrupted; please reinstall it.&lt;br /&gt;
* Check if you're running 64-bit Unity Editor under 64-bit Windows (7 or newer) (as listed in [[Manual#System_requirements|system requirements]]).&lt;br /&gt;
* Make sure you have 64-bit [https://www.microsoft.com/en-us/download/details.aspx?id=48145 Visual C++ Redistributables for Visual Studio 2015] installed. In case if the Microsoft site download is broken, here is a [https://drive.google.com/file/d/1WfRP1A43bCwZflZ_I0wHSGPyC3b-0lqK/view?usp=sharing reupload].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Lightmap UVs are wrong when opening previously baked project on a Mac ===&lt;br /&gt;
&lt;br /&gt;
When Unity reimports model assets, it performs UV unwrapping. If you baked the scene with [[Manual#Unwrapper|Unwrapper]] was set to xatlas, it won't work on a Mac because Bakery's xatlas wrapper library is only compiled for Windows. Rebaking with Default unwrapper should fix it.&lt;br /&gt;
&lt;br /&gt;
You can still keep xatlas as the [[Manual#Atlas_Packer|Atlas Packer]].&lt;br /&gt;
&lt;br /&gt;
''Unwrapper'' is used to generate UVs for individual, isolated meshes, while ''Atlas Packer'' packs big scene-specific atlases out of many unwrapped layouts.&lt;br /&gt;
&lt;br /&gt;
Combining Default unwrapper with xatlas being used as the Atlas Packer and enabling [[Manual#Hole_filling|Hole Filling]] should give pretty good [https://x.com/guycalledfrank/status/1231890428313600000 results] and compensate for any individual mesh unwrapping inefficiencies.&lt;/div&gt;</summary>
		<author><name>Mr F</name></author>
		
	</entry>
	<entry>
		<id>https://geom.io/bakery/wiki/index.php?title=Bakery_-_GPU_Lightmapper&amp;diff=1844</id>
		<title>Bakery - GPU Lightmapper</title>
		<link rel="alternate" type="text/html" href="https://geom.io/bakery/wiki/index.php?title=Bakery_-_GPU_Lightmapper&amp;diff=1844"/>
		<updated>2025-12-15T16:43:58Z</updated>

		<summary type="html">&lt;p&gt;Mr F: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{note|December 2025 update: Nvidia driver 591.44 breaks OptiX6 support and therefore Bakery. If you get &amp;quot;Failed to load OptiX library&amp;quot;, please use any older driver.&amp;lt;br&amp;gt;In the meantime I'm waiting for a response from Nvidia and working on a patch.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
UPDATE December 15th: Bakery has been updated to support new drivers. Please try the latest [[Github access|github]] version. If no issues are reported within a week, the patch will land on the Asset Store.}}&lt;br /&gt;
Nvidia drivers can be downloaded [https://www.nvidia.com/Download/index.aspx?lang=en-US here].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[What is Bakery and why use it]]&lt;br /&gt;
&lt;br /&gt;
== Bakery for Unity ==&lt;br /&gt;
* [https://assetstore.unity.com/packages/tools/level-design/bakery-gpu-lightmapper-122218 Asset Store page]&lt;br /&gt;
* [[Github access]]&lt;br /&gt;
* '''[[RTPreview|RTPreview manual]]'''&lt;br /&gt;
* '''[[Manual|Manual (v1.95)]]'''&lt;br /&gt;
* [https://docs.google.com/document/d/1r-ZFqovUkVXL-1S9ATYqUHL00M5SpiM2Qwjg0eVCJ4Y/edit Changelog]&lt;br /&gt;
* [https://drive.google.com/file/d/1i_zkeB4VBgNOI_-dBqxkdwZ4HCj6tTyA/view?usp=share_link Latest URP graphs (rev 2.0) (12.1.6)]&lt;br /&gt;
* [https://drive.google.com/file/d/1kutq2zwyOGhSw79_rtZNeW5cFOLWzuVr/view?usp=share_link Latest URP graphs (14.0.7)]&lt;br /&gt;
* [https://drive.google.com/file/d/1CIM7_LFaMJ2lxs4eZMZ-KgX8OA7KBt2U/view?usp=sharing Latest URP graphs (15.0.6)]&lt;br /&gt;
* [https://drive.google.com/file/d/1IJIbw2He3c5xa9hdaTVHnqIf5Ewfg0gZ/view?usp=sharing Latest URP graphs (15.0.7)]&lt;br /&gt;
* [https://drive.google.com/file/d/1lmQsDjLnP-HlslQNHffjqj6Bty9iJUzH/view?usp=sharing Latest URP graphs (16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/1mTpG6o9RfjSlq8EBdpQ8kSZVZq3JP4BQ/view?usp=sharing Latest URP graphs (rev 9.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/1fw7OM83pp0jRHqLjpF2WRZYSd1Z1H1Eh/view?usp=sharing Latest URP graphs (rev 12.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/18TU_8MpVdUiSQjCm1JWyg-binr02ZfzZ/view?usp=sharing Latest URP graphs (rev 13.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/15Nga4ld-F0_GzCfkDLrE3Uv1QfIYvIGk/view?usp=sharing Latest URP graphs (rev 14.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/1x6kCNmJzKgOnnQRQx7ol5VSNMq4VwFeU/view?usp=sharing Latest URP graphs (rev 15.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/1RvaSoy4ceOCTQIHs5DvdYlt5gUEkDYG5/view?usp=sharing Latest URP graphs (rev 16.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/1-1_oNZyPptlcUWWjcXzcTv1-b-mPJBsw/view?usp=sharing Latest HDRP graphs (10.4.0)]&lt;br /&gt;
* [https://drive.google.com/file/d/1hYn8FXPf47FsVTgoao0jV0AqxGFN48dH/view?usp=sharing Latest HDRP graphs (11.0.0)]&lt;br /&gt;
* [https://drive.google.com/file/d/1dLlg-GWYbyzvG9jo9srnpnht1S19W6Z2/view Latest HDRP graphs (12.1.6)]&lt;br /&gt;
* [https://drive.google.com/file/d/1RBRS024Dd9ddM-35D1KssOReTrcC8zGn/view?usp=sharing Latest HDRP graphs (14.0.7)]&lt;br /&gt;
* [https://drive.google.com/file/d/1z3jSHNgHALU6r3b6lBXEBvHLlxEmXARZ/view?usp=sharing Latest HDRP graphs (rev 2.0) (14.0.7)]&lt;br /&gt;
* [[FAQ]]&lt;br /&gt;
* [[How do I...]]&lt;br /&gt;
* [[Reporting bugs]]&lt;br /&gt;
* [[Troubleshooting]]&lt;br /&gt;
* [[Community extensions]]&lt;br /&gt;
* [https://discord.gg/dP3SkdM Community Discord]&amp;lt;br&amp;gt;&amp;lt;small&amp;gt;(for support, please contact me on [https://discussions.unity.com/t/bakery-gpu-lightmapper-v1-96-rtpreview-released/704890/7512 Unity forum] / [https://github.com/guycalledfrank/bakery-issues/issues github] / or via email listed [https://assetstore.unity.com/publishers/37453 here]).&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bakery is made by [https://twitter.com/guycalledfrank Mr F]&lt;br /&gt;
&lt;br /&gt;
== Decalery ==&lt;br /&gt;
* '''[[Decalery manual]]'''&lt;br /&gt;
* [[Decalery Github access]]&lt;/div&gt;</summary>
		<author><name>Mr F</name></author>
		
	</entry>
	<entry>
		<id>https://geom.io/bakery/wiki/index.php?title=Bakery_-_GPU_Lightmapper&amp;diff=1843</id>
		<title>Bakery - GPU Lightmapper</title>
		<link rel="alternate" type="text/html" href="https://geom.io/bakery/wiki/index.php?title=Bakery_-_GPU_Lightmapper&amp;diff=1843"/>
		<updated>2025-12-15T16:43:42Z</updated>

		<summary type="html">&lt;p&gt;Mr F: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{note|December 2025 update: Nvidia driver 591.44 breaks OptiX6 support and therefore Bakery. If you get &amp;quot;Failed to load OptiX library&amp;quot;, please use any older driver.&amp;lt;br&amp;gt;In the meantime I'm waiting for a response from Nvidia and working on a patch.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
UPDATE December 15th: Bakery has been updated to support new drivers. Please try the latest [[Github access|github]] version. If no issues are reported within a week, the patch will land to the Asset Store.}}&lt;br /&gt;
Nvidia drivers can be downloaded [https://www.nvidia.com/Download/index.aspx?lang=en-US here].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[What is Bakery and why use it]]&lt;br /&gt;
&lt;br /&gt;
== Bakery for Unity ==&lt;br /&gt;
* [https://assetstore.unity.com/packages/tools/level-design/bakery-gpu-lightmapper-122218 Asset Store page]&lt;br /&gt;
* [[Github access]]&lt;br /&gt;
* '''[[RTPreview|RTPreview manual]]'''&lt;br /&gt;
* '''[[Manual|Manual (v1.95)]]'''&lt;br /&gt;
* [https://docs.google.com/document/d/1r-ZFqovUkVXL-1S9ATYqUHL00M5SpiM2Qwjg0eVCJ4Y/edit Changelog]&lt;br /&gt;
* [https://drive.google.com/file/d/1i_zkeB4VBgNOI_-dBqxkdwZ4HCj6tTyA/view?usp=share_link Latest URP graphs (rev 2.0) (12.1.6)]&lt;br /&gt;
* [https://drive.google.com/file/d/1kutq2zwyOGhSw79_rtZNeW5cFOLWzuVr/view?usp=share_link Latest URP graphs (14.0.7)]&lt;br /&gt;
* [https://drive.google.com/file/d/1CIM7_LFaMJ2lxs4eZMZ-KgX8OA7KBt2U/view?usp=sharing Latest URP graphs (15.0.6)]&lt;br /&gt;
* [https://drive.google.com/file/d/1IJIbw2He3c5xa9hdaTVHnqIf5Ewfg0gZ/view?usp=sharing Latest URP graphs (15.0.7)]&lt;br /&gt;
* [https://drive.google.com/file/d/1lmQsDjLnP-HlslQNHffjqj6Bty9iJUzH/view?usp=sharing Latest URP graphs (16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/1mTpG6o9RfjSlq8EBdpQ8kSZVZq3JP4BQ/view?usp=sharing Latest URP graphs (rev 9.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/1fw7OM83pp0jRHqLjpF2WRZYSd1Z1H1Eh/view?usp=sharing Latest URP graphs (rev 12.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/18TU_8MpVdUiSQjCm1JWyg-binr02ZfzZ/view?usp=sharing Latest URP graphs (rev 13.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/15Nga4ld-F0_GzCfkDLrE3Uv1QfIYvIGk/view?usp=sharing Latest URP graphs (rev 14.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/1x6kCNmJzKgOnnQRQx7ol5VSNMq4VwFeU/view?usp=sharing Latest URP graphs (rev 15.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/1RvaSoy4ceOCTQIHs5DvdYlt5gUEkDYG5/view?usp=sharing Latest URP graphs (rev 16.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/1-1_oNZyPptlcUWWjcXzcTv1-b-mPJBsw/view?usp=sharing Latest HDRP graphs (10.4.0)]&lt;br /&gt;
* [https://drive.google.com/file/d/1hYn8FXPf47FsVTgoao0jV0AqxGFN48dH/view?usp=sharing Latest HDRP graphs (11.0.0)]&lt;br /&gt;
* [https://drive.google.com/file/d/1dLlg-GWYbyzvG9jo9srnpnht1S19W6Z2/view Latest HDRP graphs (12.1.6)]&lt;br /&gt;
* [https://drive.google.com/file/d/1RBRS024Dd9ddM-35D1KssOReTrcC8zGn/view?usp=sharing Latest HDRP graphs (14.0.7)]&lt;br /&gt;
* [https://drive.google.com/file/d/1z3jSHNgHALU6r3b6lBXEBvHLlxEmXARZ/view?usp=sharing Latest HDRP graphs (rev 2.0) (14.0.7)]&lt;br /&gt;
* [[FAQ]]&lt;br /&gt;
* [[How do I...]]&lt;br /&gt;
* [[Reporting bugs]]&lt;br /&gt;
* [[Troubleshooting]]&lt;br /&gt;
* [[Community extensions]]&lt;br /&gt;
* [https://discord.gg/dP3SkdM Community Discord]&amp;lt;br&amp;gt;&amp;lt;small&amp;gt;(for support, please contact me on [https://discussions.unity.com/t/bakery-gpu-lightmapper-v1-96-rtpreview-released/704890/7512 Unity forum] / [https://github.com/guycalledfrank/bakery-issues/issues github] / or via email listed [https://assetstore.unity.com/publishers/37453 here]).&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bakery is made by [https://twitter.com/guycalledfrank Mr F]&lt;br /&gt;
&lt;br /&gt;
== Decalery ==&lt;br /&gt;
* '''[[Decalery manual]]'''&lt;br /&gt;
* [[Decalery Github access]]&lt;/div&gt;</summary>
		<author><name>Mr F</name></author>
		
	</entry>
	<entry>
		<id>https://geom.io/bakery/wiki/index.php?title=Bakery_-_GPU_Lightmapper&amp;diff=1842</id>
		<title>Bakery - GPU Lightmapper</title>
		<link rel="alternate" type="text/html" href="https://geom.io/bakery/wiki/index.php?title=Bakery_-_GPU_Lightmapper&amp;diff=1842"/>
		<updated>2025-12-07T08:27:38Z</updated>

		<summary type="html">&lt;p&gt;Mr F: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{note|December 2025 update: Nvidia driver 591.44 breaks OptiX6 support and therefore Bakery. If you get &amp;quot;Failed to load OptiX library&amp;quot;, please use any older driver.&amp;lt;br&amp;gt;In the meantime I'm waiting for a response from Nvidia and working on a patch.}}&lt;br /&gt;
Nvidia drivers can be downloaded [https://www.nvidia.com/Download/index.aspx?lang=en-US here].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[What is Bakery and why use it]]&lt;br /&gt;
&lt;br /&gt;
== Bakery for Unity ==&lt;br /&gt;
* [https://assetstore.unity.com/packages/tools/level-design/bakery-gpu-lightmapper-122218 Asset Store page]&lt;br /&gt;
* [[Github access]]&lt;br /&gt;
* '''[[RTPreview|RTPreview manual]]'''&lt;br /&gt;
* '''[[Manual|Manual (v1.95)]]'''&lt;br /&gt;
* [https://docs.google.com/document/d/1r-ZFqovUkVXL-1S9ATYqUHL00M5SpiM2Qwjg0eVCJ4Y/edit Changelog]&lt;br /&gt;
* [https://drive.google.com/file/d/1i_zkeB4VBgNOI_-dBqxkdwZ4HCj6tTyA/view?usp=share_link Latest URP graphs (rev 2.0) (12.1.6)]&lt;br /&gt;
* [https://drive.google.com/file/d/1kutq2zwyOGhSw79_rtZNeW5cFOLWzuVr/view?usp=share_link Latest URP graphs (14.0.7)]&lt;br /&gt;
* [https://drive.google.com/file/d/1CIM7_LFaMJ2lxs4eZMZ-KgX8OA7KBt2U/view?usp=sharing Latest URP graphs (15.0.6)]&lt;br /&gt;
* [https://drive.google.com/file/d/1IJIbw2He3c5xa9hdaTVHnqIf5Ewfg0gZ/view?usp=sharing Latest URP graphs (15.0.7)]&lt;br /&gt;
* [https://drive.google.com/file/d/1lmQsDjLnP-HlslQNHffjqj6Bty9iJUzH/view?usp=sharing Latest URP graphs (16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/1mTpG6o9RfjSlq8EBdpQ8kSZVZq3JP4BQ/view?usp=sharing Latest URP graphs (rev 9.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/1fw7OM83pp0jRHqLjpF2WRZYSd1Z1H1Eh/view?usp=sharing Latest URP graphs (rev 12.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/18TU_8MpVdUiSQjCm1JWyg-binr02ZfzZ/view?usp=sharing Latest URP graphs (rev 13.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/15Nga4ld-F0_GzCfkDLrE3Uv1QfIYvIGk/view?usp=sharing Latest URP graphs (rev 14.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/1x6kCNmJzKgOnnQRQx7ol5VSNMq4VwFeU/view?usp=sharing Latest URP graphs (rev 15.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/1RvaSoy4ceOCTQIHs5DvdYlt5gUEkDYG5/view?usp=sharing Latest URP graphs (rev 16.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/1-1_oNZyPptlcUWWjcXzcTv1-b-mPJBsw/view?usp=sharing Latest HDRP graphs (10.4.0)]&lt;br /&gt;
* [https://drive.google.com/file/d/1hYn8FXPf47FsVTgoao0jV0AqxGFN48dH/view?usp=sharing Latest HDRP graphs (11.0.0)]&lt;br /&gt;
* [https://drive.google.com/file/d/1dLlg-GWYbyzvG9jo9srnpnht1S19W6Z2/view Latest HDRP graphs (12.1.6)]&lt;br /&gt;
* [https://drive.google.com/file/d/1RBRS024Dd9ddM-35D1KssOReTrcC8zGn/view?usp=sharing Latest HDRP graphs (14.0.7)]&lt;br /&gt;
* [https://drive.google.com/file/d/1z3jSHNgHALU6r3b6lBXEBvHLlxEmXARZ/view?usp=sharing Latest HDRP graphs (rev 2.0) (14.0.7)]&lt;br /&gt;
* [[FAQ]]&lt;br /&gt;
* [[How do I...]]&lt;br /&gt;
* [[Reporting bugs]]&lt;br /&gt;
* [[Troubleshooting]]&lt;br /&gt;
* [[Community extensions]]&lt;br /&gt;
* [https://discord.gg/dP3SkdM Community Discord]&amp;lt;br&amp;gt;&amp;lt;small&amp;gt;(for support, please contact me on [https://discussions.unity.com/t/bakery-gpu-lightmapper-v1-96-rtpreview-released/704890/7512 Unity forum] / [https://github.com/guycalledfrank/bakery-issues/issues github] / or via email listed [https://assetstore.unity.com/publishers/37453 here]).&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bakery is made by [https://twitter.com/guycalledfrank Mr F]&lt;br /&gt;
&lt;br /&gt;
== Decalery ==&lt;br /&gt;
* '''[[Decalery manual]]'''&lt;br /&gt;
* [[Decalery Github access]]&lt;/div&gt;</summary>
		<author><name>Mr F</name></author>
		
	</entry>
	<entry>
		<id>https://geom.io/bakery/wiki/index.php?title=Manual&amp;diff=1841</id>
		<title>Manual</title>
		<link rel="alternate" type="text/html" href="https://geom.io/bakery/wiki/index.php?title=Manual&amp;diff=1841"/>
		<updated>2025-12-07T08:27:10Z</updated>

		<summary type="html">&lt;p&gt;Mr F: /* Prerequisites */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== System requirements ==&lt;br /&gt;
To use Bakery you'll need:&lt;br /&gt;
* Windows (7 or higher) PC.&lt;br /&gt;
* Nvidia GPU. Minimum supported model is Kepler (GeForce 650 or newer. For Quadro cards check the specs).&lt;br /&gt;
* 64-bit Unity editor. Bakery was tested on all versions from 5.6 to 6 or higher.&lt;br /&gt;
&lt;br /&gt;
{{note|System requirements are for developer machine, not target platform. You can use lightmaps baked with Bakery anywhere.}}&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
* Make sure your project does not have any script compilation errors, as it will prevent Bakery scripts from compiling as well.&lt;br /&gt;
* Make sure you have the latest GPU driver. [https://www.nvidia.com/Download/index.aspx?lang=en-US Update it] if needed.&lt;br /&gt;
&lt;br /&gt;
{{note|Nvidia driver 591.44 breaks OptiX6 support and therefore Bakery. If you get &amp;quot;Failed to load OptiX library&amp;quot;, please use any older driver.&amp;lt;br&amp;gt;In the meantime I'm waiting for a response from Nvidia and working on a patch.}}&lt;br /&gt;
&lt;br /&gt;
'''Use the Game-Ready (standard) driver, not the &amp;quot;Studio&amp;quot; one.'''&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
1. Import Bakery to your project via [https://assetstore.unity.com/packages/tools/level-design/bakery-gpu-lightmapper-122218 Asset Store].&lt;br /&gt;
&lt;br /&gt;
2. Unity will show a list of files to import. If it's your first time using Bakery, it is recommended you just '''click Import'''. Experienced users may want to untick the ''examples'' folder for a more lightweight installation.&lt;br /&gt;
&lt;br /&gt;
Files will be imported to Assets/Bakery and Assets/Editor/x64/Bakery. These folders can be moved later.&lt;br /&gt;
&lt;br /&gt;
3. Unity will then import Bakery and compile the scripts. It may show a window like this:&lt;br /&gt;
&lt;br /&gt;
[[File:Goahead.png]]&lt;br /&gt;
&lt;br /&gt;
In which case you should click &amp;quot;Go Ahead&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
You should now see Bakery menu added to the editor:&lt;br /&gt;
&lt;br /&gt;
[[File:bmenu.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Quickstart ==&lt;br /&gt;
&lt;br /&gt;
1. Add some model or primitive and mark it as Static.&lt;br /&gt;
&lt;br /&gt;
'''Meshes must have non-overlapping UV for lightmapping. UV2 is used if present (otherwise UV1). If you did not unwrap models for lightmapping, make sure to check [https://docs.unity3d.com/Manual/LightingGiUvs-GeneratingLightmappingUVs.html Generate Lightmap UVs] on the asset.''' Unity primitives already have correct UV2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Staticmarked.jpg|320px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Select Directional Light (the one Unity created for you) and add '''Bakery Direct Light''' component to it.&lt;br /&gt;
{{note| Bakery and Unity use separate light source components.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Bakery Direct Light has many options to tweak, but you can easily match it to Unity light. Click '''Match lightmapped to real-time'''. Now Bakery light should have the same yellowish color as Unity’s default Directional.&lt;br /&gt;
&lt;br /&gt;
[[File:Matching.jpg|640px]]&lt;br /&gt;
&lt;br /&gt;
{{note| Direct Light component may complain about project not using linear light intensity. The problem is that by default Unity applies gamma correction to light source colors [https://twitter.com/guycalledfrank/status/1001108508614553600 incorrectly]. Correct mode can be enabled by [https://docs.unity3d.com/ScriptReference/Rendering.GraphicsSettings-lightsUseLinearIntensity.html scripting], and that’s what the “Fix” button does. If you already have many light sources set up in non-linear intensity mode, and you don’t want to change them again, you may skip fixing. Even if you press “Fix”, you can always revert the change anytime.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. To get shadowed ambient lighting, create Skylight (Bakery-&amp;gt;Create-&amp;gt;Skylight).&lt;br /&gt;
&lt;br /&gt;
[[File:Menusky.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Select Skylight, give it some bluish color and click '''Match scene skybox to this light'''. This will make scene skybox match lighting exactly.&lt;br /&gt;
{{note| Matching Unity skybox to Bakery skylight is optional but useful for correctness, as to ensure that visible environment and in-engine reflection probes match baked lighting. Currently this option only works for Standard render pipeline.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Skycomp.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Click Bakery-&amp;gt;Render Lightmap. By default, Full Lighting mode is active. It will bake both direct and indirect contribution from all lights. If you want to combine real-time shadows with baked GI, change it to '''Indirect'''.&lt;br /&gt;
&lt;br /&gt;
[[File:Bakerywindow.jpg]]&lt;br /&gt;
&lt;br /&gt;
{{note| Bakery may complain that you are using old [https://docs.unity3d.com/Manual/LinearLighting.html gamma mode] and suggest to change it. If you care about quality of lighting, using Linear mode is highly recommended. You may ignore it if you already have a big project set up with incorrect gamma and don’t want to change it or when shipping to mobile devices that don't support it.}}&lt;br /&gt;
&lt;br /&gt;
7. Click '''Render'''.&lt;br /&gt;
&lt;br /&gt;
8. Done! You should now have baked GI:&lt;br /&gt;
&lt;br /&gt;
[[File:Bakedgi.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Render settings ==&lt;br /&gt;
&lt;br /&gt;
All render settings can be accessed via Bakery-&amp;gt;Render Lightmap. Settings are saved for every scene. The topmost option in Bakery window allows you to switch between Simple, Advanced and Experimental settings, each succeeding mode revealing more tweakable options. Simple mode is enough for most scenes and it's a good way to get started.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render mode ===&lt;br /&gt;
Defines the type of lightmaps to bake. &lt;br /&gt;
&lt;br /&gt;
===== Full Lighting =====&lt;br /&gt;
Complete direct and indirect lighting for all Bakery lights.&lt;br /&gt;
{{note| On pre-2017.3 Unity versions if you have both Unity and Bakery components on the same object, you will need to disable Unity ones manually to avoid double brightness. On newer versions real-time effects are automatically disabled for baked lights, as with built-in lightmappers.}}&lt;br /&gt;
&lt;br /&gt;
===== Indirect =====&lt;br /&gt;
[[File:Image26.png|thumb|Comparison of different render modes supported by Unity]]&lt;br /&gt;
Basic mixed mode. It will look at the Baked Contribution selector on every light: if it’s set to ''Direct And Indirect'', the light is baked as in Full Lighting mode. If it’s set to ''Indirect Only'', only indirect contribution (GI) from this light is baked. In latter case you should keep both Unity and Bakery lights on the object, one giving real-time direct contribution, and another for precomputed GI.&lt;br /&gt;
&lt;br /&gt;
[[File:Indirectonly.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== Shadowmask =====&lt;br /&gt;
[[File:Image21.png|thumb|Left: completely baked light. Center: dynamic light with baked GI. Right: capsule shadow, bump and specular are dynamic, but cube shadow and GI are baked.]]&lt;br /&gt;
[[File:Image6.png|thumb|When camera gets far away enough or if dynamic shadows are disabled, the same scene will look like this]]&lt;br /&gt;
A more advanced mixed mode. It works by generating two types of lightmaps - one with baked color (as in Indirect mode), and another with shadows from static objects. It has several benefits:&lt;br /&gt;
* Real-time shadows can render only a handful of dynamic objects, instead of the whole scene.&lt;br /&gt;
* Real-time and baked shadows blend together properly.&lt;br /&gt;
* Real-time lights can render bump, specular and other surface effects, while still being occluded by high-quality baked shadows.&lt;br /&gt;
[https://docs.unity3d.com/Manual/LightMode-Mixed-Shadowmask.html More details]&lt;br /&gt;
&lt;br /&gt;
To enable this behaviour, you must have both Unity and Bakery lights on the same object, with Baked Contribution set to ''Shadowmask and Indirect''. Unmarked lights will be baked as in Indirect mode.&lt;br /&gt;
&lt;br /&gt;
[[File:Smask22.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== Distance Shadowmask =====&lt;br /&gt;
This checkbox is only visible if you chose shadowmask and simply toggles [https://docs.unity3d.com/Manual/LightMode-Mixed-ShadowmaskMode.html equally named setting] in project’s Quality Settings.&lt;br /&gt;
[https://docs.unity3d.com/Manual/LightMode-Mixed-DistanceShadowmask.html More details.]&lt;br /&gt;
{{note| Checkbox is not visible on Unity 5.6.x due to the lack of corresponding scripting API. Instead you can toggle it in Window-&amp;gt;Lighting-&amp;gt;Mixed Lighting-&amp;gt;Lighting Mode.}}&lt;br /&gt;
{{note| On Unity versions &amp;lt; 2017.3 rendering Shadowmask lightmaps will clear the light probes due to API limitations. They will need to be re-rendered again after bake. It shouldn’t happen on newer versions.}}&lt;br /&gt;
&lt;br /&gt;
===== Subtractive =====&lt;br /&gt;
Enables [https://docs.unity3d.com/Manual/LightMode-Mixed-Subtractive.html Subtractive] lighting mode. &lt;br /&gt;
&lt;br /&gt;
This option does not do anything special to lightmaps and, in fact, works just like Full Lighting.&lt;br /&gt;
&lt;br /&gt;
The only difference is that it also sets up real-time Unity lights to work with Subtractive mode (as it cannot be done through UI).&lt;br /&gt;
&lt;br /&gt;
You will need to additionally set up global subtractive parameters (like the global shadow color) in [https://docs.unity3d.com/Manual/GlobalIllumination.html#MixedLighting Unity lighting window].&lt;br /&gt;
&lt;br /&gt;
===== Ambient Occlusion Only =====&lt;br /&gt;
Only bakes AO. May be useful if you know what you're doing. Make sure to set up [[#Ambient_occlusion|AO options]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Directional mode ===&lt;br /&gt;
[[File:Image3.png|thumb|Comparison of different directional modes]]&lt;br /&gt;
Defines how directional information is baked. Standard lightmaps only store a single color per texel, while directional lightmaps give shaders a hint of how lighting changes over a hemisphere around the texel. This data is required to combine fully lightmapped areas with normal maps. Plugging it into the built-in [[#Bakery_shaders|Bakery shader]] can also produce approximate specular response.&lt;br /&gt;
&lt;br /&gt;
===== None =====&lt;br /&gt;
No directional data, single color per texel.&lt;br /&gt;
&lt;br /&gt;
===== Baked Normal Maps =====&lt;br /&gt;
Still no directional data, but normal maps are taken into account when rendering the lightmap. There is no additional runtime overhead. Since lightmaps usually have lower resolution than normal maps, the result may look blurry. Other problems include aliasing at distance due to lack of mipmapping and denoising step potentially smudging the detail. To learn how to use custom shaders with procedural normals in this mode, read [[#Normal_mapping|Normal Mapping]] section.&lt;br /&gt;
&lt;br /&gt;
===== Dominant Direction =====&lt;br /&gt;
This mode is similar to what Enlighten and Progressive bake in Unity. It is compatible will most shaders, only generates one additional map and the runtime overhead is minimal. The downside is that bump-mapping looks rather faint and gray-ish and can be quite different comparing to the same object under real-time lighting.&lt;br /&gt;
&lt;br /&gt;
===== RNM =====&lt;br /&gt;
Based on Radiosity Normal Mapping technique originally invented for HL2 ([https://steamcdn-a.akamaihd.net/apps/valve/2004/GDC2004_Half-Life2_Shading.pdf slides]) and later used in many games (e.g. Mirror’s Edge). It generates 3 HDR maps in total, being the most memory-demanding mode of all. Runtime overhead is still relatively low. This mode is more precise than Dominant Direction. It is better at reproducing surface contrast and handling colored lights affecting normal maps from different angles.&lt;br /&gt;
&lt;br /&gt;
===== SH =====&lt;br /&gt;
Based on “Precomputed Global Illumination in Frostbite” [https://media.contentapi.ea.com/content/dam/eacom/frostbite/files/gdc2018-precomputedgiobalilluminationinfrostbite.pdf paper]. This is the highest quality mode, giving much better surface contrast and representing differently colored lighting coming from different directions. Generates 4 maps in total, only one of them being HDR, therefore takes less memory than RNM. Runtime overhead is slightly higher than that of RNM.&lt;br /&gt;
&lt;br /&gt;
===== MonoSH =====&lt;br /&gt;
[[File:FY8Ru8hWIAAdYYH.jpg|thumb|Size/quality comparison of Dominant Direction, full SH and MonoSH]]&lt;br /&gt;
Same as SH, but using a monochromatic L1 directional coefficients. Similarly good surface contrast, although not accurately representing different colors shining from different directions at one texel; but good enough for many scenes. Only generates one additional map, so the VRAM usage/bandwidth is similar to Dominant Direction; in fact it's even smaller, due to Dominant Direction using RGBA maps, while MonoSH only needing RGB. The map is fed via the built-in directional lightmap system, but ''won't look correct with standard shaders''. Make sure to use a compatible shader.&lt;br /&gt;
&lt;br /&gt;
===== Limitations =====&lt;br /&gt;
&lt;br /&gt;
* RNM and SH/MonoSH can be only used with [[#Bakery_shaders|Bakery shader]] or require adjustments to your shaders.&lt;br /&gt;
* In RNM and SH modes, standard color lightmaps are not created. You need to either have Bakery shader on all materials in the scene, or use [[#Bakery_Lightmap_Group_Selector|Lightmap Groups]] to separate RNM/SH objects from the rest.&lt;br /&gt;
* RNM and SH maps are applied to objects using [https://docs.unity3d.com/ScriptReference/MaterialPropertyBlock.html MaterialPropertyBlock] and so may be not shown completely in Unity’s Lighting window.&lt;br /&gt;
* Dominant Direction, RNM and SH/MonoSH modes may require slightly more samples for GI and Light Meshes to get comparable quality.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Texels per unit ===&lt;br /&gt;
[[File:Texelscomp.jpg|thumb|1 vs 10 texels per unit]]&lt;br /&gt;
Approximate amount of lightmap texels per world unit. Affects the amount and resolution of generated lightmaps.&lt;br /&gt;
&lt;br /&gt;
Example values to get you started:&lt;br /&gt;
* Large outdoor area (a city): 1 - 5&lt;br /&gt;
* Medium outdoor area (a few alleys): 10-20&lt;br /&gt;
* High quality interior: 100&lt;br /&gt;
&lt;br /&gt;
It is assumed that scene scale is roughly 1 unit = 1 meter. Such scale is generally recommended when working in Unity for better navigation and for physics simulation. If your scale is different, multiply Texels accordingly.&lt;br /&gt;
&lt;br /&gt;
Keep in mind that Texels Per Unit is base resolution, but every object can be additionally tweaked using [https://docs.unity3d.com/Manual/class-MeshRenderer.html Scale in Lightmap] option on Mesh Renderers as well as [[#Scale per map type|Scale per map type]] in Bakery window.&lt;br /&gt;
&lt;br /&gt;
{{note| Objects with Scale in Lightmap set to 0 will not be baked, but will still cast shadows and affect GI.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Max resolution ===&lt;br /&gt;
Maximum lightmap size limit. If objects can't fit in a single lightmap (given current Texels Per Unit value), additional lightmaps will be allocated. Same 4 square objects can take four 512x512 maps or one 1024x1024.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bounces ===&lt;br /&gt;
[[File:Image36.png|thumb|Note how more bounces bring more light to closed spaces.]]&lt;br /&gt;
Defines how many times light rays should bounce off surfaces. Usually lower values are sufficient for outdoor scenes (e.g. a city), while higher values are required for more closed scenes (interiors, caves).&lt;br /&gt;
&lt;br /&gt;
While the slider is limited by 5 bounces, it is possible to type any amount of bounces into the number field.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Samples ===&lt;br /&gt;
[[File:Image7.png|thumb|Left: samples = 4, right: samples = 16. Denoising is off for illustrative purposes.]]&lt;br /&gt;
Affects quality of GI. Typical values are from 16 to 32.&lt;br /&gt;
&lt;br /&gt;
{{note| It is possible to type in any number, beyond the maximum slider value, but be aware that this number represents a square root of the final ray count, i.e. 32 is 1024 rays, 64 is 4096 rays, etc.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GPU Priority ===&lt;br /&gt;
While GPU is working on lightmaps, OS and other software may become less responsive. This option allows you to balance between baking speed and system responsiveness.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render ===&lt;br /&gt;
Bakes lightmaps for all opened scenes.&lt;br /&gt;
If [[Manual#Light_probe_mode|Light Probe Mode]] is set to L1 or L2, also bakes light probes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Render Light Probes ===&lt;br /&gt;
Bakes [https://docs.unity3d.com/Manual/LightProbes.html light probes] for all opened scenes.&lt;br /&gt;
&lt;br /&gt;
Note that to get correct mixed light shadowing on dynamic objects in Shadowmask mode you also need to enable [[Manual#Occlusion_probes|occlusion probes]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Render Reflection Probes ===&lt;br /&gt;
Bakes [https://docs.unity3d.com/Manual/class-ReflectionProbe.html reflection probes] for all opened scenes. This button is just for convenience and will call built-in engine reflection probe update.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update Skybox Probe ===&lt;br /&gt;
Bakes global diffuse and reflection probe for the current skybox. As with &amp;quot;Render Reflection Probes&amp;quot;, it just calls built-in engine functions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Occlusion probes ===&lt;br /&gt;
When rendering light probes, lets Unity bake occlusion probes using currently selected built-in lightmapper. Occlusion probes is additional data stored inside regular light probes, and it prevents dynamic objects from getting lit in shadowed areas. Currently there is no way to use custom occlusion probes in Unity, and it has to call its own lightmappers instead to do the job.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Warnings ===&lt;br /&gt;
These options will validate the scene after one of the Render buttons is pressed and show warning dialog boxes asking to continue or stop the baking process.&lt;br /&gt;
* Suppress all popups: don't show any dialog boxes after pressing Render.&lt;br /&gt;
* UV validation: will check if all models have fully correct lightmapping UVs - specifically if they lie within 0-1 range and don’t overlap.&lt;br /&gt;
* Overwrite check: will tell which lightmap files are going to be overwritten.&lt;br /&gt;
* Memory check: will tell a very approximate amount of video memory required.&lt;br /&gt;
* Sample count check: will check if any lights, GI or AO have unreasonable sample counts that can make GPU go out of available resources.&lt;br /&gt;
* Lightmapped prefab validation: validates Lightmapped Prefabs and notifies if some prefabs are going to be overwritten.&lt;br /&gt;
&lt;br /&gt;
== Advanced render settings ==&lt;br /&gt;
=== Light probe mode ===&lt;br /&gt;
Changes the way light probes are baked.&lt;br /&gt;
&lt;br /&gt;
* Legacy:  use Render Light Probes button to generate the probes. Point and directional lights are calculated within the lightmapper, while area/sky/indirect lighting is gathered by rendering a cubemap at each probe position. Results are stored as [https://docs.unity3d.com/ScriptReference/Rendering.SphericalHarmonicsL2.html L2 spherical harmonics]. The downsides are slow cubemap rendering performance and possible mismatch between lightmaps and probes in cases where shaders in your game do not physically represent lit surfaces or your project is set up for mobile (Unity can clip high intensity values away).&lt;br /&gt;
&lt;br /&gt;
* L1: light probes will be rendered together with lightmaps when you click Render. This option provides superior baking performance and will guarantee that probe lighting matches the lightmaps. Results are stored as L1 spherical harmonics (can be still used by regular shaders). Results can be further improved by using Non-Linear Light Probe SH option in [[#Bakery_shaders|Bakery shader]].&lt;br /&gt;
&lt;br /&gt;
* L2: superior quality (full L2 spherical harmonics). As with L1, automatically rendered together with lightmaps. Negligible performance impact compared to L1. Should look OK with all shaders. Probe contrast/directionality/ringing removal can be tweaked via Project Settings -&amp;gt; Bakery -&amp;gt; &amp;quot;Ringing removal for L2 light probes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''There seems to be a bug in Unity 2019.3 preventing Legacy light probe colors from being properly saved IF [[Manual#Occlusion_probes|occlusion probes]] option is enabled. L2 mode is now default and recommended when using occlusion probes.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Asset UV Processing ===&lt;br /&gt;
Configures UV padding adjustment for assets. Possible values:&lt;br /&gt;
* Don't change: don't touch the assets.&lt;br /&gt;
* Adjust UV padding: will look for models with auto-generated UVs (“Generate Lightmap UVs” on the asset) and adjust them further to have proper padding between UV islands per-mesh. Model-wide Pack Margin in importer settings is ignored. Optimal values are calculated instead, given area of each mesh and lightmap resolution.&lt;br /&gt;
* Adjust UV padding for new meshes only: same, but skips any models that were previously adjusted at least once.&lt;br /&gt;
* Remove UV adjustments: reverts all previous UV adjustments, makes auto-unwrapped models look they way Unity originally unwrapped them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser ===&lt;br /&gt;
Sets the desired denoiser. Possible values:&lt;br /&gt;
* Optix 5: uses OptiX 5.1 AI denoiser (previously known as &amp;quot;Legacy denoiser&amp;quot;). Runs on the GPU. Supported on everything from [https://en.wikipedia.org/wiki/Kepler_(microarchitecture) Kepler] (typically GeForce 6xx) to [https://en.wikipedia.org/wiki/Turing_(microarchitecture) Turing] (typically Geforce 20xx). Not supported on [https://en.wikipedia.org/wiki/Ampere_(microarchitecture) Ampere] (30xx). OptiX 5.1 uses a static training dataset which is embedded into it, meaning it is not affected by the driver implementation.&lt;br /&gt;
* Optix 6: uses OptiX 6.0 AI denoiser (previously the default option). Runs on the GPU. Seems to fail on Kepler (6xx) GPUs, but runs on everything newer, including Ampere (30xx). Since 6.0 the training dataset for the OptiX denoiser is in the driver. Before driver v442.50 its behaviour was similar to OptiX 5.1; however, after it NVIDIA has [https://forums.developer.nvidia.com/t/optix7-denoiser-different-results-with-different-version-of-drivers/117989/2 changed the dataset], and results can be different. The updated dataset may sometimes produce grid-like patterns and more bright edges (still fixable with [[Manual#Denoise:_fix_bright_edges|&amp;quot;Denoise: fix bright edges&amp;quot;]]), but it runs faster.&lt;br /&gt;
* Optix 7: uses OptiX 7.2 AI denoiser. Behaves similarly to OptiX 6.0, but might be better supported on Ampere (30xx).&lt;br /&gt;
* OpenImageDenoise: uses Intel Open Image Denoise library. Runs on the CPU (any CPU that supports SSE 4.1). Can be slightly slower than OptiX, but the quality is comparable.&lt;br /&gt;
* OpenImageDenoise2: uses Intel Open Image Denoise 2, CUDA mode. Runs on the GPU, performance is comparable to OptiX 6/7, quality is identical to the CPU version.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Adjust sample positions ===&lt;br /&gt;
Find best sample positions to prevent lighting leaks. Details of the algorithm are outlined [https://ndotl.wordpress.com/2018/08/29/baking-artifact-free-lightmaps/#leaks here]. In some cases (usually large and very low poly geometry with smooth normals) it may produce incorrect results, in which case you can disable it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Unload scenes before render ===&lt;br /&gt;
Unloads Unity scenes before baking to free up video memory. Complex scenes can take a few gigabytes of VRAM by simply being shown in editor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Denoise ===&lt;br /&gt;
[[File:Image31.png|thumb|Left: denoising off, right: denoising on.]]&lt;br /&gt;
If enabled, will apply denoising algorithm. Bakery uses [https://developer.nvidia.com/optix-denoiser Nvidia’s AI denoiser (OptiX)] or Intel's Open Image Denoise (if selected).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Fix Seams ===&lt;br /&gt;
[[File:Image22.png|thumb|Left: seams, right: seams are fixed.]]&lt;br /&gt;
If enabled, will attempt to blend seams created by UV discontinuities. Useful for smooth geometry, including Unity’s default sphere.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Split by scene ===&lt;br /&gt;
If multiple scenes are loaded at once, and this option is enabled, each scene will have its own set of lightmaps, not shared with others. It can be useful for limiting the amount of textures loaded when scenes are streamed at runtime.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hole filling ===&lt;br /&gt;
[[File:Holefilling.jpg|thumb|Hole filling off vs on.]]&lt;br /&gt;
If [[Manual#Atlas_Packer|Atlas Packer]] is set to xatlas, will try to fill every hole, resulting in more efficient atlases. For scenes with very complex geometry it can increase scene export time, but otherwise recommended.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Min resolution ===&lt;br /&gt;
Minimum lightmap size limit. Can be used to balance between many small but fully occupied lightmaps vs few incompletely filled.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Scale per map type ===&lt;br /&gt;
Allows you to scale the resolution of color/shadowmask/direction maps differently. For example, a common case would be to have low resolution indirect color but highly detailed shadowmask. Note that scaling is applied after the lightmaps are rendered, so it won’t save baking time. If “Adjust UV padding” is on, padding will be based on the lowest resolution map to prevent texel leaking.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Checker preview ===&lt;br /&gt;
[[File:Image12.png|thumb|Checker preview in action]]&lt;br /&gt;
If Show checker checkbox is on, Scene View will render a checkerboard pattern on top of visible objects to demonstrate lightmap texel size. This is useful to make sure you are using adequate values for Texels Per Unit and other resolution-affecting settings before you bake.&lt;br /&gt;
&lt;br /&gt;
Enabling checker preview will force Bakery to perform atlas packing. It can take some time, but shouldn’t be longer than a few seconds. Press Refresh checker to re-atlas the scene after you changed something to see changes.&lt;br /&gt;
&lt;br /&gt;
Checker preview also uses random colors to show how the scene will be split into different lightmaps.&lt;br /&gt;
&lt;br /&gt;
{{note| Checker preview currently does not show correct texel sizes for Terrains.}}&lt;br /&gt;
&lt;br /&gt;
==== Atlas preview ====&lt;br /&gt;
[[File:FN-TmhRXwAE9i2I.png|thumb|Atlas preview in action]]&lt;br /&gt;
Atlas preview button is visible when Checker preview is on. Clicking it will open a new window where the UV layouts of future lightmaps are shown. Click &amp;quot;&amp;lt;&amp;quot; &amp;quot;&amp;gt;&amp;quot; buttons to browse the lightmaps.&lt;br /&gt;
This is useful for checking out packing quality and lightmap count before baking.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Emissive boost ===&lt;br /&gt;
Multiplies any surface emission by this number.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Indirect boost ===&lt;br /&gt;
Multiplies all bounced lighting by this number. Same as Indirect Intensity on light components, but global.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Backface GI ===&lt;br /&gt;
[[File:Image30.jpg|thumb|Backface GI]]&lt;br /&gt;
[[File:Image35.png|thumb|Left: backface GI = 0, right: backface GI = 1. Note how shadowed areas receive more green lighting.]]&lt;br /&gt;
Determines how much light is passed through front faces to back faces and then bounced off by GI. This is especially useful for thin translucent surfaces like leaves. Values are in 0-1 range.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Ambient occlusion ===&lt;br /&gt;
[[File:Image15.png|thumb|Left: AO intensity = 0. Right: AO intensity = 1.]]&lt;br /&gt;
Simple non-physical ambient occlusion you can apply over final scene lighting for aesthetic purposes.&lt;br /&gt;
* Intensity: controls visibility of the AO effect. Value of 0 disables the effect.&lt;br /&gt;
* Radius: determines the ray distance used in the AO effect. Smaller values give localized occlusion (corners, wrinkles), while larger values make it more similar to Skylight, giving shadows from distant objects.&lt;br /&gt;
* Samples: affects the quality of ambient occlusion. Typical values are from 4 to 32.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dither transparency ===&lt;br /&gt;
Enables semi-transparent shadows by automatically dithering alpha textures. See [[Manual#Opacity|how Bakery interprets opacity maps]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== RTX Mode ===&lt;br /&gt;
Enables RTX hardware acceleration. Only RTX GPUs will benefit from this option. Minimum supported driver version is 418.&lt;br /&gt;
&lt;br /&gt;
Drivers can emulate RTX mode on most non-RTX Nvidia cards, but the result is usually slower.&lt;br /&gt;
&lt;br /&gt;
RTX mode '''must''' be enabled on Ampere (3xxx) or newer cards.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Export terrain trees ===&lt;br /&gt;
If enabled, painted terrain trees will affect lighting. Trees themselves will not be baked. Note that highest possible LOD level is used for every tree during baking. It is not recommended to use this option for rendering multi-kilometer forests with highly detailed models.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Terrain optimization ===&lt;br /&gt;
If enabled (default), Terrains use separate ray tracing technique to take advantage of their heightfield geometry. Otherwise they are treated like any other mesh. Terrain optimization significantly reduces memory footprint required for high-resolution landscapes. In some cases it can also make terrain baking faster, in other cases (especially with simple low-resolution landscapes) it might make sense to disable it.&lt;br /&gt;
&lt;br /&gt;
{{note| Terrain Optimization is not currently compatible with painted terrain holes. Disable it to make them work.}}&lt;br /&gt;
{{note| Terrain Optimization is only supported in non-RTX mode.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Light Mesh batch limit ===&lt;br /&gt;
If this value is above 0, combines many [[Manual#Bakery_Light_Mesh|Light Meshes]] into one, given they have identical settings and affect the same [[Manual#Bakery_Lightmap_Group_Selector|Lightmap Groups]], but limiting their total sample count to this value (I.e. if the limit is 64, it can combine 2 lights with samples=32 or 4 lights with samples=16, etc). This will increase performance in scenes with many Light Meshes. Be careful setting this value too high, as the GPU may hit the OS driver timeout while processing too many samples at once.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Compress volumes ===&lt;br /&gt;
If enabled, applies texture compression to volume 3D textures and switches Bakery shaders to a corresponding sampling mode. Not recommended for very low resolution volumes. Volume size may be increased to be a multiple of 4.&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
* Currently it can only compress to BC6H/BC7 texture formats (desktop/consoles).&lt;br /&gt;
* Volume compression is only supported on Unity 2020.1 or newer.&lt;br /&gt;
* Currently only Bakery shader for the standard rendering pipeline supports using compressed volumes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Samples multiplier ===&lt;br /&gt;
Multiplies all shadow and GI samples by the specified factor. Use it to quickly change between draft and final quality.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Tile size ===&lt;br /&gt;
Same as [[#GPU Priority|GPU Priority]], but instead of abstract priority you set tile size. Bakery splits lightmaps into smaller tiles and updates one at a time. Smaller size means more GPU work interruptions, and can make system more responsive.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Temp path ===&lt;br /&gt;
Temporary files folder. Bakery may require a few gigabytes of free space during rendering. Having this folder on SSD can make rendering slightly faster comparing to HDD. At the moment, this folder is not cleaned automatically. You can delete its contents anytime (except during rendering) manually or via Bakery -&amp;gt; Utilities -&amp;gt; Clear cache.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Output path ===&lt;br /&gt;
Lightmap folder. This is where all lightmap, and also lightprobe and vertex color assets will be saved. This path is relative to your Assets folder.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Use scene named output path ===&lt;br /&gt;
If this option is enabled, output path will be automatically set to a folder with the same name as the currently active scene (Assets/CurrentSceneName/). This is similar to how built-in Unity lightmappers behave.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render Selected Groups ===&lt;br /&gt;
Only bakes [[#Bakery_Lightmap_Group_Selector|Lightmap Groups]] containing selected objects.&lt;br /&gt;
Not only selected objects will be redrawn, but all Lightmap Groups they belong to. Other lightmaps will not be updated. If objects are not a part of some manually assigned group, then a part of the scene using the same lightmap will be rebaked.&lt;br /&gt;
&lt;br /&gt;
Currently it is more convenient to use [[Partial_scene_baking|Sectors for partial scene baking]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Beep on finish ===&lt;br /&gt;
If enabled, Bakery will play a sound when the bake is finished.&lt;br /&gt;
&lt;br /&gt;
== Experimental render settings ==&lt;br /&gt;
=== Unwrapper ===&lt;br /&gt;
If [[#Asset_UV_Processing|Adjust UV Padding]] is enabled, defines the unwrapper that will be used.&lt;br /&gt;
* Default: standard Unity unwrapper. Bakery will call [https://docs.unity3d.com/ScriptReference/Unwrapping.GenerateSecondaryUVSet.html Unwrapping.GenerateSecondaryUVSet] for every mesh with different padding parameters.&lt;br /&gt;
* xatlas: uses [https://github.com/jpcy/xatlas xatlas] by [https://github.com/jpcy jpcy], a modified version of [https://github.com/Thekla/thekla_atlas thekla_atlas] by [https://github.com/castano Ignacio Castaño]. thekla_atlas was used in The Witness ([http://the-witness.net/news/2010/03/graphics-tech-texture-parameterization/ blog post]).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Atlas Packer ===&lt;br /&gt;
Selects the algorithm to use when packing different object UV layouts into large lightmap atlases.&lt;br /&gt;
* Default: original algorithm Bakery used before v1.7.&lt;br /&gt;
* xatlas: uses xatlas.&lt;br /&gt;
&lt;br /&gt;
Some features are only supported with one atlas packer:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Default&lt;br /&gt;
! xatlas&lt;br /&gt;
|-&lt;br /&gt;
| [[Manual#Bakery_Lightmap_Group_Selector|Override resolution]]&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
|-&lt;br /&gt;
| Efficient LOD packing&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Manual#Hole_filling|Hole filling]]&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that atlas packer can be also chosen separately for every Lightmap Group.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Export geometry and maps ===&lt;br /&gt;
If enabled, Bakery will export the scene to its format before rendering. If you are sure that geometry and textures of the scene and lightmap resolution settings were not changed (e.g. you are only tweaking GI or light settings), you can disable this checkbox to make next rendering faster.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update unmodified lights ===&lt;br /&gt;
If enabled, Bakery will recalculate light sources that didn’t change since last rendering. If you are only tweaking one light and don’t want to wait for other lights to re-render, you can disable this checkbox.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update modified lights and GI ===&lt;br /&gt;
If enabled, Bakery will recalculate GI and lights that were changed since last rendering.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== UV padding: increase only ===&lt;br /&gt;
Only visible if [[#Asset_UV_Processing|Adjust UV padding]] is on. By default, optimal UV padding for a model asset is calculated only based on currently loaded scenes. If there are multiple instances of the same model using different lightmap resolution, the smallest one will define padding, so spacing between UV charts is large enough to prevent them from leaking over each other. However, baking the same model in 2 different isolated scenes will possibly break UVs in previous scenes while optimizing for the new one. This checkbox allows to prevent such behaviour by never decreasing the padding value, so it will be always optimized for the lowest resolution instance ever baked.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoise: fix bright edges ===&lt;br /&gt;
[[File:Image19.png|thumb|Left: a bright edge is visible after denoising; Right: fixed.]]&lt;br /&gt;
Only visible if [[#Denoise|Denoise]] is on. Sometimes the neural net used for denoising may produce bright edges around shadows, like if a sharpening effect was applied. If this option is enabled, Bakery will try to filter them away. Denoising stage may get slightly slower, when enabled.&lt;br /&gt;
&lt;br /&gt;
This feature may also be used to filter &amp;quot;fireflies&amp;quot;, i.e. occasional bright dots from the lightmap.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Post-packing ===&lt;br /&gt;
Sometimes when rendering a scene, Bakery can split the lightmap into multiple sub-lightmaps, e.g. when baking different LODs or terrains.&lt;br /&gt;
Post-packing tries to minimize final atlas count by combining these sub-lightmaps in one texture.&lt;br /&gt;
It is recommended to keep this option enabled.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Combine with Enlighten real-time GI ===&lt;br /&gt;
If enabled, then when the Render button is pressed, it will first try to bake with Enlighten to calculate real-time GI. After that, regular Bakery lightmapping process will happen. Both baked and real-time GI will work together.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bake on remote server ===&lt;br /&gt;
Enables [[Network baking|network baking]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Presets ===&lt;br /&gt;
Currently shown under Render/Update buttons when settings are in Experimental mode.&lt;br /&gt;
* Click '''New''' to save all current settings to a preset file.&lt;br /&gt;
* By default, when a preset is active, all settings are grayed out to prevent overwriting the preset.&lt;br /&gt;
* Click '''Modify preset''' to be able to change settings and overwrite the preset.&lt;br /&gt;
* Presets can be swapped via the preset field. Disable preset usage by setting it to None.&lt;br /&gt;
&lt;br /&gt;
== Components ==&lt;br /&gt;
=== Bakery Lightmap Group Selector ===&lt;br /&gt;
&lt;br /&gt;
Specifies which '''Lightmap Group''' to use for the object and all of its children.&lt;br /&gt;
Lightmap Group is a term Bakery uses for a collection of objects sharing one lightmap. Groups have properties telling Bakery how to pack the objects, which lights should affect them, should the result be baked into a texture or vertices.&lt;br /&gt;
By default all static objects are automatically packed into multiple lightmaps groups (atlases), so you don’t have to worry. Defining groups manually should be only used for special purposes, for example:&lt;br /&gt;
* Marking certain objects use [[Vertex Lightmaps|per-vertex lightmap]] instead of textures.&lt;br /&gt;
* Baking a lightmap using exact unscaled UVs as they were in a modeling package.&lt;br /&gt;
* Grouping certain areas of the level to use single lightmap to facilitate resource streaming or to switch different baked lighting at runtime via scripts.&lt;br /&gt;
* Using Render Selected Groups button to only update grouped objects.&lt;br /&gt;
&lt;br /&gt;
To manually define a group, you create '''Lightmap Group Assets''', either by using Assets-&amp;gt;Create menu, or using the Create New button in the component. When using the Create New button, new asset will be created based on these forms:&lt;br /&gt;
* Name: name of the Lightmap Group Asset to create.&lt;br /&gt;
* Packing mode: this selector defines the packing mode of the Lightmap Group. There are 3 modes:&lt;br /&gt;
** Original UV: object and its children will be baked with unmodified UVs. No packing is performed. This is useful for models when multiple meshes share the same already packed UV layout.&lt;br /&gt;
** Pack Atlas: object and its children are packed into a dedicated texture atlas. Before v1.3 every packable child needed to have the component, but it’s no longer necessary. Every child will be packed as its own rectangle, except when Bakery auto-detects a child having non-overlapping sub-children, in which case multiple objects can use a single rectangle.&lt;br /&gt;
** Vertex: object and its children will use vertex-colored baked lighting instead of textures. Note that you’ll need a custom shader for this to work, like [[#Bakery_shaders|Bakery Shader]]. One simple shader (&amp;quot;Bakery/Simple Vertex Lightmapped&amp;quot;) is also included for demonstration and reference. [[Vertex Lightmaps|Learn more about vertex lightmaps.]]&lt;br /&gt;
* Directional mode: allows you to override [[#Directional mode|directional mode]] on the group. Options are the same except for Auto, which will simply use the global setting.&lt;br /&gt;
* Resolution: desired lightmap resolution.&lt;br /&gt;
* Auto-resolution: use [[Manual#Texels_per_unit|Texels Per Unit]] to determine closest power-of-two resolution.&lt;br /&gt;
* Atlas packer: select [[Manual#Atlas_Packer|atlas packing]] algorithm for this group.&lt;br /&gt;
* Bitmask: a list of toggles used to exclude light sources from affecting the lightmap. Every Bakery light source also has a bitmask setting. Lights only affects Lightmap Groups with which they share at least one of these toggles. Default settings mean all lights affect all lightmaps.&lt;br /&gt;
&lt;br /&gt;
[[File:Ts.jpg|thumb|Transparent selfshadow OFF vs ON: note how some single-sided but back-facing polygons become properly lit]]&lt;br /&gt;
&lt;br /&gt;
If you have a Lightmap Group with the Pack Atlas mode assigned, additional settings will appear on the component:&lt;br /&gt;
* Override resolution: override the resolution this object and its children occupy in the lightmap.&lt;br /&gt;
* Resolution: manually defined resolution. For example, if you have a lightmap with a resolution of 512 and it is assigned to 4 objects with override resolution set to 256, Bakery will generate a single 512x512 lightmap where each object takes exactly 256x256 square.&lt;br /&gt;
&lt;br /&gt;
If you select a Lightmap Group asset, additional experimental settings will be visible:&lt;br /&gt;
* [[Subsurface scattering|Subsurface scattering: (click to read more)]]&lt;br /&gt;
* Normal offset: allows you to offset rays from the surface. This is rarely useful and mostly present for experimental purposes.&lt;br /&gt;
* Transparent selfshadow: start rays behind the surface so it doesn't cast shadows on self. Might be useful for translucent foliage.&lt;br /&gt;
* Vertex sampling density (only if Packing Mode is set to Vertex): by default per-vertex bakes only compute 1 value for every vertex; if sampling density is &amp;gt; 0, it will instead average many samples scattered across triangles, yielding super-sampled, smoother results.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Lightmapped Prefab ===&lt;br /&gt;
This component allows prefabs to store lightmapping metadata. Such prefabs can be then instantiated in any scene, both in editor and at runtime.&lt;br /&gt;
The component should be added directly to the root object of the prefab. Nested prefabs are not supported. Because the prefab is going to be overwritten after bake (the same way as when the “Apply” button is pressed), it is required that the prefab does not have any unapplied changes (child objects shouldn’t be moved, materials and script parameters should be unchanged, etc). If such changes are detected, an error will be printed in the component UI and no metadata will be saved after bake. If [[#Warnings|Lightmapped prefab validation]] warning is enabled, all prefab errors will be also shown in a dialog box before the bake.&lt;br /&gt;
&lt;br /&gt;
Lightmapped prefabs support all Bakery features, such as LODs, terrains, directional lightmaps, RNM, SH, per-vertex modes and shadowmasks. For shadowmasks to work, you need lights to also be a part of the same prefab.&lt;br /&gt;
&lt;br /&gt;
{{note| Note that prefab shadowmasks only work on Unity 2017.4 or newer due to API limitations.}}&lt;br /&gt;
&lt;br /&gt;
After baking, an object named “BakeryPrefabLightmapData” will be added to prefab. This object holds a script with all necessary data to apply the lightmaps.&lt;br /&gt;
&lt;br /&gt;
Additionally, Lightmapped Prefab allows to save current render settings and load them back to any currently open scene, using two buttons:&lt;br /&gt;
* Save current render settings to prefab: stores a copy of current Render Settings on  this prefab.&lt;br /&gt;
* Load render settings from prefab: sets current Render Settings to those stored on the prefab.&lt;br /&gt;
[[File:Upload 2019-9-17 10-32-34.png|thumb|Applying the prefab]]&lt;br /&gt;
When baking a Lightmapped Prefab, it is recommended to check that:&lt;br /&gt;
* Prefab is &amp;quot;Applied&amp;quot;. On older Unity versions, click &amp;quot;Apply&amp;quot; button on the top right corner on the Inspector. On newer versions click the &amp;quot;Overrides&amp;quot; list and then &amp;quot;Apply all&amp;quot;.&lt;br /&gt;
* Prefab component UI does not show any errors.&lt;br /&gt;
* [Recommended] &amp;quot;Lightmapped prefab validation&amp;quot; checkbox is enabled in the main window. Clicking Render you doesn't show any warning dialog boxes about the prefabs.&lt;br /&gt;
&lt;br /&gt;
{{note| Lightmaps are named after the scene they are baked in or a Lightmap Group they use (if any). When baking different prefabs in the same scene, make sure to either use a differently named [[Manual#Bakery_Lightmap_Group_Selector|Lightmap Group]] or change the [[Manual#Output_path|Output Path]].}}&lt;br /&gt;
&lt;br /&gt;
{{note| When baking multiple prefabs using identical models one by one, it is recommended to set [[Manual#Asset_UV_Processing|Asset UV Processing]] to ''Don't Change'', to prevent alteration of shared model UVs.}}&lt;br /&gt;
&lt;br /&gt;
{{note| Bakery's prefab workflow was implemented before Unity had a &amp;quot;double-click into prefab&amp;quot; view feature. Thus, lightmaps may be not correctly applied in the isolated prefab view, and the component may show a &amp;quot;This GameObject is not a prefab&amp;quot; message. It should work as expected when working in a normal scene.}}&lt;br /&gt;
&lt;br /&gt;
{{note|When unpacking previously baked prefabs and unlinking them from existing lightmaps, make sure to remove the BakeryPrefabLightmapData object which holds the prefab-wide lightmap/renderer connections.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Direct Light ===&lt;br /&gt;
[[File:Directlight.jpg|thumb|Pure direct light with GI]]&lt;br /&gt;
[[File:Image4.png|thumb|Left: shadow spread = 0.01, right: 0.05. Note how shadows start sharp and get gradually blurrier with distance.]]&lt;br /&gt;
Infinitely distant directional light (e.g. Sun).&lt;br /&gt;
* Color: color.&lt;br /&gt;
* Intensity: linear color multiplier.&lt;br /&gt;
* Shadow spread: size of the light source or, simply put, shadow blurriness. 0 = max sharp shadows, 1 = max blurred shadows. Technically it interpolates from a single ray to a wider cone of rays.&lt;br /&gt;
* Shadow samples: affect shadows quality. The smaller the Shadow Spread value, the less samples are needed for a clean image. Typical values for sun shadows are from 1 to 16. Setting samples to 0 will make shadows from this light disappear.&lt;br /&gt;
* Bitmask: a list of toggles used to exclude this light source from affecting particular Lightmap Groups.&lt;br /&gt;
* Baked contribution: determines what kind of lighting data should be baked. Only visible in Indirect or Shadowmask modes. Possible values:&lt;br /&gt;
** Direct and Indirect: both direct and indirect contribution will be completely baked.&lt;br /&gt;
** Indirect only: a realtime light is supposed to provide direct contribution; only indirect lighting is baked.&lt;br /&gt;
** Shadowmask and indirect: a realtime light is supposed to provide direct contribution, but shadows from static geometry will be baked to a separate map. Dynamic and static shadows will be mixed together. Indirect lighting will be baked as usual.&lt;br /&gt;
** Direct, Indirect, Shadowmask (custom lighting only): same as Direct and Indirect, but the Shadowmask is also produced and assigned to use with custom shaders.&lt;br /&gt;
* Denoise shadowmask: determines if denoising should be applied to this light’s shadowmask. Usually it’s not necessary as shadows don’t exhibit much noise, but can be useful for very wide blurry shadows (large shadow spread).&lt;br /&gt;
* Indirect intensity: non-physical GI multiplier for this light. Should be 1 for natural lighting, but can be modified for more stylized scenes.&lt;br /&gt;
* Anti-alias: performs super-sampling for the shadow.&lt;br /&gt;
* Texture projection: projects a multiplicative tiled texture over lighting. Can be used to emulate distant cloud shadows.&lt;br /&gt;
When texture projection is set, its scale/offset can be manipulated using &amp;quot;Tiling&amp;quot; and &amp;quot;Offset&amp;quot; fields. Alternatively, click &amp;quot;Tweak projection in Scene View&amp;quot; and use additional gizmo to move and scale the projection visually. Click &amp;quot;Render reference frame&amp;quot; to save a PNG of &amp;quot;light's point of view&amp;quot;. This is useful to paint cloud shadows over the scene.&lt;br /&gt;
&lt;br /&gt;
If the same object has both Unity and Bakery light sources enabled, and they don’t match, two buttons will appear:&lt;br /&gt;
* Match lightmapped to real-time: copy common settings from Unity light to Bakery light.&lt;br /&gt;
* Match real-time to lightmapped: copy common settings from Bakery light to Unity light.&lt;br /&gt;
&lt;br /&gt;
{{note| In physical terms, Bakery's &amp;quot;Intensity&amp;quot; for directional lights is Lux divided by Pi.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Sky Light ===&lt;br /&gt;
[[File:Skylight.jpg|thumb|Pure sky light with GI]]&lt;br /&gt;
Infinitely distant shadowed ambient light (sky).&lt;br /&gt;
* Color: color.&lt;br /&gt;
* Intensity: linear color multiplier.&lt;br /&gt;
* Sky texture: optional cubemap asset, e.g. HDRI panorama to affect lighting colors from different directions.&lt;br /&gt;
{{note| Rotating sky light’s GameObject will rotate lighting from the cubemap accordingly.}}&lt;br /&gt;
* Samples: affects shadows quality. Typical values are from 8 to 32.&lt;br /&gt;
* Hemispherical: if enabled, lighting will only come from above (upper hemisphere). Otherwise from all directions.&lt;br /&gt;
* Bitmask: a list of toggles used to exclude this light source from affecting particular Lightmap Groups.&lt;br /&gt;
* Baked contribution: determines what kind of lighting data should be baked. Only visible in Indirect or Shadowmask modes. Possible values:&lt;br /&gt;
** Direct and Indirect: both direct and indirect contribution will be completely baked. This is the default and recommended behaviour for all Sky Lights, as there is no real-time version to emulate them in Unity.&lt;br /&gt;
** Indirect only: a realtime light is supposed to provide direct contribution; only indirect lighting is baked.&lt;br /&gt;
&lt;br /&gt;
If sky light’s settings and current scene skybox don’t match, two buttons will appear:&lt;br /&gt;
* Match this light to scene skybox: copy common settings from active skybox material to Bakery sky light. Currently it can only match skyboxes using the “Skybox/Cubemap” or “Skybox/Bakery skybox” shaders.&lt;br /&gt;
* Match scene skybox to this light: copy common settings from Bakery sky light to scene skybox.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bakery Light Mesh ===&lt;br /&gt;
[[File:Image29.png|thumb|Left: Samples Near = 0, Samples Far = 4096.&amp;lt;br&amp;gt;&lt;br /&gt;
Middle: Samples Near = 0, Samples Far = 128.&amp;lt;br&amp;gt;&lt;br /&gt;
Right: Samples Near = 16, Samples Far = 128.&amp;lt;br&amp;gt;&lt;br /&gt;
Note how the lighting appearance is similar, yet less combined samples are used.]]&lt;br /&gt;
Emissive mesh of any shape. Should be used together with the Mesh Renderer component or with a Light component set to Area mode.&lt;br /&gt;
* Color: color&lt;br /&gt;
* Intensity: linear color multiplier.&lt;br /&gt;
* Cutoff: maximum lighting distance. Bakery will additionally attenuate correct inverse-squared falloff near the limit. It works best when cutoff value is just where physical falloff gets very dim. Cutoff can improve baking performance, but you also can set it to a very high (unreachable) value for complete correctness.&lt;br /&gt;
* Self Shadow: determines if light mesh itself casts shadows. This option also enables a more precise lighting algorithm.&lt;br /&gt;
* Samples Near: affect lighting quality near the mesh. Typical values are from 16 to 64. This option is only available when Self Shadow is on.&lt;br /&gt;
* Samples Far: affects lighting quality far away from the mesh. Typical values are from 4 to 4096.&lt;br /&gt;
&lt;br /&gt;
Bakery mixes two different algorithms for area lights based on emissive surface proximity. Close to the light it works similar to the GI algorithm, while at a distance the light is approximated as a cloud of virtual point lights.&lt;br /&gt;
&lt;br /&gt;
{{note| &amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;Light Meshes don’t receive lighting on their own and don’t get lightmapped.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;One Light Mesh with many polygons is faster to bake than many simple Light Meshes.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;If you keep getting dirty/noisy results, try setting Samples Near to 0. Then only the VPL algorithm is used. It is also useful for very simple lights where precision is not important (e.g. window lights on a building).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;}}&lt;br /&gt;
[[File:Dd99d-QU0AEKFBK.jpg|thumb|A curved Light Mesh]]&lt;br /&gt;
* Bitmask: a list of toggles used to exclude this light source from affecting particular Lightmap Groups.&lt;br /&gt;
* Baked contribution: determines what kind of lighting data should be baked. Only visible in Indirect or Shadowmask modes. Possible values:&lt;br /&gt;
** Direct and Indirect: both direct and indirect contribution will be completely baked. This is the default and recommended behaviour for all Light Meshes, as there is no real-time version to emulate them in Unity.&lt;br /&gt;
** Indirect only: a realtime light is supposed to provide direct contribution; only indirect lighting is baked.&lt;br /&gt;
** Shadowmask and Indirect: a realtime light is supposed to provide direct contribution, but shadows from static geometry will be baked to a separate map. Dynamic and static shadows will be mixed together. Indirect lighting will be baked as usual. Currently only HDRP (and custom renderers) support mixed area lights.&lt;br /&gt;
** Direct, Indirect, Shadowmask (custom lighting only): same as Direct and Indirect, but the Shadowmask is also produced and assigned to use with custom shaders.&lt;br /&gt;
* Indirect intensity: non-physical GI multiplier for this light. Should be 1 for natural lighting, but can be modified for more stylized scenes.&lt;br /&gt;
* Shadowmask with falloff: bakes complete light attenuation into the shadowmask (only useful with custom shaders).&lt;br /&gt;
&lt;br /&gt;
If mesh material and light settings do not match, two buttons will appear:&lt;br /&gt;
* Match light to material:  copy common settings from unlit mesh material or area light to Bakery light.&lt;br /&gt;
* Match material to light: copy common settings from Bakery light to unlit mesh material or area light.&lt;br /&gt;
&lt;br /&gt;
==== Differences between Light Mesh and emissive materials ====&lt;br /&gt;
Emissive material:&lt;br /&gt;
* Propagates light during GI calculation, therefore is “free”, no matter how many meshes are emissive.&lt;br /&gt;
* Small and bright lights can give inaccurate noisy results, depending on GI sample count.&lt;br /&gt;
* Has to occupy space in lightmap due to the way GI in Bakery works, therefore possibly wasting it. Also it means that emissive objects require valid UVs and have “Cast shadows” enabled..&lt;br /&gt;
&lt;br /&gt;
Light Mesh:&lt;br /&gt;
* Lighting is calculated separately for each light, therefore is slower than emissive materials.&lt;br /&gt;
* Designed to give clean results for small and bright lights, even very far away from them.&lt;br /&gt;
* Doesn’t take space in lightmaps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Point Light ===&lt;br /&gt;
[[File:Image11.png|thumb|Left: Shadow Spread = 0.5, right: Shadow Spread = 1.]]&lt;br /&gt;
Point light, doesn’t have area. Despite physical impossibility it is useful for games and the only way to match Unity’s point and spot lights.&lt;br /&gt;
{{note|Spot lights are just point lights with additional projection mask.}}&lt;br /&gt;
* Color: color.&lt;br /&gt;
* Intensity: linear color multiplier.&lt;br /&gt;
* Shadow spread: shadow blurriness. Although point lights don’t have area, it is often desired to still have blurred shadows from them. For this purpose shadows are simulated as if they were cast from a spherical area light. This parameter defines the radius of such virtual sphere, directly affecting blurriness.&lt;br /&gt;
* Physical falloff: if enabled, will use correct inverse-squared falloff with additional attenuation near the limit. Otherwise will try to mimic Unity’s falloff.&lt;br /&gt;
* Falloff min size: learn more in [[Point Light Attenuation]] section.&lt;br /&gt;
* Range: if physical falloff is disabled, equals to Unity’s light range. If it’s enabled, will only slightly fade away physical falloff at the edge.&lt;br /&gt;
* Samples: affects shadows quality. Typical values are from 1 to 512. Setting samples to 0 will make shadows from this light disappear.&lt;br /&gt;
[[File:Image10.png|thumb|Left to right: Omni, Cookie (default spot texture), Cubemap, IES.]]&lt;br /&gt;
* Projection mask: type of mask/cookie. Options:&lt;br /&gt;
** Omni: no mask, equals to Unity’s Point Light.&lt;br /&gt;
** Cookie: cookie texture projection. Additional options:&lt;br /&gt;
*** Cookie texture: 2D texture asset. Bakery includes the original Unity’s Spot Light texture (named ftUnitySpotTexture) that you can use to mimic it.&lt;br /&gt;
*** Angle: texture projection angle (similar to Unity’s Spot Light).&lt;br /&gt;
*** Correct distortion: corrects cookie distortion visible on straight lines at wide angles.&lt;br /&gt;
** Cubemap: cubemap cookie projection. Additional options:&lt;br /&gt;
*** Projected cubemap: cubemap asset.&lt;br /&gt;
** IES: lighting is modulated by the IES file data. Additional options:&lt;br /&gt;
*** IES file: file with .ies extension.&lt;br /&gt;
* Bitmask: a list of toggles used to exclude this light source from affecting particular Lightmap Groups.&lt;br /&gt;
* Baked contribution: determines what kind of lighting data should be baked. Only visible in Indirect or Shadowmask modes. Possible values:&lt;br /&gt;
** Direct and Indirect: both direct and indirect contribution will be completely baked.&lt;br /&gt;
** Indirect only: a realtime light is supposed to provide direct contribution; only indirect lighting is baked.&lt;br /&gt;
** Shadowmask and Indirect: a realtime light is supposed to provide direct contribution, but shadows from static geometry will be baked to a separate map. Dynamic and static shadows will be mixed together. Indirect lighting will be baked as usual.&lt;br /&gt;
** Direct, Indirect, Shadowmask (custom lighting only): same as Direct and Indirect, but the Shadowmask is also produced and assigned to use with custom shaders.&lt;br /&gt;
* Indirect intensity: non-physical GI multiplier for this light. Should be 1 for natural lighting, but can be modified for more stylized scenes.&lt;br /&gt;
* Shadowmask with falloff: bakes complete light attenuation (except for distance) into the shadowmask (only useful with custom shaders).&lt;br /&gt;
* Legacy sampling: use Bakery's original more biased shadow sampling strategy. Produces noise-free shadows, but wide penumbras can exhibit banding. If disabled, an unbiased, but noisier technique is used.&lt;br /&gt;
&lt;br /&gt;
If the same object has both Unity and Bakery light sources enabled, and they don’t match, two buttons will appear:&lt;br /&gt;
* Match lightmapped to real-time: copy common settings from Unity light to Bakery light.&lt;br /&gt;
* Match real-time to lightmapped: copy common settings from Bakery light to Unity light.&lt;br /&gt;
&lt;br /&gt;
{{note| In physical terms, Bakery's &amp;quot;Intensity&amp;quot; for points lights is (Candela/Pi).}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Volume ===&lt;br /&gt;
[[File:Voldemo notlonely.gif|A dynamic door being lit by a BakeryVolume (animated GIF by NOTLonely)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Volumes generate 3D textures that store light probes per voxel (L1 spherical harmonics and shadowmasks) making them a viable replacement for regular Unity light probes.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Unity Light Probes&lt;br /&gt;
! Unity LPPV&lt;br /&gt;
! Bakery Volumes&lt;br /&gt;
|-&lt;br /&gt;
| Manually placing each probe&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | No&lt;br /&gt;
|-&lt;br /&gt;
| Interpolate multiple probes on one object&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Movable at runtime&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Can put in a prefab&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Full scripting API&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Ringing&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Possible&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Possible&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Fixed&lt;br /&gt;
|-&lt;br /&gt;
| Denoising&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Runtime overhead&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | CPU: low; GPU: low.&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | CPU: medium; GPU: medium.&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#e4ead3;&amp;quot; | CPU: none; GPU: medium.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bakery Volume is a bounding box linked to a set of 3D textures (3 SH textures and one shadowmask, if needed), making it very easy to use and script. Volumes can be trivially swapped, moved, loaded or unloaded at runtime or linked to prefabs. They also do not need any Light Probe Groups and manual probe placement; the whole volume is filled with a uniform grid of probe voxels. Light/shadow leaking is automatically fixed the same way it is done for lightmaps (although thin double-sided walls may be a problem with large voxel size, but it can be avoided by using different volumes on different sides). Because of the uniform nature of voxel grids, it is also possible to apply lightmap-like denoising to them, which is not possible with regular light probes. Additionally, Bakery shaders use the [https://drive.google.com/file/d/1MK6Clw93q8ljijRjb4gQOzzaIjn1uF9Y/view Geomerics sampling trick] to completely get rid of the &amp;quot;ringing&amp;quot; artifact spherical harmonics can sometimes produce with high-contrast HDR lighting.&lt;br /&gt;
&lt;br /&gt;
Because of that, Volumes can produce clean, detailed, high-quality baked lighting for dynamic objects (that is, the lighting that comes from the static objects and affects dynamic objects, not the other way around).&lt;br /&gt;
&lt;br /&gt;
The only downside of the Volume approach is the higher per-pixel shading cost. The cost is similar to LPPV (scaling with the amount of shaded volume-affected pixels on the screen) but unlike LPPV, the Volumes themselves are never updated once they are baked. Multiple volume blending can be avoided by slightly overlapping them instead.&lt;br /&gt;
&lt;br /&gt;
====Setting volume transform====&lt;br /&gt;
[[File:Bvolgizmo.jpg|thumb|Volume gizmo]]&lt;br /&gt;
When BakeryVolume is added to a GameObject, a bounding box gizmo will appear in scene view. Dragging it by the little squares will scale it.&lt;br /&gt;
There are also other ways to change volume size and position:&lt;br /&gt;
* Drag any renderable GameObject into &amp;quot;Wrap to object&amp;quot; field. The volume will wrap around this object (and its children) to encapsulate them.&lt;br /&gt;
* If there is a Box Collider added to the same object, &amp;quot;Set from box collider&amp;quot; and &amp;quot;Set to box collider&amp;quot; buttons will appear. These can be used to quickly copy values between Volume/Collider.&lt;br /&gt;
&lt;br /&gt;
====Resolution====&lt;br /&gt;
When &amp;quot;Adaptive resolution&amp;quot; is enabled, the amount of voxels is governed by &amp;quot;Voxels per unit&amp;quot;. Disabling it allows to manually enter the resolution. For most games with 1 unit = 1 meter, a reasonable &amp;quot;Voxels per unit&amp;quot; value is 2, but there are cases (e.g. dynamic doors) when using a smaller, but higher resolution volume is beneficial.&lt;br /&gt;
&lt;br /&gt;
====Other settings====&lt;br /&gt;
* Enable baking: should the volume be (re)computed? Disable to prevent overwriting existing data.&lt;br /&gt;
* Denoise: apply denoising after baking the volume. Recommended for high-resolution volumes. Avoid using for very low-resolution volumes covering many lights, as it will be hard for denoisers to tell actual content from noise.&lt;br /&gt;
* Global: automatically assign this volume to all volume-compatible shaders, unless they have overrides. Internally it will call Shader.SetGlobalTexture()/SetGlobalVector().&lt;br /&gt;
&lt;br /&gt;
====Usage====&lt;br /&gt;
Volumes can be assigned to objects using a volume-aware shader. Bakery comes with &amp;quot;Bakery Standard&amp;quot; shader that implements it, as well as a HDRP and URP graphs. See example_volumes scenes for various ways of applying a volume.&lt;br /&gt;
&lt;br /&gt;
====Hints====&lt;br /&gt;
* Make sure to check the examples.&lt;br /&gt;
* If two volumes connect, make them overlap a bit. The size of the overlap should be equal to the size of the largest dynamic object. This way simply switching between volumes on the go will work.&lt;br /&gt;
* Only place volumes around areas dynamic objects can actually reach. E.g. use player height to limit volume height.&lt;br /&gt;
&lt;br /&gt;
====Rotating volumes====&lt;br /&gt;
Volumes can be rotated around Y axis, if &amp;quot;Rotate around Y&amp;quot; option is enabled. Rotation is very cheap and only uses 2 extra floats of data (precomputed sin/cos of the angle).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There is also an additional option to rotate volumes at runtime (Experimental -&amp;gt; &amp;quot;Support rotation after bake&amp;quot; and a similar option in Bakery Shader), in which case they need to be baked with zero initial rotation.&lt;br /&gt;
&lt;br /&gt;
In URP such dynamic rotation can be used with BakeryURPVolumeGraphRotatable.shadergraph.&lt;br /&gt;
&lt;br /&gt;
For global volumes dynamic rotation will be updated when the component is (re)enabled or volume.SetGlobalParams() is called. Using local rotated volumes requires manually setting the rotation on the material or the MaterialPropertyBlock:&lt;br /&gt;
{{code|&amp;lt;nowiki&amp;gt;SetMatrix(&amp;quot;_VolumeMatrix&amp;quot;, volume.GetMatrix())&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
====Technical information====&lt;br /&gt;
Volumes can work automatically (check example scenes), but it is also possible to script the way they are used.&lt;br /&gt;
&lt;br /&gt;
Volume data can be retrieved from the component via these public properties:&lt;br /&gt;
* bakedTexture0: stores L0 RGB coefficients and L1 Z red channel in alpha.&lt;br /&gt;
* bakedTexture1: stores L1 X RGB coefficients and L1 Z green channel in alpha.&lt;br /&gt;
* bakedTexture2: stores L1 Y RGB coefficients and L1 Z blue channel in alpha.&lt;br /&gt;
* bakedMask: stores the volumetric shadowmask.&lt;br /&gt;
* bounds: the bounding box of the volume.&lt;br /&gt;
&lt;br /&gt;
All bakedTexture* maps use RGBAHalf (8 bytes per voxel) format and the mask is ARGB32 (4 bytes per voxel). Shadowmask can also use single-channel R8 format (1 byte per voxel).&lt;br /&gt;
&lt;br /&gt;
Therefore volume byte size = width*height*depth*3*8 + (only if the shadowmask is used) width*height*depth*4 (or width*height*depth with an R8 mask).&lt;br /&gt;
&lt;br /&gt;
[[Manual#Compress_volumes|Texture compression]] can be enabled on volumes to make them much smaller.&lt;br /&gt;
&lt;br /&gt;
To sample the volume, a special shader is needed, and these are included in Bakery. To add volumes to a custom shader, check BakeryVolume_float() function in BakeryDecodeLightmap.hlsl which is included in HDRP/URP packages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Light Filter ===&lt;br /&gt;
[[File:Output optimized.gif|Stained glass, as seen in Bakery Real-Time Preview. Same results are baked by the Bakery lightmapper.]]&lt;br /&gt;
&lt;br /&gt;
Marks a renderer as a Light Filter. Filters tint all direct/indirect rays with their color, similar to real-life optical filters, allowing for colored transparencies (e.g. stained glass). The only parameter is the texture used for tinting.&lt;br /&gt;
* Light Filter objects still receive lightmaps like everything else.&lt;br /&gt;
* Filters don't scatter/blur rays (for that try [[Subsurface_scattering|Subsurface Scattering]] or [[Manual#Backface_GI|Backface GI]]).&lt;br /&gt;
* Filters can produce color-tinted shadows. If [[Manual#Shadowmask|Shadowmask]] mode is used on the light, only R channel of the result will be saved (as Unity only supports single-channel masks). For fully baked shadows there are no limitations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Sector ===&lt;br /&gt;
See '''[[Partial_scene_baking|Partial scene baking]]'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Always Render ===&lt;br /&gt;
If added to an object, Bakery will always take it into account when baking, even if its renderer is disabled.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Pack As Single Square ===&lt;br /&gt;
If added to an object, Bakery will treat UVs of this object and its children as a single combined square and never move them away from each other during automatic atlas packing or in a Lightmap Group with Pack Atlas mode. Whole children hierarchy will be packed as one.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Shared LOD UV ===&lt;br /&gt;
If added to a LODGroup, will mark all similarly-named LODs as sharing the same lightmap. By default, every LOD mesh receives a unique lightmap, taking space in the atlas; If, however, it is known that LODs of the same object have similar UV2 (or UV1, if it's non-overlapping, and UV2 is not present), they can map to the same part of the atlas, saving memory.&lt;br /&gt;
This technique is also known as [https://github.com/laurenth-personal/LODLightmapScripts/ Lightmap Stealing].&lt;br /&gt;
&lt;br /&gt;
= Material compatibility =&lt;br /&gt;
=== Albedo and emission ===&lt;br /&gt;
Bakery supports most Unity materials by utilizing the [https://docs.unity3d.com/Manual/MetaPass.html Meta Pass] system. All built-in, surface, URP and HDRP shaders already have a correct meta pass defined.&lt;br /&gt;
&lt;br /&gt;
If you have an Unlit shader, add meta pass manually, as described in Unity docs.&lt;br /&gt;
&lt;br /&gt;
If the pass is not present, Bakery will assume {{codeVar|_MainTex}}, {{codeVar|_BaseColorMap}} or {{codeVar|_Color}} (if no texture is set) properties as material albedo and {{codeVar|_EmissionMap}} and {{codeVar|_EmissionColor}} as emissive color.&lt;br /&gt;
&lt;br /&gt;
In order for emission to work, [https://docs.unity3d.com/ScriptReference/Material-globalIlluminationFlags.html Material.globalIlluminationFlags] must be set to [https://docs.unity3d.com/ScriptReference/MaterialGlobalIlluminationFlags.BakedEmissive.html MaterialGlobalIlluminationFlags.BakedEmissive]. Standard shaders set this value automatically.&lt;br /&gt;
&lt;br /&gt;
=== Opacity ===&lt;br /&gt;
[[File:Upload 2019-1-25 0-4-30.png|thumb|Material parameters converted to cutout (default)]]&lt;br /&gt;
[[File:Alphacombos dither.jpg|thumb|Semi-transparent values added via Dither Transparency option]]&lt;br /&gt;
[[File:Alphacombos filter.jpg|thumb|Light Filter components used on red planes, producing colored shadows]]&lt;br /&gt;
By default, Bakery always takes full resolution opacity from the alpha value of {{codeVar|_MainTex}}, {{codeVar|_BaseColorMap}} or {{codeVar|_BaseMap}} and treats it as cutout (1 bit tranparency).&lt;br /&gt;
&lt;br /&gt;
When '''Dither Transparency''' option is enabled, semi-transparent values are automatically converted to variable blue noise, which is then filtered/blurred, resulting in partial transparency (it was previously possible using custom manually dithered maps, but since v1.97 it is automatic).&lt;br /&gt;
&lt;br /&gt;
In order for opacity to work, [https://docs.unity3d.com/Manual/SL-SubShaderTags.html RenderType tag] of the shader must be one of these values:&lt;br /&gt;
* {{codeVar|Transparent}}&lt;br /&gt;
* {{codeVar|TransparentCutout}}&lt;br /&gt;
* {{codeVar|TreeLeaf}}&lt;br /&gt;
&lt;br /&gt;
If a property named {{codeVar|_Cutoff}} is present, it will affect the cutout (therefore Standard shader cutoff slider works automatically).&lt;br /&gt;
&lt;br /&gt;
Without Dither Transparency, if material RenderType is {{codeVar|Transparent}} or {{codeVar|TreeLeaf}}, then alpha value of {{codeVar|_Color}} will additionally modify the cutoff: ''finalCutoff = 1 - (1 - cutoff) * alpha''&lt;br /&gt;
&lt;br /&gt;
For colored transparency, use the [[Manual#Bakery_Light_Filter|Light Filter]] component.&lt;br /&gt;
&lt;br /&gt;
For diffuse translucency effects read about [[#Backface GI|Backface GI]] and [[subsurface scattering]].&lt;br /&gt;
&lt;br /&gt;
==== Alpha Meta Pass ====&lt;br /&gt;
Since v1.9 Bakery also supports specifying custom shader-based transparency, but it requires a compatible shader. To take advantage of ''Alpha Meta Pass'', following steps must be taken:&lt;br /&gt;
* Add a property named '''BAKERY_META_ALPHA_ENABLE''' to the shader. For example:&lt;br /&gt;
{{code|&amp;lt;nowiki&amp;gt;[HideInInspector] BAKERY_META_ALPHA_ENABLE (&amp;quot;Enable Bakery alpha meta pass&amp;quot;, Float) = 1.0&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
* Make sure that RenderType tag is set to one of the values above.&lt;br /&gt;
* Declare a pass named '''META_BAKERY'''. &lt;br /&gt;
* In that pass check if '''unity_MetaFragmentControl.w''' is non-zero, in which case, return the computed transparency value. &lt;br /&gt;
&lt;br /&gt;
See ''Baked_Alpha_meta.shader'' included in the package as an example.&lt;br /&gt;
&lt;br /&gt;
Note: currently Alpha Meta Pass requires Light Probe Mode to be set to L1 or L2.&lt;br /&gt;
&lt;br /&gt;
=== Normal mapping ===&lt;br /&gt;
Custom surface normals can be used in conjunction with [[#Baked Normal Maps|Baked Normal Maps]] mode. Unfortunately, Unity's Meta Pass does not output normal information, so by default normals are taken from a texture named {{codeVar|_BumpMap}}, additionally transformed by {{codeVar|_MainTex_ST}}.&lt;br /&gt;
&lt;br /&gt;
It is however possible to make completely custom shaders with advanced normal mapping features (e.g. blending multiple layers) compatible with baking. To do that you'll need:&lt;br /&gt;
&lt;br /&gt;
1. Define a Meta Pass in your shader, just [https://docs.unity3d.com/Manual/MetaPass.html#ExampleMetaPass as described in Unity docs].&lt;br /&gt;
&lt;br /&gt;
2. Name it {{codeVar|&amp;quot;META_BAKERY&amp;quot;}}, instead of just {{codeVar|&amp;quot;META&amp;quot;}}.&lt;br /&gt;
&lt;br /&gt;
3. Include {{codeVar|&amp;quot;BakeryMetaPass.cginc&amp;quot;}}.&lt;br /&gt;
&lt;br /&gt;
4. Add {{codeVar|#pragma vertex vert_bakerymt}}&lt;br /&gt;
&lt;br /&gt;
5. If {{codeVar|unity_MetaFragmentControl.z}} variable is not 0, shader should return world-space normal. Returned normal should be encoded using {{codeVar|BakeryEncodeNormal}} function.&lt;br /&gt;
&lt;br /&gt;
Two example shaders implementing this extended Meta Pass are included in Assets/Bakery/examples/shaders.&lt;br /&gt;
&lt;br /&gt;
You can copy and modify BakeryMetaPass.cginc to suit your needs, e.g. pass additional data from the vertex shader.&lt;br /&gt;
&lt;br /&gt;
=== Front/back faces ===&lt;br /&gt;
No matter what culling mode is used on the shader, Bakery treats all back-faces as opaque, meaning any direct light ray will not pass through a back-face, just as it will not pass through a front-face.&lt;br /&gt;
However, back-faces can partially emit lighting received by a front-face, if you use [[Manual#Backface_GI|Backface GI]].&lt;br /&gt;
&lt;br /&gt;
= &amp;quot;Lightmap Parameters&amp;quot; assets =&lt;br /&gt;
[[File:Lp.jpg|thumb|Extended Lightmap Parameters]]&lt;br /&gt;
Similar to Bakery's [[Manual#Bakery_Lightmap_Group_Selector|Lightmap Groups]], Unity has [https://docs.unity3d.com/Manual/class-LightmapParameters.html Lightmap Parameters] that can be created as assets and assigned to Mesh Renderers. Their logic has differences and similarities:&lt;br /&gt;
* Lightmap Group's primary usage is to group multiple objects in one atlas. Additionally it allows overriding baking settings for this atlas.&lt;br /&gt;
* Lightmap Parameters are primarily used to override baking settings for an object. But additionally they can influence packing by using the &amp;quot;Baked Tag&amp;quot; option: objects with a different Baked Tag will never share the same atlas.&lt;br /&gt;
&lt;br /&gt;
Since some users are more used to the Lightmap Parameters workflow, Bakery now supports and extends them:&lt;br /&gt;
* Baked Tag is respected by Bakery.&lt;br /&gt;
* Additional Bakery-specific options will be shown in the Lightmap Parameters UI. Refer to the [[Manual#Bakery_Lightmap_Group_Selector|Lightmap Group]] section for their meaning.&lt;br /&gt;
&lt;br /&gt;
= Project Settings =&lt;br /&gt;
Some global settings can be tweaked in Project Settings -&amp;gt; Bakery GPU Lightmapper (this option is only visible in Unity 2018.3 or newer; for older versions, edit BakeryProjectSettings.asset instead):&lt;br /&gt;
* Mipmap lightmaps: enables mipmapping on lightmap assets. Can cause leaks across UV charts as atlases get smaller; on the other hand, it reduces high resolution lightmap aliasing in the distance. Overall it is recommended to use separately baked LODs with lower resolution lightmaps for very distant objects instead.&lt;br /&gt;
* Color file format: format for regular HDR color lightmaps. Possible values:&lt;br /&gt;
** HDR: Radiance HDR format (default). Can be opened in many image editors.&lt;br /&gt;
** Asset: native Unity format. Can have custom mipmap count.&lt;br /&gt;
* Mask/Direction file format: format for additional LDR maps, such as shadowmasks or directional data. Possible values:&lt;br /&gt;
** TGA: 8-bit Targa (default).&lt;br /&gt;
** PNG: 8-bit PNG. Usually takes less space on disk compared to TGA.&lt;br /&gt;
** Asset: native Unity format. Can have custom mipmap count.&lt;br /&gt;
* Compress lightmaps: defines lightmap asset compression behaviour. Compressed lightmaps take less VRAM, but may exhibit some visual artifacts (such as banding or colored blotches) depending on the type of compression (for mobile compression issues [[Troubleshooting#I_have_an_Android_project.2C_and_lightmaps_don.27t_look_good|see this]]). Possible values:&lt;br /&gt;
*** Compress but allow overriding asset: new lightmaps will be created with compression enabled. After they are created, it is possible to change their compression settings in Inspector. These modified values will be kept after rebaking (default).&lt;br /&gt;
*** Force compress: always compress all lightmaps.&lt;br /&gt;
*** Force no compress: always produce uncompressed lightmaps.&lt;br /&gt;
* High quality direction: enables &amp;quot;high&amp;quot; quality compression for directional maps. Actual formats depend on platform. On PC, for example, it will change it from DXT1 to BC7, which gives higher quality, but doubles the VRAM usage.&lt;br /&gt;
* Texel padding (default atlas packer): defines how many empty texels to add between objects' UV layouts in lightmap atlases, when using the default atlas packer.&lt;br /&gt;
* Texel padding (xatlas packer): same, but when using xatlas.&lt;br /&gt;
* Alpha Meta Pass resolution multiplier: multiplies resolution of the [[Manual#Alpha_Meta_Pass|Alpha Meta Pass]] allowing to have precise shader-based cutouts while baking low resolution lightmaps.&lt;br /&gt;
* Volume render mode: which [[Manual#Render_mode|render mode]] to use for all [[Manual#Bakery_Volume|Volumes]]? Auto uses current active render mode (default).&lt;br /&gt;
* Delete previous lightmaps before bake: actually delete all previously rendered lightmap files from this scene before baking new ones.&lt;br /&gt;
* Log level: defines how much information is printed to console during the bake. Possible values:&lt;br /&gt;
** 0: do not print anything.&lt;br /&gt;
** 1: only print progress information.&lt;br /&gt;
** 2: only print warnings.&lt;br /&gt;
** 3: print everything.&lt;br /&gt;
* Alternative scale in lightmap: makes 'Scale in Lightmap' renderer property act more similar to built-in Unity behaviour.&lt;br /&gt;
* Align to texture compression blocks with xatlas: makes xatlas align charts to 4x4 block boundaries, which gives more compression-friendly results.&lt;br /&gt;
* Generate smooth positions: should sample positions be adjusted to prevent incorrect shadowing on low-poly geometry with smooth normals? Can be disabled in very rare cases when using geometry with wildly mismatching normals. See [https://ndotl.wordpress.com/2018/08/29/baking-artifact-free-lightmaps/#shadowterm  this article] for technical explanation.&lt;br /&gt;
* Smooth positions per-triangle: should smooth/flat position be decided per-triangle? Can be disabled in very rare cases when using geometry with wildly mismatching normals.&lt;br /&gt;
* Use 'Receive GI' values: take 'Receive Global Illumination' values into account on renderers. Originally Bakery ignored it.&lt;br /&gt;
* Remove ringing in Legacy light probes: enables softer light probe convolution in Legacy mode to prevent artifacts in high-contrast areas.&lt;br /&gt;
* Always render reflection probes: automatically render reflection probes after every Render/Render Light Probes.&lt;br /&gt;
* Ringing removal for L2 light probes: applies de-ringing to [[Manual#Light_probe_mode|L2 light probes]]. The higher the value, the smoother the probe lighting is; this smoothing reduces [https://docs.unity3d.com/6000.2/Documentation/Manual/light-probes-troubleshooting.html ringing] artifacts (if present).&lt;br /&gt;
* Put menu under Tools: puts Bakery menu under the Tools menu.&lt;br /&gt;
&lt;br /&gt;
If any format is set to Asset, and mipmapping is enabled, an additional option is shown:&lt;br /&gt;
* Maximum mipmap count: defines maximum amount of mipmaps. For example, if set to 2, a 8K lightmap will only have two additional mipmaps: 4K and 2K. Lower resolutions will be omitted, thus limiting leaking artifacts during mipmapping.&lt;br /&gt;
&lt;br /&gt;
= Skinned mesh renderer support =&lt;br /&gt;
&lt;br /&gt;
Bakery supports skinned meshes since v1.65. However, there are some limitations:&lt;br /&gt;
* Some versions of Unity do not support UV1 on skinned meshes and silently ignore &amp;quot;Generate lightmap UVs&amp;quot;. Make sure the actual mesh used in your scene has UV1 and use non-overlapping UV0 if possible;&lt;br /&gt;
* UV padding adjustment does not work on skinned meshes (Unity seems to crash when attempting to call Unwrap function on them);&lt;br /&gt;
* Skinned meshes can't have per-vertex lightmaps (engine has no support for additionalVertexStreams with skinning).&lt;br /&gt;
&lt;br /&gt;
= Shader Tweaks =&lt;br /&gt;
[[File:Image2.jpg|thumb|Left: default bilinear filtering. Right: bicubic filtering.]]&lt;br /&gt;
[[File:Image34.jpg|thumb|Left: both shadows are baked.&amp;lt;br&amp;gt;&lt;br /&gt;
Center: spherical shadow is dynamic, and other shadow is static. Combined together with multiplication.&amp;lt;br&amp;gt;&lt;br /&gt;
Right: same as center, but combined with default minimum.]]&lt;br /&gt;
Bakery offers optional shader modifications that can be applied to Unity shaders to improve lightmap sampling and match real-time lighting closer to lightmaps. Shader tweaking menu can be accessed via Bakery-&amp;gt;Shader Tweaks.&lt;br /&gt;
&lt;br /&gt;
These options will patch base Unity shader includes (from the CGIncludes folder) that are used by most built-in and third party shaders. All modifications will affect all projects opened with this version of editor, but can be also easily reverted back. Shader tweaks affect the way standard and surface shaders work. HDRP, URP and other SRPs are not affected.&lt;br /&gt;
&lt;br /&gt;
All available modifications are shown as buttons. Press the button to apply modification, and it will remain pressed. Un-press the button to remove the modification. Currently available options:&lt;br /&gt;
&lt;br /&gt;
{{note| You may need to run Unity editor as admin to make CGIncludes patching work}}&lt;br /&gt;
&lt;br /&gt;
* Use bicubic interpolation for lightmaps: bicubic interpolation will be used instead of default bilinear. This tweak fixes many jagged edges of low resolution lightmaps pretty well. Currently it only works on DX11 and modern consoles, while other platforms will remain using bilinear.&lt;br /&gt;
&lt;br /&gt;
* Use multiplication for shadowmask: combine static and dynamic shadows using multiplication instead of minimum. For reasons unknown Unity decided to use minimum operator by default, and it produces artifacts that are not present with multiplication.&lt;br /&gt;
&lt;br /&gt;
* Use physical light falloff (forward): replace default attenuation of real-time point/spot lights with a more physically correct inverse-squared. “Range” will only slightly fade it out near the edge (matches Bakery lights with Physical Falloff checkbox). Only affects forward renderer. See [[Point Light Attenuation]] for more details.&lt;br /&gt;
&lt;br /&gt;
* Use physical light falloff (deferred): same as above, but only affects deferred renderer.&lt;br /&gt;
&lt;br /&gt;
'''Falloff tweaks may not fully work on &amp;gt; 2017 Unity versions. Also, SRPs have correct falloff by default.'''&lt;br /&gt;
&lt;br /&gt;
= Bakery shaders =&lt;br /&gt;
Bakery includes its own shaders with support for vertex lightmapping, as well as RNM and SH directional modes. It also allows approximate baked specular to be calculated from directional data. &lt;br /&gt;
Bakery shader is '''not required''' for regular color lightmaps, shadow masks and Dominant Direction mode, as these features are supported by most Unity shaders anyway.&lt;br /&gt;
&lt;br /&gt;
=== Standard render pipeline ===&lt;br /&gt;
'''Bakery/Standard''': extends regular Standard shader. Additional options:&lt;br /&gt;
* Allow Vertex Lightmaps: allows this material to be used with [[Vertex Lightmaps|vertex lightmapping]].&lt;br /&gt;
* Allow RNM Lightmaps: allows this material to be used with [[#RNM|RNM directional mode]].&lt;br /&gt;
* Allow SH Lightmaps: allows this material to be used with [[#SH|SH directional mode]].&lt;br /&gt;
{{note| All “Allow” toggles enable a certain code path in the shader. It is recommended to only use one “allow” option in a material for performance reasons.}}&lt;br /&gt;
* Enable Lightmap Specular: calculates baked specular using data from Dominant Direction, RNM or SH directional modes. Note that due to the lack of information, the effect is very approximate. If you ever used baked specular in Unity 4, it should be comparable. It looks best together with highly perturbed normal maps, not so good on flat surfaces.&lt;br /&gt;
* Enable VertexLM directional: if vertex lightmaps are present, specifies that Dominant Direction data is stored in vertices and should be used.&lt;br /&gt;
* Enable VertexLM SH: if vertex lightmaps are present, specifies that SH data is stored in vertices and should be used.&lt;br /&gt;
* Enable VertexLM Shadowmask: if vertex lightmaps are present, specifies that shadow mask is stored in vertices and should be used.&lt;br /&gt;
* Enable MonoSH: treat directional maps as MonoSH maps.&lt;br /&gt;
[[File:Image5.png|thumb|Standard SH light probe vs non-linear]]&lt;br /&gt;
[[File:Shspec.jpg|thumb|SH specular effect]]&lt;br /&gt;
* Non-linear SH: in SH directional mode this option can enhance contrast (closer to ground truth), but it makes the shader a bit slower. This trick is based on [https://drive.google.com/file/d/1MK6Clw93q8ljijRjb4gQOzzaIjn1uF9Y/view “Reconstructing Diffuse Lighting from Spherical Harmonic Data”] paper by Geomerics.&lt;br /&gt;
* Non-linear Light Probe SH: similar to Non-linear SH, but works for light probes instead. In case of probes the most notable benefit is getting rid of incorrect negative values. This problem often happens in high-contrast scenes with bright HDR light sources. It’s an inherent limitation of spherical harmonics and not specific to Bakery (i.e. you can get similar artifacts with built-in lightmappers as well).&lt;br /&gt;
* Force Bicubic Filter: enables bicubic filtering for all additional maps. For complete bicubic filtering (including the first color map) it is recommended to also enable it in [[#Shader Tweaks|Shader Tweaks]].&lt;br /&gt;
&lt;br /&gt;
'''Bakery/Standard Specular''': same as Standard, but for specular workflow.&lt;br /&gt;
&lt;br /&gt;
=== HDRP &amp;amp; URP ===&lt;br /&gt;
To extract additional HDRP/URP shaders, open Bakery_ShaderGraphHDRP.unitypackage or Bakery_ShaderGraphURP.unitypackage included with Bakery. Inside you will find Shader Subgraphs that you can use in your own Shader Graphs as well as some example materials.&lt;br /&gt;
&lt;br /&gt;
=== Feature support across shaders ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Most Unity shaders&lt;br /&gt;
! Most HDRP &amp;amp; URP shaders&lt;br /&gt;
! Bakery Standard&lt;br /&gt;
! HDRP graphs&lt;br /&gt;
! URP graphs&lt;br /&gt;
|-&lt;br /&gt;
| HDR color lightmaps&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Shadowmask&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes (Since URP 10.1)&lt;br /&gt;
|-&lt;br /&gt;
| Dominant Direction&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| RNM&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| SH&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| MonoSH&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Lightmap specular&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes for dominant direction and SH&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes for dominant direction (see link)&lt;br /&gt;
|-&lt;br /&gt;
| Bicubic filtering&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes,&lt;br /&gt;
with [[#Shader Tweaks|Shader Tweaks]]&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes,&lt;br /&gt;
with [[#Shader Tweaks|Shader Tweaks]]&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
|-&lt;br /&gt;
| Vertex lightmaps&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Single color, no per-vertex SH, direction or shadowmasks (shader graph limitation)&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Single color, no per-vertex SH, direction or shadowmasks (shader graph limitation)&lt;br /&gt;
|-&lt;br /&gt;
| Non-Linear Light Probes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Volumes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Volume shadowmask&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Compressed volumes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{note| Everything except for regular color lightmaps requires at least Shader Model 3.0 to work.}}&lt;br /&gt;
{{note| Vertex Lightmaps with SH mode require at least Shader Model 4.0 due to interpolator limit.}}&lt;br /&gt;
{{note| Updated URP graphs with specular from Dominant Direction can be downloaded [[Bakery_-_GPU_Lightmapper|from the main wiki page]].}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
See also: [[Integrating_Bakery_shader_features_to_custom_shaders| Integrating Bakery shader features to custom shaders]]&lt;br /&gt;
&lt;br /&gt;
= Notes on HDRP/URP =&lt;br /&gt;
Once the package is imported into an HDRP or URP project, in general it can be used right away, but there are some things to note:&lt;br /&gt;
&lt;br /&gt;
* Example scenes use both regular Standard and, in some cases, &amp;quot;Bakery Standard&amp;quot; shaders. HDRP and URP provide a mechanism to update project shaders from Standard to Lit, but they cannot upgrade from Bakery Standard. Replace Bakery Standard materials with the ones coming from Bakery_ShaderGraphHDRP.unitypackage or Bakery_ShaderGraphURP.unitypackage.&lt;br /&gt;
&lt;br /&gt;
* In HDRP, the default HDRI sky intensity is high (11) and sky reflection is not being occluded by default. Together with default eye adaption it may result in some example scenes being hardly visible, as they are baked using much lower intensities. Reduce HDRI sky intensity to 1 in this case. HDRI settings are usually located in Assets/HDRPDefaultResources/DefaultSettingsVolumeProfile.&lt;br /&gt;
&lt;br /&gt;
* In HDRP, if lights in example scenes are too bright, click &amp;quot;match real-time to lightmapped&amp;quot; on Bakery light components.&lt;br /&gt;
&lt;br /&gt;
* Use OpenImageDenoise 2 (best) or OptiX 7 denoiser in HDRP, as it is better suited for high intensity values.&lt;br /&gt;
&lt;br /&gt;
* In HDRP &amp;quot;distance&amp;quot; and regular Shadowmask can be switched on the Light component itself, not in global settings.&lt;br /&gt;
&lt;br /&gt;
* Don't use &amp;quot;match&amp;quot; buttons on the Skylight, as HDRP uses a very specific procedural sky shader. Instead, bake it into a HDRI [[How_do_I...#How_do_I_use_Skylight_with_a_procedural_sky_shader.3F|this way]].&lt;br /&gt;
&lt;br /&gt;
* It is recommended to always set Light Probe Mode to L2 or L1 when using HDRP, as HDRP's renderer is not optimized for the Legacy mode.&lt;br /&gt;
&lt;br /&gt;
* Newest version of HDRP/URP have their own IES file importer. Because of the asset type mismatch, Unity will unplug them from Bakery IES lights saved using older versions, meaning they will appear as regular point lights instead. They can be plugged back and re-saved.&lt;br /&gt;
&lt;br /&gt;
Bakery's example scenes are designed for the Built-in rendering pipeline, so there are a few steps to properly render them in HDRP/URP. Here are some tips; a fresh project with default HDRP/URP settings is assumed:&lt;br /&gt;
&lt;br /&gt;
=== Viewing example scenes on HDRP ===&lt;br /&gt;
* After importing Bakery, upgrade standard materials to HDRP: Edit-&amp;gt;Rendering-&amp;gt;Materials-&amp;gt;Convert All Built-in Materials To HDRP.&lt;br /&gt;
* Import Bakery_ShaderGraphHDRP.unitypackage into the project, as it contains special shader graphs implementing advanced Bakery features (not required for classic color/directional/mask lightmaps).&lt;br /&gt;
* Select DefaultSettingsVolumeProfile.asset. In HDRI Sky section, change Exposure Compensation to 1. Otherwise the default HDRP will be too bright compared to example scenes, and they will appear black due to this exposure adjustment.&lt;br /&gt;
* When selecting lights in example scenes, HDRP will initialize its own light data. Sometimes it may result in the light immediately becoming much brighter. Click &amp;quot;Match real-time to lightmapped&amp;quot; to synchronize.&lt;br /&gt;
* Set Light Probe Mode to L2 before rendering light probes.&lt;br /&gt;
* '''example_directional''': change shaders to BakeryDirSpecGraph to see baked highlights (or just regular HDRP/Lit for diffuse-only normal mapping). Delete the sphere, as there is currently no shader graph supporting per-vertex direction.&lt;br /&gt;
* '''example_directional_MonoSH''': change shaders to BakerySpecMonoSHGraph (or BakeryMonoSHGraph for a slightly cheaper version without highlights). Delete the sphere, as there is currently no shader graph supporting per-vertex MonoSH.&lt;br /&gt;
* '''example_RNM''': change shaders to BakeryRNMGraph.&lt;br /&gt;
* '''example_SH''': change shaders to BakerySpecSHGraph (or BakerySHGraph for a slightly cheaper version without highlights). Delete the sphere, as there is currently no shader graph supporting per-vertex SH.&lt;br /&gt;
* '''example_mixed_directional_mode''': similarly a different graph is needed for MonoSH/RNM/SH planes.&lt;br /&gt;
* '''example_lights''': change the shader of the vertex-lightmapped sphere to BakeryVertexColorGraph.&lt;br /&gt;
* '''example_prefabs_bake''': no further adjustments needed.&lt;br /&gt;
* '''example_sectors''': no further adjustments needed.&lt;br /&gt;
* '''example_shadowmask''': Select the DirectLight and click &amp;quot;Match real-time to lightmapped&amp;quot; to fix brightness. Set Shadowmask Mode to Shadowmask on all HDRP lights. &lt;br /&gt;
* '''example_sponza_day''': set OpenImageDenoise 2 (or Optix 7, if unsupported) as preferred denoiser.&lt;br /&gt;
* '''example_sponza_evening''': set OpenImageDenoise 2 (or Optix 7, if unsupported) as preferred denoiser.&lt;br /&gt;
* '''example_subtractive''': HDRP doesn't support the subtractive mode.&lt;br /&gt;
* '''example_volumes_simple''': change train shader to BakeryVolumeSpecGraph (or BakeryVolumeGraph for a slightly cheaper version without highlights).&lt;br /&gt;
* '''example_volumes_simple_shadowmask''': shadowmask volumes are not currently supported for HDRP.&lt;br /&gt;
* '''example_volumes_advanced''': same as with example_volumes_simple.&lt;br /&gt;
* '''example_translucency''': most of the scene should appear fine. For the &amp;quot;Dynamic sphere lit by volume&amp;quot;, set shader to BakeryVolumeGraph.&lt;br /&gt;
&lt;br /&gt;
=== Viewing example scenes on URP ===&lt;br /&gt;
* After importing Bakery, upgrade standard materials to URP: open Assets/Bakery/examples/content, select all materials by typing &amp;quot;t:material&amp;quot; and choosing to only search the &amp;quot;content&amp;quot; folder below. Click Edit-&amp;gt;Rendering-&amp;gt;Materials-&amp;gt;Convert Selected Built-in Materials To URP.&lt;br /&gt;
* Import Bakery_ShaderGraphURP.unitypackage into the project, as it contains special shader graphs implementing advanced Bakery features (not required for classic color/directional/mask lightmaps).&lt;br /&gt;
* '''example_directional''': change shaders to BakeryURPLit, enable &amp;quot;Bakery Lightmapped Specular&amp;quot; (or just keep regular URP/Lit for diffuse-only normal mapping). Delete the sphere, as there is currently no shader graph supporting per-vertex direction.&lt;br /&gt;
* '''example_directional_MonoSH''': change shaders to BakeryURPLit, set Bakery Mode to MonoSH, enable &amp;quot;Bakery Lightmapped Specular&amp;quot;. On the vertex-lit sphere also enable &amp;quot;Per-vertex&amp;quot;.&lt;br /&gt;
* '''example_RNM''': change shaders to BakeryURPLit, set Bakery Mode to RNM, enable &amp;quot;Bakery Lightmapped Specular&amp;quot;.&lt;br /&gt;
* '''example_SH''': change shaders to BakeryURPLit, set Bakery Mode to SH, enable &amp;quot;Bakery Lightmapped Specular&amp;quot;. Delete the sphere, as there is currently no shader graph supporting per-vertex SH.&lt;br /&gt;
* '''example_mixed_directional_mode''': similarly use BakeryURPLit with a different Bakery Mode (MonoSH, RNM, SH). Non-directional / dominant direction / baked normap maps can use regular URP/Lit.&lt;br /&gt;
* '''example_lights''': no further adjustments needed.&lt;br /&gt;
* '''example_prefabs_bake''': no further adjustments needed.&lt;br /&gt;
* '''example_sectors''': no further adjustments needed.&lt;br /&gt;
* '''example_shadowmask''': similarly to the Built-in pipeline, uncheck Distance Shadowmask in Bakery window (or project Quality Settings) to see actual baked/real-time shadow mixing near the camera.&lt;br /&gt;
* '''example_sponza_day''': enable alpha clipping on the foliage material.&lt;br /&gt;
* '''example_sponza_evening''': same as example_sponza_day.&lt;br /&gt;
* '''example_subtractive''': no further adjustments needed.&lt;br /&gt;
* '''example_volumes_simple''': change train shader to BakeryURPLit and set Bakery Mode to Volume. Optionally enable &amp;quot;Bakery Lightmapped Specular&amp;quot;.&lt;br /&gt;
* '''example_volumes_simple_shadowmask''': same as example_volumes_simple, but also enable &amp;quot;Volume Shadowmask&amp;quot;.&lt;br /&gt;
* '''example_volumes_advanced''': same as with example_volumes_simple.&lt;br /&gt;
* '''example_translucency''': most of the scene should appear fine. For the &amp;quot;Dynamic sphere lit by volume&amp;quot;, set shader to BakeryURPLit and Bakery Mode to Volume.&lt;br /&gt;
&lt;br /&gt;
= Upgrading Bakery =&lt;br /&gt;
When it comes to upgrading the asset, it is recommended to follow these steps:&lt;br /&gt;
* Close Bakery windows.&lt;br /&gt;
* Close Unity.&lt;br /&gt;
* Open it again.&lt;br /&gt;
* Import the updated package.&lt;br /&gt;
&lt;br /&gt;
Note that without first closing Unity importing may fail because of locked DLL files (printing messages like &amp;quot;alphabuffergen.dll: Access is denied.&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
If you moved Bakery folders (Assets/Bakery and Assets/Editor/x64/Bakery) to other locations, you might need to move them back before updating to prevent getting two conflicting copies of the package.&lt;br /&gt;
&lt;br /&gt;
= Scripting API =&lt;br /&gt;
&lt;br /&gt;
==Basic usage==&lt;br /&gt;
&lt;br /&gt;
Get and modify render settings:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ftLightmapsStorage storage = ftRenderLightmap.FindRenderSettingsStorage();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Full list of available settings can be seen in ftLightmapsStorage.cs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Get lightmapper instance and (re)load settings:&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap bakery = ftRenderLightmap.instance != null ? ftRenderLightmap.instance : new ftRenderLightmap();&lt;br /&gt;
bakery.LoadRenderSettings();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Render lightmaps (also probes if they're set to L1 or L2 mode):&lt;br /&gt;
&amp;lt;pre&amp;gt;bakery.RenderButton(bool showMsgWindows)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Render light probes only:&lt;br /&gt;
&amp;lt;pre&amp;gt;bakery.RenderLightProbesButton(bool showMsgWindows)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Render reflection probes only:&lt;br /&gt;
&amp;lt;pre&amp;gt;bakery.RenderReflectionProbesButton(bool showMsgWindows)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''showMsgWindows''' tells if any dialog boxes/confirmations can be shown. Supressed, if set to false.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Check if baking is in progress:&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.bakeInProgress&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For usage example check [[Community_extensions#Batch_scene_baker|Batch Scene Baker]] script.&lt;br /&gt;
&lt;br /&gt;
==Additional functions==&lt;br /&gt;
&lt;br /&gt;
Copies all render settings from one ftLightmapsStorage to another:&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmapsStorage.CopySettings(ftLightmapsStorage src, ftLightmapsStorage dest)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Gets global (per-project) storage object:&lt;br /&gt;
&amp;lt;pre&amp;gt;ftGlobalStorage gstorage = ftLightmaps.GetGlobalStorage()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copies all render settings from ftLightmapsStorage (per-scene) to ftGlobalStorage  (per-project):&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmapsStorage.CopySettings(ftLightmapsStorage src, ftGlobalStorage dest)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copies all render settings from ftGlobalStorage (per-project) to ftLightmapsStorage (per-scene):&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmapsStorage.CopySettings(ftGlobalStorage src, ftLightmapsStorage dest)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Gets the path to the folder containing Bakery binaries:&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmaps.GetEditorPath()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Additional variables==&lt;br /&gt;
&lt;br /&gt;
Gets the current temporary files path (ftRenderLightmap instance must be created first):&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.scenePath&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Gets/sets UVGBuffer data compression (LZ4, if enabled, DDS if not):&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.compressedGBuffer&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Gets/sets output lightmap data compression (LZ4, if enabled, DDS if not):&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.compressedOutput&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Events==&lt;br /&gt;
&lt;br /&gt;
Scripts can subscribe to static events in ftRenderLightmap class.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Called before full Render:&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnPreFullRender&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Called before each light probe is rendered in Legacy light probe mode. ProbeEventArgs is a struct containing '''pos''' field with current light probe position:&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler&amp;lt;ProbeEventArgs&amp;gt; OnPreRenderProbe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Called after Legacy light probes were rendered:&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnFinishedProbes&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Called after full Render was finished:&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnFinishedFullRender&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Called before reflection probes are rendered:&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnPreReflectionProbeRender&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Called after reflection probes were rendered:&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnFinishedReflectionProbes&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mr F</name></author>
		
	</entry>
	<entry>
		<id>https://geom.io/bakery/wiki/index.php?title=Bakery_-_GPU_Lightmapper&amp;diff=1840</id>
		<title>Bakery - GPU Lightmapper</title>
		<link rel="alternate" type="text/html" href="https://geom.io/bakery/wiki/index.php?title=Bakery_-_GPU_Lightmapper&amp;diff=1840"/>
		<updated>2025-12-07T08:26:49Z</updated>

		<summary type="html">&lt;p&gt;Mr F: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{note|Nvidia driver 591.44 breaks OptiX6 support and therefore Bakery. If you get &amp;quot;Failed to load OptiX library&amp;quot;, please use any older driver.&amp;lt;br&amp;gt;In the meantime I'm waiting for a response from Nvidia and working on a patch.}}&lt;br /&gt;
Nvidia drivers can be downloaded [https://www.nvidia.com/Download/index.aspx?lang=en-US here].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[What is Bakery and why use it]]&lt;br /&gt;
&lt;br /&gt;
== Bakery for Unity ==&lt;br /&gt;
* [https://assetstore.unity.com/packages/tools/level-design/bakery-gpu-lightmapper-122218 Asset Store page]&lt;br /&gt;
* [[Github access]]&lt;br /&gt;
* '''[[RTPreview|RTPreview manual]]'''&lt;br /&gt;
* '''[[Manual|Manual (v1.95)]]'''&lt;br /&gt;
* [https://docs.google.com/document/d/1r-ZFqovUkVXL-1S9ATYqUHL00M5SpiM2Qwjg0eVCJ4Y/edit Changelog]&lt;br /&gt;
* [https://drive.google.com/file/d/1i_zkeB4VBgNOI_-dBqxkdwZ4HCj6tTyA/view?usp=share_link Latest URP graphs (rev 2.0) (12.1.6)]&lt;br /&gt;
* [https://drive.google.com/file/d/1kutq2zwyOGhSw79_rtZNeW5cFOLWzuVr/view?usp=share_link Latest URP graphs (14.0.7)]&lt;br /&gt;
* [https://drive.google.com/file/d/1CIM7_LFaMJ2lxs4eZMZ-KgX8OA7KBt2U/view?usp=sharing Latest URP graphs (15.0.6)]&lt;br /&gt;
* [https://drive.google.com/file/d/1IJIbw2He3c5xa9hdaTVHnqIf5Ewfg0gZ/view?usp=sharing Latest URP graphs (15.0.7)]&lt;br /&gt;
* [https://drive.google.com/file/d/1lmQsDjLnP-HlslQNHffjqj6Bty9iJUzH/view?usp=sharing Latest URP graphs (16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/1mTpG6o9RfjSlq8EBdpQ8kSZVZq3JP4BQ/view?usp=sharing Latest URP graphs (rev 9.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/1fw7OM83pp0jRHqLjpF2WRZYSd1Z1H1Eh/view?usp=sharing Latest URP graphs (rev 12.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/18TU_8MpVdUiSQjCm1JWyg-binr02ZfzZ/view?usp=sharing Latest URP graphs (rev 13.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/15Nga4ld-F0_GzCfkDLrE3Uv1QfIYvIGk/view?usp=sharing Latest URP graphs (rev 14.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/1x6kCNmJzKgOnnQRQx7ol5VSNMq4VwFeU/view?usp=sharing Latest URP graphs (rev 15.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/1RvaSoy4ceOCTQIHs5DvdYlt5gUEkDYG5/view?usp=sharing Latest URP graphs (rev 16.0) (12.1 - 16.0.4)]&lt;br /&gt;
* [https://drive.google.com/file/d/1-1_oNZyPptlcUWWjcXzcTv1-b-mPJBsw/view?usp=sharing Latest HDRP graphs (10.4.0)]&lt;br /&gt;
* [https://drive.google.com/file/d/1hYn8FXPf47FsVTgoao0jV0AqxGFN48dH/view?usp=sharing Latest HDRP graphs (11.0.0)]&lt;br /&gt;
* [https://drive.google.com/file/d/1dLlg-GWYbyzvG9jo9srnpnht1S19W6Z2/view Latest HDRP graphs (12.1.6)]&lt;br /&gt;
* [https://drive.google.com/file/d/1RBRS024Dd9ddM-35D1KssOReTrcC8zGn/view?usp=sharing Latest HDRP graphs (14.0.7)]&lt;br /&gt;
* [https://drive.google.com/file/d/1z3jSHNgHALU6r3b6lBXEBvHLlxEmXARZ/view?usp=sharing Latest HDRP graphs (rev 2.0) (14.0.7)]&lt;br /&gt;
* [[FAQ]]&lt;br /&gt;
* [[How do I...]]&lt;br /&gt;
* [[Reporting bugs]]&lt;br /&gt;
* [[Troubleshooting]]&lt;br /&gt;
* [[Community extensions]]&lt;br /&gt;
* [https://discord.gg/dP3SkdM Community Discord]&amp;lt;br&amp;gt;&amp;lt;small&amp;gt;(for support, please contact me on [https://discussions.unity.com/t/bakery-gpu-lightmapper-v1-96-rtpreview-released/704890/7512 Unity forum] / [https://github.com/guycalledfrank/bakery-issues/issues github] / or via email listed [https://assetstore.unity.com/publishers/37453 here]).&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bakery is made by [https://twitter.com/guycalledfrank Mr F]&lt;br /&gt;
&lt;br /&gt;
== Decalery ==&lt;br /&gt;
* '''[[Decalery manual]]'''&lt;br /&gt;
* [[Decalery Github access]]&lt;/div&gt;</summary>
		<author><name>Mr F</name></author>
		
	</entry>
	<entry>
		<id>https://geom.io/bakery/wiki/index.php?title=What_is_Bakery_and_why_use_it&amp;diff=1839</id>
		<title>What is Bakery and why use it</title>
		<link rel="alternate" type="text/html" href="https://geom.io/bakery/wiki/index.php?title=What_is_Bakery_and_why_use_it&amp;diff=1839"/>
		<updated>2025-12-05T10:29:49Z</updated>

		<summary type="html">&lt;p&gt;Mr F: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:fdlm1200x630.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
Bakery is a high-end, production-ready GPU lightmapper, designed with flexibility and performance in mind. On top of light baking itself, Bakery aims to solve following problems:&lt;br /&gt;
* Fixing various baking artifacts, such as seams, light/shadow leaks, incorrect shadow terminators, etc. Baking a lightmap should not bring more problems than rendering a camera frame in an offline renderer.&lt;br /&gt;
* Baking all kinds of useful ligthing data. Direct and indirect contribution of different light sources in any combination, separate shadow masks, direction vectors, spherical harmonics, etc. Lighting can be also baked per-vertex or into probes instead of using textures.&lt;br /&gt;
* Physical correctness. Bakery results were thoroughly compared against Mitsuba, a well-known unbiased renderer.&lt;br /&gt;
* LOD support.&lt;br /&gt;
&lt;br /&gt;
When used in Unity, following benefits are also notable:&lt;br /&gt;
* Directional information can be baked in the form of dominant direction map (classic “directional” mode in Unity), 3 maps for Radiosity Normal Mapping, or 4 maps for per-pixel Spherical Harmonics (much higher quality than classic directional). Multiple directional modes can be used in a single scene on different objects.&lt;br /&gt;
* Bakery supports both correct inverse-squared light falloff and Unity's own non-physical one.&lt;br /&gt;
* IES light support.&lt;br /&gt;
* Baked prefab support.&lt;br /&gt;
&lt;br /&gt;
Bakery can also take advantage of RTX hardware to speed up baking (but it's not required).&lt;br /&gt;
&lt;br /&gt;
Some notable games shipped using Bakery:&lt;br /&gt;
&lt;br /&gt;
[https://www.callofduty.com/mobile Call of Duty Mobile]&lt;br /&gt;
&lt;br /&gt;
[https://landfall.se/totally-accurate-battle-simulator-early-access Totally Accurate Battle Simulator]&lt;br /&gt;
&lt;br /&gt;
[https://www.oculus.com/experiences/quest/2134077359973067 Dead and Buried II]&lt;br /&gt;
&lt;br /&gt;
... and many more!&lt;/div&gt;</summary>
		<author><name>Mr F</name></author>
		
	</entry>
	<entry>
		<id>https://geom.io/bakery/wiki/index.php?title=%E4%BD%BF%E7%94%A8%E6%89%8B%E5%86%8C&amp;diff=1838</id>
		<title>使用手册</title>
		<link rel="alternate" type="text/html" href="https://geom.io/bakery/wiki/index.php?title=%E4%BD%BF%E7%94%A8%E6%89%8B%E5%86%8C&amp;diff=1838"/>
		<updated>2025-11-07T10:59:28Z</updated>

		<summary type="html">&lt;p&gt;Mr F: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:fdlm1200x630.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
[https://geom.io/bakery/wiki/index.php?title=Manual (Click for English version)]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 系统要求 ==&lt;br /&gt;
&lt;br /&gt;
使用 Bakery 需要：&lt;br /&gt;
&lt;br /&gt;
Windows（7 或更高版本）电脑。&lt;br /&gt;
&lt;br /&gt;
Nvidia 显卡。最低支持型号为 Kepler（GeForce 650 或更新型号，Quadro 显卡请查看规格）。&lt;br /&gt;
&lt;br /&gt;
64 位 Unity 编辑器。Bakery 已在 5.6 到 6 及更高版本上测试过，同时也在 Tuanjie 1.6.7 上通过测试。&lt;br /&gt;
&lt;br /&gt;
{{note|系统要求仅适用于开发者的电脑，而非目标平台。使用 Bakery 烘焙的光照贴图可以在任何地方使用。}}&lt;br /&gt;
&lt;br /&gt;
== 前提条件 ==&lt;br /&gt;
* 确保你的项目中没有任何脚本编译错误，否则也会导致 Bakery 的脚本无法编译。&lt;br /&gt;
* 确保你的显卡驱动是最新版本，如有需要请[https://www.nvidia.com/Download/index.aspx?lang=en-US 更新]。&lt;br /&gt;
&lt;br /&gt;
'''请使用 Game-Ready（标准）驱动程序，而不是 “Studio” 驱动。'''&lt;br /&gt;
&lt;br /&gt;
== 安装 ==&lt;br /&gt;
&lt;br /&gt;
1. 通过 [https://assetstore.unity.com/packages/tools/level-design/bakery-gpu-lightmapper-122218 Asset Store] 将 Bakery 导入到你的项目中。&lt;br /&gt;
&lt;br /&gt;
2. Unity 会显示要导入的文件列表。如果这是你第一次使用 Bakery，建议直接 点击 Import（导入）。有经验的用户可以取消选中 examples 文件夹，以进行更轻量的安装。&lt;br /&gt;
&lt;br /&gt;
文件将被导入到 `Assets/Bakery` 和 `Assets/Editor/x64/Bakery` 文件夹中。&lt;br /&gt;
这些文件夹之后可以移动。&lt;br /&gt;
&lt;br /&gt;
3. Unity 随后会导入 Bakery 并编译脚本。此时可能会弹出如下窗口：&lt;br /&gt;
&lt;br /&gt;
[[File:Goahead.png]]&lt;br /&gt;
&lt;br /&gt;
此时你应点击 “Go Ahead”（继续）。&lt;br /&gt;
&lt;br /&gt;
现在你应该能在编辑器中看到新增的 Bakery 菜单：&lt;br /&gt;
&lt;br /&gt;
[[File:bmenu.jpg]]&lt;br /&gt;
&lt;br /&gt;
== 快速开始 ==&lt;br /&gt;
&lt;br /&gt;
1. 添加一些模型或基础体，并将其标记为静态（Static）。&lt;br /&gt;
&lt;br /&gt;
'''用于光照贴图的网格必须具有不重叠的 UV2。如果存在 UV2，则会使用 UV2（否则使用 UV1）。如果你的模型没有为光照贴图进行展开，请在资源中勾选 Generate Lightmap UVs（生成光照贴图 UV）。'''&lt;br /&gt;
Unity 的基础体已经具有正确的 UV2。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Staticmarked.jpg|320px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. 选择方向光（Unity 为你创建的那个），并添加 '''Bakery Direct Light''' 组件。&lt;br /&gt;
   {{note|Bakery 和 Unity 使用独立的光源组件。}}&lt;br /&gt;
&lt;br /&gt;
3. Bakery Direct Light 有许多可调选项，但你可以轻松将其与 Unity 光源匹配。点击 '''Match lightmapped to real-time'''。现在 Bakery 光源的颜色应与 Unity 默认的方向光相同，呈黄色调。&lt;br /&gt;
&lt;br /&gt;
[[File:Matching.jpg|640px]]&lt;br /&gt;
&lt;br /&gt;
{{note|Direct Light 组件可能会提示项目未使用线性光强度。问题在于，Unity 默认会对光源颜色应用伽马校正 [https://twitter.com/guycalledfrank/status/1001108508614553600 不正确]。&lt;br /&gt;
可以通过[https://docs.unity3d.com/ScriptReference/Rendering.GraphicsSettings-lightsUseLinearIntensity.html 脚本]启用正确模式。&lt;br /&gt;
这就是 “Fix” 按钮的作用。如果你已经在非线性光强模式下设置了许多光源，并且不想再次更改它们，可以跳过修复。即使你按了 “Fix”，也可以随时撤销此更改。&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. 要获得带阴影的环境光，请创建 Skylight（Bakery-&amp;gt;Create-&amp;gt;Skylight）。&lt;br /&gt;
&lt;br /&gt;
[[File:Menusky.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. 选择 Skylight，为它设置一些偏蓝的颜色，然后点击 '''Match scene skybox to this light'''。   这将使场景的 skybox 与光照完全匹配。&lt;br /&gt;
   {{note|将 Unity 的 skybox 与 Bakery Skylight 匹配是可选的，但对正确性很有用，可以确保可见环境和引擎内的反射探针与烘焙光照一致。目前此选项仅适用于 Standard 渲染管线。}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Skycomp.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. 点击 Bakery-&amp;gt;Render Lightmap。默认情况下，Full Lighting 模式是激活的。它会烘焙所有光源的直接和间接光照贡献。如果你想将实时阴影与烘焙全局光照（GI）结合使用，请将模式更改为 '''Indirect'''。&lt;br /&gt;
&lt;br /&gt;
[[File:Bakerywindow.jpg]]&lt;br /&gt;
&lt;br /&gt;
{{note| Bakery 可能会提示你正在使用旧的 [https://docs.unity3d.com/Manual/LinearLighting.html gamma mode]。如果你在意光照质量，强烈建议使用线性模式。如果你的项目已经在错误的伽马模式下设置好了，并且不想更改，或者是发布到不支持线性模式的移动设备上，也可以忽略此提示。}}&lt;br /&gt;
&lt;br /&gt;
7. 点击 '''Render'''。&lt;br /&gt;
&lt;br /&gt;
8. 完成！现在你应该已经得到烘焙的全局光照（GI）：&lt;br /&gt;
&lt;br /&gt;
[[File:Bakedgi.jpg]]&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 ==&lt;br /&gt;
&lt;br /&gt;
所有渲染设置都可以通过 Bakery-&amp;gt;Render Lightmap 访问。设置会为每个场景单独保存。Bakery 窗口顶部的选项允许你在 Simple（简单）、Advanced（高级）和 Experimental（实验）设置之间切换，每个后续模式都会显示更多可调选项。对于大多数场景，Simple 模式已经足够，是入门的好方法。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render mode ===  &lt;br /&gt;
定义要烘焙的光照贴图类型。  &lt;br /&gt;
&lt;br /&gt;
===== Full Lighting =====&lt;br /&gt;
烘焙所有 Bakery 光源的完整直接光和间接光。&lt;br /&gt;
{{note|在 2017.3 之前的 Unity 版本中，如果同一对象上同时有 Unity 和 Bakery 组件，你需要手动禁用 Unity 组件以避免亮度加倍。在较新版本中，实时效果会自动对烘焙光源禁用，就像内置光照烘焙器一样。}}&lt;br /&gt;
&lt;br /&gt;
===== Indirect =====&lt;br /&gt;
[[File:Image26.png|thumb|Unity 支持的不同渲染模式对比]]&lt;br /&gt;
基础混合模式。它会查看每个光源上的 Baked Contribution 选择器：如果设置为 ''Direct And Indirect''，则光源会像在 Full Lighting 模式下一样被烘焙。如果设置为 ''Indirect Only''，则只会烘焙该光源的间接光照（GI）。在后一种情况下，你应保持对象上的 Unity 光源和 Bakery 光源同时存在，一个提供实时直接光照，另一个提供预计算的全局光照（GI）。&lt;br /&gt;
&lt;br /&gt;
[[File:Indirectonly.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== Shadowmask =====&lt;br /&gt;
[[File:Image21.png|thumb|左：完全烘焙的光照。中：动态光源 + 烘焙 GI。右：胶囊形阴影、凹凸贴图和高光为动态光照，但立方体阴影和 GI 为烘焙光照。]]&lt;br /&gt;
[[File:Image6.png|thumb|当相机足够远离场景，或者动态阴影被禁用时，场景将呈现如下效果]]&lt;br /&gt;
更高级的混合模式。它通过生成两种类型的光照贴图来工作——一种包含烘焙颜色（如 Indirect 模式），另一种包含静态物体的阴影。它有几个优点：&lt;br /&gt;
* 实时阴影只需渲染少量动态对象，而不是整个场景。&lt;br /&gt;
* 实时阴影与烘焙阴影可以正确融合。&lt;br /&gt;
* 实时光源可以渲染凹凸贴图、高光和其他表面效果，同时仍会被高质量烘焙阴影遮挡。&lt;br /&gt;
[https://docs.unity3d.com/Manual/LightMode-Mixed-Shadowmask.html 更多详情]&lt;br /&gt;
&lt;br /&gt;
要启用此行为，你必须在同一对象上同时存在 Unity 光源和 Bakery 光源，并将 Baked Contribution 设置为 ''Shadowmask and Indirect''。未标记的光源将按 Indirect 模式进行烘焙。&lt;br /&gt;
&lt;br /&gt;
[[File:Smask22.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== Distance Shadowmask =====&lt;br /&gt;
此复选框仅在你选择 Shadowmask 时可见，并且只是切换项目 [https://docs.unity3d.com/Manual/LightMode-Mixed-ShadowmaskMode.html Quality Settings] 中同名的设置。&lt;br /&gt;
[https://docs.unity3d.com/Manual/LightMode-Mixed-DistanceShadowmask.html 更多详情]&lt;br /&gt;
{{note|由于缺少对应的脚本 API，该复选框在 Unity 5.6.x 上不可见。你可以在 Window-&amp;gt;Lighting-&amp;gt;Mixed Lighting-&amp;gt;Lighting Mode 中切换该设置。}}&lt;br /&gt;
{{note|在 Unity 版本 &amp;lt; 2017.3 中，由于 API 限制，渲染 Shadowmask 光照贴图会清除光照探针。烘焙后需要重新渲染光照探针。在较新版本中不应发生此问题。}}&lt;br /&gt;
&lt;br /&gt;
===== Subtractive =====&lt;br /&gt;
&lt;br /&gt;
启用 [https://docs.unity3d.com/Manual/LightMode-Mixed-Subtractive.html Subtractive] 光照模式。&lt;br /&gt;
&lt;br /&gt;
此选项对光照贴图本身没有任何特殊作用，实际上它的工作方式与 Full Lighting 相同。&lt;br /&gt;
&lt;br /&gt;
唯一的区别是，它还会将实时 Unity 光源设置为与 Subtractive 模式兼容（因为无法通过 UI 完成此操作）。&lt;br /&gt;
&lt;br /&gt;
你还需要在 [https://docs.unity3d.com/Manual/GlobalIllumination.html#MixedLighting Unity Lighting] 窗口中额外设置全局减法参数（例如全局阴影颜色）。&lt;br /&gt;
&lt;br /&gt;
===== Ambient Occlusion Only =====&lt;br /&gt;
仅烘焙环境光遮蔽（AO）。如果你很清楚自己在做什么，这可能会有用。请确保设置 [[#Ambient_occlusion|AO 选项]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Directional mode ===&lt;br /&gt;
[[File:Image3.png|thumb|不同方向模式的对比]]&lt;br /&gt;
定义了方向信息的烘焙方式。标准光照贴图每个像素只存储单一颜色，而方向光照贴图为着色器提供了关于该像素周围半球内光照变化的提示。这些数据用于在完全烘焙的区域中结合法线贴图。如果将其应用到内置的 [[#Bakery_shaders|Bakery]] 着色器中，还可以产生**近似高光反射**效果。&lt;br /&gt;
&lt;br /&gt;
===== None =====&lt;br /&gt;
不包含方向数据，每个像素仅有单一颜色。&lt;br /&gt;
&lt;br /&gt;
===== Baked Normal Maps =====&lt;br /&gt;
依然没有方向数据，但在渲染光照贴图时会考虑法线贴图。此方式在运行时没有额外开销。由于光照贴图的分辨率通常低于法线贴图，结果可能显得模糊。其他问题包括：由于缺乏 mipmapping，远处可能出现锯齿，以及降噪步骤可能导致细节被涂抹。要了解如何在此模式下使用具有程序化法线的自定义着色器，请参阅 [[#Normal_mapping|Normal Mapping]] 章节。&lt;br /&gt;
&lt;br /&gt;
===== Dominant Direction =====&lt;br /&gt;
此模式类似于 Unity 中 Enlighten 和 Progressive 烘焙器的实现。它与大多数着色器兼容，仅生成一张额外的贴图，运行时开销极小。缺点是凹凸贴图的效果较弱，略显灰暗，与实时光照下的同一物体相比可能差异较大。&lt;br /&gt;
&lt;br /&gt;
===== RNM =====&lt;br /&gt;
基于最初为《Half-Life 2》开发的 [https://steamcdn-a.akamaihd.net/apps/valve/2004/GDC2004_Half-Life2_Shading.pdf Radiosity Normal Mapping] 技术（相关演示文稿），后来被许多游戏采用（如《Mirror's Edge》）。此模式总共生成三张 HDR 贴图，是内存占用最高的模式之一，但运行时开销仍相对较低。该模式比 Dominant Direction 更精确，能更好地再现表面反差，并能正确处理来自不同角度、具有不同颜色的光照对法线贴图的影响。&lt;br /&gt;
&lt;br /&gt;
===== SH =====&lt;br /&gt;
基于论文《[https://media.contentapi.ea.com/content/dam/eacom/frostbite/files/gdc2018-precomputedgiobalilluminationinfrostbite.pdf Precomputed Global Illumination in Frostbite]》。这是最高质量的模式，能提供更好的表面对比度，并准确表现来自不同方向、不同颜色的光照。总共生成四张贴图，其中仅一张为 HDR，因此比 RNM 占用更少内存。运行时开销略高于 RNM。&lt;br /&gt;
&lt;br /&gt;
===== MonoSH =====&lt;br /&gt;
[[File:FY8Ru8hWIAAdYYH.jpg|thumb|Dominant Direction、完整 SH 与 MonoSH 的尺寸/质量对比]]&lt;br /&gt;
与 SH 类似，但使用单色的 L1 方向系数。表面对比度同样良好，虽然无法准确表现来自不同方向的不同颜色光照，但对多数场景来说已经足够。仅生成一张额外贴图，因此显存占用与带宽需求与 Dominant Direction 相近；事实上更低，因为 Dominant Direction 使用 RGBA 贴图，而 MonoSH 只需 RGB。该贴图通过内置的方向光照贴图系统传递，但''在标准着色器下显示不正确''。请务必使用兼容的着色器。&lt;br /&gt;
&lt;br /&gt;
===== 限制 =====&lt;br /&gt;
&lt;br /&gt;
* RNM 和 SH/MonoSH 只能与 [[#Bakery_shaders|Bakery shader]] 一起使用，或者需要对你的着色器进行调整。&lt;br /&gt;
* 在 RNM 和 SH 模式下，不会生成标准的颜色光照贴图。你需要确保场景中所有材质都使用 Bakery Shader，或者使用 [[#Bakery_Lightmap_Group_Selector|Lightmap Groups]] 将 RNM/SH 对象与其他对象分开。&lt;br /&gt;
* RNM 和 SH 贴图是通过 [https://docs.unity3d.com/ScriptReference/MaterialPropertyBlock.html MaterialPropertyBlock] 应用于对象的，因此在 Unity 的 Lighting 窗口中可能无法完全显示。&lt;br /&gt;
* Dominant Direction、RNM 和 SH/MonoSH 模式可能需要为全局光照（GI）和光照网格使用更多采样，以获得相近的质量。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Texels per unit ===&lt;br /&gt;
[[File:Texelscomp.jpg|thumb|1 vs 10 texels per unit]]&lt;br /&gt;
每个世界单位的光照贴图像素（Texels）近似数量。它会影响生成光照贴图的数量和分辨率。&lt;br /&gt;
&lt;br /&gt;
入门示例值：&lt;br /&gt;
&lt;br /&gt;
* 大型户外区域（城市）：1 - 5&lt;br /&gt;
* 中型户外区域（几条小巷）：10 - 20&lt;br /&gt;
* 高质量室内场景：100&lt;br /&gt;
&lt;br /&gt;
假设场景比例大约为 1 单位 = 1 米。在 Unity 中使用这种比例通常是推荐的，以便更好地导航和进行物理模拟。如果你的比例不同，请相应地调整 Texels。&lt;br /&gt;
&lt;br /&gt;
请注意，Texels Per Unit 是基础分辨率，但每个对象还可以通过 Mesh Renderer 上的 &amp;quot;Scale in Lightmap&amp;quot; 选项以及 Bakery 窗口中的 &amp;quot;Scale per map type&amp;quot; 进行额外调整。&lt;br /&gt;
&lt;br /&gt;
{{note| 将 &amp;quot;Scale in Lightmap&amp;quot; 设置为 0 的对象不会被烘焙，但仍会投射阴影并影响全局光照（GI）。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Max resolution ===&lt;br /&gt;
光照贴图的最大尺寸限制。如果对象无法容纳在单张光照贴图中（根据当前的 Texels Per Unit 值），将会分配额外的光照贴图。同样的四个正方形对象可以使用四张 512x512 的贴图，也可以使用一张 1024x1024 的贴图。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bounces ===&lt;br /&gt;
[[File:Image36.png|thumb|注意更多的反弹会为封闭空间带来更多光照。]]&lt;br /&gt;
定义光线在表面上反弹的次数。通常，对于户外场景（例如城市），较低的反弹次数就足够了，而对于封闭场景（室内、洞穴），则需要较高的反弹次数。&lt;br /&gt;
&lt;br /&gt;
虽然滑块最多限制为 5 次反弹，但可以在数字输入框中输入任意反弹次数。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Samples ===&lt;br /&gt;
[[File:Image7.png|thumb|左：Samples = 4，右：Samples = 16。为了演示，去噪功能已关闭。]]&lt;br /&gt;
影响全局光照（GI）的质量。典型值为 16 到 32。&lt;br /&gt;
&lt;br /&gt;
{{note| 可以输入超出滑块最大值的任意数字，但请注意，该数字表示最终光线数量的平方根，例如 32 表示 1024 条光线，64 表示 4096 条光线，依此类推。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GPU Priority ===&lt;br /&gt;
在 GPU 处理光照贴图时，操作系统和其他软件的响应可能会变慢。此选项允许你在烘焙速度和系统响应之间进行平衡。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render ===&lt;br /&gt;
为所有打开的场景烘焙光照贴图。&lt;br /&gt;
如果 [[使用手册#Light_probe_mode|Light Probe Mode]] 设置为 L1 或 L2，也会烘焙 [https://docs.unity3d.com/Manual/LightProbes.html 光照探针]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Render Light Probes ===&lt;br /&gt;
为所有打开的场景烘焙 [https://docs.unity3d.com/Manual/LightProbes.html 光照探针]。&lt;br /&gt;
&lt;br /&gt;
请注意，要在 Shadowmask 模式下对动态对象获得正确的混合光阴影，你还需要启用 [[使用手册#Occlusion_probes|occlusion probes]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Render Reflection Probes ===&lt;br /&gt;
为所有打开的场景烘焙反射探针。此按钮仅为方便起见，会调用引擎内置的反射探针更新功能。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update Skybox Probe ===&lt;br /&gt;
为当前的 skybox 烘焙全局漫反射和反射探针。与 “Render Reflection Probes” 一样，它仅调用引擎内置函数。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Occlusion probes ===&lt;br /&gt;
在渲染光照探针时，允许 Unity 使用当前选择的内置光照烘焙器烘焙遮挡探针（occlusion probes）。遮挡探针是存储在普通光照探针中的附加数据，可以防止动态对象在阴影区域被错误照亮。目前在 Unity 中无法使用自定义遮挡探针，必须调用内置光照烘焙器来完成此操作。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Warnings ===&lt;br /&gt;
这些选项会在按下任意 Render 按钮后对场景进行验证，并显示警告对话框，询问是否继续或停止烘焙过程。&lt;br /&gt;
&lt;br /&gt;
* Suppress all popups（屏蔽所有弹窗）：按下 Render 后不显示任何对话框。&lt;br /&gt;
* UV validation（UV 验证）：检查所有模型是否具有完全正确的光照贴图 UV，特别是 UV 是否位于 0-1 范围内且不重叠。&lt;br /&gt;
* Overwrite check（覆盖检查）：显示哪些光照贴图文件将被覆盖。&lt;br /&gt;
* Memory check（内存检查）：显示大致所需的视频内存量。&lt;br /&gt;
* Sample count check（采样数检查）：检查是否有光源、GI 或 AO 的采样数不合理，可能导致 GPU 超出可用资源。&lt;br /&gt;
* Lightmapped prefab validation（光照贴图预制体验证）：验证光照贴图预制体，并在某些预制体将被覆盖时发出通知。&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 (Advanced) ==&lt;br /&gt;
=== Light probe mode ===&lt;br /&gt;
更改光照探针的烘焙方式。&lt;br /&gt;
&lt;br /&gt;
* Legacy（传统模式）：使用 Render Light Probes 按钮生成探针。点光源和方向光在光照烘焙器中计算，而区域光/天空光/间接光则通过在每个探针位置渲染立方体贴图收集。结果以 [https://docs.unity3d.com/ScriptReference/Rendering.SphericalHarmonicsL2.html L2] 球谐（spherical harmonics）形式存储。缺点是立方体贴图渲染速度慢，并且在游戏中使用的着色器未物理正确表示光照表面，或者项目为移动平台设置时，光照贴图和探针可能不匹配（Unity 可能会裁剪高强度值）。&lt;br /&gt;
&lt;br /&gt;
* L1：在点击 Render 时，光照探针会与光照贴图一起渲染。此选项提供更高的烘焙性能，并保证探针光照与光照贴图匹配。结果以 L1 球谐形式存储（仍可被普通着色器使用）。使用 [[#Bakery_shaders|Bakery shader]] 的 Non-Linear Light Probe SH 选项可以进一步提升结果。&lt;br /&gt;
&lt;br /&gt;
* L2：更高质量（完整 L2 球谐）。与 L1 一样，会自动与光照贴图一起渲染。与 L1 相比，性能影响可忽略不计。应在所有着色器下显示正常。探针对比度/方向性/振铃去除可通过 Project Settings -&amp;gt; Bakery -&amp;gt; “Ringing removal for L2 light probes” 调整。&lt;br /&gt;
&lt;br /&gt;
'''在 Unity 2019.3 中似乎存在一个 bug，如果启用 Occlusion Probes 选项，Legacy 光照探针的颜色无法正确保存。使用 Occlusion Probes 时，默认且推荐使用 L2 模式。'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Asset UV Processing ===&lt;br /&gt;
配置资产的 UV 间距（padding）调整。可选值：&lt;br /&gt;
&lt;br /&gt;
* Don't change（不更改）：不修改资产。&lt;br /&gt;
* Adjust UV padding（调整 UV 间距）：会查找具有自动生成 UV 的模型（资产上启用 “Generate Lightmap UVs”），并进一步调整它们，使每个网格的 UV 岛之间具有适当间距。导入器设置中的全模型 Pack Margin 会被忽略。系统会根据每个网格的面积和光照贴图分辨率计算出最优值。&lt;br /&gt;
* Adjust UV padding for new meshes only（仅调整新网格的 UV 间距）：与上面相同，但会跳过之前至少调整过一次的模型。&lt;br /&gt;
* Remove UV adjustments（移除 UV 调整）：撤销所有之前的 UV 调整，使自动展开的模型恢复到 Unity 原始展开的样子。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser ===&lt;br /&gt;
设置所需的去噪器。可选值：&lt;br /&gt;
&lt;br /&gt;
* Optix 5：使用 OptiX 5.1 AI 去噪器（之前称为 “Legacy denoiser”）。在 GPU 上运行。支持从 [https://en.wikipedia.org/wiki/Kepler_(microarchitecture) Kepler]（通常是 GeForce 6xx）到 [https://en.wikipedia.org/wiki/Turing_(microarchitecture) Turing]（通常是 GeForce 20xx）的所有显卡。不支持 [https://en.wikipedia.org/wiki/Ampere_(microarchitecture) Ampere]（30xx）。OptiX 5.1 使用嵌入的静态训练数据集，因此不受驱动实现影响。&lt;br /&gt;
&lt;br /&gt;
* Optix 6：使用 OptiX 6.0 AI 去噪器（之前为默认选项）。在 GPU 上运行。在 Kepler（6xx）显卡上似乎无法使用，但在更新的显卡上均可运行，包括 Ampere（30xx）。自 6.0 起，OptiX 去噪器的训练数据集存储在驱动中。在 v442.50 之前，其行为类似于 OptiX 5.1；但之后 NVIDIA [https://forums.developer.nvidia.com/t/optix7-denoiser-different-results-with-different-version-of-drivers/117989/2 更改了数据集]，结果可能有所不同。更新后的数据集有时可能产生网格状图案和更亮的边缘（仍可通过 “Denoise: fix bright edges” 修复），但运行速度更快。&lt;br /&gt;
&lt;br /&gt;
* Optix 7：使用 OptiX 7.2 AI 去噪器。行为类似 OptiX 6.0，但在 Ampere（30xx）上可能支持更好。&lt;br /&gt;
&lt;br /&gt;
* OpenImageDenoise：使用 Intel Open Image Denoise 库。在 CPU 上运行（任何支持 SSE 4.1 的 CPU）。可能略慢于 OptiX，但质量可比。&lt;br /&gt;
&lt;br /&gt;
* OpenImageDenoise2：使用 Intel Open Image Denoise 2，CUDA 模式。在 GPU 上运行，性能与 OptiX 6/7 相当，质量与 CPU 版本相同。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Adjust sample positions ===&lt;br /&gt;
寻找最佳采样位置以防止光照泄漏。算法详情可参考 [https://ndotl.wordpress.com/2018/08/29/baking-artifact-free-lightmaps/#leaks 此处]。在某些情况下（通常是大型且多边形极少、法线平滑的几何体），可能会产生不正确的结果，此时可以将其禁用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Unload scenes before render ===&lt;br /&gt;
在烘焙前卸载 Unity 场景以释放显存。复杂场景仅在编辑器中显示就可能占用数 GB 的显存。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Denoise ===&lt;br /&gt;
[[File:Image31.png|thumb|左：未开启 “Denoise”，右：开启 “Denoise”。]]&lt;br /&gt;
如果启用，将应用去噪算法。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Fix Seams ===&lt;br /&gt;
[[File:Image22.png|thumb|左：缝隙（“Fix Seams” 关闭），右：缝隙已修复（“Fix Seams” 开启）。]]&lt;br /&gt;
如果启用，将尝试融合由 UV 不连续造成的缝隙。对平滑几何体很有用，包括 Unity 默认的球体。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Split by scene ===&lt;br /&gt;
如果同时加载多个场景，并且启用此选项，每个场景将拥有自己的一套光照贴图，而不会与其他场景共享。这对于在运行时流式加载场景时限制纹理占用量非常有用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hole filling ===&lt;br /&gt;
[[File:Holefilling.jpg|thumb|“Hole filling” 关闭与开启的对比。]]&lt;br /&gt;
如果 Atlas Packer 设置为 xatlas，将尝试填充每个孔洞，从而生成更高效的贴图集。对于几何体非常复杂的场景，可能会增加场景导出时间，但通常推荐开启。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Min resolution ===&lt;br /&gt;
光照贴图的最小尺寸限制。可用于在生成大量小而完全填充的光照贴图与少量未完全填充的光照贴图之间进行平衡。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Scale per map type ===&lt;br /&gt;
允许你对颜色贴图、Shadowmask 和方向贴图设置不同的分辨率缩放。例如，常见情况是间接光颜色分辨率较低，但 Shadowmask 分辨率较高。请注意，缩放在光照贴图渲染完成后才应用，因此不会节省烘焙时间。如果启用了 “Adjust UV padding”，间距将基于最低分辨率的贴图，以防止像素泄漏。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Checker preview ===&lt;br /&gt;
[[File:Image12.png|thumb|Checker Preview 功能演示。]]&lt;br /&gt;
如果勾选了 “Show checker” 选项，场景视图将在可见对象上渲染棋盘格图案，以展示光照贴图像素大小。这对于在烘焙前确保 Texels Per Unit 和其他影响分辨率的设置使用合理数值非常有用。&lt;br /&gt;
&lt;br /&gt;
启用 Checker Preview 将强制 Bakery 执行贴图集打包。可能需要一些时间，但通常不会超过几秒钟。在修改场景内容后，按下 “Refresh checker” 可重新打包场景以查看更改。&lt;br /&gt;
&lt;br /&gt;
Checker Preview 还使用随机颜色显示场景将如何被分割到不同的光照贴图中。&lt;br /&gt;
&lt;br /&gt;
{{note| 当前 Checker Preview 无法显示地形的正确像素大小。}}&lt;br /&gt;
&lt;br /&gt;
==== Atlas preview ====&lt;br /&gt;
[[File:FN-TmhRXwAE9i2I.png|thumb|Atlas Preview 功能演示]]&lt;br /&gt;
当 Checker Preview 开启时，会显示 Atlas Preview 按钮。点击它将打开一个新窗口，显示未来光照贴图的 UV 布局。点击 &amp;quot;&amp;lt;&amp;quot; 和 &amp;quot;&amp;gt;&amp;quot; 按钮可浏览各个光照贴图。&lt;br /&gt;
这对于在烘焙前检查打包质量和光照贴图数量非常有用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Emissive boost ===&lt;br /&gt;
将任何表面自发光（emission）乘以此数值。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Indirect boost ===&lt;br /&gt;
将所有反弹光照乘以此数值。作用与光源组件上的 Indirect Intensity 相同，但为全局设置。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Backface GI ===&lt;br /&gt;
[[File:Image30.jpg|thumb|Backface GI]]&lt;br /&gt;
[[File:Image35.png|thumb|左：“Backface GI” = 0，右：“Backface GI” = 1。注意阴影区域接收到更多的绿色光照。]]&lt;br /&gt;
决定光线通过前面表面到达背面并被全局光照（GI）反弹的程度。这对于薄的半透明表面（如树叶）尤其有用。取值范围为 0-1。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Ambient occlusion ===&lt;br /&gt;
[[File:Image15.png|thumb|左：AO intensity = 0，右：AO intensity = 1。]]&lt;br /&gt;
一种简单的非物理环境光遮蔽（Ambient Occlusion，AO），可在最终场景光照上叠加以增强美观效果。&lt;br /&gt;
&lt;br /&gt;
* Intensity（强度）：控制 AO 效果的可见度。值为 0 时禁用该效果。&lt;br /&gt;
* Radius（半径）：决定 AO 效果使用的光线距离。较小的值产生局部遮蔽（角落、褶皱），较大的值则更类似 Skylight，从远处物体产生阴影。&lt;br /&gt;
* Samples（采样数）：影响环境光遮蔽的质量。典型值为 4 到 32。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dither transparency ===&lt;br /&gt;
通过自动抖动不透明度贴图来启用半透明阴影。[[使用手册#Opacity|了解 Bakery 如何处理不透明度贴图]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== RTX Mode ===&lt;br /&gt;
启用 RTX 硬件加速。仅 RTX 显卡可受益于此选项。最低支持的驱动版本为 418。&lt;br /&gt;
&lt;br /&gt;
驱动可以在大多数非 RTX Nvidia 显卡上模拟 RTX 模式，但通常会更慢。&lt;br /&gt;
&lt;br /&gt;
在 Ampere（3xxx）或更新的显卡上，RTX 模式 ''必须'' 启用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Export terrain trees ===&lt;br /&gt;
如果启用，绘制在地形上的树木将影响光照。树木本身不会被烘焙。请注意，在烘焙过程中，每棵树都使用最高可能的 LOD 等级。对于多公里范围且模型高度复杂的森林场景，不建议使用此选项。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Terrain optimization ===&lt;br /&gt;
如果启用（默认），地形将使用独立的光线追踪技术以利用其高程图几何结构。否则，它们将像其他普通网格一样处理。地形优化可以显著减少高分辨率地形所需的内存占用。在某些情况下，它还能加快地形烘焙速度，但在其他情况下（尤其是简单低分辨率地形）可能需要禁用该选项。&lt;br /&gt;
&lt;br /&gt;
{{note| 地形优化当前不兼容绘制的地形洞。需禁用此选项才能使其正常工作。}}&lt;br /&gt;
{{note| 地形优化仅支持非 RTX 模式。}}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Light Mesh batch limit ===&lt;br /&gt;
如果该值大于 0，会将多个 Light Mesh 合并为一个，前提是它们具有相同设置并影响相同的 Lightmap Groups，同时将它们的总采样数限制为该值（例如，如果限制为 64，则可以合并 2 个采样数为 32 的灯光，或 4 个采样数为 16 的灯光，等等）。在拥有大量 Light Mesh 的场景中，这可以提升性能。但设置过高时需小心，因为 GPU 在一次处理过多采样时可能触发操作系统驱动超时。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Compress volumes ===&lt;br /&gt;
如果启用，将对体积 3D 贴图应用纹理压缩，并将 Bakery 着色器切换到相应的采样模式。不推荐对分辨率非常低的体积使用此选项。体积大小可能会被调整为 4 的倍数。&lt;br /&gt;
&lt;br /&gt;
注意事项：&lt;br /&gt;
&lt;br /&gt;
* 目前仅支持压缩为 BC6H/BC7 纹理格式（桌面/主机平台）。&lt;br /&gt;
* 体积压缩仅支持 Unity 2020.1 或更高版本。&lt;br /&gt;
* 目前仅标准渲染管线的 Bakery 着色器支持使用压缩体积贴图。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Samples multiplier ===&lt;br /&gt;
将所有阴影和 GI 采样数乘以指定因子。可用于在草稿质量和最终质量之间快速切换。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Tile size ===&lt;br /&gt;
与 [[#GPU Priority|GPU Priority]] 相同，但这里设置的是贴图块（tile）大小。Bakery 会将光照贴图拆分为更小的块，并一次更新一个块。块越小，GPU 工作被中断的次数越多，系统响应性可能更好。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Temp path ===&lt;br /&gt;
临时文件夹。在渲染过程中，Bakery 可能需要几个 GB 的可用空间。将此文件夹放在 SSD 上相比 HDD 可略微加快渲染速度。目前，该文件夹不会自动清理。你可以随时手动删除其内容（渲染时除外），或通过 Bakery -&amp;gt; Utilities -&amp;gt; Clear cache 清理。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Output path ===&lt;br /&gt;
光照贴图文件夹。所有光照贴图，以及 lightprobe 和顶点颜色（vertex color）资源都将保存在此处。该路径相对于你的 Assets 文件夹。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Use scene named output path ===&lt;br /&gt;
如果启用此选项，输出路径将自动设置为与当前活动场景同名的文件夹（Assets/CurrentSceneName/）。这与 Unity 内置光照贴图烘焙器的行为类似。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render Selected Groups ===&lt;br /&gt;
仅烘焙包含所选对象的 Lightmap Groups。&lt;br /&gt;
不仅仅是所选对象会被重新绘制，它们所属的所有 Lightmap Groups 都会被处理。其他光照贴图不会被更新。如果对象不属于某个手动分配的组，则使用相同光照贴图的场景部分将被重新烘焙。&lt;br /&gt;
&lt;br /&gt;
目前，使用 [[Partial_scene_baking|Sectors]] 进行场景部分烘焙更为方便。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Beep on finish ===&lt;br /&gt;
如果启用，Bakery 在烘焙完成时会播放提示音。&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 (Experimental) ==&lt;br /&gt;
=== Unwrapper ===&lt;br /&gt;
如果启用 [[#Asset_UV_Processing|Adjust UV Padding]]，则定义将使用的展开器（unwrapper）。&lt;br /&gt;
&lt;br /&gt;
* Default：使用 Unity 标准展开器。Bakery 会为每个具有不同间距参数的网格调用 [https://docs.unity3d.com/ScriptReference/Unwrapping.GenerateSecondaryUVSet.html Unwrapping.GenerateSecondaryUVSet]。&lt;br /&gt;
* xatlas：使用 [https://github.com/jpcy jpcy] 的 [https://github.com/jpcy/xatlas xatlas]，这是 [https://github.com/castano Ignacio Castaño] 的 [https://github.com/Thekla/thekla_atlas thekla_atlas] 的修改版。thekla_atlas 曾用于游戏《The Witness》（[http://the-witness.net/news/2010/03/graphics-tech-texture-parameterization/ 参见博客文章]）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Atlas Packer ===&lt;br /&gt;
选择在将不同对象的 UV 布局打包到大型光照贴图集时使用的算法。&lt;br /&gt;
* Default：Bakery 在 v1.7 之前使用的原始算法。&lt;br /&gt;
* xatlas：使用 xatlas。&lt;br /&gt;
&lt;br /&gt;
某些功能仅支持特定的贴图集打包器：&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Default&lt;br /&gt;
! xatlas&lt;br /&gt;
|-&lt;br /&gt;
| [[使用手册#Bakery_Lightmap_Group_Selector|Override resolution]]&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
|-&lt;br /&gt;
| 高效 LOD 打包&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
|-&lt;br /&gt;
| [[使用手册#Hole_filling|Hole filling]]&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
请注意，贴图集打包器（Atlas Packer）也可以为每个 Lightmap Group 单独选择。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Export geometry and maps ===&lt;br /&gt;
如果启用，Bakery 会在渲染前将场景导出为其专用格式。如果你确定场景的几何体和贴图以及光照贴图分辨率设置没有改变（例如，你只是调整 GI 或光源设置），可以禁用此选项以加快下一次渲染速度。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update unmodified lights ===&lt;br /&gt;
如果启用，Bakery 会重新计算自上次渲染以来未改变的光源。如果你只是调整某个光源，不想等待其他光源重新渲染，可以禁用此选项。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update modified lights and GI ===&lt;br /&gt;
如果启用，Bakery 会重新计算自上次渲染以来发生变化的 GI 和光源。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== UV padding: increase only ===&lt;br /&gt;
仅在启用 [[#Asset_UV_Processing|Adjust UV padding]] 时可见。默认情况下，模型资源的最佳 UV 间距仅基于当前加载的场景进行计算。如果同一模型有多个实例使用不同的光照贴图分辨率，最小的分辨率将决定间距，以确保 UV 图块之间的间距足够大，防止相互重叠。然而，在两个不同的独立场景中烘焙同一模型时，为新场景优化可能会破坏之前场景中的 UV。勾选此选项可以防止这种情况发生，即永远不减小间距值，从而始终为曾经烘焙过的最低分辨率实例进行优化。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoise: fix bright edges ===&lt;br /&gt;
[[File:Image19.png|thumb|左：去噪后可见明亮边缘；右：已修复。]]&lt;br /&gt;
仅在 [[#Denoise|Denoise]] 启用时可见。有时用于去噪的神经网络可能会在阴影周围产生明亮边缘，就像应用了锐化效果一样。如果启用此选项，Bakery 会尝试将其滤除。启用后，去噪阶段可能会略微变慢。&lt;br /&gt;
&lt;br /&gt;
此功能也可用于滤除“火花”（fireflies），即光照贴图中偶尔出现的亮点。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Post-packing ===&lt;br /&gt;
有时在渲染场景时，Bakery 会将光照贴图拆分为多个子光照贴图，例如在烘焙不同 LOD 或地形时。&lt;br /&gt;
Post-packing 会尝试通过将这些子光照贴图合并到同一纹理中来最小化最终贴图集数量。&lt;br /&gt;
建议保持此选项启用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Combine with Enlighten real-time GI ===&lt;br /&gt;
如果启用，则在按下 Render 按钮时，Bakery 会首先尝试使用 Enlighten 烘焙以计算实时 GI。之后，将进行常规的 Bakery 光照贴图烘焙过程。烘焙 GI 和实时 GI 将协同工作。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bake on remote server ===&lt;br /&gt;
启用网络烘焙（[[Network baking|Network baking]]）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Presets ===&lt;br /&gt;
当前在 Experimental 模式下的 Render/Update 按钮下显示。&lt;br /&gt;
&lt;br /&gt;
* 点击 '''New''' 将所有当前设置保存到预设文件中。&lt;br /&gt;
* 默认情况下，当一个预设处于激活状态时，所有设置都会被灰显，以防止覆盖预设。&lt;br /&gt;
* 点击 '''Modify preset''' 可更改设置并覆盖预设。&lt;br /&gt;
* 可以通过预设字段切换预设。将其设置为 None 可禁用预设使用。&lt;br /&gt;
&lt;br /&gt;
== 组件 ==&lt;br /&gt;
=== Bakery Lightmap Group Selector ===&lt;br /&gt;
指定对象及其所有子对象使用的 '''Lightmap Group'''。&lt;br /&gt;
Lightmap Group 是 Bakery 用来表示共享同一光照贴图的对象集合的术语。每个组都有属性，告诉 Bakery 如何打包对象、哪些光源影响它们，以及结果是烘焙到纹理还是顶点。&lt;br /&gt;
&lt;br /&gt;
默认情况下，所有静态对象会自动打包到多个光照贴图组（贴图集）中，因此通常无需手动管理。手动定义组仅用于特殊用途，例如：&lt;br /&gt;
&lt;br /&gt;
* 指定某些对象使用 [[Vertex Lightmaps|每顶点光照贴图]] 而非纹理。&lt;br /&gt;
* 使用建模软件中的原始未缩放 UV 烘焙光照贴图。&lt;br /&gt;
* 将关卡的特定区域分组以使用单张光照贴图，从而便于资源流式加载或通过脚本在运行时切换不同的烘焙光照。&lt;br /&gt;
* 使用 Render Selected Groups 按钮仅更新已分组的对象。&lt;br /&gt;
&lt;br /&gt;
要手动定义组，可以创建 '''Lightmap Group Assets'''，方法包括使用 Assets-&amp;gt;Create 菜单，或在组件中使用 Create New 按钮。使用 Create New 按钮时，将根据以下表单创建新的资源：&lt;br /&gt;
&lt;br /&gt;
* Name：要创建的 Lightmap Group 资源的名称。&lt;br /&gt;
* Packing Mode：此选择器定义 Lightmap Group 的打包模式，共有 3 种模式：&lt;br /&gt;
** Original UV：对象及其子对象将使用未修改的 UV 进行烘焙，不执行打包。适用于多个网格共享同一已打包 UV 布局的模型。&lt;br /&gt;
** Pack Atlas：对象及其子对象将打包到专用纹理贴图集中。在 v1.3 之前，每个可打包的子对象都需要有此组件，但现在不再需要。每个子对象将作为单独矩形打包，除非 Bakery 自动检测到子对象有非重叠的子对象，在这种情况下，多个对象可以使用同一个矩形。&lt;br /&gt;
** Vertex：对象及其子对象将使用顶点色烘焙光照而非纹理。注意，需要使用自定义着色器才能生效，例如 [[#Bakery_shaders|Bakery Shader]]。文档中也提供了一个简单的着色器（“Bakery/Simple Vertex Lightmapped”）用于演示和参考。[[Vertex Lightmaps|了解更多关于顶点光照贴图的信息]]。&lt;br /&gt;
* Directional mode：允许你覆盖该组的 [[#Directional mode|directional mode]]。选项与全局相同，Auto 将使用全局设置。&lt;br /&gt;
* Resolution：所需的光照贴图分辨率。&lt;br /&gt;
* Auto-resolution：使用 [[使用手册#Texels_per_unit|Texels Per Unit]] 来确定最接近的二次幂分辨率。&lt;br /&gt;
* Atlas packer：为该组选择 [[使用手册#Atlas_Packer|贴图集打包]] 算法。&lt;br /&gt;
* Bitmask：用于排除光源影响光照贴图的开关列表。每个 Bakery 光源也有一个位掩码设置。光源只会影响与其共享至少一个开关的 Lightmap Group。默认设置意味着所有光源影响所有光照贴图。&lt;br /&gt;
&lt;br /&gt;
[[File:Ts.jpg|thumb|Transparent selfshadow关闭 vs 开启：注意一些单面但背向的多边形如何被正确照亮。]]&lt;br /&gt;
&lt;br /&gt;
如果你有一个被分配了“Pack Atlas”模式的 Lightmap Group，组件上将会出现额外设置：&lt;br /&gt;
&lt;br /&gt;
* Override resolution：覆盖该对象及其子对象在光照贴图中占用的分辨率。&lt;br /&gt;
* Resolution：手动定义的分辨率。例如，如果你有一个分辨率为 512 的光照贴图，并且分配给 4 个对象，同时覆盖分辨率设置为 256，Bakery 将生成一个 512x512 的光照贴图，每个对象正好占据 256x256 的区域。&lt;br /&gt;
&lt;br /&gt;
如果你选择一个 Lightmap Group 资产，将会显示额外的实验性设置：&lt;br /&gt;
* [[Subsurface scattering|Subsurface scattering: (点击阅读更多)]]&lt;br /&gt;
* Normal offset：允许你将光线从表面偏移。这很少有用，主要用于实验目的。&lt;br /&gt;
* Transparent selfshadow：从表面后方发射光线，使其不会在自身投射阴影。对于半透明叶片可能有用。&lt;br /&gt;
* Vertex sampling density，(仅当 Packing Mode 设置为 Vertex 时可用）：默认情况下，每个顶点只计算一个值；如果采样密度 &amp;gt; 0，则会在三角形上分散采样并求平均，从而生成超采样、更平滑的结果。&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Lightmapped Prefab ===&lt;br /&gt;
此组件允许预制件存储光照贴图元数据。这样处理后的预制件可以在任意场景中实例化，无论是在编辑器中还是运行时。&lt;br /&gt;
该组件应直接添加到预制件的根对象上。不支持嵌套预制件。由于预制件在烘焙后会被覆盖（类似于按下“Apply”按钮的效果），因此要求预制件没有任何未应用的更改（子对象不应移动，材质和脚本参数应保持不变等）。如果检测到此类更改，组件界面会显示错误，烘焙后不会保存任何元数据。如果启用了 [[#Warnings|Lightmapped prefab validation]] 警告，所有预制件错误也会在烘焙前以对话框形式显示。&lt;br /&gt;
&lt;br /&gt;
光照贴图预制件支持所有 Bakery 功能，例如 LOD、地形、方向光贴图、RNM、SH、顶点模式和 Shadowmask。要使 Shadowmask 生效，光源也必须是同一预制件的一部分。&lt;br /&gt;
&lt;br /&gt;
{{note| 注意，由于 API 限制，预制件 Shadowmask 仅在 Unity 2017.4 或更高版本中可用。}}&lt;br /&gt;
&lt;br /&gt;
烘焙后，一个名为 “BakeryPrefabLightmapData” 的对象会被添加到预制件中。该对象包含一个脚本，存储应用光照贴图所需的所有数据。&lt;br /&gt;
&lt;br /&gt;
此外，光照贴图预制件允许保存当前渲染设置，并使用两个按钮将其加载回任意已打开的场景：&lt;br /&gt;
&lt;br /&gt;
* Save current render settings to prefab：在该预制件上存储当前渲染设置的副本。&lt;br /&gt;
* Load render settings from prefab：将当前渲染设置设置为预制件中存储的设置。&lt;br /&gt;
  [[File:Upload 2019-9-17 10-32-34.png|thumb|应用预制件]]&lt;br /&gt;
&lt;br /&gt;
烘焙光照贴图预制件时，建议检查：&lt;br /&gt;
&lt;br /&gt;
* 预制件已“应用”。在旧版 Unity 中，点击 Inspector 右上角的 “Apply” 按钮。在新版 Unity 中，点击 “Overrides” 列表，然后选择 “Apply All”。&lt;br /&gt;
* 预制件组件 UI 不显示任何错误。&lt;br /&gt;
* [推荐] 在主窗口启用 “Lightmapped prefab validation” 复选框。点击 Render 时不会显示任何关于预制件的警告对话框。&lt;br /&gt;
&lt;br /&gt;
{{note| 光照贴图以其烘焙所在的场景或所使用的 Lightmap Group 命名（如果有）。在同一场景中烘焙不同预制件时，请确保使用不同命名的 [[使用手册#Bakery_Lightmap_Group_Selector|Lightmap Group]] 或更改 [[使用手册#Output_path|输出路径]]。}}&lt;br /&gt;
&lt;br /&gt;
{{note| 当使用相同模型逐个烘焙多个预制件时，建议将 [[使用手册#Asset_UV_Processing|Asset UV Processing]] 设置为“Don't Change”，以防止修改共享模型的 UV。}}&lt;br /&gt;
&lt;br /&gt;
{{note| Bakery 的预制件工作流程是在 Unity 提供“预制件双击进入视图”功能之前实现的。因此，在隔离预制件视图中光照贴图可能无法正确应用，组件可能显示 “This GameObject is not a prefab” 信息。但在普通场景中使用时应能正常工作。}}&lt;br /&gt;
&lt;br /&gt;
{{note| 当解包已烘焙的预制件并取消与现有光照贴图的关联时，请确保删除保存预制件范围光照贴图/渲染器连接的 BakeryPrefabLightmapData 对象。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Direct Light ===&lt;br /&gt;
[[File:Directlight.jpg|thumb|纯直射光 + GI]]&lt;br /&gt;
[[File:Image4.png|thumb|左：“Shadow Spread” = 0.01，右：0.05。注意阴影从锐利逐渐变模糊的效果。]]&lt;br /&gt;
无限远方向光（例如太阳）。&lt;br /&gt;
&lt;br /&gt;
* Color：光的颜色。&lt;br /&gt;
* Intensity：线性色彩乘数。&lt;br /&gt;
* Shadow Spread：光源尺寸，或者简单说，阴影的模糊度。0 = 阴影最锐利，1 = 阴影最模糊。从技术上讲，它在单条光线与更宽光锥之间插值。&lt;br /&gt;
* Shadow Samples：影响阴影质量。Shadow Spread 值越小，所需样本越少即可得到干净图像。太阳阴影的典型值为 1 到 16。设置为 0 时，该光源的阴影将消失。&lt;br /&gt;
* Bitmask：用于排除此光源对特定 Lightmap Groups 影响的开关列表。&lt;br /&gt;
* Baked contribution：确定应烘焙哪类光照数据。仅在 Indirect 或 Shadowmask 模式可见。可选值：&lt;br /&gt;
** Direct and Indirect：直射光与间接光都完全烘焙。&lt;br /&gt;
** Indirect only：实时光提供直射贡献，仅烘焙间接光。&lt;br /&gt;
** Shadowmask and indirect：实时光提供直射贡献，静态几何体的阴影烘焙到单独贴图，动态与静态阴影混合。间接光正常烘焙。&lt;br /&gt;
** Direct, Indirect, Shadowmask（仅自定义光照）：与直射和间接相同，但 Shadowmask 也生成，可与自定义着色器一起使用。&lt;br /&gt;
* Denoise shadowmask：确定是否对该光源的 Shadowmask 应用去噪。通常不需要，因为阴影噪点不明显，但对非常宽且模糊的阴影（大 Shadow Spread）可能有用。&lt;br /&gt;
* Indirect intensity：非物理 GI 乘数。自然光照应为 1，可根据场景风格调整。&lt;br /&gt;
* Anti-alias：对阴影执行超采样。&lt;br /&gt;
* Texture projection：在光照上投射乘法平铺纹理，可用于模拟远处云影。&lt;br /&gt;
当设置了纹理投影时，可以使用“Tiling”和“Offset”字段调整其缩放和偏移。或者，点击 &amp;quot;Tweak projection in Scene View&amp;quot; 并使用额外的 Gizmo 可视化移动和缩放投影。点击“Render reference frame”可保存光源视角的 PNG，这对于在场景上绘制云影很有用。&lt;br /&gt;
&lt;br /&gt;
如果同一对象同时启用了 Unity 和 Bakery 光源且参数不匹配，会出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match lightmapped to real-time：将 Unity 光源的通用设置复制到 Bakery 光源。&lt;br /&gt;
* Match real-time to lightmapped：将 Bakery 光源的通用设置复制到 Unity 光源。&lt;br /&gt;
&lt;br /&gt;
{{note| 从物理角度看，Bakery 的方向光强度（Intensity）等于照度（Lux）除以 π。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Sky Light ===&lt;br /&gt;
[[File:Skylight.jpg|thumb|纯天空光与 GI]]&lt;br /&gt;
无限远的带阴影环境光（天空）。&lt;br /&gt;
&lt;br /&gt;
* Color: 颜色。&lt;br /&gt;
* Intensity: 线性色彩倍增。&lt;br /&gt;
* Sky texture: 可选的立方体贴图资源，例如 HDRI 全景图，用于从不同方向影响光照颜色。&lt;br /&gt;
  {{note| 旋转天空光的 GameObject 会相应旋转立方体贴图的光照。}}&lt;br /&gt;
* Samples: 影响阴影质量。典型值为 8 到 32。&lt;br /&gt;
* Hemispherical: 如果启用，光照仅来自上方（上半球）。否则来自所有方向。&lt;br /&gt;
* Bitmask: 用于排除此光源影响特定 Lightmap Groups 的开关列表。&lt;br /&gt;
* Baked contribution: 决定应烘焙哪种光照数据。仅在 Indirect/Shadowmask 模式下可见。可能值：&lt;br /&gt;
** Direct and Indirect: 直接和间接光照都将完全烘焙。这是默认且推荐的天空光行为，因为在 Unity 中没有实时版本可以模拟它们。&lt;br /&gt;
** Indirect only: 假定实时光源提供直接贡献；仅烘焙间接光照。&lt;br /&gt;
&lt;br /&gt;
如果天空光的设置与当前场景的天空盒不匹配，将出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match this light to scene skybox: 将活动天空盒材质的通用设置复制到 Bakery 天空光。当前仅支持使用 “Skybox/Cubemap” 或 “Skybox/Bakery skybox” 着色器的天空盒。&lt;br /&gt;
* Match scene skybox to this light: 将 Bakery 天空光的通用设置复制到场景天空盒。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bakery Light Mesh ===&lt;br /&gt;
[[File:Image29.png|thumb|Left: Samples Near = 0, Samples Far = 4096.&amp;lt;br&amp;gt;&lt;br /&gt;
Middle: Samples Near = 0, Samples Far = 128.&amp;lt;br&amp;gt;&lt;br /&gt;
Right: Samples Near = 16, Samples Far = 128.&amp;lt;br&amp;gt;&lt;br /&gt;
请注意，光照效果看起来相似，但使用的合并采样数量更少。]]&lt;br /&gt;
任何形状的自发光网格。应与 Mesh Renderer 组件或设置为 Area 模式的 Light 组件一起使用。&lt;br /&gt;
&lt;br /&gt;
* Color：颜色&lt;br /&gt;
* Intensity：线性颜色倍增器&lt;br /&gt;
* Cutoff：最大光照距离。Bakery 会在接近该限制时额外衰减正确的平方反比衰减。当 Cutoff 值刚好对应物理衰减变得非常暗的位置时效果最佳。Cutoff 可提升烘焙性能，也可以设置为非常高（不可达）的值以保证完全正确性。&lt;br /&gt;
* Self Shadow：决定光源网格自身是否投射阴影。此选项同时启用更精确的光照算法。&lt;br /&gt;
* Samples Near：影响靠近网格的光照质量。典型值为 16 到 64，仅当 Self Shadow 开启时可用。&lt;br /&gt;
* Samples Far：影响远离网格的光照质量。典型值为 4 到 4096。&lt;br /&gt;
&lt;br /&gt;
Bakery 基于光源表面距离混合两种不同的区域光算法。靠近光源时，算法类似 GI，而远处光源被近似为虚拟点光云。&lt;br /&gt;
&lt;br /&gt;
{{note| &amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;光源网格自身不会接收光照，也不会被烘焙到光照贴图中。&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;一个拥有大量多边形的光源网格比烘焙多个简单的光源网格要快&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;如果结果总是脏/噪点较多，可以尝试将 Samples Near 设置为 0，这样只使用 VPL 算法。对于不需要精度的简单光源（如建筑物的窗户光），这也非常有用。&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;}}  &lt;br /&gt;
[[File:Dd99d-QU0AEKFBK.jpg|thumb|弯曲的光源网格]]  &lt;br /&gt;
* Bitmask：用于排除此光源影响特定 Lightmap Groups 的开关列表。  &lt;br /&gt;
* Baked contribution：决定烘焙哪种类型的光照数据。仅在 Indirect 或 Shadowmask 模式下可见。可能的值：  &lt;br /&gt;
** Direct and Indirect：完全烘焙直接和间接光贡献。这是默认且推荐的光源网格行为，因为 Unity 中没有实时版本可以模拟它们。  &lt;br /&gt;
** Indirect only：实时光源提供直接光贡献，仅烘焙间接光。  &lt;br /&gt;
** Shadowmask and Indirect：实时光源提供直接光贡献，但静态几何体的阴影会烘焙到单独的贴图。动态和静态阴影将混合在一起。间接光照将照常烘焙。目前仅 HDRP（和自定义渲染器）支持混合区域光。  &lt;br /&gt;
** Direct, Indirect, Shadowmask (custom lighting only)：与 Direct and Indirect 相同，但同时生成 Shadowmask 并分配用于自定义着色器。  &lt;br /&gt;
* Indirect intensity：非物理 GI 倍增器。自然光照应设为 1，但可修改以实现更风格化的场景。  &lt;br /&gt;
* Shadowmask with falloff：将完整光衰减烘焙进 Shadowmask（仅对自定义着色器有用）。  &lt;br /&gt;
&lt;br /&gt;
如果网格材质和光源设置不匹配，将出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match light to material：将网格材质或区域光的通用设置复制到 Bakery 光源。&lt;br /&gt;
* Match material to light：将 Bakery 光源的通用设置复制到网格材质或区域光。&lt;br /&gt;
&lt;br /&gt;
==== Light Mesh 与自发光材质的区别 ====&lt;br /&gt;
自发光材质：&lt;br /&gt;
&lt;br /&gt;
* 在 GI 计算中传播光线，因此是“免费的”，无论有多少网格是自发光的。&lt;br /&gt;
* 小而明亮的光可能会产生不准确或有噪点的结果，这取决于 GI 的采样数量。&lt;br /&gt;
* 由于 Bakery 中 GI 的工作方式，它必须占用光照贴图空间，因此可能会浪费空间。同时，这意味着自发光对象需要有效的 UV，并且必须启用“投射阴影”。&lt;br /&gt;
&lt;br /&gt;
Light Mesh：&lt;br /&gt;
&lt;br /&gt;
* 光照会为每个光源单独计算，因此比自发光材质慢。&lt;br /&gt;
* 设计用于为小而明亮的光提供干净的光照效果，即使距离很远也能保持效果。&lt;br /&gt;
* 不占用光照贴图空间。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Point Light ===&lt;br /&gt;
[[File:Image11.png|thumb|左：“Shadow Spread” = 0.5，右：“Shadow Spread” = 1。]]&lt;br /&gt;
点光源，没有面积。尽管在物理上不可能，但在游戏中很有用，并且是匹配 Unity 点光源和聚光灯的唯一方式。&lt;br /&gt;
{{note| 聚光灯只是带有额外投影遮罩的点光源。}}&lt;br /&gt;
&lt;br /&gt;
* Color: 颜色&lt;br /&gt;
* Intensity: 线性色彩倍增&lt;br /&gt;
* Shadow spread: 阴影模糊度。虽然点光源没有面积，但通常希望它仍能产生模糊阴影。为此，阴影被模拟为从球形区域光源投射。此参数定义了虚拟球体的半径，直接影响阴影模糊度。&lt;br /&gt;
* Physical falloff: 如果启用，将使用正确的平方反比衰减，并在边界附近额外衰减。否则将尝试模拟 Unity 的衰减。&lt;br /&gt;
* Falloff min size: 详见 [[Point Light Attenuation]] 部分。&lt;br /&gt;
* Range: 如果物理衰减被禁用，则等于 Unity 的光源范围；如果启用，只会在边缘轻微衰减物理衰减。&lt;br /&gt;
* Samples: 影响阴影质量。典型值为 1 到 512。设置为 0 将使该光源的阴影消失。&lt;br /&gt;
  [[File:Image10.png|thumb|从左到右：Omni，Cookie（默认聚光灯纹理），Cubemap，IES。]]&lt;br /&gt;
* Projection mask: 遮罩/Cookie 类型。选项：&lt;br /&gt;
** Omni: 无遮罩，相当于 Unity 的点光源。&lt;br /&gt;
** Cookie: 纹理投影遮罩。附加选项：&lt;br /&gt;
*** Cookie texture: 2D 纹理资源。Bakery 包含原始 Unity 聚光灯纹理（名为 ftUnitySpotTexture），可用于模拟。&lt;br /&gt;
*** Angle: 纹理投影角度（类似 Unity 聚光灯）。&lt;br /&gt;
*** Correct distortion: 修正宽角下直线可见的 cookie 失真。&lt;br /&gt;
** Cubemap: 立方体贴图投影遮罩。附加选项：&lt;br /&gt;
*** Projected cubemap: 立方体贴图资源。&lt;br /&gt;
** IES: 光照由 IES 文件数据调制。附加选项：&lt;br /&gt;
*** IES file: .ies 扩展名文件。&lt;br /&gt;
* Bitmask: 用于排除该光源影响特定 Lightmap Groups 的开关列表。&lt;br /&gt;
* Baked contribution: 决定应烘焙哪种类型的光照数据。仅在 Indirect 或 Shadowmask 模式下可见。可能值：&lt;br /&gt;
** Direct and Indirect: 直接光和间接光完全烘焙。&lt;br /&gt;
** Indirect only: 实时光提供直接光，仅烘焙间接光。&lt;br /&gt;
** Shadowmask and Indirect: 实时光提供直接光，但静态几何体阴影烘焙到单独贴图中，动态和静态阴影混合，间接光正常烘焙。&lt;br /&gt;
** Direct, Indirect, Shadowmask (custom lighting only): 与 Direct and Indirect 相同，同时生成 Shadowmask 用于自定义着色器。&lt;br /&gt;
* Indirect intensity: 该光的非物理 GI 倍增。自然光应为 1，可根据风格化场景修改。&lt;br /&gt;
* Shadowmask with falloff: 将完整光衰减（除距离外）烘焙到 Shadowmask（仅自定义着色器有用）。&lt;br /&gt;
* Legacy sampling: 使用 Bakery 原始更偏置的阴影采样策略。产生无噪点阴影，但宽半影可能出现条纹。禁用后使用无偏但更有噪点的技术。&lt;br /&gt;
&lt;br /&gt;
如果同一对象同时启用了 Unity 和 Bakery 光源，且设置不匹配，则会出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match lightmapped to real-time: 将 Unity 光的常用设置复制到 Bakery 光。&lt;br /&gt;
* Match real-time to lightmapped: 将 Bakery 光的常用设置复制到 Unity 光。&lt;br /&gt;
&lt;br /&gt;
{{note| 从物理角度来看，Bakery 点光源的“Intensity”为 Candela 除以 Pi。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Volume ===&lt;br /&gt;
[[File:Voldemo notlonely.gif|由 BakeryVolume 照亮的动态门（动态 GIF，由 NOTLonely 制作）]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
体积（Volumes）生成存储每个体素光探针的 3D 纹理（L1 球面调和和阴影贴图），使其成为常规 Unity 光探针的可行替代方案。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Unity Light Probes&lt;br /&gt;
! Unity LPPV&lt;br /&gt;
! Bakery Volumes&lt;br /&gt;
|-&lt;br /&gt;
| 手动放置每个光探针&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 否&lt;br /&gt;
|-&lt;br /&gt;
| 在一个物体上插值多个光探针&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 运行时可移动&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 可以放入预制件&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 完整脚本 API&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| “Ringing” 伪影&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 可能出现&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 可能出现&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 已修正&lt;br /&gt;
|-&lt;br /&gt;
| 去噪&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 运行时开销&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | CPU：低开销；GPU：低开销&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | CPU：中等开销；GPU：中等开销&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#e4ead3;&amp;quot; | CPU：无开销；GPU：中等开销&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bakery Volume 是一个与一组 3D 纹理（3 个 SH 纹理和一个可选的 shadowmask）关联的边界盒，使其非常易于使用和编程。Volumes 可以在运行时轻松地交换、移动、加载或卸载，也可以与预制件关联。它们不需要任何 Light Probe Groups 或手动探针布置；整个 Volume 都由均匀的探针体素网格填充。光/影泄漏会自动像处理光照贴图一样修复（尽管对于较大的体素尺寸，薄的双面墙可能会出现问题，但可以通过在不同侧使用不同 Volume 避免）。由于体素网格的均匀特性，也可以对其应用类似光照贴图的降噪，这是常规光探针无法做到的。此外，Bakery 着色器使用 [https://drive.google.com/file/d/1MK6Clw93q8ljijRjb4gQOzzaIjn1uF9Y/view Geomerics] 采样技巧，完全消除了高对比度 HDR 光照下 SH 有时会产生的 “ringing” 伪影。&lt;br /&gt;
&lt;br /&gt;
因此，Volumes 可以为动态物体生成干净、精细、高质量的烘焙光照（即来自静态物体并影响动态物体的光照，而不是相反）。&lt;br /&gt;
&lt;br /&gt;
Volume 方法的唯一缺点是每像素着色开销较高。其开销类似于 LPPV（随着屏幕上受体素影响的像素数量而缩放），但与 LPPV 不同的是，一旦烘焙完成，Volumes 本身不会再更新。多个 Volume 的混合可以通过稍微重叠它们来避免。&lt;br /&gt;
&lt;br /&gt;
====设置 Volume 变换====&lt;br /&gt;
[[File:Bvolgizmo.jpg|thumb|Volume 控制柄]]&lt;br /&gt;
当 BakeryVolume 被添加到一个 GameObject 时，场景视图中会出现一个边界盒控制柄。拖动小方块即可缩放它。&lt;br /&gt;
&lt;br /&gt;
还有其他方法可以更改 Volume 的大小和位置：&lt;br /&gt;
&lt;br /&gt;
* 将任何可渲染的 GameObject 拖入 “Wrap to object” 字段。Volume 会包裹该对象（及其子对象），以将它们完全包含在内。&lt;br /&gt;
* 如果同一个对象上添加了 Box Collider，则会出现 “Set from box collider” 和 “Set to box collider” 按钮。可以用它们快速在 Volume 和 Collider 之间复制数值。&lt;br /&gt;
&lt;br /&gt;
====分辨率====&lt;br /&gt;
当启用 “Adaptive resolution” 时，体素数量由 “Voxels per unit” 控制。禁用它可以手动输入分辨率。对于大多数 1 单位 = 1 米 的游戏来说，一个合理的 “Voxels per unit” 值是 2，但在某些情况下（例如动态门）使用较小但更高分辨率的 Volume 会更有利。&lt;br /&gt;
&lt;br /&gt;
====其他设置====&lt;br /&gt;
&lt;br /&gt;
* Enable baking: 是否需要（重新）计算 Volume？禁用可防止覆盖已有数据。&lt;br /&gt;
* Denoise: 在烘焙 Volume 后应用去噪。推荐用于高分辨率 Volume。避免用于覆盖许多光源的低分辨率 Volume，因为去噪器难以区分实际内容和噪声。&lt;br /&gt;
* Global: 自动将此 Volume 分配给所有兼容 Volume 的 Shader，除非它们有覆盖设置。内部会调用 Shader.SetGlobalTexture()/SetGlobalVector()。&lt;br /&gt;
====使用方法====&lt;br /&gt;
Volumes 可以分配给使用 Volume 感知 Shader 的对象。Bakery 自带实现该功能的 “Bakery Standard” Shader，以及 HDRP 和 URP 的 Shader 图。请查看 example_volumes 场景，了解应用 Volume 的各种方式。&lt;br /&gt;
&lt;br /&gt;
====提示====&lt;br /&gt;
&lt;br /&gt;
* 确保查看示例。&lt;br /&gt;
* 如果两个 Volume 相连，让它们略微重叠。重叠大小应等于最大动态对象的尺寸。这样在运行时简单切换 Volume 就能正常工作。&lt;br /&gt;
* 仅在动态对象实际可达的区域放置 Volume。例如，使用玩家高度限制 Volume 的高度。&lt;br /&gt;
&lt;br /&gt;
====旋转 Volumes====&lt;br /&gt;
如果启用 “Rotate around Y” 选项，Volumes 可以绕 Y 轴旋转。旋转开销非常低，只使用 2 个额外的浮点数据（预计算的角度 sin/cos）。&lt;br /&gt;
&lt;br /&gt;
还可以在运行时旋转 Volumes（Experimental -&amp;gt; “Support rotation after bake” 以及 Bakery Shader 中的类似选项），这种情况下 Volume 必须在初始旋转为零时进行烘焙。&lt;br /&gt;
&lt;br /&gt;
在 URP 中，这种动态旋转可以与 `BakeryURPVolumeGraphRotatable.shadergraph` 一起使用。&lt;br /&gt;
&lt;br /&gt;
对于全局 Volume，动态旋转会在组件被（重新）启用或调用 `volume.SetGlobalParams()` 时更新。使用局部旋转 Volume 时，需要手动在材质或 MaterialPropertyBlock 上设置旋转：&lt;br /&gt;
{{code|&amp;lt;nowiki&amp;gt;SetMatrix(&amp;quot;_VolumeMatrix&amp;quot;, volume.GetMatrix())&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
====技术信息====&lt;br /&gt;
Volumes 可以自动工作（查看示例场景），也可以通过脚本控制其使用方式。&lt;br /&gt;
&lt;br /&gt;
可以通过组件的以下公共属性获取 Volume 数据：&lt;br /&gt;
&lt;br /&gt;
* `bakedTexture0`：存储 L0 RGB 系数和 L1 Z 红色通道在 alpha 中。&lt;br /&gt;
* `bakedTexture1`：存储 L1 X RGB 系数和 L1 Z 绿色通道在 alpha 中。&lt;br /&gt;
* `bakedTexture2`：存储 L1 Y RGB 系数和 L1 Z 蓝色通道在 alpha 中。&lt;br /&gt;
* `bakedMask`：存储体积阴影遮罩。&lt;br /&gt;
* `bounds`：Volume 的包围盒。&lt;br /&gt;
&lt;br /&gt;
所有 `bakedTexture*` 使用 RGBAHalf（每体素 8 字节）格式，mask 使用 ARGB32（每体素 4 字节）。阴影遮罩也可以使用单通道 R8 格式（每体素 1 字节）。&lt;br /&gt;
&lt;br /&gt;
因此 Volume 的字节大小 = width * height * depth * 3 * 8 + （仅当使用阴影遮罩时）width * height * depth * 4（或使用 R8 mask 时为 width * height * depth）。&lt;br /&gt;
&lt;br /&gt;
[[使用手册#Compress_volumes|可以对 Volume 启用纹理压缩]]，使其体积显著减小。&lt;br /&gt;
&lt;br /&gt;
采样 Volume 需要特殊 Shader，这些 Shader 已包含在 Bakery 中。要在自定义 Shader 中添加 Volumes，请查看 HDRP/URP 包中包含的 `BakeryVolume_float()` 函数（位于 `BakeryDecodeLightmap.hlsl`）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Light Filter ===&lt;br /&gt;
[[File:Output optimized.gif|彩色玻璃，如在 &amp;quot;Bakery Real-Time Preview&amp;quot; 中所见。Bakery lightmapper 烘焙出的结果相同。]]&lt;br /&gt;
&lt;br /&gt;
将渲染器标记为光过滤器（Light Filter）。过滤器会用其颜色着色所有直接和间接光线，类似于现实中的光学滤镜，从而实现彩色透明效果（例如彩色玻璃）。唯一的参数是用于着色的纹理。&lt;br /&gt;
&lt;br /&gt;
* 光过滤器对象仍然会像其他对象一样接收光照贴图。&lt;br /&gt;
* 过滤器不会散射或模糊光线（如需此效果，请尝试 [[Subsurface_scattering|Subsurface Scattering]] 或 [[使用手册#Backface_GI|Backface GI]]）。&lt;br /&gt;
* 过滤器可以产生带颜色的阴影。如果灯光使用 [[使用手册#Shadowmask|Shadowmask]] 模式，则结果只会保存 R 通道（因为 Unity 仅支持单通道遮罩）。对于完全烘焙的阴影，则没有限制。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Sector ===&lt;br /&gt;
参见 '''[[Partial_scene_baking|Partial scene baking]]'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Always Render ===&lt;br /&gt;
如果添加到一个物体上，Bakery 在烘焙时将始终考虑该物体，即使它的 Renderer 被禁用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
=== Bakery Pack As Single Square ===&lt;br /&gt;
如果添加到一个物体上，Bakery 会将该物体及其子物体的 UV 视为单个组合方块，在自动图集打包或 Lightmap Group 的 Pack Atlas 模式下，它们之间永远不会被移动。整个子层级将作为一个整体打包。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
=== Bakery Shared LOD UV ===&lt;br /&gt;
如果添加到一个 LODGroup 上，将标记所有同名 LOD 共享同一个光照贴图。默认情况下，每个 LOD 网格会获得独立的光照贴图，占用图集空间；但如果已知同一个物体的 LOD 拥有相似的 UV2（或者在没有 UV2 且 UV1 不重叠的情况下），它们可以映射到图集的同一部分，从而节省内存。&lt;br /&gt;
这种技术也称为 [https://github.com/laurenth-personal/LODLightmapScripts/ Lightmap Stealing]。&lt;br /&gt;
&lt;br /&gt;
= 材质兼容性 =&lt;br /&gt;
&lt;br /&gt;
=== 漫反射和发光 ===&lt;br /&gt;
Bakery 利用 [https://docs.unity3d.com/Manual/MetaPass.html Meta Pass] 系统支持大多数 Unity 材质。所有内置、Surface、URP 和 HDRP 着色器都已经定义了正确的 Meta Pass。&lt;br /&gt;
&lt;br /&gt;
如果你使用的是 Unlit 着色器，需要按照 Unity 文档手动添加 Meta Pass。&lt;br /&gt;
&lt;br /&gt;
如果未定义该 Pass，Bakery 将假定 {{codeVar|_MainTex}}、{{codeVar|_BaseColorMap}} 或 {{codeVar|_Color}}（如果未设置纹理）为材质的漫反射（Albedo），并将 {{codeVar|_EmissionMap}} 和 {{codeVar|_EmissionColor}} 作为发光颜色。&lt;br /&gt;
&lt;br /&gt;
为了使发光生效，[https://docs.unity3d.com/ScriptReference/Material-globalIlluminationFlags.html Material.globalIlluminationFlags] 必须设置为 [https://docs.unity3d.com/ScriptReference/MaterialGlobalIlluminationFlags.BakedEmissive.html MaterialGlobalIlluminationFlags.BakedEmissive]。标准着色器会自动设置此值。&lt;br /&gt;
&lt;br /&gt;
=== 不透明度 ===&lt;br /&gt;
[[File:Upload 2019-1-25 0-4-30.png|thumb|材质参数被转换为 Cutout（默认）]]&lt;br /&gt;
[[File:Alphacombos dither.jpg|thumb|通过“Dither Transparency”选项添加半透明值]]&lt;br /&gt;
[[File:Alphacombos filter.jpg|thumb|Light Filter 组件用于红色平面，生成彩色阴影]]&lt;br /&gt;
&lt;br /&gt;
默认情况下，Bakery 始终从 {{codeVar|_MainTex}}、{{codeVar|_BaseColorMap}} 或 {{codeVar|_BaseMap}} 的 alpha 值获取全分辨率的不透明度，并将其视为 Cutout（1 位透明）。&lt;br /&gt;
&lt;br /&gt;
当启用 '''Dither Transparency''' 选项时，半透明值会自动转换为可变蓝噪声，然后被滤波/模糊，产生部分透明效果（以前可以通过自定义手动抖动贴图实现，但从 v1.97 起自动完成）。&lt;br /&gt;
&lt;br /&gt;
为了使不透明度生效，着色器的 [https://docs.unity3d.com/Manual/SL-SubShaderTags.html RenderType 标签] 必须为以下值之一：&lt;br /&gt;
&lt;br /&gt;
* {{codeVar|Transparent}}&lt;br /&gt;
* {{codeVar|TransparentCutout}}&lt;br /&gt;
* {{codeVar|TreeLeaf}}&lt;br /&gt;
&lt;br /&gt;
如果存在名为 {{codeVar|_Cutoff}} 的属性，它将影响 Cutout（因此 Standard 着色器的 Cutoff 滑块会自动生效）。&lt;br /&gt;
&lt;br /&gt;
在没有 Dither Transparency 的情况下，如果材质 RenderType 为 {{codeVar|Transparent}} 或 {{codeVar|TreeLeaf}}，则 {{codeVar|_Color}} 的 alpha 值会额外修改 Cutoff：&lt;br /&gt;
''finalCutoff = 1 - (1 - cutoff) * alpha''&lt;br /&gt;
&lt;br /&gt;
对于彩色透明效果，请使用 [[使用手册#Bakery_Light_Filter|Light Filter]] 组件。&lt;br /&gt;
&lt;br /&gt;
有关漫反射半透明效果，请参考 [[#Backface GI|Backface GI]] 和 [[subsurface scattering]]。&lt;br /&gt;
&lt;br /&gt;
==== Alpha Meta Pass ====&lt;br /&gt;
从 v1.9 起，Bakery 还支持指定基于自定义着色器的透明度，但这需要使用兼容的着色器。要使用 ''Alpha Meta Pass''，需要执行以下步骤：&lt;br /&gt;
&lt;br /&gt;
* 在着色器中添加一个名为 '''BAKERY_META_ALPHA_ENABLE''' 的属性。例如：&lt;br /&gt;
  {{code|&amp;lt;nowiki&amp;gt;[HideInInspector] BAKERY_META_ALPHA_ENABLE (&amp;quot;Enable Bakery alpha meta pass&amp;quot;, Float) = 1.0&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
* 确保 RenderType 标签设置为上文提到的某个值。&lt;br /&gt;
* 声明一个名为 '''META_BAKERY''' 的 Pass。&lt;br /&gt;
* 在该 Pass 中检查 '''unity_MetaFragmentControl.w''' 是否非零，如果是，则返回计算出的透明度值。&lt;br /&gt;
&lt;br /&gt;
示例可参考包内的 ''Baked_Alpha_meta.shader''。&lt;br /&gt;
&lt;br /&gt;
注意：当前 Alpha Meta Pass 需要将 Light Probe Mode 设置为 L1 或 L2。&lt;br /&gt;
&lt;br /&gt;
=== Normal mapping ===&lt;br /&gt;
自定义表面法线可以与 [[#Baked Normal Maps|烘焙法线贴图]] 模式一起使用。不幸的是，Unity 的 Meta Pass 默认不输出法线信息，因此默认情况下，法线取自名为 {{codeVar|_BumpMap}} 的贴图，并通过 {{codeVar|_MainTex_ST}} 进行额外变换。&lt;br /&gt;
&lt;br /&gt;
然而，可以制作完全自定义的着色器，带有高级法线映射功能（例如混合多层法线），并使其兼容烘焙。要实现这一点，需要执行以下步骤：&lt;br /&gt;
&lt;br /&gt;
1. 在着色器中定义一个 Meta Pass，具体方法请参考 [https://docs.unity3d.com/Manual/MetaPass.html#ExampleMetaPassUnity 文档]。&lt;br /&gt;
&lt;br /&gt;
2. 将该 Pass 命名为 {{codeVar|&amp;quot;META_BAKERY&amp;quot;}}，而不仅仅是 {{codeVar|&amp;quot;META&amp;quot;}}。&lt;br /&gt;
&lt;br /&gt;
3. 包含文件 {{codeVar|&amp;quot;BakeryMetaPass.cginc&amp;quot;}}。&lt;br /&gt;
&lt;br /&gt;
4. 添加 {{codeVar|#pragma vertex vert_bakerymt}}。&lt;br /&gt;
&lt;br /&gt;
5. 如果 {{codeVar|unity_MetaFragmentControl.z}} 变量不为 0，着色器应返回世界空间法线。返回的法线应使用 {{codeVar|BakeryEncodeNormal}} 函数编码。&lt;br /&gt;
&lt;br /&gt;
在 Assets/Bakery/examples/shaders 中包含了两个实现了扩展 Meta Pass 的示例着色器。&lt;br /&gt;
&lt;br /&gt;
你也可以复制并修改 BakeryMetaPass.cginc 以满足你的需求，例如从顶点着色器传递额外数据。&lt;br /&gt;
&lt;br /&gt;
=== 正/背面 ===&lt;br /&gt;
无论着色器使用何种剔除模式，Bakery 都将所有背面视为不透明，这意味着任何直接光线都不会穿过背面，就像它不会穿过正面一样。&lt;br /&gt;
然而，如果使用 [[使用手册#Backface_GI|Backface GI]]，背面可以部分发出正面接收到的光照。&lt;br /&gt;
&lt;br /&gt;
= 扩展 Lightmap Parameters 资源 =&lt;br /&gt;
[[File:Lp.jpg|thumb|扩展 Lightmap Parameters]]&lt;br /&gt;
类似于 Bakery 的 [[#Bakery_Lightmap_Group_Selector|Lightmap Group]]，Unity 也有 [https://docs.unity3d.com/Manual/class-LightmapParameters.html Lightmap Parameters]，可以作为资源创建并分配给 Mesh Renderer。它们的逻辑有相似之处也有不同之处：&lt;br /&gt;
&lt;br /&gt;
* Lightmap Group 的主要用途是将多个对象组合到同一个图集。此外，它还允许覆盖该图集的烘焙设置。&lt;br /&gt;
* Lightmap Parameters 主要用于覆盖对象的烘焙设置，但通过使用“Baked Tag”选项，它们也可以影响打包：具有不同 Baked Tag 的对象将永远不会共享同一个图集。&lt;br /&gt;
&lt;br /&gt;
由于有些用户更习惯 Lightmap Parameters 的工作流程，Bakery 现在支持并扩展了它们：&lt;br /&gt;
&lt;br /&gt;
* Bakery 会遵循 Baked Tag 设置。&lt;br /&gt;
* Lightmap Parameters UI 中将显示额外的 Bakery 特定选项。有关其含义，请参考 [[#Bakery_Lightmap_Group_Selector|Lightmap Group]] 部分。&lt;br /&gt;
&lt;br /&gt;
= 项目设置 =&lt;br /&gt;
一些全局设置可以在 Project Settings -&amp;gt; Bakery GPU Lightmapper 中调整（此选项仅在 Unity 2018.3 或更新版本可见；旧版本请编辑 BakeryProjectSettings.asset）：&lt;br /&gt;
&lt;br /&gt;
* Mipmap lightmaps：启用光照贴图的 mipmap。随着图集变小，可能会导致 UV 图块之间的泄漏；另一方面，它可以减少远处高分辨率光照贴图的锯齿。总体上，建议对非常远的物体使用单独烘焙的 LOD 以及较低分辨率的光照贴图。&lt;br /&gt;
* Color file format：常规 HDR 颜色光照贴图的文件格式。可选值：&lt;br /&gt;
**HDR：Radiance HDR 格式（默认）。可用多种图像编辑器打开。&lt;br /&gt;
**Asset：Unity 原生格式。可自定义 mipmap 数量。&lt;br /&gt;
* Mask/Direction file format：额外 LDR 地图的格式，如阴影遮罩或方向数据。可选值：&lt;br /&gt;
**TGA：8 位 Targa（默认）。&lt;br /&gt;
**PNG：8 位 PNG。通常比 TGA 占用更少磁盘空间。&lt;br /&gt;
**Asset：Unity 原生格式。可自定义 mipmap 数量。&lt;br /&gt;
* Compress lightmaps：定义光照贴图资源的压缩行为。压缩光照贴图占用更少的显存，但可能会出现一些视觉伪影（例如色带或色斑），具体取决于压缩类型（移动端压缩问题请参见[[Troubleshooting#I_have_an_Android_project.2C_and_lightmaps_don.27t_look_good|此处]]）。可选值：&lt;br /&gt;
*** Compress but allow overriding asset: 新的光照贴图将在启用压缩的情况下创建。创建后，可以在 Inspector 中更改它们的压缩设置。修改后的值将在重新烘焙后保留（默认）。&lt;br /&gt;
*** Force compress: 始终压缩所有光照贴图。&lt;br /&gt;
*** Force no compress: 始终生成未压缩的光照贴图。&lt;br /&gt;
* High quality direction: 为方向贴图启用“高”质量压缩。实际格式取决于平台。例如在 PC 上，它会从 DXT1 改为 BC7，这提供了更高的质量，但 VRAM 使用量会翻倍。&lt;br /&gt;
* Texel padding (default atlas packer): 定义在使用默认 atlas 打包器时，在光照贴图 atlas 中对象 UV 布局之间添加多少空白 texel。&lt;br /&gt;
* Texel padding (xatlas packer): 同上，但在使用 xatlas 时。&lt;br /&gt;
* Alpha Meta Pass resolution multiplier: 乘以 [[使用手册#Alpha_Meta_Pass|Alpha Meta Pass]] 的分辨率，使在低分辨率光照贴图烘焙时仍能实现精确的基于 Shader 的切割效果。&lt;br /&gt;
* Volume render mode: 为所有 [[使用手册#Bakery_Volume|Volumes]] 使用哪种 [[使用手册#Render_mode|渲染模式]]？Auto 使用当前活动的渲染模式（默认）。&lt;br /&gt;
* Delete previous lightmaps before bake: 在烘焙新光照贴图之前，实际删除该场景中所有之前渲染的光照贴图文件。&lt;br /&gt;
* Log level: 定义烘焙过程中在控制台输出的信息量。可能的值：&lt;br /&gt;
** 0: 不输出任何内容。&lt;br /&gt;
** 1: 仅输出进度信息。&lt;br /&gt;
** 2: 仅输出警告。&lt;br /&gt;
** 3: 输出全部信息。&lt;br /&gt;
* Alternative scale in lightmap: 使渲染器属性 'Scale in Lightmap' 的行为更类似于 Unity 内置的行为。&lt;br /&gt;
* Align to texture compression blocks with xatlas: 使 xatlas 将 chart 对齐到 4x4 块边界，从而获得更适合压缩的结果。&lt;br /&gt;
* Generate smooth positions: 是否应调整采样位置以防止低多边形几何体在平滑法线下产生错误阴影？在使用法线差异极大的几何体时，可在极少数情况下禁用。技术说明见 [https://ndotl.wordpress.com/2018/08/29/baking-artifact-free-lightmaps/#shadowterm 这篇文章]。&lt;br /&gt;
* Smooth positions per-triangle: 是否应按三角形决定平滑/平面位置？在使用法线差异极大的几何体时，可在极少数情况下禁用。&lt;br /&gt;
* Use 'Receive GI' values: 在渲染器上考虑 “Receive Global Illumination” 值。最初 Bakery 会忽略它。&lt;br /&gt;
* Remove ringing in Legacy light probes: 在 Legacy 模式下启用更柔和的光探针卷积，以防止高对比度区域出现伪影。&lt;br /&gt;
* Always render reflection probes: 在每次 Render/Render Light Probes 后自动渲染反射探针。&lt;br /&gt;
* Ringing removal for L2 light probes: 对 [[使用手册#Light_probe_mode|L2 光探针]] 应用去振铃处理。值越高，探针光照越平滑；这种平滑可以减少 [[https://docs.unity3d.com/6000.2/Documentation/Manual/light-probes-troubleshooting.html](https://docs.unity3d.com/6000.2/Documentation/Manual/light-probes-troubleshooting.html) 振铃] 伪影（如果存在）。&lt;br /&gt;
* Put menu under Tools: 将 Bakery 菜单放入 Tools 菜单下。&lt;br /&gt;
&lt;br /&gt;
如果任何格式设置为 Asset 且启用 mipmapping，会显示额外选项：&lt;br /&gt;
&lt;br /&gt;
* Maximum mipmap count: 定义 mipmap 的最大数量。例如，设置为 2，则 8K 光照贴图仅有两个额外 mipmap：4K 和 2K。更低分辨率将被省略，从而在 mipmapping 过程中限制泄漏伪影。&lt;br /&gt;
&lt;br /&gt;
= SkinnedMeshRenderer 支持 =&lt;br /&gt;
Bakery 自 v1.65 起支持蒙皮网格 (skinned meshes)。但是，有一些限制：&lt;br /&gt;
&lt;br /&gt;
* 某些 Unity 版本不支持蒙皮网格的 UV1，并会悄无声息地忽略 “Generate lightmap UVs”。请确保场景中实际使用的网格具有 UV1，并在可能的情况下使用非重叠的 UV0；&lt;br /&gt;
* UV 填充调整在蒙皮网格上不起作用（Unity 在尝试调用 Unwrap 函数时似乎会崩溃）；&lt;br /&gt;
* 蒙皮网格不能使用每顶点光照贴图 (per-vertex lightmaps)（引擎不支持带蒙皮的 additionalVertexStreams）。&lt;br /&gt;
&lt;br /&gt;
= Shader Tweaks =&lt;br /&gt;
[[File:Image2.jpg|thumb|左：默认双线性过滤。右：双三次过滤。]]&lt;br /&gt;
[[File:Image34.jpg|thumb|左：两个阴影都已烘焙。&amp;lt;br&amp;gt;中：球形阴影为动态，另一个阴影为静态。通过相乘组合在一起。&amp;lt;br&amp;gt;右：与中间相同，但使用默认最小值组合。]]&lt;br /&gt;
&lt;br /&gt;
Bakery 提供可选的着色器修改，可以应用到 Unity 着色器上，以改善光照贴图采样并使实时光照更接近光照贴图效果。着色器调整菜单可以通过 Bakery-&amp;gt;Shader Tweaks 访问。&lt;br /&gt;
&lt;br /&gt;
这些选项会修补基础 Unity 着色器包含文件（来自 CGIncludes 文件夹），这些文件被大多数内置和第三方着色器使用。所有修改都会影响使用该版本编辑器打开的所有项目，但也可以轻松恢复。着色器调整会影响标准和表面着色器的工作方式。HDRP、URP 以及其他 SRP 不受影响。&lt;br /&gt;
&lt;br /&gt;
所有可用修改显示为按钮。点击按钮应用修改，按钮将保持按下状态。再次点击按钮即可移除修改。目前可用选项：&lt;br /&gt;
&lt;br /&gt;
{{note| 可能需要以管理员身份运行 Unity 编辑器以使 CGIncludes 修补生效}}&lt;br /&gt;
&lt;br /&gt;
* Use bicubic interpolation for lightmaps: 光照贴图将使用双三次插值代替默认双线性。此调整能很好地修复低分辨率光照贴图的许多锯齿边缘。目前仅适用于 DX11 和现代主机，其他平台仍使用双线性。&lt;br /&gt;
* Use multiplication for shadowmask: 使用相乘代替最小值组合静态和动态阴影。出于未知原因，Unity 默认使用最小值操作符，这会产生一些乘法不存在的伪影。&lt;br /&gt;
* Use physical light falloff (forward): 用更物理正确的平方反比替换实时点光/聚光灯的默认衰减。“Range” 只会在边缘略微淡出（与 Bakery 光源启用 Physical Falloff 复选框效果一致）。仅影响 Forward 渲染器。详情见 [[Point Light Attenuation]]。&lt;br /&gt;
* Use physical light falloff (deferred): 同上，但仅影响 Deferred 渲染器。&lt;br /&gt;
&lt;br /&gt;
'''衰减调整在 Unity &amp;gt;2017 版本上可能无法完全生效。此外，SRP 默认已经使用正确的衰减。'''&lt;br /&gt;
&lt;br /&gt;
= Bakery shaders =&lt;br /&gt;
Bakery 包含了自带着色器，支持顶点光照贴图，以及 RNM 和 SH 方向模式。它还允许从方向数据计算近似烘焙高光。&lt;br /&gt;
对于普通颜色光照贴图、阴影遮罩和 Dominant Direction 模式，Bakery 着色器 '''不是必需的'''，因为这些功能大多数 Unity 着色器本身已经支持。&lt;br /&gt;
&lt;br /&gt;
=== Standard render pipeline ===&lt;br /&gt;
'''Bakery/Standard''': 扩展了普通 Standard 着色器。额外选项：&lt;br /&gt;
&lt;br /&gt;
* Allow Vertex Lightmaps: 允许该材质用于 [[Vertex Lightmaps|顶点光照贴图]]。&lt;br /&gt;
* Allow RNM Lightmaps: 允许该材质用于 [[#RNM|RNM 方向模式]]。&lt;br /&gt;
* Allow SH Lightmaps: 允许该材质用于 [[#SH|SH 方向模式]]。&lt;br /&gt;
  {{note| 所有 “Allow” 选项会在着色器中启用特定的代码路径。为了性能考虑，建议每个材质仅使用一个 “allow” 选项。}}&lt;br /&gt;
* Enable Lightmap Specular: 使用 Dominant Direction、RNM 或 SH 方向模式的数据计算烘焙高光。注意，由于信息有限，该效果仅为近似。如果你曾在 Unity 4 中使用烘焙高光，效果应可比。与高度扰动的法线贴图搭配效果最佳，在平面表面上效果不佳。&lt;br /&gt;
* Enable VertexLM directional: 如果存在顶点光照贴图，指定 Dominant Direction 数据存储在顶点中并应被使用。&lt;br /&gt;
* Enable VertexLM SH: 如果存在顶点光照贴图，指定 SH 数据存储在顶点中并应被使用。&lt;br /&gt;
* Enable VertexLM Shadowmask: 如果存在顶点光照贴图，指定阴影遮罩存储在顶点中并应被使用。&lt;br /&gt;
* Enable MonoSH: 将方向贴图视为 MonoSH 贴图。&lt;br /&gt;
[[File:Image5.png|thumb|Standard SH light probe vs non-linear]]&lt;br /&gt;
[[File:Shspec.jpg|thumb|SH specular effect]]&lt;br /&gt;
* Non-linear SH：在 SH 方向模式下，此选项可以增强对比度（更接近真实效果），但会使着色器稍微变慢。该技巧基于 Geomerics 的论文《[https://drive.google.com/file/d/1MK6Clw93q8ljijRjb4gQOzzaIjn1uF9Y/view Reconstructing Diffuse Lighting from Spherical Harmonic Data]》。&lt;br /&gt;
* Non-linear Light Probe SH：与 Non-linear SH 类似，但用于光照探针。在探针的情况下，最显著的好处是消除错误的负值。这种问题常见于具有高对比度、明亮 HDR 光源的场景中。这是球谐函数的固有限制，而不是 Bakery 特有的问题（即使用 Unity 内置光照贴图器也可能出现类似伪影）。&lt;br /&gt;
* Force Bicubic Filter：为所有附加贴图启用双三次滤波。若要实现完整的双三次滤波（包括第一张颜色贴图），建议同时在 [[#Shader Tweaks|Shader Tweaks]] 中启用该功能。&lt;br /&gt;
&lt;br /&gt;
'''Bakery/Standard Specular'''：与 Standard 相同，但用于高光（Specular）工作流程。&lt;br /&gt;
&lt;br /&gt;
=== HDRP &amp;amp; URP ===&lt;br /&gt;
要提取额外的 HDRP/URP 着色器，请打开 Bakery 自带的 Bakery_ShaderGraphHDRP.unitypackage 或 Bakery_ShaderGraphURP.unitypackage。&lt;br /&gt;
在其中，你会找到可在自己 Shader Graph 中使用的 Shader Subgraph，以及一些示例材质。&lt;br /&gt;
&lt;br /&gt;
=== 各着色器功能支持对比 ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! 大多数 Unity 着色器&lt;br /&gt;
! 大多数 HDRP 和 URP 着色器&lt;br /&gt;
! Bakery Standard&lt;br /&gt;
! Bakery HDRP graphs&lt;br /&gt;
! Bakery URP graphs&lt;br /&gt;
|-&lt;br /&gt;
| HDR color lightmaps&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Shadowmask&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是 (&amp;gt;= URP 10.1)&lt;br /&gt;
|-&lt;br /&gt;
| Dominant Direction&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| RNM&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| SH&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Mo否SH&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Lightmap specular&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持 Dominant Direction 和 SH&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持 Dominant Direction&lt;br /&gt;
|-&lt;br /&gt;
| Bicubic filtering&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是,&lt;br /&gt;
通过 [[#Shader Tweaks|Shader Tweaks]] 支持&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是,&lt;br /&gt;
通过 [[#Shader Tweaks|Shader Tweaks]] 支持&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
|-&lt;br /&gt;
| Vertex lightmaps&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 单一颜色，没有每顶点 SH、方向或阴影遮罩（Shader Graph 限制）&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 单一颜色，没有每顶点 SH、方向或阴影遮罩（Shader Graph 限制）&lt;br /&gt;
|-&lt;br /&gt;
| Non-Linear Light Probes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Volumes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Volume shadowmask&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Compressed volumes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{note| 除了普通颜色光照贴图之外，所有功能都至少需要 Shader Model 3.0 才能运行。}}&lt;br /&gt;
{{note| 使用 SH 模式的顶点光照贴图由于插值器数量限制，至少需要 Shader Model 4.0。}}&lt;br /&gt;
{{note| 含有从 Dominant Direction 生成高光的更新版 URP 图表可在 [[Bakery_-_GPU_Lightmapper|主维基页面]] 下载。}}&lt;br /&gt;
&lt;br /&gt;
另请参阅：[[Integrating_Bakery_shader_features_to_custom_shaders| 将 Bakery 着色器特性集成到自定义着色器中]]&lt;br /&gt;
&lt;br /&gt;
= 关于 HDRP/URP 的说明 =&lt;br /&gt;
将该插件导入到 HDRP 或 URP 项目后，一般即可直接使用，但需要注意以下几点：&lt;br /&gt;
&lt;br /&gt;
* 示例场景中同时使用了普通 Standard 着色器以及部分 “Bakery Standard” 着色器。HDRP 和 URP 提供了将项目着色器从 Standard 升级到 Lit 的机制，但无法从 Bakery Standard 升级。请将 Bakery Standard 材质替换为来自 Bakery_ShaderGraphHDRP.unitypackage 或 Bakery_ShaderGraphURP.unitypackage 中的材质。&lt;br /&gt;
&lt;br /&gt;
* 在 HDRP 中，默认 HDRI 天空亮度较高（11），且天空反射默认不会被遮蔽。再加上默认的自动曝光，可能导致某些示例场景几乎不可见，因为它们使用了更低的亮度进行烘焙。此时可将 HDRI 天空亮度降低到 1。HDRI 设置通常位于 Assets/HDRPDefaultResources/DefaultSettingsVolumeProfile 中。&lt;br /&gt;
&lt;br /&gt;
* 在 HDRP 中，如果示例场景中的灯光过亮，可在 Bakery 灯光组件上点击 “match real-time to lightmapped” 按钮。&lt;br /&gt;
&lt;br /&gt;
* 在 HDRP 中建议使用 OpenImageDenoise 2（最佳）或 OptiX 7 去噪器，因为它们对高亮度值更适合。&lt;br /&gt;
&lt;br /&gt;
* 在 HDRP 中，“distance” 与普通 Shadowmask 的切换可直接在 Light 组件上完成，而不是在全局设置中。&lt;br /&gt;
&lt;br /&gt;
* 不要在 Skylight 上使用 “match” 按钮，因为 HDRP 使用的是非常特定的程序化天空着色器。请改为将其烘焙为 HDRI [[How_do_I...#How_do_I_use_Skylight_with_a_procedural_sky_shader.3F|这种方式]]。&lt;br /&gt;
&lt;br /&gt;
* 建议在使用 HDRP 时始终将 Light Probe Mode 设置为 L2 或 L1，因为 HDRP 的渲染器并未针对 Legacy 模式进行优化。&lt;br /&gt;
&lt;br /&gt;
* 最新版本的 HDRP/URP 自带自己的 IES 文件导入器。由于资源类型不匹配，Unity 会将旧版本 Bakery IES 灯光断开连接，使其显示为普通点光源。它们可以重新连接并重新保存。&lt;br /&gt;
&lt;br /&gt;
Bakery 的示例场景是为内置渲染管线设计的，因此在 HDRP/URP 中正确渲染它们需要一些步骤。以下是一些提示；假设新建项目使用默认的 HDRP/URP 设置：&lt;br /&gt;
&lt;br /&gt;
=== 在 HDRP 中查看示例场景 ===&lt;br /&gt;
&lt;br /&gt;
* 导入 Bakery 后，将标准材质升级为 HDRP：Edit-&amp;gt;Rendering-&amp;gt;Materials-&amp;gt;Convert All Built-in Materials To HDRP。&lt;br /&gt;
* 将 Bakery_ShaderGraphHDRP.unitypackage 导入项目，因为它包含实现高级 Bakery 功能的特殊 Shader Graph（对于经典颜色/方向/遮罩光照贴图不需要）。&lt;br /&gt;
* 选择 DefaultSettingsVolumeProfile.asset。在 HDRI Sky 部分，将 Exposure Compensation 设置为 1。否则，与示例场景相比，默认 HDRP 会过亮，因曝光调整而使场景看起来很暗。&lt;br /&gt;
* 选择示例场景中的灯光时，HDRP 会初始化其自身的灯光数据。有时会导致灯光立即变得更亮。点击 “Match real-time to lightmapped” 以同步。&lt;br /&gt;
* 在渲染光探针前，将 Light Probe Mode 设置为 L2。&lt;br /&gt;
* '''example_directional''': 将 Shader 更改为 BakeryDirSpecGraph 以查看烘焙高光（或仅使用常规 HDRP/Lit 用于仅漫反射法线映射）。删除球体，因为当前没有支持逐顶点方向的 Shader Graph。&lt;br /&gt;
* '''example_directional_MonoSH''': 将 Shader 更改为 BakerySpecMonoSHGraph（或 BakeryMonoSHGraph，用于没有高光的略微低成本版本）。删除球体，因为当前没有支持逐顶点 MonoSH 的 Shader Graph。&lt;br /&gt;
* '''example_RNM''': 将 Shader 更改为 BakeryRNMGraph。&lt;br /&gt;
* '''example_SH''': 将 Shader 更改为 BakerySpecSHGraph（或 BakerySHGraph，用于没有高光的略微低成本版本）。删除球体，因为当前没有支持逐顶点 SH 的 Shader Graph。&lt;br /&gt;
* '''example_mixed_directional_mode''': 对 MonoSH/RNM/SH 平面，同样需要不同的 Graph。&lt;br /&gt;
* '''example_lights''': 将顶点光照球体的 Shader 更改为 BakeryVertexColorGraph。&lt;br /&gt;
* '''example_prefabs_bake''': 无需进一步调整。&lt;br /&gt;
* '''example_sectors''': 无需进一步调整。&lt;br /&gt;
* '''example_shadowmask''': 选择 DirectLight 并点击 “Match real-time to lightmapped” 修正亮度。将所有 HDRP 灯光的 Shadowmask Mode 设置为 Shadowmask。&lt;br /&gt;
* '''example_sponza_day''': 将 OpenImageDenoise 2（或 Optix 7，如果不支持）设置为首选去噪器。&lt;br /&gt;
* '''example_sponza_evening''': 将 OpenImageDenoise 2（或 Optix 7，如果不支持）设置为首选去噪器。&lt;br /&gt;
* '''example_subtractive''': HDRP 不支持减法模式。&lt;br /&gt;
* '''example_volumes_simple''': 将火车 Shader 更改为 BakeryVolumeSpecGraph（或 BakeryVolumeGraph，用于没有高光的略微低成本版本）。&lt;br /&gt;
* '''example_volumes_simple_shadowmask''': HDRP 当前不支持 Shadowmask Volumes。&lt;br /&gt;
* '''example_volumes_advanced''': 与 example_volumes_simple 相同。&lt;br /&gt;
* '''example_translucency''': 场景大部分应显示正常。对于 “Dynamic sphere lit by volume”，将 Shader 设置为 BakeryVolumeGraph。&lt;br /&gt;
&lt;br /&gt;
=== 在 URP 中查看示例场景 ===&lt;br /&gt;
&lt;br /&gt;
* 导入 Bakery 后，将标准材质升级为 URP：打开 Assets/Bakery/examples/content，输入 &amp;quot;t:material&amp;quot; 选择所有材质，并仅在 &amp;quot;content&amp;quot; 文件夹下搜索。点击 Edit-&amp;gt;Rendering-&amp;gt;Materials-&amp;gt;Convert Selected Built-in Materials To URP。&lt;br /&gt;
* 将 Bakery_ShaderGraphURP.unitypackage 导入项目，因为它包含实现高级 Bakery 功能的特殊 Shader Graph（对于经典颜色/方向/遮罩光照贴图不需要）。&lt;br /&gt;
* '''example_directional''': 将 Shader 更改为 BakeryURPLit，启用 &amp;quot;Bakery Lightmapped Specular&amp;quot;（或者仅保持常规 URP/Lit 用于仅漫反射法线映射）。删除球体，因为当前没有支持逐顶点方向的 Shader Graph。&lt;br /&gt;
* '''example_directional_MonoSH''': 将 Shader 更改为 BakeryURPLit，将 Bakery Mode 设置为 MonoSH，启用 &amp;quot;Bakery Lightmapped Specular&amp;quot;。在顶点光照球体上也启用 &amp;quot;Per-vertex&amp;quot;。&lt;br /&gt;
* '''example_RNM''': 将 Shader 更改为 BakeryURPLit，将 Bakery Mode 设置为 RNM，启用 &amp;quot;Bakery Lightmapped Specular&amp;quot;。&lt;br /&gt;
* '''example_SH''': 将 Shader 更改为 BakeryURPLit，将 Bakery Mode 设置为 SH，启用 &amp;quot;Bakery Lightmapped Specular&amp;quot;。删除球体，因为当前没有支持逐顶点 SH 的 Shader Graph。&lt;br /&gt;
* '''example_mixed_directional_mode''': 类似地使用 BakeryURPLit 并设置不同的 Bakery Mode（MonoSH、RNM、SH）。非方向性/主方向/烘焙法线贴图可使用常规 URP/Lit。&lt;br /&gt;
* '''example_lights''': 无需进一步调整。&lt;br /&gt;
* '''example_prefabs_bake''': 无需进一步调整。&lt;br /&gt;
* '''example_sectors''': 无需进一步调整。&lt;br /&gt;
* '''example_shadowmask''': 类似于 Built-in 渲染管线，在 Bakery 窗口（或项目 Quality Settings）中取消选中 Distance Shadowmask，以在摄像机附近查看实际烘焙/实时阴影混合效果。&lt;br /&gt;
* '''example_sponza_day''': 在植被材质上启用 alpha clipping。&lt;br /&gt;
* '''example_sponza_evening''': 同 example_sponza_day。&lt;br /&gt;
* '''example_subtractive''': 无需进一步调整。&lt;br /&gt;
* '''example_volumes_simple''': 将火车 Shader 更改为 BakeryURPLit，并将 Bakery Mode 设置为 Volume。可选启用 &amp;quot;Bakery Lightmapped Specular&amp;quot;。&lt;br /&gt;
* '''example_volumes_simple_shadowmask''': 与 example_volumes_simple 相同，但也启用 &amp;quot;Volume Shadowmask&amp;quot;。&lt;br /&gt;
* '''example_volumes_advanced''': 与 example_volumes_simple 相同。&lt;br /&gt;
* '''example_translucency''': 场景大部分应显示正常。对于 &amp;quot;Dynamic sphere lit by volume&amp;quot;，将 Shader 设置为 BakeryURPLit 并将 Bakery Mode 设置为 Volume。&lt;br /&gt;
&lt;br /&gt;
= 升级 Bakery =&lt;br /&gt;
在升级该资源时，建议遵循以下步骤：&lt;br /&gt;
&lt;br /&gt;
* 关闭 Bakery 窗口。&lt;br /&gt;
* 关闭 Unity。&lt;br /&gt;
* 重新打开 Unity。&lt;br /&gt;
* 导入更新后的包。&lt;br /&gt;
&lt;br /&gt;
请注意，如果不先关闭 Unity，导入可能会失败，因为 DLL 文件被锁定（会出现类似 &amp;quot;alphabuffergen.dll: Access is denied.&amp;quot; 的提示）。&lt;br /&gt;
&lt;br /&gt;
如果你移动过 Bakery 文件夹（Assets/Bakery 和 Assets/Editor/x64/Bakery）到其他位置，可能需要在更新前将它们移回原处，以避免出现两个冲突的包副本。&lt;br /&gt;
&lt;br /&gt;
= 脚本 API =&lt;br /&gt;
&lt;br /&gt;
== 基本用法 ==&lt;br /&gt;
&lt;br /&gt;
获取并修改渲染设置：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ftLightmapsStorage storage = ftRenderLightmap.FindRenderSettingsStorage();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
可以在 ftLightmapsStorage.cs 中查看可用设置的完整列表。&lt;br /&gt;
&lt;br /&gt;
获取 lightmapper 实例并（重新）加载设置：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap bakery = ftRenderLightmap.instance != null ? ftRenderLightmap.instance : new ftRenderLightmap();&lt;br /&gt;
bakery.LoadRenderSettings();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
渲染光照贴图（如果设置为 L1 或 L2 模式，也会渲染探针）：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;bakery.RenderButton(bool showMsgWindows)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
仅渲染光探针：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;bakery.RenderLightProbesButton(bool showMsgWindows)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
仅渲染反射探针：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;bakery.RenderReflectionProbesButton(bool showMsgWindows)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''showMsgWindows''' 指示是否可以显示任何对话框/确认框。如果设置为 false，则抑制显示。&lt;br /&gt;
&lt;br /&gt;
检查烘焙是否正在进行：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.bakeInProgress&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
使用示例请参考 [[Community_extensions#Batch_scene_baker|Batch Scene Baker]] 脚本。&lt;br /&gt;
&lt;br /&gt;
== 额外函数 ==&lt;br /&gt;
&lt;br /&gt;
将一个 ftLightmapsStorage 的所有渲染设置复制到另一个：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmapsStorage.CopySettings(ftLightmapsStorage src, ftLightmapsStorage dest)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
获取全局（每项目）存储对象：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftGlobalStorage gstorage = ftLightmaps.GetGlobalStorage()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
将 ftLightmapsStorage（每场景）的所有渲染设置复制到 ftGlobalStorage（每项目）：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmapsStorage.CopySettings(ftLightmapsStorage src, ftGlobalStorage dest)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
将 ftGlobalStorage（每项目）的所有渲染设置复制到 ftLightmapsStorage（每场景）：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmapsStorage.CopySettings(ftGlobalStorage src, ftLightmapsStorage dest)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
获取包含 Bakery 二进制文件的文件夹路径：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmaps.GetEditorPath()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 额外变量 ==&lt;br /&gt;
&lt;br /&gt;
获取当前临时文件路径（必须先创建 ftRenderLightmap 实例）：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.scenePath&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
获取/设置 UVGBuffer 数据压缩（启用时为 LZ4，否则为 DDS）：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.compressedGBuffer&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
获取/设置输出光照贴图数据压缩（启用时为 LZ4，否则为 DDS）：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.compressedOutput&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 事件 ==&lt;br /&gt;
&lt;br /&gt;
脚本可以订阅 ftRenderLightmap 类中的静态事件。&lt;br /&gt;
&lt;br /&gt;
在完整渲染前调用：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnPreFullRender&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
在 Legacy 光探针模式下，每渲染一个光探针前调用。ProbeEventArgs 是一个结构体，包含 '''pos''' 字段表示当前光探针的位置：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler&amp;lt;ProbeEventArgs&amp;gt; OnPreRenderProbe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
在 Legacy 光探针渲染完成后调用：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnFinishedProbes&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
在完整渲染完成后调用：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnFinishedFullRender&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
在反射探针渲染前调用：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnPreReflectionProbeRender&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
在反射探针渲染完成后调用：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnFinishedReflectionProbes&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mr F</name></author>
		
	</entry>
	<entry>
		<id>https://geom.io/bakery/wiki/index.php?title=%E4%BD%BF%E7%94%A8%E6%89%8B%E5%86%8C&amp;diff=1837</id>
		<title>使用手册</title>
		<link rel="alternate" type="text/html" href="https://geom.io/bakery/wiki/index.php?title=%E4%BD%BF%E7%94%A8%E6%89%8B%E5%86%8C&amp;diff=1837"/>
		<updated>2025-11-07T10:58:57Z</updated>

		<summary type="html">&lt;p&gt;Mr F: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:fdlm1200x630.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[https://geom.io/bakery/wiki/index.php?title=Manual (Click for English version)]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 系统要求 ==&lt;br /&gt;
&lt;br /&gt;
使用 Bakery 需要：&lt;br /&gt;
&lt;br /&gt;
Windows（7 或更高版本）电脑。&lt;br /&gt;
&lt;br /&gt;
Nvidia 显卡。最低支持型号为 Kepler（GeForce 650 或更新型号，Quadro 显卡请查看规格）。&lt;br /&gt;
&lt;br /&gt;
64 位 Unity 编辑器。Bakery 已在 5.6 到 6 及更高版本上测试过，同时也在 Tuanjie 1.6.7 上通过测试。&lt;br /&gt;
&lt;br /&gt;
{{note|系统要求仅适用于开发者的电脑，而非目标平台。使用 Bakery 烘焙的光照贴图可以在任何地方使用。}}&lt;br /&gt;
&lt;br /&gt;
== 前提条件 ==&lt;br /&gt;
* 确保你的项目中没有任何脚本编译错误，否则也会导致 Bakery 的脚本无法编译。&lt;br /&gt;
* 确保你的显卡驱动是最新版本，如有需要请[https://www.nvidia.com/Download/index.aspx?lang=en-US 更新]。&lt;br /&gt;
&lt;br /&gt;
'''请使用 Game-Ready（标准）驱动程序，而不是 “Studio” 驱动。'''&lt;br /&gt;
&lt;br /&gt;
== 安装 ==&lt;br /&gt;
&lt;br /&gt;
1. 通过 [https://assetstore.unity.com/packages/tools/level-design/bakery-gpu-lightmapper-122218 Asset Store] 将 Bakery 导入到你的项目中。&lt;br /&gt;
&lt;br /&gt;
2. Unity 会显示要导入的文件列表。如果这是你第一次使用 Bakery，建议直接 点击 Import（导入）。有经验的用户可以取消选中 examples 文件夹，以进行更轻量的安装。&lt;br /&gt;
&lt;br /&gt;
文件将被导入到 `Assets/Bakery` 和 `Assets/Editor/x64/Bakery` 文件夹中。&lt;br /&gt;
这些文件夹之后可以移动。&lt;br /&gt;
&lt;br /&gt;
3. Unity 随后会导入 Bakery 并编译脚本。此时可能会弹出如下窗口：&lt;br /&gt;
&lt;br /&gt;
[[File:Goahead.png]]&lt;br /&gt;
&lt;br /&gt;
此时你应点击 “Go Ahead”（继续）。&lt;br /&gt;
&lt;br /&gt;
现在你应该能在编辑器中看到新增的 Bakery 菜单：&lt;br /&gt;
&lt;br /&gt;
[[File:bmenu.jpg]]&lt;br /&gt;
&lt;br /&gt;
== 快速开始 ==&lt;br /&gt;
&lt;br /&gt;
1. 添加一些模型或基础体，并将其标记为静态（Static）。&lt;br /&gt;
&lt;br /&gt;
'''用于光照贴图的网格必须具有不重叠的 UV2。如果存在 UV2，则会使用 UV2（否则使用 UV1）。如果你的模型没有为光照贴图进行展开，请在资源中勾选 Generate Lightmap UVs（生成光照贴图 UV）。'''&lt;br /&gt;
Unity 的基础体已经具有正确的 UV2。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Staticmarked.jpg|320px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. 选择方向光（Unity 为你创建的那个），并添加 '''Bakery Direct Light''' 组件。&lt;br /&gt;
   {{note|Bakery 和 Unity 使用独立的光源组件。}}&lt;br /&gt;
&lt;br /&gt;
3. Bakery Direct Light 有许多可调选项，但你可以轻松将其与 Unity 光源匹配。点击 '''Match lightmapped to real-time'''。现在 Bakery 光源的颜色应与 Unity 默认的方向光相同，呈黄色调。&lt;br /&gt;
&lt;br /&gt;
[[File:Matching.jpg|640px]]&lt;br /&gt;
&lt;br /&gt;
{{note|Direct Light 组件可能会提示项目未使用线性光强度。问题在于，Unity 默认会对光源颜色应用伽马校正 [https://twitter.com/guycalledfrank/status/1001108508614553600 不正确]。&lt;br /&gt;
可以通过[https://docs.unity3d.com/ScriptReference/Rendering.GraphicsSettings-lightsUseLinearIntensity.html 脚本]启用正确模式。&lt;br /&gt;
这就是 “Fix” 按钮的作用。如果你已经在非线性光强模式下设置了许多光源，并且不想再次更改它们，可以跳过修复。即使你按了 “Fix”，也可以随时撤销此更改。&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. 要获得带阴影的环境光，请创建 Skylight（Bakery-&amp;gt;Create-&amp;gt;Skylight）。&lt;br /&gt;
&lt;br /&gt;
[[File:Menusky.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. 选择 Skylight，为它设置一些偏蓝的颜色，然后点击 '''Match scene skybox to this light'''。   这将使场景的 skybox 与光照完全匹配。&lt;br /&gt;
   {{note|将 Unity 的 skybox 与 Bakery Skylight 匹配是可选的，但对正确性很有用，可以确保可见环境和引擎内的反射探针与烘焙光照一致。目前此选项仅适用于 Standard 渲染管线。}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Skycomp.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. 点击 Bakery-&amp;gt;Render Lightmap。默认情况下，Full Lighting 模式是激活的。它会烘焙所有光源的直接和间接光照贡献。如果你想将实时阴影与烘焙全局光照（GI）结合使用，请将模式更改为 '''Indirect'''。&lt;br /&gt;
&lt;br /&gt;
[[File:Bakerywindow.jpg]]&lt;br /&gt;
&lt;br /&gt;
{{note| Bakery 可能会提示你正在使用旧的 [https://docs.unity3d.com/Manual/LinearLighting.html gamma mode]。如果你在意光照质量，强烈建议使用线性模式。如果你的项目已经在错误的伽马模式下设置好了，并且不想更改，或者是发布到不支持线性模式的移动设备上，也可以忽略此提示。}}&lt;br /&gt;
&lt;br /&gt;
7. 点击 '''Render'''。&lt;br /&gt;
&lt;br /&gt;
8. 完成！现在你应该已经得到烘焙的全局光照（GI）：&lt;br /&gt;
&lt;br /&gt;
[[File:Bakedgi.jpg]]&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 ==&lt;br /&gt;
&lt;br /&gt;
所有渲染设置都可以通过 Bakery-&amp;gt;Render Lightmap 访问。设置会为每个场景单独保存。Bakery 窗口顶部的选项允许你在 Simple（简单）、Advanced（高级）和 Experimental（实验）设置之间切换，每个后续模式都会显示更多可调选项。对于大多数场景，Simple 模式已经足够，是入门的好方法。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render mode ===  &lt;br /&gt;
定义要烘焙的光照贴图类型。  &lt;br /&gt;
&lt;br /&gt;
===== Full Lighting =====&lt;br /&gt;
烘焙所有 Bakery 光源的完整直接光和间接光。&lt;br /&gt;
{{note|在 2017.3 之前的 Unity 版本中，如果同一对象上同时有 Unity 和 Bakery 组件，你需要手动禁用 Unity 组件以避免亮度加倍。在较新版本中，实时效果会自动对烘焙光源禁用，就像内置光照烘焙器一样。}}&lt;br /&gt;
&lt;br /&gt;
===== Indirect =====&lt;br /&gt;
[[File:Image26.png|thumb|Unity 支持的不同渲染模式对比]]&lt;br /&gt;
基础混合模式。它会查看每个光源上的 Baked Contribution 选择器：如果设置为 ''Direct And Indirect''，则光源会像在 Full Lighting 模式下一样被烘焙。如果设置为 ''Indirect Only''，则只会烘焙该光源的间接光照（GI）。在后一种情况下，你应保持对象上的 Unity 光源和 Bakery 光源同时存在，一个提供实时直接光照，另一个提供预计算的全局光照（GI）。&lt;br /&gt;
&lt;br /&gt;
[[File:Indirectonly.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== Shadowmask =====&lt;br /&gt;
[[File:Image21.png|thumb|左：完全烘焙的光照。中：动态光源 + 烘焙 GI。右：胶囊形阴影、凹凸贴图和高光为动态光照，但立方体阴影和 GI 为烘焙光照。]]&lt;br /&gt;
[[File:Image6.png|thumb|当相机足够远离场景，或者动态阴影被禁用时，场景将呈现如下效果]]&lt;br /&gt;
更高级的混合模式。它通过生成两种类型的光照贴图来工作——一种包含烘焙颜色（如 Indirect 模式），另一种包含静态物体的阴影。它有几个优点：&lt;br /&gt;
* 实时阴影只需渲染少量动态对象，而不是整个场景。&lt;br /&gt;
* 实时阴影与烘焙阴影可以正确融合。&lt;br /&gt;
* 实时光源可以渲染凹凸贴图、高光和其他表面效果，同时仍会被高质量烘焙阴影遮挡。&lt;br /&gt;
[https://docs.unity3d.com/Manual/LightMode-Mixed-Shadowmask.html 更多详情]&lt;br /&gt;
&lt;br /&gt;
要启用此行为，你必须在同一对象上同时存在 Unity 光源和 Bakery 光源，并将 Baked Contribution 设置为 ''Shadowmask and Indirect''。未标记的光源将按 Indirect 模式进行烘焙。&lt;br /&gt;
&lt;br /&gt;
[[File:Smask22.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== Distance Shadowmask =====&lt;br /&gt;
此复选框仅在你选择 Shadowmask 时可见，并且只是切换项目 [https://docs.unity3d.com/Manual/LightMode-Mixed-ShadowmaskMode.html Quality Settings] 中同名的设置。&lt;br /&gt;
[https://docs.unity3d.com/Manual/LightMode-Mixed-DistanceShadowmask.html 更多详情]&lt;br /&gt;
{{note|由于缺少对应的脚本 API，该复选框在 Unity 5.6.x 上不可见。你可以在 Window-&amp;gt;Lighting-&amp;gt;Mixed Lighting-&amp;gt;Lighting Mode 中切换该设置。}}&lt;br /&gt;
{{note|在 Unity 版本 &amp;lt; 2017.3 中，由于 API 限制，渲染 Shadowmask 光照贴图会清除光照探针。烘焙后需要重新渲染光照探针。在较新版本中不应发生此问题。}}&lt;br /&gt;
&lt;br /&gt;
===== Subtractive =====&lt;br /&gt;
&lt;br /&gt;
启用 [https://docs.unity3d.com/Manual/LightMode-Mixed-Subtractive.html Subtractive] 光照模式。&lt;br /&gt;
&lt;br /&gt;
此选项对光照贴图本身没有任何特殊作用，实际上它的工作方式与 Full Lighting 相同。&lt;br /&gt;
&lt;br /&gt;
唯一的区别是，它还会将实时 Unity 光源设置为与 Subtractive 模式兼容（因为无法通过 UI 完成此操作）。&lt;br /&gt;
&lt;br /&gt;
你还需要在 [https://docs.unity3d.com/Manual/GlobalIllumination.html#MixedLighting Unity Lighting] 窗口中额外设置全局减法参数（例如全局阴影颜色）。&lt;br /&gt;
&lt;br /&gt;
===== Ambient Occlusion Only =====&lt;br /&gt;
仅烘焙环境光遮蔽（AO）。如果你很清楚自己在做什么，这可能会有用。请确保设置 [[#Ambient_occlusion|AO 选项]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Directional mode ===&lt;br /&gt;
[[File:Image3.png|thumb|不同方向模式的对比]]&lt;br /&gt;
定义了方向信息的烘焙方式。标准光照贴图每个像素只存储单一颜色，而方向光照贴图为着色器提供了关于该像素周围半球内光照变化的提示。这些数据用于在完全烘焙的区域中结合法线贴图。如果将其应用到内置的 [[#Bakery_shaders|Bakery]] 着色器中，还可以产生**近似高光反射**效果。&lt;br /&gt;
&lt;br /&gt;
===== None =====&lt;br /&gt;
不包含方向数据，每个像素仅有单一颜色。&lt;br /&gt;
&lt;br /&gt;
===== Baked Normal Maps =====&lt;br /&gt;
依然没有方向数据，但在渲染光照贴图时会考虑法线贴图。此方式在运行时没有额外开销。由于光照贴图的分辨率通常低于法线贴图，结果可能显得模糊。其他问题包括：由于缺乏 mipmapping，远处可能出现锯齿，以及降噪步骤可能导致细节被涂抹。要了解如何在此模式下使用具有程序化法线的自定义着色器，请参阅 [[#Normal_mapping|Normal Mapping]] 章节。&lt;br /&gt;
&lt;br /&gt;
===== Dominant Direction =====&lt;br /&gt;
此模式类似于 Unity 中 Enlighten 和 Progressive 烘焙器的实现。它与大多数着色器兼容，仅生成一张额外的贴图，运行时开销极小。缺点是凹凸贴图的效果较弱，略显灰暗，与实时光照下的同一物体相比可能差异较大。&lt;br /&gt;
&lt;br /&gt;
===== RNM =====&lt;br /&gt;
基于最初为《Half-Life 2》开发的 [https://steamcdn-a.akamaihd.net/apps/valve/2004/GDC2004_Half-Life2_Shading.pdf Radiosity Normal Mapping] 技术（相关演示文稿），后来被许多游戏采用（如《Mirror's Edge》）。此模式总共生成三张 HDR 贴图，是内存占用最高的模式之一，但运行时开销仍相对较低。该模式比 Dominant Direction 更精确，能更好地再现表面反差，并能正确处理来自不同角度、具有不同颜色的光照对法线贴图的影响。&lt;br /&gt;
&lt;br /&gt;
===== SH =====&lt;br /&gt;
基于论文《[https://media.contentapi.ea.com/content/dam/eacom/frostbite/files/gdc2018-precomputedgiobalilluminationinfrostbite.pdf Precomputed Global Illumination in Frostbite]》。这是最高质量的模式，能提供更好的表面对比度，并准确表现来自不同方向、不同颜色的光照。总共生成四张贴图，其中仅一张为 HDR，因此比 RNM 占用更少内存。运行时开销略高于 RNM。&lt;br /&gt;
&lt;br /&gt;
===== MonoSH =====&lt;br /&gt;
[[File:FY8Ru8hWIAAdYYH.jpg|thumb|Dominant Direction、完整 SH 与 MonoSH 的尺寸/质量对比]]&lt;br /&gt;
与 SH 类似，但使用单色的 L1 方向系数。表面对比度同样良好，虽然无法准确表现来自不同方向的不同颜色光照，但对多数场景来说已经足够。仅生成一张额外贴图，因此显存占用与带宽需求与 Dominant Direction 相近；事实上更低，因为 Dominant Direction 使用 RGBA 贴图，而 MonoSH 只需 RGB。该贴图通过内置的方向光照贴图系统传递，但''在标准着色器下显示不正确''。请务必使用兼容的着色器。&lt;br /&gt;
&lt;br /&gt;
===== 限制 =====&lt;br /&gt;
&lt;br /&gt;
* RNM 和 SH/MonoSH 只能与 [[#Bakery_shaders|Bakery shader]] 一起使用，或者需要对你的着色器进行调整。&lt;br /&gt;
* 在 RNM 和 SH 模式下，不会生成标准的颜色光照贴图。你需要确保场景中所有材质都使用 Bakery Shader，或者使用 [[#Bakery_Lightmap_Group_Selector|Lightmap Groups]] 将 RNM/SH 对象与其他对象分开。&lt;br /&gt;
* RNM 和 SH 贴图是通过 [https://docs.unity3d.com/ScriptReference/MaterialPropertyBlock.html MaterialPropertyBlock] 应用于对象的，因此在 Unity 的 Lighting 窗口中可能无法完全显示。&lt;br /&gt;
* Dominant Direction、RNM 和 SH/MonoSH 模式可能需要为全局光照（GI）和光照网格使用更多采样，以获得相近的质量。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Texels per unit ===&lt;br /&gt;
[[File:Texelscomp.jpg|thumb|1 vs 10 texels per unit]]&lt;br /&gt;
每个世界单位的光照贴图像素（Texels）近似数量。它会影响生成光照贴图的数量和分辨率。&lt;br /&gt;
&lt;br /&gt;
入门示例值：&lt;br /&gt;
&lt;br /&gt;
* 大型户外区域（城市）：1 - 5&lt;br /&gt;
* 中型户外区域（几条小巷）：10 - 20&lt;br /&gt;
* 高质量室内场景：100&lt;br /&gt;
&lt;br /&gt;
假设场景比例大约为 1 单位 = 1 米。在 Unity 中使用这种比例通常是推荐的，以便更好地导航和进行物理模拟。如果你的比例不同，请相应地调整 Texels。&lt;br /&gt;
&lt;br /&gt;
请注意，Texels Per Unit 是基础分辨率，但每个对象还可以通过 Mesh Renderer 上的 &amp;quot;Scale in Lightmap&amp;quot; 选项以及 Bakery 窗口中的 &amp;quot;Scale per map type&amp;quot; 进行额外调整。&lt;br /&gt;
&lt;br /&gt;
{{note| 将 &amp;quot;Scale in Lightmap&amp;quot; 设置为 0 的对象不会被烘焙，但仍会投射阴影并影响全局光照（GI）。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Max resolution ===&lt;br /&gt;
光照贴图的最大尺寸限制。如果对象无法容纳在单张光照贴图中（根据当前的 Texels Per Unit 值），将会分配额外的光照贴图。同样的四个正方形对象可以使用四张 512x512 的贴图，也可以使用一张 1024x1024 的贴图。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bounces ===&lt;br /&gt;
[[File:Image36.png|thumb|注意更多的反弹会为封闭空间带来更多光照。]]&lt;br /&gt;
定义光线在表面上反弹的次数。通常，对于户外场景（例如城市），较低的反弹次数就足够了，而对于封闭场景（室内、洞穴），则需要较高的反弹次数。&lt;br /&gt;
&lt;br /&gt;
虽然滑块最多限制为 5 次反弹，但可以在数字输入框中输入任意反弹次数。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Samples ===&lt;br /&gt;
[[File:Image7.png|thumb|左：Samples = 4，右：Samples = 16。为了演示，去噪功能已关闭。]]&lt;br /&gt;
影响全局光照（GI）的质量。典型值为 16 到 32。&lt;br /&gt;
&lt;br /&gt;
{{note| 可以输入超出滑块最大值的任意数字，但请注意，该数字表示最终光线数量的平方根，例如 32 表示 1024 条光线，64 表示 4096 条光线，依此类推。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GPU Priority ===&lt;br /&gt;
在 GPU 处理光照贴图时，操作系统和其他软件的响应可能会变慢。此选项允许你在烘焙速度和系统响应之间进行平衡。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render ===&lt;br /&gt;
为所有打开的场景烘焙光照贴图。&lt;br /&gt;
如果 [[使用手册#Light_probe_mode|Light Probe Mode]] 设置为 L1 或 L2，也会烘焙 [https://docs.unity3d.com/Manual/LightProbes.html 光照探针]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Render Light Probes ===&lt;br /&gt;
为所有打开的场景烘焙 [https://docs.unity3d.com/Manual/LightProbes.html 光照探针]。&lt;br /&gt;
&lt;br /&gt;
请注意，要在 Shadowmask 模式下对动态对象获得正确的混合光阴影，你还需要启用 [[使用手册#Occlusion_probes|occlusion probes]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Render Reflection Probes ===&lt;br /&gt;
为所有打开的场景烘焙反射探针。此按钮仅为方便起见，会调用引擎内置的反射探针更新功能。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update Skybox Probe ===&lt;br /&gt;
为当前的 skybox 烘焙全局漫反射和反射探针。与 “Render Reflection Probes” 一样，它仅调用引擎内置函数。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Occlusion probes ===&lt;br /&gt;
在渲染光照探针时，允许 Unity 使用当前选择的内置光照烘焙器烘焙遮挡探针（occlusion probes）。遮挡探针是存储在普通光照探针中的附加数据，可以防止动态对象在阴影区域被错误照亮。目前在 Unity 中无法使用自定义遮挡探针，必须调用内置光照烘焙器来完成此操作。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Warnings ===&lt;br /&gt;
这些选项会在按下任意 Render 按钮后对场景进行验证，并显示警告对话框，询问是否继续或停止烘焙过程。&lt;br /&gt;
&lt;br /&gt;
* Suppress all popups（屏蔽所有弹窗）：按下 Render 后不显示任何对话框。&lt;br /&gt;
* UV validation（UV 验证）：检查所有模型是否具有完全正确的光照贴图 UV，特别是 UV 是否位于 0-1 范围内且不重叠。&lt;br /&gt;
* Overwrite check（覆盖检查）：显示哪些光照贴图文件将被覆盖。&lt;br /&gt;
* Memory check（内存检查）：显示大致所需的视频内存量。&lt;br /&gt;
* Sample count check（采样数检查）：检查是否有光源、GI 或 AO 的采样数不合理，可能导致 GPU 超出可用资源。&lt;br /&gt;
* Lightmapped prefab validation（光照贴图预制体验证）：验证光照贴图预制体，并在某些预制体将被覆盖时发出通知。&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 (Advanced) ==&lt;br /&gt;
=== Light probe mode ===&lt;br /&gt;
更改光照探针的烘焙方式。&lt;br /&gt;
&lt;br /&gt;
* Legacy（传统模式）：使用 Render Light Probes 按钮生成探针。点光源和方向光在光照烘焙器中计算，而区域光/天空光/间接光则通过在每个探针位置渲染立方体贴图收集。结果以 [https://docs.unity3d.com/ScriptReference/Rendering.SphericalHarmonicsL2.html L2] 球谐（spherical harmonics）形式存储。缺点是立方体贴图渲染速度慢，并且在游戏中使用的着色器未物理正确表示光照表面，或者项目为移动平台设置时，光照贴图和探针可能不匹配（Unity 可能会裁剪高强度值）。&lt;br /&gt;
&lt;br /&gt;
* L1：在点击 Render 时，光照探针会与光照贴图一起渲染。此选项提供更高的烘焙性能，并保证探针光照与光照贴图匹配。结果以 L1 球谐形式存储（仍可被普通着色器使用）。使用 [[#Bakery_shaders|Bakery shader]] 的 Non-Linear Light Probe SH 选项可以进一步提升结果。&lt;br /&gt;
&lt;br /&gt;
* L2：更高质量（完整 L2 球谐）。与 L1 一样，会自动与光照贴图一起渲染。与 L1 相比，性能影响可忽略不计。应在所有着色器下显示正常。探针对比度/方向性/振铃去除可通过 Project Settings -&amp;gt; Bakery -&amp;gt; “Ringing removal for L2 light probes” 调整。&lt;br /&gt;
&lt;br /&gt;
'''在 Unity 2019.3 中似乎存在一个 bug，如果启用 Occlusion Probes 选项，Legacy 光照探针的颜色无法正确保存。使用 Occlusion Probes 时，默认且推荐使用 L2 模式。'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Asset UV Processing ===&lt;br /&gt;
配置资产的 UV 间距（padding）调整。可选值：&lt;br /&gt;
&lt;br /&gt;
* Don't change（不更改）：不修改资产。&lt;br /&gt;
* Adjust UV padding（调整 UV 间距）：会查找具有自动生成 UV 的模型（资产上启用 “Generate Lightmap UVs”），并进一步调整它们，使每个网格的 UV 岛之间具有适当间距。导入器设置中的全模型 Pack Margin 会被忽略。系统会根据每个网格的面积和光照贴图分辨率计算出最优值。&lt;br /&gt;
* Adjust UV padding for new meshes only（仅调整新网格的 UV 间距）：与上面相同，但会跳过之前至少调整过一次的模型。&lt;br /&gt;
* Remove UV adjustments（移除 UV 调整）：撤销所有之前的 UV 调整，使自动展开的模型恢复到 Unity 原始展开的样子。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser ===&lt;br /&gt;
设置所需的去噪器。可选值：&lt;br /&gt;
&lt;br /&gt;
* Optix 5：使用 OptiX 5.1 AI 去噪器（之前称为 “Legacy denoiser”）。在 GPU 上运行。支持从 [https://en.wikipedia.org/wiki/Kepler_(microarchitecture) Kepler]（通常是 GeForce 6xx）到 [https://en.wikipedia.org/wiki/Turing_(microarchitecture) Turing]（通常是 GeForce 20xx）的所有显卡。不支持 [https://en.wikipedia.org/wiki/Ampere_(microarchitecture) Ampere]（30xx）。OptiX 5.1 使用嵌入的静态训练数据集，因此不受驱动实现影响。&lt;br /&gt;
&lt;br /&gt;
* Optix 6：使用 OptiX 6.0 AI 去噪器（之前为默认选项）。在 GPU 上运行。在 Kepler（6xx）显卡上似乎无法使用，但在更新的显卡上均可运行，包括 Ampere（30xx）。自 6.0 起，OptiX 去噪器的训练数据集存储在驱动中。在 v442.50 之前，其行为类似于 OptiX 5.1；但之后 NVIDIA [https://forums.developer.nvidia.com/t/optix7-denoiser-different-results-with-different-version-of-drivers/117989/2 更改了数据集]，结果可能有所不同。更新后的数据集有时可能产生网格状图案和更亮的边缘（仍可通过 “Denoise: fix bright edges” 修复），但运行速度更快。&lt;br /&gt;
&lt;br /&gt;
* Optix 7：使用 OptiX 7.2 AI 去噪器。行为类似 OptiX 6.0，但在 Ampere（30xx）上可能支持更好。&lt;br /&gt;
&lt;br /&gt;
* OpenImageDenoise：使用 Intel Open Image Denoise 库。在 CPU 上运行（任何支持 SSE 4.1 的 CPU）。可能略慢于 OptiX，但质量可比。&lt;br /&gt;
&lt;br /&gt;
* OpenImageDenoise2：使用 Intel Open Image Denoise 2，CUDA 模式。在 GPU 上运行，性能与 OptiX 6/7 相当，质量与 CPU 版本相同。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Adjust sample positions ===&lt;br /&gt;
寻找最佳采样位置以防止光照泄漏。算法详情可参考 [https://ndotl.wordpress.com/2018/08/29/baking-artifact-free-lightmaps/#leaks 此处]。在某些情况下（通常是大型且多边形极少、法线平滑的几何体），可能会产生不正确的结果，此时可以将其禁用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Unload scenes before render ===&lt;br /&gt;
在烘焙前卸载 Unity 场景以释放显存。复杂场景仅在编辑器中显示就可能占用数 GB 的显存。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Denoise ===&lt;br /&gt;
[[File:Image31.png|thumb|左：未开启 “Denoise”，右：开启 “Denoise”。]]&lt;br /&gt;
如果启用，将应用去噪算法。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Fix Seams ===&lt;br /&gt;
[[File:Image22.png|thumb|左：缝隙（“Fix Seams” 关闭），右：缝隙已修复（“Fix Seams” 开启）。]]&lt;br /&gt;
如果启用，将尝试融合由 UV 不连续造成的缝隙。对平滑几何体很有用，包括 Unity 默认的球体。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Split by scene ===&lt;br /&gt;
如果同时加载多个场景，并且启用此选项，每个场景将拥有自己的一套光照贴图，而不会与其他场景共享。这对于在运行时流式加载场景时限制纹理占用量非常有用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hole filling ===&lt;br /&gt;
[[File:Holefilling.jpg|thumb|“Hole filling” 关闭与开启的对比。]]&lt;br /&gt;
如果 Atlas Packer 设置为 xatlas，将尝试填充每个孔洞，从而生成更高效的贴图集。对于几何体非常复杂的场景，可能会增加场景导出时间，但通常推荐开启。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Min resolution ===&lt;br /&gt;
光照贴图的最小尺寸限制。可用于在生成大量小而完全填充的光照贴图与少量未完全填充的光照贴图之间进行平衡。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Scale per map type ===&lt;br /&gt;
允许你对颜色贴图、Shadowmask 和方向贴图设置不同的分辨率缩放。例如，常见情况是间接光颜色分辨率较低，但 Shadowmask 分辨率较高。请注意，缩放在光照贴图渲染完成后才应用，因此不会节省烘焙时间。如果启用了 “Adjust UV padding”，间距将基于最低分辨率的贴图，以防止像素泄漏。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Checker preview ===&lt;br /&gt;
[[File:Image12.png|thumb|Checker Preview 功能演示。]]&lt;br /&gt;
如果勾选了 “Show checker” 选项，场景视图将在可见对象上渲染棋盘格图案，以展示光照贴图像素大小。这对于在烘焙前确保 Texels Per Unit 和其他影响分辨率的设置使用合理数值非常有用。&lt;br /&gt;
&lt;br /&gt;
启用 Checker Preview 将强制 Bakery 执行贴图集打包。可能需要一些时间，但通常不会超过几秒钟。在修改场景内容后，按下 “Refresh checker” 可重新打包场景以查看更改。&lt;br /&gt;
&lt;br /&gt;
Checker Preview 还使用随机颜色显示场景将如何被分割到不同的光照贴图中。&lt;br /&gt;
&lt;br /&gt;
{{note| 当前 Checker Preview 无法显示地形的正确像素大小。}}&lt;br /&gt;
&lt;br /&gt;
==== Atlas preview ====&lt;br /&gt;
[[File:FN-TmhRXwAE9i2I.png|thumb|Atlas Preview 功能演示]]&lt;br /&gt;
当 Checker Preview 开启时，会显示 Atlas Preview 按钮。点击它将打开一个新窗口，显示未来光照贴图的 UV 布局。点击 &amp;quot;&amp;lt;&amp;quot; 和 &amp;quot;&amp;gt;&amp;quot; 按钮可浏览各个光照贴图。&lt;br /&gt;
这对于在烘焙前检查打包质量和光照贴图数量非常有用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Emissive boost ===&lt;br /&gt;
将任何表面自发光（emission）乘以此数值。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Indirect boost ===&lt;br /&gt;
将所有反弹光照乘以此数值。作用与光源组件上的 Indirect Intensity 相同，但为全局设置。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Backface GI ===&lt;br /&gt;
[[File:Image30.jpg|thumb|Backface GI]]&lt;br /&gt;
[[File:Image35.png|thumb|左：“Backface GI” = 0，右：“Backface GI” = 1。注意阴影区域接收到更多的绿色光照。]]&lt;br /&gt;
决定光线通过前面表面到达背面并被全局光照（GI）反弹的程度。这对于薄的半透明表面（如树叶）尤其有用。取值范围为 0-1。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Ambient occlusion ===&lt;br /&gt;
[[File:Image15.png|thumb|左：AO intensity = 0，右：AO intensity = 1。]]&lt;br /&gt;
一种简单的非物理环境光遮蔽（Ambient Occlusion，AO），可在最终场景光照上叠加以增强美观效果。&lt;br /&gt;
&lt;br /&gt;
* Intensity（强度）：控制 AO 效果的可见度。值为 0 时禁用该效果。&lt;br /&gt;
* Radius（半径）：决定 AO 效果使用的光线距离。较小的值产生局部遮蔽（角落、褶皱），较大的值则更类似 Skylight，从远处物体产生阴影。&lt;br /&gt;
* Samples（采样数）：影响环境光遮蔽的质量。典型值为 4 到 32。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dither transparency ===&lt;br /&gt;
通过自动抖动不透明度贴图来启用半透明阴影。[[使用手册#Opacity|了解 Bakery 如何处理不透明度贴图]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== RTX Mode ===&lt;br /&gt;
启用 RTX 硬件加速。仅 RTX 显卡可受益于此选项。最低支持的驱动版本为 418。&lt;br /&gt;
&lt;br /&gt;
驱动可以在大多数非 RTX Nvidia 显卡上模拟 RTX 模式，但通常会更慢。&lt;br /&gt;
&lt;br /&gt;
在 Ampere（3xxx）或更新的显卡上，RTX 模式 ''必须'' 启用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Export terrain trees ===&lt;br /&gt;
如果启用，绘制在地形上的树木将影响光照。树木本身不会被烘焙。请注意，在烘焙过程中，每棵树都使用最高可能的 LOD 等级。对于多公里范围且模型高度复杂的森林场景，不建议使用此选项。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Terrain optimization ===&lt;br /&gt;
如果启用（默认），地形将使用独立的光线追踪技术以利用其高程图几何结构。否则，它们将像其他普通网格一样处理。地形优化可以显著减少高分辨率地形所需的内存占用。在某些情况下，它还能加快地形烘焙速度，但在其他情况下（尤其是简单低分辨率地形）可能需要禁用该选项。&lt;br /&gt;
&lt;br /&gt;
{{note| 地形优化当前不兼容绘制的地形洞。需禁用此选项才能使其正常工作。}}&lt;br /&gt;
{{note| 地形优化仅支持非 RTX 模式。}}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Light Mesh batch limit ===&lt;br /&gt;
如果该值大于 0，会将多个 Light Mesh 合并为一个，前提是它们具有相同设置并影响相同的 Lightmap Groups，同时将它们的总采样数限制为该值（例如，如果限制为 64，则可以合并 2 个采样数为 32 的灯光，或 4 个采样数为 16 的灯光，等等）。在拥有大量 Light Mesh 的场景中，这可以提升性能。但设置过高时需小心，因为 GPU 在一次处理过多采样时可能触发操作系统驱动超时。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Compress volumes ===&lt;br /&gt;
如果启用，将对体积 3D 贴图应用纹理压缩，并将 Bakery 着色器切换到相应的采样模式。不推荐对分辨率非常低的体积使用此选项。体积大小可能会被调整为 4 的倍数。&lt;br /&gt;
&lt;br /&gt;
注意事项：&lt;br /&gt;
&lt;br /&gt;
* 目前仅支持压缩为 BC6H/BC7 纹理格式（桌面/主机平台）。&lt;br /&gt;
* 体积压缩仅支持 Unity 2020.1 或更高版本。&lt;br /&gt;
* 目前仅标准渲染管线的 Bakery 着色器支持使用压缩体积贴图。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Samples multiplier ===&lt;br /&gt;
将所有阴影和 GI 采样数乘以指定因子。可用于在草稿质量和最终质量之间快速切换。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Tile size ===&lt;br /&gt;
与 [[#GPU Priority|GPU Priority]] 相同，但这里设置的是贴图块（tile）大小。Bakery 会将光照贴图拆分为更小的块，并一次更新一个块。块越小，GPU 工作被中断的次数越多，系统响应性可能更好。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Temp path ===&lt;br /&gt;
临时文件夹。在渲染过程中，Bakery 可能需要几个 GB 的可用空间。将此文件夹放在 SSD 上相比 HDD 可略微加快渲染速度。目前，该文件夹不会自动清理。你可以随时手动删除其内容（渲染时除外），或通过 Bakery -&amp;gt; Utilities -&amp;gt; Clear cache 清理。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Output path ===&lt;br /&gt;
光照贴图文件夹。所有光照贴图，以及 lightprobe 和顶点颜色（vertex color）资源都将保存在此处。该路径相对于你的 Assets 文件夹。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Use scene named output path ===&lt;br /&gt;
如果启用此选项，输出路径将自动设置为与当前活动场景同名的文件夹（Assets/CurrentSceneName/）。这与 Unity 内置光照贴图烘焙器的行为类似。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render Selected Groups ===&lt;br /&gt;
仅烘焙包含所选对象的 Lightmap Groups。&lt;br /&gt;
不仅仅是所选对象会被重新绘制，它们所属的所有 Lightmap Groups 都会被处理。其他光照贴图不会被更新。如果对象不属于某个手动分配的组，则使用相同光照贴图的场景部分将被重新烘焙。&lt;br /&gt;
&lt;br /&gt;
目前，使用 [[Partial_scene_baking|Sectors]] 进行场景部分烘焙更为方便。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Beep on finish ===&lt;br /&gt;
如果启用，Bakery 在烘焙完成时会播放提示音。&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 (Experimental) ==&lt;br /&gt;
=== Unwrapper ===&lt;br /&gt;
如果启用 [[#Asset_UV_Processing|Adjust UV Padding]]，则定义将使用的展开器（unwrapper）。&lt;br /&gt;
&lt;br /&gt;
* Default：使用 Unity 标准展开器。Bakery 会为每个具有不同间距参数的网格调用 [https://docs.unity3d.com/ScriptReference/Unwrapping.GenerateSecondaryUVSet.html Unwrapping.GenerateSecondaryUVSet]。&lt;br /&gt;
* xatlas：使用 [https://github.com/jpcy jpcy] 的 [https://github.com/jpcy/xatlas xatlas]，这是 [https://github.com/castano Ignacio Castaño] 的 [https://github.com/Thekla/thekla_atlas thekla_atlas] 的修改版。thekla_atlas 曾用于游戏《The Witness》（[http://the-witness.net/news/2010/03/graphics-tech-texture-parameterization/ 参见博客文章]）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Atlas Packer ===&lt;br /&gt;
选择在将不同对象的 UV 布局打包到大型光照贴图集时使用的算法。&lt;br /&gt;
* Default：Bakery 在 v1.7 之前使用的原始算法。&lt;br /&gt;
* xatlas：使用 xatlas。&lt;br /&gt;
&lt;br /&gt;
某些功能仅支持特定的贴图集打包器：&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Default&lt;br /&gt;
! xatlas&lt;br /&gt;
|-&lt;br /&gt;
| [[使用手册#Bakery_Lightmap_Group_Selector|Override resolution]]&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
|-&lt;br /&gt;
| 高效 LOD 打包&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
|-&lt;br /&gt;
| [[使用手册#Hole_filling|Hole filling]]&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
请注意，贴图集打包器（Atlas Packer）也可以为每个 Lightmap Group 单独选择。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Export geometry and maps ===&lt;br /&gt;
如果启用，Bakery 会在渲染前将场景导出为其专用格式。如果你确定场景的几何体和贴图以及光照贴图分辨率设置没有改变（例如，你只是调整 GI 或光源设置），可以禁用此选项以加快下一次渲染速度。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update unmodified lights ===&lt;br /&gt;
如果启用，Bakery 会重新计算自上次渲染以来未改变的光源。如果你只是调整某个光源，不想等待其他光源重新渲染，可以禁用此选项。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update modified lights and GI ===&lt;br /&gt;
如果启用，Bakery 会重新计算自上次渲染以来发生变化的 GI 和光源。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== UV padding: increase only ===&lt;br /&gt;
仅在启用 [[#Asset_UV_Processing|Adjust UV padding]] 时可见。默认情况下，模型资源的最佳 UV 间距仅基于当前加载的场景进行计算。如果同一模型有多个实例使用不同的光照贴图分辨率，最小的分辨率将决定间距，以确保 UV 图块之间的间距足够大，防止相互重叠。然而，在两个不同的独立场景中烘焙同一模型时，为新场景优化可能会破坏之前场景中的 UV。勾选此选项可以防止这种情况发生，即永远不减小间距值，从而始终为曾经烘焙过的最低分辨率实例进行优化。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoise: fix bright edges ===&lt;br /&gt;
[[File:Image19.png|thumb|左：去噪后可见明亮边缘；右：已修复。]]&lt;br /&gt;
仅在 [[#Denoise|Denoise]] 启用时可见。有时用于去噪的神经网络可能会在阴影周围产生明亮边缘，就像应用了锐化效果一样。如果启用此选项，Bakery 会尝试将其滤除。启用后，去噪阶段可能会略微变慢。&lt;br /&gt;
&lt;br /&gt;
此功能也可用于滤除“火花”（fireflies），即光照贴图中偶尔出现的亮点。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Post-packing ===&lt;br /&gt;
有时在渲染场景时，Bakery 会将光照贴图拆分为多个子光照贴图，例如在烘焙不同 LOD 或地形时。&lt;br /&gt;
Post-packing 会尝试通过将这些子光照贴图合并到同一纹理中来最小化最终贴图集数量。&lt;br /&gt;
建议保持此选项启用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Combine with Enlighten real-time GI ===&lt;br /&gt;
如果启用，则在按下 Render 按钮时，Bakery 会首先尝试使用 Enlighten 烘焙以计算实时 GI。之后，将进行常规的 Bakery 光照贴图烘焙过程。烘焙 GI 和实时 GI 将协同工作。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bake on remote server ===&lt;br /&gt;
启用网络烘焙（[[Network baking|Network baking]]）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Presets ===&lt;br /&gt;
当前在 Experimental 模式下的 Render/Update 按钮下显示。&lt;br /&gt;
&lt;br /&gt;
* 点击 '''New''' 将所有当前设置保存到预设文件中。&lt;br /&gt;
* 默认情况下，当一个预设处于激活状态时，所有设置都会被灰显，以防止覆盖预设。&lt;br /&gt;
* 点击 '''Modify preset''' 可更改设置并覆盖预设。&lt;br /&gt;
* 可以通过预设字段切换预设。将其设置为 None 可禁用预设使用。&lt;br /&gt;
&lt;br /&gt;
== 组件 ==&lt;br /&gt;
=== Bakery Lightmap Group Selector ===&lt;br /&gt;
指定对象及其所有子对象使用的 '''Lightmap Group'''。&lt;br /&gt;
Lightmap Group 是 Bakery 用来表示共享同一光照贴图的对象集合的术语。每个组都有属性，告诉 Bakery 如何打包对象、哪些光源影响它们，以及结果是烘焙到纹理还是顶点。&lt;br /&gt;
&lt;br /&gt;
默认情况下，所有静态对象会自动打包到多个光照贴图组（贴图集）中，因此通常无需手动管理。手动定义组仅用于特殊用途，例如：&lt;br /&gt;
&lt;br /&gt;
* 指定某些对象使用 [[Vertex Lightmaps|每顶点光照贴图]] 而非纹理。&lt;br /&gt;
* 使用建模软件中的原始未缩放 UV 烘焙光照贴图。&lt;br /&gt;
* 将关卡的特定区域分组以使用单张光照贴图，从而便于资源流式加载或通过脚本在运行时切换不同的烘焙光照。&lt;br /&gt;
* 使用 Render Selected Groups 按钮仅更新已分组的对象。&lt;br /&gt;
&lt;br /&gt;
要手动定义组，可以创建 '''Lightmap Group Assets'''，方法包括使用 Assets-&amp;gt;Create 菜单，或在组件中使用 Create New 按钮。使用 Create New 按钮时，将根据以下表单创建新的资源：&lt;br /&gt;
&lt;br /&gt;
* Name：要创建的 Lightmap Group 资源的名称。&lt;br /&gt;
* Packing Mode：此选择器定义 Lightmap Group 的打包模式，共有 3 种模式：&lt;br /&gt;
** Original UV：对象及其子对象将使用未修改的 UV 进行烘焙，不执行打包。适用于多个网格共享同一已打包 UV 布局的模型。&lt;br /&gt;
** Pack Atlas：对象及其子对象将打包到专用纹理贴图集中。在 v1.3 之前，每个可打包的子对象都需要有此组件，但现在不再需要。每个子对象将作为单独矩形打包，除非 Bakery 自动检测到子对象有非重叠的子对象，在这种情况下，多个对象可以使用同一个矩形。&lt;br /&gt;
** Vertex：对象及其子对象将使用顶点色烘焙光照而非纹理。注意，需要使用自定义着色器才能生效，例如 [[#Bakery_shaders|Bakery Shader]]。文档中也提供了一个简单的着色器（“Bakery/Simple Vertex Lightmapped”）用于演示和参考。[[Vertex Lightmaps|了解更多关于顶点光照贴图的信息]]。&lt;br /&gt;
* Directional mode：允许你覆盖该组的 [[#Directional mode|directional mode]]。选项与全局相同，Auto 将使用全局设置。&lt;br /&gt;
* Resolution：所需的光照贴图分辨率。&lt;br /&gt;
* Auto-resolution：使用 [[使用手册#Texels_per_unit|Texels Per Unit]] 来确定最接近的二次幂分辨率。&lt;br /&gt;
* Atlas packer：为该组选择 [[使用手册#Atlas_Packer|贴图集打包]] 算法。&lt;br /&gt;
* Bitmask：用于排除光源影响光照贴图的开关列表。每个 Bakery 光源也有一个位掩码设置。光源只会影响与其共享至少一个开关的 Lightmap Group。默认设置意味着所有光源影响所有光照贴图。&lt;br /&gt;
&lt;br /&gt;
[[File:Ts.jpg|thumb|Transparent selfshadow关闭 vs 开启：注意一些单面但背向的多边形如何被正确照亮。]]&lt;br /&gt;
&lt;br /&gt;
如果你有一个被分配了“Pack Atlas”模式的 Lightmap Group，组件上将会出现额外设置：&lt;br /&gt;
&lt;br /&gt;
* Override resolution：覆盖该对象及其子对象在光照贴图中占用的分辨率。&lt;br /&gt;
* Resolution：手动定义的分辨率。例如，如果你有一个分辨率为 512 的光照贴图，并且分配给 4 个对象，同时覆盖分辨率设置为 256，Bakery 将生成一个 512x512 的光照贴图，每个对象正好占据 256x256 的区域。&lt;br /&gt;
&lt;br /&gt;
如果你选择一个 Lightmap Group 资产，将会显示额外的实验性设置：&lt;br /&gt;
* [[Subsurface scattering|Subsurface scattering: (点击阅读更多)]]&lt;br /&gt;
* Normal offset：允许你将光线从表面偏移。这很少有用，主要用于实验目的。&lt;br /&gt;
* Transparent selfshadow：从表面后方发射光线，使其不会在自身投射阴影。对于半透明叶片可能有用。&lt;br /&gt;
* Vertex sampling density，(仅当 Packing Mode 设置为 Vertex 时可用）：默认情况下，每个顶点只计算一个值；如果采样密度 &amp;gt; 0，则会在三角形上分散采样并求平均，从而生成超采样、更平滑的结果。&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Lightmapped Prefab ===&lt;br /&gt;
此组件允许预制件存储光照贴图元数据。这样处理后的预制件可以在任意场景中实例化，无论是在编辑器中还是运行时。&lt;br /&gt;
该组件应直接添加到预制件的根对象上。不支持嵌套预制件。由于预制件在烘焙后会被覆盖（类似于按下“Apply”按钮的效果），因此要求预制件没有任何未应用的更改（子对象不应移动，材质和脚本参数应保持不变等）。如果检测到此类更改，组件界面会显示错误，烘焙后不会保存任何元数据。如果启用了 [[#Warnings|Lightmapped prefab validation]] 警告，所有预制件错误也会在烘焙前以对话框形式显示。&lt;br /&gt;
&lt;br /&gt;
光照贴图预制件支持所有 Bakery 功能，例如 LOD、地形、方向光贴图、RNM、SH、顶点模式和 Shadowmask。要使 Shadowmask 生效，光源也必须是同一预制件的一部分。&lt;br /&gt;
&lt;br /&gt;
{{note| 注意，由于 API 限制，预制件 Shadowmask 仅在 Unity 2017.4 或更高版本中可用。}}&lt;br /&gt;
&lt;br /&gt;
烘焙后，一个名为 “BakeryPrefabLightmapData” 的对象会被添加到预制件中。该对象包含一个脚本，存储应用光照贴图所需的所有数据。&lt;br /&gt;
&lt;br /&gt;
此外，光照贴图预制件允许保存当前渲染设置，并使用两个按钮将其加载回任意已打开的场景：&lt;br /&gt;
&lt;br /&gt;
* Save current render settings to prefab：在该预制件上存储当前渲染设置的副本。&lt;br /&gt;
* Load render settings from prefab：将当前渲染设置设置为预制件中存储的设置。&lt;br /&gt;
  [[File:Upload 2019-9-17 10-32-34.png|thumb|应用预制件]]&lt;br /&gt;
&lt;br /&gt;
烘焙光照贴图预制件时，建议检查：&lt;br /&gt;
&lt;br /&gt;
* 预制件已“应用”。在旧版 Unity 中，点击 Inspector 右上角的 “Apply” 按钮。在新版 Unity 中，点击 “Overrides” 列表，然后选择 “Apply All”。&lt;br /&gt;
* 预制件组件 UI 不显示任何错误。&lt;br /&gt;
* [推荐] 在主窗口启用 “Lightmapped prefab validation” 复选框。点击 Render 时不会显示任何关于预制件的警告对话框。&lt;br /&gt;
&lt;br /&gt;
{{note| 光照贴图以其烘焙所在的场景或所使用的 Lightmap Group 命名（如果有）。在同一场景中烘焙不同预制件时，请确保使用不同命名的 [[使用手册#Bakery_Lightmap_Group_Selector|Lightmap Group]] 或更改 [[使用手册#Output_path|输出路径]]。}}&lt;br /&gt;
&lt;br /&gt;
{{note| 当使用相同模型逐个烘焙多个预制件时，建议将 [[使用手册#Asset_UV_Processing|Asset UV Processing]] 设置为“Don't Change”，以防止修改共享模型的 UV。}}&lt;br /&gt;
&lt;br /&gt;
{{note| Bakery 的预制件工作流程是在 Unity 提供“预制件双击进入视图”功能之前实现的。因此，在隔离预制件视图中光照贴图可能无法正确应用，组件可能显示 “This GameObject is not a prefab” 信息。但在普通场景中使用时应能正常工作。}}&lt;br /&gt;
&lt;br /&gt;
{{note| 当解包已烘焙的预制件并取消与现有光照贴图的关联时，请确保删除保存预制件范围光照贴图/渲染器连接的 BakeryPrefabLightmapData 对象。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Direct Light ===&lt;br /&gt;
[[File:Directlight.jpg|thumb|纯直射光 + GI]]&lt;br /&gt;
[[File:Image4.png|thumb|左：“Shadow Spread” = 0.01，右：0.05。注意阴影从锐利逐渐变模糊的效果。]]&lt;br /&gt;
无限远方向光（例如太阳）。&lt;br /&gt;
&lt;br /&gt;
* Color：光的颜色。&lt;br /&gt;
* Intensity：线性色彩乘数。&lt;br /&gt;
* Shadow Spread：光源尺寸，或者简单说，阴影的模糊度。0 = 阴影最锐利，1 = 阴影最模糊。从技术上讲，它在单条光线与更宽光锥之间插值。&lt;br /&gt;
* Shadow Samples：影响阴影质量。Shadow Spread 值越小，所需样本越少即可得到干净图像。太阳阴影的典型值为 1 到 16。设置为 0 时，该光源的阴影将消失。&lt;br /&gt;
* Bitmask：用于排除此光源对特定 Lightmap Groups 影响的开关列表。&lt;br /&gt;
* Baked contribution：确定应烘焙哪类光照数据。仅在 Indirect 或 Shadowmask 模式可见。可选值：&lt;br /&gt;
** Direct and Indirect：直射光与间接光都完全烘焙。&lt;br /&gt;
** Indirect only：实时光提供直射贡献，仅烘焙间接光。&lt;br /&gt;
** Shadowmask and indirect：实时光提供直射贡献，静态几何体的阴影烘焙到单独贴图，动态与静态阴影混合。间接光正常烘焙。&lt;br /&gt;
** Direct, Indirect, Shadowmask（仅自定义光照）：与直射和间接相同，但 Shadowmask 也生成，可与自定义着色器一起使用。&lt;br /&gt;
* Denoise shadowmask：确定是否对该光源的 Shadowmask 应用去噪。通常不需要，因为阴影噪点不明显，但对非常宽且模糊的阴影（大 Shadow Spread）可能有用。&lt;br /&gt;
* Indirect intensity：非物理 GI 乘数。自然光照应为 1，可根据场景风格调整。&lt;br /&gt;
* Anti-alias：对阴影执行超采样。&lt;br /&gt;
* Texture projection：在光照上投射乘法平铺纹理，可用于模拟远处云影。&lt;br /&gt;
当设置了纹理投影时，可以使用“Tiling”和“Offset”字段调整其缩放和偏移。或者，点击 &amp;quot;Tweak projection in Scene View&amp;quot; 并使用额外的 Gizmo 可视化移动和缩放投影。点击“Render reference frame”可保存光源视角的 PNG，这对于在场景上绘制云影很有用。&lt;br /&gt;
&lt;br /&gt;
如果同一对象同时启用了 Unity 和 Bakery 光源且参数不匹配，会出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match lightmapped to real-time：将 Unity 光源的通用设置复制到 Bakery 光源。&lt;br /&gt;
* Match real-time to lightmapped：将 Bakery 光源的通用设置复制到 Unity 光源。&lt;br /&gt;
&lt;br /&gt;
{{note| 从物理角度看，Bakery 的方向光强度（Intensity）等于照度（Lux）除以 π。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Sky Light ===&lt;br /&gt;
[[File:Skylight.jpg|thumb|纯天空光与 GI]]&lt;br /&gt;
无限远的带阴影环境光（天空）。&lt;br /&gt;
&lt;br /&gt;
* Color: 颜色。&lt;br /&gt;
* Intensity: 线性色彩倍增。&lt;br /&gt;
* Sky texture: 可选的立方体贴图资源，例如 HDRI 全景图，用于从不同方向影响光照颜色。&lt;br /&gt;
  {{note| 旋转天空光的 GameObject 会相应旋转立方体贴图的光照。}}&lt;br /&gt;
* Samples: 影响阴影质量。典型值为 8 到 32。&lt;br /&gt;
* Hemispherical: 如果启用，光照仅来自上方（上半球）。否则来自所有方向。&lt;br /&gt;
* Bitmask: 用于排除此光源影响特定 Lightmap Groups 的开关列表。&lt;br /&gt;
* Baked contribution: 决定应烘焙哪种光照数据。仅在 Indirect/Shadowmask 模式下可见。可能值：&lt;br /&gt;
** Direct and Indirect: 直接和间接光照都将完全烘焙。这是默认且推荐的天空光行为，因为在 Unity 中没有实时版本可以模拟它们。&lt;br /&gt;
** Indirect only: 假定实时光源提供直接贡献；仅烘焙间接光照。&lt;br /&gt;
&lt;br /&gt;
如果天空光的设置与当前场景的天空盒不匹配，将出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match this light to scene skybox: 将活动天空盒材质的通用设置复制到 Bakery 天空光。当前仅支持使用 “Skybox/Cubemap” 或 “Skybox/Bakery skybox” 着色器的天空盒。&lt;br /&gt;
* Match scene skybox to this light: 将 Bakery 天空光的通用设置复制到场景天空盒。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bakery Light Mesh ===&lt;br /&gt;
[[File:Image29.png|thumb|Left: Samples Near = 0, Samples Far = 4096.&amp;lt;br&amp;gt;&lt;br /&gt;
Middle: Samples Near = 0, Samples Far = 128.&amp;lt;br&amp;gt;&lt;br /&gt;
Right: Samples Near = 16, Samples Far = 128.&amp;lt;br&amp;gt;&lt;br /&gt;
请注意，光照效果看起来相似，但使用的合并采样数量更少。]]&lt;br /&gt;
任何形状的自发光网格。应与 Mesh Renderer 组件或设置为 Area 模式的 Light 组件一起使用。&lt;br /&gt;
&lt;br /&gt;
* Color：颜色&lt;br /&gt;
* Intensity：线性颜色倍增器&lt;br /&gt;
* Cutoff：最大光照距离。Bakery 会在接近该限制时额外衰减正确的平方反比衰减。当 Cutoff 值刚好对应物理衰减变得非常暗的位置时效果最佳。Cutoff 可提升烘焙性能，也可以设置为非常高（不可达）的值以保证完全正确性。&lt;br /&gt;
* Self Shadow：决定光源网格自身是否投射阴影。此选项同时启用更精确的光照算法。&lt;br /&gt;
* Samples Near：影响靠近网格的光照质量。典型值为 16 到 64，仅当 Self Shadow 开启时可用。&lt;br /&gt;
* Samples Far：影响远离网格的光照质量。典型值为 4 到 4096。&lt;br /&gt;
&lt;br /&gt;
Bakery 基于光源表面距离混合两种不同的区域光算法。靠近光源时，算法类似 GI，而远处光源被近似为虚拟点光云。&lt;br /&gt;
&lt;br /&gt;
{{note| &amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;光源网格自身不会接收光照，也不会被烘焙到光照贴图中。&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;一个拥有大量多边形的光源网格比烘焙多个简单的光源网格要快&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;如果结果总是脏/噪点较多，可以尝试将 Samples Near 设置为 0，这样只使用 VPL 算法。对于不需要精度的简单光源（如建筑物的窗户光），这也非常有用。&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;}}  &lt;br /&gt;
[[File:Dd99d-QU0AEKFBK.jpg|thumb|弯曲的光源网格]]  &lt;br /&gt;
* Bitmask：用于排除此光源影响特定 Lightmap Groups 的开关列表。  &lt;br /&gt;
* Baked contribution：决定烘焙哪种类型的光照数据。仅在 Indirect 或 Shadowmask 模式下可见。可能的值：  &lt;br /&gt;
** Direct and Indirect：完全烘焙直接和间接光贡献。这是默认且推荐的光源网格行为，因为 Unity 中没有实时版本可以模拟它们。  &lt;br /&gt;
** Indirect only：实时光源提供直接光贡献，仅烘焙间接光。  &lt;br /&gt;
** Shadowmask and Indirect：实时光源提供直接光贡献，但静态几何体的阴影会烘焙到单独的贴图。动态和静态阴影将混合在一起。间接光照将照常烘焙。目前仅 HDRP（和自定义渲染器）支持混合区域光。  &lt;br /&gt;
** Direct, Indirect, Shadowmask (custom lighting only)：与 Direct and Indirect 相同，但同时生成 Shadowmask 并分配用于自定义着色器。  &lt;br /&gt;
* Indirect intensity：非物理 GI 倍增器。自然光照应设为 1，但可修改以实现更风格化的场景。  &lt;br /&gt;
* Shadowmask with falloff：将完整光衰减烘焙进 Shadowmask（仅对自定义着色器有用）。  &lt;br /&gt;
&lt;br /&gt;
如果网格材质和光源设置不匹配，将出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match light to material：将网格材质或区域光的通用设置复制到 Bakery 光源。&lt;br /&gt;
* Match material to light：将 Bakery 光源的通用设置复制到网格材质或区域光。&lt;br /&gt;
&lt;br /&gt;
==== Light Mesh 与自发光材质的区别 ====&lt;br /&gt;
自发光材质：&lt;br /&gt;
&lt;br /&gt;
* 在 GI 计算中传播光线，因此是“免费的”，无论有多少网格是自发光的。&lt;br /&gt;
* 小而明亮的光可能会产生不准确或有噪点的结果，这取决于 GI 的采样数量。&lt;br /&gt;
* 由于 Bakery 中 GI 的工作方式，它必须占用光照贴图空间，因此可能会浪费空间。同时，这意味着自发光对象需要有效的 UV，并且必须启用“投射阴影”。&lt;br /&gt;
&lt;br /&gt;
Light Mesh：&lt;br /&gt;
&lt;br /&gt;
* 光照会为每个光源单独计算，因此比自发光材质慢。&lt;br /&gt;
* 设计用于为小而明亮的光提供干净的光照效果，即使距离很远也能保持效果。&lt;br /&gt;
* 不占用光照贴图空间。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Point Light ===&lt;br /&gt;
[[File:Image11.png|thumb|左：“Shadow Spread” = 0.5，右：“Shadow Spread” = 1。]]&lt;br /&gt;
点光源，没有面积。尽管在物理上不可能，但在游戏中很有用，并且是匹配 Unity 点光源和聚光灯的唯一方式。&lt;br /&gt;
{{note| 聚光灯只是带有额外投影遮罩的点光源。}}&lt;br /&gt;
&lt;br /&gt;
* Color: 颜色&lt;br /&gt;
* Intensity: 线性色彩倍增&lt;br /&gt;
* Shadow spread: 阴影模糊度。虽然点光源没有面积，但通常希望它仍能产生模糊阴影。为此，阴影被模拟为从球形区域光源投射。此参数定义了虚拟球体的半径，直接影响阴影模糊度。&lt;br /&gt;
* Physical falloff: 如果启用，将使用正确的平方反比衰减，并在边界附近额外衰减。否则将尝试模拟 Unity 的衰减。&lt;br /&gt;
* Falloff min size: 详见 [[Point Light Attenuation]] 部分。&lt;br /&gt;
* Range: 如果物理衰减被禁用，则等于 Unity 的光源范围；如果启用，只会在边缘轻微衰减物理衰减。&lt;br /&gt;
* Samples: 影响阴影质量。典型值为 1 到 512。设置为 0 将使该光源的阴影消失。&lt;br /&gt;
  [[File:Image10.png|thumb|从左到右：Omni，Cookie（默认聚光灯纹理），Cubemap，IES。]]&lt;br /&gt;
* Projection mask: 遮罩/Cookie 类型。选项：&lt;br /&gt;
** Omni: 无遮罩，相当于 Unity 的点光源。&lt;br /&gt;
** Cookie: 纹理投影遮罩。附加选项：&lt;br /&gt;
*** Cookie texture: 2D 纹理资源。Bakery 包含原始 Unity 聚光灯纹理（名为 ftUnitySpotTexture），可用于模拟。&lt;br /&gt;
*** Angle: 纹理投影角度（类似 Unity 聚光灯）。&lt;br /&gt;
*** Correct distortion: 修正宽角下直线可见的 cookie 失真。&lt;br /&gt;
** Cubemap: 立方体贴图投影遮罩。附加选项：&lt;br /&gt;
*** Projected cubemap: 立方体贴图资源。&lt;br /&gt;
** IES: 光照由 IES 文件数据调制。附加选项：&lt;br /&gt;
*** IES file: .ies 扩展名文件。&lt;br /&gt;
* Bitmask: 用于排除该光源影响特定 Lightmap Groups 的开关列表。&lt;br /&gt;
* Baked contribution: 决定应烘焙哪种类型的光照数据。仅在 Indirect 或 Shadowmask 模式下可见。可能值：&lt;br /&gt;
** Direct and Indirect: 直接光和间接光完全烘焙。&lt;br /&gt;
** Indirect only: 实时光提供直接光，仅烘焙间接光。&lt;br /&gt;
** Shadowmask and Indirect: 实时光提供直接光，但静态几何体阴影烘焙到单独贴图中，动态和静态阴影混合，间接光正常烘焙。&lt;br /&gt;
** Direct, Indirect, Shadowmask (custom lighting only): 与 Direct and Indirect 相同，同时生成 Shadowmask 用于自定义着色器。&lt;br /&gt;
* Indirect intensity: 该光的非物理 GI 倍增。自然光应为 1，可根据风格化场景修改。&lt;br /&gt;
* Shadowmask with falloff: 将完整光衰减（除距离外）烘焙到 Shadowmask（仅自定义着色器有用）。&lt;br /&gt;
* Legacy sampling: 使用 Bakery 原始更偏置的阴影采样策略。产生无噪点阴影，但宽半影可能出现条纹。禁用后使用无偏但更有噪点的技术。&lt;br /&gt;
&lt;br /&gt;
如果同一对象同时启用了 Unity 和 Bakery 光源，且设置不匹配，则会出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match lightmapped to real-time: 将 Unity 光的常用设置复制到 Bakery 光。&lt;br /&gt;
* Match real-time to lightmapped: 将 Bakery 光的常用设置复制到 Unity 光。&lt;br /&gt;
&lt;br /&gt;
{{note| 从物理角度来看，Bakery 点光源的“Intensity”为 Candela 除以 Pi。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Volume ===&lt;br /&gt;
[[File:Voldemo notlonely.gif|由 BakeryVolume 照亮的动态门（动态 GIF，由 NOTLonely 制作）]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
体积（Volumes）生成存储每个体素光探针的 3D 纹理（L1 球面调和和阴影贴图），使其成为常规 Unity 光探针的可行替代方案。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Unity Light Probes&lt;br /&gt;
! Unity LPPV&lt;br /&gt;
! Bakery Volumes&lt;br /&gt;
|-&lt;br /&gt;
| 手动放置每个光探针&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 否&lt;br /&gt;
|-&lt;br /&gt;
| 在一个物体上插值多个光探针&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 运行时可移动&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 可以放入预制件&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 完整脚本 API&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| “Ringing” 伪影&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 可能出现&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 可能出现&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 已修正&lt;br /&gt;
|-&lt;br /&gt;
| 去噪&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 运行时开销&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | CPU：低开销；GPU：低开销&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | CPU：中等开销；GPU：中等开销&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#e4ead3;&amp;quot; | CPU：无开销；GPU：中等开销&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bakery Volume 是一个与一组 3D 纹理（3 个 SH 纹理和一个可选的 shadowmask）关联的边界盒，使其非常易于使用和编程。Volumes 可以在运行时轻松地交换、移动、加载或卸载，也可以与预制件关联。它们不需要任何 Light Probe Groups 或手动探针布置；整个 Volume 都由均匀的探针体素网格填充。光/影泄漏会自动像处理光照贴图一样修复（尽管对于较大的体素尺寸，薄的双面墙可能会出现问题，但可以通过在不同侧使用不同 Volume 避免）。由于体素网格的均匀特性，也可以对其应用类似光照贴图的降噪，这是常规光探针无法做到的。此外，Bakery 着色器使用 [https://drive.google.com/file/d/1MK6Clw93q8ljijRjb4gQOzzaIjn1uF9Y/view Geomerics] 采样技巧，完全消除了高对比度 HDR 光照下 SH 有时会产生的 “ringing” 伪影。&lt;br /&gt;
&lt;br /&gt;
因此，Volumes 可以为动态物体生成干净、精细、高质量的烘焙光照（即来自静态物体并影响动态物体的光照，而不是相反）。&lt;br /&gt;
&lt;br /&gt;
Volume 方法的唯一缺点是每像素着色开销较高。其开销类似于 LPPV（随着屏幕上受体素影响的像素数量而缩放），但与 LPPV 不同的是，一旦烘焙完成，Volumes 本身不会再更新。多个 Volume 的混合可以通过稍微重叠它们来避免。&lt;br /&gt;
&lt;br /&gt;
====设置 Volume 变换====&lt;br /&gt;
[[File:Bvolgizmo.jpg|thumb|Volume 控制柄]]&lt;br /&gt;
当 BakeryVolume 被添加到一个 GameObject 时，场景视图中会出现一个边界盒控制柄。拖动小方块即可缩放它。&lt;br /&gt;
&lt;br /&gt;
还有其他方法可以更改 Volume 的大小和位置：&lt;br /&gt;
&lt;br /&gt;
* 将任何可渲染的 GameObject 拖入 “Wrap to object” 字段。Volume 会包裹该对象（及其子对象），以将它们完全包含在内。&lt;br /&gt;
* 如果同一个对象上添加了 Box Collider，则会出现 “Set from box collider” 和 “Set to box collider” 按钮。可以用它们快速在 Volume 和 Collider 之间复制数值。&lt;br /&gt;
&lt;br /&gt;
====分辨率====&lt;br /&gt;
当启用 “Adaptive resolution” 时，体素数量由 “Voxels per unit” 控制。禁用它可以手动输入分辨率。对于大多数 1 单位 = 1 米 的游戏来说，一个合理的 “Voxels per unit” 值是 2，但在某些情况下（例如动态门）使用较小但更高分辨率的 Volume 会更有利。&lt;br /&gt;
&lt;br /&gt;
====其他设置====&lt;br /&gt;
&lt;br /&gt;
* Enable baking: 是否需要（重新）计算 Volume？禁用可防止覆盖已有数据。&lt;br /&gt;
* Denoise: 在烘焙 Volume 后应用去噪。推荐用于高分辨率 Volume。避免用于覆盖许多光源的低分辨率 Volume，因为去噪器难以区分实际内容和噪声。&lt;br /&gt;
* Global: 自动将此 Volume 分配给所有兼容 Volume 的 Shader，除非它们有覆盖设置。内部会调用 Shader.SetGlobalTexture()/SetGlobalVector()。&lt;br /&gt;
====使用方法====&lt;br /&gt;
Volumes 可以分配给使用 Volume 感知 Shader 的对象。Bakery 自带实现该功能的 “Bakery Standard” Shader，以及 HDRP 和 URP 的 Shader 图。请查看 example_volumes 场景，了解应用 Volume 的各种方式。&lt;br /&gt;
&lt;br /&gt;
====提示====&lt;br /&gt;
&lt;br /&gt;
* 确保查看示例。&lt;br /&gt;
* 如果两个 Volume 相连，让它们略微重叠。重叠大小应等于最大动态对象的尺寸。这样在运行时简单切换 Volume 就能正常工作。&lt;br /&gt;
* 仅在动态对象实际可达的区域放置 Volume。例如，使用玩家高度限制 Volume 的高度。&lt;br /&gt;
&lt;br /&gt;
====旋转 Volumes====&lt;br /&gt;
如果启用 “Rotate around Y” 选项，Volumes 可以绕 Y 轴旋转。旋转开销非常低，只使用 2 个额外的浮点数据（预计算的角度 sin/cos）。&lt;br /&gt;
&lt;br /&gt;
还可以在运行时旋转 Volumes（Experimental -&amp;gt; “Support rotation after bake” 以及 Bakery Shader 中的类似选项），这种情况下 Volume 必须在初始旋转为零时进行烘焙。&lt;br /&gt;
&lt;br /&gt;
在 URP 中，这种动态旋转可以与 `BakeryURPVolumeGraphRotatable.shadergraph` 一起使用。&lt;br /&gt;
&lt;br /&gt;
对于全局 Volume，动态旋转会在组件被（重新）启用或调用 `volume.SetGlobalParams()` 时更新。使用局部旋转 Volume 时，需要手动在材质或 MaterialPropertyBlock 上设置旋转：&lt;br /&gt;
{{code|&amp;lt;nowiki&amp;gt;SetMatrix(&amp;quot;_VolumeMatrix&amp;quot;, volume.GetMatrix())&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
====技术信息====&lt;br /&gt;
Volumes 可以自动工作（查看示例场景），也可以通过脚本控制其使用方式。&lt;br /&gt;
&lt;br /&gt;
可以通过组件的以下公共属性获取 Volume 数据：&lt;br /&gt;
&lt;br /&gt;
* `bakedTexture0`：存储 L0 RGB 系数和 L1 Z 红色通道在 alpha 中。&lt;br /&gt;
* `bakedTexture1`：存储 L1 X RGB 系数和 L1 Z 绿色通道在 alpha 中。&lt;br /&gt;
* `bakedTexture2`：存储 L1 Y RGB 系数和 L1 Z 蓝色通道在 alpha 中。&lt;br /&gt;
* `bakedMask`：存储体积阴影遮罩。&lt;br /&gt;
* `bounds`：Volume 的包围盒。&lt;br /&gt;
&lt;br /&gt;
所有 `bakedTexture*` 使用 RGBAHalf（每体素 8 字节）格式，mask 使用 ARGB32（每体素 4 字节）。阴影遮罩也可以使用单通道 R8 格式（每体素 1 字节）。&lt;br /&gt;
&lt;br /&gt;
因此 Volume 的字节大小 = width * height * depth * 3 * 8 + （仅当使用阴影遮罩时）width * height * depth * 4（或使用 R8 mask 时为 width * height * depth）。&lt;br /&gt;
&lt;br /&gt;
[[使用手册#Compress_volumes|可以对 Volume 启用纹理压缩]]，使其体积显著减小。&lt;br /&gt;
&lt;br /&gt;
采样 Volume 需要特殊 Shader，这些 Shader 已包含在 Bakery 中。要在自定义 Shader 中添加 Volumes，请查看 HDRP/URP 包中包含的 `BakeryVolume_float()` 函数（位于 `BakeryDecodeLightmap.hlsl`）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Light Filter ===&lt;br /&gt;
[[File:Output optimized.gif|彩色玻璃，如在 &amp;quot;Bakery Real-Time Preview&amp;quot; 中所见。Bakery lightmapper 烘焙出的结果相同。]]&lt;br /&gt;
&lt;br /&gt;
将渲染器标记为光过滤器（Light Filter）。过滤器会用其颜色着色所有直接和间接光线，类似于现实中的光学滤镜，从而实现彩色透明效果（例如彩色玻璃）。唯一的参数是用于着色的纹理。&lt;br /&gt;
&lt;br /&gt;
* 光过滤器对象仍然会像其他对象一样接收光照贴图。&lt;br /&gt;
* 过滤器不会散射或模糊光线（如需此效果，请尝试 [[Subsurface_scattering|Subsurface Scattering]] 或 [[使用手册#Backface_GI|Backface GI]]）。&lt;br /&gt;
* 过滤器可以产生带颜色的阴影。如果灯光使用 [[使用手册#Shadowmask|Shadowmask]] 模式，则结果只会保存 R 通道（因为 Unity 仅支持单通道遮罩）。对于完全烘焙的阴影，则没有限制。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Sector ===&lt;br /&gt;
参见 '''[[Partial_scene_baking|Partial scene baking]]'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Always Render ===&lt;br /&gt;
如果添加到一个物体上，Bakery 在烘焙时将始终考虑该物体，即使它的 Renderer 被禁用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
=== Bakery Pack As Single Square ===&lt;br /&gt;
如果添加到一个物体上，Bakery 会将该物体及其子物体的 UV 视为单个组合方块，在自动图集打包或 Lightmap Group 的 Pack Atlas 模式下，它们之间永远不会被移动。整个子层级将作为一个整体打包。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
=== Bakery Shared LOD UV ===&lt;br /&gt;
如果添加到一个 LODGroup 上，将标记所有同名 LOD 共享同一个光照贴图。默认情况下，每个 LOD 网格会获得独立的光照贴图，占用图集空间；但如果已知同一个物体的 LOD 拥有相似的 UV2（或者在没有 UV2 且 UV1 不重叠的情况下），它们可以映射到图集的同一部分，从而节省内存。&lt;br /&gt;
这种技术也称为 [https://github.com/laurenth-personal/LODLightmapScripts/ Lightmap Stealing]。&lt;br /&gt;
&lt;br /&gt;
= 材质兼容性 =&lt;br /&gt;
&lt;br /&gt;
=== 漫反射和发光 ===&lt;br /&gt;
Bakery 利用 [https://docs.unity3d.com/Manual/MetaPass.html Meta Pass] 系统支持大多数 Unity 材质。所有内置、Surface、URP 和 HDRP 着色器都已经定义了正确的 Meta Pass。&lt;br /&gt;
&lt;br /&gt;
如果你使用的是 Unlit 着色器，需要按照 Unity 文档手动添加 Meta Pass。&lt;br /&gt;
&lt;br /&gt;
如果未定义该 Pass，Bakery 将假定 {{codeVar|_MainTex}}、{{codeVar|_BaseColorMap}} 或 {{codeVar|_Color}}（如果未设置纹理）为材质的漫反射（Albedo），并将 {{codeVar|_EmissionMap}} 和 {{codeVar|_EmissionColor}} 作为发光颜色。&lt;br /&gt;
&lt;br /&gt;
为了使发光生效，[https://docs.unity3d.com/ScriptReference/Material-globalIlluminationFlags.html Material.globalIlluminationFlags] 必须设置为 [https://docs.unity3d.com/ScriptReference/MaterialGlobalIlluminationFlags.BakedEmissive.html MaterialGlobalIlluminationFlags.BakedEmissive]。标准着色器会自动设置此值。&lt;br /&gt;
&lt;br /&gt;
=== 不透明度 ===&lt;br /&gt;
[[File:Upload 2019-1-25 0-4-30.png|thumb|材质参数被转换为 Cutout（默认）]]&lt;br /&gt;
[[File:Alphacombos dither.jpg|thumb|通过“Dither Transparency”选项添加半透明值]]&lt;br /&gt;
[[File:Alphacombos filter.jpg|thumb|Light Filter 组件用于红色平面，生成彩色阴影]]&lt;br /&gt;
&lt;br /&gt;
默认情况下，Bakery 始终从 {{codeVar|_MainTex}}、{{codeVar|_BaseColorMap}} 或 {{codeVar|_BaseMap}} 的 alpha 值获取全分辨率的不透明度，并将其视为 Cutout（1 位透明）。&lt;br /&gt;
&lt;br /&gt;
当启用 '''Dither Transparency''' 选项时，半透明值会自动转换为可变蓝噪声，然后被滤波/模糊，产生部分透明效果（以前可以通过自定义手动抖动贴图实现，但从 v1.97 起自动完成）。&lt;br /&gt;
&lt;br /&gt;
为了使不透明度生效，着色器的 [https://docs.unity3d.com/Manual/SL-SubShaderTags.html RenderType 标签] 必须为以下值之一：&lt;br /&gt;
&lt;br /&gt;
* {{codeVar|Transparent}}&lt;br /&gt;
* {{codeVar|TransparentCutout}}&lt;br /&gt;
* {{codeVar|TreeLeaf}}&lt;br /&gt;
&lt;br /&gt;
如果存在名为 {{codeVar|_Cutoff}} 的属性，它将影响 Cutout（因此 Standard 着色器的 Cutoff 滑块会自动生效）。&lt;br /&gt;
&lt;br /&gt;
在没有 Dither Transparency 的情况下，如果材质 RenderType 为 {{codeVar|Transparent}} 或 {{codeVar|TreeLeaf}}，则 {{codeVar|_Color}} 的 alpha 值会额外修改 Cutoff：&lt;br /&gt;
''finalCutoff = 1 - (1 - cutoff) * alpha''&lt;br /&gt;
&lt;br /&gt;
对于彩色透明效果，请使用 [[使用手册#Bakery_Light_Filter|Light Filter]] 组件。&lt;br /&gt;
&lt;br /&gt;
有关漫反射半透明效果，请参考 [[#Backface GI|Backface GI]] 和 [[subsurface scattering]]。&lt;br /&gt;
&lt;br /&gt;
==== Alpha Meta Pass ====&lt;br /&gt;
从 v1.9 起，Bakery 还支持指定基于自定义着色器的透明度，但这需要使用兼容的着色器。要使用 ''Alpha Meta Pass''，需要执行以下步骤：&lt;br /&gt;
&lt;br /&gt;
* 在着色器中添加一个名为 '''BAKERY_META_ALPHA_ENABLE''' 的属性。例如：&lt;br /&gt;
  {{code|&amp;lt;nowiki&amp;gt;[HideInInspector] BAKERY_META_ALPHA_ENABLE (&amp;quot;Enable Bakery alpha meta pass&amp;quot;, Float) = 1.0&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
* 确保 RenderType 标签设置为上文提到的某个值。&lt;br /&gt;
* 声明一个名为 '''META_BAKERY''' 的 Pass。&lt;br /&gt;
* 在该 Pass 中检查 '''unity_MetaFragmentControl.w''' 是否非零，如果是，则返回计算出的透明度值。&lt;br /&gt;
&lt;br /&gt;
示例可参考包内的 ''Baked_Alpha_meta.shader''。&lt;br /&gt;
&lt;br /&gt;
注意：当前 Alpha Meta Pass 需要将 Light Probe Mode 设置为 L1 或 L2。&lt;br /&gt;
&lt;br /&gt;
=== Normal mapping ===&lt;br /&gt;
自定义表面法线可以与 [[#Baked Normal Maps|烘焙法线贴图]] 模式一起使用。不幸的是，Unity 的 Meta Pass 默认不输出法线信息，因此默认情况下，法线取自名为 {{codeVar|_BumpMap}} 的贴图，并通过 {{codeVar|_MainTex_ST}} 进行额外变换。&lt;br /&gt;
&lt;br /&gt;
然而，可以制作完全自定义的着色器，带有高级法线映射功能（例如混合多层法线），并使其兼容烘焙。要实现这一点，需要执行以下步骤：&lt;br /&gt;
&lt;br /&gt;
1. 在着色器中定义一个 Meta Pass，具体方法请参考 [https://docs.unity3d.com/Manual/MetaPass.html#ExampleMetaPassUnity 文档]。&lt;br /&gt;
&lt;br /&gt;
2. 将该 Pass 命名为 {{codeVar|&amp;quot;META_BAKERY&amp;quot;}}，而不仅仅是 {{codeVar|&amp;quot;META&amp;quot;}}。&lt;br /&gt;
&lt;br /&gt;
3. 包含文件 {{codeVar|&amp;quot;BakeryMetaPass.cginc&amp;quot;}}。&lt;br /&gt;
&lt;br /&gt;
4. 添加 {{codeVar|#pragma vertex vert_bakerymt}}。&lt;br /&gt;
&lt;br /&gt;
5. 如果 {{codeVar|unity_MetaFragmentControl.z}} 变量不为 0，着色器应返回世界空间法线。返回的法线应使用 {{codeVar|BakeryEncodeNormal}} 函数编码。&lt;br /&gt;
&lt;br /&gt;
在 Assets/Bakery/examples/shaders 中包含了两个实现了扩展 Meta Pass 的示例着色器。&lt;br /&gt;
&lt;br /&gt;
你也可以复制并修改 BakeryMetaPass.cginc 以满足你的需求，例如从顶点着色器传递额外数据。&lt;br /&gt;
&lt;br /&gt;
=== 正/背面 ===&lt;br /&gt;
无论着色器使用何种剔除模式，Bakery 都将所有背面视为不透明，这意味着任何直接光线都不会穿过背面，就像它不会穿过正面一样。&lt;br /&gt;
然而，如果使用 [[使用手册#Backface_GI|Backface GI]]，背面可以部分发出正面接收到的光照。&lt;br /&gt;
&lt;br /&gt;
= 扩展 Lightmap Parameters 资源 =&lt;br /&gt;
[[File:Lp.jpg|thumb|扩展 Lightmap Parameters]]&lt;br /&gt;
类似于 Bakery 的 [[#Bakery_Lightmap_Group_Selector|Lightmap Group]]，Unity 也有 [https://docs.unity3d.com/Manual/class-LightmapParameters.html Lightmap Parameters]，可以作为资源创建并分配给 Mesh Renderer。它们的逻辑有相似之处也有不同之处：&lt;br /&gt;
&lt;br /&gt;
* Lightmap Group 的主要用途是将多个对象组合到同一个图集。此外，它还允许覆盖该图集的烘焙设置。&lt;br /&gt;
* Lightmap Parameters 主要用于覆盖对象的烘焙设置，但通过使用“Baked Tag”选项，它们也可以影响打包：具有不同 Baked Tag 的对象将永远不会共享同一个图集。&lt;br /&gt;
&lt;br /&gt;
由于有些用户更习惯 Lightmap Parameters 的工作流程，Bakery 现在支持并扩展了它们：&lt;br /&gt;
&lt;br /&gt;
* Bakery 会遵循 Baked Tag 设置。&lt;br /&gt;
* Lightmap Parameters UI 中将显示额外的 Bakery 特定选项。有关其含义，请参考 [[#Bakery_Lightmap_Group_Selector|Lightmap Group]] 部分。&lt;br /&gt;
&lt;br /&gt;
= 项目设置 =&lt;br /&gt;
一些全局设置可以在 Project Settings -&amp;gt; Bakery GPU Lightmapper 中调整（此选项仅在 Unity 2018.3 或更新版本可见；旧版本请编辑 BakeryProjectSettings.asset）：&lt;br /&gt;
&lt;br /&gt;
* Mipmap lightmaps：启用光照贴图的 mipmap。随着图集变小，可能会导致 UV 图块之间的泄漏；另一方面，它可以减少远处高分辨率光照贴图的锯齿。总体上，建议对非常远的物体使用单独烘焙的 LOD 以及较低分辨率的光照贴图。&lt;br /&gt;
* Color file format：常规 HDR 颜色光照贴图的文件格式。可选值：&lt;br /&gt;
**HDR：Radiance HDR 格式（默认）。可用多种图像编辑器打开。&lt;br /&gt;
**Asset：Unity 原生格式。可自定义 mipmap 数量。&lt;br /&gt;
* Mask/Direction file format：额外 LDR 地图的格式，如阴影遮罩或方向数据。可选值：&lt;br /&gt;
**TGA：8 位 Targa（默认）。&lt;br /&gt;
**PNG：8 位 PNG。通常比 TGA 占用更少磁盘空间。&lt;br /&gt;
**Asset：Unity 原生格式。可自定义 mipmap 数量。&lt;br /&gt;
* Compress lightmaps：定义光照贴图资源的压缩行为。压缩光照贴图占用更少的显存，但可能会出现一些视觉伪影（例如色带或色斑），具体取决于压缩类型（移动端压缩问题请参见[[Troubleshooting#I_have_an_Android_project.2C_and_lightmaps_don.27t_look_good|此处]]）。可选值：&lt;br /&gt;
*** Compress but allow overriding asset: 新的光照贴图将在启用压缩的情况下创建。创建后，可以在 Inspector 中更改它们的压缩设置。修改后的值将在重新烘焙后保留（默认）。&lt;br /&gt;
*** Force compress: 始终压缩所有光照贴图。&lt;br /&gt;
*** Force no compress: 始终生成未压缩的光照贴图。&lt;br /&gt;
* High quality direction: 为方向贴图启用“高”质量压缩。实际格式取决于平台。例如在 PC 上，它会从 DXT1 改为 BC7，这提供了更高的质量，但 VRAM 使用量会翻倍。&lt;br /&gt;
* Texel padding (default atlas packer): 定义在使用默认 atlas 打包器时，在光照贴图 atlas 中对象 UV 布局之间添加多少空白 texel。&lt;br /&gt;
* Texel padding (xatlas packer): 同上，但在使用 xatlas 时。&lt;br /&gt;
* Alpha Meta Pass resolution multiplier: 乘以 [[使用手册#Alpha_Meta_Pass|Alpha Meta Pass]] 的分辨率，使在低分辨率光照贴图烘焙时仍能实现精确的基于 Shader 的切割效果。&lt;br /&gt;
* Volume render mode: 为所有 [[使用手册#Bakery_Volume|Volumes]] 使用哪种 [[使用手册#Render_mode|渲染模式]]？Auto 使用当前活动的渲染模式（默认）。&lt;br /&gt;
* Delete previous lightmaps before bake: 在烘焙新光照贴图之前，实际删除该场景中所有之前渲染的光照贴图文件。&lt;br /&gt;
* Log level: 定义烘焙过程中在控制台输出的信息量。可能的值：&lt;br /&gt;
** 0: 不输出任何内容。&lt;br /&gt;
** 1: 仅输出进度信息。&lt;br /&gt;
** 2: 仅输出警告。&lt;br /&gt;
** 3: 输出全部信息。&lt;br /&gt;
* Alternative scale in lightmap: 使渲染器属性 'Scale in Lightmap' 的行为更类似于 Unity 内置的行为。&lt;br /&gt;
* Align to texture compression blocks with xatlas: 使 xatlas 将 chart 对齐到 4x4 块边界，从而获得更适合压缩的结果。&lt;br /&gt;
* Generate smooth positions: 是否应调整采样位置以防止低多边形几何体在平滑法线下产生错误阴影？在使用法线差异极大的几何体时，可在极少数情况下禁用。技术说明见 [https://ndotl.wordpress.com/2018/08/29/baking-artifact-free-lightmaps/#shadowterm 这篇文章]。&lt;br /&gt;
* Smooth positions per-triangle: 是否应按三角形决定平滑/平面位置？在使用法线差异极大的几何体时，可在极少数情况下禁用。&lt;br /&gt;
* Use 'Receive GI' values: 在渲染器上考虑 “Receive Global Illumination” 值。最初 Bakery 会忽略它。&lt;br /&gt;
* Remove ringing in Legacy light probes: 在 Legacy 模式下启用更柔和的光探针卷积，以防止高对比度区域出现伪影。&lt;br /&gt;
* Always render reflection probes: 在每次 Render/Render Light Probes 后自动渲染反射探针。&lt;br /&gt;
* Ringing removal for L2 light probes: 对 [[使用手册#Light_probe_mode|L2 光探针]] 应用去振铃处理。值越高，探针光照越平滑；这种平滑可以减少 [[https://docs.unity3d.com/6000.2/Documentation/Manual/light-probes-troubleshooting.html](https://docs.unity3d.com/6000.2/Documentation/Manual/light-probes-troubleshooting.html) 振铃] 伪影（如果存在）。&lt;br /&gt;
* Put menu under Tools: 将 Bakery 菜单放入 Tools 菜单下。&lt;br /&gt;
&lt;br /&gt;
如果任何格式设置为 Asset 且启用 mipmapping，会显示额外选项：&lt;br /&gt;
&lt;br /&gt;
* Maximum mipmap count: 定义 mipmap 的最大数量。例如，设置为 2，则 8K 光照贴图仅有两个额外 mipmap：4K 和 2K。更低分辨率将被省略，从而在 mipmapping 过程中限制泄漏伪影。&lt;br /&gt;
&lt;br /&gt;
= SkinnedMeshRenderer 支持 =&lt;br /&gt;
Bakery 自 v1.65 起支持蒙皮网格 (skinned meshes)。但是，有一些限制：&lt;br /&gt;
&lt;br /&gt;
* 某些 Unity 版本不支持蒙皮网格的 UV1，并会悄无声息地忽略 “Generate lightmap UVs”。请确保场景中实际使用的网格具有 UV1，并在可能的情况下使用非重叠的 UV0；&lt;br /&gt;
* UV 填充调整在蒙皮网格上不起作用（Unity 在尝试调用 Unwrap 函数时似乎会崩溃）；&lt;br /&gt;
* 蒙皮网格不能使用每顶点光照贴图 (per-vertex lightmaps)（引擎不支持带蒙皮的 additionalVertexStreams）。&lt;br /&gt;
&lt;br /&gt;
= Shader Tweaks =&lt;br /&gt;
[[File:Image2.jpg|thumb|左：默认双线性过滤。右：双三次过滤。]]&lt;br /&gt;
[[File:Image34.jpg|thumb|左：两个阴影都已烘焙。&amp;lt;br&amp;gt;中：球形阴影为动态，另一个阴影为静态。通过相乘组合在一起。&amp;lt;br&amp;gt;右：与中间相同，但使用默认最小值组合。]]&lt;br /&gt;
&lt;br /&gt;
Bakery 提供可选的着色器修改，可以应用到 Unity 着色器上，以改善光照贴图采样并使实时光照更接近光照贴图效果。着色器调整菜单可以通过 Bakery-&amp;gt;Shader Tweaks 访问。&lt;br /&gt;
&lt;br /&gt;
这些选项会修补基础 Unity 着色器包含文件（来自 CGIncludes 文件夹），这些文件被大多数内置和第三方着色器使用。所有修改都会影响使用该版本编辑器打开的所有项目，但也可以轻松恢复。着色器调整会影响标准和表面着色器的工作方式。HDRP、URP 以及其他 SRP 不受影响。&lt;br /&gt;
&lt;br /&gt;
所有可用修改显示为按钮。点击按钮应用修改，按钮将保持按下状态。再次点击按钮即可移除修改。目前可用选项：&lt;br /&gt;
&lt;br /&gt;
{{note| 可能需要以管理员身份运行 Unity 编辑器以使 CGIncludes 修补生效}}&lt;br /&gt;
&lt;br /&gt;
* Use bicubic interpolation for lightmaps: 光照贴图将使用双三次插值代替默认双线性。此调整能很好地修复低分辨率光照贴图的许多锯齿边缘。目前仅适用于 DX11 和现代主机，其他平台仍使用双线性。&lt;br /&gt;
* Use multiplication for shadowmask: 使用相乘代替最小值组合静态和动态阴影。出于未知原因，Unity 默认使用最小值操作符，这会产生一些乘法不存在的伪影。&lt;br /&gt;
* Use physical light falloff (forward): 用更物理正确的平方反比替换实时点光/聚光灯的默认衰减。“Range” 只会在边缘略微淡出（与 Bakery 光源启用 Physical Falloff 复选框效果一致）。仅影响 Forward 渲染器。详情见 [[Point Light Attenuation]]。&lt;br /&gt;
* Use physical light falloff (deferred): 同上，但仅影响 Deferred 渲染器。&lt;br /&gt;
&lt;br /&gt;
'''衰减调整在 Unity &amp;gt;2017 版本上可能无法完全生效。此外，SRP 默认已经使用正确的衰减。'''&lt;br /&gt;
&lt;br /&gt;
= Bakery shaders =&lt;br /&gt;
Bakery 包含了自带着色器，支持顶点光照贴图，以及 RNM 和 SH 方向模式。它还允许从方向数据计算近似烘焙高光。&lt;br /&gt;
对于普通颜色光照贴图、阴影遮罩和 Dominant Direction 模式，Bakery 着色器 '''不是必需的'''，因为这些功能大多数 Unity 着色器本身已经支持。&lt;br /&gt;
&lt;br /&gt;
=== Standard render pipeline ===&lt;br /&gt;
'''Bakery/Standard''': 扩展了普通 Standard 着色器。额外选项：&lt;br /&gt;
&lt;br /&gt;
* Allow Vertex Lightmaps: 允许该材质用于 [[Vertex Lightmaps|顶点光照贴图]]。&lt;br /&gt;
* Allow RNM Lightmaps: 允许该材质用于 [[#RNM|RNM 方向模式]]。&lt;br /&gt;
* Allow SH Lightmaps: 允许该材质用于 [[#SH|SH 方向模式]]。&lt;br /&gt;
  {{note| 所有 “Allow” 选项会在着色器中启用特定的代码路径。为了性能考虑，建议每个材质仅使用一个 “allow” 选项。}}&lt;br /&gt;
* Enable Lightmap Specular: 使用 Dominant Direction、RNM 或 SH 方向模式的数据计算烘焙高光。注意，由于信息有限，该效果仅为近似。如果你曾在 Unity 4 中使用烘焙高光，效果应可比。与高度扰动的法线贴图搭配效果最佳，在平面表面上效果不佳。&lt;br /&gt;
* Enable VertexLM directional: 如果存在顶点光照贴图，指定 Dominant Direction 数据存储在顶点中并应被使用。&lt;br /&gt;
* Enable VertexLM SH: 如果存在顶点光照贴图，指定 SH 数据存储在顶点中并应被使用。&lt;br /&gt;
* Enable VertexLM Shadowmask: 如果存在顶点光照贴图，指定阴影遮罩存储在顶点中并应被使用。&lt;br /&gt;
* Enable MonoSH: 将方向贴图视为 MonoSH 贴图。&lt;br /&gt;
[[File:Image5.png|thumb|Standard SH light probe vs non-linear]]&lt;br /&gt;
[[File:Shspec.jpg|thumb|SH specular effect]]&lt;br /&gt;
* Non-linear SH：在 SH 方向模式下，此选项可以增强对比度（更接近真实效果），但会使着色器稍微变慢。该技巧基于 Geomerics 的论文《[https://drive.google.com/file/d/1MK6Clw93q8ljijRjb4gQOzzaIjn1uF9Y/view Reconstructing Diffuse Lighting from Spherical Harmonic Data]》。&lt;br /&gt;
* Non-linear Light Probe SH：与 Non-linear SH 类似，但用于光照探针。在探针的情况下，最显著的好处是消除错误的负值。这种问题常见于具有高对比度、明亮 HDR 光源的场景中。这是球谐函数的固有限制，而不是 Bakery 特有的问题（即使用 Unity 内置光照贴图器也可能出现类似伪影）。&lt;br /&gt;
* Force Bicubic Filter：为所有附加贴图启用双三次滤波。若要实现完整的双三次滤波（包括第一张颜色贴图），建议同时在 [[#Shader Tweaks|Shader Tweaks]] 中启用该功能。&lt;br /&gt;
&lt;br /&gt;
'''Bakery/Standard Specular'''：与 Standard 相同，但用于高光（Specular）工作流程。&lt;br /&gt;
&lt;br /&gt;
=== HDRP &amp;amp; URP ===&lt;br /&gt;
要提取额外的 HDRP/URP 着色器，请打开 Bakery 自带的 Bakery_ShaderGraphHDRP.unitypackage 或 Bakery_ShaderGraphURP.unitypackage。&lt;br /&gt;
在其中，你会找到可在自己 Shader Graph 中使用的 Shader Subgraph，以及一些示例材质。&lt;br /&gt;
&lt;br /&gt;
=== 各着色器功能支持对比 ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! 大多数 Unity 着色器&lt;br /&gt;
! 大多数 HDRP 和 URP 着色器&lt;br /&gt;
! Bakery Standard&lt;br /&gt;
! Bakery HDRP graphs&lt;br /&gt;
! Bakery URP graphs&lt;br /&gt;
|-&lt;br /&gt;
| HDR color lightmaps&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Shadowmask&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是 (&amp;gt;= URP 10.1)&lt;br /&gt;
|-&lt;br /&gt;
| Dominant Direction&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| RNM&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| SH&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Mo否SH&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Lightmap specular&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持 Dominant Direction 和 SH&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持 Dominant Direction&lt;br /&gt;
|-&lt;br /&gt;
| Bicubic filtering&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是,&lt;br /&gt;
通过 [[#Shader Tweaks|Shader Tweaks]] 支持&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是,&lt;br /&gt;
通过 [[#Shader Tweaks|Shader Tweaks]] 支持&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
|-&lt;br /&gt;
| Vertex lightmaps&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 单一颜色，没有每顶点 SH、方向或阴影遮罩（Shader Graph 限制）&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 单一颜色，没有每顶点 SH、方向或阴影遮罩（Shader Graph 限制）&lt;br /&gt;
|-&lt;br /&gt;
| Non-Linear Light Probes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Volumes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Volume shadowmask&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Compressed volumes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{note| 除了普通颜色光照贴图之外，所有功能都至少需要 Shader Model 3.0 才能运行。}}&lt;br /&gt;
{{note| 使用 SH 模式的顶点光照贴图由于插值器数量限制，至少需要 Shader Model 4.0。}}&lt;br /&gt;
{{note| 含有从 Dominant Direction 生成高光的更新版 URP 图表可在 [[Bakery_-_GPU_Lightmapper|主维基页面]] 下载。}}&lt;br /&gt;
&lt;br /&gt;
另请参阅：[[Integrating_Bakery_shader_features_to_custom_shaders| 将 Bakery 着色器特性集成到自定义着色器中]]&lt;br /&gt;
&lt;br /&gt;
= 关于 HDRP/URP 的说明 =&lt;br /&gt;
将该插件导入到 HDRP 或 URP 项目后，一般即可直接使用，但需要注意以下几点：&lt;br /&gt;
&lt;br /&gt;
* 示例场景中同时使用了普通 Standard 着色器以及部分 “Bakery Standard” 着色器。HDRP 和 URP 提供了将项目着色器从 Standard 升级到 Lit 的机制，但无法从 Bakery Standard 升级。请将 Bakery Standard 材质替换为来自 Bakery_ShaderGraphHDRP.unitypackage 或 Bakery_ShaderGraphURP.unitypackage 中的材质。&lt;br /&gt;
&lt;br /&gt;
* 在 HDRP 中，默认 HDRI 天空亮度较高（11），且天空反射默认不会被遮蔽。再加上默认的自动曝光，可能导致某些示例场景几乎不可见，因为它们使用了更低的亮度进行烘焙。此时可将 HDRI 天空亮度降低到 1。HDRI 设置通常位于 Assets/HDRPDefaultResources/DefaultSettingsVolumeProfile 中。&lt;br /&gt;
&lt;br /&gt;
* 在 HDRP 中，如果示例场景中的灯光过亮，可在 Bakery 灯光组件上点击 “match real-time to lightmapped” 按钮。&lt;br /&gt;
&lt;br /&gt;
* 在 HDRP 中建议使用 OpenImageDenoise 2（最佳）或 OptiX 7 去噪器，因为它们对高亮度值更适合。&lt;br /&gt;
&lt;br /&gt;
* 在 HDRP 中，“distance” 与普通 Shadowmask 的切换可直接在 Light 组件上完成，而不是在全局设置中。&lt;br /&gt;
&lt;br /&gt;
* 不要在 Skylight 上使用 “match” 按钮，因为 HDRP 使用的是非常特定的程序化天空着色器。请改为将其烘焙为 HDRI [[How_do_I...#How_do_I_use_Skylight_with_a_procedural_sky_shader.3F|这种方式]]。&lt;br /&gt;
&lt;br /&gt;
* 建议在使用 HDRP 时始终将 Light Probe Mode 设置为 L2 或 L1，因为 HDRP 的渲染器并未针对 Legacy 模式进行优化。&lt;br /&gt;
&lt;br /&gt;
* 最新版本的 HDRP/URP 自带自己的 IES 文件导入器。由于资源类型不匹配，Unity 会将旧版本 Bakery IES 灯光断开连接，使其显示为普通点光源。它们可以重新连接并重新保存。&lt;br /&gt;
&lt;br /&gt;
Bakery 的示例场景是为内置渲染管线设计的，因此在 HDRP/URP 中正确渲染它们需要一些步骤。以下是一些提示；假设新建项目使用默认的 HDRP/URP 设置：&lt;br /&gt;
&lt;br /&gt;
=== 在 HDRP 中查看示例场景 ===&lt;br /&gt;
&lt;br /&gt;
* 导入 Bakery 后，将标准材质升级为 HDRP：Edit-&amp;gt;Rendering-&amp;gt;Materials-&amp;gt;Convert All Built-in Materials To HDRP。&lt;br /&gt;
* 将 Bakery_ShaderGraphHDRP.unitypackage 导入项目，因为它包含实现高级 Bakery 功能的特殊 Shader Graph（对于经典颜色/方向/遮罩光照贴图不需要）。&lt;br /&gt;
* 选择 DefaultSettingsVolumeProfile.asset。在 HDRI Sky 部分，将 Exposure Compensation 设置为 1。否则，与示例场景相比，默认 HDRP 会过亮，因曝光调整而使场景看起来很暗。&lt;br /&gt;
* 选择示例场景中的灯光时，HDRP 会初始化其自身的灯光数据。有时会导致灯光立即变得更亮。点击 “Match real-time to lightmapped” 以同步。&lt;br /&gt;
* 在渲染光探针前，将 Light Probe Mode 设置为 L2。&lt;br /&gt;
* '''example_directional''': 将 Shader 更改为 BakeryDirSpecGraph 以查看烘焙高光（或仅使用常规 HDRP/Lit 用于仅漫反射法线映射）。删除球体，因为当前没有支持逐顶点方向的 Shader Graph。&lt;br /&gt;
* '''example_directional_MonoSH''': 将 Shader 更改为 BakerySpecMonoSHGraph（或 BakeryMonoSHGraph，用于没有高光的略微低成本版本）。删除球体，因为当前没有支持逐顶点 MonoSH 的 Shader Graph。&lt;br /&gt;
* '''example_RNM''': 将 Shader 更改为 BakeryRNMGraph。&lt;br /&gt;
* '''example_SH''': 将 Shader 更改为 BakerySpecSHGraph（或 BakerySHGraph，用于没有高光的略微低成本版本）。删除球体，因为当前没有支持逐顶点 SH 的 Shader Graph。&lt;br /&gt;
* '''example_mixed_directional_mode''': 对 MonoSH/RNM/SH 平面，同样需要不同的 Graph。&lt;br /&gt;
* '''example_lights''': 将顶点光照球体的 Shader 更改为 BakeryVertexColorGraph。&lt;br /&gt;
* '''example_prefabs_bake''': 无需进一步调整。&lt;br /&gt;
* '''example_sectors''': 无需进一步调整。&lt;br /&gt;
* '''example_shadowmask''': 选择 DirectLight 并点击 “Match real-time to lightmapped” 修正亮度。将所有 HDRP 灯光的 Shadowmask Mode 设置为 Shadowmask。&lt;br /&gt;
* '''example_sponza_day''': 将 OpenImageDenoise 2（或 Optix 7，如果不支持）设置为首选去噪器。&lt;br /&gt;
* '''example_sponza_evening''': 将 OpenImageDenoise 2（或 Optix 7，如果不支持）设置为首选去噪器。&lt;br /&gt;
* '''example_subtractive''': HDRP 不支持减法模式。&lt;br /&gt;
* '''example_volumes_simple''': 将火车 Shader 更改为 BakeryVolumeSpecGraph（或 BakeryVolumeGraph，用于没有高光的略微低成本版本）。&lt;br /&gt;
* '''example_volumes_simple_shadowmask''': HDRP 当前不支持 Shadowmask Volumes。&lt;br /&gt;
* '''example_volumes_advanced''': 与 example_volumes_simple 相同。&lt;br /&gt;
* '''example_translucency''': 场景大部分应显示正常。对于 “Dynamic sphere lit by volume”，将 Shader 设置为 BakeryVolumeGraph。&lt;br /&gt;
&lt;br /&gt;
=== 在 URP 中查看示例场景 ===&lt;br /&gt;
&lt;br /&gt;
* 导入 Bakery 后，将标准材质升级为 URP：打开 Assets/Bakery/examples/content，输入 &amp;quot;t:material&amp;quot; 选择所有材质，并仅在 &amp;quot;content&amp;quot; 文件夹下搜索。点击 Edit-&amp;gt;Rendering-&amp;gt;Materials-&amp;gt;Convert Selected Built-in Materials To URP。&lt;br /&gt;
* 将 Bakery_ShaderGraphURP.unitypackage 导入项目，因为它包含实现高级 Bakery 功能的特殊 Shader Graph（对于经典颜色/方向/遮罩光照贴图不需要）。&lt;br /&gt;
* '''example_directional''': 将 Shader 更改为 BakeryURPLit，启用 &amp;quot;Bakery Lightmapped Specular&amp;quot;（或者仅保持常规 URP/Lit 用于仅漫反射法线映射）。删除球体，因为当前没有支持逐顶点方向的 Shader Graph。&lt;br /&gt;
* '''example_directional_MonoSH''': 将 Shader 更改为 BakeryURPLit，将 Bakery Mode 设置为 MonoSH，启用 &amp;quot;Bakery Lightmapped Specular&amp;quot;。在顶点光照球体上也启用 &amp;quot;Per-vertex&amp;quot;。&lt;br /&gt;
* '''example_RNM''': 将 Shader 更改为 BakeryURPLit，将 Bakery Mode 设置为 RNM，启用 &amp;quot;Bakery Lightmapped Specular&amp;quot;。&lt;br /&gt;
* '''example_SH''': 将 Shader 更改为 BakeryURPLit，将 Bakery Mode 设置为 SH，启用 &amp;quot;Bakery Lightmapped Specular&amp;quot;。删除球体，因为当前没有支持逐顶点 SH 的 Shader Graph。&lt;br /&gt;
* '''example_mixed_directional_mode''': 类似地使用 BakeryURPLit 并设置不同的 Bakery Mode（MonoSH、RNM、SH）。非方向性/主方向/烘焙法线贴图可使用常规 URP/Lit。&lt;br /&gt;
* '''example_lights''': 无需进一步调整。&lt;br /&gt;
* '''example_prefabs_bake''': 无需进一步调整。&lt;br /&gt;
* '''example_sectors''': 无需进一步调整。&lt;br /&gt;
* '''example_shadowmask''': 类似于 Built-in 渲染管线，在 Bakery 窗口（或项目 Quality Settings）中取消选中 Distance Shadowmask，以在摄像机附近查看实际烘焙/实时阴影混合效果。&lt;br /&gt;
* '''example_sponza_day''': 在植被材质上启用 alpha clipping。&lt;br /&gt;
* '''example_sponza_evening''': 同 example_sponza_day。&lt;br /&gt;
* '''example_subtractive''': 无需进一步调整。&lt;br /&gt;
* '''example_volumes_simple''': 将火车 Shader 更改为 BakeryURPLit，并将 Bakery Mode 设置为 Volume。可选启用 &amp;quot;Bakery Lightmapped Specular&amp;quot;。&lt;br /&gt;
* '''example_volumes_simple_shadowmask''': 与 example_volumes_simple 相同，但也启用 &amp;quot;Volume Shadowmask&amp;quot;。&lt;br /&gt;
* '''example_volumes_advanced''': 与 example_volumes_simple 相同。&lt;br /&gt;
* '''example_translucency''': 场景大部分应显示正常。对于 &amp;quot;Dynamic sphere lit by volume&amp;quot;，将 Shader 设置为 BakeryURPLit 并将 Bakery Mode 设置为 Volume。&lt;br /&gt;
&lt;br /&gt;
= 升级 Bakery =&lt;br /&gt;
在升级该资源时，建议遵循以下步骤：&lt;br /&gt;
&lt;br /&gt;
* 关闭 Bakery 窗口。&lt;br /&gt;
* 关闭 Unity。&lt;br /&gt;
* 重新打开 Unity。&lt;br /&gt;
* 导入更新后的包。&lt;br /&gt;
&lt;br /&gt;
请注意，如果不先关闭 Unity，导入可能会失败，因为 DLL 文件被锁定（会出现类似 &amp;quot;alphabuffergen.dll: Access is denied.&amp;quot; 的提示）。&lt;br /&gt;
&lt;br /&gt;
如果你移动过 Bakery 文件夹（Assets/Bakery 和 Assets/Editor/x64/Bakery）到其他位置，可能需要在更新前将它们移回原处，以避免出现两个冲突的包副本。&lt;br /&gt;
&lt;br /&gt;
= 脚本 API =&lt;br /&gt;
&lt;br /&gt;
== 基本用法 ==&lt;br /&gt;
&lt;br /&gt;
获取并修改渲染设置：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ftLightmapsStorage storage = ftRenderLightmap.FindRenderSettingsStorage();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
可以在 ftLightmapsStorage.cs 中查看可用设置的完整列表。&lt;br /&gt;
&lt;br /&gt;
获取 lightmapper 实例并（重新）加载设置：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap bakery = ftRenderLightmap.instance != null ? ftRenderLightmap.instance : new ftRenderLightmap();&lt;br /&gt;
bakery.LoadRenderSettings();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
渲染光照贴图（如果设置为 L1 或 L2 模式，也会渲染探针）：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;bakery.RenderButton(bool showMsgWindows)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
仅渲染光探针：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;bakery.RenderLightProbesButton(bool showMsgWindows)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
仅渲染反射探针：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;bakery.RenderReflectionProbesButton(bool showMsgWindows)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''showMsgWindows''' 指示是否可以显示任何对话框/确认框。如果设置为 false，则抑制显示。&lt;br /&gt;
&lt;br /&gt;
检查烘焙是否正在进行：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.bakeInProgress&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
使用示例请参考 [[Community_extensions#Batch_scene_baker|Batch Scene Baker]] 脚本。&lt;br /&gt;
&lt;br /&gt;
== 额外函数 ==&lt;br /&gt;
&lt;br /&gt;
将一个 ftLightmapsStorage 的所有渲染设置复制到另一个：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmapsStorage.CopySettings(ftLightmapsStorage src, ftLightmapsStorage dest)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
获取全局（每项目）存储对象：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftGlobalStorage gstorage = ftLightmaps.GetGlobalStorage()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
将 ftLightmapsStorage（每场景）的所有渲染设置复制到 ftGlobalStorage（每项目）：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmapsStorage.CopySettings(ftLightmapsStorage src, ftGlobalStorage dest)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
将 ftGlobalStorage（每项目）的所有渲染设置复制到 ftLightmapsStorage（每场景）：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmapsStorage.CopySettings(ftGlobalStorage src, ftLightmapsStorage dest)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
获取包含 Bakery 二进制文件的文件夹路径：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmaps.GetEditorPath()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 额外变量 ==&lt;br /&gt;
&lt;br /&gt;
获取当前临时文件路径（必须先创建 ftRenderLightmap 实例）：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.scenePath&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
获取/设置 UVGBuffer 数据压缩（启用时为 LZ4，否则为 DDS）：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.compressedGBuffer&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
获取/设置输出光照贴图数据压缩（启用时为 LZ4，否则为 DDS）：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.compressedOutput&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 事件 ==&lt;br /&gt;
&lt;br /&gt;
脚本可以订阅 ftRenderLightmap 类中的静态事件。&lt;br /&gt;
&lt;br /&gt;
在完整渲染前调用：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnPreFullRender&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
在 Legacy 光探针模式下，每渲染一个光探针前调用。ProbeEventArgs 是一个结构体，包含 '''pos''' 字段表示当前光探针的位置：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler&amp;lt;ProbeEventArgs&amp;gt; OnPreRenderProbe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
在 Legacy 光探针渲染完成后调用：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnFinishedProbes&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
在完整渲染完成后调用：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnFinishedFullRender&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
在反射探针渲染前调用：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnPreReflectionProbeRender&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
在反射探针渲染完成后调用：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnFinishedReflectionProbes&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mr F</name></author>
		
	</entry>
	<entry>
		<id>https://geom.io/bakery/wiki/index.php?title=%E4%BD%BF%E7%94%A8%E6%89%8B%E5%86%8C&amp;diff=1836</id>
		<title>使用手册</title>
		<link rel="alternate" type="text/html" href="https://geom.io/bakery/wiki/index.php?title=%E4%BD%BF%E7%94%A8%E6%89%8B%E5%86%8C&amp;diff=1836"/>
		<updated>2025-11-07T10:58:35Z</updated>

		<summary type="html">&lt;p&gt;Mr F: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:fdlm1200x630.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
[https://geom.io/bakery/wiki/index.php?title=Manual (Click for English version)]&lt;br /&gt;
&lt;br /&gt;
== 系统要求 ==&lt;br /&gt;
&lt;br /&gt;
使用 Bakery 需要：&lt;br /&gt;
&lt;br /&gt;
Windows（7 或更高版本）电脑。&lt;br /&gt;
&lt;br /&gt;
Nvidia 显卡。最低支持型号为 Kepler（GeForce 650 或更新型号，Quadro 显卡请查看规格）。&lt;br /&gt;
&lt;br /&gt;
64 位 Unity 编辑器。Bakery 已在 5.6 到 6 及更高版本上测试过，同时也在 Tuanjie 1.6.7 上通过测试。&lt;br /&gt;
&lt;br /&gt;
{{note|系统要求仅适用于开发者的电脑，而非目标平台。使用 Bakery 烘焙的光照贴图可以在任何地方使用。}}&lt;br /&gt;
&lt;br /&gt;
== 前提条件 ==&lt;br /&gt;
* 确保你的项目中没有任何脚本编译错误，否则也会导致 Bakery 的脚本无法编译。&lt;br /&gt;
* 确保你的显卡驱动是最新版本，如有需要请[https://www.nvidia.com/Download/index.aspx?lang=en-US 更新]。&lt;br /&gt;
&lt;br /&gt;
'''请使用 Game-Ready（标准）驱动程序，而不是 “Studio” 驱动。'''&lt;br /&gt;
&lt;br /&gt;
== 安装 ==&lt;br /&gt;
&lt;br /&gt;
1. 通过 [https://assetstore.unity.com/packages/tools/level-design/bakery-gpu-lightmapper-122218 Asset Store] 将 Bakery 导入到你的项目中。&lt;br /&gt;
&lt;br /&gt;
2. Unity 会显示要导入的文件列表。如果这是你第一次使用 Bakery，建议直接 点击 Import（导入）。有经验的用户可以取消选中 examples 文件夹，以进行更轻量的安装。&lt;br /&gt;
&lt;br /&gt;
文件将被导入到 `Assets/Bakery` 和 `Assets/Editor/x64/Bakery` 文件夹中。&lt;br /&gt;
这些文件夹之后可以移动。&lt;br /&gt;
&lt;br /&gt;
3. Unity 随后会导入 Bakery 并编译脚本。此时可能会弹出如下窗口：&lt;br /&gt;
&lt;br /&gt;
[[File:Goahead.png]]&lt;br /&gt;
&lt;br /&gt;
此时你应点击 “Go Ahead”（继续）。&lt;br /&gt;
&lt;br /&gt;
现在你应该能在编辑器中看到新增的 Bakery 菜单：&lt;br /&gt;
&lt;br /&gt;
[[File:bmenu.jpg]]&lt;br /&gt;
&lt;br /&gt;
== 快速开始 ==&lt;br /&gt;
&lt;br /&gt;
1. 添加一些模型或基础体，并将其标记为静态（Static）。&lt;br /&gt;
&lt;br /&gt;
'''用于光照贴图的网格必须具有不重叠的 UV2。如果存在 UV2，则会使用 UV2（否则使用 UV1）。如果你的模型没有为光照贴图进行展开，请在资源中勾选 Generate Lightmap UVs（生成光照贴图 UV）。'''&lt;br /&gt;
Unity 的基础体已经具有正确的 UV2。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Staticmarked.jpg|320px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. 选择方向光（Unity 为你创建的那个），并添加 '''Bakery Direct Light''' 组件。&lt;br /&gt;
   {{note|Bakery 和 Unity 使用独立的光源组件。}}&lt;br /&gt;
&lt;br /&gt;
3. Bakery Direct Light 有许多可调选项，但你可以轻松将其与 Unity 光源匹配。点击 '''Match lightmapped to real-time'''。现在 Bakery 光源的颜色应与 Unity 默认的方向光相同，呈黄色调。&lt;br /&gt;
&lt;br /&gt;
[[File:Matching.jpg|640px]]&lt;br /&gt;
&lt;br /&gt;
{{note|Direct Light 组件可能会提示项目未使用线性光强度。问题在于，Unity 默认会对光源颜色应用伽马校正 [https://twitter.com/guycalledfrank/status/1001108508614553600 不正确]。&lt;br /&gt;
可以通过[https://docs.unity3d.com/ScriptReference/Rendering.GraphicsSettings-lightsUseLinearIntensity.html 脚本]启用正确模式。&lt;br /&gt;
这就是 “Fix” 按钮的作用。如果你已经在非线性光强模式下设置了许多光源，并且不想再次更改它们，可以跳过修复。即使你按了 “Fix”，也可以随时撤销此更改。&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. 要获得带阴影的环境光，请创建 Skylight（Bakery-&amp;gt;Create-&amp;gt;Skylight）。&lt;br /&gt;
&lt;br /&gt;
[[File:Menusky.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. 选择 Skylight，为它设置一些偏蓝的颜色，然后点击 '''Match scene skybox to this light'''。   这将使场景的 skybox 与光照完全匹配。&lt;br /&gt;
   {{note|将 Unity 的 skybox 与 Bakery Skylight 匹配是可选的，但对正确性很有用，可以确保可见环境和引擎内的反射探针与烘焙光照一致。目前此选项仅适用于 Standard 渲染管线。}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Skycomp.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. 点击 Bakery-&amp;gt;Render Lightmap。默认情况下，Full Lighting 模式是激活的。它会烘焙所有光源的直接和间接光照贡献。如果你想将实时阴影与烘焙全局光照（GI）结合使用，请将模式更改为 '''Indirect'''。&lt;br /&gt;
&lt;br /&gt;
[[File:Bakerywindow.jpg]]&lt;br /&gt;
&lt;br /&gt;
{{note| Bakery 可能会提示你正在使用旧的 [https://docs.unity3d.com/Manual/LinearLighting.html gamma mode]。如果你在意光照质量，强烈建议使用线性模式。如果你的项目已经在错误的伽马模式下设置好了，并且不想更改，或者是发布到不支持线性模式的移动设备上，也可以忽略此提示。}}&lt;br /&gt;
&lt;br /&gt;
7. 点击 '''Render'''。&lt;br /&gt;
&lt;br /&gt;
8. 完成！现在你应该已经得到烘焙的全局光照（GI）：&lt;br /&gt;
&lt;br /&gt;
[[File:Bakedgi.jpg]]&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 ==&lt;br /&gt;
&lt;br /&gt;
所有渲染设置都可以通过 Bakery-&amp;gt;Render Lightmap 访问。设置会为每个场景单独保存。Bakery 窗口顶部的选项允许你在 Simple（简单）、Advanced（高级）和 Experimental（实验）设置之间切换，每个后续模式都会显示更多可调选项。对于大多数场景，Simple 模式已经足够，是入门的好方法。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render mode ===  &lt;br /&gt;
定义要烘焙的光照贴图类型。  &lt;br /&gt;
&lt;br /&gt;
===== Full Lighting =====&lt;br /&gt;
烘焙所有 Bakery 光源的完整直接光和间接光。&lt;br /&gt;
{{note|在 2017.3 之前的 Unity 版本中，如果同一对象上同时有 Unity 和 Bakery 组件，你需要手动禁用 Unity 组件以避免亮度加倍。在较新版本中，实时效果会自动对烘焙光源禁用，就像内置光照烘焙器一样。}}&lt;br /&gt;
&lt;br /&gt;
===== Indirect =====&lt;br /&gt;
[[File:Image26.png|thumb|Unity 支持的不同渲染模式对比]]&lt;br /&gt;
基础混合模式。它会查看每个光源上的 Baked Contribution 选择器：如果设置为 ''Direct And Indirect''，则光源会像在 Full Lighting 模式下一样被烘焙。如果设置为 ''Indirect Only''，则只会烘焙该光源的间接光照（GI）。在后一种情况下，你应保持对象上的 Unity 光源和 Bakery 光源同时存在，一个提供实时直接光照，另一个提供预计算的全局光照（GI）。&lt;br /&gt;
&lt;br /&gt;
[[File:Indirectonly.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== Shadowmask =====&lt;br /&gt;
[[File:Image21.png|thumb|左：完全烘焙的光照。中：动态光源 + 烘焙 GI。右：胶囊形阴影、凹凸贴图和高光为动态光照，但立方体阴影和 GI 为烘焙光照。]]&lt;br /&gt;
[[File:Image6.png|thumb|当相机足够远离场景，或者动态阴影被禁用时，场景将呈现如下效果]]&lt;br /&gt;
更高级的混合模式。它通过生成两种类型的光照贴图来工作——一种包含烘焙颜色（如 Indirect 模式），另一种包含静态物体的阴影。它有几个优点：&lt;br /&gt;
* 实时阴影只需渲染少量动态对象，而不是整个场景。&lt;br /&gt;
* 实时阴影与烘焙阴影可以正确融合。&lt;br /&gt;
* 实时光源可以渲染凹凸贴图、高光和其他表面效果，同时仍会被高质量烘焙阴影遮挡。&lt;br /&gt;
[https://docs.unity3d.com/Manual/LightMode-Mixed-Shadowmask.html 更多详情]&lt;br /&gt;
&lt;br /&gt;
要启用此行为，你必须在同一对象上同时存在 Unity 光源和 Bakery 光源，并将 Baked Contribution 设置为 ''Shadowmask and Indirect''。未标记的光源将按 Indirect 模式进行烘焙。&lt;br /&gt;
&lt;br /&gt;
[[File:Smask22.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== Distance Shadowmask =====&lt;br /&gt;
此复选框仅在你选择 Shadowmask 时可见，并且只是切换项目 [https://docs.unity3d.com/Manual/LightMode-Mixed-ShadowmaskMode.html Quality Settings] 中同名的设置。&lt;br /&gt;
[https://docs.unity3d.com/Manual/LightMode-Mixed-DistanceShadowmask.html 更多详情]&lt;br /&gt;
{{note|由于缺少对应的脚本 API，该复选框在 Unity 5.6.x 上不可见。你可以在 Window-&amp;gt;Lighting-&amp;gt;Mixed Lighting-&amp;gt;Lighting Mode 中切换该设置。}}&lt;br /&gt;
{{note|在 Unity 版本 &amp;lt; 2017.3 中，由于 API 限制，渲染 Shadowmask 光照贴图会清除光照探针。烘焙后需要重新渲染光照探针。在较新版本中不应发生此问题。}}&lt;br /&gt;
&lt;br /&gt;
===== Subtractive =====&lt;br /&gt;
&lt;br /&gt;
启用 [https://docs.unity3d.com/Manual/LightMode-Mixed-Subtractive.html Subtractive] 光照模式。&lt;br /&gt;
&lt;br /&gt;
此选项对光照贴图本身没有任何特殊作用，实际上它的工作方式与 Full Lighting 相同。&lt;br /&gt;
&lt;br /&gt;
唯一的区别是，它还会将实时 Unity 光源设置为与 Subtractive 模式兼容（因为无法通过 UI 完成此操作）。&lt;br /&gt;
&lt;br /&gt;
你还需要在 [https://docs.unity3d.com/Manual/GlobalIllumination.html#MixedLighting Unity Lighting] 窗口中额外设置全局减法参数（例如全局阴影颜色）。&lt;br /&gt;
&lt;br /&gt;
===== Ambient Occlusion Only =====&lt;br /&gt;
仅烘焙环境光遮蔽（AO）。如果你很清楚自己在做什么，这可能会有用。请确保设置 [[#Ambient_occlusion|AO 选项]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Directional mode ===&lt;br /&gt;
[[File:Image3.png|thumb|不同方向模式的对比]]&lt;br /&gt;
定义了方向信息的烘焙方式。标准光照贴图每个像素只存储单一颜色，而方向光照贴图为着色器提供了关于该像素周围半球内光照变化的提示。这些数据用于在完全烘焙的区域中结合法线贴图。如果将其应用到内置的 [[#Bakery_shaders|Bakery]] 着色器中，还可以产生**近似高光反射**效果。&lt;br /&gt;
&lt;br /&gt;
===== None =====&lt;br /&gt;
不包含方向数据，每个像素仅有单一颜色。&lt;br /&gt;
&lt;br /&gt;
===== Baked Normal Maps =====&lt;br /&gt;
依然没有方向数据，但在渲染光照贴图时会考虑法线贴图。此方式在运行时没有额外开销。由于光照贴图的分辨率通常低于法线贴图，结果可能显得模糊。其他问题包括：由于缺乏 mipmapping，远处可能出现锯齿，以及降噪步骤可能导致细节被涂抹。要了解如何在此模式下使用具有程序化法线的自定义着色器，请参阅 [[#Normal_mapping|Normal Mapping]] 章节。&lt;br /&gt;
&lt;br /&gt;
===== Dominant Direction =====&lt;br /&gt;
此模式类似于 Unity 中 Enlighten 和 Progressive 烘焙器的实现。它与大多数着色器兼容，仅生成一张额外的贴图，运行时开销极小。缺点是凹凸贴图的效果较弱，略显灰暗，与实时光照下的同一物体相比可能差异较大。&lt;br /&gt;
&lt;br /&gt;
===== RNM =====&lt;br /&gt;
基于最初为《Half-Life 2》开发的 [https://steamcdn-a.akamaihd.net/apps/valve/2004/GDC2004_Half-Life2_Shading.pdf Radiosity Normal Mapping] 技术（相关演示文稿），后来被许多游戏采用（如《Mirror's Edge》）。此模式总共生成三张 HDR 贴图，是内存占用最高的模式之一，但运行时开销仍相对较低。该模式比 Dominant Direction 更精确，能更好地再现表面反差，并能正确处理来自不同角度、具有不同颜色的光照对法线贴图的影响。&lt;br /&gt;
&lt;br /&gt;
===== SH =====&lt;br /&gt;
基于论文《[https://media.contentapi.ea.com/content/dam/eacom/frostbite/files/gdc2018-precomputedgiobalilluminationinfrostbite.pdf Precomputed Global Illumination in Frostbite]》。这是最高质量的模式，能提供更好的表面对比度，并准确表现来自不同方向、不同颜色的光照。总共生成四张贴图，其中仅一张为 HDR，因此比 RNM 占用更少内存。运行时开销略高于 RNM。&lt;br /&gt;
&lt;br /&gt;
===== MonoSH =====&lt;br /&gt;
[[File:FY8Ru8hWIAAdYYH.jpg|thumb|Dominant Direction、完整 SH 与 MonoSH 的尺寸/质量对比]]&lt;br /&gt;
与 SH 类似，但使用单色的 L1 方向系数。表面对比度同样良好，虽然无法准确表现来自不同方向的不同颜色光照，但对多数场景来说已经足够。仅生成一张额外贴图，因此显存占用与带宽需求与 Dominant Direction 相近；事实上更低，因为 Dominant Direction 使用 RGBA 贴图，而 MonoSH 只需 RGB。该贴图通过内置的方向光照贴图系统传递，但''在标准着色器下显示不正确''。请务必使用兼容的着色器。&lt;br /&gt;
&lt;br /&gt;
===== 限制 =====&lt;br /&gt;
&lt;br /&gt;
* RNM 和 SH/MonoSH 只能与 [[#Bakery_shaders|Bakery shader]] 一起使用，或者需要对你的着色器进行调整。&lt;br /&gt;
* 在 RNM 和 SH 模式下，不会生成标准的颜色光照贴图。你需要确保场景中所有材质都使用 Bakery Shader，或者使用 [[#Bakery_Lightmap_Group_Selector|Lightmap Groups]] 将 RNM/SH 对象与其他对象分开。&lt;br /&gt;
* RNM 和 SH 贴图是通过 [https://docs.unity3d.com/ScriptReference/MaterialPropertyBlock.html MaterialPropertyBlock] 应用于对象的，因此在 Unity 的 Lighting 窗口中可能无法完全显示。&lt;br /&gt;
* Dominant Direction、RNM 和 SH/MonoSH 模式可能需要为全局光照（GI）和光照网格使用更多采样，以获得相近的质量。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Texels per unit ===&lt;br /&gt;
[[File:Texelscomp.jpg|thumb|1 vs 10 texels per unit]]&lt;br /&gt;
每个世界单位的光照贴图像素（Texels）近似数量。它会影响生成光照贴图的数量和分辨率。&lt;br /&gt;
&lt;br /&gt;
入门示例值：&lt;br /&gt;
&lt;br /&gt;
* 大型户外区域（城市）：1 - 5&lt;br /&gt;
* 中型户外区域（几条小巷）：10 - 20&lt;br /&gt;
* 高质量室内场景：100&lt;br /&gt;
&lt;br /&gt;
假设场景比例大约为 1 单位 = 1 米。在 Unity 中使用这种比例通常是推荐的，以便更好地导航和进行物理模拟。如果你的比例不同，请相应地调整 Texels。&lt;br /&gt;
&lt;br /&gt;
请注意，Texels Per Unit 是基础分辨率，但每个对象还可以通过 Mesh Renderer 上的 &amp;quot;Scale in Lightmap&amp;quot; 选项以及 Bakery 窗口中的 &amp;quot;Scale per map type&amp;quot; 进行额外调整。&lt;br /&gt;
&lt;br /&gt;
{{note| 将 &amp;quot;Scale in Lightmap&amp;quot; 设置为 0 的对象不会被烘焙，但仍会投射阴影并影响全局光照（GI）。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Max resolution ===&lt;br /&gt;
光照贴图的最大尺寸限制。如果对象无法容纳在单张光照贴图中（根据当前的 Texels Per Unit 值），将会分配额外的光照贴图。同样的四个正方形对象可以使用四张 512x512 的贴图，也可以使用一张 1024x1024 的贴图。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bounces ===&lt;br /&gt;
[[File:Image36.png|thumb|注意更多的反弹会为封闭空间带来更多光照。]]&lt;br /&gt;
定义光线在表面上反弹的次数。通常，对于户外场景（例如城市），较低的反弹次数就足够了，而对于封闭场景（室内、洞穴），则需要较高的反弹次数。&lt;br /&gt;
&lt;br /&gt;
虽然滑块最多限制为 5 次反弹，但可以在数字输入框中输入任意反弹次数。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Samples ===&lt;br /&gt;
[[File:Image7.png|thumb|左：Samples = 4，右：Samples = 16。为了演示，去噪功能已关闭。]]&lt;br /&gt;
影响全局光照（GI）的质量。典型值为 16 到 32。&lt;br /&gt;
&lt;br /&gt;
{{note| 可以输入超出滑块最大值的任意数字，但请注意，该数字表示最终光线数量的平方根，例如 32 表示 1024 条光线，64 表示 4096 条光线，依此类推。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GPU Priority ===&lt;br /&gt;
在 GPU 处理光照贴图时，操作系统和其他软件的响应可能会变慢。此选项允许你在烘焙速度和系统响应之间进行平衡。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render ===&lt;br /&gt;
为所有打开的场景烘焙光照贴图。&lt;br /&gt;
如果 [[使用手册#Light_probe_mode|Light Probe Mode]] 设置为 L1 或 L2，也会烘焙 [https://docs.unity3d.com/Manual/LightProbes.html 光照探针]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Render Light Probes ===&lt;br /&gt;
为所有打开的场景烘焙 [https://docs.unity3d.com/Manual/LightProbes.html 光照探针]。&lt;br /&gt;
&lt;br /&gt;
请注意，要在 Shadowmask 模式下对动态对象获得正确的混合光阴影，你还需要启用 [[使用手册#Occlusion_probes|occlusion probes]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Render Reflection Probes ===&lt;br /&gt;
为所有打开的场景烘焙反射探针。此按钮仅为方便起见，会调用引擎内置的反射探针更新功能。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update Skybox Probe ===&lt;br /&gt;
为当前的 skybox 烘焙全局漫反射和反射探针。与 “Render Reflection Probes” 一样，它仅调用引擎内置函数。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Occlusion probes ===&lt;br /&gt;
在渲染光照探针时，允许 Unity 使用当前选择的内置光照烘焙器烘焙遮挡探针（occlusion probes）。遮挡探针是存储在普通光照探针中的附加数据，可以防止动态对象在阴影区域被错误照亮。目前在 Unity 中无法使用自定义遮挡探针，必须调用内置光照烘焙器来完成此操作。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Warnings ===&lt;br /&gt;
这些选项会在按下任意 Render 按钮后对场景进行验证，并显示警告对话框，询问是否继续或停止烘焙过程。&lt;br /&gt;
&lt;br /&gt;
* Suppress all popups（屏蔽所有弹窗）：按下 Render 后不显示任何对话框。&lt;br /&gt;
* UV validation（UV 验证）：检查所有模型是否具有完全正确的光照贴图 UV，特别是 UV 是否位于 0-1 范围内且不重叠。&lt;br /&gt;
* Overwrite check（覆盖检查）：显示哪些光照贴图文件将被覆盖。&lt;br /&gt;
* Memory check（内存检查）：显示大致所需的视频内存量。&lt;br /&gt;
* Sample count check（采样数检查）：检查是否有光源、GI 或 AO 的采样数不合理，可能导致 GPU 超出可用资源。&lt;br /&gt;
* Lightmapped prefab validation（光照贴图预制体验证）：验证光照贴图预制体，并在某些预制体将被覆盖时发出通知。&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 (Advanced) ==&lt;br /&gt;
=== Light probe mode ===&lt;br /&gt;
更改光照探针的烘焙方式。&lt;br /&gt;
&lt;br /&gt;
* Legacy（传统模式）：使用 Render Light Probes 按钮生成探针。点光源和方向光在光照烘焙器中计算，而区域光/天空光/间接光则通过在每个探针位置渲染立方体贴图收集。结果以 [https://docs.unity3d.com/ScriptReference/Rendering.SphericalHarmonicsL2.html L2] 球谐（spherical harmonics）形式存储。缺点是立方体贴图渲染速度慢，并且在游戏中使用的着色器未物理正确表示光照表面，或者项目为移动平台设置时，光照贴图和探针可能不匹配（Unity 可能会裁剪高强度值）。&lt;br /&gt;
&lt;br /&gt;
* L1：在点击 Render 时，光照探针会与光照贴图一起渲染。此选项提供更高的烘焙性能，并保证探针光照与光照贴图匹配。结果以 L1 球谐形式存储（仍可被普通着色器使用）。使用 [[#Bakery_shaders|Bakery shader]] 的 Non-Linear Light Probe SH 选项可以进一步提升结果。&lt;br /&gt;
&lt;br /&gt;
* L2：更高质量（完整 L2 球谐）。与 L1 一样，会自动与光照贴图一起渲染。与 L1 相比，性能影响可忽略不计。应在所有着色器下显示正常。探针对比度/方向性/振铃去除可通过 Project Settings -&amp;gt; Bakery -&amp;gt; “Ringing removal for L2 light probes” 调整。&lt;br /&gt;
&lt;br /&gt;
'''在 Unity 2019.3 中似乎存在一个 bug，如果启用 Occlusion Probes 选项，Legacy 光照探针的颜色无法正确保存。使用 Occlusion Probes 时，默认且推荐使用 L2 模式。'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Asset UV Processing ===&lt;br /&gt;
配置资产的 UV 间距（padding）调整。可选值：&lt;br /&gt;
&lt;br /&gt;
* Don't change（不更改）：不修改资产。&lt;br /&gt;
* Adjust UV padding（调整 UV 间距）：会查找具有自动生成 UV 的模型（资产上启用 “Generate Lightmap UVs”），并进一步调整它们，使每个网格的 UV 岛之间具有适当间距。导入器设置中的全模型 Pack Margin 会被忽略。系统会根据每个网格的面积和光照贴图分辨率计算出最优值。&lt;br /&gt;
* Adjust UV padding for new meshes only（仅调整新网格的 UV 间距）：与上面相同，但会跳过之前至少调整过一次的模型。&lt;br /&gt;
* Remove UV adjustments（移除 UV 调整）：撤销所有之前的 UV 调整，使自动展开的模型恢复到 Unity 原始展开的样子。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser ===&lt;br /&gt;
设置所需的去噪器。可选值：&lt;br /&gt;
&lt;br /&gt;
* Optix 5：使用 OptiX 5.1 AI 去噪器（之前称为 “Legacy denoiser”）。在 GPU 上运行。支持从 [https://en.wikipedia.org/wiki/Kepler_(microarchitecture) Kepler]（通常是 GeForce 6xx）到 [https://en.wikipedia.org/wiki/Turing_(microarchitecture) Turing]（通常是 GeForce 20xx）的所有显卡。不支持 [https://en.wikipedia.org/wiki/Ampere_(microarchitecture) Ampere]（30xx）。OptiX 5.1 使用嵌入的静态训练数据集，因此不受驱动实现影响。&lt;br /&gt;
&lt;br /&gt;
* Optix 6：使用 OptiX 6.0 AI 去噪器（之前为默认选项）。在 GPU 上运行。在 Kepler（6xx）显卡上似乎无法使用，但在更新的显卡上均可运行，包括 Ampere（30xx）。自 6.0 起，OptiX 去噪器的训练数据集存储在驱动中。在 v442.50 之前，其行为类似于 OptiX 5.1；但之后 NVIDIA [https://forums.developer.nvidia.com/t/optix7-denoiser-different-results-with-different-version-of-drivers/117989/2 更改了数据集]，结果可能有所不同。更新后的数据集有时可能产生网格状图案和更亮的边缘（仍可通过 “Denoise: fix bright edges” 修复），但运行速度更快。&lt;br /&gt;
&lt;br /&gt;
* Optix 7：使用 OptiX 7.2 AI 去噪器。行为类似 OptiX 6.0，但在 Ampere（30xx）上可能支持更好。&lt;br /&gt;
&lt;br /&gt;
* OpenImageDenoise：使用 Intel Open Image Denoise 库。在 CPU 上运行（任何支持 SSE 4.1 的 CPU）。可能略慢于 OptiX，但质量可比。&lt;br /&gt;
&lt;br /&gt;
* OpenImageDenoise2：使用 Intel Open Image Denoise 2，CUDA 模式。在 GPU 上运行，性能与 OptiX 6/7 相当，质量与 CPU 版本相同。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Adjust sample positions ===&lt;br /&gt;
寻找最佳采样位置以防止光照泄漏。算法详情可参考 [https://ndotl.wordpress.com/2018/08/29/baking-artifact-free-lightmaps/#leaks 此处]。在某些情况下（通常是大型且多边形极少、法线平滑的几何体），可能会产生不正确的结果，此时可以将其禁用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Unload scenes before render ===&lt;br /&gt;
在烘焙前卸载 Unity 场景以释放显存。复杂场景仅在编辑器中显示就可能占用数 GB 的显存。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Denoise ===&lt;br /&gt;
[[File:Image31.png|thumb|左：未开启 “Denoise”，右：开启 “Denoise”。]]&lt;br /&gt;
如果启用，将应用去噪算法。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Fix Seams ===&lt;br /&gt;
[[File:Image22.png|thumb|左：缝隙（“Fix Seams” 关闭），右：缝隙已修复（“Fix Seams” 开启）。]]&lt;br /&gt;
如果启用，将尝试融合由 UV 不连续造成的缝隙。对平滑几何体很有用，包括 Unity 默认的球体。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Split by scene ===&lt;br /&gt;
如果同时加载多个场景，并且启用此选项，每个场景将拥有自己的一套光照贴图，而不会与其他场景共享。这对于在运行时流式加载场景时限制纹理占用量非常有用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hole filling ===&lt;br /&gt;
[[File:Holefilling.jpg|thumb|“Hole filling” 关闭与开启的对比。]]&lt;br /&gt;
如果 Atlas Packer 设置为 xatlas，将尝试填充每个孔洞，从而生成更高效的贴图集。对于几何体非常复杂的场景，可能会增加场景导出时间，但通常推荐开启。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Min resolution ===&lt;br /&gt;
光照贴图的最小尺寸限制。可用于在生成大量小而完全填充的光照贴图与少量未完全填充的光照贴图之间进行平衡。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Scale per map type ===&lt;br /&gt;
允许你对颜色贴图、Shadowmask 和方向贴图设置不同的分辨率缩放。例如，常见情况是间接光颜色分辨率较低，但 Shadowmask 分辨率较高。请注意，缩放在光照贴图渲染完成后才应用，因此不会节省烘焙时间。如果启用了 “Adjust UV padding”，间距将基于最低分辨率的贴图，以防止像素泄漏。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Checker preview ===&lt;br /&gt;
[[File:Image12.png|thumb|Checker Preview 功能演示。]]&lt;br /&gt;
如果勾选了 “Show checker” 选项，场景视图将在可见对象上渲染棋盘格图案，以展示光照贴图像素大小。这对于在烘焙前确保 Texels Per Unit 和其他影响分辨率的设置使用合理数值非常有用。&lt;br /&gt;
&lt;br /&gt;
启用 Checker Preview 将强制 Bakery 执行贴图集打包。可能需要一些时间，但通常不会超过几秒钟。在修改场景内容后，按下 “Refresh checker” 可重新打包场景以查看更改。&lt;br /&gt;
&lt;br /&gt;
Checker Preview 还使用随机颜色显示场景将如何被分割到不同的光照贴图中。&lt;br /&gt;
&lt;br /&gt;
{{note| 当前 Checker Preview 无法显示地形的正确像素大小。}}&lt;br /&gt;
&lt;br /&gt;
==== Atlas preview ====&lt;br /&gt;
[[File:FN-TmhRXwAE9i2I.png|thumb|Atlas Preview 功能演示]]&lt;br /&gt;
当 Checker Preview 开启时，会显示 Atlas Preview 按钮。点击它将打开一个新窗口，显示未来光照贴图的 UV 布局。点击 &amp;quot;&amp;lt;&amp;quot; 和 &amp;quot;&amp;gt;&amp;quot; 按钮可浏览各个光照贴图。&lt;br /&gt;
这对于在烘焙前检查打包质量和光照贴图数量非常有用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Emissive boost ===&lt;br /&gt;
将任何表面自发光（emission）乘以此数值。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Indirect boost ===&lt;br /&gt;
将所有反弹光照乘以此数值。作用与光源组件上的 Indirect Intensity 相同，但为全局设置。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Backface GI ===&lt;br /&gt;
[[File:Image30.jpg|thumb|Backface GI]]&lt;br /&gt;
[[File:Image35.png|thumb|左：“Backface GI” = 0，右：“Backface GI” = 1。注意阴影区域接收到更多的绿色光照。]]&lt;br /&gt;
决定光线通过前面表面到达背面并被全局光照（GI）反弹的程度。这对于薄的半透明表面（如树叶）尤其有用。取值范围为 0-1。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Ambient occlusion ===&lt;br /&gt;
[[File:Image15.png|thumb|左：AO intensity = 0，右：AO intensity = 1。]]&lt;br /&gt;
一种简单的非物理环境光遮蔽（Ambient Occlusion，AO），可在最终场景光照上叠加以增强美观效果。&lt;br /&gt;
&lt;br /&gt;
* Intensity（强度）：控制 AO 效果的可见度。值为 0 时禁用该效果。&lt;br /&gt;
* Radius（半径）：决定 AO 效果使用的光线距离。较小的值产生局部遮蔽（角落、褶皱），较大的值则更类似 Skylight，从远处物体产生阴影。&lt;br /&gt;
* Samples（采样数）：影响环境光遮蔽的质量。典型值为 4 到 32。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dither transparency ===&lt;br /&gt;
通过自动抖动不透明度贴图来启用半透明阴影。[[使用手册#Opacity|了解 Bakery 如何处理不透明度贴图]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== RTX Mode ===&lt;br /&gt;
启用 RTX 硬件加速。仅 RTX 显卡可受益于此选项。最低支持的驱动版本为 418。&lt;br /&gt;
&lt;br /&gt;
驱动可以在大多数非 RTX Nvidia 显卡上模拟 RTX 模式，但通常会更慢。&lt;br /&gt;
&lt;br /&gt;
在 Ampere（3xxx）或更新的显卡上，RTX 模式 ''必须'' 启用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Export terrain trees ===&lt;br /&gt;
如果启用，绘制在地形上的树木将影响光照。树木本身不会被烘焙。请注意，在烘焙过程中，每棵树都使用最高可能的 LOD 等级。对于多公里范围且模型高度复杂的森林场景，不建议使用此选项。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Terrain optimization ===&lt;br /&gt;
如果启用（默认），地形将使用独立的光线追踪技术以利用其高程图几何结构。否则，它们将像其他普通网格一样处理。地形优化可以显著减少高分辨率地形所需的内存占用。在某些情况下，它还能加快地形烘焙速度，但在其他情况下（尤其是简单低分辨率地形）可能需要禁用该选项。&lt;br /&gt;
&lt;br /&gt;
{{note| 地形优化当前不兼容绘制的地形洞。需禁用此选项才能使其正常工作。}}&lt;br /&gt;
{{note| 地形优化仅支持非 RTX 模式。}}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Light Mesh batch limit ===&lt;br /&gt;
如果该值大于 0，会将多个 Light Mesh 合并为一个，前提是它们具有相同设置并影响相同的 Lightmap Groups，同时将它们的总采样数限制为该值（例如，如果限制为 64，则可以合并 2 个采样数为 32 的灯光，或 4 个采样数为 16 的灯光，等等）。在拥有大量 Light Mesh 的场景中，这可以提升性能。但设置过高时需小心，因为 GPU 在一次处理过多采样时可能触发操作系统驱动超时。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Compress volumes ===&lt;br /&gt;
如果启用，将对体积 3D 贴图应用纹理压缩，并将 Bakery 着色器切换到相应的采样模式。不推荐对分辨率非常低的体积使用此选项。体积大小可能会被调整为 4 的倍数。&lt;br /&gt;
&lt;br /&gt;
注意事项：&lt;br /&gt;
&lt;br /&gt;
* 目前仅支持压缩为 BC6H/BC7 纹理格式（桌面/主机平台）。&lt;br /&gt;
* 体积压缩仅支持 Unity 2020.1 或更高版本。&lt;br /&gt;
* 目前仅标准渲染管线的 Bakery 着色器支持使用压缩体积贴图。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Samples multiplier ===&lt;br /&gt;
将所有阴影和 GI 采样数乘以指定因子。可用于在草稿质量和最终质量之间快速切换。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Tile size ===&lt;br /&gt;
与 [[#GPU Priority|GPU Priority]] 相同，但这里设置的是贴图块（tile）大小。Bakery 会将光照贴图拆分为更小的块，并一次更新一个块。块越小，GPU 工作被中断的次数越多，系统响应性可能更好。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Temp path ===&lt;br /&gt;
临时文件夹。在渲染过程中，Bakery 可能需要几个 GB 的可用空间。将此文件夹放在 SSD 上相比 HDD 可略微加快渲染速度。目前，该文件夹不会自动清理。你可以随时手动删除其内容（渲染时除外），或通过 Bakery -&amp;gt; Utilities -&amp;gt; Clear cache 清理。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Output path ===&lt;br /&gt;
光照贴图文件夹。所有光照贴图，以及 lightprobe 和顶点颜色（vertex color）资源都将保存在此处。该路径相对于你的 Assets 文件夹。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Use scene named output path ===&lt;br /&gt;
如果启用此选项，输出路径将自动设置为与当前活动场景同名的文件夹（Assets/CurrentSceneName/）。这与 Unity 内置光照贴图烘焙器的行为类似。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render Selected Groups ===&lt;br /&gt;
仅烘焙包含所选对象的 Lightmap Groups。&lt;br /&gt;
不仅仅是所选对象会被重新绘制，它们所属的所有 Lightmap Groups 都会被处理。其他光照贴图不会被更新。如果对象不属于某个手动分配的组，则使用相同光照贴图的场景部分将被重新烘焙。&lt;br /&gt;
&lt;br /&gt;
目前，使用 [[Partial_scene_baking|Sectors]] 进行场景部分烘焙更为方便。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Beep on finish ===&lt;br /&gt;
如果启用，Bakery 在烘焙完成时会播放提示音。&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 (Experimental) ==&lt;br /&gt;
=== Unwrapper ===&lt;br /&gt;
如果启用 [[#Asset_UV_Processing|Adjust UV Padding]]，则定义将使用的展开器（unwrapper）。&lt;br /&gt;
&lt;br /&gt;
* Default：使用 Unity 标准展开器。Bakery 会为每个具有不同间距参数的网格调用 [https://docs.unity3d.com/ScriptReference/Unwrapping.GenerateSecondaryUVSet.html Unwrapping.GenerateSecondaryUVSet]。&lt;br /&gt;
* xatlas：使用 [https://github.com/jpcy jpcy] 的 [https://github.com/jpcy/xatlas xatlas]，这是 [https://github.com/castano Ignacio Castaño] 的 [https://github.com/Thekla/thekla_atlas thekla_atlas] 的修改版。thekla_atlas 曾用于游戏《The Witness》（[http://the-witness.net/news/2010/03/graphics-tech-texture-parameterization/ 参见博客文章]）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Atlas Packer ===&lt;br /&gt;
选择在将不同对象的 UV 布局打包到大型光照贴图集时使用的算法。&lt;br /&gt;
* Default：Bakery 在 v1.7 之前使用的原始算法。&lt;br /&gt;
* xatlas：使用 xatlas。&lt;br /&gt;
&lt;br /&gt;
某些功能仅支持特定的贴图集打包器：&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Default&lt;br /&gt;
! xatlas&lt;br /&gt;
|-&lt;br /&gt;
| [[使用手册#Bakery_Lightmap_Group_Selector|Override resolution]]&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
|-&lt;br /&gt;
| 高效 LOD 打包&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
|-&lt;br /&gt;
| [[使用手册#Hole_filling|Hole filling]]&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
请注意，贴图集打包器（Atlas Packer）也可以为每个 Lightmap Group 单独选择。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Export geometry and maps ===&lt;br /&gt;
如果启用，Bakery 会在渲染前将场景导出为其专用格式。如果你确定场景的几何体和贴图以及光照贴图分辨率设置没有改变（例如，你只是调整 GI 或光源设置），可以禁用此选项以加快下一次渲染速度。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update unmodified lights ===&lt;br /&gt;
如果启用，Bakery 会重新计算自上次渲染以来未改变的光源。如果你只是调整某个光源，不想等待其他光源重新渲染，可以禁用此选项。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update modified lights and GI ===&lt;br /&gt;
如果启用，Bakery 会重新计算自上次渲染以来发生变化的 GI 和光源。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== UV padding: increase only ===&lt;br /&gt;
仅在启用 [[#Asset_UV_Processing|Adjust UV padding]] 时可见。默认情况下，模型资源的最佳 UV 间距仅基于当前加载的场景进行计算。如果同一模型有多个实例使用不同的光照贴图分辨率，最小的分辨率将决定间距，以确保 UV 图块之间的间距足够大，防止相互重叠。然而，在两个不同的独立场景中烘焙同一模型时，为新场景优化可能会破坏之前场景中的 UV。勾选此选项可以防止这种情况发生，即永远不减小间距值，从而始终为曾经烘焙过的最低分辨率实例进行优化。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoise: fix bright edges ===&lt;br /&gt;
[[File:Image19.png|thumb|左：去噪后可见明亮边缘；右：已修复。]]&lt;br /&gt;
仅在 [[#Denoise|Denoise]] 启用时可见。有时用于去噪的神经网络可能会在阴影周围产生明亮边缘，就像应用了锐化效果一样。如果启用此选项，Bakery 会尝试将其滤除。启用后，去噪阶段可能会略微变慢。&lt;br /&gt;
&lt;br /&gt;
此功能也可用于滤除“火花”（fireflies），即光照贴图中偶尔出现的亮点。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Post-packing ===&lt;br /&gt;
有时在渲染场景时，Bakery 会将光照贴图拆分为多个子光照贴图，例如在烘焙不同 LOD 或地形时。&lt;br /&gt;
Post-packing 会尝试通过将这些子光照贴图合并到同一纹理中来最小化最终贴图集数量。&lt;br /&gt;
建议保持此选项启用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Combine with Enlighten real-time GI ===&lt;br /&gt;
如果启用，则在按下 Render 按钮时，Bakery 会首先尝试使用 Enlighten 烘焙以计算实时 GI。之后，将进行常规的 Bakery 光照贴图烘焙过程。烘焙 GI 和实时 GI 将协同工作。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bake on remote server ===&lt;br /&gt;
启用网络烘焙（[[Network baking|Network baking]]）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Presets ===&lt;br /&gt;
当前在 Experimental 模式下的 Render/Update 按钮下显示。&lt;br /&gt;
&lt;br /&gt;
* 点击 '''New''' 将所有当前设置保存到预设文件中。&lt;br /&gt;
* 默认情况下，当一个预设处于激活状态时，所有设置都会被灰显，以防止覆盖预设。&lt;br /&gt;
* 点击 '''Modify preset''' 可更改设置并覆盖预设。&lt;br /&gt;
* 可以通过预设字段切换预设。将其设置为 None 可禁用预设使用。&lt;br /&gt;
&lt;br /&gt;
== 组件 ==&lt;br /&gt;
=== Bakery Lightmap Group Selector ===&lt;br /&gt;
指定对象及其所有子对象使用的 '''Lightmap Group'''。&lt;br /&gt;
Lightmap Group 是 Bakery 用来表示共享同一光照贴图的对象集合的术语。每个组都有属性，告诉 Bakery 如何打包对象、哪些光源影响它们，以及结果是烘焙到纹理还是顶点。&lt;br /&gt;
&lt;br /&gt;
默认情况下，所有静态对象会自动打包到多个光照贴图组（贴图集）中，因此通常无需手动管理。手动定义组仅用于特殊用途，例如：&lt;br /&gt;
&lt;br /&gt;
* 指定某些对象使用 [[Vertex Lightmaps|每顶点光照贴图]] 而非纹理。&lt;br /&gt;
* 使用建模软件中的原始未缩放 UV 烘焙光照贴图。&lt;br /&gt;
* 将关卡的特定区域分组以使用单张光照贴图，从而便于资源流式加载或通过脚本在运行时切换不同的烘焙光照。&lt;br /&gt;
* 使用 Render Selected Groups 按钮仅更新已分组的对象。&lt;br /&gt;
&lt;br /&gt;
要手动定义组，可以创建 '''Lightmap Group Assets'''，方法包括使用 Assets-&amp;gt;Create 菜单，或在组件中使用 Create New 按钮。使用 Create New 按钮时，将根据以下表单创建新的资源：&lt;br /&gt;
&lt;br /&gt;
* Name：要创建的 Lightmap Group 资源的名称。&lt;br /&gt;
* Packing Mode：此选择器定义 Lightmap Group 的打包模式，共有 3 种模式：&lt;br /&gt;
** Original UV：对象及其子对象将使用未修改的 UV 进行烘焙，不执行打包。适用于多个网格共享同一已打包 UV 布局的模型。&lt;br /&gt;
** Pack Atlas：对象及其子对象将打包到专用纹理贴图集中。在 v1.3 之前，每个可打包的子对象都需要有此组件，但现在不再需要。每个子对象将作为单独矩形打包，除非 Bakery 自动检测到子对象有非重叠的子对象，在这种情况下，多个对象可以使用同一个矩形。&lt;br /&gt;
** Vertex：对象及其子对象将使用顶点色烘焙光照而非纹理。注意，需要使用自定义着色器才能生效，例如 [[#Bakery_shaders|Bakery Shader]]。文档中也提供了一个简单的着色器（“Bakery/Simple Vertex Lightmapped”）用于演示和参考。[[Vertex Lightmaps|了解更多关于顶点光照贴图的信息]]。&lt;br /&gt;
* Directional mode：允许你覆盖该组的 [[#Directional mode|directional mode]]。选项与全局相同，Auto 将使用全局设置。&lt;br /&gt;
* Resolution：所需的光照贴图分辨率。&lt;br /&gt;
* Auto-resolution：使用 [[使用手册#Texels_per_unit|Texels Per Unit]] 来确定最接近的二次幂分辨率。&lt;br /&gt;
* Atlas packer：为该组选择 [[使用手册#Atlas_Packer|贴图集打包]] 算法。&lt;br /&gt;
* Bitmask：用于排除光源影响光照贴图的开关列表。每个 Bakery 光源也有一个位掩码设置。光源只会影响与其共享至少一个开关的 Lightmap Group。默认设置意味着所有光源影响所有光照贴图。&lt;br /&gt;
&lt;br /&gt;
[[File:Ts.jpg|thumb|Transparent selfshadow关闭 vs 开启：注意一些单面但背向的多边形如何被正确照亮。]]&lt;br /&gt;
&lt;br /&gt;
如果你有一个被分配了“Pack Atlas”模式的 Lightmap Group，组件上将会出现额外设置：&lt;br /&gt;
&lt;br /&gt;
* Override resolution：覆盖该对象及其子对象在光照贴图中占用的分辨率。&lt;br /&gt;
* Resolution：手动定义的分辨率。例如，如果你有一个分辨率为 512 的光照贴图，并且分配给 4 个对象，同时覆盖分辨率设置为 256，Bakery 将生成一个 512x512 的光照贴图，每个对象正好占据 256x256 的区域。&lt;br /&gt;
&lt;br /&gt;
如果你选择一个 Lightmap Group 资产，将会显示额外的实验性设置：&lt;br /&gt;
* [[Subsurface scattering|Subsurface scattering: (点击阅读更多)]]&lt;br /&gt;
* Normal offset：允许你将光线从表面偏移。这很少有用，主要用于实验目的。&lt;br /&gt;
* Transparent selfshadow：从表面后方发射光线，使其不会在自身投射阴影。对于半透明叶片可能有用。&lt;br /&gt;
* Vertex sampling density，(仅当 Packing Mode 设置为 Vertex 时可用）：默认情况下，每个顶点只计算一个值；如果采样密度 &amp;gt; 0，则会在三角形上分散采样并求平均，从而生成超采样、更平滑的结果。&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Lightmapped Prefab ===&lt;br /&gt;
此组件允许预制件存储光照贴图元数据。这样处理后的预制件可以在任意场景中实例化，无论是在编辑器中还是运行时。&lt;br /&gt;
该组件应直接添加到预制件的根对象上。不支持嵌套预制件。由于预制件在烘焙后会被覆盖（类似于按下“Apply”按钮的效果），因此要求预制件没有任何未应用的更改（子对象不应移动，材质和脚本参数应保持不变等）。如果检测到此类更改，组件界面会显示错误，烘焙后不会保存任何元数据。如果启用了 [[#Warnings|Lightmapped prefab validation]] 警告，所有预制件错误也会在烘焙前以对话框形式显示。&lt;br /&gt;
&lt;br /&gt;
光照贴图预制件支持所有 Bakery 功能，例如 LOD、地形、方向光贴图、RNM、SH、顶点模式和 Shadowmask。要使 Shadowmask 生效，光源也必须是同一预制件的一部分。&lt;br /&gt;
&lt;br /&gt;
{{note| 注意，由于 API 限制，预制件 Shadowmask 仅在 Unity 2017.4 或更高版本中可用。}}&lt;br /&gt;
&lt;br /&gt;
烘焙后，一个名为 “BakeryPrefabLightmapData” 的对象会被添加到预制件中。该对象包含一个脚本，存储应用光照贴图所需的所有数据。&lt;br /&gt;
&lt;br /&gt;
此外，光照贴图预制件允许保存当前渲染设置，并使用两个按钮将其加载回任意已打开的场景：&lt;br /&gt;
&lt;br /&gt;
* Save current render settings to prefab：在该预制件上存储当前渲染设置的副本。&lt;br /&gt;
* Load render settings from prefab：将当前渲染设置设置为预制件中存储的设置。&lt;br /&gt;
  [[File:Upload 2019-9-17 10-32-34.png|thumb|应用预制件]]&lt;br /&gt;
&lt;br /&gt;
烘焙光照贴图预制件时，建议检查：&lt;br /&gt;
&lt;br /&gt;
* 预制件已“应用”。在旧版 Unity 中，点击 Inspector 右上角的 “Apply” 按钮。在新版 Unity 中，点击 “Overrides” 列表，然后选择 “Apply All”。&lt;br /&gt;
* 预制件组件 UI 不显示任何错误。&lt;br /&gt;
* [推荐] 在主窗口启用 “Lightmapped prefab validation” 复选框。点击 Render 时不会显示任何关于预制件的警告对话框。&lt;br /&gt;
&lt;br /&gt;
{{note| 光照贴图以其烘焙所在的场景或所使用的 Lightmap Group 命名（如果有）。在同一场景中烘焙不同预制件时，请确保使用不同命名的 [[使用手册#Bakery_Lightmap_Group_Selector|Lightmap Group]] 或更改 [[使用手册#Output_path|输出路径]]。}}&lt;br /&gt;
&lt;br /&gt;
{{note| 当使用相同模型逐个烘焙多个预制件时，建议将 [[使用手册#Asset_UV_Processing|Asset UV Processing]] 设置为“Don't Change”，以防止修改共享模型的 UV。}}&lt;br /&gt;
&lt;br /&gt;
{{note| Bakery 的预制件工作流程是在 Unity 提供“预制件双击进入视图”功能之前实现的。因此，在隔离预制件视图中光照贴图可能无法正确应用，组件可能显示 “This GameObject is not a prefab” 信息。但在普通场景中使用时应能正常工作。}}&lt;br /&gt;
&lt;br /&gt;
{{note| 当解包已烘焙的预制件并取消与现有光照贴图的关联时，请确保删除保存预制件范围光照贴图/渲染器连接的 BakeryPrefabLightmapData 对象。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Direct Light ===&lt;br /&gt;
[[File:Directlight.jpg|thumb|纯直射光 + GI]]&lt;br /&gt;
[[File:Image4.png|thumb|左：“Shadow Spread” = 0.01，右：0.05。注意阴影从锐利逐渐变模糊的效果。]]&lt;br /&gt;
无限远方向光（例如太阳）。&lt;br /&gt;
&lt;br /&gt;
* Color：光的颜色。&lt;br /&gt;
* Intensity：线性色彩乘数。&lt;br /&gt;
* Shadow Spread：光源尺寸，或者简单说，阴影的模糊度。0 = 阴影最锐利，1 = 阴影最模糊。从技术上讲，它在单条光线与更宽光锥之间插值。&lt;br /&gt;
* Shadow Samples：影响阴影质量。Shadow Spread 值越小，所需样本越少即可得到干净图像。太阳阴影的典型值为 1 到 16。设置为 0 时，该光源的阴影将消失。&lt;br /&gt;
* Bitmask：用于排除此光源对特定 Lightmap Groups 影响的开关列表。&lt;br /&gt;
* Baked contribution：确定应烘焙哪类光照数据。仅在 Indirect 或 Shadowmask 模式可见。可选值：&lt;br /&gt;
** Direct and Indirect：直射光与间接光都完全烘焙。&lt;br /&gt;
** Indirect only：实时光提供直射贡献，仅烘焙间接光。&lt;br /&gt;
** Shadowmask and indirect：实时光提供直射贡献，静态几何体的阴影烘焙到单独贴图，动态与静态阴影混合。间接光正常烘焙。&lt;br /&gt;
** Direct, Indirect, Shadowmask（仅自定义光照）：与直射和间接相同，但 Shadowmask 也生成，可与自定义着色器一起使用。&lt;br /&gt;
* Denoise shadowmask：确定是否对该光源的 Shadowmask 应用去噪。通常不需要，因为阴影噪点不明显，但对非常宽且模糊的阴影（大 Shadow Spread）可能有用。&lt;br /&gt;
* Indirect intensity：非物理 GI 乘数。自然光照应为 1，可根据场景风格调整。&lt;br /&gt;
* Anti-alias：对阴影执行超采样。&lt;br /&gt;
* Texture projection：在光照上投射乘法平铺纹理，可用于模拟远处云影。&lt;br /&gt;
当设置了纹理投影时，可以使用“Tiling”和“Offset”字段调整其缩放和偏移。或者，点击 &amp;quot;Tweak projection in Scene View&amp;quot; 并使用额外的 Gizmo 可视化移动和缩放投影。点击“Render reference frame”可保存光源视角的 PNG，这对于在场景上绘制云影很有用。&lt;br /&gt;
&lt;br /&gt;
如果同一对象同时启用了 Unity 和 Bakery 光源且参数不匹配，会出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match lightmapped to real-time：将 Unity 光源的通用设置复制到 Bakery 光源。&lt;br /&gt;
* Match real-time to lightmapped：将 Bakery 光源的通用设置复制到 Unity 光源。&lt;br /&gt;
&lt;br /&gt;
{{note| 从物理角度看，Bakery 的方向光强度（Intensity）等于照度（Lux）除以 π。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Sky Light ===&lt;br /&gt;
[[File:Skylight.jpg|thumb|纯天空光与 GI]]&lt;br /&gt;
无限远的带阴影环境光（天空）。&lt;br /&gt;
&lt;br /&gt;
* Color: 颜色。&lt;br /&gt;
* Intensity: 线性色彩倍增。&lt;br /&gt;
* Sky texture: 可选的立方体贴图资源，例如 HDRI 全景图，用于从不同方向影响光照颜色。&lt;br /&gt;
  {{note| 旋转天空光的 GameObject 会相应旋转立方体贴图的光照。}}&lt;br /&gt;
* Samples: 影响阴影质量。典型值为 8 到 32。&lt;br /&gt;
* Hemispherical: 如果启用，光照仅来自上方（上半球）。否则来自所有方向。&lt;br /&gt;
* Bitmask: 用于排除此光源影响特定 Lightmap Groups 的开关列表。&lt;br /&gt;
* Baked contribution: 决定应烘焙哪种光照数据。仅在 Indirect/Shadowmask 模式下可见。可能值：&lt;br /&gt;
** Direct and Indirect: 直接和间接光照都将完全烘焙。这是默认且推荐的天空光行为，因为在 Unity 中没有实时版本可以模拟它们。&lt;br /&gt;
** Indirect only: 假定实时光源提供直接贡献；仅烘焙间接光照。&lt;br /&gt;
&lt;br /&gt;
如果天空光的设置与当前场景的天空盒不匹配，将出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match this light to scene skybox: 将活动天空盒材质的通用设置复制到 Bakery 天空光。当前仅支持使用 “Skybox/Cubemap” 或 “Skybox/Bakery skybox” 着色器的天空盒。&lt;br /&gt;
* Match scene skybox to this light: 将 Bakery 天空光的通用设置复制到场景天空盒。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bakery Light Mesh ===&lt;br /&gt;
[[File:Image29.png|thumb|Left: Samples Near = 0, Samples Far = 4096.&amp;lt;br&amp;gt;&lt;br /&gt;
Middle: Samples Near = 0, Samples Far = 128.&amp;lt;br&amp;gt;&lt;br /&gt;
Right: Samples Near = 16, Samples Far = 128.&amp;lt;br&amp;gt;&lt;br /&gt;
请注意，光照效果看起来相似，但使用的合并采样数量更少。]]&lt;br /&gt;
任何形状的自发光网格。应与 Mesh Renderer 组件或设置为 Area 模式的 Light 组件一起使用。&lt;br /&gt;
&lt;br /&gt;
* Color：颜色&lt;br /&gt;
* Intensity：线性颜色倍增器&lt;br /&gt;
* Cutoff：最大光照距离。Bakery 会在接近该限制时额外衰减正确的平方反比衰减。当 Cutoff 值刚好对应物理衰减变得非常暗的位置时效果最佳。Cutoff 可提升烘焙性能，也可以设置为非常高（不可达）的值以保证完全正确性。&lt;br /&gt;
* Self Shadow：决定光源网格自身是否投射阴影。此选项同时启用更精确的光照算法。&lt;br /&gt;
* Samples Near：影响靠近网格的光照质量。典型值为 16 到 64，仅当 Self Shadow 开启时可用。&lt;br /&gt;
* Samples Far：影响远离网格的光照质量。典型值为 4 到 4096。&lt;br /&gt;
&lt;br /&gt;
Bakery 基于光源表面距离混合两种不同的区域光算法。靠近光源时，算法类似 GI，而远处光源被近似为虚拟点光云。&lt;br /&gt;
&lt;br /&gt;
{{note| &amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;光源网格自身不会接收光照，也不会被烘焙到光照贴图中。&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;一个拥有大量多边形的光源网格比烘焙多个简单的光源网格要快&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;如果结果总是脏/噪点较多，可以尝试将 Samples Near 设置为 0，这样只使用 VPL 算法。对于不需要精度的简单光源（如建筑物的窗户光），这也非常有用。&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;}}  &lt;br /&gt;
[[File:Dd99d-QU0AEKFBK.jpg|thumb|弯曲的光源网格]]  &lt;br /&gt;
* Bitmask：用于排除此光源影响特定 Lightmap Groups 的开关列表。  &lt;br /&gt;
* Baked contribution：决定烘焙哪种类型的光照数据。仅在 Indirect 或 Shadowmask 模式下可见。可能的值：  &lt;br /&gt;
** Direct and Indirect：完全烘焙直接和间接光贡献。这是默认且推荐的光源网格行为，因为 Unity 中没有实时版本可以模拟它们。  &lt;br /&gt;
** Indirect only：实时光源提供直接光贡献，仅烘焙间接光。  &lt;br /&gt;
** Shadowmask and Indirect：实时光源提供直接光贡献，但静态几何体的阴影会烘焙到单独的贴图。动态和静态阴影将混合在一起。间接光照将照常烘焙。目前仅 HDRP（和自定义渲染器）支持混合区域光。  &lt;br /&gt;
** Direct, Indirect, Shadowmask (custom lighting only)：与 Direct and Indirect 相同，但同时生成 Shadowmask 并分配用于自定义着色器。  &lt;br /&gt;
* Indirect intensity：非物理 GI 倍增器。自然光照应设为 1，但可修改以实现更风格化的场景。  &lt;br /&gt;
* Shadowmask with falloff：将完整光衰减烘焙进 Shadowmask（仅对自定义着色器有用）。  &lt;br /&gt;
&lt;br /&gt;
如果网格材质和光源设置不匹配，将出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match light to material：将网格材质或区域光的通用设置复制到 Bakery 光源。&lt;br /&gt;
* Match material to light：将 Bakery 光源的通用设置复制到网格材质或区域光。&lt;br /&gt;
&lt;br /&gt;
==== Light Mesh 与自发光材质的区别 ====&lt;br /&gt;
自发光材质：&lt;br /&gt;
&lt;br /&gt;
* 在 GI 计算中传播光线，因此是“免费的”，无论有多少网格是自发光的。&lt;br /&gt;
* 小而明亮的光可能会产生不准确或有噪点的结果，这取决于 GI 的采样数量。&lt;br /&gt;
* 由于 Bakery 中 GI 的工作方式，它必须占用光照贴图空间，因此可能会浪费空间。同时，这意味着自发光对象需要有效的 UV，并且必须启用“投射阴影”。&lt;br /&gt;
&lt;br /&gt;
Light Mesh：&lt;br /&gt;
&lt;br /&gt;
* 光照会为每个光源单独计算，因此比自发光材质慢。&lt;br /&gt;
* 设计用于为小而明亮的光提供干净的光照效果，即使距离很远也能保持效果。&lt;br /&gt;
* 不占用光照贴图空间。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Point Light ===&lt;br /&gt;
[[File:Image11.png|thumb|左：“Shadow Spread” = 0.5，右：“Shadow Spread” = 1。]]&lt;br /&gt;
点光源，没有面积。尽管在物理上不可能，但在游戏中很有用，并且是匹配 Unity 点光源和聚光灯的唯一方式。&lt;br /&gt;
{{note| 聚光灯只是带有额外投影遮罩的点光源。}}&lt;br /&gt;
&lt;br /&gt;
* Color: 颜色&lt;br /&gt;
* Intensity: 线性色彩倍增&lt;br /&gt;
* Shadow spread: 阴影模糊度。虽然点光源没有面积，但通常希望它仍能产生模糊阴影。为此，阴影被模拟为从球形区域光源投射。此参数定义了虚拟球体的半径，直接影响阴影模糊度。&lt;br /&gt;
* Physical falloff: 如果启用，将使用正确的平方反比衰减，并在边界附近额外衰减。否则将尝试模拟 Unity 的衰减。&lt;br /&gt;
* Falloff min size: 详见 [[Point Light Attenuation]] 部分。&lt;br /&gt;
* Range: 如果物理衰减被禁用，则等于 Unity 的光源范围；如果启用，只会在边缘轻微衰减物理衰减。&lt;br /&gt;
* Samples: 影响阴影质量。典型值为 1 到 512。设置为 0 将使该光源的阴影消失。&lt;br /&gt;
  [[File:Image10.png|thumb|从左到右：Omni，Cookie（默认聚光灯纹理），Cubemap，IES。]]&lt;br /&gt;
* Projection mask: 遮罩/Cookie 类型。选项：&lt;br /&gt;
** Omni: 无遮罩，相当于 Unity 的点光源。&lt;br /&gt;
** Cookie: 纹理投影遮罩。附加选项：&lt;br /&gt;
*** Cookie texture: 2D 纹理资源。Bakery 包含原始 Unity 聚光灯纹理（名为 ftUnitySpotTexture），可用于模拟。&lt;br /&gt;
*** Angle: 纹理投影角度（类似 Unity 聚光灯）。&lt;br /&gt;
*** Correct distortion: 修正宽角下直线可见的 cookie 失真。&lt;br /&gt;
** Cubemap: 立方体贴图投影遮罩。附加选项：&lt;br /&gt;
*** Projected cubemap: 立方体贴图资源。&lt;br /&gt;
** IES: 光照由 IES 文件数据调制。附加选项：&lt;br /&gt;
*** IES file: .ies 扩展名文件。&lt;br /&gt;
* Bitmask: 用于排除该光源影响特定 Lightmap Groups 的开关列表。&lt;br /&gt;
* Baked contribution: 决定应烘焙哪种类型的光照数据。仅在 Indirect 或 Shadowmask 模式下可见。可能值：&lt;br /&gt;
** Direct and Indirect: 直接光和间接光完全烘焙。&lt;br /&gt;
** Indirect only: 实时光提供直接光，仅烘焙间接光。&lt;br /&gt;
** Shadowmask and Indirect: 实时光提供直接光，但静态几何体阴影烘焙到单独贴图中，动态和静态阴影混合，间接光正常烘焙。&lt;br /&gt;
** Direct, Indirect, Shadowmask (custom lighting only): 与 Direct and Indirect 相同，同时生成 Shadowmask 用于自定义着色器。&lt;br /&gt;
* Indirect intensity: 该光的非物理 GI 倍增。自然光应为 1，可根据风格化场景修改。&lt;br /&gt;
* Shadowmask with falloff: 将完整光衰减（除距离外）烘焙到 Shadowmask（仅自定义着色器有用）。&lt;br /&gt;
* Legacy sampling: 使用 Bakery 原始更偏置的阴影采样策略。产生无噪点阴影，但宽半影可能出现条纹。禁用后使用无偏但更有噪点的技术。&lt;br /&gt;
&lt;br /&gt;
如果同一对象同时启用了 Unity 和 Bakery 光源，且设置不匹配，则会出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match lightmapped to real-time: 将 Unity 光的常用设置复制到 Bakery 光。&lt;br /&gt;
* Match real-time to lightmapped: 将 Bakery 光的常用设置复制到 Unity 光。&lt;br /&gt;
&lt;br /&gt;
{{note| 从物理角度来看，Bakery 点光源的“Intensity”为 Candela 除以 Pi。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Volume ===&lt;br /&gt;
[[File:Voldemo notlonely.gif|由 BakeryVolume 照亮的动态门（动态 GIF，由 NOTLonely 制作）]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
体积（Volumes）生成存储每个体素光探针的 3D 纹理（L1 球面调和和阴影贴图），使其成为常规 Unity 光探针的可行替代方案。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Unity Light Probes&lt;br /&gt;
! Unity LPPV&lt;br /&gt;
! Bakery Volumes&lt;br /&gt;
|-&lt;br /&gt;
| 手动放置每个光探针&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 否&lt;br /&gt;
|-&lt;br /&gt;
| 在一个物体上插值多个光探针&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 运行时可移动&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 可以放入预制件&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 完整脚本 API&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| “Ringing” 伪影&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 可能出现&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 可能出现&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 已修正&lt;br /&gt;
|-&lt;br /&gt;
| 去噪&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 运行时开销&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | CPU：低开销；GPU：低开销&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | CPU：中等开销；GPU：中等开销&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#e4ead3;&amp;quot; | CPU：无开销；GPU：中等开销&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bakery Volume 是一个与一组 3D 纹理（3 个 SH 纹理和一个可选的 shadowmask）关联的边界盒，使其非常易于使用和编程。Volumes 可以在运行时轻松地交换、移动、加载或卸载，也可以与预制件关联。它们不需要任何 Light Probe Groups 或手动探针布置；整个 Volume 都由均匀的探针体素网格填充。光/影泄漏会自动像处理光照贴图一样修复（尽管对于较大的体素尺寸，薄的双面墙可能会出现问题，但可以通过在不同侧使用不同 Volume 避免）。由于体素网格的均匀特性，也可以对其应用类似光照贴图的降噪，这是常规光探针无法做到的。此外，Bakery 着色器使用 [https://drive.google.com/file/d/1MK6Clw93q8ljijRjb4gQOzzaIjn1uF9Y/view Geomerics] 采样技巧，完全消除了高对比度 HDR 光照下 SH 有时会产生的 “ringing” 伪影。&lt;br /&gt;
&lt;br /&gt;
因此，Volumes 可以为动态物体生成干净、精细、高质量的烘焙光照（即来自静态物体并影响动态物体的光照，而不是相反）。&lt;br /&gt;
&lt;br /&gt;
Volume 方法的唯一缺点是每像素着色开销较高。其开销类似于 LPPV（随着屏幕上受体素影响的像素数量而缩放），但与 LPPV 不同的是，一旦烘焙完成，Volumes 本身不会再更新。多个 Volume 的混合可以通过稍微重叠它们来避免。&lt;br /&gt;
&lt;br /&gt;
====设置 Volume 变换====&lt;br /&gt;
[[File:Bvolgizmo.jpg|thumb|Volume 控制柄]]&lt;br /&gt;
当 BakeryVolume 被添加到一个 GameObject 时，场景视图中会出现一个边界盒控制柄。拖动小方块即可缩放它。&lt;br /&gt;
&lt;br /&gt;
还有其他方法可以更改 Volume 的大小和位置：&lt;br /&gt;
&lt;br /&gt;
* 将任何可渲染的 GameObject 拖入 “Wrap to object” 字段。Volume 会包裹该对象（及其子对象），以将它们完全包含在内。&lt;br /&gt;
* 如果同一个对象上添加了 Box Collider，则会出现 “Set from box collider” 和 “Set to box collider” 按钮。可以用它们快速在 Volume 和 Collider 之间复制数值。&lt;br /&gt;
&lt;br /&gt;
====分辨率====&lt;br /&gt;
当启用 “Adaptive resolution” 时，体素数量由 “Voxels per unit” 控制。禁用它可以手动输入分辨率。对于大多数 1 单位 = 1 米 的游戏来说，一个合理的 “Voxels per unit” 值是 2，但在某些情况下（例如动态门）使用较小但更高分辨率的 Volume 会更有利。&lt;br /&gt;
&lt;br /&gt;
====其他设置====&lt;br /&gt;
&lt;br /&gt;
* Enable baking: 是否需要（重新）计算 Volume？禁用可防止覆盖已有数据。&lt;br /&gt;
* Denoise: 在烘焙 Volume 后应用去噪。推荐用于高分辨率 Volume。避免用于覆盖许多光源的低分辨率 Volume，因为去噪器难以区分实际内容和噪声。&lt;br /&gt;
* Global: 自动将此 Volume 分配给所有兼容 Volume 的 Shader，除非它们有覆盖设置。内部会调用 Shader.SetGlobalTexture()/SetGlobalVector()。&lt;br /&gt;
====使用方法====&lt;br /&gt;
Volumes 可以分配给使用 Volume 感知 Shader 的对象。Bakery 自带实现该功能的 “Bakery Standard” Shader，以及 HDRP 和 URP 的 Shader 图。请查看 example_volumes 场景，了解应用 Volume 的各种方式。&lt;br /&gt;
&lt;br /&gt;
====提示====&lt;br /&gt;
&lt;br /&gt;
* 确保查看示例。&lt;br /&gt;
* 如果两个 Volume 相连，让它们略微重叠。重叠大小应等于最大动态对象的尺寸。这样在运行时简单切换 Volume 就能正常工作。&lt;br /&gt;
* 仅在动态对象实际可达的区域放置 Volume。例如，使用玩家高度限制 Volume 的高度。&lt;br /&gt;
&lt;br /&gt;
====旋转 Volumes====&lt;br /&gt;
如果启用 “Rotate around Y” 选项，Volumes 可以绕 Y 轴旋转。旋转开销非常低，只使用 2 个额外的浮点数据（预计算的角度 sin/cos）。&lt;br /&gt;
&lt;br /&gt;
还可以在运行时旋转 Volumes（Experimental -&amp;gt; “Support rotation after bake” 以及 Bakery Shader 中的类似选项），这种情况下 Volume 必须在初始旋转为零时进行烘焙。&lt;br /&gt;
&lt;br /&gt;
在 URP 中，这种动态旋转可以与 `BakeryURPVolumeGraphRotatable.shadergraph` 一起使用。&lt;br /&gt;
&lt;br /&gt;
对于全局 Volume，动态旋转会在组件被（重新）启用或调用 `volume.SetGlobalParams()` 时更新。使用局部旋转 Volume 时，需要手动在材质或 MaterialPropertyBlock 上设置旋转：&lt;br /&gt;
{{code|&amp;lt;nowiki&amp;gt;SetMatrix(&amp;quot;_VolumeMatrix&amp;quot;, volume.GetMatrix())&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
====技术信息====&lt;br /&gt;
Volumes 可以自动工作（查看示例场景），也可以通过脚本控制其使用方式。&lt;br /&gt;
&lt;br /&gt;
可以通过组件的以下公共属性获取 Volume 数据：&lt;br /&gt;
&lt;br /&gt;
* `bakedTexture0`：存储 L0 RGB 系数和 L1 Z 红色通道在 alpha 中。&lt;br /&gt;
* `bakedTexture1`：存储 L1 X RGB 系数和 L1 Z 绿色通道在 alpha 中。&lt;br /&gt;
* `bakedTexture2`：存储 L1 Y RGB 系数和 L1 Z 蓝色通道在 alpha 中。&lt;br /&gt;
* `bakedMask`：存储体积阴影遮罩。&lt;br /&gt;
* `bounds`：Volume 的包围盒。&lt;br /&gt;
&lt;br /&gt;
所有 `bakedTexture*` 使用 RGBAHalf（每体素 8 字节）格式，mask 使用 ARGB32（每体素 4 字节）。阴影遮罩也可以使用单通道 R8 格式（每体素 1 字节）。&lt;br /&gt;
&lt;br /&gt;
因此 Volume 的字节大小 = width * height * depth * 3 * 8 + （仅当使用阴影遮罩时）width * height * depth * 4（或使用 R8 mask 时为 width * height * depth）。&lt;br /&gt;
&lt;br /&gt;
[[使用手册#Compress_volumes|可以对 Volume 启用纹理压缩]]，使其体积显著减小。&lt;br /&gt;
&lt;br /&gt;
采样 Volume 需要特殊 Shader，这些 Shader 已包含在 Bakery 中。要在自定义 Shader 中添加 Volumes，请查看 HDRP/URP 包中包含的 `BakeryVolume_float()` 函数（位于 `BakeryDecodeLightmap.hlsl`）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Light Filter ===&lt;br /&gt;
[[File:Output optimized.gif|彩色玻璃，如在 &amp;quot;Bakery Real-Time Preview&amp;quot; 中所见。Bakery lightmapper 烘焙出的结果相同。]]&lt;br /&gt;
&lt;br /&gt;
将渲染器标记为光过滤器（Light Filter）。过滤器会用其颜色着色所有直接和间接光线，类似于现实中的光学滤镜，从而实现彩色透明效果（例如彩色玻璃）。唯一的参数是用于着色的纹理。&lt;br /&gt;
&lt;br /&gt;
* 光过滤器对象仍然会像其他对象一样接收光照贴图。&lt;br /&gt;
* 过滤器不会散射或模糊光线（如需此效果，请尝试 [[Subsurface_scattering|Subsurface Scattering]] 或 [[使用手册#Backface_GI|Backface GI]]）。&lt;br /&gt;
* 过滤器可以产生带颜色的阴影。如果灯光使用 [[使用手册#Shadowmask|Shadowmask]] 模式，则结果只会保存 R 通道（因为 Unity 仅支持单通道遮罩）。对于完全烘焙的阴影，则没有限制。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Sector ===&lt;br /&gt;
参见 '''[[Partial_scene_baking|Partial scene baking]]'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Always Render ===&lt;br /&gt;
如果添加到一个物体上，Bakery 在烘焙时将始终考虑该物体，即使它的 Renderer 被禁用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
=== Bakery Pack As Single Square ===&lt;br /&gt;
如果添加到一个物体上，Bakery 会将该物体及其子物体的 UV 视为单个组合方块，在自动图集打包或 Lightmap Group 的 Pack Atlas 模式下，它们之间永远不会被移动。整个子层级将作为一个整体打包。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
=== Bakery Shared LOD UV ===&lt;br /&gt;
如果添加到一个 LODGroup 上，将标记所有同名 LOD 共享同一个光照贴图。默认情况下，每个 LOD 网格会获得独立的光照贴图，占用图集空间；但如果已知同一个物体的 LOD 拥有相似的 UV2（或者在没有 UV2 且 UV1 不重叠的情况下），它们可以映射到图集的同一部分，从而节省内存。&lt;br /&gt;
这种技术也称为 [https://github.com/laurenth-personal/LODLightmapScripts/ Lightmap Stealing]。&lt;br /&gt;
&lt;br /&gt;
= 材质兼容性 =&lt;br /&gt;
&lt;br /&gt;
=== 漫反射和发光 ===&lt;br /&gt;
Bakery 利用 [https://docs.unity3d.com/Manual/MetaPass.html Meta Pass] 系统支持大多数 Unity 材质。所有内置、Surface、URP 和 HDRP 着色器都已经定义了正确的 Meta Pass。&lt;br /&gt;
&lt;br /&gt;
如果你使用的是 Unlit 着色器，需要按照 Unity 文档手动添加 Meta Pass。&lt;br /&gt;
&lt;br /&gt;
如果未定义该 Pass，Bakery 将假定 {{codeVar|_MainTex}}、{{codeVar|_BaseColorMap}} 或 {{codeVar|_Color}}（如果未设置纹理）为材质的漫反射（Albedo），并将 {{codeVar|_EmissionMap}} 和 {{codeVar|_EmissionColor}} 作为发光颜色。&lt;br /&gt;
&lt;br /&gt;
为了使发光生效，[https://docs.unity3d.com/ScriptReference/Material-globalIlluminationFlags.html Material.globalIlluminationFlags] 必须设置为 [https://docs.unity3d.com/ScriptReference/MaterialGlobalIlluminationFlags.BakedEmissive.html MaterialGlobalIlluminationFlags.BakedEmissive]。标准着色器会自动设置此值。&lt;br /&gt;
&lt;br /&gt;
=== 不透明度 ===&lt;br /&gt;
[[File:Upload 2019-1-25 0-4-30.png|thumb|材质参数被转换为 Cutout（默认）]]&lt;br /&gt;
[[File:Alphacombos dither.jpg|thumb|通过“Dither Transparency”选项添加半透明值]]&lt;br /&gt;
[[File:Alphacombos filter.jpg|thumb|Light Filter 组件用于红色平面，生成彩色阴影]]&lt;br /&gt;
&lt;br /&gt;
默认情况下，Bakery 始终从 {{codeVar|_MainTex}}、{{codeVar|_BaseColorMap}} 或 {{codeVar|_BaseMap}} 的 alpha 值获取全分辨率的不透明度，并将其视为 Cutout（1 位透明）。&lt;br /&gt;
&lt;br /&gt;
当启用 '''Dither Transparency''' 选项时，半透明值会自动转换为可变蓝噪声，然后被滤波/模糊，产生部分透明效果（以前可以通过自定义手动抖动贴图实现，但从 v1.97 起自动完成）。&lt;br /&gt;
&lt;br /&gt;
为了使不透明度生效，着色器的 [https://docs.unity3d.com/Manual/SL-SubShaderTags.html RenderType 标签] 必须为以下值之一：&lt;br /&gt;
&lt;br /&gt;
* {{codeVar|Transparent}}&lt;br /&gt;
* {{codeVar|TransparentCutout}}&lt;br /&gt;
* {{codeVar|TreeLeaf}}&lt;br /&gt;
&lt;br /&gt;
如果存在名为 {{codeVar|_Cutoff}} 的属性，它将影响 Cutout（因此 Standard 着色器的 Cutoff 滑块会自动生效）。&lt;br /&gt;
&lt;br /&gt;
在没有 Dither Transparency 的情况下，如果材质 RenderType 为 {{codeVar|Transparent}} 或 {{codeVar|TreeLeaf}}，则 {{codeVar|_Color}} 的 alpha 值会额外修改 Cutoff：&lt;br /&gt;
''finalCutoff = 1 - (1 - cutoff) * alpha''&lt;br /&gt;
&lt;br /&gt;
对于彩色透明效果，请使用 [[使用手册#Bakery_Light_Filter|Light Filter]] 组件。&lt;br /&gt;
&lt;br /&gt;
有关漫反射半透明效果，请参考 [[#Backface GI|Backface GI]] 和 [[subsurface scattering]]。&lt;br /&gt;
&lt;br /&gt;
==== Alpha Meta Pass ====&lt;br /&gt;
从 v1.9 起，Bakery 还支持指定基于自定义着色器的透明度，但这需要使用兼容的着色器。要使用 ''Alpha Meta Pass''，需要执行以下步骤：&lt;br /&gt;
&lt;br /&gt;
* 在着色器中添加一个名为 '''BAKERY_META_ALPHA_ENABLE''' 的属性。例如：&lt;br /&gt;
  {{code|&amp;lt;nowiki&amp;gt;[HideInInspector] BAKERY_META_ALPHA_ENABLE (&amp;quot;Enable Bakery alpha meta pass&amp;quot;, Float) = 1.0&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
* 确保 RenderType 标签设置为上文提到的某个值。&lt;br /&gt;
* 声明一个名为 '''META_BAKERY''' 的 Pass。&lt;br /&gt;
* 在该 Pass 中检查 '''unity_MetaFragmentControl.w''' 是否非零，如果是，则返回计算出的透明度值。&lt;br /&gt;
&lt;br /&gt;
示例可参考包内的 ''Baked_Alpha_meta.shader''。&lt;br /&gt;
&lt;br /&gt;
注意：当前 Alpha Meta Pass 需要将 Light Probe Mode 设置为 L1 或 L2。&lt;br /&gt;
&lt;br /&gt;
=== Normal mapping ===&lt;br /&gt;
自定义表面法线可以与 [[#Baked Normal Maps|烘焙法线贴图]] 模式一起使用。不幸的是，Unity 的 Meta Pass 默认不输出法线信息，因此默认情况下，法线取自名为 {{codeVar|_BumpMap}} 的贴图，并通过 {{codeVar|_MainTex_ST}} 进行额外变换。&lt;br /&gt;
&lt;br /&gt;
然而，可以制作完全自定义的着色器，带有高级法线映射功能（例如混合多层法线），并使其兼容烘焙。要实现这一点，需要执行以下步骤：&lt;br /&gt;
&lt;br /&gt;
1. 在着色器中定义一个 Meta Pass，具体方法请参考 [https://docs.unity3d.com/Manual/MetaPass.html#ExampleMetaPassUnity 文档]。&lt;br /&gt;
&lt;br /&gt;
2. 将该 Pass 命名为 {{codeVar|&amp;quot;META_BAKERY&amp;quot;}}，而不仅仅是 {{codeVar|&amp;quot;META&amp;quot;}}。&lt;br /&gt;
&lt;br /&gt;
3. 包含文件 {{codeVar|&amp;quot;BakeryMetaPass.cginc&amp;quot;}}。&lt;br /&gt;
&lt;br /&gt;
4. 添加 {{codeVar|#pragma vertex vert_bakerymt}}。&lt;br /&gt;
&lt;br /&gt;
5. 如果 {{codeVar|unity_MetaFragmentControl.z}} 变量不为 0，着色器应返回世界空间法线。返回的法线应使用 {{codeVar|BakeryEncodeNormal}} 函数编码。&lt;br /&gt;
&lt;br /&gt;
在 Assets/Bakery/examples/shaders 中包含了两个实现了扩展 Meta Pass 的示例着色器。&lt;br /&gt;
&lt;br /&gt;
你也可以复制并修改 BakeryMetaPass.cginc 以满足你的需求，例如从顶点着色器传递额外数据。&lt;br /&gt;
&lt;br /&gt;
=== 正/背面 ===&lt;br /&gt;
无论着色器使用何种剔除模式，Bakery 都将所有背面视为不透明，这意味着任何直接光线都不会穿过背面，就像它不会穿过正面一样。&lt;br /&gt;
然而，如果使用 [[使用手册#Backface_GI|Backface GI]]，背面可以部分发出正面接收到的光照。&lt;br /&gt;
&lt;br /&gt;
= 扩展 Lightmap Parameters 资源 =&lt;br /&gt;
[[File:Lp.jpg|thumb|扩展 Lightmap Parameters]]&lt;br /&gt;
类似于 Bakery 的 [[#Bakery_Lightmap_Group_Selector|Lightmap Group]]，Unity 也有 [https://docs.unity3d.com/Manual/class-LightmapParameters.html Lightmap Parameters]，可以作为资源创建并分配给 Mesh Renderer。它们的逻辑有相似之处也有不同之处：&lt;br /&gt;
&lt;br /&gt;
* Lightmap Group 的主要用途是将多个对象组合到同一个图集。此外，它还允许覆盖该图集的烘焙设置。&lt;br /&gt;
* Lightmap Parameters 主要用于覆盖对象的烘焙设置，但通过使用“Baked Tag”选项，它们也可以影响打包：具有不同 Baked Tag 的对象将永远不会共享同一个图集。&lt;br /&gt;
&lt;br /&gt;
由于有些用户更习惯 Lightmap Parameters 的工作流程，Bakery 现在支持并扩展了它们：&lt;br /&gt;
&lt;br /&gt;
* Bakery 会遵循 Baked Tag 设置。&lt;br /&gt;
* Lightmap Parameters UI 中将显示额外的 Bakery 特定选项。有关其含义，请参考 [[#Bakery_Lightmap_Group_Selector|Lightmap Group]] 部分。&lt;br /&gt;
&lt;br /&gt;
= 项目设置 =&lt;br /&gt;
一些全局设置可以在 Project Settings -&amp;gt; Bakery GPU Lightmapper 中调整（此选项仅在 Unity 2018.3 或更新版本可见；旧版本请编辑 BakeryProjectSettings.asset）：&lt;br /&gt;
&lt;br /&gt;
* Mipmap lightmaps：启用光照贴图的 mipmap。随着图集变小，可能会导致 UV 图块之间的泄漏；另一方面，它可以减少远处高分辨率光照贴图的锯齿。总体上，建议对非常远的物体使用单独烘焙的 LOD 以及较低分辨率的光照贴图。&lt;br /&gt;
* Color file format：常规 HDR 颜色光照贴图的文件格式。可选值：&lt;br /&gt;
**HDR：Radiance HDR 格式（默认）。可用多种图像编辑器打开。&lt;br /&gt;
**Asset：Unity 原生格式。可自定义 mipmap 数量。&lt;br /&gt;
* Mask/Direction file format：额外 LDR 地图的格式，如阴影遮罩或方向数据。可选值：&lt;br /&gt;
**TGA：8 位 Targa（默认）。&lt;br /&gt;
**PNG：8 位 PNG。通常比 TGA 占用更少磁盘空间。&lt;br /&gt;
**Asset：Unity 原生格式。可自定义 mipmap 数量。&lt;br /&gt;
* Compress lightmaps：定义光照贴图资源的压缩行为。压缩光照贴图占用更少的显存，但可能会出现一些视觉伪影（例如色带或色斑），具体取决于压缩类型（移动端压缩问题请参见[[Troubleshooting#I_have_an_Android_project.2C_and_lightmaps_don.27t_look_good|此处]]）。可选值：&lt;br /&gt;
*** Compress but allow overriding asset: 新的光照贴图将在启用压缩的情况下创建。创建后，可以在 Inspector 中更改它们的压缩设置。修改后的值将在重新烘焙后保留（默认）。&lt;br /&gt;
*** Force compress: 始终压缩所有光照贴图。&lt;br /&gt;
*** Force no compress: 始终生成未压缩的光照贴图。&lt;br /&gt;
* High quality direction: 为方向贴图启用“高”质量压缩。实际格式取决于平台。例如在 PC 上，它会从 DXT1 改为 BC7，这提供了更高的质量，但 VRAM 使用量会翻倍。&lt;br /&gt;
* Texel padding (default atlas packer): 定义在使用默认 atlas 打包器时，在光照贴图 atlas 中对象 UV 布局之间添加多少空白 texel。&lt;br /&gt;
* Texel padding (xatlas packer): 同上，但在使用 xatlas 时。&lt;br /&gt;
* Alpha Meta Pass resolution multiplier: 乘以 [[使用手册#Alpha_Meta_Pass|Alpha Meta Pass]] 的分辨率，使在低分辨率光照贴图烘焙时仍能实现精确的基于 Shader 的切割效果。&lt;br /&gt;
* Volume render mode: 为所有 [[使用手册#Bakery_Volume|Volumes]] 使用哪种 [[使用手册#Render_mode|渲染模式]]？Auto 使用当前活动的渲染模式（默认）。&lt;br /&gt;
* Delete previous lightmaps before bake: 在烘焙新光照贴图之前，实际删除该场景中所有之前渲染的光照贴图文件。&lt;br /&gt;
* Log level: 定义烘焙过程中在控制台输出的信息量。可能的值：&lt;br /&gt;
** 0: 不输出任何内容。&lt;br /&gt;
** 1: 仅输出进度信息。&lt;br /&gt;
** 2: 仅输出警告。&lt;br /&gt;
** 3: 输出全部信息。&lt;br /&gt;
* Alternative scale in lightmap: 使渲染器属性 'Scale in Lightmap' 的行为更类似于 Unity 内置的行为。&lt;br /&gt;
* Align to texture compression blocks with xatlas: 使 xatlas 将 chart 对齐到 4x4 块边界，从而获得更适合压缩的结果。&lt;br /&gt;
* Generate smooth positions: 是否应调整采样位置以防止低多边形几何体在平滑法线下产生错误阴影？在使用法线差异极大的几何体时，可在极少数情况下禁用。技术说明见 [https://ndotl.wordpress.com/2018/08/29/baking-artifact-free-lightmaps/#shadowterm 这篇文章]。&lt;br /&gt;
* Smooth positions per-triangle: 是否应按三角形决定平滑/平面位置？在使用法线差异极大的几何体时，可在极少数情况下禁用。&lt;br /&gt;
* Use 'Receive GI' values: 在渲染器上考虑 “Receive Global Illumination” 值。最初 Bakery 会忽略它。&lt;br /&gt;
* Remove ringing in Legacy light probes: 在 Legacy 模式下启用更柔和的光探针卷积，以防止高对比度区域出现伪影。&lt;br /&gt;
* Always render reflection probes: 在每次 Render/Render Light Probes 后自动渲染反射探针。&lt;br /&gt;
* Ringing removal for L2 light probes: 对 [[使用手册#Light_probe_mode|L2 光探针]] 应用去振铃处理。值越高，探针光照越平滑；这种平滑可以减少 [[https://docs.unity3d.com/6000.2/Documentation/Manual/light-probes-troubleshooting.html](https://docs.unity3d.com/6000.2/Documentation/Manual/light-probes-troubleshooting.html) 振铃] 伪影（如果存在）。&lt;br /&gt;
* Put menu under Tools: 将 Bakery 菜单放入 Tools 菜单下。&lt;br /&gt;
&lt;br /&gt;
如果任何格式设置为 Asset 且启用 mipmapping，会显示额外选项：&lt;br /&gt;
&lt;br /&gt;
* Maximum mipmap count: 定义 mipmap 的最大数量。例如，设置为 2，则 8K 光照贴图仅有两个额外 mipmap：4K 和 2K。更低分辨率将被省略，从而在 mipmapping 过程中限制泄漏伪影。&lt;br /&gt;
&lt;br /&gt;
= SkinnedMeshRenderer 支持 =&lt;br /&gt;
Bakery 自 v1.65 起支持蒙皮网格 (skinned meshes)。但是，有一些限制：&lt;br /&gt;
&lt;br /&gt;
* 某些 Unity 版本不支持蒙皮网格的 UV1，并会悄无声息地忽略 “Generate lightmap UVs”。请确保场景中实际使用的网格具有 UV1，并在可能的情况下使用非重叠的 UV0；&lt;br /&gt;
* UV 填充调整在蒙皮网格上不起作用（Unity 在尝试调用 Unwrap 函数时似乎会崩溃）；&lt;br /&gt;
* 蒙皮网格不能使用每顶点光照贴图 (per-vertex lightmaps)（引擎不支持带蒙皮的 additionalVertexStreams）。&lt;br /&gt;
&lt;br /&gt;
= Shader Tweaks =&lt;br /&gt;
[[File:Image2.jpg|thumb|左：默认双线性过滤。右：双三次过滤。]]&lt;br /&gt;
[[File:Image34.jpg|thumb|左：两个阴影都已烘焙。&amp;lt;br&amp;gt;中：球形阴影为动态，另一个阴影为静态。通过相乘组合在一起。&amp;lt;br&amp;gt;右：与中间相同，但使用默认最小值组合。]]&lt;br /&gt;
&lt;br /&gt;
Bakery 提供可选的着色器修改，可以应用到 Unity 着色器上，以改善光照贴图采样并使实时光照更接近光照贴图效果。着色器调整菜单可以通过 Bakery-&amp;gt;Shader Tweaks 访问。&lt;br /&gt;
&lt;br /&gt;
这些选项会修补基础 Unity 着色器包含文件（来自 CGIncludes 文件夹），这些文件被大多数内置和第三方着色器使用。所有修改都会影响使用该版本编辑器打开的所有项目，但也可以轻松恢复。着色器调整会影响标准和表面着色器的工作方式。HDRP、URP 以及其他 SRP 不受影响。&lt;br /&gt;
&lt;br /&gt;
所有可用修改显示为按钮。点击按钮应用修改，按钮将保持按下状态。再次点击按钮即可移除修改。目前可用选项：&lt;br /&gt;
&lt;br /&gt;
{{note| 可能需要以管理员身份运行 Unity 编辑器以使 CGIncludes 修补生效}}&lt;br /&gt;
&lt;br /&gt;
* Use bicubic interpolation for lightmaps: 光照贴图将使用双三次插值代替默认双线性。此调整能很好地修复低分辨率光照贴图的许多锯齿边缘。目前仅适用于 DX11 和现代主机，其他平台仍使用双线性。&lt;br /&gt;
* Use multiplication for shadowmask: 使用相乘代替最小值组合静态和动态阴影。出于未知原因，Unity 默认使用最小值操作符，这会产生一些乘法不存在的伪影。&lt;br /&gt;
* Use physical light falloff (forward): 用更物理正确的平方反比替换实时点光/聚光灯的默认衰减。“Range” 只会在边缘略微淡出（与 Bakery 光源启用 Physical Falloff 复选框效果一致）。仅影响 Forward 渲染器。详情见 [[Point Light Attenuation]]。&lt;br /&gt;
* Use physical light falloff (deferred): 同上，但仅影响 Deferred 渲染器。&lt;br /&gt;
&lt;br /&gt;
'''衰减调整在 Unity &amp;gt;2017 版本上可能无法完全生效。此外，SRP 默认已经使用正确的衰减。'''&lt;br /&gt;
&lt;br /&gt;
= Bakery shaders =&lt;br /&gt;
Bakery 包含了自带着色器，支持顶点光照贴图，以及 RNM 和 SH 方向模式。它还允许从方向数据计算近似烘焙高光。&lt;br /&gt;
对于普通颜色光照贴图、阴影遮罩和 Dominant Direction 模式，Bakery 着色器 '''不是必需的'''，因为这些功能大多数 Unity 着色器本身已经支持。&lt;br /&gt;
&lt;br /&gt;
=== Standard render pipeline ===&lt;br /&gt;
'''Bakery/Standard''': 扩展了普通 Standard 着色器。额外选项：&lt;br /&gt;
&lt;br /&gt;
* Allow Vertex Lightmaps: 允许该材质用于 [[Vertex Lightmaps|顶点光照贴图]]。&lt;br /&gt;
* Allow RNM Lightmaps: 允许该材质用于 [[#RNM|RNM 方向模式]]。&lt;br /&gt;
* Allow SH Lightmaps: 允许该材质用于 [[#SH|SH 方向模式]]。&lt;br /&gt;
  {{note| 所有 “Allow” 选项会在着色器中启用特定的代码路径。为了性能考虑，建议每个材质仅使用一个 “allow” 选项。}}&lt;br /&gt;
* Enable Lightmap Specular: 使用 Dominant Direction、RNM 或 SH 方向模式的数据计算烘焙高光。注意，由于信息有限，该效果仅为近似。如果你曾在 Unity 4 中使用烘焙高光，效果应可比。与高度扰动的法线贴图搭配效果最佳，在平面表面上效果不佳。&lt;br /&gt;
* Enable VertexLM directional: 如果存在顶点光照贴图，指定 Dominant Direction 数据存储在顶点中并应被使用。&lt;br /&gt;
* Enable VertexLM SH: 如果存在顶点光照贴图，指定 SH 数据存储在顶点中并应被使用。&lt;br /&gt;
* Enable VertexLM Shadowmask: 如果存在顶点光照贴图，指定阴影遮罩存储在顶点中并应被使用。&lt;br /&gt;
* Enable MonoSH: 将方向贴图视为 MonoSH 贴图。&lt;br /&gt;
[[File:Image5.png|thumb|Standard SH light probe vs non-linear]]&lt;br /&gt;
[[File:Shspec.jpg|thumb|SH specular effect]]&lt;br /&gt;
* Non-linear SH：在 SH 方向模式下，此选项可以增强对比度（更接近真实效果），但会使着色器稍微变慢。该技巧基于 Geomerics 的论文《[https://drive.google.com/file/d/1MK6Clw93q8ljijRjb4gQOzzaIjn1uF9Y/view Reconstructing Diffuse Lighting from Spherical Harmonic Data]》。&lt;br /&gt;
* Non-linear Light Probe SH：与 Non-linear SH 类似，但用于光照探针。在探针的情况下，最显著的好处是消除错误的负值。这种问题常见于具有高对比度、明亮 HDR 光源的场景中。这是球谐函数的固有限制，而不是 Bakery 特有的问题（即使用 Unity 内置光照贴图器也可能出现类似伪影）。&lt;br /&gt;
* Force Bicubic Filter：为所有附加贴图启用双三次滤波。若要实现完整的双三次滤波（包括第一张颜色贴图），建议同时在 [[#Shader Tweaks|Shader Tweaks]] 中启用该功能。&lt;br /&gt;
&lt;br /&gt;
'''Bakery/Standard Specular'''：与 Standard 相同，但用于高光（Specular）工作流程。&lt;br /&gt;
&lt;br /&gt;
=== HDRP &amp;amp; URP ===&lt;br /&gt;
要提取额外的 HDRP/URP 着色器，请打开 Bakery 自带的 Bakery_ShaderGraphHDRP.unitypackage 或 Bakery_ShaderGraphURP.unitypackage。&lt;br /&gt;
在其中，你会找到可在自己 Shader Graph 中使用的 Shader Subgraph，以及一些示例材质。&lt;br /&gt;
&lt;br /&gt;
=== 各着色器功能支持对比 ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! 大多数 Unity 着色器&lt;br /&gt;
! 大多数 HDRP 和 URP 着色器&lt;br /&gt;
! Bakery Standard&lt;br /&gt;
! Bakery HDRP graphs&lt;br /&gt;
! Bakery URP graphs&lt;br /&gt;
|-&lt;br /&gt;
| HDR color lightmaps&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Shadowmask&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是 (&amp;gt;= URP 10.1)&lt;br /&gt;
|-&lt;br /&gt;
| Dominant Direction&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| RNM&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| SH&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Mo否SH&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Lightmap specular&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持 Dominant Direction 和 SH&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持 Dominant Direction&lt;br /&gt;
|-&lt;br /&gt;
| Bicubic filtering&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是,&lt;br /&gt;
通过 [[#Shader Tweaks|Shader Tweaks]] 支持&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是,&lt;br /&gt;
通过 [[#Shader Tweaks|Shader Tweaks]] 支持&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
|-&lt;br /&gt;
| Vertex lightmaps&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 单一颜色，没有每顶点 SH、方向或阴影遮罩（Shader Graph 限制）&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 单一颜色，没有每顶点 SH、方向或阴影遮罩（Shader Graph 限制）&lt;br /&gt;
|-&lt;br /&gt;
| Non-Linear Light Probes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Volumes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Volume shadowmask&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Compressed volumes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{note| 除了普通颜色光照贴图之外，所有功能都至少需要 Shader Model 3.0 才能运行。}}&lt;br /&gt;
{{note| 使用 SH 模式的顶点光照贴图由于插值器数量限制，至少需要 Shader Model 4.0。}}&lt;br /&gt;
{{note| 含有从 Dominant Direction 生成高光的更新版 URP 图表可在 [[Bakery_-_GPU_Lightmapper|主维基页面]] 下载。}}&lt;br /&gt;
&lt;br /&gt;
另请参阅：[[Integrating_Bakery_shader_features_to_custom_shaders| 将 Bakery 着色器特性集成到自定义着色器中]]&lt;br /&gt;
&lt;br /&gt;
= 关于 HDRP/URP 的说明 =&lt;br /&gt;
将该插件导入到 HDRP 或 URP 项目后，一般即可直接使用，但需要注意以下几点：&lt;br /&gt;
&lt;br /&gt;
* 示例场景中同时使用了普通 Standard 着色器以及部分 “Bakery Standard” 着色器。HDRP 和 URP 提供了将项目着色器从 Standard 升级到 Lit 的机制，但无法从 Bakery Standard 升级。请将 Bakery Standard 材质替换为来自 Bakery_ShaderGraphHDRP.unitypackage 或 Bakery_ShaderGraphURP.unitypackage 中的材质。&lt;br /&gt;
&lt;br /&gt;
* 在 HDRP 中，默认 HDRI 天空亮度较高（11），且天空反射默认不会被遮蔽。再加上默认的自动曝光，可能导致某些示例场景几乎不可见，因为它们使用了更低的亮度进行烘焙。此时可将 HDRI 天空亮度降低到 1。HDRI 设置通常位于 Assets/HDRPDefaultResources/DefaultSettingsVolumeProfile 中。&lt;br /&gt;
&lt;br /&gt;
* 在 HDRP 中，如果示例场景中的灯光过亮，可在 Bakery 灯光组件上点击 “match real-time to lightmapped” 按钮。&lt;br /&gt;
&lt;br /&gt;
* 在 HDRP 中建议使用 OpenImageDenoise 2（最佳）或 OptiX 7 去噪器，因为它们对高亮度值更适合。&lt;br /&gt;
&lt;br /&gt;
* 在 HDRP 中，“distance” 与普通 Shadowmask 的切换可直接在 Light 组件上完成，而不是在全局设置中。&lt;br /&gt;
&lt;br /&gt;
* 不要在 Skylight 上使用 “match” 按钮，因为 HDRP 使用的是非常特定的程序化天空着色器。请改为将其烘焙为 HDRI [[How_do_I...#How_do_I_use_Skylight_with_a_procedural_sky_shader.3F|这种方式]]。&lt;br /&gt;
&lt;br /&gt;
* 建议在使用 HDRP 时始终将 Light Probe Mode 设置为 L2 或 L1，因为 HDRP 的渲染器并未针对 Legacy 模式进行优化。&lt;br /&gt;
&lt;br /&gt;
* 最新版本的 HDRP/URP 自带自己的 IES 文件导入器。由于资源类型不匹配，Unity 会将旧版本 Bakery IES 灯光断开连接，使其显示为普通点光源。它们可以重新连接并重新保存。&lt;br /&gt;
&lt;br /&gt;
Bakery 的示例场景是为内置渲染管线设计的，因此在 HDRP/URP 中正确渲染它们需要一些步骤。以下是一些提示；假设新建项目使用默认的 HDRP/URP 设置：&lt;br /&gt;
&lt;br /&gt;
=== 在 HDRP 中查看示例场景 ===&lt;br /&gt;
&lt;br /&gt;
* 导入 Bakery 后，将标准材质升级为 HDRP：Edit-&amp;gt;Rendering-&amp;gt;Materials-&amp;gt;Convert All Built-in Materials To HDRP。&lt;br /&gt;
* 将 Bakery_ShaderGraphHDRP.unitypackage 导入项目，因为它包含实现高级 Bakery 功能的特殊 Shader Graph（对于经典颜色/方向/遮罩光照贴图不需要）。&lt;br /&gt;
* 选择 DefaultSettingsVolumeProfile.asset。在 HDRI Sky 部分，将 Exposure Compensation 设置为 1。否则，与示例场景相比，默认 HDRP 会过亮，因曝光调整而使场景看起来很暗。&lt;br /&gt;
* 选择示例场景中的灯光时，HDRP 会初始化其自身的灯光数据。有时会导致灯光立即变得更亮。点击 “Match real-time to lightmapped” 以同步。&lt;br /&gt;
* 在渲染光探针前，将 Light Probe Mode 设置为 L2。&lt;br /&gt;
* '''example_directional''': 将 Shader 更改为 BakeryDirSpecGraph 以查看烘焙高光（或仅使用常规 HDRP/Lit 用于仅漫反射法线映射）。删除球体，因为当前没有支持逐顶点方向的 Shader Graph。&lt;br /&gt;
* '''example_directional_MonoSH''': 将 Shader 更改为 BakerySpecMonoSHGraph（或 BakeryMonoSHGraph，用于没有高光的略微低成本版本）。删除球体，因为当前没有支持逐顶点 MonoSH 的 Shader Graph。&lt;br /&gt;
* '''example_RNM''': 将 Shader 更改为 BakeryRNMGraph。&lt;br /&gt;
* '''example_SH''': 将 Shader 更改为 BakerySpecSHGraph（或 BakerySHGraph，用于没有高光的略微低成本版本）。删除球体，因为当前没有支持逐顶点 SH 的 Shader Graph。&lt;br /&gt;
* '''example_mixed_directional_mode''': 对 MonoSH/RNM/SH 平面，同样需要不同的 Graph。&lt;br /&gt;
* '''example_lights''': 将顶点光照球体的 Shader 更改为 BakeryVertexColorGraph。&lt;br /&gt;
* '''example_prefabs_bake''': 无需进一步调整。&lt;br /&gt;
* '''example_sectors''': 无需进一步调整。&lt;br /&gt;
* '''example_shadowmask''': 选择 DirectLight 并点击 “Match real-time to lightmapped” 修正亮度。将所有 HDRP 灯光的 Shadowmask Mode 设置为 Shadowmask。&lt;br /&gt;
* '''example_sponza_day''': 将 OpenImageDenoise 2（或 Optix 7，如果不支持）设置为首选去噪器。&lt;br /&gt;
* '''example_sponza_evening''': 将 OpenImageDenoise 2（或 Optix 7，如果不支持）设置为首选去噪器。&lt;br /&gt;
* '''example_subtractive''': HDRP 不支持减法模式。&lt;br /&gt;
* '''example_volumes_simple''': 将火车 Shader 更改为 BakeryVolumeSpecGraph（或 BakeryVolumeGraph，用于没有高光的略微低成本版本）。&lt;br /&gt;
* '''example_volumes_simple_shadowmask''': HDRP 当前不支持 Shadowmask Volumes。&lt;br /&gt;
* '''example_volumes_advanced''': 与 example_volumes_simple 相同。&lt;br /&gt;
* '''example_translucency''': 场景大部分应显示正常。对于 “Dynamic sphere lit by volume”，将 Shader 设置为 BakeryVolumeGraph。&lt;br /&gt;
&lt;br /&gt;
=== 在 URP 中查看示例场景 ===&lt;br /&gt;
&lt;br /&gt;
* 导入 Bakery 后，将标准材质升级为 URP：打开 Assets/Bakery/examples/content，输入 &amp;quot;t:material&amp;quot; 选择所有材质，并仅在 &amp;quot;content&amp;quot; 文件夹下搜索。点击 Edit-&amp;gt;Rendering-&amp;gt;Materials-&amp;gt;Convert Selected Built-in Materials To URP。&lt;br /&gt;
* 将 Bakery_ShaderGraphURP.unitypackage 导入项目，因为它包含实现高级 Bakery 功能的特殊 Shader Graph（对于经典颜色/方向/遮罩光照贴图不需要）。&lt;br /&gt;
* '''example_directional''': 将 Shader 更改为 BakeryURPLit，启用 &amp;quot;Bakery Lightmapped Specular&amp;quot;（或者仅保持常规 URP/Lit 用于仅漫反射法线映射）。删除球体，因为当前没有支持逐顶点方向的 Shader Graph。&lt;br /&gt;
* '''example_directional_MonoSH''': 将 Shader 更改为 BakeryURPLit，将 Bakery Mode 设置为 MonoSH，启用 &amp;quot;Bakery Lightmapped Specular&amp;quot;。在顶点光照球体上也启用 &amp;quot;Per-vertex&amp;quot;。&lt;br /&gt;
* '''example_RNM''': 将 Shader 更改为 BakeryURPLit，将 Bakery Mode 设置为 RNM，启用 &amp;quot;Bakery Lightmapped Specular&amp;quot;。&lt;br /&gt;
* '''example_SH''': 将 Shader 更改为 BakeryURPLit，将 Bakery Mode 设置为 SH，启用 &amp;quot;Bakery Lightmapped Specular&amp;quot;。删除球体，因为当前没有支持逐顶点 SH 的 Shader Graph。&lt;br /&gt;
* '''example_mixed_directional_mode''': 类似地使用 BakeryURPLit 并设置不同的 Bakery Mode（MonoSH、RNM、SH）。非方向性/主方向/烘焙法线贴图可使用常规 URP/Lit。&lt;br /&gt;
* '''example_lights''': 无需进一步调整。&lt;br /&gt;
* '''example_prefabs_bake''': 无需进一步调整。&lt;br /&gt;
* '''example_sectors''': 无需进一步调整。&lt;br /&gt;
* '''example_shadowmask''': 类似于 Built-in 渲染管线，在 Bakery 窗口（或项目 Quality Settings）中取消选中 Distance Shadowmask，以在摄像机附近查看实际烘焙/实时阴影混合效果。&lt;br /&gt;
* '''example_sponza_day''': 在植被材质上启用 alpha clipping。&lt;br /&gt;
* '''example_sponza_evening''': 同 example_sponza_day。&lt;br /&gt;
* '''example_subtractive''': 无需进一步调整。&lt;br /&gt;
* '''example_volumes_simple''': 将火车 Shader 更改为 BakeryURPLit，并将 Bakery Mode 设置为 Volume。可选启用 &amp;quot;Bakery Lightmapped Specular&amp;quot;。&lt;br /&gt;
* '''example_volumes_simple_shadowmask''': 与 example_volumes_simple 相同，但也启用 &amp;quot;Volume Shadowmask&amp;quot;。&lt;br /&gt;
* '''example_volumes_advanced''': 与 example_volumes_simple 相同。&lt;br /&gt;
* '''example_translucency''': 场景大部分应显示正常。对于 &amp;quot;Dynamic sphere lit by volume&amp;quot;，将 Shader 设置为 BakeryURPLit 并将 Bakery Mode 设置为 Volume。&lt;br /&gt;
&lt;br /&gt;
= 升级 Bakery =&lt;br /&gt;
在升级该资源时，建议遵循以下步骤：&lt;br /&gt;
&lt;br /&gt;
* 关闭 Bakery 窗口。&lt;br /&gt;
* 关闭 Unity。&lt;br /&gt;
* 重新打开 Unity。&lt;br /&gt;
* 导入更新后的包。&lt;br /&gt;
&lt;br /&gt;
请注意，如果不先关闭 Unity，导入可能会失败，因为 DLL 文件被锁定（会出现类似 &amp;quot;alphabuffergen.dll: Access is denied.&amp;quot; 的提示）。&lt;br /&gt;
&lt;br /&gt;
如果你移动过 Bakery 文件夹（Assets/Bakery 和 Assets/Editor/x64/Bakery）到其他位置，可能需要在更新前将它们移回原处，以避免出现两个冲突的包副本。&lt;br /&gt;
&lt;br /&gt;
= 脚本 API =&lt;br /&gt;
&lt;br /&gt;
== 基本用法 ==&lt;br /&gt;
&lt;br /&gt;
获取并修改渲染设置：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ftLightmapsStorage storage = ftRenderLightmap.FindRenderSettingsStorage();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
可以在 ftLightmapsStorage.cs 中查看可用设置的完整列表。&lt;br /&gt;
&lt;br /&gt;
获取 lightmapper 实例并（重新）加载设置：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap bakery = ftRenderLightmap.instance != null ? ftRenderLightmap.instance : new ftRenderLightmap();&lt;br /&gt;
bakery.LoadRenderSettings();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
渲染光照贴图（如果设置为 L1 或 L2 模式，也会渲染探针）：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;bakery.RenderButton(bool showMsgWindows)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
仅渲染光探针：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;bakery.RenderLightProbesButton(bool showMsgWindows)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
仅渲染反射探针：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;bakery.RenderReflectionProbesButton(bool showMsgWindows)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''showMsgWindows''' 指示是否可以显示任何对话框/确认框。如果设置为 false，则抑制显示。&lt;br /&gt;
&lt;br /&gt;
检查烘焙是否正在进行：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.bakeInProgress&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
使用示例请参考 [[Community_extensions#Batch_scene_baker|Batch Scene Baker]] 脚本。&lt;br /&gt;
&lt;br /&gt;
== 额外函数 ==&lt;br /&gt;
&lt;br /&gt;
将一个 ftLightmapsStorage 的所有渲染设置复制到另一个：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmapsStorage.CopySettings(ftLightmapsStorage src, ftLightmapsStorage dest)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
获取全局（每项目）存储对象：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftGlobalStorage gstorage = ftLightmaps.GetGlobalStorage()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
将 ftLightmapsStorage（每场景）的所有渲染设置复制到 ftGlobalStorage（每项目）：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmapsStorage.CopySettings(ftLightmapsStorage src, ftGlobalStorage dest)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
将 ftGlobalStorage（每项目）的所有渲染设置复制到 ftLightmapsStorage（每场景）：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmapsStorage.CopySettings(ftGlobalStorage src, ftLightmapsStorage dest)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
获取包含 Bakery 二进制文件的文件夹路径：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmaps.GetEditorPath()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 额外变量 ==&lt;br /&gt;
&lt;br /&gt;
获取当前临时文件路径（必须先创建 ftRenderLightmap 实例）：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.scenePath&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
获取/设置 UVGBuffer 数据压缩（启用时为 LZ4，否则为 DDS）：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.compressedGBuffer&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
获取/设置输出光照贴图数据压缩（启用时为 LZ4，否则为 DDS）：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.compressedOutput&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 事件 ==&lt;br /&gt;
&lt;br /&gt;
脚本可以订阅 ftRenderLightmap 类中的静态事件。&lt;br /&gt;
&lt;br /&gt;
在完整渲染前调用：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnPreFullRender&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
在 Legacy 光探针模式下，每渲染一个光探针前调用。ProbeEventArgs 是一个结构体，包含 '''pos''' 字段表示当前光探针的位置：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler&amp;lt;ProbeEventArgs&amp;gt; OnPreRenderProbe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
在 Legacy 光探针渲染完成后调用：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnFinishedProbes&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
在完整渲染完成后调用：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnFinishedFullRender&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
在反射探针渲染前调用：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnPreReflectionProbeRender&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
在反射探针渲染完成后调用：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnFinishedReflectionProbes&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mr F</name></author>
		
	</entry>
	<entry>
		<id>https://geom.io/bakery/wiki/index.php?title=%E4%BD%BF%E7%94%A8%E6%89%8B%E5%86%8C&amp;diff=1835</id>
		<title>使用手册</title>
		<link rel="alternate" type="text/html" href="https://geom.io/bakery/wiki/index.php?title=%E4%BD%BF%E7%94%A8%E6%89%8B%E5%86%8C&amp;diff=1835"/>
		<updated>2025-11-05T20:49:51Z</updated>

		<summary type="html">&lt;p&gt;Mr F: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:fdlm1200x630.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 系统要求 ==&lt;br /&gt;
&lt;br /&gt;
使用 Bakery 需要：&lt;br /&gt;
&lt;br /&gt;
Windows（7 或更高版本）电脑。&lt;br /&gt;
&lt;br /&gt;
Nvidia 显卡。最低支持型号为 Kepler（GeForce 650 或更新型号，Quadro 显卡请查看规格）。&lt;br /&gt;
&lt;br /&gt;
64 位 Unity 编辑器。Bakery 已在 5.6 到 6 及更高版本上测试过，同时也在 Tuanjie 1.6.7 上通过测试。&lt;br /&gt;
&lt;br /&gt;
{{note|系统要求仅适用于开发者的电脑，而非目标平台。使用 Bakery 烘焙的光照贴图可以在任何地方使用。}}&lt;br /&gt;
&lt;br /&gt;
== 前提条件 ==&lt;br /&gt;
* 确保你的项目中没有任何脚本编译错误，否则也会导致 Bakery 的脚本无法编译。&lt;br /&gt;
* 确保你的显卡驱动是最新版本，如有需要请[https://www.nvidia.com/Download/index.aspx?lang=en-US 更新]。&lt;br /&gt;
&lt;br /&gt;
'''请使用 Game-Ready（标准）驱动程序，而不是 “Studio” 驱动。'''&lt;br /&gt;
&lt;br /&gt;
== 安装 ==&lt;br /&gt;
&lt;br /&gt;
1. 通过 [https://assetstore.unity.com/packages/tools/level-design/bakery-gpu-lightmapper-122218 Asset Store] 将 Bakery 导入到你的项目中。&lt;br /&gt;
&lt;br /&gt;
2. Unity 会显示要导入的文件列表。如果这是你第一次使用 Bakery，建议直接 点击 Import（导入）。有经验的用户可以取消选中 examples 文件夹，以进行更轻量的安装。&lt;br /&gt;
&lt;br /&gt;
文件将被导入到 `Assets/Bakery` 和 `Assets/Editor/x64/Bakery` 文件夹中。&lt;br /&gt;
这些文件夹之后可以移动。&lt;br /&gt;
&lt;br /&gt;
3. Unity 随后会导入 Bakery 并编译脚本。此时可能会弹出如下窗口：&lt;br /&gt;
&lt;br /&gt;
[[File:Goahead.png]]&lt;br /&gt;
&lt;br /&gt;
此时你应点击 “Go Ahead”（继续）。&lt;br /&gt;
&lt;br /&gt;
现在你应该能在编辑器中看到新增的 Bakery 菜单：&lt;br /&gt;
&lt;br /&gt;
[[File:bmenu.jpg]]&lt;br /&gt;
&lt;br /&gt;
== 快速开始 ==&lt;br /&gt;
&lt;br /&gt;
1. 添加一些模型或基础体，并将其标记为静态（Static）。&lt;br /&gt;
&lt;br /&gt;
'''用于光照贴图的网格必须具有不重叠的 UV2。如果存在 UV2，则会使用 UV2（否则使用 UV1）。如果你的模型没有为光照贴图进行展开，请在资源中勾选 Generate Lightmap UVs（生成光照贴图 UV）。'''&lt;br /&gt;
Unity 的基础体已经具有正确的 UV2。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Staticmarked.jpg|320px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. 选择方向光（Unity 为你创建的那个），并添加 '''Bakery Direct Light''' 组件。&lt;br /&gt;
   {{note|Bakery 和 Unity 使用独立的光源组件。}}&lt;br /&gt;
&lt;br /&gt;
3. Bakery Direct Light 有许多可调选项，但你可以轻松将其与 Unity 光源匹配。点击 '''Match lightmapped to real-time'''。现在 Bakery 光源的颜色应与 Unity 默认的方向光相同，呈黄色调。&lt;br /&gt;
&lt;br /&gt;
[[File:Matching.jpg|640px]]&lt;br /&gt;
&lt;br /&gt;
{{note|Direct Light 组件可能会提示项目未使用线性光强度。问题在于，Unity 默认会对光源颜色应用伽马校正 [https://twitter.com/guycalledfrank/status/1001108508614553600 不正确]。&lt;br /&gt;
可以通过[https://docs.unity3d.com/ScriptReference/Rendering.GraphicsSettings-lightsUseLinearIntensity.html 脚本]启用正确模式。&lt;br /&gt;
这就是 “Fix” 按钮的作用。如果你已经在非线性光强模式下设置了许多光源，并且不想再次更改它们，可以跳过修复。即使你按了 “Fix”，也可以随时撤销此更改。&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. 要获得带阴影的环境光，请创建 Skylight（Bakery-&amp;gt;Create-&amp;gt;Skylight）。&lt;br /&gt;
&lt;br /&gt;
[[File:Menusky.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. 选择 Skylight，为它设置一些偏蓝的颜色，然后点击 '''Match scene skybox to this light'''。   这将使场景的 skybox 与光照完全匹配。&lt;br /&gt;
   {{note|将 Unity 的 skybox 与 Bakery Skylight 匹配是可选的，但对正确性很有用，可以确保可见环境和引擎内的反射探针与烘焙光照一致。目前此选项仅适用于 Standard 渲染管线。}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Skycomp.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. 点击 Bakery-&amp;gt;Render Lightmap。默认情况下，Full Lighting 模式是激活的。它会烘焙所有光源的直接和间接光照贡献。如果你想将实时阴影与烘焙全局光照（GI）结合使用，请将模式更改为 '''Indirect'''。&lt;br /&gt;
&lt;br /&gt;
[[File:Bakerywindow.jpg]]&lt;br /&gt;
&lt;br /&gt;
{{note| Bakery 可能会提示你正在使用旧的 [https://docs.unity3d.com/Manual/LinearLighting.html gamma mode]。如果你在意光照质量，强烈建议使用线性模式。如果你的项目已经在错误的伽马模式下设置好了，并且不想更改，或者是发布到不支持线性模式的移动设备上，也可以忽略此提示。}}&lt;br /&gt;
&lt;br /&gt;
7. 点击 '''Render'''。&lt;br /&gt;
&lt;br /&gt;
8. 完成！现在你应该已经得到烘焙的全局光照（GI）：&lt;br /&gt;
&lt;br /&gt;
[[File:Bakedgi.jpg]]&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 ==&lt;br /&gt;
&lt;br /&gt;
所有渲染设置都可以通过 Bakery-&amp;gt;Render Lightmap 访问。设置会为每个场景单独保存。Bakery 窗口顶部的选项允许你在 Simple（简单）、Advanced（高级）和 Experimental（实验）设置之间切换，每个后续模式都会显示更多可调选项。对于大多数场景，Simple 模式已经足够，是入门的好方法。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render mode ===  &lt;br /&gt;
定义要烘焙的光照贴图类型。  &lt;br /&gt;
&lt;br /&gt;
===== Full Lighting =====&lt;br /&gt;
烘焙所有 Bakery 光源的完整直接光和间接光。&lt;br /&gt;
{{note|在 2017.3 之前的 Unity 版本中，如果同一对象上同时有 Unity 和 Bakery 组件，你需要手动禁用 Unity 组件以避免亮度加倍。在较新版本中，实时效果会自动对烘焙光源禁用，就像内置光照烘焙器一样。}}&lt;br /&gt;
&lt;br /&gt;
===== Indirect =====&lt;br /&gt;
[[File:Image26.png|thumb|Unity 支持的不同渲染模式对比]]&lt;br /&gt;
基础混合模式。它会查看每个光源上的 Baked Contribution 选择器：如果设置为 ''Direct And Indirect''，则光源会像在 Full Lighting 模式下一样被烘焙。如果设置为 ''Indirect Only''，则只会烘焙该光源的间接光照（GI）。在后一种情况下，你应保持对象上的 Unity 光源和 Bakery 光源同时存在，一个提供实时直接光照，另一个提供预计算的全局光照（GI）。&lt;br /&gt;
&lt;br /&gt;
[[File:Indirectonly.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== Shadowmask =====&lt;br /&gt;
[[File:Image21.png|thumb|左：完全烘焙的光照。中：动态光源 + 烘焙 GI。右：胶囊形阴影、凹凸贴图和高光为动态光照，但立方体阴影和 GI 为烘焙光照。]]&lt;br /&gt;
[[File:Image6.png|thumb|当相机足够远离场景，或者动态阴影被禁用时，场景将呈现如下效果]]&lt;br /&gt;
更高级的混合模式。它通过生成两种类型的光照贴图来工作——一种包含烘焙颜色（如 Indirect 模式），另一种包含静态物体的阴影。它有几个优点：&lt;br /&gt;
* 实时阴影只需渲染少量动态对象，而不是整个场景。&lt;br /&gt;
* 实时阴影与烘焙阴影可以正确融合。&lt;br /&gt;
* 实时光源可以渲染凹凸贴图、高光和其他表面效果，同时仍会被高质量烘焙阴影遮挡。&lt;br /&gt;
[https://docs.unity3d.com/Manual/LightMode-Mixed-Shadowmask.html 更多详情]&lt;br /&gt;
&lt;br /&gt;
要启用此行为，你必须在同一对象上同时存在 Unity 光源和 Bakery 光源，并将 Baked Contribution 设置为 ''Shadowmask and Indirect''。未标记的光源将按 Indirect 模式进行烘焙。&lt;br /&gt;
&lt;br /&gt;
[[File:Smask22.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== Distance Shadowmask =====&lt;br /&gt;
此复选框仅在你选择 Shadowmask 时可见，并且只是切换项目 [https://docs.unity3d.com/Manual/LightMode-Mixed-ShadowmaskMode.html Quality Settings] 中同名的设置。&lt;br /&gt;
[https://docs.unity3d.com/Manual/LightMode-Mixed-DistanceShadowmask.html 更多详情]&lt;br /&gt;
{{note|由于缺少对应的脚本 API，该复选框在 Unity 5.6.x 上不可见。你可以在 Window-&amp;gt;Lighting-&amp;gt;Mixed Lighting-&amp;gt;Lighting Mode 中切换该设置。}}&lt;br /&gt;
{{note|在 Unity 版本 &amp;lt; 2017.3 中，由于 API 限制，渲染 Shadowmask 光照贴图会清除光照探针。烘焙后需要重新渲染光照探针。在较新版本中不应发生此问题。}}&lt;br /&gt;
&lt;br /&gt;
===== Subtractive =====&lt;br /&gt;
&lt;br /&gt;
启用 [https://docs.unity3d.com/Manual/LightMode-Mixed-Subtractive.html Subtractive] 光照模式。&lt;br /&gt;
&lt;br /&gt;
此选项对光照贴图本身没有任何特殊作用，实际上它的工作方式与 Full Lighting 相同。&lt;br /&gt;
&lt;br /&gt;
唯一的区别是，它还会将实时 Unity 光源设置为与 Subtractive 模式兼容（因为无法通过 UI 完成此操作）。&lt;br /&gt;
&lt;br /&gt;
你还需要在 [https://docs.unity3d.com/Manual/GlobalIllumination.html#MixedLighting Unity Lighting] 窗口中额外设置全局减法参数（例如全局阴影颜色）。&lt;br /&gt;
&lt;br /&gt;
===== Ambient Occlusion Only =====&lt;br /&gt;
仅烘焙环境光遮蔽（AO）。如果你很清楚自己在做什么，这可能会有用。请确保设置 [[#Ambient_occlusion|AO 选项]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Directional mode ===&lt;br /&gt;
[[File:Image3.png|thumb|不同方向模式的对比]]&lt;br /&gt;
定义了方向信息的烘焙方式。标准光照贴图每个像素只存储单一颜色，而方向光照贴图为着色器提供了关于该像素周围半球内光照变化的提示。这些数据用于在完全烘焙的区域中结合法线贴图。如果将其应用到内置的 [[#Bakery_shaders|Bakery]] 着色器中，还可以产生**近似高光反射**效果。&lt;br /&gt;
&lt;br /&gt;
===== None =====&lt;br /&gt;
不包含方向数据，每个像素仅有单一颜色。&lt;br /&gt;
&lt;br /&gt;
===== Baked Normal Maps =====&lt;br /&gt;
依然没有方向数据，但在渲染光照贴图时会考虑法线贴图。此方式在运行时没有额外开销。由于光照贴图的分辨率通常低于法线贴图，结果可能显得模糊。其他问题包括：由于缺乏 mipmapping，远处可能出现锯齿，以及降噪步骤可能导致细节被涂抹。要了解如何在此模式下使用具有程序化法线的自定义着色器，请参阅 [[#Normal_mapping|Normal Mapping]] 章节。&lt;br /&gt;
&lt;br /&gt;
===== Dominant Direction =====&lt;br /&gt;
此模式类似于 Unity 中 Enlighten 和 Progressive 烘焙器的实现。它与大多数着色器兼容，仅生成一张额外的贴图，运行时开销极小。缺点是凹凸贴图的效果较弱，略显灰暗，与实时光照下的同一物体相比可能差异较大。&lt;br /&gt;
&lt;br /&gt;
===== RNM =====&lt;br /&gt;
基于最初为《Half-Life 2》开发的 [https://steamcdn-a.akamaihd.net/apps/valve/2004/GDC2004_Half-Life2_Shading.pdf Radiosity Normal Mapping] 技术（相关演示文稿），后来被许多游戏采用（如《Mirror's Edge》）。此模式总共生成三张 HDR 贴图，是内存占用最高的模式之一，但运行时开销仍相对较低。该模式比 Dominant Direction 更精确，能更好地再现表面反差，并能正确处理来自不同角度、具有不同颜色的光照对法线贴图的影响。&lt;br /&gt;
&lt;br /&gt;
===== SH =====&lt;br /&gt;
基于论文《[https://media.contentapi.ea.com/content/dam/eacom/frostbite/files/gdc2018-precomputedgiobalilluminationinfrostbite.pdf Precomputed Global Illumination in Frostbite]》。这是最高质量的模式，能提供更好的表面对比度，并准确表现来自不同方向、不同颜色的光照。总共生成四张贴图，其中仅一张为 HDR，因此比 RNM 占用更少内存。运行时开销略高于 RNM。&lt;br /&gt;
&lt;br /&gt;
===== MonoSH =====&lt;br /&gt;
[[File:FY8Ru8hWIAAdYYH.jpg|thumb|Dominant Direction、完整 SH 与 MonoSH 的尺寸/质量对比]]&lt;br /&gt;
与 SH 类似，但使用单色的 L1 方向系数。表面对比度同样良好，虽然无法准确表现来自不同方向的不同颜色光照，但对多数场景来说已经足够。仅生成一张额外贴图，因此显存占用与带宽需求与 Dominant Direction 相近；事实上更低，因为 Dominant Direction 使用 RGBA 贴图，而 MonoSH 只需 RGB。该贴图通过内置的方向光照贴图系统传递，但''在标准着色器下显示不正确''。请务必使用兼容的着色器。&lt;br /&gt;
&lt;br /&gt;
===== 限制 =====&lt;br /&gt;
&lt;br /&gt;
* RNM 和 SH/MonoSH 只能与 [[#Bakery_shaders|Bakery shader]] 一起使用，或者需要对你的着色器进行调整。&lt;br /&gt;
* 在 RNM 和 SH 模式下，不会生成标准的颜色光照贴图。你需要确保场景中所有材质都使用 Bakery Shader，或者使用 [[#Bakery_Lightmap_Group_Selector|Lightmap Groups]] 将 RNM/SH 对象与其他对象分开。&lt;br /&gt;
* RNM 和 SH 贴图是通过 [https://docs.unity3d.com/ScriptReference/MaterialPropertyBlock.html MaterialPropertyBlock] 应用于对象的，因此在 Unity 的 Lighting 窗口中可能无法完全显示。&lt;br /&gt;
* Dominant Direction、RNM 和 SH/MonoSH 模式可能需要为全局光照（GI）和光照网格使用更多采样，以获得相近的质量。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Texels per unit ===&lt;br /&gt;
[[File:Texelscomp.jpg|thumb|1 vs 10 texels per unit]]&lt;br /&gt;
每个世界单位的光照贴图像素（Texels）近似数量。它会影响生成光照贴图的数量和分辨率。&lt;br /&gt;
&lt;br /&gt;
入门示例值：&lt;br /&gt;
&lt;br /&gt;
* 大型户外区域（城市）：1 - 5&lt;br /&gt;
* 中型户外区域（几条小巷）：10 - 20&lt;br /&gt;
* 高质量室内场景：100&lt;br /&gt;
&lt;br /&gt;
假设场景比例大约为 1 单位 = 1 米。在 Unity 中使用这种比例通常是推荐的，以便更好地导航和进行物理模拟。如果你的比例不同，请相应地调整 Texels。&lt;br /&gt;
&lt;br /&gt;
请注意，Texels Per Unit 是基础分辨率，但每个对象还可以通过 Mesh Renderer 上的 &amp;quot;Scale in Lightmap&amp;quot; 选项以及 Bakery 窗口中的 &amp;quot;Scale per map type&amp;quot; 进行额外调整。&lt;br /&gt;
&lt;br /&gt;
{{note| 将 &amp;quot;Scale in Lightmap&amp;quot; 设置为 0 的对象不会被烘焙，但仍会投射阴影并影响全局光照（GI）。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Max resolution ===&lt;br /&gt;
光照贴图的最大尺寸限制。如果对象无法容纳在单张光照贴图中（根据当前的 Texels Per Unit 值），将会分配额外的光照贴图。同样的四个正方形对象可以使用四张 512x512 的贴图，也可以使用一张 1024x1024 的贴图。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bounces ===&lt;br /&gt;
[[File:Image36.png|thumb|注意更多的反弹会为封闭空间带来更多光照。]]&lt;br /&gt;
定义光线在表面上反弹的次数。通常，对于户外场景（例如城市），较低的反弹次数就足够了，而对于封闭场景（室内、洞穴），则需要较高的反弹次数。&lt;br /&gt;
&lt;br /&gt;
虽然滑块最多限制为 5 次反弹，但可以在数字输入框中输入任意反弹次数。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Samples ===&lt;br /&gt;
[[File:Image7.png|thumb|左：Samples = 4，右：Samples = 16。为了演示，去噪功能已关闭。]]&lt;br /&gt;
影响全局光照（GI）的质量。典型值为 16 到 32。&lt;br /&gt;
&lt;br /&gt;
{{note| 可以输入超出滑块最大值的任意数字，但请注意，该数字表示最终光线数量的平方根，例如 32 表示 1024 条光线，64 表示 4096 条光线，依此类推。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GPU Priority ===&lt;br /&gt;
在 GPU 处理光照贴图时，操作系统和其他软件的响应可能会变慢。此选项允许你在烘焙速度和系统响应之间进行平衡。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render ===&lt;br /&gt;
为所有打开的场景烘焙光照贴图。&lt;br /&gt;
如果 [[使用手册#Light_probe_mode|Light Probe Mode]] 设置为 L1 或 L2，也会烘焙 [https://docs.unity3d.com/Manual/LightProbes.html 光照探针]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Render Light Probes ===&lt;br /&gt;
为所有打开的场景烘焙 [https://docs.unity3d.com/Manual/LightProbes.html 光照探针]。&lt;br /&gt;
&lt;br /&gt;
请注意，要在 Shadowmask 模式下对动态对象获得正确的混合光阴影，你还需要启用 [[使用手册#Occlusion_probes|occlusion probes]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Render Reflection Probes ===&lt;br /&gt;
为所有打开的场景烘焙反射探针。此按钮仅为方便起见，会调用引擎内置的反射探针更新功能。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update Skybox Probe ===&lt;br /&gt;
为当前的 skybox 烘焙全局漫反射和反射探针。与 “Render Reflection Probes” 一样，它仅调用引擎内置函数。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Occlusion probes ===&lt;br /&gt;
在渲染光照探针时，允许 Unity 使用当前选择的内置光照烘焙器烘焙遮挡探针（occlusion probes）。遮挡探针是存储在普通光照探针中的附加数据，可以防止动态对象在阴影区域被错误照亮。目前在 Unity 中无法使用自定义遮挡探针，必须调用内置光照烘焙器来完成此操作。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Warnings ===&lt;br /&gt;
这些选项会在按下任意 Render 按钮后对场景进行验证，并显示警告对话框，询问是否继续或停止烘焙过程。&lt;br /&gt;
&lt;br /&gt;
* Suppress all popups（屏蔽所有弹窗）：按下 Render 后不显示任何对话框。&lt;br /&gt;
* UV validation（UV 验证）：检查所有模型是否具有完全正确的光照贴图 UV，特别是 UV 是否位于 0-1 范围内且不重叠。&lt;br /&gt;
* Overwrite check（覆盖检查）：显示哪些光照贴图文件将被覆盖。&lt;br /&gt;
* Memory check（内存检查）：显示大致所需的视频内存量。&lt;br /&gt;
* Sample count check（采样数检查）：检查是否有光源、GI 或 AO 的采样数不合理，可能导致 GPU 超出可用资源。&lt;br /&gt;
* Lightmapped prefab validation（光照贴图预制体验证）：验证光照贴图预制体，并在某些预制体将被覆盖时发出通知。&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 (Advanced) ==&lt;br /&gt;
=== Light probe mode ===&lt;br /&gt;
更改光照探针的烘焙方式。&lt;br /&gt;
&lt;br /&gt;
* Legacy（传统模式）：使用 Render Light Probes 按钮生成探针。点光源和方向光在光照烘焙器中计算，而区域光/天空光/间接光则通过在每个探针位置渲染立方体贴图收集。结果以 [https://docs.unity3d.com/ScriptReference/Rendering.SphericalHarmonicsL2.html L2] 球谐（spherical harmonics）形式存储。缺点是立方体贴图渲染速度慢，并且在游戏中使用的着色器未物理正确表示光照表面，或者项目为移动平台设置时，光照贴图和探针可能不匹配（Unity 可能会裁剪高强度值）。&lt;br /&gt;
&lt;br /&gt;
* L1：在点击 Render 时，光照探针会与光照贴图一起渲染。此选项提供更高的烘焙性能，并保证探针光照与光照贴图匹配。结果以 L1 球谐形式存储（仍可被普通着色器使用）。使用 [[#Bakery_shaders|Bakery shader]] 的 Non-Linear Light Probe SH 选项可以进一步提升结果。&lt;br /&gt;
&lt;br /&gt;
* L2：更高质量（完整 L2 球谐）。与 L1 一样，会自动与光照贴图一起渲染。与 L1 相比，性能影响可忽略不计。应在所有着色器下显示正常。探针对比度/方向性/振铃去除可通过 Project Settings -&amp;gt; Bakery -&amp;gt; “Ringing removal for L2 light probes” 调整。&lt;br /&gt;
&lt;br /&gt;
'''在 Unity 2019.3 中似乎存在一个 bug，如果启用 Occlusion Probes 选项，Legacy 光照探针的颜色无法正确保存。使用 Occlusion Probes 时，默认且推荐使用 L2 模式。'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Asset UV Processing ===&lt;br /&gt;
配置资产的 UV 间距（padding）调整。可选值：&lt;br /&gt;
&lt;br /&gt;
* Don't change（不更改）：不修改资产。&lt;br /&gt;
* Adjust UV padding（调整 UV 间距）：会查找具有自动生成 UV 的模型（资产上启用 “Generate Lightmap UVs”），并进一步调整它们，使每个网格的 UV 岛之间具有适当间距。导入器设置中的全模型 Pack Margin 会被忽略。系统会根据每个网格的面积和光照贴图分辨率计算出最优值。&lt;br /&gt;
* Adjust UV padding for new meshes only（仅调整新网格的 UV 间距）：与上面相同，但会跳过之前至少调整过一次的模型。&lt;br /&gt;
* Remove UV adjustments（移除 UV 调整）：撤销所有之前的 UV 调整，使自动展开的模型恢复到 Unity 原始展开的样子。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser ===&lt;br /&gt;
设置所需的去噪器。可选值：&lt;br /&gt;
&lt;br /&gt;
* Optix 5：使用 OptiX 5.1 AI 去噪器（之前称为 “Legacy denoiser”）。在 GPU 上运行。支持从 [https://en.wikipedia.org/wiki/Kepler_(microarchitecture) Kepler]（通常是 GeForce 6xx）到 [https://en.wikipedia.org/wiki/Turing_(microarchitecture) Turing]（通常是 GeForce 20xx）的所有显卡。不支持 [https://en.wikipedia.org/wiki/Ampere_(microarchitecture) Ampere]（30xx）。OptiX 5.1 使用嵌入的静态训练数据集，因此不受驱动实现影响。&lt;br /&gt;
&lt;br /&gt;
* Optix 6：使用 OptiX 6.0 AI 去噪器（之前为默认选项）。在 GPU 上运行。在 Kepler（6xx）显卡上似乎无法使用，但在更新的显卡上均可运行，包括 Ampere（30xx）。自 6.0 起，OptiX 去噪器的训练数据集存储在驱动中。在 v442.50 之前，其行为类似于 OptiX 5.1；但之后 NVIDIA [https://forums.developer.nvidia.com/t/optix7-denoiser-different-results-with-different-version-of-drivers/117989/2 更改了数据集]，结果可能有所不同。更新后的数据集有时可能产生网格状图案和更亮的边缘（仍可通过 “Denoise: fix bright edges” 修复），但运行速度更快。&lt;br /&gt;
&lt;br /&gt;
* Optix 7：使用 OptiX 7.2 AI 去噪器。行为类似 OptiX 6.0，但在 Ampere（30xx）上可能支持更好。&lt;br /&gt;
&lt;br /&gt;
* OpenImageDenoise：使用 Intel Open Image Denoise 库。在 CPU 上运行（任何支持 SSE 4.1 的 CPU）。可能略慢于 OptiX，但质量可比。&lt;br /&gt;
&lt;br /&gt;
* OpenImageDenoise2：使用 Intel Open Image Denoise 2，CUDA 模式。在 GPU 上运行，性能与 OptiX 6/7 相当，质量与 CPU 版本相同。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Adjust sample positions ===&lt;br /&gt;
寻找最佳采样位置以防止光照泄漏。算法详情可参考 [https://ndotl.wordpress.com/2018/08/29/baking-artifact-free-lightmaps/#leaks 此处]。在某些情况下（通常是大型且多边形极少、法线平滑的几何体），可能会产生不正确的结果，此时可以将其禁用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Unload scenes before render ===&lt;br /&gt;
在烘焙前卸载 Unity 场景以释放显存。复杂场景仅在编辑器中显示就可能占用数 GB 的显存。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Denoise ===&lt;br /&gt;
[[File:Image31.png|thumb|左：未开启 “Denoise”，右：开启 “Denoise”。]]&lt;br /&gt;
如果启用，将应用去噪算法。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Fix Seams ===&lt;br /&gt;
[[File:Image22.png|thumb|左：缝隙（“Fix Seams” 关闭），右：缝隙已修复（“Fix Seams” 开启）。]]&lt;br /&gt;
如果启用，将尝试融合由 UV 不连续造成的缝隙。对平滑几何体很有用，包括 Unity 默认的球体。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Split by scene ===&lt;br /&gt;
如果同时加载多个场景，并且启用此选项，每个场景将拥有自己的一套光照贴图，而不会与其他场景共享。这对于在运行时流式加载场景时限制纹理占用量非常有用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hole filling ===&lt;br /&gt;
[[File:Holefilling.jpg|thumb|“Hole filling” 关闭与开启的对比。]]&lt;br /&gt;
如果 Atlas Packer 设置为 xatlas，将尝试填充每个孔洞，从而生成更高效的贴图集。对于几何体非常复杂的场景，可能会增加场景导出时间，但通常推荐开启。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Min resolution ===&lt;br /&gt;
光照贴图的最小尺寸限制。可用于在生成大量小而完全填充的光照贴图与少量未完全填充的光照贴图之间进行平衡。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Scale per map type ===&lt;br /&gt;
允许你对颜色贴图、Shadowmask 和方向贴图设置不同的分辨率缩放。例如，常见情况是间接光颜色分辨率较低，但 Shadowmask 分辨率较高。请注意，缩放在光照贴图渲染完成后才应用，因此不会节省烘焙时间。如果启用了 “Adjust UV padding”，间距将基于最低分辨率的贴图，以防止像素泄漏。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Checker preview ===&lt;br /&gt;
[[File:Image12.png|thumb|Checker Preview 功能演示。]]&lt;br /&gt;
如果勾选了 “Show checker” 选项，场景视图将在可见对象上渲染棋盘格图案，以展示光照贴图像素大小。这对于在烘焙前确保 Texels Per Unit 和其他影响分辨率的设置使用合理数值非常有用。&lt;br /&gt;
&lt;br /&gt;
启用 Checker Preview 将强制 Bakery 执行贴图集打包。可能需要一些时间，但通常不会超过几秒钟。在修改场景内容后，按下 “Refresh checker” 可重新打包场景以查看更改。&lt;br /&gt;
&lt;br /&gt;
Checker Preview 还使用随机颜色显示场景将如何被分割到不同的光照贴图中。&lt;br /&gt;
&lt;br /&gt;
{{note| 当前 Checker Preview 无法显示地形的正确像素大小。}}&lt;br /&gt;
&lt;br /&gt;
==== Atlas preview ====&lt;br /&gt;
[[File:FN-TmhRXwAE9i2I.png|thumb|Atlas Preview 功能演示]]&lt;br /&gt;
当 Checker Preview 开启时，会显示 Atlas Preview 按钮。点击它将打开一个新窗口，显示未来光照贴图的 UV 布局。点击 &amp;quot;&amp;lt;&amp;quot; 和 &amp;quot;&amp;gt;&amp;quot; 按钮可浏览各个光照贴图。&lt;br /&gt;
这对于在烘焙前检查打包质量和光照贴图数量非常有用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Emissive boost ===&lt;br /&gt;
将任何表面自发光（emission）乘以此数值。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Indirect boost ===&lt;br /&gt;
将所有反弹光照乘以此数值。作用与光源组件上的 Indirect Intensity 相同，但为全局设置。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Backface GI ===&lt;br /&gt;
[[File:Image30.jpg|thumb|Backface GI]]&lt;br /&gt;
[[File:Image35.png|thumb|左：“Backface GI” = 0，右：“Backface GI” = 1。注意阴影区域接收到更多的绿色光照。]]&lt;br /&gt;
决定光线通过前面表面到达背面并被全局光照（GI）反弹的程度。这对于薄的半透明表面（如树叶）尤其有用。取值范围为 0-1。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Ambient occlusion ===&lt;br /&gt;
[[File:Image15.png|thumb|左：AO intensity = 0，右：AO intensity = 1。]]&lt;br /&gt;
一种简单的非物理环境光遮蔽（Ambient Occlusion，AO），可在最终场景光照上叠加以增强美观效果。&lt;br /&gt;
&lt;br /&gt;
* Intensity（强度）：控制 AO 效果的可见度。值为 0 时禁用该效果。&lt;br /&gt;
* Radius（半径）：决定 AO 效果使用的光线距离。较小的值产生局部遮蔽（角落、褶皱），较大的值则更类似 Skylight，从远处物体产生阴影。&lt;br /&gt;
* Samples（采样数）：影响环境光遮蔽的质量。典型值为 4 到 32。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dither transparency ===&lt;br /&gt;
通过自动抖动不透明度贴图来启用半透明阴影。[[使用手册#Opacity|了解 Bakery 如何处理不透明度贴图]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== RTX Mode ===&lt;br /&gt;
启用 RTX 硬件加速。仅 RTX 显卡可受益于此选项。最低支持的驱动版本为 418。&lt;br /&gt;
&lt;br /&gt;
驱动可以在大多数非 RTX Nvidia 显卡上模拟 RTX 模式，但通常会更慢。&lt;br /&gt;
&lt;br /&gt;
在 Ampere（3xxx）或更新的显卡上，RTX 模式 ''必须'' 启用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Export terrain trees ===&lt;br /&gt;
如果启用，绘制在地形上的树木将影响光照。树木本身不会被烘焙。请注意，在烘焙过程中，每棵树都使用最高可能的 LOD 等级。对于多公里范围且模型高度复杂的森林场景，不建议使用此选项。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Terrain optimization ===&lt;br /&gt;
如果启用（默认），地形将使用独立的光线追踪技术以利用其高程图几何结构。否则，它们将像其他普通网格一样处理。地形优化可以显著减少高分辨率地形所需的内存占用。在某些情况下，它还能加快地形烘焙速度，但在其他情况下（尤其是简单低分辨率地形）可能需要禁用该选项。&lt;br /&gt;
&lt;br /&gt;
{{note| 地形优化当前不兼容绘制的地形洞。需禁用此选项才能使其正常工作。}}&lt;br /&gt;
{{note| 地形优化仅支持非 RTX 模式。}}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Light Mesh batch limit ===&lt;br /&gt;
如果该值大于 0，会将多个 Light Mesh 合并为一个，前提是它们具有相同设置并影响相同的 Lightmap Groups，同时将它们的总采样数限制为该值（例如，如果限制为 64，则可以合并 2 个采样数为 32 的灯光，或 4 个采样数为 16 的灯光，等等）。在拥有大量 Light Mesh 的场景中，这可以提升性能。但设置过高时需小心，因为 GPU 在一次处理过多采样时可能触发操作系统驱动超时。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Compress volumes ===&lt;br /&gt;
如果启用，将对体积 3D 贴图应用纹理压缩，并将 Bakery 着色器切换到相应的采样模式。不推荐对分辨率非常低的体积使用此选项。体积大小可能会被调整为 4 的倍数。&lt;br /&gt;
&lt;br /&gt;
注意事项：&lt;br /&gt;
&lt;br /&gt;
* 目前仅支持压缩为 BC6H/BC7 纹理格式（桌面/主机平台）。&lt;br /&gt;
* 体积压缩仅支持 Unity 2020.1 或更高版本。&lt;br /&gt;
* 目前仅标准渲染管线的 Bakery 着色器支持使用压缩体积贴图。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Samples multiplier ===&lt;br /&gt;
将所有阴影和 GI 采样数乘以指定因子。可用于在草稿质量和最终质量之间快速切换。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Tile size ===&lt;br /&gt;
与 [[#GPU Priority|GPU Priority]] 相同，但这里设置的是贴图块（tile）大小。Bakery 会将光照贴图拆分为更小的块，并一次更新一个块。块越小，GPU 工作被中断的次数越多，系统响应性可能更好。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Temp path ===&lt;br /&gt;
临时文件夹。在渲染过程中，Bakery 可能需要几个 GB 的可用空间。将此文件夹放在 SSD 上相比 HDD 可略微加快渲染速度。目前，该文件夹不会自动清理。你可以随时手动删除其内容（渲染时除外），或通过 Bakery -&amp;gt; Utilities -&amp;gt; Clear cache 清理。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Output path ===&lt;br /&gt;
光照贴图文件夹。所有光照贴图，以及 lightprobe 和顶点颜色（vertex color）资源都将保存在此处。该路径相对于你的 Assets 文件夹。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Use scene named output path ===&lt;br /&gt;
如果启用此选项，输出路径将自动设置为与当前活动场景同名的文件夹（Assets/CurrentSceneName/）。这与 Unity 内置光照贴图烘焙器的行为类似。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render Selected Groups ===&lt;br /&gt;
仅烘焙包含所选对象的 Lightmap Groups。&lt;br /&gt;
不仅仅是所选对象会被重新绘制，它们所属的所有 Lightmap Groups 都会被处理。其他光照贴图不会被更新。如果对象不属于某个手动分配的组，则使用相同光照贴图的场景部分将被重新烘焙。&lt;br /&gt;
&lt;br /&gt;
目前，使用 [[Partial_scene_baking|Sectors]] 进行场景部分烘焙更为方便。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Beep on finish ===&lt;br /&gt;
如果启用，Bakery 在烘焙完成时会播放提示音。&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 (Experimental) ==&lt;br /&gt;
=== Unwrapper ===&lt;br /&gt;
如果启用 [[#Asset_UV_Processing|Adjust UV Padding]]，则定义将使用的展开器（unwrapper）。&lt;br /&gt;
&lt;br /&gt;
* Default：使用 Unity 标准展开器。Bakery 会为每个具有不同间距参数的网格调用 [https://docs.unity3d.com/ScriptReference/Unwrapping.GenerateSecondaryUVSet.html Unwrapping.GenerateSecondaryUVSet]。&lt;br /&gt;
* xatlas：使用 [https://github.com/jpcy jpcy] 的 [https://github.com/jpcy/xatlas xatlas]，这是 [https://github.com/castano Ignacio Castaño] 的 [https://github.com/Thekla/thekla_atlas thekla_atlas] 的修改版。thekla_atlas 曾用于游戏《The Witness》（[http://the-witness.net/news/2010/03/graphics-tech-texture-parameterization/ 参见博客文章]）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Atlas Packer ===&lt;br /&gt;
选择在将不同对象的 UV 布局打包到大型光照贴图集时使用的算法。&lt;br /&gt;
* Default：Bakery 在 v1.7 之前使用的原始算法。&lt;br /&gt;
* xatlas：使用 xatlas。&lt;br /&gt;
&lt;br /&gt;
某些功能仅支持特定的贴图集打包器：&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Default&lt;br /&gt;
! xatlas&lt;br /&gt;
|-&lt;br /&gt;
| [[使用手册#Bakery_Lightmap_Group_Selector|Override resolution]]&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
|-&lt;br /&gt;
| 高效 LOD 打包&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
|-&lt;br /&gt;
| [[使用手册#Hole_filling|Hole filling]]&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
请注意，贴图集打包器（Atlas Packer）也可以为每个 Lightmap Group 单独选择。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Export geometry and maps ===&lt;br /&gt;
如果启用，Bakery 会在渲染前将场景导出为其专用格式。如果你确定场景的几何体和贴图以及光照贴图分辨率设置没有改变（例如，你只是调整 GI 或光源设置），可以禁用此选项以加快下一次渲染速度。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update unmodified lights ===&lt;br /&gt;
如果启用，Bakery 会重新计算自上次渲染以来未改变的光源。如果你只是调整某个光源，不想等待其他光源重新渲染，可以禁用此选项。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update modified lights and GI ===&lt;br /&gt;
如果启用，Bakery 会重新计算自上次渲染以来发生变化的 GI 和光源。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== UV padding: increase only ===&lt;br /&gt;
仅在启用 [[#Asset_UV_Processing|Adjust UV padding]] 时可见。默认情况下，模型资源的最佳 UV 间距仅基于当前加载的场景进行计算。如果同一模型有多个实例使用不同的光照贴图分辨率，最小的分辨率将决定间距，以确保 UV 图块之间的间距足够大，防止相互重叠。然而，在两个不同的独立场景中烘焙同一模型时，为新场景优化可能会破坏之前场景中的 UV。勾选此选项可以防止这种情况发生，即永远不减小间距值，从而始终为曾经烘焙过的最低分辨率实例进行优化。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoise: fix bright edges ===&lt;br /&gt;
[[File:Image19.png|thumb|左：去噪后可见明亮边缘；右：已修复。]]&lt;br /&gt;
仅在 [[#Denoise|Denoise]] 启用时可见。有时用于去噪的神经网络可能会在阴影周围产生明亮边缘，就像应用了锐化效果一样。如果启用此选项，Bakery 会尝试将其滤除。启用后，去噪阶段可能会略微变慢。&lt;br /&gt;
&lt;br /&gt;
此功能也可用于滤除“火花”（fireflies），即光照贴图中偶尔出现的亮点。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Post-packing ===&lt;br /&gt;
有时在渲染场景时，Bakery 会将光照贴图拆分为多个子光照贴图，例如在烘焙不同 LOD 或地形时。&lt;br /&gt;
Post-packing 会尝试通过将这些子光照贴图合并到同一纹理中来最小化最终贴图集数量。&lt;br /&gt;
建议保持此选项启用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Combine with Enlighten real-time GI ===&lt;br /&gt;
如果启用，则在按下 Render 按钮时，Bakery 会首先尝试使用 Enlighten 烘焙以计算实时 GI。之后，将进行常规的 Bakery 光照贴图烘焙过程。烘焙 GI 和实时 GI 将协同工作。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bake on remote server ===&lt;br /&gt;
启用网络烘焙（[[Network baking|Network baking]]）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Presets ===&lt;br /&gt;
当前在 Experimental 模式下的 Render/Update 按钮下显示。&lt;br /&gt;
&lt;br /&gt;
* 点击 '''New''' 将所有当前设置保存到预设文件中。&lt;br /&gt;
* 默认情况下，当一个预设处于激活状态时，所有设置都会被灰显，以防止覆盖预设。&lt;br /&gt;
* 点击 '''Modify preset''' 可更改设置并覆盖预设。&lt;br /&gt;
* 可以通过预设字段切换预设。将其设置为 None 可禁用预设使用。&lt;br /&gt;
&lt;br /&gt;
== 组件 ==&lt;br /&gt;
=== Bakery Lightmap Group Selector ===&lt;br /&gt;
指定对象及其所有子对象使用的 '''Lightmap Group'''。&lt;br /&gt;
Lightmap Group 是 Bakery 用来表示共享同一光照贴图的对象集合的术语。每个组都有属性，告诉 Bakery 如何打包对象、哪些光源影响它们，以及结果是烘焙到纹理还是顶点。&lt;br /&gt;
&lt;br /&gt;
默认情况下，所有静态对象会自动打包到多个光照贴图组（贴图集）中，因此通常无需手动管理。手动定义组仅用于特殊用途，例如：&lt;br /&gt;
&lt;br /&gt;
* 指定某些对象使用 [[Vertex Lightmaps|每顶点光照贴图]] 而非纹理。&lt;br /&gt;
* 使用建模软件中的原始未缩放 UV 烘焙光照贴图。&lt;br /&gt;
* 将关卡的特定区域分组以使用单张光照贴图，从而便于资源流式加载或通过脚本在运行时切换不同的烘焙光照。&lt;br /&gt;
* 使用 Render Selected Groups 按钮仅更新已分组的对象。&lt;br /&gt;
&lt;br /&gt;
要手动定义组，可以创建 '''Lightmap Group Assets'''，方法包括使用 Assets-&amp;gt;Create 菜单，或在组件中使用 Create New 按钮。使用 Create New 按钮时，将根据以下表单创建新的资源：&lt;br /&gt;
&lt;br /&gt;
* Name：要创建的 Lightmap Group 资源的名称。&lt;br /&gt;
* Packing Mode：此选择器定义 Lightmap Group 的打包模式，共有 3 种模式：&lt;br /&gt;
** Original UV：对象及其子对象将使用未修改的 UV 进行烘焙，不执行打包。适用于多个网格共享同一已打包 UV 布局的模型。&lt;br /&gt;
** Pack Atlas：对象及其子对象将打包到专用纹理贴图集中。在 v1.3 之前，每个可打包的子对象都需要有此组件，但现在不再需要。每个子对象将作为单独矩形打包，除非 Bakery 自动检测到子对象有非重叠的子对象，在这种情况下，多个对象可以使用同一个矩形。&lt;br /&gt;
** Vertex：对象及其子对象将使用顶点色烘焙光照而非纹理。注意，需要使用自定义着色器才能生效，例如 [[#Bakery_shaders|Bakery Shader]]。文档中也提供了一个简单的着色器（“Bakery/Simple Vertex Lightmapped”）用于演示和参考。[[Vertex Lightmaps|了解更多关于顶点光照贴图的信息]]。&lt;br /&gt;
* Directional mode：允许你覆盖该组的 [[#Directional mode|directional mode]]。选项与全局相同，Auto 将使用全局设置。&lt;br /&gt;
* Resolution：所需的光照贴图分辨率。&lt;br /&gt;
* Auto-resolution：使用 [[使用手册#Texels_per_unit|Texels Per Unit]] 来确定最接近的二次幂分辨率。&lt;br /&gt;
* Atlas packer：为该组选择 [[使用手册#Atlas_Packer|贴图集打包]] 算法。&lt;br /&gt;
* Bitmask：用于排除光源影响光照贴图的开关列表。每个 Bakery 光源也有一个位掩码设置。光源只会影响与其共享至少一个开关的 Lightmap Group。默认设置意味着所有光源影响所有光照贴图。&lt;br /&gt;
&lt;br /&gt;
[[File:Ts.jpg|thumb|Transparent selfshadow关闭 vs 开启：注意一些单面但背向的多边形如何被正确照亮。]]&lt;br /&gt;
&lt;br /&gt;
如果你有一个被分配了“Pack Atlas”模式的 Lightmap Group，组件上将会出现额外设置：&lt;br /&gt;
&lt;br /&gt;
* Override resolution：覆盖该对象及其子对象在光照贴图中占用的分辨率。&lt;br /&gt;
* Resolution：手动定义的分辨率。例如，如果你有一个分辨率为 512 的光照贴图，并且分配给 4 个对象，同时覆盖分辨率设置为 256，Bakery 将生成一个 512x512 的光照贴图，每个对象正好占据 256x256 的区域。&lt;br /&gt;
&lt;br /&gt;
如果你选择一个 Lightmap Group 资产，将会显示额外的实验性设置：&lt;br /&gt;
* [[Subsurface scattering|Subsurface scattering: (点击阅读更多)]]&lt;br /&gt;
* Normal offset：允许你将光线从表面偏移。这很少有用，主要用于实验目的。&lt;br /&gt;
* Transparent selfshadow：从表面后方发射光线，使其不会在自身投射阴影。对于半透明叶片可能有用。&lt;br /&gt;
* Vertex sampling density，(仅当 Packing Mode 设置为 Vertex 时可用）：默认情况下，每个顶点只计算一个值；如果采样密度 &amp;gt; 0，则会在三角形上分散采样并求平均，从而生成超采样、更平滑的结果。&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Lightmapped Prefab ===&lt;br /&gt;
此组件允许预制件存储光照贴图元数据。这样处理后的预制件可以在任意场景中实例化，无论是在编辑器中还是运行时。&lt;br /&gt;
该组件应直接添加到预制件的根对象上。不支持嵌套预制件。由于预制件在烘焙后会被覆盖（类似于按下“Apply”按钮的效果），因此要求预制件没有任何未应用的更改（子对象不应移动，材质和脚本参数应保持不变等）。如果检测到此类更改，组件界面会显示错误，烘焙后不会保存任何元数据。如果启用了 [[#Warnings|Lightmapped prefab validation]] 警告，所有预制件错误也会在烘焙前以对话框形式显示。&lt;br /&gt;
&lt;br /&gt;
光照贴图预制件支持所有 Bakery 功能，例如 LOD、地形、方向光贴图、RNM、SH、顶点模式和 Shadowmask。要使 Shadowmask 生效，光源也必须是同一预制件的一部分。&lt;br /&gt;
&lt;br /&gt;
{{note| 注意，由于 API 限制，预制件 Shadowmask 仅在 Unity 2017.4 或更高版本中可用。}}&lt;br /&gt;
&lt;br /&gt;
烘焙后，一个名为 “BakeryPrefabLightmapData” 的对象会被添加到预制件中。该对象包含一个脚本，存储应用光照贴图所需的所有数据。&lt;br /&gt;
&lt;br /&gt;
此外，光照贴图预制件允许保存当前渲染设置，并使用两个按钮将其加载回任意已打开的场景：&lt;br /&gt;
&lt;br /&gt;
* Save current render settings to prefab：在该预制件上存储当前渲染设置的副本。&lt;br /&gt;
* Load render settings from prefab：将当前渲染设置设置为预制件中存储的设置。&lt;br /&gt;
  [[File:Upload 2019-9-17 10-32-34.png|thumb|应用预制件]]&lt;br /&gt;
&lt;br /&gt;
烘焙光照贴图预制件时，建议检查：&lt;br /&gt;
&lt;br /&gt;
* 预制件已“应用”。在旧版 Unity 中，点击 Inspector 右上角的 “Apply” 按钮。在新版 Unity 中，点击 “Overrides” 列表，然后选择 “Apply All”。&lt;br /&gt;
* 预制件组件 UI 不显示任何错误。&lt;br /&gt;
* [推荐] 在主窗口启用 “Lightmapped prefab validation” 复选框。点击 Render 时不会显示任何关于预制件的警告对话框。&lt;br /&gt;
&lt;br /&gt;
{{note| 光照贴图以其烘焙所在的场景或所使用的 Lightmap Group 命名（如果有）。在同一场景中烘焙不同预制件时，请确保使用不同命名的 [[使用手册#Bakery_Lightmap_Group_Selector|Lightmap Group]] 或更改 [[使用手册#Output_path|输出路径]]。}}&lt;br /&gt;
&lt;br /&gt;
{{note| 当使用相同模型逐个烘焙多个预制件时，建议将 [[使用手册#Asset_UV_Processing|Asset UV Processing]] 设置为“Don't Change”，以防止修改共享模型的 UV。}}&lt;br /&gt;
&lt;br /&gt;
{{note| Bakery 的预制件工作流程是在 Unity 提供“预制件双击进入视图”功能之前实现的。因此，在隔离预制件视图中光照贴图可能无法正确应用，组件可能显示 “This GameObject is not a prefab” 信息。但在普通场景中使用时应能正常工作。}}&lt;br /&gt;
&lt;br /&gt;
{{note| 当解包已烘焙的预制件并取消与现有光照贴图的关联时，请确保删除保存预制件范围光照贴图/渲染器连接的 BakeryPrefabLightmapData 对象。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Direct Light ===&lt;br /&gt;
[[File:Directlight.jpg|thumb|纯直射光 + GI]]&lt;br /&gt;
[[File:Image4.png|thumb|左：“Shadow Spread” = 0.01，右：0.05。注意阴影从锐利逐渐变模糊的效果。]]&lt;br /&gt;
无限远方向光（例如太阳）。&lt;br /&gt;
&lt;br /&gt;
* Color：光的颜色。&lt;br /&gt;
* Intensity：线性色彩乘数。&lt;br /&gt;
* Shadow Spread：光源尺寸，或者简单说，阴影的模糊度。0 = 阴影最锐利，1 = 阴影最模糊。从技术上讲，它在单条光线与更宽光锥之间插值。&lt;br /&gt;
* Shadow Samples：影响阴影质量。Shadow Spread 值越小，所需样本越少即可得到干净图像。太阳阴影的典型值为 1 到 16。设置为 0 时，该光源的阴影将消失。&lt;br /&gt;
* Bitmask：用于排除此光源对特定 Lightmap Groups 影响的开关列表。&lt;br /&gt;
* Baked contribution：确定应烘焙哪类光照数据。仅在 Indirect 或 Shadowmask 模式可见。可选值：&lt;br /&gt;
** Direct and Indirect：直射光与间接光都完全烘焙。&lt;br /&gt;
** Indirect only：实时光提供直射贡献，仅烘焙间接光。&lt;br /&gt;
** Shadowmask and indirect：实时光提供直射贡献，静态几何体的阴影烘焙到单独贴图，动态与静态阴影混合。间接光正常烘焙。&lt;br /&gt;
** Direct, Indirect, Shadowmask（仅自定义光照）：与直射和间接相同，但 Shadowmask 也生成，可与自定义着色器一起使用。&lt;br /&gt;
* Denoise shadowmask：确定是否对该光源的 Shadowmask 应用去噪。通常不需要，因为阴影噪点不明显，但对非常宽且模糊的阴影（大 Shadow Spread）可能有用。&lt;br /&gt;
* Indirect intensity：非物理 GI 乘数。自然光照应为 1，可根据场景风格调整。&lt;br /&gt;
* Anti-alias：对阴影执行超采样。&lt;br /&gt;
* Texture projection：在光照上投射乘法平铺纹理，可用于模拟远处云影。&lt;br /&gt;
当设置了纹理投影时，可以使用“Tiling”和“Offset”字段调整其缩放和偏移。或者，点击 &amp;quot;Tweak projection in Scene View&amp;quot; 并使用额外的 Gizmo 可视化移动和缩放投影。点击“Render reference frame”可保存光源视角的 PNG，这对于在场景上绘制云影很有用。&lt;br /&gt;
&lt;br /&gt;
如果同一对象同时启用了 Unity 和 Bakery 光源且参数不匹配，会出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match lightmapped to real-time：将 Unity 光源的通用设置复制到 Bakery 光源。&lt;br /&gt;
* Match real-time to lightmapped：将 Bakery 光源的通用设置复制到 Unity 光源。&lt;br /&gt;
&lt;br /&gt;
{{note| 从物理角度看，Bakery 的方向光强度（Intensity）等于照度（Lux）除以 π。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Sky Light ===&lt;br /&gt;
[[File:Skylight.jpg|thumb|纯天空光与 GI]]&lt;br /&gt;
无限远的带阴影环境光（天空）。&lt;br /&gt;
&lt;br /&gt;
* Color: 颜色。&lt;br /&gt;
* Intensity: 线性色彩倍增。&lt;br /&gt;
* Sky texture: 可选的立方体贴图资源，例如 HDRI 全景图，用于从不同方向影响光照颜色。&lt;br /&gt;
  {{note| 旋转天空光的 GameObject 会相应旋转立方体贴图的光照。}}&lt;br /&gt;
* Samples: 影响阴影质量。典型值为 8 到 32。&lt;br /&gt;
* Hemispherical: 如果启用，光照仅来自上方（上半球）。否则来自所有方向。&lt;br /&gt;
* Bitmask: 用于排除此光源影响特定 Lightmap Groups 的开关列表。&lt;br /&gt;
* Baked contribution: 决定应烘焙哪种光照数据。仅在 Indirect/Shadowmask 模式下可见。可能值：&lt;br /&gt;
** Direct and Indirect: 直接和间接光照都将完全烘焙。这是默认且推荐的天空光行为，因为在 Unity 中没有实时版本可以模拟它们。&lt;br /&gt;
** Indirect only: 假定实时光源提供直接贡献；仅烘焙间接光照。&lt;br /&gt;
&lt;br /&gt;
如果天空光的设置与当前场景的天空盒不匹配，将出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match this light to scene skybox: 将活动天空盒材质的通用设置复制到 Bakery 天空光。当前仅支持使用 “Skybox/Cubemap” 或 “Skybox/Bakery skybox” 着色器的天空盒。&lt;br /&gt;
* Match scene skybox to this light: 将 Bakery 天空光的通用设置复制到场景天空盒。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bakery Light Mesh ===&lt;br /&gt;
[[File:Image29.png|thumb|Left: Samples Near = 0, Samples Far = 4096.&amp;lt;br&amp;gt;&lt;br /&gt;
Middle: Samples Near = 0, Samples Far = 128.&amp;lt;br&amp;gt;&lt;br /&gt;
Right: Samples Near = 16, Samples Far = 128.&amp;lt;br&amp;gt;&lt;br /&gt;
请注意，光照效果看起来相似，但使用的合并采样数量更少。]]&lt;br /&gt;
任何形状的自发光网格。应与 Mesh Renderer 组件或设置为 Area 模式的 Light 组件一起使用。&lt;br /&gt;
&lt;br /&gt;
* Color：颜色&lt;br /&gt;
* Intensity：线性颜色倍增器&lt;br /&gt;
* Cutoff：最大光照距离。Bakery 会在接近该限制时额外衰减正确的平方反比衰减。当 Cutoff 值刚好对应物理衰减变得非常暗的位置时效果最佳。Cutoff 可提升烘焙性能，也可以设置为非常高（不可达）的值以保证完全正确性。&lt;br /&gt;
* Self Shadow：决定光源网格自身是否投射阴影。此选项同时启用更精确的光照算法。&lt;br /&gt;
* Samples Near：影响靠近网格的光照质量。典型值为 16 到 64，仅当 Self Shadow 开启时可用。&lt;br /&gt;
* Samples Far：影响远离网格的光照质量。典型值为 4 到 4096。&lt;br /&gt;
&lt;br /&gt;
Bakery 基于光源表面距离混合两种不同的区域光算法。靠近光源时，算法类似 GI，而远处光源被近似为虚拟点光云。&lt;br /&gt;
&lt;br /&gt;
{{note| &amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;光源网格自身不会接收光照，也不会被烘焙到光照贴图中。&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;一个拥有大量多边形的光源网格比烘焙多个简单的光源网格要快&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;如果结果总是脏/噪点较多，可以尝试将 Samples Near 设置为 0，这样只使用 VPL 算法。对于不需要精度的简单光源（如建筑物的窗户光），这也非常有用。&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;}}  &lt;br /&gt;
[[File:Dd99d-QU0AEKFBK.jpg|thumb|弯曲的光源网格]]  &lt;br /&gt;
* Bitmask：用于排除此光源影响特定 Lightmap Groups 的开关列表。  &lt;br /&gt;
* Baked contribution：决定烘焙哪种类型的光照数据。仅在 Indirect 或 Shadowmask 模式下可见。可能的值：  &lt;br /&gt;
** Direct and Indirect：完全烘焙直接和间接光贡献。这是默认且推荐的光源网格行为，因为 Unity 中没有实时版本可以模拟它们。  &lt;br /&gt;
** Indirect only：实时光源提供直接光贡献，仅烘焙间接光。  &lt;br /&gt;
** Shadowmask and Indirect：实时光源提供直接光贡献，但静态几何体的阴影会烘焙到单独的贴图。动态和静态阴影将混合在一起。间接光照将照常烘焙。目前仅 HDRP（和自定义渲染器）支持混合区域光。  &lt;br /&gt;
** Direct, Indirect, Shadowmask (custom lighting only)：与 Direct and Indirect 相同，但同时生成 Shadowmask 并分配用于自定义着色器。  &lt;br /&gt;
* Indirect intensity：非物理 GI 倍增器。自然光照应设为 1，但可修改以实现更风格化的场景。  &lt;br /&gt;
* Shadowmask with falloff：将完整光衰减烘焙进 Shadowmask（仅对自定义着色器有用）。  &lt;br /&gt;
&lt;br /&gt;
如果网格材质和光源设置不匹配，将出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match light to material：将网格材质或区域光的通用设置复制到 Bakery 光源。&lt;br /&gt;
* Match material to light：将 Bakery 光源的通用设置复制到网格材质或区域光。&lt;br /&gt;
&lt;br /&gt;
==== Light Mesh 与自发光材质的区别 ====&lt;br /&gt;
自发光材质：&lt;br /&gt;
&lt;br /&gt;
* 在 GI 计算中传播光线，因此是“免费的”，无论有多少网格是自发光的。&lt;br /&gt;
* 小而明亮的光可能会产生不准确或有噪点的结果，这取决于 GI 的采样数量。&lt;br /&gt;
* 由于 Bakery 中 GI 的工作方式，它必须占用光照贴图空间，因此可能会浪费空间。同时，这意味着自发光对象需要有效的 UV，并且必须启用“投射阴影”。&lt;br /&gt;
&lt;br /&gt;
Light Mesh：&lt;br /&gt;
&lt;br /&gt;
* 光照会为每个光源单独计算，因此比自发光材质慢。&lt;br /&gt;
* 设计用于为小而明亮的光提供干净的光照效果，即使距离很远也能保持效果。&lt;br /&gt;
* 不占用光照贴图空间。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Point Light ===&lt;br /&gt;
[[File:Image11.png|thumb|左：“Shadow Spread” = 0.5，右：“Shadow Spread” = 1。]]&lt;br /&gt;
点光源，没有面积。尽管在物理上不可能，但在游戏中很有用，并且是匹配 Unity 点光源和聚光灯的唯一方式。&lt;br /&gt;
{{note| 聚光灯只是带有额外投影遮罩的点光源。}}&lt;br /&gt;
&lt;br /&gt;
* Color: 颜色&lt;br /&gt;
* Intensity: 线性色彩倍增&lt;br /&gt;
* Shadow spread: 阴影模糊度。虽然点光源没有面积，但通常希望它仍能产生模糊阴影。为此，阴影被模拟为从球形区域光源投射。此参数定义了虚拟球体的半径，直接影响阴影模糊度。&lt;br /&gt;
* Physical falloff: 如果启用，将使用正确的平方反比衰减，并在边界附近额外衰减。否则将尝试模拟 Unity 的衰减。&lt;br /&gt;
* Falloff min size: 详见 [[Point Light Attenuation]] 部分。&lt;br /&gt;
* Range: 如果物理衰减被禁用，则等于 Unity 的光源范围；如果启用，只会在边缘轻微衰减物理衰减。&lt;br /&gt;
* Samples: 影响阴影质量。典型值为 1 到 512。设置为 0 将使该光源的阴影消失。&lt;br /&gt;
  [[File:Image10.png|thumb|从左到右：Omni，Cookie（默认聚光灯纹理），Cubemap，IES。]]&lt;br /&gt;
* Projection mask: 遮罩/Cookie 类型。选项：&lt;br /&gt;
** Omni: 无遮罩，相当于 Unity 的点光源。&lt;br /&gt;
** Cookie: 纹理投影遮罩。附加选项：&lt;br /&gt;
*** Cookie texture: 2D 纹理资源。Bakery 包含原始 Unity 聚光灯纹理（名为 ftUnitySpotTexture），可用于模拟。&lt;br /&gt;
*** Angle: 纹理投影角度（类似 Unity 聚光灯）。&lt;br /&gt;
*** Correct distortion: 修正宽角下直线可见的 cookie 失真。&lt;br /&gt;
** Cubemap: 立方体贴图投影遮罩。附加选项：&lt;br /&gt;
*** Projected cubemap: 立方体贴图资源。&lt;br /&gt;
** IES: 光照由 IES 文件数据调制。附加选项：&lt;br /&gt;
*** IES file: .ies 扩展名文件。&lt;br /&gt;
* Bitmask: 用于排除该光源影响特定 Lightmap Groups 的开关列表。&lt;br /&gt;
* Baked contribution: 决定应烘焙哪种类型的光照数据。仅在 Indirect 或 Shadowmask 模式下可见。可能值：&lt;br /&gt;
** Direct and Indirect: 直接光和间接光完全烘焙。&lt;br /&gt;
** Indirect only: 实时光提供直接光，仅烘焙间接光。&lt;br /&gt;
** Shadowmask and Indirect: 实时光提供直接光，但静态几何体阴影烘焙到单独贴图中，动态和静态阴影混合，间接光正常烘焙。&lt;br /&gt;
** Direct, Indirect, Shadowmask (custom lighting only): 与 Direct and Indirect 相同，同时生成 Shadowmask 用于自定义着色器。&lt;br /&gt;
* Indirect intensity: 该光的非物理 GI 倍增。自然光应为 1，可根据风格化场景修改。&lt;br /&gt;
* Shadowmask with falloff: 将完整光衰减（除距离外）烘焙到 Shadowmask（仅自定义着色器有用）。&lt;br /&gt;
* Legacy sampling: 使用 Bakery 原始更偏置的阴影采样策略。产生无噪点阴影，但宽半影可能出现条纹。禁用后使用无偏但更有噪点的技术。&lt;br /&gt;
&lt;br /&gt;
如果同一对象同时启用了 Unity 和 Bakery 光源，且设置不匹配，则会出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match lightmapped to real-time: 将 Unity 光的常用设置复制到 Bakery 光。&lt;br /&gt;
* Match real-time to lightmapped: 将 Bakery 光的常用设置复制到 Unity 光。&lt;br /&gt;
&lt;br /&gt;
{{note| 从物理角度来看，Bakery 点光源的“Intensity”为 Candela 除以 Pi。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Volume ===&lt;br /&gt;
[[File:Voldemo notlonely.gif|由 BakeryVolume 照亮的动态门（动态 GIF，由 NOTLonely 制作）]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
体积（Volumes）生成存储每个体素光探针的 3D 纹理（L1 球面调和和阴影贴图），使其成为常规 Unity 光探针的可行替代方案。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Unity Light Probes&lt;br /&gt;
! Unity LPPV&lt;br /&gt;
! Bakery Volumes&lt;br /&gt;
|-&lt;br /&gt;
| 手动放置每个光探针&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 否&lt;br /&gt;
|-&lt;br /&gt;
| 在一个物体上插值多个光探针&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 运行时可移动&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 可以放入预制件&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 完整脚本 API&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| “Ringing” 伪影&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 可能出现&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 可能出现&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 已修正&lt;br /&gt;
|-&lt;br /&gt;
| 去噪&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 运行时开销&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | CPU：低开销；GPU：低开销&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | CPU：中等开销；GPU：中等开销&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#e4ead3;&amp;quot; | CPU：无开销；GPU：中等开销&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bakery Volume 是一个与一组 3D 纹理（3 个 SH 纹理和一个可选的 shadowmask）关联的边界盒，使其非常易于使用和编程。Volumes 可以在运行时轻松地交换、移动、加载或卸载，也可以与预制件关联。它们不需要任何 Light Probe Groups 或手动探针布置；整个 Volume 都由均匀的探针体素网格填充。光/影泄漏会自动像处理光照贴图一样修复（尽管对于较大的体素尺寸，薄的双面墙可能会出现问题，但可以通过在不同侧使用不同 Volume 避免）。由于体素网格的均匀特性，也可以对其应用类似光照贴图的降噪，这是常规光探针无法做到的。此外，Bakery 着色器使用 [https://drive.google.com/file/d/1MK6Clw93q8ljijRjb4gQOzzaIjn1uF9Y/view Geomerics] 采样技巧，完全消除了高对比度 HDR 光照下 SH 有时会产生的 “ringing” 伪影。&lt;br /&gt;
&lt;br /&gt;
因此，Volumes 可以为动态物体生成干净、精细、高质量的烘焙光照（即来自静态物体并影响动态物体的光照，而不是相反）。&lt;br /&gt;
&lt;br /&gt;
Volume 方法的唯一缺点是每像素着色开销较高。其开销类似于 LPPV（随着屏幕上受体素影响的像素数量而缩放），但与 LPPV 不同的是，一旦烘焙完成，Volumes 本身不会再更新。多个 Volume 的混合可以通过稍微重叠它们来避免。&lt;br /&gt;
&lt;br /&gt;
====设置 Volume 变换====&lt;br /&gt;
[[File:Bvolgizmo.jpg|thumb|Volume 控制柄]]&lt;br /&gt;
当 BakeryVolume 被添加到一个 GameObject 时，场景视图中会出现一个边界盒控制柄。拖动小方块即可缩放它。&lt;br /&gt;
&lt;br /&gt;
还有其他方法可以更改 Volume 的大小和位置：&lt;br /&gt;
&lt;br /&gt;
* 将任何可渲染的 GameObject 拖入 “Wrap to object” 字段。Volume 会包裹该对象（及其子对象），以将它们完全包含在内。&lt;br /&gt;
* 如果同一个对象上添加了 Box Collider，则会出现 “Set from box collider” 和 “Set to box collider” 按钮。可以用它们快速在 Volume 和 Collider 之间复制数值。&lt;br /&gt;
&lt;br /&gt;
====分辨率====&lt;br /&gt;
当启用 “Adaptive resolution” 时，体素数量由 “Voxels per unit” 控制。禁用它可以手动输入分辨率。对于大多数 1 单位 = 1 米 的游戏来说，一个合理的 “Voxels per unit” 值是 2，但在某些情况下（例如动态门）使用较小但更高分辨率的 Volume 会更有利。&lt;br /&gt;
&lt;br /&gt;
====其他设置====&lt;br /&gt;
&lt;br /&gt;
* Enable baking: 是否需要（重新）计算 Volume？禁用可防止覆盖已有数据。&lt;br /&gt;
* Denoise: 在烘焙 Volume 后应用去噪。推荐用于高分辨率 Volume。避免用于覆盖许多光源的低分辨率 Volume，因为去噪器难以区分实际内容和噪声。&lt;br /&gt;
* Global: 自动将此 Volume 分配给所有兼容 Volume 的 Shader，除非它们有覆盖设置。内部会调用 Shader.SetGlobalTexture()/SetGlobalVector()。&lt;br /&gt;
====使用方法====&lt;br /&gt;
Volumes 可以分配给使用 Volume 感知 Shader 的对象。Bakery 自带实现该功能的 “Bakery Standard” Shader，以及 HDRP 和 URP 的 Shader 图。请查看 example_volumes 场景，了解应用 Volume 的各种方式。&lt;br /&gt;
&lt;br /&gt;
====提示====&lt;br /&gt;
&lt;br /&gt;
* 确保查看示例。&lt;br /&gt;
* 如果两个 Volume 相连，让它们略微重叠。重叠大小应等于最大动态对象的尺寸。这样在运行时简单切换 Volume 就能正常工作。&lt;br /&gt;
* 仅在动态对象实际可达的区域放置 Volume。例如，使用玩家高度限制 Volume 的高度。&lt;br /&gt;
&lt;br /&gt;
====旋转 Volumes====&lt;br /&gt;
如果启用 “Rotate around Y” 选项，Volumes 可以绕 Y 轴旋转。旋转开销非常低，只使用 2 个额外的浮点数据（预计算的角度 sin/cos）。&lt;br /&gt;
&lt;br /&gt;
还可以在运行时旋转 Volumes（Experimental -&amp;gt; “Support rotation after bake” 以及 Bakery Shader 中的类似选项），这种情况下 Volume 必须在初始旋转为零时进行烘焙。&lt;br /&gt;
&lt;br /&gt;
在 URP 中，这种动态旋转可以与 `BakeryURPVolumeGraphRotatable.shadergraph` 一起使用。&lt;br /&gt;
&lt;br /&gt;
对于全局 Volume，动态旋转会在组件被（重新）启用或调用 `volume.SetGlobalParams()` 时更新。使用局部旋转 Volume 时，需要手动在材质或 MaterialPropertyBlock 上设置旋转：&lt;br /&gt;
{{code|&amp;lt;nowiki&amp;gt;SetMatrix(&amp;quot;_VolumeMatrix&amp;quot;, volume.GetMatrix())&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
====技术信息====&lt;br /&gt;
Volumes 可以自动工作（查看示例场景），也可以通过脚本控制其使用方式。&lt;br /&gt;
&lt;br /&gt;
可以通过组件的以下公共属性获取 Volume 数据：&lt;br /&gt;
&lt;br /&gt;
* `bakedTexture0`：存储 L0 RGB 系数和 L1 Z 红色通道在 alpha 中。&lt;br /&gt;
* `bakedTexture1`：存储 L1 X RGB 系数和 L1 Z 绿色通道在 alpha 中。&lt;br /&gt;
* `bakedTexture2`：存储 L1 Y RGB 系数和 L1 Z 蓝色通道在 alpha 中。&lt;br /&gt;
* `bakedMask`：存储体积阴影遮罩。&lt;br /&gt;
* `bounds`：Volume 的包围盒。&lt;br /&gt;
&lt;br /&gt;
所有 `bakedTexture*` 使用 RGBAHalf（每体素 8 字节）格式，mask 使用 ARGB32（每体素 4 字节）。阴影遮罩也可以使用单通道 R8 格式（每体素 1 字节）。&lt;br /&gt;
&lt;br /&gt;
因此 Volume 的字节大小 = width * height * depth * 3 * 8 + （仅当使用阴影遮罩时）width * height * depth * 4（或使用 R8 mask 时为 width * height * depth）。&lt;br /&gt;
&lt;br /&gt;
[[使用手册#Compress_volumes|可以对 Volume 启用纹理压缩]]，使其体积显著减小。&lt;br /&gt;
&lt;br /&gt;
采样 Volume 需要特殊 Shader，这些 Shader 已包含在 Bakery 中。要在自定义 Shader 中添加 Volumes，请查看 HDRP/URP 包中包含的 `BakeryVolume_float()` 函数（位于 `BakeryDecodeLightmap.hlsl`）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Light Filter ===&lt;br /&gt;
[[File:Output optimized.gif|彩色玻璃，如在 &amp;quot;Bakery Real-Time Preview&amp;quot; 中所见。Bakery lightmapper 烘焙出的结果相同。]]&lt;br /&gt;
&lt;br /&gt;
将渲染器标记为光过滤器（Light Filter）。过滤器会用其颜色着色所有直接和间接光线，类似于现实中的光学滤镜，从而实现彩色透明效果（例如彩色玻璃）。唯一的参数是用于着色的纹理。&lt;br /&gt;
&lt;br /&gt;
* 光过滤器对象仍然会像其他对象一样接收光照贴图。&lt;br /&gt;
* 过滤器不会散射或模糊光线（如需此效果，请尝试 [[Subsurface_scattering|Subsurface Scattering]] 或 [[使用手册#Backface_GI|Backface GI]]）。&lt;br /&gt;
* 过滤器可以产生带颜色的阴影。如果灯光使用 [[使用手册#Shadowmask|Shadowmask]] 模式，则结果只会保存 R 通道（因为 Unity 仅支持单通道遮罩）。对于完全烘焙的阴影，则没有限制。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Sector ===&lt;br /&gt;
参见 '''[[Partial_scene_baking|Partial scene baking]]'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Always Render ===&lt;br /&gt;
如果添加到一个物体上，Bakery 在烘焙时将始终考虑该物体，即使它的 Renderer 被禁用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
=== Bakery Pack As Single Square ===&lt;br /&gt;
如果添加到一个物体上，Bakery 会将该物体及其子物体的 UV 视为单个组合方块，在自动图集打包或 Lightmap Group 的 Pack Atlas 模式下，它们之间永远不会被移动。整个子层级将作为一个整体打包。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
=== Bakery Shared LOD UV ===&lt;br /&gt;
如果添加到一个 LODGroup 上，将标记所有同名 LOD 共享同一个光照贴图。默认情况下，每个 LOD 网格会获得独立的光照贴图，占用图集空间；但如果已知同一个物体的 LOD 拥有相似的 UV2（或者在没有 UV2 且 UV1 不重叠的情况下），它们可以映射到图集的同一部分，从而节省内存。&lt;br /&gt;
这种技术也称为 [https://github.com/laurenth-personal/LODLightmapScripts/ Lightmap Stealing]。&lt;br /&gt;
&lt;br /&gt;
= 材质兼容性 =&lt;br /&gt;
&lt;br /&gt;
=== 漫反射和发光 ===&lt;br /&gt;
Bakery 利用 [https://docs.unity3d.com/Manual/MetaPass.html Meta Pass] 系统支持大多数 Unity 材质。所有内置、Surface、URP 和 HDRP 着色器都已经定义了正确的 Meta Pass。&lt;br /&gt;
&lt;br /&gt;
如果你使用的是 Unlit 着色器，需要按照 Unity 文档手动添加 Meta Pass。&lt;br /&gt;
&lt;br /&gt;
如果未定义该 Pass，Bakery 将假定 {{codeVar|_MainTex}}、{{codeVar|_BaseColorMap}} 或 {{codeVar|_Color}}（如果未设置纹理）为材质的漫反射（Albedo），并将 {{codeVar|_EmissionMap}} 和 {{codeVar|_EmissionColor}} 作为发光颜色。&lt;br /&gt;
&lt;br /&gt;
为了使发光生效，[https://docs.unity3d.com/ScriptReference/Material-globalIlluminationFlags.html Material.globalIlluminationFlags] 必须设置为 [https://docs.unity3d.com/ScriptReference/MaterialGlobalIlluminationFlags.BakedEmissive.html MaterialGlobalIlluminationFlags.BakedEmissive]。标准着色器会自动设置此值。&lt;br /&gt;
&lt;br /&gt;
=== 不透明度 ===&lt;br /&gt;
[[File:Upload 2019-1-25 0-4-30.png|thumb|材质参数被转换为 Cutout（默认）]]&lt;br /&gt;
[[File:Alphacombos dither.jpg|thumb|通过“Dither Transparency”选项添加半透明值]]&lt;br /&gt;
[[File:Alphacombos filter.jpg|thumb|Light Filter 组件用于红色平面，生成彩色阴影]]&lt;br /&gt;
&lt;br /&gt;
默认情况下，Bakery 始终从 {{codeVar|_MainTex}}、{{codeVar|_BaseColorMap}} 或 {{codeVar|_BaseMap}} 的 alpha 值获取全分辨率的不透明度，并将其视为 Cutout（1 位透明）。&lt;br /&gt;
&lt;br /&gt;
当启用 '''Dither Transparency''' 选项时，半透明值会自动转换为可变蓝噪声，然后被滤波/模糊，产生部分透明效果（以前可以通过自定义手动抖动贴图实现，但从 v1.97 起自动完成）。&lt;br /&gt;
&lt;br /&gt;
为了使不透明度生效，着色器的 [https://docs.unity3d.com/Manual/SL-SubShaderTags.html RenderType 标签] 必须为以下值之一：&lt;br /&gt;
&lt;br /&gt;
* {{codeVar|Transparent}}&lt;br /&gt;
* {{codeVar|TransparentCutout}}&lt;br /&gt;
* {{codeVar|TreeLeaf}}&lt;br /&gt;
&lt;br /&gt;
如果存在名为 {{codeVar|_Cutoff}} 的属性，它将影响 Cutout（因此 Standard 着色器的 Cutoff 滑块会自动生效）。&lt;br /&gt;
&lt;br /&gt;
在没有 Dither Transparency 的情况下，如果材质 RenderType 为 {{codeVar|Transparent}} 或 {{codeVar|TreeLeaf}}，则 {{codeVar|_Color}} 的 alpha 值会额外修改 Cutoff：&lt;br /&gt;
''finalCutoff = 1 - (1 - cutoff) * alpha''&lt;br /&gt;
&lt;br /&gt;
对于彩色透明效果，请使用 [[使用手册#Bakery_Light_Filter|Light Filter]] 组件。&lt;br /&gt;
&lt;br /&gt;
有关漫反射半透明效果，请参考 [[#Backface GI|Backface GI]] 和 [[subsurface scattering]]。&lt;br /&gt;
&lt;br /&gt;
==== Alpha Meta Pass ====&lt;br /&gt;
从 v1.9 起，Bakery 还支持指定基于自定义着色器的透明度，但这需要使用兼容的着色器。要使用 ''Alpha Meta Pass''，需要执行以下步骤：&lt;br /&gt;
&lt;br /&gt;
* 在着色器中添加一个名为 '''BAKERY_META_ALPHA_ENABLE''' 的属性。例如：&lt;br /&gt;
  {{code|&amp;lt;nowiki&amp;gt;[HideInInspector] BAKERY_META_ALPHA_ENABLE (&amp;quot;Enable Bakery alpha meta pass&amp;quot;, Float) = 1.0&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
* 确保 RenderType 标签设置为上文提到的某个值。&lt;br /&gt;
* 声明一个名为 '''META_BAKERY''' 的 Pass。&lt;br /&gt;
* 在该 Pass 中检查 '''unity_MetaFragmentControl.w''' 是否非零，如果是，则返回计算出的透明度值。&lt;br /&gt;
&lt;br /&gt;
示例可参考包内的 ''Baked_Alpha_meta.shader''。&lt;br /&gt;
&lt;br /&gt;
注意：当前 Alpha Meta Pass 需要将 Light Probe Mode 设置为 L1 或 L2。&lt;br /&gt;
&lt;br /&gt;
=== Normal mapping ===&lt;br /&gt;
自定义表面法线可以与 [[#Baked Normal Maps|烘焙法线贴图]] 模式一起使用。不幸的是，Unity 的 Meta Pass 默认不输出法线信息，因此默认情况下，法线取自名为 {{codeVar|_BumpMap}} 的贴图，并通过 {{codeVar|_MainTex_ST}} 进行额外变换。&lt;br /&gt;
&lt;br /&gt;
然而，可以制作完全自定义的着色器，带有高级法线映射功能（例如混合多层法线），并使其兼容烘焙。要实现这一点，需要执行以下步骤：&lt;br /&gt;
&lt;br /&gt;
1. 在着色器中定义一个 Meta Pass，具体方法请参考 [https://docs.unity3d.com/Manual/MetaPass.html#ExampleMetaPassUnity 文档]。&lt;br /&gt;
&lt;br /&gt;
2. 将该 Pass 命名为 {{codeVar|&amp;quot;META_BAKERY&amp;quot;}}，而不仅仅是 {{codeVar|&amp;quot;META&amp;quot;}}。&lt;br /&gt;
&lt;br /&gt;
3. 包含文件 {{codeVar|&amp;quot;BakeryMetaPass.cginc&amp;quot;}}。&lt;br /&gt;
&lt;br /&gt;
4. 添加 {{codeVar|#pragma vertex vert_bakerymt}}。&lt;br /&gt;
&lt;br /&gt;
5. 如果 {{codeVar|unity_MetaFragmentControl.z}} 变量不为 0，着色器应返回世界空间法线。返回的法线应使用 {{codeVar|BakeryEncodeNormal}} 函数编码。&lt;br /&gt;
&lt;br /&gt;
在 Assets/Bakery/examples/shaders 中包含了两个实现了扩展 Meta Pass 的示例着色器。&lt;br /&gt;
&lt;br /&gt;
你也可以复制并修改 BakeryMetaPass.cginc 以满足你的需求，例如从顶点着色器传递额外数据。&lt;br /&gt;
&lt;br /&gt;
=== 正/背面 ===&lt;br /&gt;
无论着色器使用何种剔除模式，Bakery 都将所有背面视为不透明，这意味着任何直接光线都不会穿过背面，就像它不会穿过正面一样。&lt;br /&gt;
然而，如果使用 [[使用手册#Backface_GI|Backface GI]]，背面可以部分发出正面接收到的光照。&lt;br /&gt;
&lt;br /&gt;
= 扩展 Lightmap Parameters 资源 =&lt;br /&gt;
[[File:Lp.jpg|thumb|扩展 Lightmap Parameters]]&lt;br /&gt;
类似于 Bakery 的 [[#Bakery_Lightmap_Group_Selector|Lightmap Group]]，Unity 也有 [https://docs.unity3d.com/Manual/class-LightmapParameters.html Lightmap Parameters]，可以作为资源创建并分配给 Mesh Renderer。它们的逻辑有相似之处也有不同之处：&lt;br /&gt;
&lt;br /&gt;
* Lightmap Group 的主要用途是将多个对象组合到同一个图集。此外，它还允许覆盖该图集的烘焙设置。&lt;br /&gt;
* Lightmap Parameters 主要用于覆盖对象的烘焙设置，但通过使用“Baked Tag”选项，它们也可以影响打包：具有不同 Baked Tag 的对象将永远不会共享同一个图集。&lt;br /&gt;
&lt;br /&gt;
由于有些用户更习惯 Lightmap Parameters 的工作流程，Bakery 现在支持并扩展了它们：&lt;br /&gt;
&lt;br /&gt;
* Bakery 会遵循 Baked Tag 设置。&lt;br /&gt;
* Lightmap Parameters UI 中将显示额外的 Bakery 特定选项。有关其含义，请参考 [[#Bakery_Lightmap_Group_Selector|Lightmap Group]] 部分。&lt;br /&gt;
&lt;br /&gt;
= 项目设置 =&lt;br /&gt;
一些全局设置可以在 Project Settings -&amp;gt; Bakery GPU Lightmapper 中调整（此选项仅在 Unity 2018.3 或更新版本可见；旧版本请编辑 BakeryProjectSettings.asset）：&lt;br /&gt;
&lt;br /&gt;
* Mipmap lightmaps：启用光照贴图的 mipmap。随着图集变小，可能会导致 UV 图块之间的泄漏；另一方面，它可以减少远处高分辨率光照贴图的锯齿。总体上，建议对非常远的物体使用单独烘焙的 LOD 以及较低分辨率的光照贴图。&lt;br /&gt;
* Color file format：常规 HDR 颜色光照贴图的文件格式。可选值：&lt;br /&gt;
**HDR：Radiance HDR 格式（默认）。可用多种图像编辑器打开。&lt;br /&gt;
**Asset：Unity 原生格式。可自定义 mipmap 数量。&lt;br /&gt;
* Mask/Direction file format：额外 LDR 地图的格式，如阴影遮罩或方向数据。可选值：&lt;br /&gt;
**TGA：8 位 Targa（默认）。&lt;br /&gt;
**PNG：8 位 PNG。通常比 TGA 占用更少磁盘空间。&lt;br /&gt;
**Asset：Unity 原生格式。可自定义 mipmap 数量。&lt;br /&gt;
* Compress lightmaps：定义光照贴图资源的压缩行为。压缩光照贴图占用更少的显存，但可能会出现一些视觉伪影（例如色带或色斑），具体取决于压缩类型（移动端压缩问题请参见[[Troubleshooting#I_have_an_Android_project.2C_and_lightmaps_don.27t_look_good|此处]]）。可选值：&lt;br /&gt;
*** Compress but allow overriding asset: 新的光照贴图将在启用压缩的情况下创建。创建后，可以在 Inspector 中更改它们的压缩设置。修改后的值将在重新烘焙后保留（默认）。&lt;br /&gt;
*** Force compress: 始终压缩所有光照贴图。&lt;br /&gt;
*** Force no compress: 始终生成未压缩的光照贴图。&lt;br /&gt;
* High quality direction: 为方向贴图启用“高”质量压缩。实际格式取决于平台。例如在 PC 上，它会从 DXT1 改为 BC7，这提供了更高的质量，但 VRAM 使用量会翻倍。&lt;br /&gt;
* Texel padding (default atlas packer): 定义在使用默认 atlas 打包器时，在光照贴图 atlas 中对象 UV 布局之间添加多少空白 texel。&lt;br /&gt;
* Texel padding (xatlas packer): 同上，但在使用 xatlas 时。&lt;br /&gt;
* Alpha Meta Pass resolution multiplier: 乘以 [[使用手册#Alpha_Meta_Pass|Alpha Meta Pass]] 的分辨率，使在低分辨率光照贴图烘焙时仍能实现精确的基于 Shader 的切割效果。&lt;br /&gt;
* Volume render mode: 为所有 [[使用手册#Bakery_Volume|Volumes]] 使用哪种 [[使用手册#Render_mode|渲染模式]]？Auto 使用当前活动的渲染模式（默认）。&lt;br /&gt;
* Delete previous lightmaps before bake: 在烘焙新光照贴图之前，实际删除该场景中所有之前渲染的光照贴图文件。&lt;br /&gt;
* Log level: 定义烘焙过程中在控制台输出的信息量。可能的值：&lt;br /&gt;
** 0: 不输出任何内容。&lt;br /&gt;
** 1: 仅输出进度信息。&lt;br /&gt;
** 2: 仅输出警告。&lt;br /&gt;
** 3: 输出全部信息。&lt;br /&gt;
* Alternative scale in lightmap: 使渲染器属性 'Scale in Lightmap' 的行为更类似于 Unity 内置的行为。&lt;br /&gt;
* Align to texture compression blocks with xatlas: 使 xatlas 将 chart 对齐到 4x4 块边界，从而获得更适合压缩的结果。&lt;br /&gt;
* Generate smooth positions: 是否应调整采样位置以防止低多边形几何体在平滑法线下产生错误阴影？在使用法线差异极大的几何体时，可在极少数情况下禁用。技术说明见 [https://ndotl.wordpress.com/2018/08/29/baking-artifact-free-lightmaps/#shadowterm 这篇文章]。&lt;br /&gt;
* Smooth positions per-triangle: 是否应按三角形决定平滑/平面位置？在使用法线差异极大的几何体时，可在极少数情况下禁用。&lt;br /&gt;
* Use 'Receive GI' values: 在渲染器上考虑 “Receive Global Illumination” 值。最初 Bakery 会忽略它。&lt;br /&gt;
* Remove ringing in Legacy light probes: 在 Legacy 模式下启用更柔和的光探针卷积，以防止高对比度区域出现伪影。&lt;br /&gt;
* Always render reflection probes: 在每次 Render/Render Light Probes 后自动渲染反射探针。&lt;br /&gt;
* Ringing removal for L2 light probes: 对 [[使用手册#Light_probe_mode|L2 光探针]] 应用去振铃处理。值越高，探针光照越平滑；这种平滑可以减少 [[https://docs.unity3d.com/6000.2/Documentation/Manual/light-probes-troubleshooting.html](https://docs.unity3d.com/6000.2/Documentation/Manual/light-probes-troubleshooting.html) 振铃] 伪影（如果存在）。&lt;br /&gt;
* Put menu under Tools: 将 Bakery 菜单放入 Tools 菜单下。&lt;br /&gt;
&lt;br /&gt;
如果任何格式设置为 Asset 且启用 mipmapping，会显示额外选项：&lt;br /&gt;
&lt;br /&gt;
* Maximum mipmap count: 定义 mipmap 的最大数量。例如，设置为 2，则 8K 光照贴图仅有两个额外 mipmap：4K 和 2K。更低分辨率将被省略，从而在 mipmapping 过程中限制泄漏伪影。&lt;br /&gt;
&lt;br /&gt;
= SkinnedMeshRenderer 支持 =&lt;br /&gt;
Bakery 自 v1.65 起支持蒙皮网格 (skinned meshes)。但是，有一些限制：&lt;br /&gt;
&lt;br /&gt;
* 某些 Unity 版本不支持蒙皮网格的 UV1，并会悄无声息地忽略 “Generate lightmap UVs”。请确保场景中实际使用的网格具有 UV1，并在可能的情况下使用非重叠的 UV0；&lt;br /&gt;
* UV 填充调整在蒙皮网格上不起作用（Unity 在尝试调用 Unwrap 函数时似乎会崩溃）；&lt;br /&gt;
* 蒙皮网格不能使用每顶点光照贴图 (per-vertex lightmaps)（引擎不支持带蒙皮的 additionalVertexStreams）。&lt;br /&gt;
&lt;br /&gt;
= Shader Tweaks =&lt;br /&gt;
[[File:Image2.jpg|thumb|左：默认双线性过滤。右：双三次过滤。]]&lt;br /&gt;
[[File:Image34.jpg|thumb|左：两个阴影都已烘焙。&amp;lt;br&amp;gt;中：球形阴影为动态，另一个阴影为静态。通过相乘组合在一起。&amp;lt;br&amp;gt;右：与中间相同，但使用默认最小值组合。]]&lt;br /&gt;
&lt;br /&gt;
Bakery 提供可选的着色器修改，可以应用到 Unity 着色器上，以改善光照贴图采样并使实时光照更接近光照贴图效果。着色器调整菜单可以通过 Bakery-&amp;gt;Shader Tweaks 访问。&lt;br /&gt;
&lt;br /&gt;
这些选项会修补基础 Unity 着色器包含文件（来自 CGIncludes 文件夹），这些文件被大多数内置和第三方着色器使用。所有修改都会影响使用该版本编辑器打开的所有项目，但也可以轻松恢复。着色器调整会影响标准和表面着色器的工作方式。HDRP、URP 以及其他 SRP 不受影响。&lt;br /&gt;
&lt;br /&gt;
所有可用修改显示为按钮。点击按钮应用修改，按钮将保持按下状态。再次点击按钮即可移除修改。目前可用选项：&lt;br /&gt;
&lt;br /&gt;
{{note| 可能需要以管理员身份运行 Unity 编辑器以使 CGIncludes 修补生效}}&lt;br /&gt;
&lt;br /&gt;
* Use bicubic interpolation for lightmaps: 光照贴图将使用双三次插值代替默认双线性。此调整能很好地修复低分辨率光照贴图的许多锯齿边缘。目前仅适用于 DX11 和现代主机，其他平台仍使用双线性。&lt;br /&gt;
* Use multiplication for shadowmask: 使用相乘代替最小值组合静态和动态阴影。出于未知原因，Unity 默认使用最小值操作符，这会产生一些乘法不存在的伪影。&lt;br /&gt;
* Use physical light falloff (forward): 用更物理正确的平方反比替换实时点光/聚光灯的默认衰减。“Range” 只会在边缘略微淡出（与 Bakery 光源启用 Physical Falloff 复选框效果一致）。仅影响 Forward 渲染器。详情见 [[Point Light Attenuation]]。&lt;br /&gt;
* Use physical light falloff (deferred): 同上，但仅影响 Deferred 渲染器。&lt;br /&gt;
&lt;br /&gt;
'''衰减调整在 Unity &amp;gt;2017 版本上可能无法完全生效。此外，SRP 默认已经使用正确的衰减。'''&lt;br /&gt;
&lt;br /&gt;
= Bakery shaders =&lt;br /&gt;
Bakery 包含了自带着色器，支持顶点光照贴图，以及 RNM 和 SH 方向模式。它还允许从方向数据计算近似烘焙高光。&lt;br /&gt;
对于普通颜色光照贴图、阴影遮罩和 Dominant Direction 模式，Bakery 着色器 '''不是必需的'''，因为这些功能大多数 Unity 着色器本身已经支持。&lt;br /&gt;
&lt;br /&gt;
=== Standard render pipeline ===&lt;br /&gt;
'''Bakery/Standard''': 扩展了普通 Standard 着色器。额外选项：&lt;br /&gt;
&lt;br /&gt;
* Allow Vertex Lightmaps: 允许该材质用于 [[Vertex Lightmaps|顶点光照贴图]]。&lt;br /&gt;
* Allow RNM Lightmaps: 允许该材质用于 [[#RNM|RNM 方向模式]]。&lt;br /&gt;
* Allow SH Lightmaps: 允许该材质用于 [[#SH|SH 方向模式]]。&lt;br /&gt;
  {{note| 所有 “Allow” 选项会在着色器中启用特定的代码路径。为了性能考虑，建议每个材质仅使用一个 “allow” 选项。}}&lt;br /&gt;
* Enable Lightmap Specular: 使用 Dominant Direction、RNM 或 SH 方向模式的数据计算烘焙高光。注意，由于信息有限，该效果仅为近似。如果你曾在 Unity 4 中使用烘焙高光，效果应可比。与高度扰动的法线贴图搭配效果最佳，在平面表面上效果不佳。&lt;br /&gt;
* Enable VertexLM directional: 如果存在顶点光照贴图，指定 Dominant Direction 数据存储在顶点中并应被使用。&lt;br /&gt;
* Enable VertexLM SH: 如果存在顶点光照贴图，指定 SH 数据存储在顶点中并应被使用。&lt;br /&gt;
* Enable VertexLM Shadowmask: 如果存在顶点光照贴图，指定阴影遮罩存储在顶点中并应被使用。&lt;br /&gt;
* Enable MonoSH: 将方向贴图视为 MonoSH 贴图。&lt;br /&gt;
[[File:Image5.png|thumb|Standard SH light probe vs non-linear]]&lt;br /&gt;
[[File:Shspec.jpg|thumb|SH specular effect]]&lt;br /&gt;
* Non-linear SH：在 SH 方向模式下，此选项可以增强对比度（更接近真实效果），但会使着色器稍微变慢。该技巧基于 Geomerics 的论文《[https://drive.google.com/file/d/1MK6Clw93q8ljijRjb4gQOzzaIjn1uF9Y/view Reconstructing Diffuse Lighting from Spherical Harmonic Data]》。&lt;br /&gt;
* Non-linear Light Probe SH：与 Non-linear SH 类似，但用于光照探针。在探针的情况下，最显著的好处是消除错误的负值。这种问题常见于具有高对比度、明亮 HDR 光源的场景中。这是球谐函数的固有限制，而不是 Bakery 特有的问题（即使用 Unity 内置光照贴图器也可能出现类似伪影）。&lt;br /&gt;
* Force Bicubic Filter：为所有附加贴图启用双三次滤波。若要实现完整的双三次滤波（包括第一张颜色贴图），建议同时在 [[#Shader Tweaks|Shader Tweaks]] 中启用该功能。&lt;br /&gt;
&lt;br /&gt;
'''Bakery/Standard Specular'''：与 Standard 相同，但用于高光（Specular）工作流程。&lt;br /&gt;
&lt;br /&gt;
=== HDRP &amp;amp; URP ===&lt;br /&gt;
要提取额外的 HDRP/URP 着色器，请打开 Bakery 自带的 Bakery_ShaderGraphHDRP.unitypackage 或 Bakery_ShaderGraphURP.unitypackage。&lt;br /&gt;
在其中，你会找到可在自己 Shader Graph 中使用的 Shader Subgraph，以及一些示例材质。&lt;br /&gt;
&lt;br /&gt;
=== 各着色器功能支持对比 ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! 大多数 Unity 着色器&lt;br /&gt;
! 大多数 HDRP 和 URP 着色器&lt;br /&gt;
! Bakery Standard&lt;br /&gt;
! Bakery HDRP graphs&lt;br /&gt;
! Bakery URP graphs&lt;br /&gt;
|-&lt;br /&gt;
| HDR color lightmaps&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Shadowmask&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是 (&amp;gt;= URP 10.1)&lt;br /&gt;
|-&lt;br /&gt;
| Dominant Direction&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| RNM&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| SH&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Mo否SH&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Lightmap specular&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持 Dominant Direction 和 SH&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持 Dominant Direction&lt;br /&gt;
|-&lt;br /&gt;
| Bicubic filtering&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是,&lt;br /&gt;
通过 [[#Shader Tweaks|Shader Tweaks]] 支持&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是,&lt;br /&gt;
通过 [[#Shader Tweaks|Shader Tweaks]] 支持&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
|-&lt;br /&gt;
| Vertex lightmaps&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 单一颜色，没有每顶点 SH、方向或阴影遮罩（Shader Graph 限制）&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 单一颜色，没有每顶点 SH、方向或阴影遮罩（Shader Graph 限制）&lt;br /&gt;
|-&lt;br /&gt;
| Non-Linear Light Probes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Volumes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Volume shadowmask&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Compressed volumes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{note| 除了普通颜色光照贴图之外，所有功能都至少需要 Shader Model 3.0 才能运行。}}&lt;br /&gt;
{{note| 使用 SH 模式的顶点光照贴图由于插值器数量限制，至少需要 Shader Model 4.0。}}&lt;br /&gt;
{{note| 含有从 Dominant Direction 生成高光的更新版 URP 图表可在 [[Bakery_-_GPU_Lightmapper|主维基页面]] 下载。}}&lt;br /&gt;
&lt;br /&gt;
另请参阅：[[Integrating_Bakery_shader_features_to_custom_shaders| 将 Bakery 着色器特性集成到自定义着色器中]]&lt;br /&gt;
&lt;br /&gt;
= 关于 HDRP/URP 的说明 =&lt;br /&gt;
将该插件导入到 HDRP 或 URP 项目后，一般即可直接使用，但需要注意以下几点：&lt;br /&gt;
&lt;br /&gt;
* 示例场景中同时使用了普通 Standard 着色器以及部分 “Bakery Standard” 着色器。HDRP 和 URP 提供了将项目着色器从 Standard 升级到 Lit 的机制，但无法从 Bakery Standard 升级。请将 Bakery Standard 材质替换为来自 Bakery_ShaderGraphHDRP.unitypackage 或 Bakery_ShaderGraphURP.unitypackage 中的材质。&lt;br /&gt;
&lt;br /&gt;
* 在 HDRP 中，默认 HDRI 天空亮度较高（11），且天空反射默认不会被遮蔽。再加上默认的自动曝光，可能导致某些示例场景几乎不可见，因为它们使用了更低的亮度进行烘焙。此时可将 HDRI 天空亮度降低到 1。HDRI 设置通常位于 Assets/HDRPDefaultResources/DefaultSettingsVolumeProfile 中。&lt;br /&gt;
&lt;br /&gt;
* 在 HDRP 中，如果示例场景中的灯光过亮，可在 Bakery 灯光组件上点击 “match real-time to lightmapped” 按钮。&lt;br /&gt;
&lt;br /&gt;
* 在 HDRP 中建议使用 OpenImageDenoise 2（最佳）或 OptiX 7 去噪器，因为它们对高亮度值更适合。&lt;br /&gt;
&lt;br /&gt;
* 在 HDRP 中，“distance” 与普通 Shadowmask 的切换可直接在 Light 组件上完成，而不是在全局设置中。&lt;br /&gt;
&lt;br /&gt;
* 不要在 Skylight 上使用 “match” 按钮，因为 HDRP 使用的是非常特定的程序化天空着色器。请改为将其烘焙为 HDRI [[How_do_I...#How_do_I_use_Skylight_with_a_procedural_sky_shader.3F|这种方式]]。&lt;br /&gt;
&lt;br /&gt;
* 建议在使用 HDRP 时始终将 Light Probe Mode 设置为 L2 或 L1，因为 HDRP 的渲染器并未针对 Legacy 模式进行优化。&lt;br /&gt;
&lt;br /&gt;
* 最新版本的 HDRP/URP 自带自己的 IES 文件导入器。由于资源类型不匹配，Unity 会将旧版本 Bakery IES 灯光断开连接，使其显示为普通点光源。它们可以重新连接并重新保存。&lt;br /&gt;
&lt;br /&gt;
Bakery 的示例场景是为内置渲染管线设计的，因此在 HDRP/URP 中正确渲染它们需要一些步骤。以下是一些提示；假设新建项目使用默认的 HDRP/URP 设置：&lt;br /&gt;
&lt;br /&gt;
=== 在 HDRP 中查看示例场景 ===&lt;br /&gt;
&lt;br /&gt;
* 导入 Bakery 后，将标准材质升级为 HDRP：Edit-&amp;gt;Rendering-&amp;gt;Materials-&amp;gt;Convert All Built-in Materials To HDRP。&lt;br /&gt;
* 将 Bakery_ShaderGraphHDRP.unitypackage 导入项目，因为它包含实现高级 Bakery 功能的特殊 Shader Graph（对于经典颜色/方向/遮罩光照贴图不需要）。&lt;br /&gt;
* 选择 DefaultSettingsVolumeProfile.asset。在 HDRI Sky 部分，将 Exposure Compensation 设置为 1。否则，与示例场景相比，默认 HDRP 会过亮，因曝光调整而使场景看起来很暗。&lt;br /&gt;
* 选择示例场景中的灯光时，HDRP 会初始化其自身的灯光数据。有时会导致灯光立即变得更亮。点击 “Match real-time to lightmapped” 以同步。&lt;br /&gt;
* 在渲染光探针前，将 Light Probe Mode 设置为 L2。&lt;br /&gt;
* '''example_directional''': 将 Shader 更改为 BakeryDirSpecGraph 以查看烘焙高光（或仅使用常规 HDRP/Lit 用于仅漫反射法线映射）。删除球体，因为当前没有支持逐顶点方向的 Shader Graph。&lt;br /&gt;
* '''example_directional_MonoSH''': 将 Shader 更改为 BakerySpecMonoSHGraph（或 BakeryMonoSHGraph，用于没有高光的略微低成本版本）。删除球体，因为当前没有支持逐顶点 MonoSH 的 Shader Graph。&lt;br /&gt;
* '''example_RNM''': 将 Shader 更改为 BakeryRNMGraph。&lt;br /&gt;
* '''example_SH''': 将 Shader 更改为 BakerySpecSHGraph（或 BakerySHGraph，用于没有高光的略微低成本版本）。删除球体，因为当前没有支持逐顶点 SH 的 Shader Graph。&lt;br /&gt;
* '''example_mixed_directional_mode''': 对 MonoSH/RNM/SH 平面，同样需要不同的 Graph。&lt;br /&gt;
* '''example_lights''': 将顶点光照球体的 Shader 更改为 BakeryVertexColorGraph。&lt;br /&gt;
* '''example_prefabs_bake''': 无需进一步调整。&lt;br /&gt;
* '''example_sectors''': 无需进一步调整。&lt;br /&gt;
* '''example_shadowmask''': 选择 DirectLight 并点击 “Match real-time to lightmapped” 修正亮度。将所有 HDRP 灯光的 Shadowmask Mode 设置为 Shadowmask。&lt;br /&gt;
* '''example_sponza_day''': 将 OpenImageDenoise 2（或 Optix 7，如果不支持）设置为首选去噪器。&lt;br /&gt;
* '''example_sponza_evening''': 将 OpenImageDenoise 2（或 Optix 7，如果不支持）设置为首选去噪器。&lt;br /&gt;
* '''example_subtractive''': HDRP 不支持减法模式。&lt;br /&gt;
* '''example_volumes_simple''': 将火车 Shader 更改为 BakeryVolumeSpecGraph（或 BakeryVolumeGraph，用于没有高光的略微低成本版本）。&lt;br /&gt;
* '''example_volumes_simple_shadowmask''': HDRP 当前不支持 Shadowmask Volumes。&lt;br /&gt;
* '''example_volumes_advanced''': 与 example_volumes_simple 相同。&lt;br /&gt;
* '''example_translucency''': 场景大部分应显示正常。对于 “Dynamic sphere lit by volume”，将 Shader 设置为 BakeryVolumeGraph。&lt;br /&gt;
&lt;br /&gt;
=== 在 URP 中查看示例场景 ===&lt;br /&gt;
&lt;br /&gt;
* 导入 Bakery 后，将标准材质升级为 URP：打开 Assets/Bakery/examples/content，输入 &amp;quot;t:material&amp;quot; 选择所有材质，并仅在 &amp;quot;content&amp;quot; 文件夹下搜索。点击 Edit-&amp;gt;Rendering-&amp;gt;Materials-&amp;gt;Convert Selected Built-in Materials To URP。&lt;br /&gt;
* 将 Bakery_ShaderGraphURP.unitypackage 导入项目，因为它包含实现高级 Bakery 功能的特殊 Shader Graph（对于经典颜色/方向/遮罩光照贴图不需要）。&lt;br /&gt;
* '''example_directional''': 将 Shader 更改为 BakeryURPLit，启用 &amp;quot;Bakery Lightmapped Specular&amp;quot;（或者仅保持常规 URP/Lit 用于仅漫反射法线映射）。删除球体，因为当前没有支持逐顶点方向的 Shader Graph。&lt;br /&gt;
* '''example_directional_MonoSH''': 将 Shader 更改为 BakeryURPLit，将 Bakery Mode 设置为 MonoSH，启用 &amp;quot;Bakery Lightmapped Specular&amp;quot;。在顶点光照球体上也启用 &amp;quot;Per-vertex&amp;quot;。&lt;br /&gt;
* '''example_RNM''': 将 Shader 更改为 BakeryURPLit，将 Bakery Mode 设置为 RNM，启用 &amp;quot;Bakery Lightmapped Specular&amp;quot;。&lt;br /&gt;
* '''example_SH''': 将 Shader 更改为 BakeryURPLit，将 Bakery Mode 设置为 SH，启用 &amp;quot;Bakery Lightmapped Specular&amp;quot;。删除球体，因为当前没有支持逐顶点 SH 的 Shader Graph。&lt;br /&gt;
* '''example_mixed_directional_mode''': 类似地使用 BakeryURPLit 并设置不同的 Bakery Mode（MonoSH、RNM、SH）。非方向性/主方向/烘焙法线贴图可使用常规 URP/Lit。&lt;br /&gt;
* '''example_lights''': 无需进一步调整。&lt;br /&gt;
* '''example_prefabs_bake''': 无需进一步调整。&lt;br /&gt;
* '''example_sectors''': 无需进一步调整。&lt;br /&gt;
* '''example_shadowmask''': 类似于 Built-in 渲染管线，在 Bakery 窗口（或项目 Quality Settings）中取消选中 Distance Shadowmask，以在摄像机附近查看实际烘焙/实时阴影混合效果。&lt;br /&gt;
* '''example_sponza_day''': 在植被材质上启用 alpha clipping。&lt;br /&gt;
* '''example_sponza_evening''': 同 example_sponza_day。&lt;br /&gt;
* '''example_subtractive''': 无需进一步调整。&lt;br /&gt;
* '''example_volumes_simple''': 将火车 Shader 更改为 BakeryURPLit，并将 Bakery Mode 设置为 Volume。可选启用 &amp;quot;Bakery Lightmapped Specular&amp;quot;。&lt;br /&gt;
* '''example_volumes_simple_shadowmask''': 与 example_volumes_simple 相同，但也启用 &amp;quot;Volume Shadowmask&amp;quot;。&lt;br /&gt;
* '''example_volumes_advanced''': 与 example_volumes_simple 相同。&lt;br /&gt;
* '''example_translucency''': 场景大部分应显示正常。对于 &amp;quot;Dynamic sphere lit by volume&amp;quot;，将 Shader 设置为 BakeryURPLit 并将 Bakery Mode 设置为 Volume。&lt;br /&gt;
&lt;br /&gt;
= 升级 Bakery =&lt;br /&gt;
在升级该资源时，建议遵循以下步骤：&lt;br /&gt;
&lt;br /&gt;
* 关闭 Bakery 窗口。&lt;br /&gt;
* 关闭 Unity。&lt;br /&gt;
* 重新打开 Unity。&lt;br /&gt;
* 导入更新后的包。&lt;br /&gt;
&lt;br /&gt;
请注意，如果不先关闭 Unity，导入可能会失败，因为 DLL 文件被锁定（会出现类似 &amp;quot;alphabuffergen.dll: Access is denied.&amp;quot; 的提示）。&lt;br /&gt;
&lt;br /&gt;
如果你移动过 Bakery 文件夹（Assets/Bakery 和 Assets/Editor/x64/Bakery）到其他位置，可能需要在更新前将它们移回原处，以避免出现两个冲突的包副本。&lt;br /&gt;
&lt;br /&gt;
= 脚本 API =&lt;br /&gt;
&lt;br /&gt;
== 基本用法 ==&lt;br /&gt;
&lt;br /&gt;
获取并修改渲染设置：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ftLightmapsStorage storage = ftRenderLightmap.FindRenderSettingsStorage();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
可以在 ftLightmapsStorage.cs 中查看可用设置的完整列表。&lt;br /&gt;
&lt;br /&gt;
获取 lightmapper 实例并（重新）加载设置：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap bakery = ftRenderLightmap.instance != null ? ftRenderLightmap.instance : new ftRenderLightmap();&lt;br /&gt;
bakery.LoadRenderSettings();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
渲染光照贴图（如果设置为 L1 或 L2 模式，也会渲染探针）：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;bakery.RenderButton(bool showMsgWindows)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
仅渲染光探针：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;bakery.RenderLightProbesButton(bool showMsgWindows)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
仅渲染反射探针：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;bakery.RenderReflectionProbesButton(bool showMsgWindows)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''showMsgWindows''' 指示是否可以显示任何对话框/确认框。如果设置为 false，则抑制显示。&lt;br /&gt;
&lt;br /&gt;
检查烘焙是否正在进行：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.bakeInProgress&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
使用示例请参考 [[Community_extensions#Batch_scene_baker|Batch Scene Baker]] 脚本。&lt;br /&gt;
&lt;br /&gt;
== 额外函数 ==&lt;br /&gt;
&lt;br /&gt;
将一个 ftLightmapsStorage 的所有渲染设置复制到另一个：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmapsStorage.CopySettings(ftLightmapsStorage src, ftLightmapsStorage dest)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
获取全局（每项目）存储对象：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftGlobalStorage gstorage = ftLightmaps.GetGlobalStorage()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
将 ftLightmapsStorage（每场景）的所有渲染设置复制到 ftGlobalStorage（每项目）：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmapsStorage.CopySettings(ftLightmapsStorage src, ftGlobalStorage dest)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
将 ftGlobalStorage（每项目）的所有渲染设置复制到 ftLightmapsStorage（每场景）：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmapsStorage.CopySettings(ftGlobalStorage src, ftLightmapsStorage dest)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
获取包含 Bakery 二进制文件的文件夹路径：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmaps.GetEditorPath()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 额外变量 ==&lt;br /&gt;
&lt;br /&gt;
获取当前临时文件路径（必须先创建 ftRenderLightmap 实例）：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.scenePath&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
获取/设置 UVGBuffer 数据压缩（启用时为 LZ4，否则为 DDS）：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.compressedGBuffer&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
获取/设置输出光照贴图数据压缩（启用时为 LZ4，否则为 DDS）：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.compressedOutput&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 事件 ==&lt;br /&gt;
&lt;br /&gt;
脚本可以订阅 ftRenderLightmap 类中的静态事件。&lt;br /&gt;
&lt;br /&gt;
在完整渲染前调用：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnPreFullRender&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
在 Legacy 光探针模式下，每渲染一个光探针前调用。ProbeEventArgs 是一个结构体，包含 '''pos''' 字段表示当前光探针的位置：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler&amp;lt;ProbeEventArgs&amp;gt; OnPreRenderProbe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
在 Legacy 光探针渲染完成后调用：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnFinishedProbes&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
在完整渲染完成后调用：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnFinishedFullRender&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
在反射探针渲染前调用：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnPreReflectionProbeRender&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
在反射探针渲染完成后调用：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnFinishedReflectionProbes&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mr F</name></author>
		
	</entry>
	<entry>
		<id>https://geom.io/bakery/wiki/index.php?title=%E4%BD%BF%E7%94%A8%E6%89%8B%E5%86%8C&amp;diff=1834</id>
		<title>使用手册</title>
		<link rel="alternate" type="text/html" href="https://geom.io/bakery/wiki/index.php?title=%E4%BD%BF%E7%94%A8%E6%89%8B%E5%86%8C&amp;diff=1834"/>
		<updated>2025-11-05T14:50:37Z</updated>

		<summary type="html">&lt;p&gt;Mr F: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== 系统要求 ==&lt;br /&gt;
&lt;br /&gt;
使用 Bakery 需要：&lt;br /&gt;
&lt;br /&gt;
Windows（7 或更高版本）电脑。&lt;br /&gt;
&lt;br /&gt;
Nvidia 显卡。最低支持型号为 Kepler（GeForce 650 或更新型号，Quadro 显卡请查看规格）。&lt;br /&gt;
&lt;br /&gt;
64 位 Unity 编辑器。Bakery 已在 5.6 到 6 及更高版本上测试过，同时也在 Tuanjie 1.6.7 上通过测试。&lt;br /&gt;
&lt;br /&gt;
{{note|系统要求仅适用于开发者的电脑，而非目标平台。使用 Bakery 烘焙的光照贴图可以在任何地方使用。}}&lt;br /&gt;
&lt;br /&gt;
== 前提条件 ==&lt;br /&gt;
* 确保你的项目中没有任何脚本编译错误，否则也会导致 Bakery 的脚本无法编译。&lt;br /&gt;
* 确保你的显卡驱动是最新版本，如有需要请[https://www.nvidia.com/Download/index.aspx?lang=en-US 更新]。&lt;br /&gt;
&lt;br /&gt;
'''请使用 Game-Ready（标准）驱动程序，而不是 “Studio” 驱动。'''&lt;br /&gt;
&lt;br /&gt;
== 安装 ==&lt;br /&gt;
&lt;br /&gt;
1. 通过 [https://assetstore.unity.com/packages/tools/level-design/bakery-gpu-lightmapper-122218 Asset Store] 将 Bakery 导入到你的项目中。&lt;br /&gt;
&lt;br /&gt;
2. Unity 会显示要导入的文件列表。如果这是你第一次使用 Bakery，建议直接 点击 Import（导入）。有经验的用户可以取消选中 examples 文件夹，以进行更轻量的安装。&lt;br /&gt;
&lt;br /&gt;
文件将被导入到 `Assets/Bakery` 和 `Assets/Editor/x64/Bakery` 文件夹中。&lt;br /&gt;
这些文件夹之后可以移动。&lt;br /&gt;
&lt;br /&gt;
3. Unity 随后会导入 Bakery 并编译脚本。此时可能会弹出如下窗口：&lt;br /&gt;
&lt;br /&gt;
[[File:Goahead.png]]&lt;br /&gt;
&lt;br /&gt;
此时你应点击 “Go Ahead”（继续）。&lt;br /&gt;
&lt;br /&gt;
现在你应该能在编辑器中看到新增的 Bakery 菜单：&lt;br /&gt;
&lt;br /&gt;
[[File:bmenu.jpg]]&lt;br /&gt;
&lt;br /&gt;
== 快速开始 ==&lt;br /&gt;
&lt;br /&gt;
1. 添加一些模型或基础体，并将其标记为静态（Static）。&lt;br /&gt;
&lt;br /&gt;
'''用于光照贴图的网格必须具有不重叠的 UV2。如果存在 UV2，则会使用 UV2（否则使用 UV1）。如果你的模型没有为光照贴图进行展开，请在资源中勾选 Generate Lightmap UVs（生成光照贴图 UV）。'''&lt;br /&gt;
Unity 的基础体已经具有正确的 UV2。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Staticmarked.jpg|320px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. 选择方向光（Unity 为你创建的那个），并添加 '''Bakery Direct Light''' 组件。&lt;br /&gt;
   {{note|Bakery 和 Unity 使用独立的光源组件。}}&lt;br /&gt;
&lt;br /&gt;
3. Bakery Direct Light 有许多可调选项，但你可以轻松将其与 Unity 光源匹配。点击 '''Match lightmapped to real-time'''。现在 Bakery 光源的颜色应与 Unity 默认的方向光相同，呈黄色调。&lt;br /&gt;
&lt;br /&gt;
[[File:Matching.jpg|640px]]&lt;br /&gt;
&lt;br /&gt;
{{note|Direct Light 组件可能会提示项目未使用线性光强度。问题在于，Unity 默认会对光源颜色应用伽马校正 [https://twitter.com/guycalledfrank/status/1001108508614553600 不正确]。&lt;br /&gt;
可以通过[https://docs.unity3d.com/ScriptReference/Rendering.GraphicsSettings-lightsUseLinearIntensity.html 脚本]启用正确模式。&lt;br /&gt;
这就是 “Fix” 按钮的作用。如果你已经在非线性光强模式下设置了许多光源，并且不想再次更改它们，可以跳过修复。即使你按了 “Fix”，也可以随时撤销此更改。&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. 要获得带阴影的环境光，请创建 Skylight（Bakery-&amp;gt;Create-&amp;gt;Skylight）。&lt;br /&gt;
&lt;br /&gt;
[[File:Menusky.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. 选择 Skylight，为它设置一些偏蓝的颜色，然后点击 '''Match scene skybox to this light'''。   这将使场景的 skybox 与光照完全匹配。&lt;br /&gt;
   {{note|将 Unity 的 skybox 与 Bakery Skylight 匹配是可选的，但对正确性很有用，可以确保可见环境和引擎内的反射探针与烘焙光照一致。目前此选项仅适用于 Standard 渲染管线。}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Skycomp.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. 点击 Bakery-&amp;gt;Render Lightmap。默认情况下，Full Lighting 模式是激活的。它会烘焙所有光源的直接和间接光照贡献。如果你想将实时阴影与烘焙全局光照（GI）结合使用，请将模式更改为 '''Indirect'''。&lt;br /&gt;
&lt;br /&gt;
[[File:Bakerywindow.jpg]]&lt;br /&gt;
&lt;br /&gt;
{{note| Bakery 可能会提示你正在使用旧的 [https://docs.unity3d.com/Manual/LinearLighting.html gamma mode]。如果你在意光照质量，强烈建议使用线性模式。如果你的项目已经在错误的伽马模式下设置好了，并且不想更改，或者是发布到不支持线性模式的移动设备上，也可以忽略此提示。}}&lt;br /&gt;
&lt;br /&gt;
7. 点击 '''Render'''。&lt;br /&gt;
&lt;br /&gt;
8. 完成！现在你应该已经得到烘焙的全局光照（GI）：&lt;br /&gt;
&lt;br /&gt;
[[File:Bakedgi.jpg]]&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 ==&lt;br /&gt;
&lt;br /&gt;
所有渲染设置都可以通过 Bakery-&amp;gt;Render Lightmap 访问。设置会为每个场景单独保存。Bakery 窗口顶部的选项允许你在 Simple（简单）、Advanced（高级）和 Experimental（实验）设置之间切换，每个后续模式都会显示更多可调选项。对于大多数场景，Simple 模式已经足够，是入门的好方法。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render mode ===  &lt;br /&gt;
定义要烘焙的光照贴图类型。  &lt;br /&gt;
&lt;br /&gt;
===== Full Lighting =====&lt;br /&gt;
烘焙所有 Bakery 光源的完整直接光和间接光。&lt;br /&gt;
{{note|在 2017.3 之前的 Unity 版本中，如果同一对象上同时有 Unity 和 Bakery 组件，你需要手动禁用 Unity 组件以避免亮度加倍。在较新版本中，实时效果会自动对烘焙光源禁用，就像内置光照烘焙器一样。}}&lt;br /&gt;
&lt;br /&gt;
===== Indirect =====&lt;br /&gt;
[[File:Image26.png|thumb|Unity 支持的不同渲染模式对比]]&lt;br /&gt;
基础混合模式。它会查看每个光源上的 Baked Contribution 选择器：如果设置为 ''Direct And Indirect''，则光源会像在 Full Lighting 模式下一样被烘焙。如果设置为 ''Indirect Only''，则只会烘焙该光源的间接光照（GI）。在后一种情况下，你应保持对象上的 Unity 光源和 Bakery 光源同时存在，一个提供实时直接光照，另一个提供预计算的全局光照（GI）。&lt;br /&gt;
&lt;br /&gt;
[[File:Indirectonly.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== Shadowmask =====&lt;br /&gt;
[[File:Image21.png|thumb|左：完全烘焙的光照。中：动态光源 + 烘焙 GI。右：胶囊形阴影、凹凸贴图和高光为动态光照，但立方体阴影和 GI 为烘焙光照。]]&lt;br /&gt;
[[File:Image6.png|thumb|当相机足够远离场景，或者动态阴影被禁用时，场景将呈现如下效果]]&lt;br /&gt;
更高级的混合模式。它通过生成两种类型的光照贴图来工作——一种包含烘焙颜色（如 Indirect 模式），另一种包含静态物体的阴影。它有几个优点：&lt;br /&gt;
* 实时阴影只需渲染少量动态对象，而不是整个场景。&lt;br /&gt;
* 实时阴影与烘焙阴影可以正确融合。&lt;br /&gt;
* 实时光源可以渲染凹凸贴图、高光和其他表面效果，同时仍会被高质量烘焙阴影遮挡。&lt;br /&gt;
[https://docs.unity3d.com/Manual/LightMode-Mixed-Shadowmask.html 更多详情]&lt;br /&gt;
&lt;br /&gt;
要启用此行为，你必须在同一对象上同时存在 Unity 光源和 Bakery 光源，并将 Baked Contribution 设置为 ''Shadowmask and Indirect''。未标记的光源将按 Indirect 模式进行烘焙。&lt;br /&gt;
&lt;br /&gt;
[[File:Smask22.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== Distance Shadowmask =====&lt;br /&gt;
此复选框仅在你选择 Shadowmask 时可见，并且只是切换项目 [https://docs.unity3d.com/Manual/LightMode-Mixed-ShadowmaskMode.html Quality Settings] 中同名的设置。&lt;br /&gt;
[https://docs.unity3d.com/Manual/LightMode-Mixed-DistanceShadowmask.html 更多详情]&lt;br /&gt;
{{note|由于缺少对应的脚本 API，该复选框在 Unity 5.6.x 上不可见。你可以在 Window-&amp;gt;Lighting-&amp;gt;Mixed Lighting-&amp;gt;Lighting Mode 中切换该设置。}}&lt;br /&gt;
{{note|在 Unity 版本 &amp;lt; 2017.3 中，由于 API 限制，渲染 Shadowmask 光照贴图会清除光照探针。烘焙后需要重新渲染光照探针。在较新版本中不应发生此问题。}}&lt;br /&gt;
&lt;br /&gt;
===== Subtractive =====&lt;br /&gt;
&lt;br /&gt;
启用 [https://docs.unity3d.com/Manual/LightMode-Mixed-Subtractive.html Subtractive] 光照模式。&lt;br /&gt;
&lt;br /&gt;
此选项对光照贴图本身没有任何特殊作用，实际上它的工作方式与 Full Lighting 相同。&lt;br /&gt;
&lt;br /&gt;
唯一的区别是，它还会将实时 Unity 光源设置为与 Subtractive 模式兼容（因为无法通过 UI 完成此操作）。&lt;br /&gt;
&lt;br /&gt;
你还需要在 [https://docs.unity3d.com/Manual/GlobalIllumination.html#MixedLighting Unity Lighting] 窗口中额外设置全局减法参数（例如全局阴影颜色）。&lt;br /&gt;
&lt;br /&gt;
===== Ambient Occlusion Only =====&lt;br /&gt;
仅烘焙环境光遮蔽（AO）。如果你很清楚自己在做什么，这可能会有用。请确保设置 [[#Ambient_occlusion|AO 选项]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Directional mode ===&lt;br /&gt;
[[File:Image3.png|thumb|不同方向模式的对比]]&lt;br /&gt;
定义了方向信息的烘焙方式。标准光照贴图每个像素只存储单一颜色，而方向光照贴图为着色器提供了关于该像素周围半球内光照变化的提示。这些数据用于在完全烘焙的区域中结合法线贴图。如果将其应用到内置的 [[#Bakery_shaders|Bakery]] 着色器中，还可以产生**近似高光反射**效果。&lt;br /&gt;
&lt;br /&gt;
===== None =====&lt;br /&gt;
不包含方向数据，每个像素仅有单一颜色。&lt;br /&gt;
&lt;br /&gt;
===== Baked Normal Maps =====&lt;br /&gt;
依然没有方向数据，但在渲染光照贴图时会考虑法线贴图。此方式在运行时没有额外开销。由于光照贴图的分辨率通常低于法线贴图，结果可能显得模糊。其他问题包括：由于缺乏 mipmapping，远处可能出现锯齿，以及降噪步骤可能导致细节被涂抹。要了解如何在此模式下使用具有程序化法线的自定义着色器，请参阅 [[#Normal_mapping|Normal Mapping]] 章节。&lt;br /&gt;
&lt;br /&gt;
===== Dominant Direction =====&lt;br /&gt;
此模式类似于 Unity 中 Enlighten 和 Progressive 烘焙器的实现。它与大多数着色器兼容，仅生成一张额外的贴图，运行时开销极小。缺点是凹凸贴图的效果较弱，略显灰暗，与实时光照下的同一物体相比可能差异较大。&lt;br /&gt;
&lt;br /&gt;
===== RNM =====&lt;br /&gt;
基于最初为《Half-Life 2》开发的 [https://steamcdn-a.akamaihd.net/apps/valve/2004/GDC2004_Half-Life2_Shading.pdf Radiosity Normal Mapping] 技术（相关演示文稿），后来被许多游戏采用（如《Mirror's Edge》）。此模式总共生成三张 HDR 贴图，是内存占用最高的模式之一，但运行时开销仍相对较低。该模式比 Dominant Direction 更精确，能更好地再现表面反差，并能正确处理来自不同角度、具有不同颜色的光照对法线贴图的影响。&lt;br /&gt;
&lt;br /&gt;
===== SH =====&lt;br /&gt;
基于论文《[https://media.contentapi.ea.com/content/dam/eacom/frostbite/files/gdc2018-precomputedgiobalilluminationinfrostbite.pdf Precomputed Global Illumination in Frostbite]》。这是最高质量的模式，能提供更好的表面对比度，并准确表现来自不同方向、不同颜色的光照。总共生成四张贴图，其中仅一张为 HDR，因此比 RNM 占用更少内存。运行时开销略高于 RNM。&lt;br /&gt;
&lt;br /&gt;
===== MonoSH =====&lt;br /&gt;
[[File:FY8Ru8hWIAAdYYH.jpg|thumb|Dominant Direction、完整 SH 与 MonoSH 的尺寸/质量对比]]&lt;br /&gt;
与 SH 类似，但使用单色的 L1 方向系数。表面对比度同样良好，虽然无法准确表现来自不同方向的不同颜色光照，但对多数场景来说已经足够。仅生成一张额外贴图，因此显存占用与带宽需求与 Dominant Direction 相近；事实上更低，因为 Dominant Direction 使用 RGBA 贴图，而 MonoSH 只需 RGB。该贴图通过内置的方向光照贴图系统传递，但''在标准着色器下显示不正确''。请务必使用兼容的着色器。&lt;br /&gt;
&lt;br /&gt;
===== 限制 =====&lt;br /&gt;
&lt;br /&gt;
* RNM 和 SH/MonoSH 只能与 [[#Bakery_shaders|Bakery shader]] 一起使用，或者需要对你的着色器进行调整。&lt;br /&gt;
* 在 RNM 和 SH 模式下，不会生成标准的颜色光照贴图。你需要确保场景中所有材质都使用 Bakery Shader，或者使用 [[#Bakery_Lightmap_Group_Selector|Lightmap Groups]] 将 RNM/SH 对象与其他对象分开。&lt;br /&gt;
* RNM 和 SH 贴图是通过 [https://docs.unity3d.com/ScriptReference/MaterialPropertyBlock.html MaterialPropertyBlock] 应用于对象的，因此在 Unity 的 Lighting 窗口中可能无法完全显示。&lt;br /&gt;
* Dominant Direction、RNM 和 SH/MonoSH 模式可能需要为全局光照（GI）和光照网格使用更多采样，以获得相近的质量。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Texels per unit ===&lt;br /&gt;
[[File:Texelscomp.jpg|thumb|1 vs 10 texels per unit]]&lt;br /&gt;
每个世界单位的光照贴图像素（Texels）近似数量。它会影响生成光照贴图的数量和分辨率。&lt;br /&gt;
&lt;br /&gt;
入门示例值：&lt;br /&gt;
&lt;br /&gt;
* 大型户外区域（城市）：1 - 5&lt;br /&gt;
* 中型户外区域（几条小巷）：10 - 20&lt;br /&gt;
* 高质量室内场景：100&lt;br /&gt;
&lt;br /&gt;
假设场景比例大约为 1 单位 = 1 米。在 Unity 中使用这种比例通常是推荐的，以便更好地导航和进行物理模拟。如果你的比例不同，请相应地调整 Texels。&lt;br /&gt;
&lt;br /&gt;
请注意，Texels Per Unit 是基础分辨率，但每个对象还可以通过 Mesh Renderer 上的 &amp;quot;Scale in Lightmap&amp;quot; 选项以及 Bakery 窗口中的 &amp;quot;Scale per map type&amp;quot; 进行额外调整。&lt;br /&gt;
&lt;br /&gt;
{{note| 将 &amp;quot;Scale in Lightmap&amp;quot; 设置为 0 的对象不会被烘焙，但仍会投射阴影并影响全局光照（GI）。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Max resolution ===&lt;br /&gt;
光照贴图的最大尺寸限制。如果对象无法容纳在单张光照贴图中（根据当前的 Texels Per Unit 值），将会分配额外的光照贴图。同样的四个正方形对象可以使用四张 512x512 的贴图，也可以使用一张 1024x1024 的贴图。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bounces ===&lt;br /&gt;
[[File:Image36.png|thumb|注意更多的反弹会为封闭空间带来更多光照。]]&lt;br /&gt;
定义光线在表面上反弹的次数。通常，对于户外场景（例如城市），较低的反弹次数就足够了，而对于封闭场景（室内、洞穴），则需要较高的反弹次数。&lt;br /&gt;
&lt;br /&gt;
虽然滑块最多限制为 5 次反弹，但可以在数字输入框中输入任意反弹次数。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Samples ===&lt;br /&gt;
[[File:Image7.png|thumb|左：Samples = 4，右：Samples = 16。为了演示，去噪功能已关闭。]]&lt;br /&gt;
影响全局光照（GI）的质量。典型值为 16 到 32。&lt;br /&gt;
&lt;br /&gt;
{{note| 可以输入超出滑块最大值的任意数字，但请注意，该数字表示最终光线数量的平方根，例如 32 表示 1024 条光线，64 表示 4096 条光线，依此类推。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GPU Priority ===&lt;br /&gt;
在 GPU 处理光照贴图时，操作系统和其他软件的响应可能会变慢。此选项允许你在烘焙速度和系统响应之间进行平衡。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render ===&lt;br /&gt;
为所有打开的场景烘焙光照贴图。&lt;br /&gt;
如果 [[使用手册#Light_probe_mode|Light Probe Mode]] 设置为 L1 或 L2，也会烘焙 [https://docs.unity3d.com/Manual/LightProbes.html 光照探针]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Render Light Probes ===&lt;br /&gt;
为所有打开的场景烘焙 [https://docs.unity3d.com/Manual/LightProbes.html 光照探针]。&lt;br /&gt;
&lt;br /&gt;
请注意，要在 Shadowmask 模式下对动态对象获得正确的混合光阴影，你还需要启用 [[使用手册#Occlusion_probes|occlusion probes]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Render Reflection Probes ===&lt;br /&gt;
为所有打开的场景烘焙反射探针。此按钮仅为方便起见，会调用引擎内置的反射探针更新功能。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update Skybox Probe ===&lt;br /&gt;
为当前的 skybox 烘焙全局漫反射和反射探针。与 “Render Reflection Probes” 一样，它仅调用引擎内置函数。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Occlusion probes ===&lt;br /&gt;
在渲染光照探针时，允许 Unity 使用当前选择的内置光照烘焙器烘焙遮挡探针（occlusion probes）。遮挡探针是存储在普通光照探针中的附加数据，可以防止动态对象在阴影区域被错误照亮。目前在 Unity 中无法使用自定义遮挡探针，必须调用内置光照烘焙器来完成此操作。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Warnings ===&lt;br /&gt;
这些选项会在按下任意 Render 按钮后对场景进行验证，并显示警告对话框，询问是否继续或停止烘焙过程。&lt;br /&gt;
&lt;br /&gt;
* Suppress all popups（屏蔽所有弹窗）：按下 Render 后不显示任何对话框。&lt;br /&gt;
* UV validation（UV 验证）：检查所有模型是否具有完全正确的光照贴图 UV，特别是 UV 是否位于 0-1 范围内且不重叠。&lt;br /&gt;
* Overwrite check（覆盖检查）：显示哪些光照贴图文件将被覆盖。&lt;br /&gt;
* Memory check（内存检查）：显示大致所需的视频内存量。&lt;br /&gt;
* Sample count check（采样数检查）：检查是否有光源、GI 或 AO 的采样数不合理，可能导致 GPU 超出可用资源。&lt;br /&gt;
* Lightmapped prefab validation（光照贴图预制体验证）：验证光照贴图预制体，并在某些预制体将被覆盖时发出通知。&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 (Advanced) ==&lt;br /&gt;
=== Light probe mode ===&lt;br /&gt;
更改光照探针的烘焙方式。&lt;br /&gt;
&lt;br /&gt;
* Legacy（传统模式）：使用 Render Light Probes 按钮生成探针。点光源和方向光在光照烘焙器中计算，而区域光/天空光/间接光则通过在每个探针位置渲染立方体贴图收集。结果以 [https://docs.unity3d.com/ScriptReference/Rendering.SphericalHarmonicsL2.html L2] 球谐（spherical harmonics）形式存储。缺点是立方体贴图渲染速度慢，并且在游戏中使用的着色器未物理正确表示光照表面，或者项目为移动平台设置时，光照贴图和探针可能不匹配（Unity 可能会裁剪高强度值）。&lt;br /&gt;
&lt;br /&gt;
* L1：在点击 Render 时，光照探针会与光照贴图一起渲染。此选项提供更高的烘焙性能，并保证探针光照与光照贴图匹配。结果以 L1 球谐形式存储（仍可被普通着色器使用）。使用 [[#Bakery_shaders|Bakery shader]] 的 Non-Linear Light Probe SH 选项可以进一步提升结果。&lt;br /&gt;
&lt;br /&gt;
* L2：更高质量（完整 L2 球谐）。与 L1 一样，会自动与光照贴图一起渲染。与 L1 相比，性能影响可忽略不计。应在所有着色器下显示正常。探针对比度/方向性/振铃去除可通过 Project Settings -&amp;gt; Bakery -&amp;gt; “Ringing removal for L2 light probes” 调整。&lt;br /&gt;
&lt;br /&gt;
'''在 Unity 2019.3 中似乎存在一个 bug，如果启用 Occlusion Probes 选项，Legacy 光照探针的颜色无法正确保存。使用 Occlusion Probes 时，默认且推荐使用 L2 模式。'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Asset UV Processing ===&lt;br /&gt;
配置资产的 UV 间距（padding）调整。可选值：&lt;br /&gt;
&lt;br /&gt;
* Don't change（不更改）：不修改资产。&lt;br /&gt;
* Adjust UV padding（调整 UV 间距）：会查找具有自动生成 UV 的模型（资产上启用 “Generate Lightmap UVs”），并进一步调整它们，使每个网格的 UV 岛之间具有适当间距。导入器设置中的全模型 Pack Margin 会被忽略。系统会根据每个网格的面积和光照贴图分辨率计算出最优值。&lt;br /&gt;
* Adjust UV padding for new meshes only（仅调整新网格的 UV 间距）：与上面相同，但会跳过之前至少调整过一次的模型。&lt;br /&gt;
* Remove UV adjustments（移除 UV 调整）：撤销所有之前的 UV 调整，使自动展开的模型恢复到 Unity 原始展开的样子。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser ===&lt;br /&gt;
设置所需的去噪器。可选值：&lt;br /&gt;
&lt;br /&gt;
* Optix 5：使用 OptiX 5.1 AI 去噪器（之前称为 “Legacy denoiser”）。在 GPU 上运行。支持从 [https://en.wikipedia.org/wiki/Kepler_(microarchitecture) Kepler]（通常是 GeForce 6xx）到 [https://en.wikipedia.org/wiki/Turing_(microarchitecture) Turing]（通常是 GeForce 20xx）的所有显卡。不支持 [https://en.wikipedia.org/wiki/Ampere_(microarchitecture) Ampere]（30xx）。OptiX 5.1 使用嵌入的静态训练数据集，因此不受驱动实现影响。&lt;br /&gt;
&lt;br /&gt;
* Optix 6：使用 OptiX 6.0 AI 去噪器（之前为默认选项）。在 GPU 上运行。在 Kepler（6xx）显卡上似乎无法使用，但在更新的显卡上均可运行，包括 Ampere（30xx）。自 6.0 起，OptiX 去噪器的训练数据集存储在驱动中。在 v442.50 之前，其行为类似于 OptiX 5.1；但之后 NVIDIA [https://forums.developer.nvidia.com/t/optix7-denoiser-different-results-with-different-version-of-drivers/117989/2 更改了数据集]，结果可能有所不同。更新后的数据集有时可能产生网格状图案和更亮的边缘（仍可通过 “Denoise: fix bright edges” 修复），但运行速度更快。&lt;br /&gt;
&lt;br /&gt;
* Optix 7：使用 OptiX 7.2 AI 去噪器。行为类似 OptiX 6.0，但在 Ampere（30xx）上可能支持更好。&lt;br /&gt;
&lt;br /&gt;
* OpenImageDenoise：使用 Intel Open Image Denoise 库。在 CPU 上运行（任何支持 SSE 4.1 的 CPU）。可能略慢于 OptiX，但质量可比。&lt;br /&gt;
&lt;br /&gt;
* OpenImageDenoise2：使用 Intel Open Image Denoise 2，CUDA 模式。在 GPU 上运行，性能与 OptiX 6/7 相当，质量与 CPU 版本相同。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Adjust sample positions ===&lt;br /&gt;
寻找最佳采样位置以防止光照泄漏。算法详情可参考 [https://ndotl.wordpress.com/2018/08/29/baking-artifact-free-lightmaps/#leaks 此处]。在某些情况下（通常是大型且多边形极少、法线平滑的几何体），可能会产生不正确的结果，此时可以将其禁用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Unload scenes before render ===&lt;br /&gt;
在烘焙前卸载 Unity 场景以释放显存。复杂场景仅在编辑器中显示就可能占用数 GB 的显存。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Denoise ===&lt;br /&gt;
[[File:Image31.png|thumb|左：未开启 “Denoise”，右：开启 “Denoise”。]]&lt;br /&gt;
如果启用，将应用去噪算法。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Fix Seams ===&lt;br /&gt;
[[File:Image22.png|thumb|左：缝隙（“Fix Seams” 关闭），右：缝隙已修复（“Fix Seams” 开启）。]]&lt;br /&gt;
如果启用，将尝试融合由 UV 不连续造成的缝隙。对平滑几何体很有用，包括 Unity 默认的球体。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Split by scene ===&lt;br /&gt;
如果同时加载多个场景，并且启用此选项，每个场景将拥有自己的一套光照贴图，而不会与其他场景共享。这对于在运行时流式加载场景时限制纹理占用量非常有用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hole filling ===&lt;br /&gt;
[[File:Holefilling.jpg|thumb|“Hole filling” 关闭与开启的对比。]]&lt;br /&gt;
如果 Atlas Packer 设置为 xatlas，将尝试填充每个孔洞，从而生成更高效的贴图集。对于几何体非常复杂的场景，可能会增加场景导出时间，但通常推荐开启。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Min resolution ===&lt;br /&gt;
光照贴图的最小尺寸限制。可用于在生成大量小而完全填充的光照贴图与少量未完全填充的光照贴图之间进行平衡。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Scale per map type ===&lt;br /&gt;
允许你对颜色贴图、Shadowmask 和方向贴图设置不同的分辨率缩放。例如，常见情况是间接光颜色分辨率较低，但 Shadowmask 分辨率较高。请注意，缩放在光照贴图渲染完成后才应用，因此不会节省烘焙时间。如果启用了 “Adjust UV padding”，间距将基于最低分辨率的贴图，以防止像素泄漏。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Checker preview ===&lt;br /&gt;
[[File:Image12.png|thumb|Checker Preview 功能演示。]]&lt;br /&gt;
如果勾选了 “Show checker” 选项，场景视图将在可见对象上渲染棋盘格图案，以展示光照贴图像素大小。这对于在烘焙前确保 Texels Per Unit 和其他影响分辨率的设置使用合理数值非常有用。&lt;br /&gt;
&lt;br /&gt;
启用 Checker Preview 将强制 Bakery 执行贴图集打包。可能需要一些时间，但通常不会超过几秒钟。在修改场景内容后，按下 “Refresh checker” 可重新打包场景以查看更改。&lt;br /&gt;
&lt;br /&gt;
Checker Preview 还使用随机颜色显示场景将如何被分割到不同的光照贴图中。&lt;br /&gt;
&lt;br /&gt;
{{note| 当前 Checker Preview 无法显示地形的正确像素大小。}}&lt;br /&gt;
&lt;br /&gt;
==== Atlas preview ====&lt;br /&gt;
[[File:FN-TmhRXwAE9i2I.png|thumb|Atlas Preview 功能演示]]&lt;br /&gt;
当 Checker Preview 开启时，会显示 Atlas Preview 按钮。点击它将打开一个新窗口，显示未来光照贴图的 UV 布局。点击 &amp;quot;&amp;lt;&amp;quot; 和 &amp;quot;&amp;gt;&amp;quot; 按钮可浏览各个光照贴图。&lt;br /&gt;
这对于在烘焙前检查打包质量和光照贴图数量非常有用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Emissive boost ===&lt;br /&gt;
将任何表面自发光（emission）乘以此数值。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Indirect boost ===&lt;br /&gt;
将所有反弹光照乘以此数值。作用与光源组件上的 Indirect Intensity 相同，但为全局设置。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Backface GI ===&lt;br /&gt;
[[File:Image30.jpg|thumb|Backface GI]]&lt;br /&gt;
[[File:Image35.png|thumb|左：“Backface GI” = 0，右：“Backface GI” = 1。注意阴影区域接收到更多的绿色光照。]]&lt;br /&gt;
决定光线通过前面表面到达背面并被全局光照（GI）反弹的程度。这对于薄的半透明表面（如树叶）尤其有用。取值范围为 0-1。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Ambient occlusion ===&lt;br /&gt;
[[File:Image15.png|thumb|左：AO intensity = 0，右：AO intensity = 1。]]&lt;br /&gt;
一种简单的非物理环境光遮蔽（Ambient Occlusion，AO），可在最终场景光照上叠加以增强美观效果。&lt;br /&gt;
&lt;br /&gt;
* Intensity（强度）：控制 AO 效果的可见度。值为 0 时禁用该效果。&lt;br /&gt;
* Radius（半径）：决定 AO 效果使用的光线距离。较小的值产生局部遮蔽（角落、褶皱），较大的值则更类似 Skylight，从远处物体产生阴影。&lt;br /&gt;
* Samples（采样数）：影响环境光遮蔽的质量。典型值为 4 到 32。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dither transparency ===&lt;br /&gt;
通过自动抖动不透明度贴图来启用半透明阴影。[[使用手册#Opacity|了解 Bakery 如何处理不透明度贴图]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== RTX Mode ===&lt;br /&gt;
启用 RTX 硬件加速。仅 RTX 显卡可受益于此选项。最低支持的驱动版本为 418。&lt;br /&gt;
&lt;br /&gt;
驱动可以在大多数非 RTX Nvidia 显卡上模拟 RTX 模式，但通常会更慢。&lt;br /&gt;
&lt;br /&gt;
在 Ampere（3xxx）或更新的显卡上，RTX 模式 ''必须'' 启用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Export terrain trees ===&lt;br /&gt;
如果启用，绘制在地形上的树木将影响光照。树木本身不会被烘焙。请注意，在烘焙过程中，每棵树都使用最高可能的 LOD 等级。对于多公里范围且模型高度复杂的森林场景，不建议使用此选项。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Terrain optimization ===&lt;br /&gt;
如果启用（默认），地形将使用独立的光线追踪技术以利用其高程图几何结构。否则，它们将像其他普通网格一样处理。地形优化可以显著减少高分辨率地形所需的内存占用。在某些情况下，它还能加快地形烘焙速度，但在其他情况下（尤其是简单低分辨率地形）可能需要禁用该选项。&lt;br /&gt;
&lt;br /&gt;
{{note| 地形优化当前不兼容绘制的地形洞。需禁用此选项才能使其正常工作。}}&lt;br /&gt;
{{note| 地形优化仅支持非 RTX 模式。}}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Light Mesh batch limit ===&lt;br /&gt;
如果该值大于 0，会将多个 Light Mesh 合并为一个，前提是它们具有相同设置并影响相同的 Lightmap Groups，同时将它们的总采样数限制为该值（例如，如果限制为 64，则可以合并 2 个采样数为 32 的灯光，或 4 个采样数为 16 的灯光，等等）。在拥有大量 Light Mesh 的场景中，这可以提升性能。但设置过高时需小心，因为 GPU 在一次处理过多采样时可能触发操作系统驱动超时。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Compress volumes ===&lt;br /&gt;
如果启用，将对体积 3D 贴图应用纹理压缩，并将 Bakery 着色器切换到相应的采样模式。不推荐对分辨率非常低的体积使用此选项。体积大小可能会被调整为 4 的倍数。&lt;br /&gt;
&lt;br /&gt;
注意事项：&lt;br /&gt;
&lt;br /&gt;
* 目前仅支持压缩为 BC6H/BC7 纹理格式（桌面/主机平台）。&lt;br /&gt;
* 体积压缩仅支持 Unity 2020.1 或更高版本。&lt;br /&gt;
* 目前仅标准渲染管线的 Bakery 着色器支持使用压缩体积贴图。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Samples multiplier ===&lt;br /&gt;
将所有阴影和 GI 采样数乘以指定因子。可用于在草稿质量和最终质量之间快速切换。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Tile size ===&lt;br /&gt;
与 [[#GPU Priority|GPU Priority]] 相同，但这里设置的是贴图块（tile）大小。Bakery 会将光照贴图拆分为更小的块，并一次更新一个块。块越小，GPU 工作被中断的次数越多，系统响应性可能更好。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Temp path ===&lt;br /&gt;
临时文件夹。在渲染过程中，Bakery 可能需要几个 GB 的可用空间。将此文件夹放在 SSD 上相比 HDD 可略微加快渲染速度。目前，该文件夹不会自动清理。你可以随时手动删除其内容（渲染时除外），或通过 Bakery -&amp;gt; Utilities -&amp;gt; Clear cache 清理。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Output path ===&lt;br /&gt;
光照贴图文件夹。所有光照贴图，以及 lightprobe 和顶点颜色（vertex color）资源都将保存在此处。该路径相对于你的 Assets 文件夹。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Use scene named output path ===&lt;br /&gt;
如果启用此选项，输出路径将自动设置为与当前活动场景同名的文件夹（Assets/CurrentSceneName/）。这与 Unity 内置光照贴图烘焙器的行为类似。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render Selected Groups ===&lt;br /&gt;
仅烘焙包含所选对象的 Lightmap Groups。&lt;br /&gt;
不仅仅是所选对象会被重新绘制，它们所属的所有 Lightmap Groups 都会被处理。其他光照贴图不会被更新。如果对象不属于某个手动分配的组，则使用相同光照贴图的场景部分将被重新烘焙。&lt;br /&gt;
&lt;br /&gt;
目前，使用 [[Partial_scene_baking|Sectors]] 进行场景部分烘焙更为方便。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Beep on finish ===&lt;br /&gt;
如果启用，Bakery 在烘焙完成时会播放提示音。&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 (Experimental) ==&lt;br /&gt;
=== Unwrapper ===&lt;br /&gt;
如果启用 [[#Asset_UV_Processing|Adjust UV Padding]]，则定义将使用的展开器（unwrapper）。&lt;br /&gt;
&lt;br /&gt;
* Default：使用 Unity 标准展开器。Bakery 会为每个具有不同间距参数的网格调用 [https://docs.unity3d.com/ScriptReference/Unwrapping.GenerateSecondaryUVSet.html Unwrapping.GenerateSecondaryUVSet]。&lt;br /&gt;
* xatlas：使用 [https://github.com/jpcy jpcy] 的 [https://github.com/jpcy/xatlas xatlas]，这是 [https://github.com/castano Ignacio Castaño] 的 [https://github.com/Thekla/thekla_atlas thekla_atlas] 的修改版。thekla_atlas 曾用于游戏《The Witness》（[http://the-witness.net/news/2010/03/graphics-tech-texture-parameterization/ 参见博客文章]）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Atlas Packer ===&lt;br /&gt;
选择在将不同对象的 UV 布局打包到大型光照贴图集时使用的算法。&lt;br /&gt;
* Default：Bakery 在 v1.7 之前使用的原始算法。&lt;br /&gt;
* xatlas：使用 xatlas。&lt;br /&gt;
&lt;br /&gt;
某些功能仅支持特定的贴图集打包器：&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Default&lt;br /&gt;
! xatlas&lt;br /&gt;
|-&lt;br /&gt;
| [[使用手册#Bakery_Lightmap_Group_Selector|Override resolution]]&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
|-&lt;br /&gt;
| 高效 LOD 打包&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
|-&lt;br /&gt;
| [[使用手册#Hole_filling|Hole filling]]&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
请注意，贴图集打包器（Atlas Packer）也可以为每个 Lightmap Group 单独选择。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Export geometry and maps ===&lt;br /&gt;
如果启用，Bakery 会在渲染前将场景导出为其专用格式。如果你确定场景的几何体和贴图以及光照贴图分辨率设置没有改变（例如，你只是调整 GI 或光源设置），可以禁用此选项以加快下一次渲染速度。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update unmodified lights ===&lt;br /&gt;
如果启用，Bakery 会重新计算自上次渲染以来未改变的光源。如果你只是调整某个光源，不想等待其他光源重新渲染，可以禁用此选项。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update modified lights and GI ===&lt;br /&gt;
如果启用，Bakery 会重新计算自上次渲染以来发生变化的 GI 和光源。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== UV padding: increase only ===&lt;br /&gt;
仅在启用 [[#Asset_UV_Processing|Adjust UV padding]] 时可见。默认情况下，模型资源的最佳 UV 间距仅基于当前加载的场景进行计算。如果同一模型有多个实例使用不同的光照贴图分辨率，最小的分辨率将决定间距，以确保 UV 图块之间的间距足够大，防止相互重叠。然而，在两个不同的独立场景中烘焙同一模型时，为新场景优化可能会破坏之前场景中的 UV。勾选此选项可以防止这种情况发生，即永远不减小间距值，从而始终为曾经烘焙过的最低分辨率实例进行优化。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoise: fix bright edges ===&lt;br /&gt;
[[File:Image19.png|thumb|左：去噪后可见明亮边缘；右：已修复。]]&lt;br /&gt;
仅在 [[#Denoise|Denoise]] 启用时可见。有时用于去噪的神经网络可能会在阴影周围产生明亮边缘，就像应用了锐化效果一样。如果启用此选项，Bakery 会尝试将其滤除。启用后，去噪阶段可能会略微变慢。&lt;br /&gt;
&lt;br /&gt;
此功能也可用于滤除“火花”（fireflies），即光照贴图中偶尔出现的亮点。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Post-packing ===&lt;br /&gt;
有时在渲染场景时，Bakery 会将光照贴图拆分为多个子光照贴图，例如在烘焙不同 LOD 或地形时。&lt;br /&gt;
Post-packing 会尝试通过将这些子光照贴图合并到同一纹理中来最小化最终贴图集数量。&lt;br /&gt;
建议保持此选项启用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Combine with Enlighten real-time GI ===&lt;br /&gt;
如果启用，则在按下 Render 按钮时，Bakery 会首先尝试使用 Enlighten 烘焙以计算实时 GI。之后，将进行常规的 Bakery 光照贴图烘焙过程。烘焙 GI 和实时 GI 将协同工作。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bake on remote server ===&lt;br /&gt;
启用网络烘焙（[[Network baking|Network baking]]）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Presets ===&lt;br /&gt;
当前在 Experimental 模式下的 Render/Update 按钮下显示。&lt;br /&gt;
&lt;br /&gt;
* 点击 '''New''' 将所有当前设置保存到预设文件中。&lt;br /&gt;
* 默认情况下，当一个预设处于激活状态时，所有设置都会被灰显，以防止覆盖预设。&lt;br /&gt;
* 点击 '''Modify preset''' 可更改设置并覆盖预设。&lt;br /&gt;
* 可以通过预设字段切换预设。将其设置为 None 可禁用预设使用。&lt;br /&gt;
&lt;br /&gt;
== 组件 ==&lt;br /&gt;
=== Bakery Lightmap Group Selector ===&lt;br /&gt;
指定对象及其所有子对象使用的 '''Lightmap Group'''。&lt;br /&gt;
Lightmap Group 是 Bakery 用来表示共享同一光照贴图的对象集合的术语。每个组都有属性，告诉 Bakery 如何打包对象、哪些光源影响它们，以及结果是烘焙到纹理还是顶点。&lt;br /&gt;
&lt;br /&gt;
默认情况下，所有静态对象会自动打包到多个光照贴图组（贴图集）中，因此通常无需手动管理。手动定义组仅用于特殊用途，例如：&lt;br /&gt;
&lt;br /&gt;
* 指定某些对象使用 [[Vertex Lightmaps|每顶点光照贴图]] 而非纹理。&lt;br /&gt;
* 使用建模软件中的原始未缩放 UV 烘焙光照贴图。&lt;br /&gt;
* 将关卡的特定区域分组以使用单张光照贴图，从而便于资源流式加载或通过脚本在运行时切换不同的烘焙光照。&lt;br /&gt;
* 使用 Render Selected Groups 按钮仅更新已分组的对象。&lt;br /&gt;
&lt;br /&gt;
要手动定义组，可以创建 '''Lightmap Group Assets'''，方法包括使用 Assets-&amp;gt;Create 菜单，或在组件中使用 Create New 按钮。使用 Create New 按钮时，将根据以下表单创建新的资源：&lt;br /&gt;
&lt;br /&gt;
* Name：要创建的 Lightmap Group 资源的名称。&lt;br /&gt;
* Packing Mode：此选择器定义 Lightmap Group 的打包模式，共有 3 种模式：&lt;br /&gt;
** Original UV：对象及其子对象将使用未修改的 UV 进行烘焙，不执行打包。适用于多个网格共享同一已打包 UV 布局的模型。&lt;br /&gt;
** Pack Atlas：对象及其子对象将打包到专用纹理贴图集中。在 v1.3 之前，每个可打包的子对象都需要有此组件，但现在不再需要。每个子对象将作为单独矩形打包，除非 Bakery 自动检测到子对象有非重叠的子对象，在这种情况下，多个对象可以使用同一个矩形。&lt;br /&gt;
** Vertex：对象及其子对象将使用顶点色烘焙光照而非纹理。注意，需要使用自定义着色器才能生效，例如 [[#Bakery_shaders|Bakery Shader]]。文档中也提供了一个简单的着色器（“Bakery/Simple Vertex Lightmapped”）用于演示和参考。[[Vertex Lightmaps|了解更多关于顶点光照贴图的信息]]。&lt;br /&gt;
* Directional mode：允许你覆盖该组的 [[#Directional mode|directional mode]]。选项与全局相同，Auto 将使用全局设置。&lt;br /&gt;
* Resolution：所需的光照贴图分辨率。&lt;br /&gt;
* Auto-resolution：使用 [[使用手册#Texels_per_unit|Texels Per Unit]] 来确定最接近的二次幂分辨率。&lt;br /&gt;
* Atlas packer：为该组选择 [[使用手册#Atlas_Packer|贴图集打包]] 算法。&lt;br /&gt;
* Bitmask：用于排除光源影响光照贴图的开关列表。每个 Bakery 光源也有一个位掩码设置。光源只会影响与其共享至少一个开关的 Lightmap Group。默认设置意味着所有光源影响所有光照贴图。&lt;br /&gt;
&lt;br /&gt;
[[File:Ts.jpg|thumb|Transparent selfshadow关闭 vs 开启：注意一些单面但背向的多边形如何被正确照亮。]]&lt;br /&gt;
&lt;br /&gt;
如果你有一个被分配了“Pack Atlas”模式的 Lightmap Group，组件上将会出现额外设置：&lt;br /&gt;
&lt;br /&gt;
* Override resolution：覆盖该对象及其子对象在光照贴图中占用的分辨率。&lt;br /&gt;
* Resolution：手动定义的分辨率。例如，如果你有一个分辨率为 512 的光照贴图，并且分配给 4 个对象，同时覆盖分辨率设置为 256，Bakery 将生成一个 512x512 的光照贴图，每个对象正好占据 256x256 的区域。&lt;br /&gt;
&lt;br /&gt;
如果你选择一个 Lightmap Group 资产，将会显示额外的实验性设置：&lt;br /&gt;
* [[Subsurface scattering|Subsurface scattering: (点击阅读更多)]]&lt;br /&gt;
* Normal offset：允许你将光线从表面偏移。这很少有用，主要用于实验目的。&lt;br /&gt;
* Transparent selfshadow：从表面后方发射光线，使其不会在自身投射阴影。对于半透明叶片可能有用。&lt;br /&gt;
* Vertex sampling density，(仅当 Packing Mode 设置为 Vertex 时可用）：默认情况下，每个顶点只计算一个值；如果采样密度 &amp;gt; 0，则会在三角形上分散采样并求平均，从而生成超采样、更平滑的结果。&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Lightmapped Prefab ===&lt;br /&gt;
此组件允许预制件存储光照贴图元数据。这样处理后的预制件可以在任意场景中实例化，无论是在编辑器中还是运行时。&lt;br /&gt;
该组件应直接添加到预制件的根对象上。不支持嵌套预制件。由于预制件在烘焙后会被覆盖（类似于按下“Apply”按钮的效果），因此要求预制件没有任何未应用的更改（子对象不应移动，材质和脚本参数应保持不变等）。如果检测到此类更改，组件界面会显示错误，烘焙后不会保存任何元数据。如果启用了 [[#Warnings|Lightmapped prefab validation]] 警告，所有预制件错误也会在烘焙前以对话框形式显示。&lt;br /&gt;
&lt;br /&gt;
光照贴图预制件支持所有 Bakery 功能，例如 LOD、地形、方向光贴图、RNM、SH、顶点模式和 Shadowmask。要使 Shadowmask 生效，光源也必须是同一预制件的一部分。&lt;br /&gt;
&lt;br /&gt;
{{note| 注意，由于 API 限制，预制件 Shadowmask 仅在 Unity 2017.4 或更高版本中可用。}}&lt;br /&gt;
&lt;br /&gt;
烘焙后，一个名为 “BakeryPrefabLightmapData” 的对象会被添加到预制件中。该对象包含一个脚本，存储应用光照贴图所需的所有数据。&lt;br /&gt;
&lt;br /&gt;
此外，光照贴图预制件允许保存当前渲染设置，并使用两个按钮将其加载回任意已打开的场景：&lt;br /&gt;
&lt;br /&gt;
* Save current render settings to prefab：在该预制件上存储当前渲染设置的副本。&lt;br /&gt;
* Load render settings from prefab：将当前渲染设置设置为预制件中存储的设置。&lt;br /&gt;
  [[File:Upload 2019-9-17 10-32-34.png|thumb|应用预制件]]&lt;br /&gt;
&lt;br /&gt;
烘焙光照贴图预制件时，建议检查：&lt;br /&gt;
&lt;br /&gt;
* 预制件已“应用”。在旧版 Unity 中，点击 Inspector 右上角的 “Apply” 按钮。在新版 Unity 中，点击 “Overrides” 列表，然后选择 “Apply All”。&lt;br /&gt;
* 预制件组件 UI 不显示任何错误。&lt;br /&gt;
* [推荐] 在主窗口启用 “Lightmapped prefab validation” 复选框。点击 Render 时不会显示任何关于预制件的警告对话框。&lt;br /&gt;
&lt;br /&gt;
{{note| 光照贴图以其烘焙所在的场景或所使用的 Lightmap Group 命名（如果有）。在同一场景中烘焙不同预制件时，请确保使用不同命名的 [[使用手册#Bakery_Lightmap_Group_Selector|Lightmap Group]] 或更改 [[使用手册#Output_path|输出路径]]。}}&lt;br /&gt;
&lt;br /&gt;
{{note| 当使用相同模型逐个烘焙多个预制件时，建议将 [[使用手册#Asset_UV_Processing|Asset UV Processing]] 设置为“Don't Change”，以防止修改共享模型的 UV。}}&lt;br /&gt;
&lt;br /&gt;
{{note| Bakery 的预制件工作流程是在 Unity 提供“预制件双击进入视图”功能之前实现的。因此，在隔离预制件视图中光照贴图可能无法正确应用，组件可能显示 “This GameObject is not a prefab” 信息。但在普通场景中使用时应能正常工作。}}&lt;br /&gt;
&lt;br /&gt;
{{note| 当解包已烘焙的预制件并取消与现有光照贴图的关联时，请确保删除保存预制件范围光照贴图/渲染器连接的 BakeryPrefabLightmapData 对象。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Direct Light ===&lt;br /&gt;
[[File:Directlight.jpg|thumb|纯直射光 + GI]]&lt;br /&gt;
[[File:Image4.png|thumb|左：“Shadow Spread” = 0.01，右：0.05。注意阴影从锐利逐渐变模糊的效果。]]&lt;br /&gt;
无限远方向光（例如太阳）。&lt;br /&gt;
&lt;br /&gt;
* Color：光的颜色。&lt;br /&gt;
* Intensity：线性色彩乘数。&lt;br /&gt;
* Shadow Spread：光源尺寸，或者简单说，阴影的模糊度。0 = 阴影最锐利，1 = 阴影最模糊。从技术上讲，它在单条光线与更宽光锥之间插值。&lt;br /&gt;
* Shadow Samples：影响阴影质量。Shadow Spread 值越小，所需样本越少即可得到干净图像。太阳阴影的典型值为 1 到 16。设置为 0 时，该光源的阴影将消失。&lt;br /&gt;
* Bitmask：用于排除此光源对特定 Lightmap Groups 影响的开关列表。&lt;br /&gt;
* Baked contribution：确定应烘焙哪类光照数据。仅在 Indirect 或 Shadowmask 模式可见。可选值：&lt;br /&gt;
** Direct and Indirect：直射光与间接光都完全烘焙。&lt;br /&gt;
** Indirect only：实时光提供直射贡献，仅烘焙间接光。&lt;br /&gt;
** Shadowmask and indirect：实时光提供直射贡献，静态几何体的阴影烘焙到单独贴图，动态与静态阴影混合。间接光正常烘焙。&lt;br /&gt;
** Direct, Indirect, Shadowmask（仅自定义光照）：与直射和间接相同，但 Shadowmask 也生成，可与自定义着色器一起使用。&lt;br /&gt;
* Denoise shadowmask：确定是否对该光源的 Shadowmask 应用去噪。通常不需要，因为阴影噪点不明显，但对非常宽且模糊的阴影（大 Shadow Spread）可能有用。&lt;br /&gt;
* Indirect intensity：非物理 GI 乘数。自然光照应为 1，可根据场景风格调整。&lt;br /&gt;
* Anti-alias：对阴影执行超采样。&lt;br /&gt;
* Texture projection：在光照上投射乘法平铺纹理，可用于模拟远处云影。&lt;br /&gt;
当设置了纹理投影时，可以使用“Tiling”和“Offset”字段调整其缩放和偏移。或者，点击 &amp;quot;Tweak projection in Scene View&amp;quot; 并使用额外的 Gizmo 可视化移动和缩放投影。点击“Render reference frame”可保存光源视角的 PNG，这对于在场景上绘制云影很有用。&lt;br /&gt;
&lt;br /&gt;
如果同一对象同时启用了 Unity 和 Bakery 光源且参数不匹配，会出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match lightmapped to real-time：将 Unity 光源的通用设置复制到 Bakery 光源。&lt;br /&gt;
* Match real-time to lightmapped：将 Bakery 光源的通用设置复制到 Unity 光源。&lt;br /&gt;
&lt;br /&gt;
{{note| 从物理角度看，Bakery 的方向光强度（Intensity）等于照度（Lux）除以 π。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Sky Light ===&lt;br /&gt;
[[File:Skylight.jpg|thumb|纯天空光与 GI]]&lt;br /&gt;
无限远的带阴影环境光（天空）。&lt;br /&gt;
&lt;br /&gt;
* Color: 颜色。&lt;br /&gt;
* Intensity: 线性色彩倍增。&lt;br /&gt;
* Sky texture: 可选的立方体贴图资源，例如 HDRI 全景图，用于从不同方向影响光照颜色。&lt;br /&gt;
  {{note| 旋转天空光的 GameObject 会相应旋转立方体贴图的光照。}}&lt;br /&gt;
* Samples: 影响阴影质量。典型值为 8 到 32。&lt;br /&gt;
* Hemispherical: 如果启用，光照仅来自上方（上半球）。否则来自所有方向。&lt;br /&gt;
* Bitmask: 用于排除此光源影响特定 Lightmap Groups 的开关列表。&lt;br /&gt;
* Baked contribution: 决定应烘焙哪种光照数据。仅在 Indirect/Shadowmask 模式下可见。可能值：&lt;br /&gt;
** Direct and Indirect: 直接和间接光照都将完全烘焙。这是默认且推荐的天空光行为，因为在 Unity 中没有实时版本可以模拟它们。&lt;br /&gt;
** Indirect only: 假定实时光源提供直接贡献；仅烘焙间接光照。&lt;br /&gt;
&lt;br /&gt;
如果天空光的设置与当前场景的天空盒不匹配，将出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match this light to scene skybox: 将活动天空盒材质的通用设置复制到 Bakery 天空光。当前仅支持使用 “Skybox/Cubemap” 或 “Skybox/Bakery skybox” 着色器的天空盒。&lt;br /&gt;
* Match scene skybox to this light: 将 Bakery 天空光的通用设置复制到场景天空盒。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bakery Light Mesh ===&lt;br /&gt;
[[File:Image29.png|thumb|Left: Samples Near = 0, Samples Far = 4096.&amp;lt;br&amp;gt;&lt;br /&gt;
Middle: Samples Near = 0, Samples Far = 128.&amp;lt;br&amp;gt;&lt;br /&gt;
Right: Samples Near = 16, Samples Far = 128.&amp;lt;br&amp;gt;&lt;br /&gt;
请注意，光照效果看起来相似，但使用的合并采样数量更少。]]&lt;br /&gt;
任何形状的自发光网格。应与 Mesh Renderer 组件或设置为 Area 模式的 Light 组件一起使用。&lt;br /&gt;
&lt;br /&gt;
* Color：颜色&lt;br /&gt;
* Intensity：线性颜色倍增器&lt;br /&gt;
* Cutoff：最大光照距离。Bakery 会在接近该限制时额外衰减正确的平方反比衰减。当 Cutoff 值刚好对应物理衰减变得非常暗的位置时效果最佳。Cutoff 可提升烘焙性能，也可以设置为非常高（不可达）的值以保证完全正确性。&lt;br /&gt;
* Self Shadow：决定光源网格自身是否投射阴影。此选项同时启用更精确的光照算法。&lt;br /&gt;
* Samples Near：影响靠近网格的光照质量。典型值为 16 到 64，仅当 Self Shadow 开启时可用。&lt;br /&gt;
* Samples Far：影响远离网格的光照质量。典型值为 4 到 4096。&lt;br /&gt;
&lt;br /&gt;
Bakery 基于光源表面距离混合两种不同的区域光算法。靠近光源时，算法类似 GI，而远处光源被近似为虚拟点光云。&lt;br /&gt;
&lt;br /&gt;
{{note| &amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;光源网格自身不会接收光照，也不会被烘焙到光照贴图中。&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;一个拥有大量多边形的光源网格比烘焙多个简单的光源网格要快&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;如果结果总是脏/噪点较多，可以尝试将 Samples Near 设置为 0，这样只使用 VPL 算法。对于不需要精度的简单光源（如建筑物的窗户光），这也非常有用。&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;}}  &lt;br /&gt;
[[File:Dd99d-QU0AEKFBK.jpg|thumb|弯曲的光源网格]]  &lt;br /&gt;
* Bitmask：用于排除此光源影响特定 Lightmap Groups 的开关列表。  &lt;br /&gt;
* Baked contribution：决定烘焙哪种类型的光照数据。仅在 Indirect 或 Shadowmask 模式下可见。可能的值：  &lt;br /&gt;
** Direct and Indirect：完全烘焙直接和间接光贡献。这是默认且推荐的光源网格行为，因为 Unity 中没有实时版本可以模拟它们。  &lt;br /&gt;
** Indirect only：实时光源提供直接光贡献，仅烘焙间接光。  &lt;br /&gt;
** Shadowmask and Indirect：实时光源提供直接光贡献，但静态几何体的阴影会烘焙到单独的贴图。动态和静态阴影将混合在一起。间接光照将照常烘焙。目前仅 HDRP（和自定义渲染器）支持混合区域光。  &lt;br /&gt;
** Direct, Indirect, Shadowmask (custom lighting only)：与 Direct and Indirect 相同，但同时生成 Shadowmask 并分配用于自定义着色器。  &lt;br /&gt;
* Indirect intensity：非物理 GI 倍增器。自然光照应设为 1，但可修改以实现更风格化的场景。  &lt;br /&gt;
* Shadowmask with falloff：将完整光衰减烘焙进 Shadowmask（仅对自定义着色器有用）。  &lt;br /&gt;
&lt;br /&gt;
如果网格材质和光源设置不匹配，将出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match light to material：将网格材质或区域光的通用设置复制到 Bakery 光源。&lt;br /&gt;
* Match material to light：将 Bakery 光源的通用设置复制到网格材质或区域光。&lt;br /&gt;
&lt;br /&gt;
==== Light Mesh 与自发光材质的区别 ====&lt;br /&gt;
自发光材质：&lt;br /&gt;
&lt;br /&gt;
* 在 GI 计算中传播光线，因此是“免费的”，无论有多少网格是自发光的。&lt;br /&gt;
* 小而明亮的光可能会产生不准确或有噪点的结果，这取决于 GI 的采样数量。&lt;br /&gt;
* 由于 Bakery 中 GI 的工作方式，它必须占用光照贴图空间，因此可能会浪费空间。同时，这意味着自发光对象需要有效的 UV，并且必须启用“投射阴影”。&lt;br /&gt;
&lt;br /&gt;
Light Mesh：&lt;br /&gt;
&lt;br /&gt;
* 光照会为每个光源单独计算，因此比自发光材质慢。&lt;br /&gt;
* 设计用于为小而明亮的光提供干净的光照效果，即使距离很远也能保持效果。&lt;br /&gt;
* 不占用光照贴图空间。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Point Light ===&lt;br /&gt;
[[File:Image11.png|thumb|左：“Shadow Spread” = 0.5，右：“Shadow Spread” = 1。]]&lt;br /&gt;
点光源，没有面积。尽管在物理上不可能，但在游戏中很有用，并且是匹配 Unity 点光源和聚光灯的唯一方式。&lt;br /&gt;
{{note| 聚光灯只是带有额外投影遮罩的点光源。}}&lt;br /&gt;
&lt;br /&gt;
* Color: 颜色&lt;br /&gt;
* Intensity: 线性色彩倍增&lt;br /&gt;
* Shadow spread: 阴影模糊度。虽然点光源没有面积，但通常希望它仍能产生模糊阴影。为此，阴影被模拟为从球形区域光源投射。此参数定义了虚拟球体的半径，直接影响阴影模糊度。&lt;br /&gt;
* Physical falloff: 如果启用，将使用正确的平方反比衰减，并在边界附近额外衰减。否则将尝试模拟 Unity 的衰减。&lt;br /&gt;
* Falloff min size: 详见 [[Point Light Attenuation]] 部分。&lt;br /&gt;
* Range: 如果物理衰减被禁用，则等于 Unity 的光源范围；如果启用，只会在边缘轻微衰减物理衰减。&lt;br /&gt;
* Samples: 影响阴影质量。典型值为 1 到 512。设置为 0 将使该光源的阴影消失。&lt;br /&gt;
  [[File:Image10.png|thumb|从左到右：Omni，Cookie（默认聚光灯纹理），Cubemap，IES。]]&lt;br /&gt;
* Projection mask: 遮罩/Cookie 类型。选项：&lt;br /&gt;
** Omni: 无遮罩，相当于 Unity 的点光源。&lt;br /&gt;
** Cookie: 纹理投影遮罩。附加选项：&lt;br /&gt;
*** Cookie texture: 2D 纹理资源。Bakery 包含原始 Unity 聚光灯纹理（名为 ftUnitySpotTexture），可用于模拟。&lt;br /&gt;
*** Angle: 纹理投影角度（类似 Unity 聚光灯）。&lt;br /&gt;
*** Correct distortion: 修正宽角下直线可见的 cookie 失真。&lt;br /&gt;
** Cubemap: 立方体贴图投影遮罩。附加选项：&lt;br /&gt;
*** Projected cubemap: 立方体贴图资源。&lt;br /&gt;
** IES: 光照由 IES 文件数据调制。附加选项：&lt;br /&gt;
*** IES file: .ies 扩展名文件。&lt;br /&gt;
* Bitmask: 用于排除该光源影响特定 Lightmap Groups 的开关列表。&lt;br /&gt;
* Baked contribution: 决定应烘焙哪种类型的光照数据。仅在 Indirect 或 Shadowmask 模式下可见。可能值：&lt;br /&gt;
** Direct and Indirect: 直接光和间接光完全烘焙。&lt;br /&gt;
** Indirect only: 实时光提供直接光，仅烘焙间接光。&lt;br /&gt;
** Shadowmask and Indirect: 实时光提供直接光，但静态几何体阴影烘焙到单独贴图中，动态和静态阴影混合，间接光正常烘焙。&lt;br /&gt;
** Direct, Indirect, Shadowmask (custom lighting only): 与 Direct and Indirect 相同，同时生成 Shadowmask 用于自定义着色器。&lt;br /&gt;
* Indirect intensity: 该光的非物理 GI 倍增。自然光应为 1，可根据风格化场景修改。&lt;br /&gt;
* Shadowmask with falloff: 将完整光衰减（除距离外）烘焙到 Shadowmask（仅自定义着色器有用）。&lt;br /&gt;
* Legacy sampling: 使用 Bakery 原始更偏置的阴影采样策略。产生无噪点阴影，但宽半影可能出现条纹。禁用后使用无偏但更有噪点的技术。&lt;br /&gt;
&lt;br /&gt;
如果同一对象同时启用了 Unity 和 Bakery 光源，且设置不匹配，则会出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match lightmapped to real-time: 将 Unity 光的常用设置复制到 Bakery 光。&lt;br /&gt;
* Match real-time to lightmapped: 将 Bakery 光的常用设置复制到 Unity 光。&lt;br /&gt;
&lt;br /&gt;
{{note| 从物理角度来看，Bakery 点光源的“Intensity”为 Candela 除以 Pi。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Volume ===&lt;br /&gt;
[[File:Voldemo notlonely.gif|由 BakeryVolume 照亮的动态门（动态 GIF，由 NOTLonely 制作）]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
体积（Volumes）生成存储每个体素光探针的 3D 纹理（L1 球面调和和阴影贴图），使其成为常规 Unity 光探针的可行替代方案。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Unity Light Probes&lt;br /&gt;
! Unity LPPV&lt;br /&gt;
! Bakery Volumes&lt;br /&gt;
|-&lt;br /&gt;
| 手动放置每个光探针&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 否&lt;br /&gt;
|-&lt;br /&gt;
| 在一个物体上插值多个光探针&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 运行时可移动&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 可以放入预制件&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 完整脚本 API&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| “Ringing” 伪影&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 可能出现&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 可能出现&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 已修正&lt;br /&gt;
|-&lt;br /&gt;
| 去噪&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 运行时开销&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | CPU：低开销；GPU：低开销&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | CPU：中等开销；GPU：中等开销&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#e4ead3;&amp;quot; | CPU：无开销；GPU：中等开销&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bakery Volume 是一个与一组 3D 纹理（3 个 SH 纹理和一个可选的 shadowmask）关联的边界盒，使其非常易于使用和编程。Volumes 可以在运行时轻松地交换、移动、加载或卸载，也可以与预制件关联。它们不需要任何 Light Probe Groups 或手动探针布置；整个 Volume 都由均匀的探针体素网格填充。光/影泄漏会自动像处理光照贴图一样修复（尽管对于较大的体素尺寸，薄的双面墙可能会出现问题，但可以通过在不同侧使用不同 Volume 避免）。由于体素网格的均匀特性，也可以对其应用类似光照贴图的降噪，这是常规光探针无法做到的。此外，Bakery 着色器使用 [https://drive.google.com/file/d/1MK6Clw93q8ljijRjb4gQOzzaIjn1uF9Y/view Geomerics] 采样技巧，完全消除了高对比度 HDR 光照下 SH 有时会产生的 “ringing” 伪影。&lt;br /&gt;
&lt;br /&gt;
因此，Volumes 可以为动态物体生成干净、精细、高质量的烘焙光照（即来自静态物体并影响动态物体的光照，而不是相反）。&lt;br /&gt;
&lt;br /&gt;
Volume 方法的唯一缺点是每像素着色开销较高。其开销类似于 LPPV（随着屏幕上受体素影响的像素数量而缩放），但与 LPPV 不同的是，一旦烘焙完成，Volumes 本身不会再更新。多个 Volume 的混合可以通过稍微重叠它们来避免。&lt;br /&gt;
&lt;br /&gt;
====设置 Volume 变换====&lt;br /&gt;
[[File:Bvolgizmo.jpg|thumb|Volume 控制柄]]&lt;br /&gt;
当 BakeryVolume 被添加到一个 GameObject 时，场景视图中会出现一个边界盒控制柄。拖动小方块即可缩放它。&lt;br /&gt;
&lt;br /&gt;
还有其他方法可以更改 Volume 的大小和位置：&lt;br /&gt;
&lt;br /&gt;
* 将任何可渲染的 GameObject 拖入 “Wrap to object” 字段。Volume 会包裹该对象（及其子对象），以将它们完全包含在内。&lt;br /&gt;
* 如果同一个对象上添加了 Box Collider，则会出现 “Set from box collider” 和 “Set to box collider” 按钮。可以用它们快速在 Volume 和 Collider 之间复制数值。&lt;br /&gt;
&lt;br /&gt;
====分辨率====&lt;br /&gt;
当启用 “Adaptive resolution” 时，体素数量由 “Voxels per unit” 控制。禁用它可以手动输入分辨率。对于大多数 1 单位 = 1 米 的游戏来说，一个合理的 “Voxels per unit” 值是 2，但在某些情况下（例如动态门）使用较小但更高分辨率的 Volume 会更有利。&lt;br /&gt;
&lt;br /&gt;
====其他设置====&lt;br /&gt;
&lt;br /&gt;
* Enable baking: 是否需要（重新）计算 Volume？禁用可防止覆盖已有数据。&lt;br /&gt;
* Denoise: 在烘焙 Volume 后应用去噪。推荐用于高分辨率 Volume。避免用于覆盖许多光源的低分辨率 Volume，因为去噪器难以区分实际内容和噪声。&lt;br /&gt;
* Global: 自动将此 Volume 分配给所有兼容 Volume 的 Shader，除非它们有覆盖设置。内部会调用 Shader.SetGlobalTexture()/SetGlobalVector()。&lt;br /&gt;
====使用方法====&lt;br /&gt;
Volumes 可以分配给使用 Volume 感知 Shader 的对象。Bakery 自带实现该功能的 “Bakery Standard” Shader，以及 HDRP 和 URP 的 Shader 图。请查看 example_volumes 场景，了解应用 Volume 的各种方式。&lt;br /&gt;
&lt;br /&gt;
====提示====&lt;br /&gt;
&lt;br /&gt;
* 确保查看示例。&lt;br /&gt;
* 如果两个 Volume 相连，让它们略微重叠。重叠大小应等于最大动态对象的尺寸。这样在运行时简单切换 Volume 就能正常工作。&lt;br /&gt;
* 仅在动态对象实际可达的区域放置 Volume。例如，使用玩家高度限制 Volume 的高度。&lt;br /&gt;
&lt;br /&gt;
====旋转 Volumes====&lt;br /&gt;
如果启用 “Rotate around Y” 选项，Volumes 可以绕 Y 轴旋转。旋转开销非常低，只使用 2 个额外的浮点数据（预计算的角度 sin/cos）。&lt;br /&gt;
&lt;br /&gt;
还可以在运行时旋转 Volumes（Experimental -&amp;gt; “Support rotation after bake” 以及 Bakery Shader 中的类似选项），这种情况下 Volume 必须在初始旋转为零时进行烘焙。&lt;br /&gt;
&lt;br /&gt;
在 URP 中，这种动态旋转可以与 `BakeryURPVolumeGraphRotatable.shadergraph` 一起使用。&lt;br /&gt;
&lt;br /&gt;
对于全局 Volume，动态旋转会在组件被（重新）启用或调用 `volume.SetGlobalParams()` 时更新。使用局部旋转 Volume 时，需要手动在材质或 MaterialPropertyBlock 上设置旋转：&lt;br /&gt;
{{code|&amp;lt;nowiki&amp;gt;SetMatrix(&amp;quot;_VolumeMatrix&amp;quot;, volume.GetMatrix())&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
====技术信息====&lt;br /&gt;
Volumes 可以自动工作（查看示例场景），也可以通过脚本控制其使用方式。&lt;br /&gt;
&lt;br /&gt;
可以通过组件的以下公共属性获取 Volume 数据：&lt;br /&gt;
&lt;br /&gt;
* `bakedTexture0`：存储 L0 RGB 系数和 L1 Z 红色通道在 alpha 中。&lt;br /&gt;
* `bakedTexture1`：存储 L1 X RGB 系数和 L1 Z 绿色通道在 alpha 中。&lt;br /&gt;
* `bakedTexture2`：存储 L1 Y RGB 系数和 L1 Z 蓝色通道在 alpha 中。&lt;br /&gt;
* `bakedMask`：存储体积阴影遮罩。&lt;br /&gt;
* `bounds`：Volume 的包围盒。&lt;br /&gt;
&lt;br /&gt;
所有 `bakedTexture*` 使用 RGBAHalf（每体素 8 字节）格式，mask 使用 ARGB32（每体素 4 字节）。阴影遮罩也可以使用单通道 R8 格式（每体素 1 字节）。&lt;br /&gt;
&lt;br /&gt;
因此 Volume 的字节大小 = width * height * depth * 3 * 8 + （仅当使用阴影遮罩时）width * height * depth * 4（或使用 R8 mask 时为 width * height * depth）。&lt;br /&gt;
&lt;br /&gt;
[[使用手册#Compress_volumes|可以对 Volume 启用纹理压缩]]，使其体积显著减小。&lt;br /&gt;
&lt;br /&gt;
采样 Volume 需要特殊 Shader，这些 Shader 已包含在 Bakery 中。要在自定义 Shader 中添加 Volumes，请查看 HDRP/URP 包中包含的 `BakeryVolume_float()` 函数（位于 `BakeryDecodeLightmap.hlsl`）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Light Filter ===&lt;br /&gt;
[[File:Output optimized.gif|彩色玻璃，如在 &amp;quot;Bakery Real-Time Preview&amp;quot; 中所见。Bakery lightmapper 烘焙出的结果相同。]]&lt;br /&gt;
&lt;br /&gt;
将渲染器标记为光过滤器（Light Filter）。过滤器会用其颜色着色所有直接和间接光线，类似于现实中的光学滤镜，从而实现彩色透明效果（例如彩色玻璃）。唯一的参数是用于着色的纹理。&lt;br /&gt;
&lt;br /&gt;
* 光过滤器对象仍然会像其他对象一样接收光照贴图。&lt;br /&gt;
* 过滤器不会散射或模糊光线（如需此效果，请尝试 [[Subsurface_scattering|Subsurface Scattering]] 或 [[使用手册#Backface_GI|Backface GI]]）。&lt;br /&gt;
* 过滤器可以产生带颜色的阴影。如果灯光使用 [[使用手册#Shadowmask|Shadowmask]] 模式，则结果只会保存 R 通道（因为 Unity 仅支持单通道遮罩）。对于完全烘焙的阴影，则没有限制。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Sector ===&lt;br /&gt;
参见 '''[[Partial_scene_baking|Partial scene baking]]'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Always Render ===&lt;br /&gt;
如果添加到一个物体上，Bakery 在烘焙时将始终考虑该物体，即使它的 Renderer 被禁用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
=== Bakery Pack As Single Square ===&lt;br /&gt;
如果添加到一个物体上，Bakery 会将该物体及其子物体的 UV 视为单个组合方块，在自动图集打包或 Lightmap Group 的 Pack Atlas 模式下，它们之间永远不会被移动。整个子层级将作为一个整体打包。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
=== Bakery Shared LOD UV ===&lt;br /&gt;
如果添加到一个 LODGroup 上，将标记所有同名 LOD 共享同一个光照贴图。默认情况下，每个 LOD 网格会获得独立的光照贴图，占用图集空间；但如果已知同一个物体的 LOD 拥有相似的 UV2（或者在没有 UV2 且 UV1 不重叠的情况下），它们可以映射到图集的同一部分，从而节省内存。&lt;br /&gt;
这种技术也称为 [https://github.com/laurenth-personal/LODLightmapScripts/ Lightmap Stealing]。&lt;br /&gt;
&lt;br /&gt;
= 材质兼容性 =&lt;br /&gt;
&lt;br /&gt;
=== 漫反射和发光 ===&lt;br /&gt;
Bakery 利用 [https://docs.unity3d.com/Manual/MetaPass.html Meta Pass] 系统支持大多数 Unity 材质。所有内置、Surface、URP 和 HDRP 着色器都已经定义了正确的 Meta Pass。&lt;br /&gt;
&lt;br /&gt;
如果你使用的是 Unlit 着色器，需要按照 Unity 文档手动添加 Meta Pass。&lt;br /&gt;
&lt;br /&gt;
如果未定义该 Pass，Bakery 将假定 {{codeVar|_MainTex}}、{{codeVar|_BaseColorMap}} 或 {{codeVar|_Color}}（如果未设置纹理）为材质的漫反射（Albedo），并将 {{codeVar|_EmissionMap}} 和 {{codeVar|_EmissionColor}} 作为发光颜色。&lt;br /&gt;
&lt;br /&gt;
为了使发光生效，[https://docs.unity3d.com/ScriptReference/Material-globalIlluminationFlags.html Material.globalIlluminationFlags] 必须设置为 [https://docs.unity3d.com/ScriptReference/MaterialGlobalIlluminationFlags.BakedEmissive.html MaterialGlobalIlluminationFlags.BakedEmissive]。标准着色器会自动设置此值。&lt;br /&gt;
&lt;br /&gt;
=== 不透明度 ===&lt;br /&gt;
[[File:Upload 2019-1-25 0-4-30.png|thumb|材质参数被转换为 Cutout（默认）]]&lt;br /&gt;
[[File:Alphacombos dither.jpg|thumb|通过“Dither Transparency”选项添加半透明值]]&lt;br /&gt;
[[File:Alphacombos filter.jpg|thumb|Light Filter 组件用于红色平面，生成彩色阴影]]&lt;br /&gt;
&lt;br /&gt;
默认情况下，Bakery 始终从 {{codeVar|_MainTex}}、{{codeVar|_BaseColorMap}} 或 {{codeVar|_BaseMap}} 的 alpha 值获取全分辨率的不透明度，并将其视为 Cutout（1 位透明）。&lt;br /&gt;
&lt;br /&gt;
当启用 '''Dither Transparency''' 选项时，半透明值会自动转换为可变蓝噪声，然后被滤波/模糊，产生部分透明效果（以前可以通过自定义手动抖动贴图实现，但从 v1.97 起自动完成）。&lt;br /&gt;
&lt;br /&gt;
为了使不透明度生效，着色器的 [https://docs.unity3d.com/Manual/SL-SubShaderTags.html RenderType 标签] 必须为以下值之一：&lt;br /&gt;
&lt;br /&gt;
* {{codeVar|Transparent}}&lt;br /&gt;
* {{codeVar|TransparentCutout}}&lt;br /&gt;
* {{codeVar|TreeLeaf}}&lt;br /&gt;
&lt;br /&gt;
如果存在名为 {{codeVar|_Cutoff}} 的属性，它将影响 Cutout（因此 Standard 着色器的 Cutoff 滑块会自动生效）。&lt;br /&gt;
&lt;br /&gt;
在没有 Dither Transparency 的情况下，如果材质 RenderType 为 {{codeVar|Transparent}} 或 {{codeVar|TreeLeaf}}，则 {{codeVar|_Color}} 的 alpha 值会额外修改 Cutoff：&lt;br /&gt;
''finalCutoff = 1 - (1 - cutoff) * alpha''&lt;br /&gt;
&lt;br /&gt;
对于彩色透明效果，请使用 [[使用手册#Bakery_Light_Filter|Light Filter]] 组件。&lt;br /&gt;
&lt;br /&gt;
有关漫反射半透明效果，请参考 [[#Backface GI|Backface GI]] 和 [[subsurface scattering]]。&lt;br /&gt;
&lt;br /&gt;
==== Alpha Meta Pass ====&lt;br /&gt;
从 v1.9 起，Bakery 还支持指定基于自定义着色器的透明度，但这需要使用兼容的着色器。要使用 ''Alpha Meta Pass''，需要执行以下步骤：&lt;br /&gt;
&lt;br /&gt;
* 在着色器中添加一个名为 '''BAKERY_META_ALPHA_ENABLE''' 的属性。例如：&lt;br /&gt;
  {{code|&amp;lt;nowiki&amp;gt;[HideInInspector] BAKERY_META_ALPHA_ENABLE (&amp;quot;Enable Bakery alpha meta pass&amp;quot;, Float) = 1.0&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
* 确保 RenderType 标签设置为上文提到的某个值。&lt;br /&gt;
* 声明一个名为 '''META_BAKERY''' 的 Pass。&lt;br /&gt;
* 在该 Pass 中检查 '''unity_MetaFragmentControl.w''' 是否非零，如果是，则返回计算出的透明度值。&lt;br /&gt;
&lt;br /&gt;
示例可参考包内的 ''Baked_Alpha_meta.shader''。&lt;br /&gt;
&lt;br /&gt;
注意：当前 Alpha Meta Pass 需要将 Light Probe Mode 设置为 L1 或 L2。&lt;br /&gt;
&lt;br /&gt;
=== Normal mapping ===&lt;br /&gt;
自定义表面法线可以与 [[#Baked Normal Maps|烘焙法线贴图]] 模式一起使用。不幸的是，Unity 的 Meta Pass 默认不输出法线信息，因此默认情况下，法线取自名为 {{codeVar|_BumpMap}} 的贴图，并通过 {{codeVar|_MainTex_ST}} 进行额外变换。&lt;br /&gt;
&lt;br /&gt;
然而，可以制作完全自定义的着色器，带有高级法线映射功能（例如混合多层法线），并使其兼容烘焙。要实现这一点，需要执行以下步骤：&lt;br /&gt;
&lt;br /&gt;
1. 在着色器中定义一个 Meta Pass，具体方法请参考 [https://docs.unity3d.com/Manual/MetaPass.html#ExampleMetaPassUnity 文档]。&lt;br /&gt;
&lt;br /&gt;
2. 将该 Pass 命名为 {{codeVar|&amp;quot;META_BAKERY&amp;quot;}}，而不仅仅是 {{codeVar|&amp;quot;META&amp;quot;}}。&lt;br /&gt;
&lt;br /&gt;
3. 包含文件 {{codeVar|&amp;quot;BakeryMetaPass.cginc&amp;quot;}}。&lt;br /&gt;
&lt;br /&gt;
4. 添加 {{codeVar|#pragma vertex vert_bakerymt}}。&lt;br /&gt;
&lt;br /&gt;
5. 如果 {{codeVar|unity_MetaFragmentControl.z}} 变量不为 0，着色器应返回世界空间法线。返回的法线应使用 {{codeVar|BakeryEncodeNormal}} 函数编码。&lt;br /&gt;
&lt;br /&gt;
在 Assets/Bakery/examples/shaders 中包含了两个实现了扩展 Meta Pass 的示例着色器。&lt;br /&gt;
&lt;br /&gt;
你也可以复制并修改 BakeryMetaPass.cginc 以满足你的需求，例如从顶点着色器传递额外数据。&lt;br /&gt;
&lt;br /&gt;
=== 正/背面 ===&lt;br /&gt;
无论着色器使用何种剔除模式，Bakery 都将所有背面视为不透明，这意味着任何直接光线都不会穿过背面，就像它不会穿过正面一样。&lt;br /&gt;
然而，如果使用 [[使用手册#Backface_GI|Backface GI]]，背面可以部分发出正面接收到的光照。&lt;br /&gt;
&lt;br /&gt;
= 扩展 Lightmap Parameters 资源 =&lt;br /&gt;
[[File:Lp.jpg|thumb|扩展 Lightmap Parameters]]&lt;br /&gt;
类似于 Bakery 的 [[#Bakery_Lightmap_Group_Selector|Lightmap Group]]，Unity 也有 [https://docs.unity3d.com/Manual/class-LightmapParameters.html Lightmap Parameters]，可以作为资源创建并分配给 Mesh Renderer。它们的逻辑有相似之处也有不同之处：&lt;br /&gt;
&lt;br /&gt;
* Lightmap Group 的主要用途是将多个对象组合到同一个图集。此外，它还允许覆盖该图集的烘焙设置。&lt;br /&gt;
* Lightmap Parameters 主要用于覆盖对象的烘焙设置，但通过使用“Baked Tag”选项，它们也可以影响打包：具有不同 Baked Tag 的对象将永远不会共享同一个图集。&lt;br /&gt;
&lt;br /&gt;
由于有些用户更习惯 Lightmap Parameters 的工作流程，Bakery 现在支持并扩展了它们：&lt;br /&gt;
&lt;br /&gt;
* Bakery 会遵循 Baked Tag 设置。&lt;br /&gt;
* Lightmap Parameters UI 中将显示额外的 Bakery 特定选项。有关其含义，请参考 [[#Bakery_Lightmap_Group_Selector|Lightmap Group]] 部分。&lt;br /&gt;
&lt;br /&gt;
= 项目设置 =&lt;br /&gt;
一些全局设置可以在 Project Settings -&amp;gt; Bakery GPU Lightmapper 中调整（此选项仅在 Unity 2018.3 或更新版本可见；旧版本请编辑 BakeryProjectSettings.asset）：&lt;br /&gt;
&lt;br /&gt;
* Mipmap lightmaps：启用光照贴图的 mipmap。随着图集变小，可能会导致 UV 图块之间的泄漏；另一方面，它可以减少远处高分辨率光照贴图的锯齿。总体上，建议对非常远的物体使用单独烘焙的 LOD 以及较低分辨率的光照贴图。&lt;br /&gt;
* Color file format：常规 HDR 颜色光照贴图的文件格式。可选值：&lt;br /&gt;
**HDR：Radiance HDR 格式（默认）。可用多种图像编辑器打开。&lt;br /&gt;
**Asset：Unity 原生格式。可自定义 mipmap 数量。&lt;br /&gt;
* Mask/Direction file format：额外 LDR 地图的格式，如阴影遮罩或方向数据。可选值：&lt;br /&gt;
**TGA：8 位 Targa（默认）。&lt;br /&gt;
**PNG：8 位 PNG。通常比 TGA 占用更少磁盘空间。&lt;br /&gt;
**Asset：Unity 原生格式。可自定义 mipmap 数量。&lt;br /&gt;
* Compress lightmaps：定义光照贴图资源的压缩行为。压缩光照贴图占用更少的显存，但可能会出现一些视觉伪影（例如色带或色斑），具体取决于压缩类型（移动端压缩问题请参见[[Troubleshooting#I_have_an_Android_project.2C_and_lightmaps_don.27t_look_good|此处]]）。可选值：&lt;br /&gt;
*** Compress but allow overriding asset: 新的光照贴图将在启用压缩的情况下创建。创建后，可以在 Inspector 中更改它们的压缩设置。修改后的值将在重新烘焙后保留（默认）。&lt;br /&gt;
*** Force compress: 始终压缩所有光照贴图。&lt;br /&gt;
*** Force no compress: 始终生成未压缩的光照贴图。&lt;br /&gt;
* High quality direction: 为方向贴图启用“高”质量压缩。实际格式取决于平台。例如在 PC 上，它会从 DXT1 改为 BC7，这提供了更高的质量，但 VRAM 使用量会翻倍。&lt;br /&gt;
* Texel padding (default atlas packer): 定义在使用默认 atlas 打包器时，在光照贴图 atlas 中对象 UV 布局之间添加多少空白 texel。&lt;br /&gt;
* Texel padding (xatlas packer): 同上，但在使用 xatlas 时。&lt;br /&gt;
* Alpha Meta Pass resolution multiplier: 乘以 [[使用手册#Alpha_Meta_Pass|Alpha Meta Pass]] 的分辨率，使在低分辨率光照贴图烘焙时仍能实现精确的基于 Shader 的切割效果。&lt;br /&gt;
* Volume render mode: 为所有 [[使用手册#Bakery_Volume|Volumes]] 使用哪种 [[使用手册#Render_mode|渲染模式]]？Auto 使用当前活动的渲染模式（默认）。&lt;br /&gt;
* Delete previous lightmaps before bake: 在烘焙新光照贴图之前，实际删除该场景中所有之前渲染的光照贴图文件。&lt;br /&gt;
* Log level: 定义烘焙过程中在控制台输出的信息量。可能的值：&lt;br /&gt;
** 0: 不输出任何内容。&lt;br /&gt;
** 1: 仅输出进度信息。&lt;br /&gt;
** 2: 仅输出警告。&lt;br /&gt;
** 3: 输出全部信息。&lt;br /&gt;
* Alternative scale in lightmap: 使渲染器属性 'Scale in Lightmap' 的行为更类似于 Unity 内置的行为。&lt;br /&gt;
* Align to texture compression blocks with xatlas: 使 xatlas 将 chart 对齐到 4x4 块边界，从而获得更适合压缩的结果。&lt;br /&gt;
* Generate smooth positions: 是否应调整采样位置以防止低多边形几何体在平滑法线下产生错误阴影？在使用法线差异极大的几何体时，可在极少数情况下禁用。技术说明见 [https://ndotl.wordpress.com/2018/08/29/baking-artifact-free-lightmaps/#shadowterm 这篇文章]。&lt;br /&gt;
* Smooth positions per-triangle: 是否应按三角形决定平滑/平面位置？在使用法线差异极大的几何体时，可在极少数情况下禁用。&lt;br /&gt;
* Use 'Receive GI' values: 在渲染器上考虑 “Receive Global Illumination” 值。最初 Bakery 会忽略它。&lt;br /&gt;
* Remove ringing in Legacy light probes: 在 Legacy 模式下启用更柔和的光探针卷积，以防止高对比度区域出现伪影。&lt;br /&gt;
* Always render reflection probes: 在每次 Render/Render Light Probes 后自动渲染反射探针。&lt;br /&gt;
* Ringing removal for L2 light probes: 对 [[使用手册#Light_probe_mode|L2 光探针]] 应用去振铃处理。值越高，探针光照越平滑；这种平滑可以减少 [[https://docs.unity3d.com/6000.2/Documentation/Manual/light-probes-troubleshooting.html](https://docs.unity3d.com/6000.2/Documentation/Manual/light-probes-troubleshooting.html) 振铃] 伪影（如果存在）。&lt;br /&gt;
* Put menu under Tools: 将 Bakery 菜单放入 Tools 菜单下。&lt;br /&gt;
&lt;br /&gt;
如果任何格式设置为 Asset 且启用 mipmapping，会显示额外选项：&lt;br /&gt;
&lt;br /&gt;
* Maximum mipmap count: 定义 mipmap 的最大数量。例如，设置为 2，则 8K 光照贴图仅有两个额外 mipmap：4K 和 2K。更低分辨率将被省略，从而在 mipmapping 过程中限制泄漏伪影。&lt;br /&gt;
&lt;br /&gt;
= SkinnedMeshRenderer 支持 =&lt;br /&gt;
Bakery 自 v1.65 起支持蒙皮网格 (skinned meshes)。但是，有一些限制：&lt;br /&gt;
&lt;br /&gt;
* 某些 Unity 版本不支持蒙皮网格的 UV1，并会悄无声息地忽略 “Generate lightmap UVs”。请确保场景中实际使用的网格具有 UV1，并在可能的情况下使用非重叠的 UV0；&lt;br /&gt;
* UV 填充调整在蒙皮网格上不起作用（Unity 在尝试调用 Unwrap 函数时似乎会崩溃）；&lt;br /&gt;
* 蒙皮网格不能使用每顶点光照贴图 (per-vertex lightmaps)（引擎不支持带蒙皮的 additionalVertexStreams）。&lt;br /&gt;
&lt;br /&gt;
= Shader Tweaks =&lt;br /&gt;
[[File:Image2.jpg|thumb|左：默认双线性过滤。右：双三次过滤。]]&lt;br /&gt;
[[File:Image34.jpg|thumb|左：两个阴影都已烘焙。&amp;lt;br&amp;gt;中：球形阴影为动态，另一个阴影为静态。通过相乘组合在一起。&amp;lt;br&amp;gt;右：与中间相同，但使用默认最小值组合。]]&lt;br /&gt;
&lt;br /&gt;
Bakery 提供可选的着色器修改，可以应用到 Unity 着色器上，以改善光照贴图采样并使实时光照更接近光照贴图效果。着色器调整菜单可以通过 Bakery-&amp;gt;Shader Tweaks 访问。&lt;br /&gt;
&lt;br /&gt;
这些选项会修补基础 Unity 着色器包含文件（来自 CGIncludes 文件夹），这些文件被大多数内置和第三方着色器使用。所有修改都会影响使用该版本编辑器打开的所有项目，但也可以轻松恢复。着色器调整会影响标准和表面着色器的工作方式。HDRP、URP 以及其他 SRP 不受影响。&lt;br /&gt;
&lt;br /&gt;
所有可用修改显示为按钮。点击按钮应用修改，按钮将保持按下状态。再次点击按钮即可移除修改。目前可用选项：&lt;br /&gt;
&lt;br /&gt;
{{note| 可能需要以管理员身份运行 Unity 编辑器以使 CGIncludes 修补生效}}&lt;br /&gt;
&lt;br /&gt;
* Use bicubic interpolation for lightmaps: 光照贴图将使用双三次插值代替默认双线性。此调整能很好地修复低分辨率光照贴图的许多锯齿边缘。目前仅适用于 DX11 和现代主机，其他平台仍使用双线性。&lt;br /&gt;
* Use multiplication for shadowmask: 使用相乘代替最小值组合静态和动态阴影。出于未知原因，Unity 默认使用最小值操作符，这会产生一些乘法不存在的伪影。&lt;br /&gt;
* Use physical light falloff (forward): 用更物理正确的平方反比替换实时点光/聚光灯的默认衰减。“Range” 只会在边缘略微淡出（与 Bakery 光源启用 Physical Falloff 复选框效果一致）。仅影响 Forward 渲染器。详情见 [[Point Light Attenuation]]。&lt;br /&gt;
* Use physical light falloff (deferred): 同上，但仅影响 Deferred 渲染器。&lt;br /&gt;
&lt;br /&gt;
'''衰减调整在 Unity &amp;gt;2017 版本上可能无法完全生效。此外，SRP 默认已经使用正确的衰减。'''&lt;br /&gt;
&lt;br /&gt;
= Bakery shaders =&lt;br /&gt;
Bakery 包含了自带着色器，支持顶点光照贴图，以及 RNM 和 SH 方向模式。它还允许从方向数据计算近似烘焙高光。&lt;br /&gt;
对于普通颜色光照贴图、阴影遮罩和 Dominant Direction 模式，Bakery 着色器 '''不是必需的'''，因为这些功能大多数 Unity 着色器本身已经支持。&lt;br /&gt;
&lt;br /&gt;
=== Standard render pipeline ===&lt;br /&gt;
'''Bakery/Standard''': 扩展了普通 Standard 着色器。额外选项：&lt;br /&gt;
&lt;br /&gt;
* Allow Vertex Lightmaps: 允许该材质用于 [[Vertex Lightmaps|顶点光照贴图]]。&lt;br /&gt;
* Allow RNM Lightmaps: 允许该材质用于 [[#RNM|RNM 方向模式]]。&lt;br /&gt;
* Allow SH Lightmaps: 允许该材质用于 [[#SH|SH 方向模式]]。&lt;br /&gt;
  {{note| 所有 “Allow” 选项会在着色器中启用特定的代码路径。为了性能考虑，建议每个材质仅使用一个 “allow” 选项。}}&lt;br /&gt;
* Enable Lightmap Specular: 使用 Dominant Direction、RNM 或 SH 方向模式的数据计算烘焙高光。注意，由于信息有限，该效果仅为近似。如果你曾在 Unity 4 中使用烘焙高光，效果应可比。与高度扰动的法线贴图搭配效果最佳，在平面表面上效果不佳。&lt;br /&gt;
* Enable VertexLM directional: 如果存在顶点光照贴图，指定 Dominant Direction 数据存储在顶点中并应被使用。&lt;br /&gt;
* Enable VertexLM SH: 如果存在顶点光照贴图，指定 SH 数据存储在顶点中并应被使用。&lt;br /&gt;
* Enable VertexLM Shadowmask: 如果存在顶点光照贴图，指定阴影遮罩存储在顶点中并应被使用。&lt;br /&gt;
* Enable MonoSH: 将方向贴图视为 MonoSH 贴图。&lt;br /&gt;
[[File:Image5.png|thumb|Standard SH light probe vs non-linear]]&lt;br /&gt;
[[File:Shspec.jpg|thumb|SH specular effect]]&lt;br /&gt;
* Non-linear SH：在 SH 方向模式下，此选项可以增强对比度（更接近真实效果），但会使着色器稍微变慢。该技巧基于 Geomerics 的论文《[https://drive.google.com/file/d/1MK6Clw93q8ljijRjb4gQOzzaIjn1uF9Y/view Reconstructing Diffuse Lighting from Spherical Harmonic Data]》。&lt;br /&gt;
* Non-linear Light Probe SH：与 Non-linear SH 类似，但用于光照探针。在探针的情况下，最显著的好处是消除错误的负值。这种问题常见于具有高对比度、明亮 HDR 光源的场景中。这是球谐函数的固有限制，而不是 Bakery 特有的问题（即使用 Unity 内置光照贴图器也可能出现类似伪影）。&lt;br /&gt;
* Force Bicubic Filter：为所有附加贴图启用双三次滤波。若要实现完整的双三次滤波（包括第一张颜色贴图），建议同时在 [[#Shader Tweaks|Shader Tweaks]] 中启用该功能。&lt;br /&gt;
&lt;br /&gt;
'''Bakery/Standard Specular'''：与 Standard 相同，但用于高光（Specular）工作流程。&lt;br /&gt;
&lt;br /&gt;
=== HDRP &amp;amp; URP ===&lt;br /&gt;
要提取额外的 HDRP/URP 着色器，请打开 Bakery 自带的 Bakery_ShaderGraphHDRP.unitypackage 或 Bakery_ShaderGraphURP.unitypackage。&lt;br /&gt;
在其中，你会找到可在自己 Shader Graph 中使用的 Shader Subgraph，以及一些示例材质。&lt;br /&gt;
&lt;br /&gt;
=== 各着色器功能支持对比 ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! 大多数 Unity 着色器&lt;br /&gt;
! 大多数 HDRP 和 URP 着色器&lt;br /&gt;
! Bakery Standard&lt;br /&gt;
! Bakery HDRP graphs&lt;br /&gt;
! Bakery URP graphs&lt;br /&gt;
|-&lt;br /&gt;
| HDR color lightmaps&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Shadowmask&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是 (&amp;gt;= URP 10.1)&lt;br /&gt;
|-&lt;br /&gt;
| Dominant Direction&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| RNM&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| SH&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Mo否SH&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Lightmap specular&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持 Dominant Direction 和 SH&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持 Dominant Direction&lt;br /&gt;
|-&lt;br /&gt;
| Bicubic filtering&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是,&lt;br /&gt;
通过 [[#Shader Tweaks|Shader Tweaks]] 支持&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是,&lt;br /&gt;
通过 [[#Shader Tweaks|Shader Tweaks]] 支持&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
|-&lt;br /&gt;
| Vertex lightmaps&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 单一颜色，没有每顶点 SH、方向或阴影遮罩（Shader Graph 限制）&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 单一颜色，没有每顶点 SH、方向或阴影遮罩（Shader Graph 限制）&lt;br /&gt;
|-&lt;br /&gt;
| Non-Linear Light Probes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Volumes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Volume shadowmask&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Compressed volumes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{note| 除了普通颜色光照贴图之外，所有功能都至少需要 Shader Model 3.0 才能运行。}}&lt;br /&gt;
{{note| 使用 SH 模式的顶点光照贴图由于插值器数量限制，至少需要 Shader Model 4.0。}}&lt;br /&gt;
{{note| 含有从 Dominant Direction 生成高光的更新版 URP 图表可在 [[Bakery_-_GPU_Lightmapper|主维基页面]] 下载。}}&lt;br /&gt;
&lt;br /&gt;
另请参阅：[[Integrating_Bakery_shader_features_to_custom_shaders| 将 Bakery 着色器特性集成到自定义着色器中]]&lt;br /&gt;
&lt;br /&gt;
= 关于 HDRP/URP 的说明 =&lt;br /&gt;
将该插件导入到 HDRP 或 URP 项目后，一般即可直接使用，但需要注意以下几点：&lt;br /&gt;
&lt;br /&gt;
* 示例场景中同时使用了普通 Standard 着色器以及部分 “Bakery Standard” 着色器。HDRP 和 URP 提供了将项目着色器从 Standard 升级到 Lit 的机制，但无法从 Bakery Standard 升级。请将 Bakery Standard 材质替换为来自 Bakery_ShaderGraphHDRP.unitypackage 或 Bakery_ShaderGraphURP.unitypackage 中的材质。&lt;br /&gt;
&lt;br /&gt;
* 在 HDRP 中，默认 HDRI 天空亮度较高（11），且天空反射默认不会被遮蔽。再加上默认的自动曝光，可能导致某些示例场景几乎不可见，因为它们使用了更低的亮度进行烘焙。此时可将 HDRI 天空亮度降低到 1。HDRI 设置通常位于 Assets/HDRPDefaultResources/DefaultSettingsVolumeProfile 中。&lt;br /&gt;
&lt;br /&gt;
* 在 HDRP 中，如果示例场景中的灯光过亮，可在 Bakery 灯光组件上点击 “match real-time to lightmapped” 按钮。&lt;br /&gt;
&lt;br /&gt;
* 在 HDRP 中建议使用 OpenImageDenoise 2（最佳）或 OptiX 7 去噪器，因为它们对高亮度值更适合。&lt;br /&gt;
&lt;br /&gt;
* 在 HDRP 中，“distance” 与普通 Shadowmask 的切换可直接在 Light 组件上完成，而不是在全局设置中。&lt;br /&gt;
&lt;br /&gt;
* 不要在 Skylight 上使用 “match” 按钮，因为 HDRP 使用的是非常特定的程序化天空着色器。请改为将其烘焙为 HDRI [[How_do_I...#How_do_I_use_Skylight_with_a_procedural_sky_shader.3F|这种方式]]。&lt;br /&gt;
&lt;br /&gt;
* 建议在使用 HDRP 时始终将 Light Probe Mode 设置为 L2 或 L1，因为 HDRP 的渲染器并未针对 Legacy 模式进行优化。&lt;br /&gt;
&lt;br /&gt;
* 最新版本的 HDRP/URP 自带自己的 IES 文件导入器。由于资源类型不匹配，Unity 会将旧版本 Bakery IES 灯光断开连接，使其显示为普通点光源。它们可以重新连接并重新保存。&lt;br /&gt;
&lt;br /&gt;
Bakery 的示例场景是为内置渲染管线设计的，因此在 HDRP/URP 中正确渲染它们需要一些步骤。以下是一些提示；假设新建项目使用默认的 HDRP/URP 设置：&lt;br /&gt;
&lt;br /&gt;
=== 在 HDRP 中查看示例场景 ===&lt;br /&gt;
&lt;br /&gt;
* 导入 Bakery 后，将标准材质升级为 HDRP：Edit-&amp;gt;Rendering-&amp;gt;Materials-&amp;gt;Convert All Built-in Materials To HDRP。&lt;br /&gt;
* 将 Bakery_ShaderGraphHDRP.unitypackage 导入项目，因为它包含实现高级 Bakery 功能的特殊 Shader Graph（对于经典颜色/方向/遮罩光照贴图不需要）。&lt;br /&gt;
* 选择 DefaultSettingsVolumeProfile.asset。在 HDRI Sky 部分，将 Exposure Compensation 设置为 1。否则，与示例场景相比，默认 HDRP 会过亮，因曝光调整而使场景看起来很暗。&lt;br /&gt;
* 选择示例场景中的灯光时，HDRP 会初始化其自身的灯光数据。有时会导致灯光立即变得更亮。点击 “Match real-time to lightmapped” 以同步。&lt;br /&gt;
* 在渲染光探针前，将 Light Probe Mode 设置为 L2。&lt;br /&gt;
* '''example_directional''': 将 Shader 更改为 BakeryDirSpecGraph 以查看烘焙高光（或仅使用常规 HDRP/Lit 用于仅漫反射法线映射）。删除球体，因为当前没有支持逐顶点方向的 Shader Graph。&lt;br /&gt;
* '''example_directional_MonoSH''': 将 Shader 更改为 BakerySpecMonoSHGraph（或 BakeryMonoSHGraph，用于没有高光的略微低成本版本）。删除球体，因为当前没有支持逐顶点 MonoSH 的 Shader Graph。&lt;br /&gt;
* '''example_RNM''': 将 Shader 更改为 BakeryRNMGraph。&lt;br /&gt;
* '''example_SH''': 将 Shader 更改为 BakerySpecSHGraph（或 BakerySHGraph，用于没有高光的略微低成本版本）。删除球体，因为当前没有支持逐顶点 SH 的 Shader Graph。&lt;br /&gt;
* '''example_mixed_directional_mode''': 对 MonoSH/RNM/SH 平面，同样需要不同的 Graph。&lt;br /&gt;
* '''example_lights''': 将顶点光照球体的 Shader 更改为 BakeryVertexColorGraph。&lt;br /&gt;
* '''example_prefabs_bake''': 无需进一步调整。&lt;br /&gt;
* '''example_sectors''': 无需进一步调整。&lt;br /&gt;
* '''example_shadowmask''': 选择 DirectLight 并点击 “Match real-time to lightmapped” 修正亮度。将所有 HDRP 灯光的 Shadowmask Mode 设置为 Shadowmask。&lt;br /&gt;
* '''example_sponza_day''': 将 OpenImageDenoise 2（或 Optix 7，如果不支持）设置为首选去噪器。&lt;br /&gt;
* '''example_sponza_evening''': 将 OpenImageDenoise 2（或 Optix 7，如果不支持）设置为首选去噪器。&lt;br /&gt;
* '''example_subtractive''': HDRP 不支持减法模式。&lt;br /&gt;
* '''example_volumes_simple''': 将火车 Shader 更改为 BakeryVolumeSpecGraph（或 BakeryVolumeGraph，用于没有高光的略微低成本版本）。&lt;br /&gt;
* '''example_volumes_simple_shadowmask''': HDRP 当前不支持 Shadowmask Volumes。&lt;br /&gt;
* '''example_volumes_advanced''': 与 example_volumes_simple 相同。&lt;br /&gt;
* '''example_translucency''': 场景大部分应显示正常。对于 “Dynamic sphere lit by volume”，将 Shader 设置为 BakeryVolumeGraph。&lt;br /&gt;
&lt;br /&gt;
=== 在 URP 中查看示例场景 ===&lt;br /&gt;
&lt;br /&gt;
* 导入 Bakery 后，将标准材质升级为 URP：打开 Assets/Bakery/examples/content，输入 &amp;quot;t:material&amp;quot; 选择所有材质，并仅在 &amp;quot;content&amp;quot; 文件夹下搜索。点击 Edit-&amp;gt;Rendering-&amp;gt;Materials-&amp;gt;Convert Selected Built-in Materials To URP。&lt;br /&gt;
* 将 Bakery_ShaderGraphURP.unitypackage 导入项目，因为它包含实现高级 Bakery 功能的特殊 Shader Graph（对于经典颜色/方向/遮罩光照贴图不需要）。&lt;br /&gt;
* '''example_directional''': 将 Shader 更改为 BakeryURPLit，启用 &amp;quot;Bakery Lightmapped Specular&amp;quot;（或者仅保持常规 URP/Lit 用于仅漫反射法线映射）。删除球体，因为当前没有支持逐顶点方向的 Shader Graph。&lt;br /&gt;
* '''example_directional_MonoSH''': 将 Shader 更改为 BakeryURPLit，将 Bakery Mode 设置为 MonoSH，启用 &amp;quot;Bakery Lightmapped Specular&amp;quot;。在顶点光照球体上也启用 &amp;quot;Per-vertex&amp;quot;。&lt;br /&gt;
* '''example_RNM''': 将 Shader 更改为 BakeryURPLit，将 Bakery Mode 设置为 RNM，启用 &amp;quot;Bakery Lightmapped Specular&amp;quot;。&lt;br /&gt;
* '''example_SH''': 将 Shader 更改为 BakeryURPLit，将 Bakery Mode 设置为 SH，启用 &amp;quot;Bakery Lightmapped Specular&amp;quot;。删除球体，因为当前没有支持逐顶点 SH 的 Shader Graph。&lt;br /&gt;
* '''example_mixed_directional_mode''': 类似地使用 BakeryURPLit 并设置不同的 Bakery Mode（MonoSH、RNM、SH）。非方向性/主方向/烘焙法线贴图可使用常规 URP/Lit。&lt;br /&gt;
* '''example_lights''': 无需进一步调整。&lt;br /&gt;
* '''example_prefabs_bake''': 无需进一步调整。&lt;br /&gt;
* '''example_sectors''': 无需进一步调整。&lt;br /&gt;
* '''example_shadowmask''': 类似于 Built-in 渲染管线，在 Bakery 窗口（或项目 Quality Settings）中取消选中 Distance Shadowmask，以在摄像机附近查看实际烘焙/实时阴影混合效果。&lt;br /&gt;
* '''example_sponza_day''': 在植被材质上启用 alpha clipping。&lt;br /&gt;
* '''example_sponza_evening''': 同 example_sponza_day。&lt;br /&gt;
* '''example_subtractive''': 无需进一步调整。&lt;br /&gt;
* '''example_volumes_simple''': 将火车 Shader 更改为 BakeryURPLit，并将 Bakery Mode 设置为 Volume。可选启用 &amp;quot;Bakery Lightmapped Specular&amp;quot;。&lt;br /&gt;
* '''example_volumes_simple_shadowmask''': 与 example_volumes_simple 相同，但也启用 &amp;quot;Volume Shadowmask&amp;quot;。&lt;br /&gt;
* '''example_volumes_advanced''': 与 example_volumes_simple 相同。&lt;br /&gt;
* '''example_translucency''': 场景大部分应显示正常。对于 &amp;quot;Dynamic sphere lit by volume&amp;quot;，将 Shader 设置为 BakeryURPLit 并将 Bakery Mode 设置为 Volume。&lt;br /&gt;
&lt;br /&gt;
= 升级 Bakery =&lt;br /&gt;
在升级该资源时，建议遵循以下步骤：&lt;br /&gt;
&lt;br /&gt;
* 关闭 Bakery 窗口。&lt;br /&gt;
* 关闭 Unity。&lt;br /&gt;
* 重新打开 Unity。&lt;br /&gt;
* 导入更新后的包。&lt;br /&gt;
&lt;br /&gt;
请注意，如果不先关闭 Unity，导入可能会失败，因为 DLL 文件被锁定（会出现类似 &amp;quot;alphabuffergen.dll: Access is denied.&amp;quot; 的提示）。&lt;br /&gt;
&lt;br /&gt;
如果你移动过 Bakery 文件夹（Assets/Bakery 和 Assets/Editor/x64/Bakery）到其他位置，可能需要在更新前将它们移回原处，以避免出现两个冲突的包副本。&lt;br /&gt;
&lt;br /&gt;
= 脚本 API =&lt;br /&gt;
&lt;br /&gt;
== 基本用法 ==&lt;br /&gt;
&lt;br /&gt;
获取并修改渲染设置：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ftLightmapsStorage storage = ftRenderLightmap.FindRenderSettingsStorage();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
可以在 ftLightmapsStorage.cs 中查看可用设置的完整列表。&lt;br /&gt;
&lt;br /&gt;
获取 lightmapper 实例并（重新）加载设置：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap bakery = ftRenderLightmap.instance != null ? ftRenderLightmap.instance : new ftRenderLightmap();&lt;br /&gt;
bakery.LoadRenderSettings();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
渲染光照贴图（如果设置为 L1 或 L2 模式，也会渲染探针）：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;bakery.RenderButton(bool showMsgWindows)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
仅渲染光探针：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;bakery.RenderLightProbesButton(bool showMsgWindows)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
仅渲染反射探针：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;bakery.RenderReflectionProbesButton(bool showMsgWindows)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''showMsgWindows''' 指示是否可以显示任何对话框/确认框。如果设置为 false，则抑制显示。&lt;br /&gt;
&lt;br /&gt;
检查烘焙是否正在进行：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.bakeInProgress&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
使用示例请参考 [[Community_extensions#Batch_scene_baker|Batch Scene Baker]] 脚本。&lt;br /&gt;
&lt;br /&gt;
== 额外函数 ==&lt;br /&gt;
&lt;br /&gt;
将一个 ftLightmapsStorage 的所有渲染设置复制到另一个：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmapsStorage.CopySettings(ftLightmapsStorage src, ftLightmapsStorage dest)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
获取全局（每项目）存储对象：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftGlobalStorage gstorage = ftLightmaps.GetGlobalStorage()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
将 ftLightmapsStorage（每场景）的所有渲染设置复制到 ftGlobalStorage（每项目）：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmapsStorage.CopySettings(ftLightmapsStorage src, ftGlobalStorage dest)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
将 ftGlobalStorage（每项目）的所有渲染设置复制到 ftLightmapsStorage（每场景）：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmapsStorage.CopySettings(ftGlobalStorage src, ftLightmapsStorage dest)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
获取包含 Bakery 二进制文件的文件夹路径：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmaps.GetEditorPath()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 额外变量 ==&lt;br /&gt;
&lt;br /&gt;
获取当前临时文件路径（必须先创建 ftRenderLightmap 实例）：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.scenePath&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
获取/设置 UVGBuffer 数据压缩（启用时为 LZ4，否则为 DDS）：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.compressedGBuffer&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
获取/设置输出光照贴图数据压缩（启用时为 LZ4，否则为 DDS）：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.compressedOutput&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 事件 ==&lt;br /&gt;
&lt;br /&gt;
脚本可以订阅 ftRenderLightmap 类中的静态事件。&lt;br /&gt;
&lt;br /&gt;
在完整渲染前调用：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnPreFullRender&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
在 Legacy 光探针模式下，每渲染一个光探针前调用。ProbeEventArgs 是一个结构体，包含 '''pos''' 字段表示当前光探针的位置：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler&amp;lt;ProbeEventArgs&amp;gt; OnPreRenderProbe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
在 Legacy 光探针渲染完成后调用：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnFinishedProbes&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
在完整渲染完成后调用：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnFinishedFullRender&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
在反射探针渲染前调用：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnPreReflectionProbeRender&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
在反射探针渲染完成后调用：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnFinishedReflectionProbes&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mr F</name></author>
		
	</entry>
	<entry>
		<id>https://geom.io/bakery/wiki/index.php?title=%E4%BD%BF%E7%94%A8%E6%89%8B%E5%86%8C&amp;diff=1833</id>
		<title>使用手册</title>
		<link rel="alternate" type="text/html" href="https://geom.io/bakery/wiki/index.php?title=%E4%BD%BF%E7%94%A8%E6%89%8B%E5%86%8C&amp;diff=1833"/>
		<updated>2025-11-05T14:50:14Z</updated>

		<summary type="html">&lt;p&gt;Mr F: /* 脚本 API */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== 系统要求 ==&lt;br /&gt;
&lt;br /&gt;
使用 Bakery 需要：&lt;br /&gt;
&lt;br /&gt;
Windows（7 或更高版本）电脑。&lt;br /&gt;
&lt;br /&gt;
Nvidia 显卡。最低支持型号为 Kepler（GeForce 650 或更新型号，Quadro 显卡请查看规格）。&lt;br /&gt;
&lt;br /&gt;
64 位 Unity 编辑器。Bakery 已在 5.6 到 6 及更高版本上测试过，同时也在 Tuanjie 1.6.7 上通过测试。&lt;br /&gt;
&lt;br /&gt;
{{note|系统要求仅适用于开发者的电脑，而非目标平台。使用 Bakery 烘焙的光照贴图可以在任何地方使用。}}&lt;br /&gt;
&lt;br /&gt;
== 前提条件 ==&lt;br /&gt;
* 确保你的项目中没有任何脚本编译错误，否则也会导致 Bakery 的脚本无法编译。&lt;br /&gt;
* 确保你的显卡驱动是最新版本，如有需要请[https://www.nvidia.com/Download/index.aspx?lang=en-US 更新]。&lt;br /&gt;
&lt;br /&gt;
'''请使用 Game-Ready（标准）驱动程序，而不是 “Studio” 驱动。'''&lt;br /&gt;
&lt;br /&gt;
== 安装 ==&lt;br /&gt;
&lt;br /&gt;
1. 通过 [https://assetstore.unity.com/packages/tools/level-design/bakery-gpu-lightmapper-122218 Asset Store] 将 Bakery 导入到你的项目中。&lt;br /&gt;
&lt;br /&gt;
2. Unity 会显示要导入的文件列表。如果这是你第一次使用 Bakery，建议直接 点击 Import（导入）。有经验的用户可以取消选中 examples 文件夹，以进行更轻量的安装。&lt;br /&gt;
&lt;br /&gt;
文件将被导入到 `Assets/Bakery` 和 `Assets/Editor/x64/Bakery` 文件夹中。&lt;br /&gt;
这些文件夹之后可以移动。&lt;br /&gt;
&lt;br /&gt;
3. Unity 随后会导入 Bakery 并编译脚本。此时可能会弹出如下窗口：&lt;br /&gt;
&lt;br /&gt;
[[File:Goahead.png]]&lt;br /&gt;
&lt;br /&gt;
此时你应点击 “Go Ahead”（继续）。&lt;br /&gt;
&lt;br /&gt;
现在你应该能在编辑器中看到新增的 Bakery 菜单：&lt;br /&gt;
&lt;br /&gt;
[[File:bmenu.jpg]]&lt;br /&gt;
&lt;br /&gt;
== 快速开始 ==&lt;br /&gt;
&lt;br /&gt;
1. 添加一些模型或基础体，并将其标记为静态（Static）。&lt;br /&gt;
&lt;br /&gt;
'''用于光照贴图的网格必须具有不重叠的 UV2。如果存在 UV2，则会使用 UV2（否则使用 UV1）。如果你的模型没有为光照贴图进行展开，请在资源中勾选 Generate Lightmap UVs（生成光照贴图 UV）。'''&lt;br /&gt;
Unity 的基础体已经具有正确的 UV2。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Staticmarked.jpg|320px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. 选择方向光（Unity 为你创建的那个），并添加 '''Bakery Direct Light''' 组件。&lt;br /&gt;
   {{note|Bakery 和 Unity 使用独立的光源组件。}}&lt;br /&gt;
&lt;br /&gt;
3. Bakery Direct Light 有许多可调选项，但你可以轻松将其与 Unity 光源匹配。点击 '''Match lightmapped to real-time'''。现在 Bakery 光源的颜色应与 Unity 默认的方向光相同，呈黄色调。&lt;br /&gt;
&lt;br /&gt;
[[File:Matching.jpg|640px]]&lt;br /&gt;
&lt;br /&gt;
{{note|Direct Light 组件可能会提示项目未使用线性光强度。问题在于，Unity 默认会对光源颜色应用伽马校正 [https://twitter.com/guycalledfrank/status/1001108508614553600 不正确]。&lt;br /&gt;
可以通过[https://docs.unity3d.com/ScriptReference/Rendering.GraphicsSettings-lightsUseLinearIntensity.html 脚本]启用正确模式。&lt;br /&gt;
这就是 “Fix” 按钮的作用。如果你已经在非线性光强模式下设置了许多光源，并且不想再次更改它们，可以跳过修复。即使你按了 “Fix”，也可以随时撤销此更改。&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. 要获得带阴影的环境光，请创建 Skylight（Bakery-&amp;gt;Create-&amp;gt;Skylight）。&lt;br /&gt;
&lt;br /&gt;
[[File:Menusky.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. 选择 Skylight，为它设置一些偏蓝的颜色，然后点击 '''Match scene skybox to this light'''。   这将使场景的 skybox 与光照完全匹配。&lt;br /&gt;
   {{note|将 Unity 的 skybox 与 Bakery Skylight 匹配是可选的，但对正确性很有用，可以确保可见环境和引擎内的反射探针与烘焙光照一致。目前此选项仅适用于 Standard 渲染管线。}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Skycomp.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. 点击 Bakery-&amp;gt;Render Lightmap。默认情况下，Full Lighting 模式是激活的。它会烘焙所有光源的直接和间接光照贡献。如果你想将实时阴影与烘焙全局光照（GI）结合使用，请将模式更改为 '''Indirect'''。&lt;br /&gt;
&lt;br /&gt;
[[File:Bakerywindow.jpg]]&lt;br /&gt;
&lt;br /&gt;
{{note| Bakery 可能会提示你正在使用旧的 [https://docs.unity3d.com/Manual/LinearLighting.html gamma mode]。如果你在意光照质量，强烈建议使用线性模式。如果你的项目已经在错误的伽马模式下设置好了，并且不想更改，或者是发布到不支持线性模式的移动设备上，也可以忽略此提示。}}&lt;br /&gt;
&lt;br /&gt;
7. 点击 '''Render'''。&lt;br /&gt;
&lt;br /&gt;
8. 完成！现在你应该已经得到烘焙的全局光照（GI）：&lt;br /&gt;
&lt;br /&gt;
[[File:Bakedgi.jpg]]&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 ==&lt;br /&gt;
&lt;br /&gt;
所有渲染设置都可以通过 Bakery-&amp;gt;Render Lightmap 访问。设置会为每个场景单独保存。Bakery 窗口顶部的选项允许你在 Simple（简单）、Advanced（高级）和 Experimental（实验）设置之间切换，每个后续模式都会显示更多可调选项。对于大多数场景，Simple 模式已经足够，是入门的好方法。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render mode ===  &lt;br /&gt;
定义要烘焙的光照贴图类型。  &lt;br /&gt;
&lt;br /&gt;
===== Full Lighting =====&lt;br /&gt;
烘焙所有 Bakery 光源的完整直接光和间接光。&lt;br /&gt;
{{note|在 2017.3 之前的 Unity 版本中，如果同一对象上同时有 Unity 和 Bakery 组件，你需要手动禁用 Unity 组件以避免亮度加倍。在较新版本中，实时效果会自动对烘焙光源禁用，就像内置光照烘焙器一样。}}&lt;br /&gt;
&lt;br /&gt;
===== Indirect =====&lt;br /&gt;
[[File:Image26.png|thumb|Unity 支持的不同渲染模式对比]]&lt;br /&gt;
基础混合模式。它会查看每个光源上的 Baked Contribution 选择器：如果设置为 ''Direct And Indirect''，则光源会像在 Full Lighting 模式下一样被烘焙。如果设置为 ''Indirect Only''，则只会烘焙该光源的间接光照（GI）。在后一种情况下，你应保持对象上的 Unity 光源和 Bakery 光源同时存在，一个提供实时直接光照，另一个提供预计算的全局光照（GI）。&lt;br /&gt;
&lt;br /&gt;
[[File:Indirectonly.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== Shadowmask =====&lt;br /&gt;
[[File:Image21.png|thumb|左：完全烘焙的光照。中：动态光源 + 烘焙 GI。右：胶囊形阴影、凹凸贴图和高光为动态光照，但立方体阴影和 GI 为烘焙光照。]]&lt;br /&gt;
[[File:Image6.png|thumb|当相机足够远离场景，或者动态阴影被禁用时，场景将呈现如下效果]]&lt;br /&gt;
更高级的混合模式。它通过生成两种类型的光照贴图来工作——一种包含烘焙颜色（如 Indirect 模式），另一种包含静态物体的阴影。它有几个优点：&lt;br /&gt;
* 实时阴影只需渲染少量动态对象，而不是整个场景。&lt;br /&gt;
* 实时阴影与烘焙阴影可以正确融合。&lt;br /&gt;
* 实时光源可以渲染凹凸贴图、高光和其他表面效果，同时仍会被高质量烘焙阴影遮挡。&lt;br /&gt;
[https://docs.unity3d.com/Manual/LightMode-Mixed-Shadowmask.html 更多详情]&lt;br /&gt;
&lt;br /&gt;
要启用此行为，你必须在同一对象上同时存在 Unity 光源和 Bakery 光源，并将 Baked Contribution 设置为 ''Shadowmask and Indirect''。未标记的光源将按 Indirect 模式进行烘焙。&lt;br /&gt;
&lt;br /&gt;
[[File:Smask22.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== Distance Shadowmask =====&lt;br /&gt;
此复选框仅在你选择 Shadowmask 时可见，并且只是切换项目 [https://docs.unity3d.com/Manual/LightMode-Mixed-ShadowmaskMode.html Quality Settings] 中同名的设置。&lt;br /&gt;
[https://docs.unity3d.com/Manual/LightMode-Mixed-DistanceShadowmask.html 更多详情]&lt;br /&gt;
{{note|由于缺少对应的脚本 API，该复选框在 Unity 5.6.x 上不可见。你可以在 Window-&amp;gt;Lighting-&amp;gt;Mixed Lighting-&amp;gt;Lighting Mode 中切换该设置。}}&lt;br /&gt;
{{note|在 Unity 版本 &amp;lt; 2017.3 中，由于 API 限制，渲染 Shadowmask 光照贴图会清除光照探针。烘焙后需要重新渲染光照探针。在较新版本中不应发生此问题。}}&lt;br /&gt;
&lt;br /&gt;
===== Subtractive =====&lt;br /&gt;
&lt;br /&gt;
启用 [https://docs.unity3d.com/Manual/LightMode-Mixed-Subtractive.html Subtractive] 光照模式。&lt;br /&gt;
&lt;br /&gt;
此选项对光照贴图本身没有任何特殊作用，实际上它的工作方式与 Full Lighting 相同。&lt;br /&gt;
&lt;br /&gt;
唯一的区别是，它还会将实时 Unity 光源设置为与 Subtractive 模式兼容（因为无法通过 UI 完成此操作）。&lt;br /&gt;
&lt;br /&gt;
你还需要在 [https://docs.unity3d.com/Manual/GlobalIllumination.html#MixedLighting Unity Lighting] 窗口中额外设置全局减法参数（例如全局阴影颜色）。&lt;br /&gt;
&lt;br /&gt;
===== Ambient Occlusion Only =====&lt;br /&gt;
仅烘焙环境光遮蔽（AO）。如果你很清楚自己在做什么，这可能会有用。请确保设置 [[#Ambient_occlusion|AO 选项]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Directional mode ===&lt;br /&gt;
[[File:Image3.png|thumb|不同方向模式的对比]]&lt;br /&gt;
定义了方向信息的烘焙方式。标准光照贴图每个像素只存储单一颜色，而方向光照贴图为着色器提供了关于该像素周围半球内光照变化的提示。这些数据用于在完全烘焙的区域中结合法线贴图。如果将其应用到内置的 [[#Bakery_shaders|Bakery]] 着色器中，还可以产生**近似高光反射**效果。&lt;br /&gt;
&lt;br /&gt;
===== None =====&lt;br /&gt;
不包含方向数据，每个像素仅有单一颜色。&lt;br /&gt;
&lt;br /&gt;
===== Baked Normal Maps =====&lt;br /&gt;
依然没有方向数据，但在渲染光照贴图时会考虑法线贴图。此方式在运行时没有额外开销。由于光照贴图的分辨率通常低于法线贴图，结果可能显得模糊。其他问题包括：由于缺乏 mipmapping，远处可能出现锯齿，以及降噪步骤可能导致细节被涂抹。要了解如何在此模式下使用具有程序化法线的自定义着色器，请参阅 [[#Normal_mapping|Normal Mapping]] 章节。&lt;br /&gt;
&lt;br /&gt;
===== Dominant Direction =====&lt;br /&gt;
此模式类似于 Unity 中 Enlighten 和 Progressive 烘焙器的实现。它与大多数着色器兼容，仅生成一张额外的贴图，运行时开销极小。缺点是凹凸贴图的效果较弱，略显灰暗，与实时光照下的同一物体相比可能差异较大。&lt;br /&gt;
&lt;br /&gt;
===== RNM =====&lt;br /&gt;
基于最初为《Half-Life 2》开发的 [https://steamcdn-a.akamaihd.net/apps/valve/2004/GDC2004_Half-Life2_Shading.pdf Radiosity Normal Mapping] 技术（相关演示文稿），后来被许多游戏采用（如《Mirror's Edge》）。此模式总共生成三张 HDR 贴图，是内存占用最高的模式之一，但运行时开销仍相对较低。该模式比 Dominant Direction 更精确，能更好地再现表面反差，并能正确处理来自不同角度、具有不同颜色的光照对法线贴图的影响。&lt;br /&gt;
&lt;br /&gt;
===== SH =====&lt;br /&gt;
基于论文《[https://media.contentapi.ea.com/content/dam/eacom/frostbite/files/gdc2018-precomputedgiobalilluminationinfrostbite.pdf Precomputed Global Illumination in Frostbite]》。这是最高质量的模式，能提供更好的表面对比度，并准确表现来自不同方向、不同颜色的光照。总共生成四张贴图，其中仅一张为 HDR，因此比 RNM 占用更少内存。运行时开销略高于 RNM。&lt;br /&gt;
&lt;br /&gt;
===== MonoSH =====&lt;br /&gt;
[[File:FY8Ru8hWIAAdYYH.jpg|thumb|Dominant Direction、完整 SH 与 MonoSH 的尺寸/质量对比]]&lt;br /&gt;
与 SH 类似，但使用单色的 L1 方向系数。表面对比度同样良好，虽然无法准确表现来自不同方向的不同颜色光照，但对多数场景来说已经足够。仅生成一张额外贴图，因此显存占用与带宽需求与 Dominant Direction 相近；事实上更低，因为 Dominant Direction 使用 RGBA 贴图，而 MonoSH 只需 RGB。该贴图通过内置的方向光照贴图系统传递，但''在标准着色器下显示不正确''。请务必使用兼容的着色器。&lt;br /&gt;
&lt;br /&gt;
===== 限制 =====&lt;br /&gt;
&lt;br /&gt;
* RNM 和 SH/MonoSH 只能与 [[#Bakery_shaders|Bakery shader]] 一起使用，或者需要对你的着色器进行调整。&lt;br /&gt;
* 在 RNM 和 SH 模式下，不会生成标准的颜色光照贴图。你需要确保场景中所有材质都使用 Bakery Shader，或者使用 [[#Bakery_Lightmap_Group_Selector|Lightmap Groups]] 将 RNM/SH 对象与其他对象分开。&lt;br /&gt;
* RNM 和 SH 贴图是通过 [https://docs.unity3d.com/ScriptReference/MaterialPropertyBlock.html MaterialPropertyBlock] 应用于对象的，因此在 Unity 的 Lighting 窗口中可能无法完全显示。&lt;br /&gt;
* Dominant Direction、RNM 和 SH/MonoSH 模式可能需要为全局光照（GI）和光照网格使用更多采样，以获得相近的质量。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Texels per unit ===&lt;br /&gt;
[[File:Texelscomp.jpg|thumb|1 vs 10 texels per unit]]&lt;br /&gt;
每个世界单位的光照贴图像素（Texels）近似数量。它会影响生成光照贴图的数量和分辨率。&lt;br /&gt;
&lt;br /&gt;
入门示例值：&lt;br /&gt;
&lt;br /&gt;
* 大型户外区域（城市）：1 - 5&lt;br /&gt;
* 中型户外区域（几条小巷）：10 - 20&lt;br /&gt;
* 高质量室内场景：100&lt;br /&gt;
&lt;br /&gt;
假设场景比例大约为 1 单位 = 1 米。在 Unity 中使用这种比例通常是推荐的，以便更好地导航和进行物理模拟。如果你的比例不同，请相应地调整 Texels。&lt;br /&gt;
&lt;br /&gt;
请注意，Texels Per Unit 是基础分辨率，但每个对象还可以通过 Mesh Renderer 上的 &amp;quot;Scale in Lightmap&amp;quot; 选项以及 Bakery 窗口中的 &amp;quot;Scale per map type&amp;quot; 进行额外调整。&lt;br /&gt;
&lt;br /&gt;
{{note| 将 &amp;quot;Scale in Lightmap&amp;quot; 设置为 0 的对象不会被烘焙，但仍会投射阴影并影响全局光照（GI）。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Max resolution ===&lt;br /&gt;
光照贴图的最大尺寸限制。如果对象无法容纳在单张光照贴图中（根据当前的 Texels Per Unit 值），将会分配额外的光照贴图。同样的四个正方形对象可以使用四张 512x512 的贴图，也可以使用一张 1024x1024 的贴图。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bounces ===&lt;br /&gt;
[[File:Image36.png|thumb|注意更多的反弹会为封闭空间带来更多光照。]]&lt;br /&gt;
定义光线在表面上反弹的次数。通常，对于户外场景（例如城市），较低的反弹次数就足够了，而对于封闭场景（室内、洞穴），则需要较高的反弹次数。&lt;br /&gt;
&lt;br /&gt;
虽然滑块最多限制为 5 次反弹，但可以在数字输入框中输入任意反弹次数。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Samples ===&lt;br /&gt;
[[File:Image7.png|thumb|左：Samples = 4，右：Samples = 16。为了演示，去噪功能已关闭。]]&lt;br /&gt;
影响全局光照（GI）的质量。典型值为 16 到 32。&lt;br /&gt;
&lt;br /&gt;
{{note| 可以输入超出滑块最大值的任意数字，但请注意，该数字表示最终光线数量的平方根，例如 32 表示 1024 条光线，64 表示 4096 条光线，依此类推。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GPU Priority ===&lt;br /&gt;
在 GPU 处理光照贴图时，操作系统和其他软件的响应可能会变慢。此选项允许你在烘焙速度和系统响应之间进行平衡。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render ===&lt;br /&gt;
为所有打开的场景烘焙光照贴图。&lt;br /&gt;
如果 [[使用手册#Light_probe_mode|Light Probe Mode]] 设置为 L1 或 L2，也会烘焙 [https://docs.unity3d.com/Manual/LightProbes.html 光照探针]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Render Light Probes ===&lt;br /&gt;
为所有打开的场景烘焙 [https://docs.unity3d.com/Manual/LightProbes.html 光照探针]。&lt;br /&gt;
&lt;br /&gt;
请注意，要在 Shadowmask 模式下对动态对象获得正确的混合光阴影，你还需要启用 [[使用手册#Occlusion_probes|occlusion probes]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Render Reflection Probes ===&lt;br /&gt;
为所有打开的场景烘焙反射探针。此按钮仅为方便起见，会调用引擎内置的反射探针更新功能。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update Skybox Probe ===&lt;br /&gt;
为当前的 skybox 烘焙全局漫反射和反射探针。与 “Render Reflection Probes” 一样，它仅调用引擎内置函数。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Occlusion probes ===&lt;br /&gt;
在渲染光照探针时，允许 Unity 使用当前选择的内置光照烘焙器烘焙遮挡探针（occlusion probes）。遮挡探针是存储在普通光照探针中的附加数据，可以防止动态对象在阴影区域被错误照亮。目前在 Unity 中无法使用自定义遮挡探针，必须调用内置光照烘焙器来完成此操作。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Warnings ===&lt;br /&gt;
这些选项会在按下任意 Render 按钮后对场景进行验证，并显示警告对话框，询问是否继续或停止烘焙过程。&lt;br /&gt;
&lt;br /&gt;
* Suppress all popups（屏蔽所有弹窗）：按下 Render 后不显示任何对话框。&lt;br /&gt;
* UV validation（UV 验证）：检查所有模型是否具有完全正确的光照贴图 UV，特别是 UV 是否位于 0-1 范围内且不重叠。&lt;br /&gt;
* Overwrite check（覆盖检查）：显示哪些光照贴图文件将被覆盖。&lt;br /&gt;
* Memory check（内存检查）：显示大致所需的视频内存量。&lt;br /&gt;
* Sample count check（采样数检查）：检查是否有光源、GI 或 AO 的采样数不合理，可能导致 GPU 超出可用资源。&lt;br /&gt;
* Lightmapped prefab validation（光照贴图预制体验证）：验证光照贴图预制体，并在某些预制体将被覆盖时发出通知。&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 (Advanced) ==&lt;br /&gt;
=== Light probe mode ===&lt;br /&gt;
更改光照探针的烘焙方式。&lt;br /&gt;
&lt;br /&gt;
* Legacy（传统模式）：使用 Render Light Probes 按钮生成探针。点光源和方向光在光照烘焙器中计算，而区域光/天空光/间接光则通过在每个探针位置渲染立方体贴图收集。结果以 [https://docs.unity3d.com/ScriptReference/Rendering.SphericalHarmonicsL2.html L2] 球谐（spherical harmonics）形式存储。缺点是立方体贴图渲染速度慢，并且在游戏中使用的着色器未物理正确表示光照表面，或者项目为移动平台设置时，光照贴图和探针可能不匹配（Unity 可能会裁剪高强度值）。&lt;br /&gt;
&lt;br /&gt;
* L1：在点击 Render 时，光照探针会与光照贴图一起渲染。此选项提供更高的烘焙性能，并保证探针光照与光照贴图匹配。结果以 L1 球谐形式存储（仍可被普通着色器使用）。使用 [[#Bakery_shaders|Bakery shader]] 的 Non-Linear Light Probe SH 选项可以进一步提升结果。&lt;br /&gt;
&lt;br /&gt;
* L2：更高质量（完整 L2 球谐）。与 L1 一样，会自动与光照贴图一起渲染。与 L1 相比，性能影响可忽略不计。应在所有着色器下显示正常。探针对比度/方向性/振铃去除可通过 Project Settings -&amp;gt; Bakery -&amp;gt; “Ringing removal for L2 light probes” 调整。&lt;br /&gt;
&lt;br /&gt;
'''在 Unity 2019.3 中似乎存在一个 bug，如果启用 Occlusion Probes 选项，Legacy 光照探针的颜色无法正确保存。使用 Occlusion Probes 时，默认且推荐使用 L2 模式。'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Asset UV Processing ===&lt;br /&gt;
配置资产的 UV 间距（padding）调整。可选值：&lt;br /&gt;
&lt;br /&gt;
* Don't change（不更改）：不修改资产。&lt;br /&gt;
* Adjust UV padding（调整 UV 间距）：会查找具有自动生成 UV 的模型（资产上启用 “Generate Lightmap UVs”），并进一步调整它们，使每个网格的 UV 岛之间具有适当间距。导入器设置中的全模型 Pack Margin 会被忽略。系统会根据每个网格的面积和光照贴图分辨率计算出最优值。&lt;br /&gt;
* Adjust UV padding for new meshes only（仅调整新网格的 UV 间距）：与上面相同，但会跳过之前至少调整过一次的模型。&lt;br /&gt;
* Remove UV adjustments（移除 UV 调整）：撤销所有之前的 UV 调整，使自动展开的模型恢复到 Unity 原始展开的样子。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser ===&lt;br /&gt;
设置所需的去噪器。可选值：&lt;br /&gt;
&lt;br /&gt;
* Optix 5：使用 OptiX 5.1 AI 去噪器（之前称为 “Legacy denoiser”）。在 GPU 上运行。支持从 [https://en.wikipedia.org/wiki/Kepler_(microarchitecture) Kepler]（通常是 GeForce 6xx）到 [https://en.wikipedia.org/wiki/Turing_(microarchitecture) Turing]（通常是 GeForce 20xx）的所有显卡。不支持 [https://en.wikipedia.org/wiki/Ampere_(microarchitecture) Ampere]（30xx）。OptiX 5.1 使用嵌入的静态训练数据集，因此不受驱动实现影响。&lt;br /&gt;
&lt;br /&gt;
* Optix 6：使用 OptiX 6.0 AI 去噪器（之前为默认选项）。在 GPU 上运行。在 Kepler（6xx）显卡上似乎无法使用，但在更新的显卡上均可运行，包括 Ampere（30xx）。自 6.0 起，OptiX 去噪器的训练数据集存储在驱动中。在 v442.50 之前，其行为类似于 OptiX 5.1；但之后 NVIDIA [https://forums.developer.nvidia.com/t/optix7-denoiser-different-results-with-different-version-of-drivers/117989/2 更改了数据集]，结果可能有所不同。更新后的数据集有时可能产生网格状图案和更亮的边缘（仍可通过 “Denoise: fix bright edges” 修复），但运行速度更快。&lt;br /&gt;
&lt;br /&gt;
* Optix 7：使用 OptiX 7.2 AI 去噪器。行为类似 OptiX 6.0，但在 Ampere（30xx）上可能支持更好。&lt;br /&gt;
&lt;br /&gt;
* OpenImageDenoise：使用 Intel Open Image Denoise 库。在 CPU 上运行（任何支持 SSE 4.1 的 CPU）。可能略慢于 OptiX，但质量可比。&lt;br /&gt;
&lt;br /&gt;
* OpenImageDenoise2：使用 Intel Open Image Denoise 2，CUDA 模式。在 GPU 上运行，性能与 OptiX 6/7 相当，质量与 CPU 版本相同。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Adjust sample positions ===&lt;br /&gt;
寻找最佳采样位置以防止光照泄漏。算法详情可参考 [https://ndotl.wordpress.com/2018/08/29/baking-artifact-free-lightmaps/#leaks 此处]。在某些情况下（通常是大型且多边形极少、法线平滑的几何体），可能会产生不正确的结果，此时可以将其禁用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Unload scenes before render ===&lt;br /&gt;
在烘焙前卸载 Unity 场景以释放显存。复杂场景仅在编辑器中显示就可能占用数 GB 的显存。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Denoise ===&lt;br /&gt;
[[File:Image31.png|thumb|左：未开启 “Denoise”，右：开启 “Denoise”。]]&lt;br /&gt;
如果启用，将应用去噪算法。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Fix Seams ===&lt;br /&gt;
[[File:Image22.png|thumb|左：缝隙（“Fix Seams” 关闭），右：缝隙已修复（“Fix Seams” 开启）。]]&lt;br /&gt;
如果启用，将尝试融合由 UV 不连续造成的缝隙。对平滑几何体很有用，包括 Unity 默认的球体。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Split by scene ===&lt;br /&gt;
如果同时加载多个场景，并且启用此选项，每个场景将拥有自己的一套光照贴图，而不会与其他场景共享。这对于在运行时流式加载场景时限制纹理占用量非常有用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hole filling ===&lt;br /&gt;
[[File:Holefilling.jpg|thumb|“Hole filling” 关闭与开启的对比。]]&lt;br /&gt;
如果 Atlas Packer 设置为 xatlas，将尝试填充每个孔洞，从而生成更高效的贴图集。对于几何体非常复杂的场景，可能会增加场景导出时间，但通常推荐开启。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Min resolution ===&lt;br /&gt;
光照贴图的最小尺寸限制。可用于在生成大量小而完全填充的光照贴图与少量未完全填充的光照贴图之间进行平衡。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Scale per map type ===&lt;br /&gt;
允许你对颜色贴图、Shadowmask 和方向贴图设置不同的分辨率缩放。例如，常见情况是间接光颜色分辨率较低，但 Shadowmask 分辨率较高。请注意，缩放在光照贴图渲染完成后才应用，因此不会节省烘焙时间。如果启用了 “Adjust UV padding”，间距将基于最低分辨率的贴图，以防止像素泄漏。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Checker preview ===&lt;br /&gt;
[[File:Image12.png|thumb|Checker Preview 功能演示。]]&lt;br /&gt;
如果勾选了 “Show checker” 选项，场景视图将在可见对象上渲染棋盘格图案，以展示光照贴图像素大小。这对于在烘焙前确保 Texels Per Unit 和其他影响分辨率的设置使用合理数值非常有用。&lt;br /&gt;
&lt;br /&gt;
启用 Checker Preview 将强制 Bakery 执行贴图集打包。可能需要一些时间，但通常不会超过几秒钟。在修改场景内容后，按下 “Refresh checker” 可重新打包场景以查看更改。&lt;br /&gt;
&lt;br /&gt;
Checker Preview 还使用随机颜色显示场景将如何被分割到不同的光照贴图中。&lt;br /&gt;
&lt;br /&gt;
{{note| 当前 Checker Preview 无法显示地形的正确像素大小。}}&lt;br /&gt;
&lt;br /&gt;
==== Atlas preview ====&lt;br /&gt;
[[File:FN-TmhRXwAE9i2I.png|thumb|Atlas Preview 功能演示]]&lt;br /&gt;
当 Checker Preview 开启时，会显示 Atlas Preview 按钮。点击它将打开一个新窗口，显示未来光照贴图的 UV 布局。点击 &amp;quot;&amp;lt;&amp;quot; 和 &amp;quot;&amp;gt;&amp;quot; 按钮可浏览各个光照贴图。&lt;br /&gt;
这对于在烘焙前检查打包质量和光照贴图数量非常有用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Emissive boost ===&lt;br /&gt;
将任何表面自发光（emission）乘以此数值。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Indirect boost ===&lt;br /&gt;
将所有反弹光照乘以此数值。作用与光源组件上的 Indirect Intensity 相同，但为全局设置。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Backface GI ===&lt;br /&gt;
[[File:Image30.jpg|thumb|Backface GI]]&lt;br /&gt;
[[File:Image35.png|thumb|左：“Backface GI” = 0，右：“Backface GI” = 1。注意阴影区域接收到更多的绿色光照。]]&lt;br /&gt;
决定光线通过前面表面到达背面并被全局光照（GI）反弹的程度。这对于薄的半透明表面（如树叶）尤其有用。取值范围为 0-1。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Ambient occlusion ===&lt;br /&gt;
[[File:Image15.png|thumb|左：AO intensity = 0，右：AO intensity = 1。]]&lt;br /&gt;
一种简单的非物理环境光遮蔽（Ambient Occlusion，AO），可在最终场景光照上叠加以增强美观效果。&lt;br /&gt;
&lt;br /&gt;
* Intensity（强度）：控制 AO 效果的可见度。值为 0 时禁用该效果。&lt;br /&gt;
* Radius（半径）：决定 AO 效果使用的光线距离。较小的值产生局部遮蔽（角落、褶皱），较大的值则更类似 Skylight，从远处物体产生阴影。&lt;br /&gt;
* Samples（采样数）：影响环境光遮蔽的质量。典型值为 4 到 32。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dither transparency ===&lt;br /&gt;
通过自动抖动不透明度贴图来启用半透明阴影。[[使用手册#Opacity|了解 Bakery 如何处理不透明度贴图]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== RTX Mode ===&lt;br /&gt;
启用 RTX 硬件加速。仅 RTX 显卡可受益于此选项。最低支持的驱动版本为 418。&lt;br /&gt;
&lt;br /&gt;
驱动可以在大多数非 RTX Nvidia 显卡上模拟 RTX 模式，但通常会更慢。&lt;br /&gt;
&lt;br /&gt;
在 Ampere（3xxx）或更新的显卡上，RTX 模式 ''必须'' 启用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Export terrain trees ===&lt;br /&gt;
如果启用，绘制在地形上的树木将影响光照。树木本身不会被烘焙。请注意，在烘焙过程中，每棵树都使用最高可能的 LOD 等级。对于多公里范围且模型高度复杂的森林场景，不建议使用此选项。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Terrain optimization ===&lt;br /&gt;
如果启用（默认），地形将使用独立的光线追踪技术以利用其高程图几何结构。否则，它们将像其他普通网格一样处理。地形优化可以显著减少高分辨率地形所需的内存占用。在某些情况下，它还能加快地形烘焙速度，但在其他情况下（尤其是简单低分辨率地形）可能需要禁用该选项。&lt;br /&gt;
&lt;br /&gt;
{{note| 地形优化当前不兼容绘制的地形洞。需禁用此选项才能使其正常工作。}}&lt;br /&gt;
{{note| 地形优化仅支持非 RTX 模式。}}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Light Mesh batch limit ===&lt;br /&gt;
如果该值大于 0，会将多个 Light Mesh 合并为一个，前提是它们具有相同设置并影响相同的 Lightmap Groups，同时将它们的总采样数限制为该值（例如，如果限制为 64，则可以合并 2 个采样数为 32 的灯光，或 4 个采样数为 16 的灯光，等等）。在拥有大量 Light Mesh 的场景中，这可以提升性能。但设置过高时需小心，因为 GPU 在一次处理过多采样时可能触发操作系统驱动超时。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Compress volumes ===&lt;br /&gt;
如果启用，将对体积 3D 贴图应用纹理压缩，并将 Bakery 着色器切换到相应的采样模式。不推荐对分辨率非常低的体积使用此选项。体积大小可能会被调整为 4 的倍数。&lt;br /&gt;
&lt;br /&gt;
注意事项：&lt;br /&gt;
&lt;br /&gt;
* 目前仅支持压缩为 BC6H/BC7 纹理格式（桌面/主机平台）。&lt;br /&gt;
* 体积压缩仅支持 Unity 2020.1 或更高版本。&lt;br /&gt;
* 目前仅标准渲染管线的 Bakery 着色器支持使用压缩体积贴图。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Samples multiplier ===&lt;br /&gt;
将所有阴影和 GI 采样数乘以指定因子。可用于在草稿质量和最终质量之间快速切换。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Tile size ===&lt;br /&gt;
与 [[#GPU Priority|GPU Priority]] 相同，但这里设置的是贴图块（tile）大小。Bakery 会将光照贴图拆分为更小的块，并一次更新一个块。块越小，GPU 工作被中断的次数越多，系统响应性可能更好。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Temp path ===&lt;br /&gt;
临时文件夹。在渲染过程中，Bakery 可能需要几个 GB 的可用空间。将此文件夹放在 SSD 上相比 HDD 可略微加快渲染速度。目前，该文件夹不会自动清理。你可以随时手动删除其内容（渲染时除外），或通过 Bakery -&amp;gt; Utilities -&amp;gt; Clear cache 清理。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Output path ===&lt;br /&gt;
光照贴图文件夹。所有光照贴图，以及 lightprobe 和顶点颜色（vertex color）资源都将保存在此处。该路径相对于你的 Assets 文件夹。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Use scene named output path ===&lt;br /&gt;
如果启用此选项，输出路径将自动设置为与当前活动场景同名的文件夹（Assets/CurrentSceneName/）。这与 Unity 内置光照贴图烘焙器的行为类似。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render Selected Groups ===&lt;br /&gt;
仅烘焙包含所选对象的 Lightmap Groups。&lt;br /&gt;
不仅仅是所选对象会被重新绘制，它们所属的所有 Lightmap Groups 都会被处理。其他光照贴图不会被更新。如果对象不属于某个手动分配的组，则使用相同光照贴图的场景部分将被重新烘焙。&lt;br /&gt;
&lt;br /&gt;
目前，使用 [[Partial_scene_baking|Sectors]] 进行场景部分烘焙更为方便。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Beep on finish ===&lt;br /&gt;
如果启用，Bakery 在烘焙完成时会播放提示音。&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 (Experimental) ==&lt;br /&gt;
=== Unwrapper ===&lt;br /&gt;
如果启用 [[#Asset_UV_Processing|Adjust UV Padding]]，则定义将使用的展开器（unwrapper）。&lt;br /&gt;
&lt;br /&gt;
* Default：使用 Unity 标准展开器。Bakery 会为每个具有不同间距参数的网格调用 [https://docs.unity3d.com/ScriptReference/Unwrapping.GenerateSecondaryUVSet.html Unwrapping.GenerateSecondaryUVSet]。&lt;br /&gt;
* xatlas：使用 [https://github.com/jpcy jpcy] 的 [https://github.com/jpcy/xatlas xatlas]，这是 [https://github.com/castano Ignacio Castaño] 的 [https://github.com/Thekla/thekla_atlas thekla_atlas] 的修改版。thekla_atlas 曾用于游戏《The Witness》（[http://the-witness.net/news/2010/03/graphics-tech-texture-parameterization/ 参见博客文章]）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Atlas Packer ===&lt;br /&gt;
选择在将不同对象的 UV 布局打包到大型光照贴图集时使用的算法。&lt;br /&gt;
* Default：Bakery 在 v1.7 之前使用的原始算法。&lt;br /&gt;
* xatlas：使用 xatlas。&lt;br /&gt;
&lt;br /&gt;
某些功能仅支持特定的贴图集打包器：&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Default&lt;br /&gt;
! xatlas&lt;br /&gt;
|-&lt;br /&gt;
| [[使用手册#Bakery_Lightmap_Group_Selector|Override resolution]]&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
|-&lt;br /&gt;
| 高效 LOD 打包&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
|-&lt;br /&gt;
| [[使用手册#Hole_filling|Hole filling]]&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
请注意，贴图集打包器（Atlas Packer）也可以为每个 Lightmap Group 单独选择。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Export geometry and maps ===&lt;br /&gt;
如果启用，Bakery 会在渲染前将场景导出为其专用格式。如果你确定场景的几何体和贴图以及光照贴图分辨率设置没有改变（例如，你只是调整 GI 或光源设置），可以禁用此选项以加快下一次渲染速度。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update unmodified lights ===&lt;br /&gt;
如果启用，Bakery 会重新计算自上次渲染以来未改变的光源。如果你只是调整某个光源，不想等待其他光源重新渲染，可以禁用此选项。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update modified lights and GI ===&lt;br /&gt;
如果启用，Bakery 会重新计算自上次渲染以来发生变化的 GI 和光源。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== UV padding: increase only ===&lt;br /&gt;
仅在启用 [[#Asset_UV_Processing|Adjust UV padding]] 时可见。默认情况下，模型资源的最佳 UV 间距仅基于当前加载的场景进行计算。如果同一模型有多个实例使用不同的光照贴图分辨率，最小的分辨率将决定间距，以确保 UV 图块之间的间距足够大，防止相互重叠。然而，在两个不同的独立场景中烘焙同一模型时，为新场景优化可能会破坏之前场景中的 UV。勾选此选项可以防止这种情况发生，即永远不减小间距值，从而始终为曾经烘焙过的最低分辨率实例进行优化。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoise: fix bright edges ===&lt;br /&gt;
[[File:Image19.png|thumb|左：去噪后可见明亮边缘；右：已修复。]]&lt;br /&gt;
仅在 [[#Denoise|Denoise]] 启用时可见。有时用于去噪的神经网络可能会在阴影周围产生明亮边缘，就像应用了锐化效果一样。如果启用此选项，Bakery 会尝试将其滤除。启用后，去噪阶段可能会略微变慢。&lt;br /&gt;
&lt;br /&gt;
此功能也可用于滤除“火花”（fireflies），即光照贴图中偶尔出现的亮点。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Post-packing ===&lt;br /&gt;
有时在渲染场景时，Bakery 会将光照贴图拆分为多个子光照贴图，例如在烘焙不同 LOD 或地形时。&lt;br /&gt;
Post-packing 会尝试通过将这些子光照贴图合并到同一纹理中来最小化最终贴图集数量。&lt;br /&gt;
建议保持此选项启用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Combine with Enlighten real-time GI ===&lt;br /&gt;
如果启用，则在按下 Render 按钮时，Bakery 会首先尝试使用 Enlighten 烘焙以计算实时 GI。之后，将进行常规的 Bakery 光照贴图烘焙过程。烘焙 GI 和实时 GI 将协同工作。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bake on remote server ===&lt;br /&gt;
启用网络烘焙（[[Network baking|Network baking]]）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Presets ===&lt;br /&gt;
当前在 Experimental 模式下的 Render/Update 按钮下显示。&lt;br /&gt;
&lt;br /&gt;
* 点击 '''New''' 将所有当前设置保存到预设文件中。&lt;br /&gt;
* 默认情况下，当一个预设处于激活状态时，所有设置都会被灰显，以防止覆盖预设。&lt;br /&gt;
* 点击 '''Modify preset''' 可更改设置并覆盖预设。&lt;br /&gt;
* 可以通过预设字段切换预设。将其设置为 None 可禁用预设使用。&lt;br /&gt;
&lt;br /&gt;
== 组件 ==&lt;br /&gt;
=== Bakery Lightmap Group Selector ===&lt;br /&gt;
指定对象及其所有子对象使用的 '''Lightmap Group'''。&lt;br /&gt;
Lightmap Group 是 Bakery 用来表示共享同一光照贴图的对象集合的术语。每个组都有属性，告诉 Bakery 如何打包对象、哪些光源影响它们，以及结果是烘焙到纹理还是顶点。&lt;br /&gt;
&lt;br /&gt;
默认情况下，所有静态对象会自动打包到多个光照贴图组（贴图集）中，因此通常无需手动管理。手动定义组仅用于特殊用途，例如：&lt;br /&gt;
&lt;br /&gt;
* 指定某些对象使用 [[Vertex Lightmaps|每顶点光照贴图]] 而非纹理。&lt;br /&gt;
* 使用建模软件中的原始未缩放 UV 烘焙光照贴图。&lt;br /&gt;
* 将关卡的特定区域分组以使用单张光照贴图，从而便于资源流式加载或通过脚本在运行时切换不同的烘焙光照。&lt;br /&gt;
* 使用 Render Selected Groups 按钮仅更新已分组的对象。&lt;br /&gt;
&lt;br /&gt;
要手动定义组，可以创建 '''Lightmap Group Assets'''，方法包括使用 Assets-&amp;gt;Create 菜单，或在组件中使用 Create New 按钮。使用 Create New 按钮时，将根据以下表单创建新的资源：&lt;br /&gt;
&lt;br /&gt;
* Name：要创建的 Lightmap Group 资源的名称。&lt;br /&gt;
* Packing Mode：此选择器定义 Lightmap Group 的打包模式，共有 3 种模式：&lt;br /&gt;
** Original UV：对象及其子对象将使用未修改的 UV 进行烘焙，不执行打包。适用于多个网格共享同一已打包 UV 布局的模型。&lt;br /&gt;
** Pack Atlas：对象及其子对象将打包到专用纹理贴图集中。在 v1.3 之前，每个可打包的子对象都需要有此组件，但现在不再需要。每个子对象将作为单独矩形打包，除非 Bakery 自动检测到子对象有非重叠的子对象，在这种情况下，多个对象可以使用同一个矩形。&lt;br /&gt;
** Vertex：对象及其子对象将使用顶点色烘焙光照而非纹理。注意，需要使用自定义着色器才能生效，例如 [[#Bakery_shaders|Bakery Shader]]。文档中也提供了一个简单的着色器（“Bakery/Simple Vertex Lightmapped”）用于演示和参考。[[Vertex Lightmaps|了解更多关于顶点光照贴图的信息]]。&lt;br /&gt;
* Directional mode：允许你覆盖该组的 [[#Directional mode|directional mode]]。选项与全局相同，Auto 将使用全局设置。&lt;br /&gt;
* Resolution：所需的光照贴图分辨率。&lt;br /&gt;
* Auto-resolution：使用 [[使用手册#Texels_per_unit|Texels Per Unit]] 来确定最接近的二次幂分辨率。&lt;br /&gt;
* Atlas packer：为该组选择 [[使用手册#Atlas_Packer|贴图集打包]] 算法。&lt;br /&gt;
* Bitmask：用于排除光源影响光照贴图的开关列表。每个 Bakery 光源也有一个位掩码设置。光源只会影响与其共享至少一个开关的 Lightmap Group。默认设置意味着所有光源影响所有光照贴图。&lt;br /&gt;
&lt;br /&gt;
[[File:Ts.jpg|thumb|Transparent selfshadow关闭 vs 开启：注意一些单面但背向的多边形如何被正确照亮。]]&lt;br /&gt;
&lt;br /&gt;
如果你有一个被分配了“Pack Atlas”模式的 Lightmap Group，组件上将会出现额外设置：&lt;br /&gt;
&lt;br /&gt;
* Override resolution：覆盖该对象及其子对象在光照贴图中占用的分辨率。&lt;br /&gt;
* Resolution：手动定义的分辨率。例如，如果你有一个分辨率为 512 的光照贴图，并且分配给 4 个对象，同时覆盖分辨率设置为 256，Bakery 将生成一个 512x512 的光照贴图，每个对象正好占据 256x256 的区域。&lt;br /&gt;
&lt;br /&gt;
如果你选择一个 Lightmap Group 资产，将会显示额外的实验性设置：&lt;br /&gt;
* [[Subsurface scattering|Subsurface scattering: (点击阅读更多)]]&lt;br /&gt;
* Normal offset：允许你将光线从表面偏移。这很少有用，主要用于实验目的。&lt;br /&gt;
* Transparent selfshadow：从表面后方发射光线，使其不会在自身投射阴影。对于半透明叶片可能有用。&lt;br /&gt;
* Vertex sampling density，(仅当 Packing Mode 设置为 Vertex 时可用）：默认情况下，每个顶点只计算一个值；如果采样密度 &amp;gt; 0，则会在三角形上分散采样并求平均，从而生成超采样、更平滑的结果。&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Lightmapped Prefab ===&lt;br /&gt;
此组件允许预制件存储光照贴图元数据。这样处理后的预制件可以在任意场景中实例化，无论是在编辑器中还是运行时。&lt;br /&gt;
该组件应直接添加到预制件的根对象上。不支持嵌套预制件。由于预制件在烘焙后会被覆盖（类似于按下“Apply”按钮的效果），因此要求预制件没有任何未应用的更改（子对象不应移动，材质和脚本参数应保持不变等）。如果检测到此类更改，组件界面会显示错误，烘焙后不会保存任何元数据。如果启用了 [[#Warnings|Lightmapped prefab validation]] 警告，所有预制件错误也会在烘焙前以对话框形式显示。&lt;br /&gt;
&lt;br /&gt;
光照贴图预制件支持所有 Bakery 功能，例如 LOD、地形、方向光贴图、RNM、SH、顶点模式和 Shadowmask。要使 Shadowmask 生效，光源也必须是同一预制件的一部分。&lt;br /&gt;
&lt;br /&gt;
{{note| 注意，由于 API 限制，预制件 Shadowmask 仅在 Unity 2017.4 或更高版本中可用。}}&lt;br /&gt;
&lt;br /&gt;
烘焙后，一个名为 “BakeryPrefabLightmapData” 的对象会被添加到预制件中。该对象包含一个脚本，存储应用光照贴图所需的所有数据。&lt;br /&gt;
&lt;br /&gt;
此外，光照贴图预制件允许保存当前渲染设置，并使用两个按钮将其加载回任意已打开的场景：&lt;br /&gt;
&lt;br /&gt;
* Save current render settings to prefab：在该预制件上存储当前渲染设置的副本。&lt;br /&gt;
* Load render settings from prefab：将当前渲染设置设置为预制件中存储的设置。&lt;br /&gt;
  [[File:Upload 2019-9-17 10-32-34.png|thumb|应用预制件]]&lt;br /&gt;
&lt;br /&gt;
烘焙光照贴图预制件时，建议检查：&lt;br /&gt;
&lt;br /&gt;
* 预制件已“应用”。在旧版 Unity 中，点击 Inspector 右上角的 “Apply” 按钮。在新版 Unity 中，点击 “Overrides” 列表，然后选择 “Apply All”。&lt;br /&gt;
* 预制件组件 UI 不显示任何错误。&lt;br /&gt;
* [推荐] 在主窗口启用 “Lightmapped prefab validation” 复选框。点击 Render 时不会显示任何关于预制件的警告对话框。&lt;br /&gt;
&lt;br /&gt;
{{note| 光照贴图以其烘焙所在的场景或所使用的 Lightmap Group 命名（如果有）。在同一场景中烘焙不同预制件时，请确保使用不同命名的 [[使用手册#Bakery_Lightmap_Group_Selector|Lightmap Group]] 或更改 [[使用手册#Output_path|输出路径]]。}}&lt;br /&gt;
&lt;br /&gt;
{{note| 当使用相同模型逐个烘焙多个预制件时，建议将 [[使用手册#Asset_UV_Processing|Asset UV Processing]] 设置为“Don't Change”，以防止修改共享模型的 UV。}}&lt;br /&gt;
&lt;br /&gt;
{{note| Bakery 的预制件工作流程是在 Unity 提供“预制件双击进入视图”功能之前实现的。因此，在隔离预制件视图中光照贴图可能无法正确应用，组件可能显示 “This GameObject is not a prefab” 信息。但在普通场景中使用时应能正常工作。}}&lt;br /&gt;
&lt;br /&gt;
{{note| 当解包已烘焙的预制件并取消与现有光照贴图的关联时，请确保删除保存预制件范围光照贴图/渲染器连接的 BakeryPrefabLightmapData 对象。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Direct Light ===&lt;br /&gt;
[[File:Directlight.jpg|thumb|纯直射光 + GI]]&lt;br /&gt;
[[File:Image4.png|thumb|左：“Shadow Spread” = 0.01，右：0.05。注意阴影从锐利逐渐变模糊的效果。]]&lt;br /&gt;
无限远方向光（例如太阳）。&lt;br /&gt;
&lt;br /&gt;
* Color：光的颜色。&lt;br /&gt;
* Intensity：线性色彩乘数。&lt;br /&gt;
* Shadow Spread：光源尺寸，或者简单说，阴影的模糊度。0 = 阴影最锐利，1 = 阴影最模糊。从技术上讲，它在单条光线与更宽光锥之间插值。&lt;br /&gt;
* Shadow Samples：影响阴影质量。Shadow Spread 值越小，所需样本越少即可得到干净图像。太阳阴影的典型值为 1 到 16。设置为 0 时，该光源的阴影将消失。&lt;br /&gt;
* Bitmask：用于排除此光源对特定 Lightmap Groups 影响的开关列表。&lt;br /&gt;
* Baked contribution：确定应烘焙哪类光照数据。仅在 Indirect 或 Shadowmask 模式可见。可选值：&lt;br /&gt;
** Direct and Indirect：直射光与间接光都完全烘焙。&lt;br /&gt;
** Indirect only：实时光提供直射贡献，仅烘焙间接光。&lt;br /&gt;
** Shadowmask and indirect：实时光提供直射贡献，静态几何体的阴影烘焙到单独贴图，动态与静态阴影混合。间接光正常烘焙。&lt;br /&gt;
** Direct, Indirect, Shadowmask（仅自定义光照）：与直射和间接相同，但 Shadowmask 也生成，可与自定义着色器一起使用。&lt;br /&gt;
* Denoise shadowmask：确定是否对该光源的 Shadowmask 应用去噪。通常不需要，因为阴影噪点不明显，但对非常宽且模糊的阴影（大 Shadow Spread）可能有用。&lt;br /&gt;
* Indirect intensity：非物理 GI 乘数。自然光照应为 1，可根据场景风格调整。&lt;br /&gt;
* Anti-alias：对阴影执行超采样。&lt;br /&gt;
* Texture projection：在光照上投射乘法平铺纹理，可用于模拟远处云影。&lt;br /&gt;
当设置了纹理投影时，可以使用“Tiling”和“Offset”字段调整其缩放和偏移。或者，点击 &amp;quot;Tweak projection in Scene View&amp;quot; 并使用额外的 Gizmo 可视化移动和缩放投影。点击“Render reference frame”可保存光源视角的 PNG，这对于在场景上绘制云影很有用。&lt;br /&gt;
&lt;br /&gt;
如果同一对象同时启用了 Unity 和 Bakery 光源且参数不匹配，会出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match lightmapped to real-time：将 Unity 光源的通用设置复制到 Bakery 光源。&lt;br /&gt;
* Match real-time to lightmapped：将 Bakery 光源的通用设置复制到 Unity 光源。&lt;br /&gt;
&lt;br /&gt;
{{note| 从物理角度看，Bakery 的方向光强度（Intensity）等于照度（Lux）除以 π。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Sky Light ===&lt;br /&gt;
[[File:Skylight.jpg|thumb|纯天空光与 GI]]&lt;br /&gt;
无限远的带阴影环境光（天空）。&lt;br /&gt;
&lt;br /&gt;
* Color: 颜色。&lt;br /&gt;
* Intensity: 线性色彩倍增。&lt;br /&gt;
* Sky texture: 可选的立方体贴图资源，例如 HDRI 全景图，用于从不同方向影响光照颜色。&lt;br /&gt;
  {{note| 旋转天空光的 GameObject 会相应旋转立方体贴图的光照。}}&lt;br /&gt;
* Samples: 影响阴影质量。典型值为 8 到 32。&lt;br /&gt;
* Hemispherical: 如果启用，光照仅来自上方（上半球）。否则来自所有方向。&lt;br /&gt;
* Bitmask: 用于排除此光源影响特定 Lightmap Groups 的开关列表。&lt;br /&gt;
* Baked contribution: 决定应烘焙哪种光照数据。仅在 Indirect/Shadowmask 模式下可见。可能值：&lt;br /&gt;
** Direct and Indirect: 直接和间接光照都将完全烘焙。这是默认且推荐的天空光行为，因为在 Unity 中没有实时版本可以模拟它们。&lt;br /&gt;
** Indirect only: 假定实时光源提供直接贡献；仅烘焙间接光照。&lt;br /&gt;
&lt;br /&gt;
如果天空光的设置与当前场景的天空盒不匹配，将出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match this light to scene skybox: 将活动天空盒材质的通用设置复制到 Bakery 天空光。当前仅支持使用 “Skybox/Cubemap” 或 “Skybox/Bakery skybox” 着色器的天空盒。&lt;br /&gt;
* Match scene skybox to this light: 将 Bakery 天空光的通用设置复制到场景天空盒。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bakery Light Mesh ===&lt;br /&gt;
[[File:Image29.png|thumb|Left: Samples Near = 0, Samples Far = 4096.&amp;lt;br&amp;gt;&lt;br /&gt;
Middle: Samples Near = 0, Samples Far = 128.&amp;lt;br&amp;gt;&lt;br /&gt;
Right: Samples Near = 16, Samples Far = 128.&amp;lt;br&amp;gt;&lt;br /&gt;
请注意，光照效果看起来相似，但使用的合并采样数量更少。]]&lt;br /&gt;
任何形状的自发光网格。应与 Mesh Renderer 组件或设置为 Area 模式的 Light 组件一起使用。&lt;br /&gt;
&lt;br /&gt;
* Color：颜色&lt;br /&gt;
* Intensity：线性颜色倍增器&lt;br /&gt;
* Cutoff：最大光照距离。Bakery 会在接近该限制时额外衰减正确的平方反比衰减。当 Cutoff 值刚好对应物理衰减变得非常暗的位置时效果最佳。Cutoff 可提升烘焙性能，也可以设置为非常高（不可达）的值以保证完全正确性。&lt;br /&gt;
* Self Shadow：决定光源网格自身是否投射阴影。此选项同时启用更精确的光照算法。&lt;br /&gt;
* Samples Near：影响靠近网格的光照质量。典型值为 16 到 64，仅当 Self Shadow 开启时可用。&lt;br /&gt;
* Samples Far：影响远离网格的光照质量。典型值为 4 到 4096。&lt;br /&gt;
&lt;br /&gt;
Bakery 基于光源表面距离混合两种不同的区域光算法。靠近光源时，算法类似 GI，而远处光源被近似为虚拟点光云。&lt;br /&gt;
&lt;br /&gt;
{{note| &amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;光源网格自身不会接收光照，也不会被烘焙到光照贴图中。&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;一个拥有大量多边形的光源网格比烘焙多个简单的光源网格要快&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;如果结果总是脏/噪点较多，可以尝试将 Samples Near 设置为 0，这样只使用 VPL 算法。对于不需要精度的简单光源（如建筑物的窗户光），这也非常有用。&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;}}  &lt;br /&gt;
[[File:Dd99d-QU0AEKFBK.jpg|thumb|弯曲的光源网格]]  &lt;br /&gt;
* Bitmask：用于排除此光源影响特定 Lightmap Groups 的开关列表。  &lt;br /&gt;
* Baked contribution：决定烘焙哪种类型的光照数据。仅在 Indirect 或 Shadowmask 模式下可见。可能的值：  &lt;br /&gt;
** Direct and Indirect：完全烘焙直接和间接光贡献。这是默认且推荐的光源网格行为，因为 Unity 中没有实时版本可以模拟它们。  &lt;br /&gt;
** Indirect only：实时光源提供直接光贡献，仅烘焙间接光。  &lt;br /&gt;
** Shadowmask and Indirect：实时光源提供直接光贡献，但静态几何体的阴影会烘焙到单独的贴图。动态和静态阴影将混合在一起。间接光照将照常烘焙。目前仅 HDRP（和自定义渲染器）支持混合区域光。  &lt;br /&gt;
** Direct, Indirect, Shadowmask (custom lighting only)：与 Direct and Indirect 相同，但同时生成 Shadowmask 并分配用于自定义着色器。  &lt;br /&gt;
* Indirect intensity：非物理 GI 倍增器。自然光照应设为 1，但可修改以实现更风格化的场景。  &lt;br /&gt;
* Shadowmask with falloff：将完整光衰减烘焙进 Shadowmask（仅对自定义着色器有用）。  &lt;br /&gt;
&lt;br /&gt;
如果网格材质和光源设置不匹配，将出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match light to material：将网格材质或区域光的通用设置复制到 Bakery 光源。&lt;br /&gt;
* Match material to light：将 Bakery 光源的通用设置复制到网格材质或区域光。&lt;br /&gt;
&lt;br /&gt;
==== Light Mesh 与自发光材质的区别 ====&lt;br /&gt;
自发光材质：&lt;br /&gt;
&lt;br /&gt;
* 在 GI 计算中传播光线，因此是“免费的”，无论有多少网格是自发光的。&lt;br /&gt;
* 小而明亮的光可能会产生不准确或有噪点的结果，这取决于 GI 的采样数量。&lt;br /&gt;
* 由于 Bakery 中 GI 的工作方式，它必须占用光照贴图空间，因此可能会浪费空间。同时，这意味着自发光对象需要有效的 UV，并且必须启用“投射阴影”。&lt;br /&gt;
&lt;br /&gt;
Light Mesh：&lt;br /&gt;
&lt;br /&gt;
* 光照会为每个光源单独计算，因此比自发光材质慢。&lt;br /&gt;
* 设计用于为小而明亮的光提供干净的光照效果，即使距离很远也能保持效果。&lt;br /&gt;
* 不占用光照贴图空间。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Point Light ===&lt;br /&gt;
[[File:Image11.png|thumb|左：“Shadow Spread” = 0.5，右：“Shadow Spread” = 1。]]&lt;br /&gt;
点光源，没有面积。尽管在物理上不可能，但在游戏中很有用，并且是匹配 Unity 点光源和聚光灯的唯一方式。&lt;br /&gt;
{{note| 聚光灯只是带有额外投影遮罩的点光源。}}&lt;br /&gt;
&lt;br /&gt;
* Color: 颜色&lt;br /&gt;
* Intensity: 线性色彩倍增&lt;br /&gt;
* Shadow spread: 阴影模糊度。虽然点光源没有面积，但通常希望它仍能产生模糊阴影。为此，阴影被模拟为从球形区域光源投射。此参数定义了虚拟球体的半径，直接影响阴影模糊度。&lt;br /&gt;
* Physical falloff: 如果启用，将使用正确的平方反比衰减，并在边界附近额外衰减。否则将尝试模拟 Unity 的衰减。&lt;br /&gt;
* Falloff min size: 详见 [[Point Light Attenuation]] 部分。&lt;br /&gt;
* Range: 如果物理衰减被禁用，则等于 Unity 的光源范围；如果启用，只会在边缘轻微衰减物理衰减。&lt;br /&gt;
* Samples: 影响阴影质量。典型值为 1 到 512。设置为 0 将使该光源的阴影消失。&lt;br /&gt;
  [[File:Image10.png|thumb|从左到右：Omni，Cookie（默认聚光灯纹理），Cubemap，IES。]]&lt;br /&gt;
* Projection mask: 遮罩/Cookie 类型。选项：&lt;br /&gt;
** Omni: 无遮罩，相当于 Unity 的点光源。&lt;br /&gt;
** Cookie: 纹理投影遮罩。附加选项：&lt;br /&gt;
*** Cookie texture: 2D 纹理资源。Bakery 包含原始 Unity 聚光灯纹理（名为 ftUnitySpotTexture），可用于模拟。&lt;br /&gt;
*** Angle: 纹理投影角度（类似 Unity 聚光灯）。&lt;br /&gt;
*** Correct distortion: 修正宽角下直线可见的 cookie 失真。&lt;br /&gt;
** Cubemap: 立方体贴图投影遮罩。附加选项：&lt;br /&gt;
*** Projected cubemap: 立方体贴图资源。&lt;br /&gt;
** IES: 光照由 IES 文件数据调制。附加选项：&lt;br /&gt;
*** IES file: .ies 扩展名文件。&lt;br /&gt;
* Bitmask: 用于排除该光源影响特定 Lightmap Groups 的开关列表。&lt;br /&gt;
* Baked contribution: 决定应烘焙哪种类型的光照数据。仅在 Indirect 或 Shadowmask 模式下可见。可能值：&lt;br /&gt;
** Direct and Indirect: 直接光和间接光完全烘焙。&lt;br /&gt;
** Indirect only: 实时光提供直接光，仅烘焙间接光。&lt;br /&gt;
** Shadowmask and Indirect: 实时光提供直接光，但静态几何体阴影烘焙到单独贴图中，动态和静态阴影混合，间接光正常烘焙。&lt;br /&gt;
** Direct, Indirect, Shadowmask (custom lighting only): 与 Direct and Indirect 相同，同时生成 Shadowmask 用于自定义着色器。&lt;br /&gt;
* Indirect intensity: 该光的非物理 GI 倍增。自然光应为 1，可根据风格化场景修改。&lt;br /&gt;
* Shadowmask with falloff: 将完整光衰减（除距离外）烘焙到 Shadowmask（仅自定义着色器有用）。&lt;br /&gt;
* Legacy sampling: 使用 Bakery 原始更偏置的阴影采样策略。产生无噪点阴影，但宽半影可能出现条纹。禁用后使用无偏但更有噪点的技术。&lt;br /&gt;
&lt;br /&gt;
如果同一对象同时启用了 Unity 和 Bakery 光源，且设置不匹配，则会出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match lightmapped to real-time: 将 Unity 光的常用设置复制到 Bakery 光。&lt;br /&gt;
* Match real-time to lightmapped: 将 Bakery 光的常用设置复制到 Unity 光。&lt;br /&gt;
&lt;br /&gt;
{{note| 从物理角度来看，Bakery 点光源的“Intensity”为 Candela 除以 Pi。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Volume ===&lt;br /&gt;
[[File:Voldemo notlonely.gif|由 BakeryVolume 照亮的动态门（动态 GIF，由 NOTLonely 制作）]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
体积（Volumes）生成存储每个体素光探针的 3D 纹理（L1 球面调和和阴影贴图），使其成为常规 Unity 光探针的可行替代方案。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Unity Light Probes&lt;br /&gt;
! Unity LPPV&lt;br /&gt;
! Bakery Volumes&lt;br /&gt;
|-&lt;br /&gt;
| 手动放置每个光探针&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 否&lt;br /&gt;
|-&lt;br /&gt;
| 在一个物体上插值多个光探针&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 运行时可移动&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 可以放入预制件&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 完整脚本 API&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| “Ringing” 伪影&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 可能出现&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 可能出现&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 已修正&lt;br /&gt;
|-&lt;br /&gt;
| 去噪&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 运行时开销&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | CPU：低开销；GPU：低开销&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | CPU：中等开销；GPU：中等开销&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#e4ead3;&amp;quot; | CPU：无开销；GPU：中等开销&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bakery Volume 是一个与一组 3D 纹理（3 个 SH 纹理和一个可选的 shadowmask）关联的边界盒，使其非常易于使用和编程。Volumes 可以在运行时轻松地交换、移动、加载或卸载，也可以与预制件关联。它们不需要任何 Light Probe Groups 或手动探针布置；整个 Volume 都由均匀的探针体素网格填充。光/影泄漏会自动像处理光照贴图一样修复（尽管对于较大的体素尺寸，薄的双面墙可能会出现问题，但可以通过在不同侧使用不同 Volume 避免）。由于体素网格的均匀特性，也可以对其应用类似光照贴图的降噪，这是常规光探针无法做到的。此外，Bakery 着色器使用 [https://drive.google.com/file/d/1MK6Clw93q8ljijRjb4gQOzzaIjn1uF9Y/view Geomerics] 采样技巧，完全消除了高对比度 HDR 光照下 SH 有时会产生的 “ringing” 伪影。&lt;br /&gt;
&lt;br /&gt;
因此，Volumes 可以为动态物体生成干净、精细、高质量的烘焙光照（即来自静态物体并影响动态物体的光照，而不是相反）。&lt;br /&gt;
&lt;br /&gt;
Volume 方法的唯一缺点是每像素着色开销较高。其开销类似于 LPPV（随着屏幕上受体素影响的像素数量而缩放），但与 LPPV 不同的是，一旦烘焙完成，Volumes 本身不会再更新。多个 Volume 的混合可以通过稍微重叠它们来避免。&lt;br /&gt;
&lt;br /&gt;
====设置 Volume 变换====&lt;br /&gt;
[[File:Bvolgizmo.jpg|thumb|Volume 控制柄]]&lt;br /&gt;
当 BakeryVolume 被添加到一个 GameObject 时，场景视图中会出现一个边界盒控制柄。拖动小方块即可缩放它。&lt;br /&gt;
&lt;br /&gt;
还有其他方法可以更改 Volume 的大小和位置：&lt;br /&gt;
&lt;br /&gt;
* 将任何可渲染的 GameObject 拖入 “Wrap to object” 字段。Volume 会包裹该对象（及其子对象），以将它们完全包含在内。&lt;br /&gt;
* 如果同一个对象上添加了 Box Collider，则会出现 “Set from box collider” 和 “Set to box collider” 按钮。可以用它们快速在 Volume 和 Collider 之间复制数值。&lt;br /&gt;
&lt;br /&gt;
====分辨率====&lt;br /&gt;
当启用 “Adaptive resolution” 时，体素数量由 “Voxels per unit” 控制。禁用它可以手动输入分辨率。对于大多数 1 单位 = 1 米 的游戏来说，一个合理的 “Voxels per unit” 值是 2，但在某些情况下（例如动态门）使用较小但更高分辨率的 Volume 会更有利。&lt;br /&gt;
&lt;br /&gt;
====其他设置====&lt;br /&gt;
&lt;br /&gt;
* Enable baking: 是否需要（重新）计算 Volume？禁用可防止覆盖已有数据。&lt;br /&gt;
* Denoise: 在烘焙 Volume 后应用去噪。推荐用于高分辨率 Volume。避免用于覆盖许多光源的低分辨率 Volume，因为去噪器难以区分实际内容和噪声。&lt;br /&gt;
* Global: 自动将此 Volume 分配给所有兼容 Volume 的 Shader，除非它们有覆盖设置。内部会调用 Shader.SetGlobalTexture()/SetGlobalVector()。&lt;br /&gt;
====使用方法====&lt;br /&gt;
Volumes 可以分配给使用 Volume 感知 Shader 的对象。Bakery 自带实现该功能的 “Bakery Standard” Shader，以及 HDRP 和 URP 的 Shader 图。请查看 example_volumes 场景，了解应用 Volume 的各种方式。&lt;br /&gt;
&lt;br /&gt;
====提示====&lt;br /&gt;
&lt;br /&gt;
* 确保查看示例。&lt;br /&gt;
* 如果两个 Volume 相连，让它们略微重叠。重叠大小应等于最大动态对象的尺寸。这样在运行时简单切换 Volume 就能正常工作。&lt;br /&gt;
* 仅在动态对象实际可达的区域放置 Volume。例如，使用玩家高度限制 Volume 的高度。&lt;br /&gt;
&lt;br /&gt;
====旋转 Volumes====&lt;br /&gt;
如果启用 “Rotate around Y” 选项，Volumes 可以绕 Y 轴旋转。旋转开销非常低，只使用 2 个额外的浮点数据（预计算的角度 sin/cos）。&lt;br /&gt;
&lt;br /&gt;
还可以在运行时旋转 Volumes（Experimental -&amp;gt; “Support rotation after bake” 以及 Bakery Shader 中的类似选项），这种情况下 Volume 必须在初始旋转为零时进行烘焙。&lt;br /&gt;
&lt;br /&gt;
在 URP 中，这种动态旋转可以与 `BakeryURPVolumeGraphRotatable.shadergraph` 一起使用。&lt;br /&gt;
&lt;br /&gt;
对于全局 Volume，动态旋转会在组件被（重新）启用或调用 `volume.SetGlobalParams()` 时更新。使用局部旋转 Volume 时，需要手动在材质或 MaterialPropertyBlock 上设置旋转：&lt;br /&gt;
{{code|&amp;lt;nowiki&amp;gt;SetMatrix(&amp;quot;_VolumeMatrix&amp;quot;, volume.GetMatrix())&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
====技术信息====&lt;br /&gt;
Volumes 可以自动工作（查看示例场景），也可以通过脚本控制其使用方式。&lt;br /&gt;
&lt;br /&gt;
可以通过组件的以下公共属性获取 Volume 数据：&lt;br /&gt;
&lt;br /&gt;
* `bakedTexture0`：存储 L0 RGB 系数和 L1 Z 红色通道在 alpha 中。&lt;br /&gt;
* `bakedTexture1`：存储 L1 X RGB 系数和 L1 Z 绿色通道在 alpha 中。&lt;br /&gt;
* `bakedTexture2`：存储 L1 Y RGB 系数和 L1 Z 蓝色通道在 alpha 中。&lt;br /&gt;
* `bakedMask`：存储体积阴影遮罩。&lt;br /&gt;
* `bounds`：Volume 的包围盒。&lt;br /&gt;
&lt;br /&gt;
所有 `bakedTexture*` 使用 RGBAHalf（每体素 8 字节）格式，mask 使用 ARGB32（每体素 4 字节）。阴影遮罩也可以使用单通道 R8 格式（每体素 1 字节）。&lt;br /&gt;
&lt;br /&gt;
因此 Volume 的字节大小 = width * height * depth * 3 * 8 + （仅当使用阴影遮罩时）width * height * depth * 4（或使用 R8 mask 时为 width * height * depth）。&lt;br /&gt;
&lt;br /&gt;
[[使用手册#Compress_volumes|可以对 Volume 启用纹理压缩]]，使其体积显著减小。&lt;br /&gt;
&lt;br /&gt;
采样 Volume 需要特殊 Shader，这些 Shader 已包含在 Bakery 中。要在自定义 Shader 中添加 Volumes，请查看 HDRP/URP 包中包含的 `BakeryVolume_float()` 函数（位于 `BakeryDecodeLightmap.hlsl`）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Light Filter ===&lt;br /&gt;
[[File:Output optimized.gif|彩色玻璃，如在 &amp;quot;Bakery Real-Time Preview&amp;quot; 中所见。Bakery lightmapper 烘焙出的结果相同。]]&lt;br /&gt;
&lt;br /&gt;
将渲染器标记为光过滤器（Light Filter）。过滤器会用其颜色着色所有直接和间接光线，类似于现实中的光学滤镜，从而实现彩色透明效果（例如彩色玻璃）。唯一的参数是用于着色的纹理。&lt;br /&gt;
&lt;br /&gt;
* 光过滤器对象仍然会像其他对象一样接收光照贴图。&lt;br /&gt;
* 过滤器不会散射或模糊光线（如需此效果，请尝试 [[Subsurface_scattering|Subsurface Scattering]] 或 [[使用手册#Backface_GI|Backface GI]]）。&lt;br /&gt;
* 过滤器可以产生带颜色的阴影。如果灯光使用 [[使用手册#Shadowmask|Shadowmask]] 模式，则结果只会保存 R 通道（因为 Unity 仅支持单通道遮罩）。对于完全烘焙的阴影，则没有限制。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Sector ===&lt;br /&gt;
参见 '''[[Partial_scene_baking|Partial scene baking]]'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Always Render ===&lt;br /&gt;
如果添加到一个物体上，Bakery 在烘焙时将始终考虑该物体，即使它的 Renderer 被禁用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
=== Bakery Pack As Single Square ===&lt;br /&gt;
如果添加到一个物体上，Bakery 会将该物体及其子物体的 UV 视为单个组合方块，在自动图集打包或 Lightmap Group 的 Pack Atlas 模式下，它们之间永远不会被移动。整个子层级将作为一个整体打包。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
=== Bakery Shared LOD UV ===&lt;br /&gt;
如果添加到一个 LODGroup 上，将标记所有同名 LOD 共享同一个光照贴图。默认情况下，每个 LOD 网格会获得独立的光照贴图，占用图集空间；但如果已知同一个物体的 LOD 拥有相似的 UV2（或者在没有 UV2 且 UV1 不重叠的情况下），它们可以映射到图集的同一部分，从而节省内存。&lt;br /&gt;
这种技术也称为 [https://github.com/laurenth-personal/LODLightmapScripts/ Lightmap Stealing]。&lt;br /&gt;
&lt;br /&gt;
= 材质兼容性 =&lt;br /&gt;
&lt;br /&gt;
=== 漫反射和发光 ===&lt;br /&gt;
Bakery 利用 [https://docs.unity3d.com/Manual/MetaPass.html Meta Pass] 系统支持大多数 Unity 材质。所有内置、Surface、URP 和 HDRP 着色器都已经定义了正确的 Meta Pass。&lt;br /&gt;
&lt;br /&gt;
如果你使用的是 Unlit 着色器，需要按照 Unity 文档手动添加 Meta Pass。&lt;br /&gt;
&lt;br /&gt;
如果未定义该 Pass，Bakery 将假定 {{codeVar|_MainTex}}、{{codeVar|_BaseColorMap}} 或 {{codeVar|_Color}}（如果未设置纹理）为材质的漫反射（Albedo），并将 {{codeVar|_EmissionMap}} 和 {{codeVar|_EmissionColor}} 作为发光颜色。&lt;br /&gt;
&lt;br /&gt;
为了使发光生效，[https://docs.unity3d.com/ScriptReference/Material-globalIlluminationFlags.html Material.globalIlluminationFlags] 必须设置为 [https://docs.unity3d.com/ScriptReference/MaterialGlobalIlluminationFlags.BakedEmissive.html MaterialGlobalIlluminationFlags.BakedEmissive]。标准着色器会自动设置此值。&lt;br /&gt;
&lt;br /&gt;
=== 不透明度 ===&lt;br /&gt;
[[File:Upload 2019-1-25 0-4-30.png|thumb|材质参数被转换为 Cutout（默认）]]&lt;br /&gt;
[[File:Alphacombos dither.jpg|thumb|通过“Dither Transparency”选项添加半透明值]]&lt;br /&gt;
[[File:Alphacombos filter.jpg|thumb|Light Filter 组件用于红色平面，生成彩色阴影]]&lt;br /&gt;
&lt;br /&gt;
默认情况下，Bakery 始终从 {{codeVar|_MainTex}}、{{codeVar|_BaseColorMap}} 或 {{codeVar|_BaseMap}} 的 alpha 值获取全分辨率的不透明度，并将其视为 Cutout（1 位透明）。&lt;br /&gt;
&lt;br /&gt;
当启用 '''Dither Transparency''' 选项时，半透明值会自动转换为可变蓝噪声，然后被滤波/模糊，产生部分透明效果（以前可以通过自定义手动抖动贴图实现，但从 v1.97 起自动完成）。&lt;br /&gt;
&lt;br /&gt;
为了使不透明度生效，着色器的 [https://docs.unity3d.com/Manual/SL-SubShaderTags.html RenderType 标签] 必须为以下值之一：&lt;br /&gt;
&lt;br /&gt;
* {{codeVar|Transparent}}&lt;br /&gt;
* {{codeVar|TransparentCutout}}&lt;br /&gt;
* {{codeVar|TreeLeaf}}&lt;br /&gt;
&lt;br /&gt;
如果存在名为 {{codeVar|_Cutoff}} 的属性，它将影响 Cutout（因此 Standard 着色器的 Cutoff 滑块会自动生效）。&lt;br /&gt;
&lt;br /&gt;
在没有 Dither Transparency 的情况下，如果材质 RenderType 为 {{codeVar|Transparent}} 或 {{codeVar|TreeLeaf}}，则 {{codeVar|_Color}} 的 alpha 值会额外修改 Cutoff：&lt;br /&gt;
''finalCutoff = 1 - (1 - cutoff) * alpha''&lt;br /&gt;
&lt;br /&gt;
对于彩色透明效果，请使用 [[Manual#Bakery_Light_Filter|Light Filter]] 组件。&lt;br /&gt;
&lt;br /&gt;
有关漫反射半透明效果，请参考 [[#Backface GI|Backface GI]] 和 [[subsurface scattering]]。&lt;br /&gt;
&lt;br /&gt;
==== Alpha Meta Pass ====&lt;br /&gt;
从 v1.9 起，Bakery 还支持指定基于自定义着色器的透明度，但这需要使用兼容的着色器。要使用 ''Alpha Meta Pass''，需要执行以下步骤：&lt;br /&gt;
&lt;br /&gt;
* 在着色器中添加一个名为 '''BAKERY_META_ALPHA_ENABLE''' 的属性。例如：&lt;br /&gt;
  {{code|&amp;lt;nowiki&amp;gt;[HideInInspector] BAKERY_META_ALPHA_ENABLE (&amp;quot;Enable Bakery alpha meta pass&amp;quot;, Float) = 1.0&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
* 确保 RenderType 标签设置为上文提到的某个值。&lt;br /&gt;
* 声明一个名为 '''META_BAKERY''' 的 Pass。&lt;br /&gt;
* 在该 Pass 中检查 '''unity_MetaFragmentControl.w''' 是否非零，如果是，则返回计算出的透明度值。&lt;br /&gt;
&lt;br /&gt;
示例可参考包内的 ''Baked_Alpha_meta.shader''。&lt;br /&gt;
&lt;br /&gt;
注意：当前 Alpha Meta Pass 需要将 Light Probe Mode 设置为 L1 或 L2。&lt;br /&gt;
&lt;br /&gt;
=== Normal mapping ===&lt;br /&gt;
自定义表面法线可以与 [[#Baked Normal Maps|烘焙法线贴图]] 模式一起使用。不幸的是，Unity 的 Meta Pass 默认不输出法线信息，因此默认情况下，法线取自名为 {{codeVar|_BumpMap}} 的贴图，并通过 {{codeVar|_MainTex_ST}} 进行额外变换。&lt;br /&gt;
&lt;br /&gt;
然而，可以制作完全自定义的着色器，带有高级法线映射功能（例如混合多层法线），并使其兼容烘焙。要实现这一点，需要执行以下步骤：&lt;br /&gt;
&lt;br /&gt;
1. 在着色器中定义一个 Meta Pass，具体方法请参考 [https://docs.unity3d.com/Manual/MetaPass.html#ExampleMetaPassUnity 文档]。&lt;br /&gt;
&lt;br /&gt;
2. 将该 Pass 命名为 {{codeVar|&amp;quot;META_BAKERY&amp;quot;}}，而不仅仅是 {{codeVar|&amp;quot;META&amp;quot;}}。&lt;br /&gt;
&lt;br /&gt;
3. 包含文件 {{codeVar|&amp;quot;BakeryMetaPass.cginc&amp;quot;}}。&lt;br /&gt;
&lt;br /&gt;
4. 添加 {{codeVar|#pragma vertex vert_bakerymt}}。&lt;br /&gt;
&lt;br /&gt;
5. 如果 {{codeVar|unity_MetaFragmentControl.z}} 变量不为 0，着色器应返回世界空间法线。返回的法线应使用 {{codeVar|BakeryEncodeNormal}} 函数编码。&lt;br /&gt;
&lt;br /&gt;
在 Assets/Bakery/examples/shaders 中包含了两个实现了扩展 Meta Pass 的示例着色器。&lt;br /&gt;
&lt;br /&gt;
你也可以复制并修改 BakeryMetaPass.cginc 以满足你的需求，例如从顶点着色器传递额外数据。&lt;br /&gt;
&lt;br /&gt;
=== 正/背面 ===&lt;br /&gt;
无论着色器使用何种剔除模式，Bakery 都将所有背面视为不透明，这意味着任何直接光线都不会穿过背面，就像它不会穿过正面一样。&lt;br /&gt;
然而，如果使用 [[使用手册#Backface_GI|Backface GI]]，背面可以部分发出正面接收到的光照。&lt;br /&gt;
&lt;br /&gt;
= 扩展 Lightmap Parameters 资源 =&lt;br /&gt;
[[File:Lp.jpg|thumb|扩展 Lightmap Parameters]]&lt;br /&gt;
类似于 Bakery 的 [[#Bakery_Lightmap_Group_Selector|Lightmap Group]]，Unity 也有 [https://docs.unity3d.com/Manual/class-LightmapParameters.html Lightmap Parameters]，可以作为资源创建并分配给 Mesh Renderer。它们的逻辑有相似之处也有不同之处：&lt;br /&gt;
&lt;br /&gt;
* Lightmap Group 的主要用途是将多个对象组合到同一个图集。此外，它还允许覆盖该图集的烘焙设置。&lt;br /&gt;
* Lightmap Parameters 主要用于覆盖对象的烘焙设置，但通过使用“Baked Tag”选项，它们也可以影响打包：具有不同 Baked Tag 的对象将永远不会共享同一个图集。&lt;br /&gt;
&lt;br /&gt;
由于有些用户更习惯 Lightmap Parameters 的工作流程，Bakery 现在支持并扩展了它们：&lt;br /&gt;
&lt;br /&gt;
* Bakery 会遵循 Baked Tag 设置。&lt;br /&gt;
* Lightmap Parameters UI 中将显示额外的 Bakery 特定选项。有关其含义，请参考 [[#Bakery_Lightmap_Group_Selector|Lightmap Group]] 部分。&lt;br /&gt;
&lt;br /&gt;
= 项目设置 =&lt;br /&gt;
一些全局设置可以在 Project Settings -&amp;gt; Bakery GPU Lightmapper 中调整（此选项仅在 Unity 2018.3 或更新版本可见；旧版本请编辑 BakeryProjectSettings.asset）：&lt;br /&gt;
&lt;br /&gt;
* Mipmap lightmaps：启用光照贴图的 mipmap。随着图集变小，可能会导致 UV 图块之间的泄漏；另一方面，它可以减少远处高分辨率光照贴图的锯齿。总体上，建议对非常远的物体使用单独烘焙的 LOD 以及较低分辨率的光照贴图。&lt;br /&gt;
* Color file format：常规 HDR 颜色光照贴图的文件格式。可选值：&lt;br /&gt;
**HDR：Radiance HDR 格式（默认）。可用多种图像编辑器打开。&lt;br /&gt;
**Asset：Unity 原生格式。可自定义 mipmap 数量。&lt;br /&gt;
* Mask/Direction file format：额外 LDR 地图的格式，如阴影遮罩或方向数据。可选值：&lt;br /&gt;
**TGA：8 位 Targa（默认）。&lt;br /&gt;
**PNG：8 位 PNG。通常比 TGA 占用更少磁盘空间。&lt;br /&gt;
**Asset：Unity 原生格式。可自定义 mipmap 数量。&lt;br /&gt;
* Compress lightmaps：定义光照贴图资源的压缩行为。压缩光照贴图占用更少的显存，但可能会出现一些视觉伪影（例如色带或色斑），具体取决于压缩类型（移动端压缩问题请参见[[Troubleshooting#I_have_an_Android_project.2C_and_lightmaps_don.27t_look_good|此处]]）。可选值：&lt;br /&gt;
*** Compress but allow overriding asset: 新的光照贴图将在启用压缩的情况下创建。创建后，可以在 Inspector 中更改它们的压缩设置。修改后的值将在重新烘焙后保留（默认）。&lt;br /&gt;
*** Force compress: 始终压缩所有光照贴图。&lt;br /&gt;
*** Force no compress: 始终生成未压缩的光照贴图。&lt;br /&gt;
* High quality direction: 为方向贴图启用“高”质量压缩。实际格式取决于平台。例如在 PC 上，它会从 DXT1 改为 BC7，这提供了更高的质量，但 VRAM 使用量会翻倍。&lt;br /&gt;
* Texel padding (default atlas packer): 定义在使用默认 atlas 打包器时，在光照贴图 atlas 中对象 UV 布局之间添加多少空白 texel。&lt;br /&gt;
* Texel padding (xatlas packer): 同上，但在使用 xatlas 时。&lt;br /&gt;
* Alpha Meta Pass resolution multiplier: 乘以 [[Manual#Alpha_Meta_Pass|Alpha Meta Pass]] 的分辨率，使在低分辨率光照贴图烘焙时仍能实现精确的基于 Shader 的切割效果。&lt;br /&gt;
* Volume render mode: 为所有 [[Manual#Bakery_Volume|Volumes]] 使用哪种 [[Manual#Render_mode|渲染模式]]？Auto 使用当前活动的渲染模式（默认）。&lt;br /&gt;
* Delete previous lightmaps before bake: 在烘焙新光照贴图之前，实际删除该场景中所有之前渲染的光照贴图文件。&lt;br /&gt;
* Log level: 定义烘焙过程中在控制台输出的信息量。可能的值：&lt;br /&gt;
** 0: 不输出任何内容。&lt;br /&gt;
** 1: 仅输出进度信息。&lt;br /&gt;
** 2: 仅输出警告。&lt;br /&gt;
** 3: 输出全部信息。&lt;br /&gt;
* Alternative scale in lightmap: 使渲染器属性 'Scale in Lightmap' 的行为更类似于 Unity 内置的行为。&lt;br /&gt;
* Align to texture compression blocks with xatlas: 使 xatlas 将 chart 对齐到 4x4 块边界，从而获得更适合压缩的结果。&lt;br /&gt;
* Generate smooth positions: 是否应调整采样位置以防止低多边形几何体在平滑法线下产生错误阴影？在使用法线差异极大的几何体时，可在极少数情况下禁用。技术说明见 [https://ndotl.wordpress.com/2018/08/29/baking-artifact-free-lightmaps/#shadowterm 这篇文章]。&lt;br /&gt;
* Smooth positions per-triangle: 是否应按三角形决定平滑/平面位置？在使用法线差异极大的几何体时，可在极少数情况下禁用。&lt;br /&gt;
* Use 'Receive GI' values: 在渲染器上考虑 “Receive Global Illumination” 值。最初 Bakery 会忽略它。&lt;br /&gt;
* Remove ringing in Legacy light probes: 在 Legacy 模式下启用更柔和的光探针卷积，以防止高对比度区域出现伪影。&lt;br /&gt;
* Always render reflection probes: 在每次 Render/Render Light Probes 后自动渲染反射探针。&lt;br /&gt;
* Ringing removal for L2 light probes: 对 [[Manual#Light_probe_mode|L2 光探针]] 应用去振铃处理。值越高，探针光照越平滑；这种平滑可以减少 [[https://docs.unity3d.com/6000.2/Documentation/Manual/light-probes-troubleshooting.html](https://docs.unity3d.com/6000.2/Documentation/Manual/light-probes-troubleshooting.html) 振铃] 伪影（如果存在）。&lt;br /&gt;
* Put menu under Tools: 将 Bakery 菜单放入 Tools 菜单下。&lt;br /&gt;
&lt;br /&gt;
如果任何格式设置为 Asset 且启用 mipmapping，会显示额外选项：&lt;br /&gt;
&lt;br /&gt;
* Maximum mipmap count: 定义 mipmap 的最大数量。例如，设置为 2，则 8K 光照贴图仅有两个额外 mipmap：4K 和 2K。更低分辨率将被省略，从而在 mipmapping 过程中限制泄漏伪影。&lt;br /&gt;
&lt;br /&gt;
= SkinnedMeshRenderer 支持 =&lt;br /&gt;
Bakery 自 v1.65 起支持蒙皮网格 (skinned meshes)。但是，有一些限制：&lt;br /&gt;
&lt;br /&gt;
* 某些 Unity 版本不支持蒙皮网格的 UV1，并会悄无声息地忽略 “Generate lightmap UVs”。请确保场景中实际使用的网格具有 UV1，并在可能的情况下使用非重叠的 UV0；&lt;br /&gt;
* UV 填充调整在蒙皮网格上不起作用（Unity 在尝试调用 Unwrap 函数时似乎会崩溃）；&lt;br /&gt;
* 蒙皮网格不能使用每顶点光照贴图 (per-vertex lightmaps)（引擎不支持带蒙皮的 additionalVertexStreams）。&lt;br /&gt;
&lt;br /&gt;
= Shader Tweaks =&lt;br /&gt;
[[File:Image2.jpg|thumb|左：默认双线性过滤。右：双三次过滤。]]&lt;br /&gt;
[[File:Image34.jpg|thumb|左：两个阴影都已烘焙。&amp;lt;br&amp;gt;中：球形阴影为动态，另一个阴影为静态。通过相乘组合在一起。&amp;lt;br&amp;gt;右：与中间相同，但使用默认最小值组合。]]&lt;br /&gt;
&lt;br /&gt;
Bakery 提供可选的着色器修改，可以应用到 Unity 着色器上，以改善光照贴图采样并使实时光照更接近光照贴图效果。着色器调整菜单可以通过 Bakery-&amp;gt;Shader Tweaks 访问。&lt;br /&gt;
&lt;br /&gt;
这些选项会修补基础 Unity 着色器包含文件（来自 CGIncludes 文件夹），这些文件被大多数内置和第三方着色器使用。所有修改都会影响使用该版本编辑器打开的所有项目，但也可以轻松恢复。着色器调整会影响标准和表面着色器的工作方式。HDRP、URP 以及其他 SRP 不受影响。&lt;br /&gt;
&lt;br /&gt;
所有可用修改显示为按钮。点击按钮应用修改，按钮将保持按下状态。再次点击按钮即可移除修改。目前可用选项：&lt;br /&gt;
&lt;br /&gt;
{{note| 可能需要以管理员身份运行 Unity 编辑器以使 CGIncludes 修补生效}}&lt;br /&gt;
&lt;br /&gt;
* Use bicubic interpolation for lightmaps: 光照贴图将使用双三次插值代替默认双线性。此调整能很好地修复低分辨率光照贴图的许多锯齿边缘。目前仅适用于 DX11 和现代主机，其他平台仍使用双线性。&lt;br /&gt;
* Use multiplication for shadowmask: 使用相乘代替最小值组合静态和动态阴影。出于未知原因，Unity 默认使用最小值操作符，这会产生一些乘法不存在的伪影。&lt;br /&gt;
* Use physical light falloff (forward): 用更物理正确的平方反比替换实时点光/聚光灯的默认衰减。“Range” 只会在边缘略微淡出（与 Bakery 光源启用 Physical Falloff 复选框效果一致）。仅影响 Forward 渲染器。详情见 [[Point Light Attenuation]]。&lt;br /&gt;
* Use physical light falloff (deferred): 同上，但仅影响 Deferred 渲染器。&lt;br /&gt;
&lt;br /&gt;
'''衰减调整在 Unity &amp;gt;2017 版本上可能无法完全生效。此外，SRP 默认已经使用正确的衰减。'''&lt;br /&gt;
&lt;br /&gt;
= Bakery shaders =&lt;br /&gt;
Bakery 包含了自带着色器，支持顶点光照贴图，以及 RNM 和 SH 方向模式。它还允许从方向数据计算近似烘焙高光。&lt;br /&gt;
对于普通颜色光照贴图、阴影遮罩和 Dominant Direction 模式，Bakery 着色器 '''不是必需的'''，因为这些功能大多数 Unity 着色器本身已经支持。&lt;br /&gt;
&lt;br /&gt;
=== Standard render pipeline ===&lt;br /&gt;
'''Bakery/Standard''': 扩展了普通 Standard 着色器。额外选项：&lt;br /&gt;
&lt;br /&gt;
* Allow Vertex Lightmaps: 允许该材质用于 [[Vertex Lightmaps|顶点光照贴图]]。&lt;br /&gt;
* Allow RNM Lightmaps: 允许该材质用于 [[#RNM|RNM 方向模式]]。&lt;br /&gt;
* Allow SH Lightmaps: 允许该材质用于 [[#SH|SH 方向模式]]。&lt;br /&gt;
  {{note| 所有 “Allow” 选项会在着色器中启用特定的代码路径。为了性能考虑，建议每个材质仅使用一个 “allow” 选项。}}&lt;br /&gt;
* Enable Lightmap Specular: 使用 Dominant Direction、RNM 或 SH 方向模式的数据计算烘焙高光。注意，由于信息有限，该效果仅为近似。如果你曾在 Unity 4 中使用烘焙高光，效果应可比。与高度扰动的法线贴图搭配效果最佳，在平面表面上效果不佳。&lt;br /&gt;
* Enable VertexLM directional: 如果存在顶点光照贴图，指定 Dominant Direction 数据存储在顶点中并应被使用。&lt;br /&gt;
* Enable VertexLM SH: 如果存在顶点光照贴图，指定 SH 数据存储在顶点中并应被使用。&lt;br /&gt;
* Enable VertexLM Shadowmask: 如果存在顶点光照贴图，指定阴影遮罩存储在顶点中并应被使用。&lt;br /&gt;
* Enable MonoSH: 将方向贴图视为 MonoSH 贴图。&lt;br /&gt;
[[File:Image5.png|thumb|Standard SH light probe vs non-linear]]&lt;br /&gt;
[[File:Shspec.jpg|thumb|SH specular effect]]&lt;br /&gt;
* Non-linear SH：在 SH 方向模式下，此选项可以增强对比度（更接近真实效果），但会使着色器稍微变慢。该技巧基于 Geomerics 的论文《[https://drive.google.com/file/d/1MK6Clw93q8ljijRjb4gQOzzaIjn1uF9Y/view Reconstructing Diffuse Lighting from Spherical Harmonic Data]》。&lt;br /&gt;
* Non-linear Light Probe SH：与 Non-linear SH 类似，但用于光照探针。在探针的情况下，最显著的好处是消除错误的负值。这种问题常见于具有高对比度、明亮 HDR 光源的场景中。这是球谐函数的固有限制，而不是 Bakery 特有的问题（即使用 Unity 内置光照贴图器也可能出现类似伪影）。&lt;br /&gt;
* Force Bicubic Filter：为所有附加贴图启用双三次滤波。若要实现完整的双三次滤波（包括第一张颜色贴图），建议同时在 [[#Shader Tweaks|Shader Tweaks]] 中启用该功能。&lt;br /&gt;
&lt;br /&gt;
'''Bakery/Standard Specular'''：与 Standard 相同，但用于高光（Specular）工作流程。&lt;br /&gt;
&lt;br /&gt;
=== HDRP &amp;amp; URP ===&lt;br /&gt;
要提取额外的 HDRP/URP 着色器，请打开 Bakery 自带的 Bakery_ShaderGraphHDRP.unitypackage 或 Bakery_ShaderGraphURP.unitypackage。&lt;br /&gt;
在其中，你会找到可在自己 Shader Graph 中使用的 Shader Subgraph，以及一些示例材质。&lt;br /&gt;
&lt;br /&gt;
=== 各着色器功能支持对比 ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! 大多数 Unity 着色器&lt;br /&gt;
! 大多数 HDRP 和 URP 着色器&lt;br /&gt;
! Bakery Standard&lt;br /&gt;
! Bakery HDRP graphs&lt;br /&gt;
! Bakery URP graphs&lt;br /&gt;
|-&lt;br /&gt;
| HDR color lightmaps&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Shadowmask&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是 (&amp;gt;= URP 10.1)&lt;br /&gt;
|-&lt;br /&gt;
| Dominant Direction&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| RNM&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| SH&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Mo否SH&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Lightmap specular&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持 Dominant Direction 和 SH&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持 Dominant Direction&lt;br /&gt;
|-&lt;br /&gt;
| Bicubic filtering&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是,&lt;br /&gt;
通过 [[#Shader Tweaks|Shader Tweaks]] 支持&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是,&lt;br /&gt;
通过 [[#Shader Tweaks|Shader Tweaks]] 支持&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
|-&lt;br /&gt;
| Vertex lightmaps&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 单一颜色，没有每顶点 SH、方向或阴影遮罩（Shader Graph 限制）&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 单一颜色，没有每顶点 SH、方向或阴影遮罩（Shader Graph 限制）&lt;br /&gt;
|-&lt;br /&gt;
| Non-Linear Light Probes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Volumes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Volume shadowmask&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Compressed volumes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{note| 除了普通颜色光照贴图之外，所有功能都至少需要 Shader Model 3.0 才能运行。}}&lt;br /&gt;
{{note| 使用 SH 模式的顶点光照贴图由于插值器数量限制，至少需要 Shader Model 4.0。}}&lt;br /&gt;
{{note| 含有从 Dominant Direction 生成高光的更新版 URP 图表可在 [[Bakery_-_GPU_Lightmapper|主维基页面]] 下载。}}&lt;br /&gt;
&lt;br /&gt;
另请参阅：[[Integrating_Bakery_shader_features_to_custom_shaders| 将 Bakery 着色器特性集成到自定义着色器中]]&lt;br /&gt;
&lt;br /&gt;
= 关于 HDRP/URP 的说明 =&lt;br /&gt;
将该插件导入到 HDRP 或 URP 项目后，一般即可直接使用，但需要注意以下几点：&lt;br /&gt;
&lt;br /&gt;
* 示例场景中同时使用了普通 Standard 着色器以及部分 “Bakery Standard” 着色器。HDRP 和 URP 提供了将项目着色器从 Standard 升级到 Lit 的机制，但无法从 Bakery Standard 升级。请将 Bakery Standard 材质替换为来自 Bakery_ShaderGraphHDRP.unitypackage 或 Bakery_ShaderGraphURP.unitypackage 中的材质。&lt;br /&gt;
&lt;br /&gt;
* 在 HDRP 中，默认 HDRI 天空亮度较高（11），且天空反射默认不会被遮蔽。再加上默认的自动曝光，可能导致某些示例场景几乎不可见，因为它们使用了更低的亮度进行烘焙。此时可将 HDRI 天空亮度降低到 1。HDRI 设置通常位于 Assets/HDRPDefaultResources/DefaultSettingsVolumeProfile 中。&lt;br /&gt;
&lt;br /&gt;
* 在 HDRP 中，如果示例场景中的灯光过亮，可在 Bakery 灯光组件上点击 “match real-time to lightmapped” 按钮。&lt;br /&gt;
&lt;br /&gt;
* 在 HDRP 中建议使用 OpenImageDenoise 2（最佳）或 OptiX 7 去噪器，因为它们对高亮度值更适合。&lt;br /&gt;
&lt;br /&gt;
* 在 HDRP 中，“distance” 与普通 Shadowmask 的切换可直接在 Light 组件上完成，而不是在全局设置中。&lt;br /&gt;
&lt;br /&gt;
* 不要在 Skylight 上使用 “match” 按钮，因为 HDRP 使用的是非常特定的程序化天空着色器。请改为将其烘焙为 HDRI [[How_do_I...#How_do_I_use_Skylight_with_a_procedural_sky_shader.3F|这种方式]]。&lt;br /&gt;
&lt;br /&gt;
* 建议在使用 HDRP 时始终将 Light Probe Mode 设置为 L2 或 L1，因为 HDRP 的渲染器并未针对 Legacy 模式进行优化。&lt;br /&gt;
&lt;br /&gt;
* 最新版本的 HDRP/URP 自带自己的 IES 文件导入器。由于资源类型不匹配，Unity 会将旧版本 Bakery IES 灯光断开连接，使其显示为普通点光源。它们可以重新连接并重新保存。&lt;br /&gt;
&lt;br /&gt;
Bakery 的示例场景是为内置渲染管线设计的，因此在 HDRP/URP 中正确渲染它们需要一些步骤。以下是一些提示；假设新建项目使用默认的 HDRP/URP 设置：&lt;br /&gt;
&lt;br /&gt;
=== 在 HDRP 中查看示例场景 ===&lt;br /&gt;
&lt;br /&gt;
* 导入 Bakery 后，将标准材质升级为 HDRP：Edit-&amp;gt;Rendering-&amp;gt;Materials-&amp;gt;Convert All Built-in Materials To HDRP。&lt;br /&gt;
* 将 Bakery_ShaderGraphHDRP.unitypackage 导入项目，因为它包含实现高级 Bakery 功能的特殊 Shader Graph（对于经典颜色/方向/遮罩光照贴图不需要）。&lt;br /&gt;
* 选择 DefaultSettingsVolumeProfile.asset。在 HDRI Sky 部分，将 Exposure Compensation 设置为 1。否则，与示例场景相比，默认 HDRP 会过亮，因曝光调整而使场景看起来很暗。&lt;br /&gt;
* 选择示例场景中的灯光时，HDRP 会初始化其自身的灯光数据。有时会导致灯光立即变得更亮。点击 “Match real-time to lightmapped” 以同步。&lt;br /&gt;
* 在渲染光探针前，将 Light Probe Mode 设置为 L2。&lt;br /&gt;
* '''example_directional''': 将 Shader 更改为 BakeryDirSpecGraph 以查看烘焙高光（或仅使用常规 HDRP/Lit 用于仅漫反射法线映射）。删除球体，因为当前没有支持逐顶点方向的 Shader Graph。&lt;br /&gt;
* '''example_directional_MonoSH''': 将 Shader 更改为 BakerySpecMonoSHGraph（或 BakeryMonoSHGraph，用于没有高光的略微低成本版本）。删除球体，因为当前没有支持逐顶点 MonoSH 的 Shader Graph。&lt;br /&gt;
* '''example_RNM''': 将 Shader 更改为 BakeryRNMGraph。&lt;br /&gt;
* '''example_SH''': 将 Shader 更改为 BakerySpecSHGraph（或 BakerySHGraph，用于没有高光的略微低成本版本）。删除球体，因为当前没有支持逐顶点 SH 的 Shader Graph。&lt;br /&gt;
* '''example_mixed_directional_mode''': 对 MonoSH/RNM/SH 平面，同样需要不同的 Graph。&lt;br /&gt;
* '''example_lights''': 将顶点光照球体的 Shader 更改为 BakeryVertexColorGraph。&lt;br /&gt;
* '''example_prefabs_bake''': 无需进一步调整。&lt;br /&gt;
* '''example_sectors''': 无需进一步调整。&lt;br /&gt;
* '''example_shadowmask''': 选择 DirectLight 并点击 “Match real-time to lightmapped” 修正亮度。将所有 HDRP 灯光的 Shadowmask Mode 设置为 Shadowmask。&lt;br /&gt;
* '''example_sponza_day''': 将 OpenImageDenoise 2（或 Optix 7，如果不支持）设置为首选去噪器。&lt;br /&gt;
* '''example_sponza_evening''': 将 OpenImageDenoise 2（或 Optix 7，如果不支持）设置为首选去噪器。&lt;br /&gt;
* '''example_subtractive''': HDRP 不支持减法模式。&lt;br /&gt;
* '''example_volumes_simple''': 将火车 Shader 更改为 BakeryVolumeSpecGraph（或 BakeryVolumeGraph，用于没有高光的略微低成本版本）。&lt;br /&gt;
* '''example_volumes_simple_shadowmask''': HDRP 当前不支持 Shadowmask Volumes。&lt;br /&gt;
* '''example_volumes_advanced''': 与 example_volumes_simple 相同。&lt;br /&gt;
* '''example_translucency''': 场景大部分应显示正常。对于 “Dynamic sphere lit by volume”，将 Shader 设置为 BakeryVolumeGraph。&lt;br /&gt;
&lt;br /&gt;
=== 在 URP 中查看示例场景 ===&lt;br /&gt;
&lt;br /&gt;
* 导入 Bakery 后，将标准材质升级为 URP：打开 Assets/Bakery/examples/content，输入 &amp;quot;t:material&amp;quot; 选择所有材质，并仅在 &amp;quot;content&amp;quot; 文件夹下搜索。点击 Edit-&amp;gt;Rendering-&amp;gt;Materials-&amp;gt;Convert Selected Built-in Materials To URP。&lt;br /&gt;
* 将 Bakery_ShaderGraphURP.unitypackage 导入项目，因为它包含实现高级 Bakery 功能的特殊 Shader Graph（对于经典颜色/方向/遮罩光照贴图不需要）。&lt;br /&gt;
* '''example_directional''': 将 Shader 更改为 BakeryURPLit，启用 &amp;quot;Bakery Lightmapped Specular&amp;quot;（或者仅保持常规 URP/Lit 用于仅漫反射法线映射）。删除球体，因为当前没有支持逐顶点方向的 Shader Graph。&lt;br /&gt;
* '''example_directional_MonoSH''': 将 Shader 更改为 BakeryURPLit，将 Bakery Mode 设置为 MonoSH，启用 &amp;quot;Bakery Lightmapped Specular&amp;quot;。在顶点光照球体上也启用 &amp;quot;Per-vertex&amp;quot;。&lt;br /&gt;
* '''example_RNM''': 将 Shader 更改为 BakeryURPLit，将 Bakery Mode 设置为 RNM，启用 &amp;quot;Bakery Lightmapped Specular&amp;quot;。&lt;br /&gt;
* '''example_SH''': 将 Shader 更改为 BakeryURPLit，将 Bakery Mode 设置为 SH，启用 &amp;quot;Bakery Lightmapped Specular&amp;quot;。删除球体，因为当前没有支持逐顶点 SH 的 Shader Graph。&lt;br /&gt;
* '''example_mixed_directional_mode''': 类似地使用 BakeryURPLit 并设置不同的 Bakery Mode（MonoSH、RNM、SH）。非方向性/主方向/烘焙法线贴图可使用常规 URP/Lit。&lt;br /&gt;
* '''example_lights''': 无需进一步调整。&lt;br /&gt;
* '''example_prefabs_bake''': 无需进一步调整。&lt;br /&gt;
* '''example_sectors''': 无需进一步调整。&lt;br /&gt;
* '''example_shadowmask''': 类似于 Built-in 渲染管线，在 Bakery 窗口（或项目 Quality Settings）中取消选中 Distance Shadowmask，以在摄像机附近查看实际烘焙/实时阴影混合效果。&lt;br /&gt;
* '''example_sponza_day''': 在植被材质上启用 alpha clipping。&lt;br /&gt;
* '''example_sponza_evening''': 同 example_sponza_day。&lt;br /&gt;
* '''example_subtractive''': 无需进一步调整。&lt;br /&gt;
* '''example_volumes_simple''': 将火车 Shader 更改为 BakeryURPLit，并将 Bakery Mode 设置为 Volume。可选启用 &amp;quot;Bakery Lightmapped Specular&amp;quot;。&lt;br /&gt;
* '''example_volumes_simple_shadowmask''': 与 example_volumes_simple 相同，但也启用 &amp;quot;Volume Shadowmask&amp;quot;。&lt;br /&gt;
* '''example_volumes_advanced''': 与 example_volumes_simple 相同。&lt;br /&gt;
* '''example_translucency''': 场景大部分应显示正常。对于 &amp;quot;Dynamic sphere lit by volume&amp;quot;，将 Shader 设置为 BakeryURPLit 并将 Bakery Mode 设置为 Volume。&lt;br /&gt;
&lt;br /&gt;
= 升级 Bakery =&lt;br /&gt;
在升级该资源时，建议遵循以下步骤：&lt;br /&gt;
&lt;br /&gt;
* 关闭 Bakery 窗口。&lt;br /&gt;
* 关闭 Unity。&lt;br /&gt;
* 重新打开 Unity。&lt;br /&gt;
* 导入更新后的包。&lt;br /&gt;
&lt;br /&gt;
请注意，如果不先关闭 Unity，导入可能会失败，因为 DLL 文件被锁定（会出现类似 &amp;quot;alphabuffergen.dll: Access is denied.&amp;quot; 的提示）。&lt;br /&gt;
&lt;br /&gt;
如果你移动过 Bakery 文件夹（Assets/Bakery 和 Assets/Editor/x64/Bakery）到其他位置，可能需要在更新前将它们移回原处，以避免出现两个冲突的包副本。&lt;br /&gt;
&lt;br /&gt;
= 脚本 API =&lt;br /&gt;
&lt;br /&gt;
== 基本用法 ==&lt;br /&gt;
&lt;br /&gt;
获取并修改渲染设置：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ftLightmapsStorage storage = ftRenderLightmap.FindRenderSettingsStorage();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
可以在 ftLightmapsStorage.cs 中查看可用设置的完整列表。&lt;br /&gt;
&lt;br /&gt;
获取 lightmapper 实例并（重新）加载设置：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap bakery = ftRenderLightmap.instance != null ? ftRenderLightmap.instance : new ftRenderLightmap();&lt;br /&gt;
bakery.LoadRenderSettings();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
渲染光照贴图（如果设置为 L1 或 L2 模式，也会渲染探针）：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;bakery.RenderButton(bool showMsgWindows)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
仅渲染光探针：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;bakery.RenderLightProbesButton(bool showMsgWindows)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
仅渲染反射探针：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;bakery.RenderReflectionProbesButton(bool showMsgWindows)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''showMsgWindows''' 指示是否可以显示任何对话框/确认框。如果设置为 false，则抑制显示。&lt;br /&gt;
&lt;br /&gt;
检查烘焙是否正在进行：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.bakeInProgress&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
使用示例请参考 [[Community_extensions#Batch_scene_baker|Batch Scene Baker]] 脚本。&lt;br /&gt;
&lt;br /&gt;
== 额外函数 ==&lt;br /&gt;
&lt;br /&gt;
将一个 ftLightmapsStorage 的所有渲染设置复制到另一个：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmapsStorage.CopySettings(ftLightmapsStorage src, ftLightmapsStorage dest)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
获取全局（每项目）存储对象：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftGlobalStorage gstorage = ftLightmaps.GetGlobalStorage()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
将 ftLightmapsStorage（每场景）的所有渲染设置复制到 ftGlobalStorage（每项目）：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmapsStorage.CopySettings(ftLightmapsStorage src, ftGlobalStorage dest)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
将 ftGlobalStorage（每项目）的所有渲染设置复制到 ftLightmapsStorage（每场景）：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmapsStorage.CopySettings(ftGlobalStorage src, ftLightmapsStorage dest)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
获取包含 Bakery 二进制文件的文件夹路径：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmaps.GetEditorPath()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 额外变量 ==&lt;br /&gt;
&lt;br /&gt;
获取当前临时文件路径（必须先创建 ftRenderLightmap 实例）：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.scenePath&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
获取/设置 UVGBuffer 数据压缩（启用时为 LZ4，否则为 DDS）：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.compressedGBuffer&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
获取/设置输出光照贴图数据压缩（启用时为 LZ4，否则为 DDS）：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.compressedOutput&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 事件 ==&lt;br /&gt;
&lt;br /&gt;
脚本可以订阅 ftRenderLightmap 类中的静态事件。&lt;br /&gt;
&lt;br /&gt;
在完整渲染前调用：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnPreFullRender&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
在 Legacy 光探针模式下，每渲染一个光探针前调用。ProbeEventArgs 是一个结构体，包含 '''pos''' 字段表示当前光探针的位置：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler&amp;lt;ProbeEventArgs&amp;gt; OnPreRenderProbe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
在 Legacy 光探针渲染完成后调用：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnFinishedProbes&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
在完整渲染完成后调用：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnFinishedFullRender&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
在反射探针渲染前调用：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnPreReflectionProbeRender&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
在反射探针渲染完成后调用：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnFinishedReflectionProbes&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mr F</name></author>
		
	</entry>
	<entry>
		<id>https://geom.io/bakery/wiki/index.php?title=%E4%BD%BF%E7%94%A8%E6%89%8B%E5%86%8C&amp;diff=1832</id>
		<title>使用手册</title>
		<link rel="alternate" type="text/html" href="https://geom.io/bakery/wiki/index.php?title=%E4%BD%BF%E7%94%A8%E6%89%8B%E5%86%8C&amp;diff=1832"/>
		<updated>2025-11-05T14:41:40Z</updated>

		<summary type="html">&lt;p&gt;Mr F: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== 系统要求 ==&lt;br /&gt;
&lt;br /&gt;
使用 Bakery 需要：&lt;br /&gt;
&lt;br /&gt;
Windows（7 或更高版本）电脑。&lt;br /&gt;
&lt;br /&gt;
Nvidia 显卡。最低支持型号为 Kepler（GeForce 650 或更新型号，Quadro 显卡请查看规格）。&lt;br /&gt;
&lt;br /&gt;
64 位 Unity 编辑器。Bakery 已在 5.6 到 6 及更高版本上测试过，同时也在 Tuanjie 1.6.7 上通过测试。&lt;br /&gt;
&lt;br /&gt;
{{note|系统要求仅适用于开发者的电脑，而非目标平台。使用 Bakery 烘焙的光照贴图可以在任何地方使用。}}&lt;br /&gt;
&lt;br /&gt;
== 前提条件 ==&lt;br /&gt;
* 确保你的项目中没有任何脚本编译错误，否则也会导致 Bakery 的脚本无法编译。&lt;br /&gt;
* 确保你的显卡驱动是最新版本，如有需要请[https://www.nvidia.com/Download/index.aspx?lang=en-US 更新]。&lt;br /&gt;
&lt;br /&gt;
'''请使用 Game-Ready（标准）驱动程序，而不是 “Studio” 驱动。'''&lt;br /&gt;
&lt;br /&gt;
== 安装 ==&lt;br /&gt;
&lt;br /&gt;
1. 通过 [https://assetstore.unity.com/packages/tools/level-design/bakery-gpu-lightmapper-122218 Asset Store] 将 Bakery 导入到你的项目中。&lt;br /&gt;
&lt;br /&gt;
2. Unity 会显示要导入的文件列表。如果这是你第一次使用 Bakery，建议直接 点击 Import（导入）。有经验的用户可以取消选中 examples 文件夹，以进行更轻量的安装。&lt;br /&gt;
&lt;br /&gt;
文件将被导入到 `Assets/Bakery` 和 `Assets/Editor/x64/Bakery` 文件夹中。&lt;br /&gt;
这些文件夹之后可以移动。&lt;br /&gt;
&lt;br /&gt;
3. Unity 随后会导入 Bakery 并编译脚本。此时可能会弹出如下窗口：&lt;br /&gt;
&lt;br /&gt;
[[File:Goahead.png]]&lt;br /&gt;
&lt;br /&gt;
此时你应点击 “Go Ahead”（继续）。&lt;br /&gt;
&lt;br /&gt;
现在你应该能在编辑器中看到新增的 Bakery 菜单：&lt;br /&gt;
&lt;br /&gt;
[[File:bmenu.jpg]]&lt;br /&gt;
&lt;br /&gt;
== 快速开始 ==&lt;br /&gt;
&lt;br /&gt;
1. 添加一些模型或基础体，并将其标记为静态（Static）。&lt;br /&gt;
&lt;br /&gt;
'''用于光照贴图的网格必须具有不重叠的 UV2。如果存在 UV2，则会使用 UV2（否则使用 UV1）。如果你的模型没有为光照贴图进行展开，请在资源中勾选 Generate Lightmap UVs（生成光照贴图 UV）。'''&lt;br /&gt;
Unity 的基础体已经具有正确的 UV2。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Staticmarked.jpg|320px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. 选择方向光（Unity 为你创建的那个），并添加 '''Bakery Direct Light''' 组件。&lt;br /&gt;
   {{note|Bakery 和 Unity 使用独立的光源组件。}}&lt;br /&gt;
&lt;br /&gt;
3. Bakery Direct Light 有许多可调选项，但你可以轻松将其与 Unity 光源匹配。点击 '''Match lightmapped to real-time'''。现在 Bakery 光源的颜色应与 Unity 默认的方向光相同，呈黄色调。&lt;br /&gt;
&lt;br /&gt;
[[File:Matching.jpg|640px]]&lt;br /&gt;
&lt;br /&gt;
{{note|Direct Light 组件可能会提示项目未使用线性光强度。问题在于，Unity 默认会对光源颜色应用伽马校正 [https://twitter.com/guycalledfrank/status/1001108508614553600 不正确]。&lt;br /&gt;
可以通过[https://docs.unity3d.com/ScriptReference/Rendering.GraphicsSettings-lightsUseLinearIntensity.html 脚本]启用正确模式。&lt;br /&gt;
这就是 “Fix” 按钮的作用。如果你已经在非线性光强模式下设置了许多光源，并且不想再次更改它们，可以跳过修复。即使你按了 “Fix”，也可以随时撤销此更改。&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. 要获得带阴影的环境光，请创建 Skylight（Bakery-&amp;gt;Create-&amp;gt;Skylight）。&lt;br /&gt;
&lt;br /&gt;
[[File:Menusky.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. 选择 Skylight，为它设置一些偏蓝的颜色，然后点击 '''Match scene skybox to this light'''。   这将使场景的 skybox 与光照完全匹配。&lt;br /&gt;
   {{note|将 Unity 的 skybox 与 Bakery Skylight 匹配是可选的，但对正确性很有用，可以确保可见环境和引擎内的反射探针与烘焙光照一致。目前此选项仅适用于 Standard 渲染管线。}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Skycomp.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. 点击 Bakery-&amp;gt;Render Lightmap。默认情况下，Full Lighting 模式是激活的。它会烘焙所有光源的直接和间接光照贡献。如果你想将实时阴影与烘焙全局光照（GI）结合使用，请将模式更改为 '''Indirect'''。&lt;br /&gt;
&lt;br /&gt;
[[File:Bakerywindow.jpg]]&lt;br /&gt;
&lt;br /&gt;
{{note| Bakery 可能会提示你正在使用旧的 [https://docs.unity3d.com/Manual/LinearLighting.html gamma mode]。如果你在意光照质量，强烈建议使用线性模式。如果你的项目已经在错误的伽马模式下设置好了，并且不想更改，或者是发布到不支持线性模式的移动设备上，也可以忽略此提示。}}&lt;br /&gt;
&lt;br /&gt;
7. 点击 '''Render'''。&lt;br /&gt;
&lt;br /&gt;
8. 完成！现在你应该已经得到烘焙的全局光照（GI）：&lt;br /&gt;
&lt;br /&gt;
[[File:Bakedgi.jpg]]&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 ==&lt;br /&gt;
&lt;br /&gt;
所有渲染设置都可以通过 Bakery-&amp;gt;Render Lightmap 访问。设置会为每个场景单独保存。Bakery 窗口顶部的选项允许你在 Simple（简单）、Advanced（高级）和 Experimental（实验）设置之间切换，每个后续模式都会显示更多可调选项。对于大多数场景，Simple 模式已经足够，是入门的好方法。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render mode ===  &lt;br /&gt;
定义要烘焙的光照贴图类型。  &lt;br /&gt;
&lt;br /&gt;
===== Full Lighting =====&lt;br /&gt;
烘焙所有 Bakery 光源的完整直接光和间接光。&lt;br /&gt;
{{note|在 2017.3 之前的 Unity 版本中，如果同一对象上同时有 Unity 和 Bakery 组件，你需要手动禁用 Unity 组件以避免亮度加倍。在较新版本中，实时效果会自动对烘焙光源禁用，就像内置光照烘焙器一样。}}&lt;br /&gt;
&lt;br /&gt;
===== Indirect =====&lt;br /&gt;
[[File:Image26.png|thumb|Unity 支持的不同渲染模式对比]]&lt;br /&gt;
基础混合模式。它会查看每个光源上的 Baked Contribution 选择器：如果设置为 ''Direct And Indirect''，则光源会像在 Full Lighting 模式下一样被烘焙。如果设置为 ''Indirect Only''，则只会烘焙该光源的间接光照（GI）。在后一种情况下，你应保持对象上的 Unity 光源和 Bakery 光源同时存在，一个提供实时直接光照，另一个提供预计算的全局光照（GI）。&lt;br /&gt;
&lt;br /&gt;
[[File:Indirectonly.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== Shadowmask =====&lt;br /&gt;
[[File:Image21.png|thumb|左：完全烘焙的光照。中：动态光源 + 烘焙 GI。右：胶囊形阴影、凹凸贴图和高光为动态光照，但立方体阴影和 GI 为烘焙光照。]]&lt;br /&gt;
[[File:Image6.png|thumb|当相机足够远离场景，或者动态阴影被禁用时，场景将呈现如下效果]]&lt;br /&gt;
更高级的混合模式。它通过生成两种类型的光照贴图来工作——一种包含烘焙颜色（如 Indirect 模式），另一种包含静态物体的阴影。它有几个优点：&lt;br /&gt;
* 实时阴影只需渲染少量动态对象，而不是整个场景。&lt;br /&gt;
* 实时阴影与烘焙阴影可以正确融合。&lt;br /&gt;
* 实时光源可以渲染凹凸贴图、高光和其他表面效果，同时仍会被高质量烘焙阴影遮挡。&lt;br /&gt;
[https://docs.unity3d.com/Manual/LightMode-Mixed-Shadowmask.html 更多详情]&lt;br /&gt;
&lt;br /&gt;
要启用此行为，你必须在同一对象上同时存在 Unity 光源和 Bakery 光源，并将 Baked Contribution 设置为 ''Shadowmask and Indirect''。未标记的光源将按 Indirect 模式进行烘焙。&lt;br /&gt;
&lt;br /&gt;
[[File:Smask22.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== Distance Shadowmask =====&lt;br /&gt;
此复选框仅在你选择 Shadowmask 时可见，并且只是切换项目 [https://docs.unity3d.com/Manual/LightMode-Mixed-ShadowmaskMode.html Quality Settings] 中同名的设置。&lt;br /&gt;
[https://docs.unity3d.com/Manual/LightMode-Mixed-DistanceShadowmask.html 更多详情]&lt;br /&gt;
{{note|由于缺少对应的脚本 API，该复选框在 Unity 5.6.x 上不可见。你可以在 Window-&amp;gt;Lighting-&amp;gt;Mixed Lighting-&amp;gt;Lighting Mode 中切换该设置。}}&lt;br /&gt;
{{note|在 Unity 版本 &amp;lt; 2017.3 中，由于 API 限制，渲染 Shadowmask 光照贴图会清除光照探针。烘焙后需要重新渲染光照探针。在较新版本中不应发生此问题。}}&lt;br /&gt;
&lt;br /&gt;
===== Subtractive =====&lt;br /&gt;
&lt;br /&gt;
启用 [https://docs.unity3d.com/Manual/LightMode-Mixed-Subtractive.html Subtractive] 光照模式。&lt;br /&gt;
&lt;br /&gt;
此选项对光照贴图本身没有任何特殊作用，实际上它的工作方式与 Full Lighting 相同。&lt;br /&gt;
&lt;br /&gt;
唯一的区别是，它还会将实时 Unity 光源设置为与 Subtractive 模式兼容（因为无法通过 UI 完成此操作）。&lt;br /&gt;
&lt;br /&gt;
你还需要在 [https://docs.unity3d.com/Manual/GlobalIllumination.html#MixedLighting Unity Lighting] 窗口中额外设置全局减法参数（例如全局阴影颜色）。&lt;br /&gt;
&lt;br /&gt;
===== Ambient Occlusion Only =====&lt;br /&gt;
仅烘焙环境光遮蔽（AO）。如果你很清楚自己在做什么，这可能会有用。请确保设置 [[#Ambient_occlusion|AO 选项]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Directional mode ===&lt;br /&gt;
[[File:Image3.png|thumb|不同方向模式的对比]]&lt;br /&gt;
定义了方向信息的烘焙方式。标准光照贴图每个像素只存储单一颜色，而方向光照贴图为着色器提供了关于该像素周围半球内光照变化的提示。这些数据用于在完全烘焙的区域中结合法线贴图。如果将其应用到内置的 [[#Bakery_shaders|Bakery]] 着色器中，还可以产生**近似高光反射**效果。&lt;br /&gt;
&lt;br /&gt;
===== None =====&lt;br /&gt;
不包含方向数据，每个像素仅有单一颜色。&lt;br /&gt;
&lt;br /&gt;
===== Baked Normal Maps =====&lt;br /&gt;
依然没有方向数据，但在渲染光照贴图时会考虑法线贴图。此方式在运行时没有额外开销。由于光照贴图的分辨率通常低于法线贴图，结果可能显得模糊。其他问题包括：由于缺乏 mipmapping，远处可能出现锯齿，以及降噪步骤可能导致细节被涂抹。要了解如何在此模式下使用具有程序化法线的自定义着色器，请参阅 [[#Normal_mapping|Normal Mapping]] 章节。&lt;br /&gt;
&lt;br /&gt;
===== Dominant Direction =====&lt;br /&gt;
此模式类似于 Unity 中 Enlighten 和 Progressive 烘焙器的实现。它与大多数着色器兼容，仅生成一张额外的贴图，运行时开销极小。缺点是凹凸贴图的效果较弱，略显灰暗，与实时光照下的同一物体相比可能差异较大。&lt;br /&gt;
&lt;br /&gt;
===== RNM =====&lt;br /&gt;
基于最初为《Half-Life 2》开发的 [https://steamcdn-a.akamaihd.net/apps/valve/2004/GDC2004_Half-Life2_Shading.pdf Radiosity Normal Mapping] 技术（相关演示文稿），后来被许多游戏采用（如《Mirror's Edge》）。此模式总共生成三张 HDR 贴图，是内存占用最高的模式之一，但运行时开销仍相对较低。该模式比 Dominant Direction 更精确，能更好地再现表面反差，并能正确处理来自不同角度、具有不同颜色的光照对法线贴图的影响。&lt;br /&gt;
&lt;br /&gt;
===== SH =====&lt;br /&gt;
基于论文《[https://media.contentapi.ea.com/content/dam/eacom/frostbite/files/gdc2018-precomputedgiobalilluminationinfrostbite.pdf Precomputed Global Illumination in Frostbite]》。这是最高质量的模式，能提供更好的表面对比度，并准确表现来自不同方向、不同颜色的光照。总共生成四张贴图，其中仅一张为 HDR，因此比 RNM 占用更少内存。运行时开销略高于 RNM。&lt;br /&gt;
&lt;br /&gt;
===== MonoSH =====&lt;br /&gt;
[[File:FY8Ru8hWIAAdYYH.jpg|thumb|Dominant Direction、完整 SH 与 MonoSH 的尺寸/质量对比]]&lt;br /&gt;
与 SH 类似，但使用单色的 L1 方向系数。表面对比度同样良好，虽然无法准确表现来自不同方向的不同颜色光照，但对多数场景来说已经足够。仅生成一张额外贴图，因此显存占用与带宽需求与 Dominant Direction 相近；事实上更低，因为 Dominant Direction 使用 RGBA 贴图，而 MonoSH 只需 RGB。该贴图通过内置的方向光照贴图系统传递，但''在标准着色器下显示不正确''。请务必使用兼容的着色器。&lt;br /&gt;
&lt;br /&gt;
===== 限制 =====&lt;br /&gt;
&lt;br /&gt;
* RNM 和 SH/MonoSH 只能与 [[#Bakery_shaders|Bakery shader]] 一起使用，或者需要对你的着色器进行调整。&lt;br /&gt;
* 在 RNM 和 SH 模式下，不会生成标准的颜色光照贴图。你需要确保场景中所有材质都使用 Bakery Shader，或者使用 [[#Bakery_Lightmap_Group_Selector|Lightmap Groups]] 将 RNM/SH 对象与其他对象分开。&lt;br /&gt;
* RNM 和 SH 贴图是通过 [https://docs.unity3d.com/ScriptReference/MaterialPropertyBlock.html MaterialPropertyBlock] 应用于对象的，因此在 Unity 的 Lighting 窗口中可能无法完全显示。&lt;br /&gt;
* Dominant Direction、RNM 和 SH/MonoSH 模式可能需要为全局光照（GI）和光照网格使用更多采样，以获得相近的质量。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Texels per unit ===&lt;br /&gt;
[[File:Texelscomp.jpg|thumb|1 vs 10 texels per unit]]&lt;br /&gt;
每个世界单位的光照贴图像素（Texels）近似数量。它会影响生成光照贴图的数量和分辨率。&lt;br /&gt;
&lt;br /&gt;
入门示例值：&lt;br /&gt;
&lt;br /&gt;
* 大型户外区域（城市）：1 - 5&lt;br /&gt;
* 中型户外区域（几条小巷）：10 - 20&lt;br /&gt;
* 高质量室内场景：100&lt;br /&gt;
&lt;br /&gt;
假设场景比例大约为 1 单位 = 1 米。在 Unity 中使用这种比例通常是推荐的，以便更好地导航和进行物理模拟。如果你的比例不同，请相应地调整 Texels。&lt;br /&gt;
&lt;br /&gt;
请注意，Texels Per Unit 是基础分辨率，但每个对象还可以通过 Mesh Renderer 上的 &amp;quot;Scale in Lightmap&amp;quot; 选项以及 Bakery 窗口中的 &amp;quot;Scale per map type&amp;quot; 进行额外调整。&lt;br /&gt;
&lt;br /&gt;
{{note| 将 &amp;quot;Scale in Lightmap&amp;quot; 设置为 0 的对象不会被烘焙，但仍会投射阴影并影响全局光照（GI）。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Max resolution ===&lt;br /&gt;
光照贴图的最大尺寸限制。如果对象无法容纳在单张光照贴图中（根据当前的 Texels Per Unit 值），将会分配额外的光照贴图。同样的四个正方形对象可以使用四张 512x512 的贴图，也可以使用一张 1024x1024 的贴图。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bounces ===&lt;br /&gt;
[[File:Image36.png|thumb|注意更多的反弹会为封闭空间带来更多光照。]]&lt;br /&gt;
定义光线在表面上反弹的次数。通常，对于户外场景（例如城市），较低的反弹次数就足够了，而对于封闭场景（室内、洞穴），则需要较高的反弹次数。&lt;br /&gt;
&lt;br /&gt;
虽然滑块最多限制为 5 次反弹，但可以在数字输入框中输入任意反弹次数。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Samples ===&lt;br /&gt;
[[File:Image7.png|thumb|左：Samples = 4，右：Samples = 16。为了演示，去噪功能已关闭。]]&lt;br /&gt;
影响全局光照（GI）的质量。典型值为 16 到 32。&lt;br /&gt;
&lt;br /&gt;
{{note| 可以输入超出滑块最大值的任意数字，但请注意，该数字表示最终光线数量的平方根，例如 32 表示 1024 条光线，64 表示 4096 条光线，依此类推。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GPU Priority ===&lt;br /&gt;
在 GPU 处理光照贴图时，操作系统和其他软件的响应可能会变慢。此选项允许你在烘焙速度和系统响应之间进行平衡。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render ===&lt;br /&gt;
为所有打开的场景烘焙光照贴图。&lt;br /&gt;
如果 [[使用手册#Light_probe_mode|Light Probe Mode]] 设置为 L1 或 L2，也会烘焙 [https://docs.unity3d.com/Manual/LightProbes.html 光照探针]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Render Light Probes ===&lt;br /&gt;
为所有打开的场景烘焙 [https://docs.unity3d.com/Manual/LightProbes.html 光照探针]。&lt;br /&gt;
&lt;br /&gt;
请注意，要在 Shadowmask 模式下对动态对象获得正确的混合光阴影，你还需要启用 [[使用手册#Occlusion_probes|occlusion probes]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Render Reflection Probes ===&lt;br /&gt;
为所有打开的场景烘焙反射探针。此按钮仅为方便起见，会调用引擎内置的反射探针更新功能。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update Skybox Probe ===&lt;br /&gt;
为当前的 skybox 烘焙全局漫反射和反射探针。与 “Render Reflection Probes” 一样，它仅调用引擎内置函数。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Occlusion probes ===&lt;br /&gt;
在渲染光照探针时，允许 Unity 使用当前选择的内置光照烘焙器烘焙遮挡探针（occlusion probes）。遮挡探针是存储在普通光照探针中的附加数据，可以防止动态对象在阴影区域被错误照亮。目前在 Unity 中无法使用自定义遮挡探针，必须调用内置光照烘焙器来完成此操作。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Warnings ===&lt;br /&gt;
这些选项会在按下任意 Render 按钮后对场景进行验证，并显示警告对话框，询问是否继续或停止烘焙过程。&lt;br /&gt;
&lt;br /&gt;
* Suppress all popups（屏蔽所有弹窗）：按下 Render 后不显示任何对话框。&lt;br /&gt;
* UV validation（UV 验证）：检查所有模型是否具有完全正确的光照贴图 UV，特别是 UV 是否位于 0-1 范围内且不重叠。&lt;br /&gt;
* Overwrite check（覆盖检查）：显示哪些光照贴图文件将被覆盖。&lt;br /&gt;
* Memory check（内存检查）：显示大致所需的视频内存量。&lt;br /&gt;
* Sample count check（采样数检查）：检查是否有光源、GI 或 AO 的采样数不合理，可能导致 GPU 超出可用资源。&lt;br /&gt;
* Lightmapped prefab validation（光照贴图预制体验证）：验证光照贴图预制体，并在某些预制体将被覆盖时发出通知。&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 (Advanced) ==&lt;br /&gt;
=== Light probe mode ===&lt;br /&gt;
更改光照探针的烘焙方式。&lt;br /&gt;
&lt;br /&gt;
* Legacy（传统模式）：使用 Render Light Probes 按钮生成探针。点光源和方向光在光照烘焙器中计算，而区域光/天空光/间接光则通过在每个探针位置渲染立方体贴图收集。结果以 [https://docs.unity3d.com/ScriptReference/Rendering.SphericalHarmonicsL2.html L2] 球谐（spherical harmonics）形式存储。缺点是立方体贴图渲染速度慢，并且在游戏中使用的着色器未物理正确表示光照表面，或者项目为移动平台设置时，光照贴图和探针可能不匹配（Unity 可能会裁剪高强度值）。&lt;br /&gt;
&lt;br /&gt;
* L1：在点击 Render 时，光照探针会与光照贴图一起渲染。此选项提供更高的烘焙性能，并保证探针光照与光照贴图匹配。结果以 L1 球谐形式存储（仍可被普通着色器使用）。使用 [[#Bakery_shaders|Bakery shader]] 的 Non-Linear Light Probe SH 选项可以进一步提升结果。&lt;br /&gt;
&lt;br /&gt;
* L2：更高质量（完整 L2 球谐）。与 L1 一样，会自动与光照贴图一起渲染。与 L1 相比，性能影响可忽略不计。应在所有着色器下显示正常。探针对比度/方向性/振铃去除可通过 Project Settings -&amp;gt; Bakery -&amp;gt; “Ringing removal for L2 light probes” 调整。&lt;br /&gt;
&lt;br /&gt;
'''在 Unity 2019.3 中似乎存在一个 bug，如果启用 Occlusion Probes 选项，Legacy 光照探针的颜色无法正确保存。使用 Occlusion Probes 时，默认且推荐使用 L2 模式。'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Asset UV Processing ===&lt;br /&gt;
配置资产的 UV 间距（padding）调整。可选值：&lt;br /&gt;
&lt;br /&gt;
* Don't change（不更改）：不修改资产。&lt;br /&gt;
* Adjust UV padding（调整 UV 间距）：会查找具有自动生成 UV 的模型（资产上启用 “Generate Lightmap UVs”），并进一步调整它们，使每个网格的 UV 岛之间具有适当间距。导入器设置中的全模型 Pack Margin 会被忽略。系统会根据每个网格的面积和光照贴图分辨率计算出最优值。&lt;br /&gt;
* Adjust UV padding for new meshes only（仅调整新网格的 UV 间距）：与上面相同，但会跳过之前至少调整过一次的模型。&lt;br /&gt;
* Remove UV adjustments（移除 UV 调整）：撤销所有之前的 UV 调整，使自动展开的模型恢复到 Unity 原始展开的样子。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser ===&lt;br /&gt;
设置所需的去噪器。可选值：&lt;br /&gt;
&lt;br /&gt;
* Optix 5：使用 OptiX 5.1 AI 去噪器（之前称为 “Legacy denoiser”）。在 GPU 上运行。支持从 [https://en.wikipedia.org/wiki/Kepler_(microarchitecture) Kepler]（通常是 GeForce 6xx）到 [https://en.wikipedia.org/wiki/Turing_(microarchitecture) Turing]（通常是 GeForce 20xx）的所有显卡。不支持 [https://en.wikipedia.org/wiki/Ampere_(microarchitecture) Ampere]（30xx）。OptiX 5.1 使用嵌入的静态训练数据集，因此不受驱动实现影响。&lt;br /&gt;
&lt;br /&gt;
* Optix 6：使用 OptiX 6.0 AI 去噪器（之前为默认选项）。在 GPU 上运行。在 Kepler（6xx）显卡上似乎无法使用，但在更新的显卡上均可运行，包括 Ampere（30xx）。自 6.0 起，OptiX 去噪器的训练数据集存储在驱动中。在 v442.50 之前，其行为类似于 OptiX 5.1；但之后 NVIDIA [https://forums.developer.nvidia.com/t/optix7-denoiser-different-results-with-different-version-of-drivers/117989/2 更改了数据集]，结果可能有所不同。更新后的数据集有时可能产生网格状图案和更亮的边缘（仍可通过 “Denoise: fix bright edges” 修复），但运行速度更快。&lt;br /&gt;
&lt;br /&gt;
* Optix 7：使用 OptiX 7.2 AI 去噪器。行为类似 OptiX 6.0，但在 Ampere（30xx）上可能支持更好。&lt;br /&gt;
&lt;br /&gt;
* OpenImageDenoise：使用 Intel Open Image Denoise 库。在 CPU 上运行（任何支持 SSE 4.1 的 CPU）。可能略慢于 OptiX，但质量可比。&lt;br /&gt;
&lt;br /&gt;
* OpenImageDenoise2：使用 Intel Open Image Denoise 2，CUDA 模式。在 GPU 上运行，性能与 OptiX 6/7 相当，质量与 CPU 版本相同。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Adjust sample positions ===&lt;br /&gt;
寻找最佳采样位置以防止光照泄漏。算法详情可参考 [https://ndotl.wordpress.com/2018/08/29/baking-artifact-free-lightmaps/#leaks 此处]。在某些情况下（通常是大型且多边形极少、法线平滑的几何体），可能会产生不正确的结果，此时可以将其禁用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Unload scenes before render ===&lt;br /&gt;
在烘焙前卸载 Unity 场景以释放显存。复杂场景仅在编辑器中显示就可能占用数 GB 的显存。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Denoise ===&lt;br /&gt;
[[File:Image31.png|thumb|左：未开启 “Denoise”，右：开启 “Denoise”。]]&lt;br /&gt;
如果启用，将应用去噪算法。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Fix Seams ===&lt;br /&gt;
[[File:Image22.png|thumb|左：缝隙（“Fix Seams” 关闭），右：缝隙已修复（“Fix Seams” 开启）。]]&lt;br /&gt;
如果启用，将尝试融合由 UV 不连续造成的缝隙。对平滑几何体很有用，包括 Unity 默认的球体。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Split by scene ===&lt;br /&gt;
如果同时加载多个场景，并且启用此选项，每个场景将拥有自己的一套光照贴图，而不会与其他场景共享。这对于在运行时流式加载场景时限制纹理占用量非常有用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hole filling ===&lt;br /&gt;
[[File:Holefilling.jpg|thumb|“Hole filling” 关闭与开启的对比。]]&lt;br /&gt;
如果 Atlas Packer 设置为 xatlas，将尝试填充每个孔洞，从而生成更高效的贴图集。对于几何体非常复杂的场景，可能会增加场景导出时间，但通常推荐开启。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Min resolution ===&lt;br /&gt;
光照贴图的最小尺寸限制。可用于在生成大量小而完全填充的光照贴图与少量未完全填充的光照贴图之间进行平衡。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Scale per map type ===&lt;br /&gt;
允许你对颜色贴图、Shadowmask 和方向贴图设置不同的分辨率缩放。例如，常见情况是间接光颜色分辨率较低，但 Shadowmask 分辨率较高。请注意，缩放在光照贴图渲染完成后才应用，因此不会节省烘焙时间。如果启用了 “Adjust UV padding”，间距将基于最低分辨率的贴图，以防止像素泄漏。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Checker preview ===&lt;br /&gt;
[[File:Image12.png|thumb|Checker Preview 功能演示。]]&lt;br /&gt;
如果勾选了 “Show checker” 选项，场景视图将在可见对象上渲染棋盘格图案，以展示光照贴图像素大小。这对于在烘焙前确保 Texels Per Unit 和其他影响分辨率的设置使用合理数值非常有用。&lt;br /&gt;
&lt;br /&gt;
启用 Checker Preview 将强制 Bakery 执行贴图集打包。可能需要一些时间，但通常不会超过几秒钟。在修改场景内容后，按下 “Refresh checker” 可重新打包场景以查看更改。&lt;br /&gt;
&lt;br /&gt;
Checker Preview 还使用随机颜色显示场景将如何被分割到不同的光照贴图中。&lt;br /&gt;
&lt;br /&gt;
{{note| 当前 Checker Preview 无法显示地形的正确像素大小。}}&lt;br /&gt;
&lt;br /&gt;
==== Atlas preview ====&lt;br /&gt;
[[File:FN-TmhRXwAE9i2I.png|thumb|Atlas Preview 功能演示]]&lt;br /&gt;
当 Checker Preview 开启时，会显示 Atlas Preview 按钮。点击它将打开一个新窗口，显示未来光照贴图的 UV 布局。点击 &amp;quot;&amp;lt;&amp;quot; 和 &amp;quot;&amp;gt;&amp;quot; 按钮可浏览各个光照贴图。&lt;br /&gt;
这对于在烘焙前检查打包质量和光照贴图数量非常有用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Emissive boost ===&lt;br /&gt;
将任何表面自发光（emission）乘以此数值。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Indirect boost ===&lt;br /&gt;
将所有反弹光照乘以此数值。作用与光源组件上的 Indirect Intensity 相同，但为全局设置。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Backface GI ===&lt;br /&gt;
[[File:Image30.jpg|thumb|Backface GI]]&lt;br /&gt;
[[File:Image35.png|thumb|左：“Backface GI” = 0，右：“Backface GI” = 1。注意阴影区域接收到更多的绿色光照。]]&lt;br /&gt;
决定光线通过前面表面到达背面并被全局光照（GI）反弹的程度。这对于薄的半透明表面（如树叶）尤其有用。取值范围为 0-1。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Ambient occlusion ===&lt;br /&gt;
[[File:Image15.png|thumb|左：AO intensity = 0，右：AO intensity = 1。]]&lt;br /&gt;
一种简单的非物理环境光遮蔽（Ambient Occlusion，AO），可在最终场景光照上叠加以增强美观效果。&lt;br /&gt;
&lt;br /&gt;
* Intensity（强度）：控制 AO 效果的可见度。值为 0 时禁用该效果。&lt;br /&gt;
* Radius（半径）：决定 AO 效果使用的光线距离。较小的值产生局部遮蔽（角落、褶皱），较大的值则更类似 Skylight，从远处物体产生阴影。&lt;br /&gt;
* Samples（采样数）：影响环境光遮蔽的质量。典型值为 4 到 32。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dither transparency ===&lt;br /&gt;
通过自动抖动不透明度贴图来启用半透明阴影。[[使用手册#Opacity|了解 Bakery 如何处理不透明度贴图]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== RTX Mode ===&lt;br /&gt;
启用 RTX 硬件加速。仅 RTX 显卡可受益于此选项。最低支持的驱动版本为 418。&lt;br /&gt;
&lt;br /&gt;
驱动可以在大多数非 RTX Nvidia 显卡上模拟 RTX 模式，但通常会更慢。&lt;br /&gt;
&lt;br /&gt;
在 Ampere（3xxx）或更新的显卡上，RTX 模式 ''必须'' 启用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Export terrain trees ===&lt;br /&gt;
如果启用，绘制在地形上的树木将影响光照。树木本身不会被烘焙。请注意，在烘焙过程中，每棵树都使用最高可能的 LOD 等级。对于多公里范围且模型高度复杂的森林场景，不建议使用此选项。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Terrain optimization ===&lt;br /&gt;
如果启用（默认），地形将使用独立的光线追踪技术以利用其高程图几何结构。否则，它们将像其他普通网格一样处理。地形优化可以显著减少高分辨率地形所需的内存占用。在某些情况下，它还能加快地形烘焙速度，但在其他情况下（尤其是简单低分辨率地形）可能需要禁用该选项。&lt;br /&gt;
&lt;br /&gt;
{{note| 地形优化当前不兼容绘制的地形洞。需禁用此选项才能使其正常工作。}}&lt;br /&gt;
{{note| 地形优化仅支持非 RTX 模式。}}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Light Mesh batch limit ===&lt;br /&gt;
如果该值大于 0，会将多个 Light Mesh 合并为一个，前提是它们具有相同设置并影响相同的 Lightmap Groups，同时将它们的总采样数限制为该值（例如，如果限制为 64，则可以合并 2 个采样数为 32 的灯光，或 4 个采样数为 16 的灯光，等等）。在拥有大量 Light Mesh 的场景中，这可以提升性能。但设置过高时需小心，因为 GPU 在一次处理过多采样时可能触发操作系统驱动超时。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Compress volumes ===&lt;br /&gt;
如果启用，将对体积 3D 贴图应用纹理压缩，并将 Bakery 着色器切换到相应的采样模式。不推荐对分辨率非常低的体积使用此选项。体积大小可能会被调整为 4 的倍数。&lt;br /&gt;
&lt;br /&gt;
注意事项：&lt;br /&gt;
&lt;br /&gt;
* 目前仅支持压缩为 BC6H/BC7 纹理格式（桌面/主机平台）。&lt;br /&gt;
* 体积压缩仅支持 Unity 2020.1 或更高版本。&lt;br /&gt;
* 目前仅标准渲染管线的 Bakery 着色器支持使用压缩体积贴图。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Samples multiplier ===&lt;br /&gt;
将所有阴影和 GI 采样数乘以指定因子。可用于在草稿质量和最终质量之间快速切换。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Tile size ===&lt;br /&gt;
与 [[#GPU Priority|GPU Priority]] 相同，但这里设置的是贴图块（tile）大小。Bakery 会将光照贴图拆分为更小的块，并一次更新一个块。块越小，GPU 工作被中断的次数越多，系统响应性可能更好。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Temp path ===&lt;br /&gt;
临时文件夹。在渲染过程中，Bakery 可能需要几个 GB 的可用空间。将此文件夹放在 SSD 上相比 HDD 可略微加快渲染速度。目前，该文件夹不会自动清理。你可以随时手动删除其内容（渲染时除外），或通过 Bakery -&amp;gt; Utilities -&amp;gt; Clear cache 清理。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Output path ===&lt;br /&gt;
光照贴图文件夹。所有光照贴图，以及 lightprobe 和顶点颜色（vertex color）资源都将保存在此处。该路径相对于你的 Assets 文件夹。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Use scene named output path ===&lt;br /&gt;
如果启用此选项，输出路径将自动设置为与当前活动场景同名的文件夹（Assets/CurrentSceneName/）。这与 Unity 内置光照贴图烘焙器的行为类似。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render Selected Groups ===&lt;br /&gt;
仅烘焙包含所选对象的 Lightmap Groups。&lt;br /&gt;
不仅仅是所选对象会被重新绘制，它们所属的所有 Lightmap Groups 都会被处理。其他光照贴图不会被更新。如果对象不属于某个手动分配的组，则使用相同光照贴图的场景部分将被重新烘焙。&lt;br /&gt;
&lt;br /&gt;
目前，使用 [[Partial_scene_baking|Sectors]] 进行场景部分烘焙更为方便。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Beep on finish ===&lt;br /&gt;
如果启用，Bakery 在烘焙完成时会播放提示音。&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 (Experimental) ==&lt;br /&gt;
=== Unwrapper ===&lt;br /&gt;
如果启用 [[#Asset_UV_Processing|Adjust UV Padding]]，则定义将使用的展开器（unwrapper）。&lt;br /&gt;
&lt;br /&gt;
* Default：使用 Unity 标准展开器。Bakery 会为每个具有不同间距参数的网格调用 [https://docs.unity3d.com/ScriptReference/Unwrapping.GenerateSecondaryUVSet.html Unwrapping.GenerateSecondaryUVSet]。&lt;br /&gt;
* xatlas：使用 [https://github.com/jpcy jpcy] 的 [https://github.com/jpcy/xatlas xatlas]，这是 [https://github.com/castano Ignacio Castaño] 的 [https://github.com/Thekla/thekla_atlas thekla_atlas] 的修改版。thekla_atlas 曾用于游戏《The Witness》（[http://the-witness.net/news/2010/03/graphics-tech-texture-parameterization/ 参见博客文章]）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Atlas Packer ===&lt;br /&gt;
选择在将不同对象的 UV 布局打包到大型光照贴图集时使用的算法。&lt;br /&gt;
* Default：Bakery 在 v1.7 之前使用的原始算法。&lt;br /&gt;
* xatlas：使用 xatlas。&lt;br /&gt;
&lt;br /&gt;
某些功能仅支持特定的贴图集打包器：&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Default&lt;br /&gt;
! xatlas&lt;br /&gt;
|-&lt;br /&gt;
| [[使用手册#Bakery_Lightmap_Group_Selector|Override resolution]]&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
|-&lt;br /&gt;
| 高效 LOD 打包&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
|-&lt;br /&gt;
| [[使用手册#Hole_filling|Hole filling]]&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
请注意，贴图集打包器（Atlas Packer）也可以为每个 Lightmap Group 单独选择。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Export geometry and maps ===&lt;br /&gt;
如果启用，Bakery 会在渲染前将场景导出为其专用格式。如果你确定场景的几何体和贴图以及光照贴图分辨率设置没有改变（例如，你只是调整 GI 或光源设置），可以禁用此选项以加快下一次渲染速度。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update unmodified lights ===&lt;br /&gt;
如果启用，Bakery 会重新计算自上次渲染以来未改变的光源。如果你只是调整某个光源，不想等待其他光源重新渲染，可以禁用此选项。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update modified lights and GI ===&lt;br /&gt;
如果启用，Bakery 会重新计算自上次渲染以来发生变化的 GI 和光源。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== UV padding: increase only ===&lt;br /&gt;
仅在启用 [[#Asset_UV_Processing|Adjust UV padding]] 时可见。默认情况下，模型资源的最佳 UV 间距仅基于当前加载的场景进行计算。如果同一模型有多个实例使用不同的光照贴图分辨率，最小的分辨率将决定间距，以确保 UV 图块之间的间距足够大，防止相互重叠。然而，在两个不同的独立场景中烘焙同一模型时，为新场景优化可能会破坏之前场景中的 UV。勾选此选项可以防止这种情况发生，即永远不减小间距值，从而始终为曾经烘焙过的最低分辨率实例进行优化。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoise: fix bright edges ===&lt;br /&gt;
[[File:Image19.png|thumb|左：去噪后可见明亮边缘；右：已修复。]]&lt;br /&gt;
仅在 [[#Denoise|Denoise]] 启用时可见。有时用于去噪的神经网络可能会在阴影周围产生明亮边缘，就像应用了锐化效果一样。如果启用此选项，Bakery 会尝试将其滤除。启用后，去噪阶段可能会略微变慢。&lt;br /&gt;
&lt;br /&gt;
此功能也可用于滤除“火花”（fireflies），即光照贴图中偶尔出现的亮点。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Post-packing ===&lt;br /&gt;
有时在渲染场景时，Bakery 会将光照贴图拆分为多个子光照贴图，例如在烘焙不同 LOD 或地形时。&lt;br /&gt;
Post-packing 会尝试通过将这些子光照贴图合并到同一纹理中来最小化最终贴图集数量。&lt;br /&gt;
建议保持此选项启用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Combine with Enlighten real-time GI ===&lt;br /&gt;
如果启用，则在按下 Render 按钮时，Bakery 会首先尝试使用 Enlighten 烘焙以计算实时 GI。之后，将进行常规的 Bakery 光照贴图烘焙过程。烘焙 GI 和实时 GI 将协同工作。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bake on remote server ===&lt;br /&gt;
启用网络烘焙（[[Network baking|Network baking]]）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Presets ===&lt;br /&gt;
当前在 Experimental 模式下的 Render/Update 按钮下显示。&lt;br /&gt;
&lt;br /&gt;
* 点击 '''New''' 将所有当前设置保存到预设文件中。&lt;br /&gt;
* 默认情况下，当一个预设处于激活状态时，所有设置都会被灰显，以防止覆盖预设。&lt;br /&gt;
* 点击 '''Modify preset''' 可更改设置并覆盖预设。&lt;br /&gt;
* 可以通过预设字段切换预设。将其设置为 None 可禁用预设使用。&lt;br /&gt;
&lt;br /&gt;
== 组件 ==&lt;br /&gt;
=== Bakery Lightmap Group Selector ===&lt;br /&gt;
指定对象及其所有子对象使用的 '''Lightmap Group'''。&lt;br /&gt;
Lightmap Group 是 Bakery 用来表示共享同一光照贴图的对象集合的术语。每个组都有属性，告诉 Bakery 如何打包对象、哪些光源影响它们，以及结果是烘焙到纹理还是顶点。&lt;br /&gt;
&lt;br /&gt;
默认情况下，所有静态对象会自动打包到多个光照贴图组（贴图集）中，因此通常无需手动管理。手动定义组仅用于特殊用途，例如：&lt;br /&gt;
&lt;br /&gt;
* 指定某些对象使用 [[Vertex Lightmaps|每顶点光照贴图]] 而非纹理。&lt;br /&gt;
* 使用建模软件中的原始未缩放 UV 烘焙光照贴图。&lt;br /&gt;
* 将关卡的特定区域分组以使用单张光照贴图，从而便于资源流式加载或通过脚本在运行时切换不同的烘焙光照。&lt;br /&gt;
* 使用 Render Selected Groups 按钮仅更新已分组的对象。&lt;br /&gt;
&lt;br /&gt;
要手动定义组，可以创建 '''Lightmap Group Assets'''，方法包括使用 Assets-&amp;gt;Create 菜单，或在组件中使用 Create New 按钮。使用 Create New 按钮时，将根据以下表单创建新的资源：&lt;br /&gt;
&lt;br /&gt;
* Name：要创建的 Lightmap Group 资源的名称。&lt;br /&gt;
* Packing Mode：此选择器定义 Lightmap Group 的打包模式，共有 3 种模式：&lt;br /&gt;
** Original UV：对象及其子对象将使用未修改的 UV 进行烘焙，不执行打包。适用于多个网格共享同一已打包 UV 布局的模型。&lt;br /&gt;
** Pack Atlas：对象及其子对象将打包到专用纹理贴图集中。在 v1.3 之前，每个可打包的子对象都需要有此组件，但现在不再需要。每个子对象将作为单独矩形打包，除非 Bakery 自动检测到子对象有非重叠的子对象，在这种情况下，多个对象可以使用同一个矩形。&lt;br /&gt;
** Vertex：对象及其子对象将使用顶点色烘焙光照而非纹理。注意，需要使用自定义着色器才能生效，例如 [[#Bakery_shaders|Bakery Shader]]。文档中也提供了一个简单的着色器（“Bakery/Simple Vertex Lightmapped”）用于演示和参考。[[Vertex Lightmaps|了解更多关于顶点光照贴图的信息]]。&lt;br /&gt;
* Directional mode：允许你覆盖该组的 [[#Directional mode|directional mode]]。选项与全局相同，Auto 将使用全局设置。&lt;br /&gt;
* Resolution：所需的光照贴图分辨率。&lt;br /&gt;
* Auto-resolution：使用 [[使用手册#Texels_per_unit|Texels Per Unit]] 来确定最接近的二次幂分辨率。&lt;br /&gt;
* Atlas packer：为该组选择 [[使用手册#Atlas_Packer|贴图集打包]] 算法。&lt;br /&gt;
* Bitmask：用于排除光源影响光照贴图的开关列表。每个 Bakery 光源也有一个位掩码设置。光源只会影响与其共享至少一个开关的 Lightmap Group。默认设置意味着所有光源影响所有光照贴图。&lt;br /&gt;
&lt;br /&gt;
[[File:Ts.jpg|thumb|Transparent selfshadow关闭 vs 开启：注意一些单面但背向的多边形如何被正确照亮。]]&lt;br /&gt;
&lt;br /&gt;
如果你有一个被分配了“Pack Atlas”模式的 Lightmap Group，组件上将会出现额外设置：&lt;br /&gt;
&lt;br /&gt;
* Override resolution：覆盖该对象及其子对象在光照贴图中占用的分辨率。&lt;br /&gt;
* Resolution：手动定义的分辨率。例如，如果你有一个分辨率为 512 的光照贴图，并且分配给 4 个对象，同时覆盖分辨率设置为 256，Bakery 将生成一个 512x512 的光照贴图，每个对象正好占据 256x256 的区域。&lt;br /&gt;
&lt;br /&gt;
如果你选择一个 Lightmap Group 资产，将会显示额外的实验性设置：&lt;br /&gt;
* [[Subsurface scattering|Subsurface scattering: (点击阅读更多)]]&lt;br /&gt;
* Normal offset：允许你将光线从表面偏移。这很少有用，主要用于实验目的。&lt;br /&gt;
* Transparent selfshadow：从表面后方发射光线，使其不会在自身投射阴影。对于半透明叶片可能有用。&lt;br /&gt;
* Vertex sampling density，(仅当 Packing Mode 设置为 Vertex 时可用）：默认情况下，每个顶点只计算一个值；如果采样密度 &amp;gt; 0，则会在三角形上分散采样并求平均，从而生成超采样、更平滑的结果。&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Lightmapped Prefab ===&lt;br /&gt;
此组件允许预制件存储光照贴图元数据。这样处理后的预制件可以在任意场景中实例化，无论是在编辑器中还是运行时。&lt;br /&gt;
该组件应直接添加到预制件的根对象上。不支持嵌套预制件。由于预制件在烘焙后会被覆盖（类似于按下“Apply”按钮的效果），因此要求预制件没有任何未应用的更改（子对象不应移动，材质和脚本参数应保持不变等）。如果检测到此类更改，组件界面会显示错误，烘焙后不会保存任何元数据。如果启用了 [[#Warnings|Lightmapped prefab validation]] 警告，所有预制件错误也会在烘焙前以对话框形式显示。&lt;br /&gt;
&lt;br /&gt;
光照贴图预制件支持所有 Bakery 功能，例如 LOD、地形、方向光贴图、RNM、SH、顶点模式和 Shadowmask。要使 Shadowmask 生效，光源也必须是同一预制件的一部分。&lt;br /&gt;
&lt;br /&gt;
{{note| 注意，由于 API 限制，预制件 Shadowmask 仅在 Unity 2017.4 或更高版本中可用。}}&lt;br /&gt;
&lt;br /&gt;
烘焙后，一个名为 “BakeryPrefabLightmapData” 的对象会被添加到预制件中。该对象包含一个脚本，存储应用光照贴图所需的所有数据。&lt;br /&gt;
&lt;br /&gt;
此外，光照贴图预制件允许保存当前渲染设置，并使用两个按钮将其加载回任意已打开的场景：&lt;br /&gt;
&lt;br /&gt;
* Save current render settings to prefab：在该预制件上存储当前渲染设置的副本。&lt;br /&gt;
* Load render settings from prefab：将当前渲染设置设置为预制件中存储的设置。&lt;br /&gt;
  [[File:Upload 2019-9-17 10-32-34.png|thumb|应用预制件]]&lt;br /&gt;
&lt;br /&gt;
烘焙光照贴图预制件时，建议检查：&lt;br /&gt;
&lt;br /&gt;
* 预制件已“应用”。在旧版 Unity 中，点击 Inspector 右上角的 “Apply” 按钮。在新版 Unity 中，点击 “Overrides” 列表，然后选择 “Apply All”。&lt;br /&gt;
* 预制件组件 UI 不显示任何错误。&lt;br /&gt;
* [推荐] 在主窗口启用 “Lightmapped prefab validation” 复选框。点击 Render 时不会显示任何关于预制件的警告对话框。&lt;br /&gt;
&lt;br /&gt;
{{note| 光照贴图以其烘焙所在的场景或所使用的 Lightmap Group 命名（如果有）。在同一场景中烘焙不同预制件时，请确保使用不同命名的 [[使用手册#Bakery_Lightmap_Group_Selector|Lightmap Group]] 或更改 [[使用手册#Output_path|输出路径]]。}}&lt;br /&gt;
&lt;br /&gt;
{{note| 当使用相同模型逐个烘焙多个预制件时，建议将 [[使用手册#Asset_UV_Processing|Asset UV Processing]] 设置为“Don't Change”，以防止修改共享模型的 UV。}}&lt;br /&gt;
&lt;br /&gt;
{{note| Bakery 的预制件工作流程是在 Unity 提供“预制件双击进入视图”功能之前实现的。因此，在隔离预制件视图中光照贴图可能无法正确应用，组件可能显示 “This GameObject is not a prefab” 信息。但在普通场景中使用时应能正常工作。}}&lt;br /&gt;
&lt;br /&gt;
{{note| 当解包已烘焙的预制件并取消与现有光照贴图的关联时，请确保删除保存预制件范围光照贴图/渲染器连接的 BakeryPrefabLightmapData 对象。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Direct Light ===&lt;br /&gt;
[[File:Directlight.jpg|thumb|纯直射光 + GI]]&lt;br /&gt;
[[File:Image4.png|thumb|左：“Shadow Spread” = 0.01，右：0.05。注意阴影从锐利逐渐变模糊的效果。]]&lt;br /&gt;
无限远方向光（例如太阳）。&lt;br /&gt;
&lt;br /&gt;
* Color：光的颜色。&lt;br /&gt;
* Intensity：线性色彩乘数。&lt;br /&gt;
* Shadow Spread：光源尺寸，或者简单说，阴影的模糊度。0 = 阴影最锐利，1 = 阴影最模糊。从技术上讲，它在单条光线与更宽光锥之间插值。&lt;br /&gt;
* Shadow Samples：影响阴影质量。Shadow Spread 值越小，所需样本越少即可得到干净图像。太阳阴影的典型值为 1 到 16。设置为 0 时，该光源的阴影将消失。&lt;br /&gt;
* Bitmask：用于排除此光源对特定 Lightmap Groups 影响的开关列表。&lt;br /&gt;
* Baked contribution：确定应烘焙哪类光照数据。仅在 Indirect 或 Shadowmask 模式可见。可选值：&lt;br /&gt;
** Direct and Indirect：直射光与间接光都完全烘焙。&lt;br /&gt;
** Indirect only：实时光提供直射贡献，仅烘焙间接光。&lt;br /&gt;
** Shadowmask and indirect：实时光提供直射贡献，静态几何体的阴影烘焙到单独贴图，动态与静态阴影混合。间接光正常烘焙。&lt;br /&gt;
** Direct, Indirect, Shadowmask（仅自定义光照）：与直射和间接相同，但 Shadowmask 也生成，可与自定义着色器一起使用。&lt;br /&gt;
* Denoise shadowmask：确定是否对该光源的 Shadowmask 应用去噪。通常不需要，因为阴影噪点不明显，但对非常宽且模糊的阴影（大 Shadow Spread）可能有用。&lt;br /&gt;
* Indirect intensity：非物理 GI 乘数。自然光照应为 1，可根据场景风格调整。&lt;br /&gt;
* Anti-alias：对阴影执行超采样。&lt;br /&gt;
* Texture projection：在光照上投射乘法平铺纹理，可用于模拟远处云影。&lt;br /&gt;
当设置了纹理投影时，可以使用“Tiling”和“Offset”字段调整其缩放和偏移。或者，点击 &amp;quot;Tweak projection in Scene View&amp;quot; 并使用额外的 Gizmo 可视化移动和缩放投影。点击“Render reference frame”可保存光源视角的 PNG，这对于在场景上绘制云影很有用。&lt;br /&gt;
&lt;br /&gt;
如果同一对象同时启用了 Unity 和 Bakery 光源且参数不匹配，会出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match lightmapped to real-time：将 Unity 光源的通用设置复制到 Bakery 光源。&lt;br /&gt;
* Match real-time to lightmapped：将 Bakery 光源的通用设置复制到 Unity 光源。&lt;br /&gt;
&lt;br /&gt;
{{note| 从物理角度看，Bakery 的方向光强度（Intensity）等于照度（Lux）除以 π。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Sky Light ===&lt;br /&gt;
[[File:Skylight.jpg|thumb|纯天空光与 GI]]&lt;br /&gt;
无限远的带阴影环境光（天空）。&lt;br /&gt;
&lt;br /&gt;
* Color: 颜色。&lt;br /&gt;
* Intensity: 线性色彩倍增。&lt;br /&gt;
* Sky texture: 可选的立方体贴图资源，例如 HDRI 全景图，用于从不同方向影响光照颜色。&lt;br /&gt;
  {{note| 旋转天空光的 GameObject 会相应旋转立方体贴图的光照。}}&lt;br /&gt;
* Samples: 影响阴影质量。典型值为 8 到 32。&lt;br /&gt;
* Hemispherical: 如果启用，光照仅来自上方（上半球）。否则来自所有方向。&lt;br /&gt;
* Bitmask: 用于排除此光源影响特定 Lightmap Groups 的开关列表。&lt;br /&gt;
* Baked contribution: 决定应烘焙哪种光照数据。仅在 Indirect/Shadowmask 模式下可见。可能值：&lt;br /&gt;
** Direct and Indirect: 直接和间接光照都将完全烘焙。这是默认且推荐的天空光行为，因为在 Unity 中没有实时版本可以模拟它们。&lt;br /&gt;
** Indirect only: 假定实时光源提供直接贡献；仅烘焙间接光照。&lt;br /&gt;
&lt;br /&gt;
如果天空光的设置与当前场景的天空盒不匹配，将出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match this light to scene skybox: 将活动天空盒材质的通用设置复制到 Bakery 天空光。当前仅支持使用 “Skybox/Cubemap” 或 “Skybox/Bakery skybox” 着色器的天空盒。&lt;br /&gt;
* Match scene skybox to this light: 将 Bakery 天空光的通用设置复制到场景天空盒。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bakery Light Mesh ===&lt;br /&gt;
[[File:Image29.png|thumb|Left: Samples Near = 0, Samples Far = 4096.&amp;lt;br&amp;gt;&lt;br /&gt;
Middle: Samples Near = 0, Samples Far = 128.&amp;lt;br&amp;gt;&lt;br /&gt;
Right: Samples Near = 16, Samples Far = 128.&amp;lt;br&amp;gt;&lt;br /&gt;
请注意，光照效果看起来相似，但使用的合并采样数量更少。]]&lt;br /&gt;
任何形状的自发光网格。应与 Mesh Renderer 组件或设置为 Area 模式的 Light 组件一起使用。&lt;br /&gt;
&lt;br /&gt;
* Color：颜色&lt;br /&gt;
* Intensity：线性颜色倍增器&lt;br /&gt;
* Cutoff：最大光照距离。Bakery 会在接近该限制时额外衰减正确的平方反比衰减。当 Cutoff 值刚好对应物理衰减变得非常暗的位置时效果最佳。Cutoff 可提升烘焙性能，也可以设置为非常高（不可达）的值以保证完全正确性。&lt;br /&gt;
* Self Shadow：决定光源网格自身是否投射阴影。此选项同时启用更精确的光照算法。&lt;br /&gt;
* Samples Near：影响靠近网格的光照质量。典型值为 16 到 64，仅当 Self Shadow 开启时可用。&lt;br /&gt;
* Samples Far：影响远离网格的光照质量。典型值为 4 到 4096。&lt;br /&gt;
&lt;br /&gt;
Bakery 基于光源表面距离混合两种不同的区域光算法。靠近光源时，算法类似 GI，而远处光源被近似为虚拟点光云。&lt;br /&gt;
&lt;br /&gt;
{{note| &amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;光源网格自身不会接收光照，也不会被烘焙到光照贴图中。&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;一个拥有大量多边形的光源网格比烘焙多个简单的光源网格要快&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;如果结果总是脏/噪点较多，可以尝试将 Samples Near 设置为 0，这样只使用 VPL 算法。对于不需要精度的简单光源（如建筑物的窗户光），这也非常有用。&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;}}  &lt;br /&gt;
[[File:Dd99d-QU0AEKFBK.jpg|thumb|弯曲的光源网格]]  &lt;br /&gt;
* Bitmask：用于排除此光源影响特定 Lightmap Groups 的开关列表。  &lt;br /&gt;
* Baked contribution：决定烘焙哪种类型的光照数据。仅在 Indirect 或 Shadowmask 模式下可见。可能的值：  &lt;br /&gt;
** Direct and Indirect：完全烘焙直接和间接光贡献。这是默认且推荐的光源网格行为，因为 Unity 中没有实时版本可以模拟它们。  &lt;br /&gt;
** Indirect only：实时光源提供直接光贡献，仅烘焙间接光。  &lt;br /&gt;
** Shadowmask and Indirect：实时光源提供直接光贡献，但静态几何体的阴影会烘焙到单独的贴图。动态和静态阴影将混合在一起。间接光照将照常烘焙。目前仅 HDRP（和自定义渲染器）支持混合区域光。  &lt;br /&gt;
** Direct, Indirect, Shadowmask (custom lighting only)：与 Direct and Indirect 相同，但同时生成 Shadowmask 并分配用于自定义着色器。  &lt;br /&gt;
* Indirect intensity：非物理 GI 倍增器。自然光照应设为 1，但可修改以实现更风格化的场景。  &lt;br /&gt;
* Shadowmask with falloff：将完整光衰减烘焙进 Shadowmask（仅对自定义着色器有用）。  &lt;br /&gt;
&lt;br /&gt;
如果网格材质和光源设置不匹配，将出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match light to material：将网格材质或区域光的通用设置复制到 Bakery 光源。&lt;br /&gt;
* Match material to light：将 Bakery 光源的通用设置复制到网格材质或区域光。&lt;br /&gt;
&lt;br /&gt;
==== Light Mesh 与自发光材质的区别 ====&lt;br /&gt;
自发光材质：&lt;br /&gt;
&lt;br /&gt;
* 在 GI 计算中传播光线，因此是“免费的”，无论有多少网格是自发光的。&lt;br /&gt;
* 小而明亮的光可能会产生不准确或有噪点的结果，这取决于 GI 的采样数量。&lt;br /&gt;
* 由于 Bakery 中 GI 的工作方式，它必须占用光照贴图空间，因此可能会浪费空间。同时，这意味着自发光对象需要有效的 UV，并且必须启用“投射阴影”。&lt;br /&gt;
&lt;br /&gt;
Light Mesh：&lt;br /&gt;
&lt;br /&gt;
* 光照会为每个光源单独计算，因此比自发光材质慢。&lt;br /&gt;
* 设计用于为小而明亮的光提供干净的光照效果，即使距离很远也能保持效果。&lt;br /&gt;
* 不占用光照贴图空间。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Point Light ===&lt;br /&gt;
[[File:Image11.png|thumb|左：“Shadow Spread” = 0.5，右：“Shadow Spread” = 1。]]&lt;br /&gt;
点光源，没有面积。尽管在物理上不可能，但在游戏中很有用，并且是匹配 Unity 点光源和聚光灯的唯一方式。&lt;br /&gt;
{{note| 聚光灯只是带有额外投影遮罩的点光源。}}&lt;br /&gt;
&lt;br /&gt;
* Color: 颜色&lt;br /&gt;
* Intensity: 线性色彩倍增&lt;br /&gt;
* Shadow spread: 阴影模糊度。虽然点光源没有面积，但通常希望它仍能产生模糊阴影。为此，阴影被模拟为从球形区域光源投射。此参数定义了虚拟球体的半径，直接影响阴影模糊度。&lt;br /&gt;
* Physical falloff: 如果启用，将使用正确的平方反比衰减，并在边界附近额外衰减。否则将尝试模拟 Unity 的衰减。&lt;br /&gt;
* Falloff min size: 详见 [[Point Light Attenuation]] 部分。&lt;br /&gt;
* Range: 如果物理衰减被禁用，则等于 Unity 的光源范围；如果启用，只会在边缘轻微衰减物理衰减。&lt;br /&gt;
* Samples: 影响阴影质量。典型值为 1 到 512。设置为 0 将使该光源的阴影消失。&lt;br /&gt;
  [[File:Image10.png|thumb|从左到右：Omni，Cookie（默认聚光灯纹理），Cubemap，IES。]]&lt;br /&gt;
* Projection mask: 遮罩/Cookie 类型。选项：&lt;br /&gt;
** Omni: 无遮罩，相当于 Unity 的点光源。&lt;br /&gt;
** Cookie: 纹理投影遮罩。附加选项：&lt;br /&gt;
*** Cookie texture: 2D 纹理资源。Bakery 包含原始 Unity 聚光灯纹理（名为 ftUnitySpotTexture），可用于模拟。&lt;br /&gt;
*** Angle: 纹理投影角度（类似 Unity 聚光灯）。&lt;br /&gt;
*** Correct distortion: 修正宽角下直线可见的 cookie 失真。&lt;br /&gt;
** Cubemap: 立方体贴图投影遮罩。附加选项：&lt;br /&gt;
*** Projected cubemap: 立方体贴图资源。&lt;br /&gt;
** IES: 光照由 IES 文件数据调制。附加选项：&lt;br /&gt;
*** IES file: .ies 扩展名文件。&lt;br /&gt;
* Bitmask: 用于排除该光源影响特定 Lightmap Groups 的开关列表。&lt;br /&gt;
* Baked contribution: 决定应烘焙哪种类型的光照数据。仅在 Indirect 或 Shadowmask 模式下可见。可能值：&lt;br /&gt;
** Direct and Indirect: 直接光和间接光完全烘焙。&lt;br /&gt;
** Indirect only: 实时光提供直接光，仅烘焙间接光。&lt;br /&gt;
** Shadowmask and Indirect: 实时光提供直接光，但静态几何体阴影烘焙到单独贴图中，动态和静态阴影混合，间接光正常烘焙。&lt;br /&gt;
** Direct, Indirect, Shadowmask (custom lighting only): 与 Direct and Indirect 相同，同时生成 Shadowmask 用于自定义着色器。&lt;br /&gt;
* Indirect intensity: 该光的非物理 GI 倍增。自然光应为 1，可根据风格化场景修改。&lt;br /&gt;
* Shadowmask with falloff: 将完整光衰减（除距离外）烘焙到 Shadowmask（仅自定义着色器有用）。&lt;br /&gt;
* Legacy sampling: 使用 Bakery 原始更偏置的阴影采样策略。产生无噪点阴影，但宽半影可能出现条纹。禁用后使用无偏但更有噪点的技术。&lt;br /&gt;
&lt;br /&gt;
如果同一对象同时启用了 Unity 和 Bakery 光源，且设置不匹配，则会出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match lightmapped to real-time: 将 Unity 光的常用设置复制到 Bakery 光。&lt;br /&gt;
* Match real-time to lightmapped: 将 Bakery 光的常用设置复制到 Unity 光。&lt;br /&gt;
&lt;br /&gt;
{{note| 从物理角度来看，Bakery 点光源的“Intensity”为 Candela 除以 Pi。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Volume ===&lt;br /&gt;
[[File:Voldemo notlonely.gif|由 BakeryVolume 照亮的动态门（动态 GIF，由 NOTLonely 制作）]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
体积（Volumes）生成存储每个体素光探针的 3D 纹理（L1 球面调和和阴影贴图），使其成为常规 Unity 光探针的可行替代方案。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Unity Light Probes&lt;br /&gt;
! Unity LPPV&lt;br /&gt;
! Bakery Volumes&lt;br /&gt;
|-&lt;br /&gt;
| 手动放置每个光探针&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 否&lt;br /&gt;
|-&lt;br /&gt;
| 在一个物体上插值多个光探针&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 运行时可移动&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 可以放入预制件&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 完整脚本 API&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| “Ringing” 伪影&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 可能出现&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 可能出现&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 已修正&lt;br /&gt;
|-&lt;br /&gt;
| 去噪&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 运行时开销&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | CPU：低开销；GPU：低开销&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | CPU：中等开销；GPU：中等开销&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#e4ead3;&amp;quot; | CPU：无开销；GPU：中等开销&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bakery Volume 是一个与一组 3D 纹理（3 个 SH 纹理和一个可选的 shadowmask）关联的边界盒，使其非常易于使用和编程。Volumes 可以在运行时轻松地交换、移动、加载或卸载，也可以与预制件关联。它们不需要任何 Light Probe Groups 或手动探针布置；整个 Volume 都由均匀的探针体素网格填充。光/影泄漏会自动像处理光照贴图一样修复（尽管对于较大的体素尺寸，薄的双面墙可能会出现问题，但可以通过在不同侧使用不同 Volume 避免）。由于体素网格的均匀特性，也可以对其应用类似光照贴图的降噪，这是常规光探针无法做到的。此外，Bakery 着色器使用 [https://drive.google.com/file/d/1MK6Clw93q8ljijRjb4gQOzzaIjn1uF9Y/view Geomerics] 采样技巧，完全消除了高对比度 HDR 光照下 SH 有时会产生的 “ringing” 伪影。&lt;br /&gt;
&lt;br /&gt;
因此，Volumes 可以为动态物体生成干净、精细、高质量的烘焙光照（即来自静态物体并影响动态物体的光照，而不是相反）。&lt;br /&gt;
&lt;br /&gt;
Volume 方法的唯一缺点是每像素着色开销较高。其开销类似于 LPPV（随着屏幕上受体素影响的像素数量而缩放），但与 LPPV 不同的是，一旦烘焙完成，Volumes 本身不会再更新。多个 Volume 的混合可以通过稍微重叠它们来避免。&lt;br /&gt;
&lt;br /&gt;
====设置 Volume 变换====&lt;br /&gt;
[[File:Bvolgizmo.jpg|thumb|Volume 控制柄]]&lt;br /&gt;
当 BakeryVolume 被添加到一个 GameObject 时，场景视图中会出现一个边界盒控制柄。拖动小方块即可缩放它。&lt;br /&gt;
&lt;br /&gt;
还有其他方法可以更改 Volume 的大小和位置：&lt;br /&gt;
&lt;br /&gt;
* 将任何可渲染的 GameObject 拖入 “Wrap to object” 字段。Volume 会包裹该对象（及其子对象），以将它们完全包含在内。&lt;br /&gt;
* 如果同一个对象上添加了 Box Collider，则会出现 “Set from box collider” 和 “Set to box collider” 按钮。可以用它们快速在 Volume 和 Collider 之间复制数值。&lt;br /&gt;
&lt;br /&gt;
====分辨率====&lt;br /&gt;
当启用 “Adaptive resolution” 时，体素数量由 “Voxels per unit” 控制。禁用它可以手动输入分辨率。对于大多数 1 单位 = 1 米 的游戏来说，一个合理的 “Voxels per unit” 值是 2，但在某些情况下（例如动态门）使用较小但更高分辨率的 Volume 会更有利。&lt;br /&gt;
&lt;br /&gt;
====其他设置====&lt;br /&gt;
&lt;br /&gt;
* Enable baking: 是否需要（重新）计算 Volume？禁用可防止覆盖已有数据。&lt;br /&gt;
* Denoise: 在烘焙 Volume 后应用去噪。推荐用于高分辨率 Volume。避免用于覆盖许多光源的低分辨率 Volume，因为去噪器难以区分实际内容和噪声。&lt;br /&gt;
* Global: 自动将此 Volume 分配给所有兼容 Volume 的 Shader，除非它们有覆盖设置。内部会调用 Shader.SetGlobalTexture()/SetGlobalVector()。&lt;br /&gt;
====使用方法====&lt;br /&gt;
Volumes 可以分配给使用 Volume 感知 Shader 的对象。Bakery 自带实现该功能的 “Bakery Standard” Shader，以及 HDRP 和 URP 的 Shader 图。请查看 example_volumes 场景，了解应用 Volume 的各种方式。&lt;br /&gt;
&lt;br /&gt;
====提示====&lt;br /&gt;
&lt;br /&gt;
* 确保查看示例。&lt;br /&gt;
* 如果两个 Volume 相连，让它们略微重叠。重叠大小应等于最大动态对象的尺寸。这样在运行时简单切换 Volume 就能正常工作。&lt;br /&gt;
* 仅在动态对象实际可达的区域放置 Volume。例如，使用玩家高度限制 Volume 的高度。&lt;br /&gt;
&lt;br /&gt;
====旋转 Volumes====&lt;br /&gt;
如果启用 “Rotate around Y” 选项，Volumes 可以绕 Y 轴旋转。旋转开销非常低，只使用 2 个额外的浮点数据（预计算的角度 sin/cos）。&lt;br /&gt;
&lt;br /&gt;
还可以在运行时旋转 Volumes（Experimental -&amp;gt; “Support rotation after bake” 以及 Bakery Shader 中的类似选项），这种情况下 Volume 必须在初始旋转为零时进行烘焙。&lt;br /&gt;
&lt;br /&gt;
在 URP 中，这种动态旋转可以与 `BakeryURPVolumeGraphRotatable.shadergraph` 一起使用。&lt;br /&gt;
&lt;br /&gt;
对于全局 Volume，动态旋转会在组件被（重新）启用或调用 `volume.SetGlobalParams()` 时更新。使用局部旋转 Volume 时，需要手动在材质或 MaterialPropertyBlock 上设置旋转：&lt;br /&gt;
{{code|&amp;lt;nowiki&amp;gt;SetMatrix(&amp;quot;_VolumeMatrix&amp;quot;, volume.GetMatrix())&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
====技术信息====&lt;br /&gt;
Volumes 可以自动工作（查看示例场景），也可以通过脚本控制其使用方式。&lt;br /&gt;
&lt;br /&gt;
可以通过组件的以下公共属性获取 Volume 数据：&lt;br /&gt;
&lt;br /&gt;
* `bakedTexture0`：存储 L0 RGB 系数和 L1 Z 红色通道在 alpha 中。&lt;br /&gt;
* `bakedTexture1`：存储 L1 X RGB 系数和 L1 Z 绿色通道在 alpha 中。&lt;br /&gt;
* `bakedTexture2`：存储 L1 Y RGB 系数和 L1 Z 蓝色通道在 alpha 中。&lt;br /&gt;
* `bakedMask`：存储体积阴影遮罩。&lt;br /&gt;
* `bounds`：Volume 的包围盒。&lt;br /&gt;
&lt;br /&gt;
所有 `bakedTexture*` 使用 RGBAHalf（每体素 8 字节）格式，mask 使用 ARGB32（每体素 4 字节）。阴影遮罩也可以使用单通道 R8 格式（每体素 1 字节）。&lt;br /&gt;
&lt;br /&gt;
因此 Volume 的字节大小 = width * height * depth * 3 * 8 + （仅当使用阴影遮罩时）width * height * depth * 4（或使用 R8 mask 时为 width * height * depth）。&lt;br /&gt;
&lt;br /&gt;
[[使用手册#Compress_volumes|可以对 Volume 启用纹理压缩]]，使其体积显著减小。&lt;br /&gt;
&lt;br /&gt;
采样 Volume 需要特殊 Shader，这些 Shader 已包含在 Bakery 中。要在自定义 Shader 中添加 Volumes，请查看 HDRP/URP 包中包含的 `BakeryVolume_float()` 函数（位于 `BakeryDecodeLightmap.hlsl`）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Light Filter ===&lt;br /&gt;
[[File:Output optimized.gif|彩色玻璃，如在 &amp;quot;Bakery Real-Time Preview&amp;quot; 中所见。Bakery lightmapper 烘焙出的结果相同。]]&lt;br /&gt;
&lt;br /&gt;
将渲染器标记为光过滤器（Light Filter）。过滤器会用其颜色着色所有直接和间接光线，类似于现实中的光学滤镜，从而实现彩色透明效果（例如彩色玻璃）。唯一的参数是用于着色的纹理。&lt;br /&gt;
&lt;br /&gt;
* 光过滤器对象仍然会像其他对象一样接收光照贴图。&lt;br /&gt;
* 过滤器不会散射或模糊光线（如需此效果，请尝试 [[Subsurface_scattering|Subsurface Scattering]] 或 [[使用手册#Backface_GI|Backface GI]]）。&lt;br /&gt;
* 过滤器可以产生带颜色的阴影。如果灯光使用 [[使用手册#Shadowmask|Shadowmask]] 模式，则结果只会保存 R 通道（因为 Unity 仅支持单通道遮罩）。对于完全烘焙的阴影，则没有限制。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Sector ===&lt;br /&gt;
参见 '''[[Partial_scene_baking|Partial scene baking]]'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Always Render ===&lt;br /&gt;
如果添加到一个物体上，Bakery 在烘焙时将始终考虑该物体，即使它的 Renderer 被禁用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
=== Bakery Pack As Single Square ===&lt;br /&gt;
如果添加到一个物体上，Bakery 会将该物体及其子物体的 UV 视为单个组合方块，在自动图集打包或 Lightmap Group 的 Pack Atlas 模式下，它们之间永远不会被移动。整个子层级将作为一个整体打包。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
=== Bakery Shared LOD UV ===&lt;br /&gt;
如果添加到一个 LODGroup 上，将标记所有同名 LOD 共享同一个光照贴图。默认情况下，每个 LOD 网格会获得独立的光照贴图，占用图集空间；但如果已知同一个物体的 LOD 拥有相似的 UV2（或者在没有 UV2 且 UV1 不重叠的情况下），它们可以映射到图集的同一部分，从而节省内存。&lt;br /&gt;
这种技术也称为 [https://github.com/laurenth-personal/LODLightmapScripts/ Lightmap Stealing]。&lt;br /&gt;
&lt;br /&gt;
= 材质兼容性 =&lt;br /&gt;
&lt;br /&gt;
=== 漫反射和发光 ===&lt;br /&gt;
Bakery 利用 [https://docs.unity3d.com/Manual/MetaPass.html Meta Pass] 系统支持大多数 Unity 材质。所有内置、Surface、URP 和 HDRP 着色器都已经定义了正确的 Meta Pass。&lt;br /&gt;
&lt;br /&gt;
如果你使用的是 Unlit 着色器，需要按照 Unity 文档手动添加 Meta Pass。&lt;br /&gt;
&lt;br /&gt;
如果未定义该 Pass，Bakery 将假定 {{codeVar|_MainTex}}、{{codeVar|_BaseColorMap}} 或 {{codeVar|_Color}}（如果未设置纹理）为材质的漫反射（Albedo），并将 {{codeVar|_EmissionMap}} 和 {{codeVar|_EmissionColor}} 作为发光颜色。&lt;br /&gt;
&lt;br /&gt;
为了使发光生效，[https://docs.unity3d.com/ScriptReference/Material-globalIlluminationFlags.html Material.globalIlluminationFlags] 必须设置为 [https://docs.unity3d.com/ScriptReference/MaterialGlobalIlluminationFlags.BakedEmissive.html MaterialGlobalIlluminationFlags.BakedEmissive]。标准着色器会自动设置此值。&lt;br /&gt;
&lt;br /&gt;
=== 不透明度 ===&lt;br /&gt;
[[File:Upload 2019-1-25 0-4-30.png|thumb|材质参数被转换为 Cutout（默认）]]&lt;br /&gt;
[[File:Alphacombos dither.jpg|thumb|通过“Dither Transparency”选项添加半透明值]]&lt;br /&gt;
[[File:Alphacombos filter.jpg|thumb|Light Filter 组件用于红色平面，生成彩色阴影]]&lt;br /&gt;
&lt;br /&gt;
默认情况下，Bakery 始终从 {{codeVar|_MainTex}}、{{codeVar|_BaseColorMap}} 或 {{codeVar|_BaseMap}} 的 alpha 值获取全分辨率的不透明度，并将其视为 Cutout（1 位透明）。&lt;br /&gt;
&lt;br /&gt;
当启用 '''Dither Transparency''' 选项时，半透明值会自动转换为可变蓝噪声，然后被滤波/模糊，产生部分透明效果（以前可以通过自定义手动抖动贴图实现，但从 v1.97 起自动完成）。&lt;br /&gt;
&lt;br /&gt;
为了使不透明度生效，着色器的 [https://docs.unity3d.com/Manual/SL-SubShaderTags.html RenderType 标签] 必须为以下值之一：&lt;br /&gt;
&lt;br /&gt;
* {{codeVar|Transparent}}&lt;br /&gt;
* {{codeVar|TransparentCutout}}&lt;br /&gt;
* {{codeVar|TreeLeaf}}&lt;br /&gt;
&lt;br /&gt;
如果存在名为 {{codeVar|_Cutoff}} 的属性，它将影响 Cutout（因此 Standard 着色器的 Cutoff 滑块会自动生效）。&lt;br /&gt;
&lt;br /&gt;
在没有 Dither Transparency 的情况下，如果材质 RenderType 为 {{codeVar|Transparent}} 或 {{codeVar|TreeLeaf}}，则 {{codeVar|_Color}} 的 alpha 值会额外修改 Cutoff：&lt;br /&gt;
''finalCutoff = 1 - (1 - cutoff) * alpha''&lt;br /&gt;
&lt;br /&gt;
对于彩色透明效果，请使用 [[Manual#Bakery_Light_Filter|Light Filter]] 组件。&lt;br /&gt;
&lt;br /&gt;
有关漫反射半透明效果，请参考 [[#Backface GI|Backface GI]] 和 [[subsurface scattering]]。&lt;br /&gt;
&lt;br /&gt;
==== Alpha Meta Pass ====&lt;br /&gt;
从 v1.9 起，Bakery 还支持指定基于自定义着色器的透明度，但这需要使用兼容的着色器。要使用 ''Alpha Meta Pass''，需要执行以下步骤：&lt;br /&gt;
&lt;br /&gt;
* 在着色器中添加一个名为 '''BAKERY_META_ALPHA_ENABLE''' 的属性。例如：&lt;br /&gt;
  {{code|&amp;lt;nowiki&amp;gt;[HideInInspector] BAKERY_META_ALPHA_ENABLE (&amp;quot;Enable Bakery alpha meta pass&amp;quot;, Float) = 1.0&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
* 确保 RenderType 标签设置为上文提到的某个值。&lt;br /&gt;
* 声明一个名为 '''META_BAKERY''' 的 Pass。&lt;br /&gt;
* 在该 Pass 中检查 '''unity_MetaFragmentControl.w''' 是否非零，如果是，则返回计算出的透明度值。&lt;br /&gt;
&lt;br /&gt;
示例可参考包内的 ''Baked_Alpha_meta.shader''。&lt;br /&gt;
&lt;br /&gt;
注意：当前 Alpha Meta Pass 需要将 Light Probe Mode 设置为 L1 或 L2。&lt;br /&gt;
&lt;br /&gt;
=== Normal mapping ===&lt;br /&gt;
自定义表面法线可以与 [[#Baked Normal Maps|烘焙法线贴图]] 模式一起使用。不幸的是，Unity 的 Meta Pass 默认不输出法线信息，因此默认情况下，法线取自名为 {{codeVar|_BumpMap}} 的贴图，并通过 {{codeVar|_MainTex_ST}} 进行额外变换。&lt;br /&gt;
&lt;br /&gt;
然而，可以制作完全自定义的着色器，带有高级法线映射功能（例如混合多层法线），并使其兼容烘焙。要实现这一点，需要执行以下步骤：&lt;br /&gt;
&lt;br /&gt;
1. 在着色器中定义一个 Meta Pass，具体方法请参考 [https://docs.unity3d.com/Manual/MetaPass.html#ExampleMetaPassUnity 文档]。&lt;br /&gt;
&lt;br /&gt;
2. 将该 Pass 命名为 {{codeVar|&amp;quot;META_BAKERY&amp;quot;}}，而不仅仅是 {{codeVar|&amp;quot;META&amp;quot;}}。&lt;br /&gt;
&lt;br /&gt;
3. 包含文件 {{codeVar|&amp;quot;BakeryMetaPass.cginc&amp;quot;}}。&lt;br /&gt;
&lt;br /&gt;
4. 添加 {{codeVar|#pragma vertex vert_bakerymt}}。&lt;br /&gt;
&lt;br /&gt;
5. 如果 {{codeVar|unity_MetaFragmentControl.z}} 变量不为 0，着色器应返回世界空间法线。返回的法线应使用 {{codeVar|BakeryEncodeNormal}} 函数编码。&lt;br /&gt;
&lt;br /&gt;
在 Assets/Bakery/examples/shaders 中包含了两个实现了扩展 Meta Pass 的示例着色器。&lt;br /&gt;
&lt;br /&gt;
你也可以复制并修改 BakeryMetaPass.cginc 以满足你的需求，例如从顶点着色器传递额外数据。&lt;br /&gt;
&lt;br /&gt;
=== 正/背面 ===&lt;br /&gt;
无论着色器使用何种剔除模式，Bakery 都将所有背面视为不透明，这意味着任何直接光线都不会穿过背面，就像它不会穿过正面一样。&lt;br /&gt;
然而，如果使用 [[使用手册#Backface_GI|Backface GI]]，背面可以部分发出正面接收到的光照。&lt;br /&gt;
&lt;br /&gt;
= 扩展 Lightmap Parameters 资源 =&lt;br /&gt;
[[File:Lp.jpg|thumb|扩展 Lightmap Parameters]]&lt;br /&gt;
类似于 Bakery 的 [[#Bakery_Lightmap_Group_Selector|Lightmap Group]]，Unity 也有 [https://docs.unity3d.com/Manual/class-LightmapParameters.html Lightmap Parameters]，可以作为资源创建并分配给 Mesh Renderer。它们的逻辑有相似之处也有不同之处：&lt;br /&gt;
&lt;br /&gt;
* Lightmap Group 的主要用途是将多个对象组合到同一个图集。此外，它还允许覆盖该图集的烘焙设置。&lt;br /&gt;
* Lightmap Parameters 主要用于覆盖对象的烘焙设置，但通过使用“Baked Tag”选项，它们也可以影响打包：具有不同 Baked Tag 的对象将永远不会共享同一个图集。&lt;br /&gt;
&lt;br /&gt;
由于有些用户更习惯 Lightmap Parameters 的工作流程，Bakery 现在支持并扩展了它们：&lt;br /&gt;
&lt;br /&gt;
* Bakery 会遵循 Baked Tag 设置。&lt;br /&gt;
* Lightmap Parameters UI 中将显示额外的 Bakery 特定选项。有关其含义，请参考 [[#Bakery_Lightmap_Group_Selector|Lightmap Group]] 部分。&lt;br /&gt;
&lt;br /&gt;
= 项目设置 =&lt;br /&gt;
一些全局设置可以在 Project Settings -&amp;gt; Bakery GPU Lightmapper 中调整（此选项仅在 Unity 2018.3 或更新版本可见；旧版本请编辑 BakeryProjectSettings.asset）：&lt;br /&gt;
&lt;br /&gt;
* Mipmap lightmaps：启用光照贴图的 mipmap。随着图集变小，可能会导致 UV 图块之间的泄漏；另一方面，它可以减少远处高分辨率光照贴图的锯齿。总体上，建议对非常远的物体使用单独烘焙的 LOD 以及较低分辨率的光照贴图。&lt;br /&gt;
* Color file format：常规 HDR 颜色光照贴图的文件格式。可选值：&lt;br /&gt;
**HDR：Radiance HDR 格式（默认）。可用多种图像编辑器打开。&lt;br /&gt;
**Asset：Unity 原生格式。可自定义 mipmap 数量。&lt;br /&gt;
* Mask/Direction file format：额外 LDR 地图的格式，如阴影遮罩或方向数据。可选值：&lt;br /&gt;
**TGA：8 位 Targa（默认）。&lt;br /&gt;
**PNG：8 位 PNG。通常比 TGA 占用更少磁盘空间。&lt;br /&gt;
**Asset：Unity 原生格式。可自定义 mipmap 数量。&lt;br /&gt;
* Compress lightmaps：定义光照贴图资源的压缩行为。压缩光照贴图占用更少的显存，但可能会出现一些视觉伪影（例如色带或色斑），具体取决于压缩类型（移动端压缩问题请参见[[Troubleshooting#I_have_an_Android_project.2C_and_lightmaps_don.27t_look_good|此处]]）。可选值：&lt;br /&gt;
*** Compress but allow overriding asset: 新的光照贴图将在启用压缩的情况下创建。创建后，可以在 Inspector 中更改它们的压缩设置。修改后的值将在重新烘焙后保留（默认）。&lt;br /&gt;
*** Force compress: 始终压缩所有光照贴图。&lt;br /&gt;
*** Force no compress: 始终生成未压缩的光照贴图。&lt;br /&gt;
* High quality direction: 为方向贴图启用“高”质量压缩。实际格式取决于平台。例如在 PC 上，它会从 DXT1 改为 BC7，这提供了更高的质量，但 VRAM 使用量会翻倍。&lt;br /&gt;
* Texel padding (default atlas packer): 定义在使用默认 atlas 打包器时，在光照贴图 atlas 中对象 UV 布局之间添加多少空白 texel。&lt;br /&gt;
* Texel padding (xatlas packer): 同上，但在使用 xatlas 时。&lt;br /&gt;
* Alpha Meta Pass resolution multiplier: 乘以 [[Manual#Alpha_Meta_Pass|Alpha Meta Pass]] 的分辨率，使在低分辨率光照贴图烘焙时仍能实现精确的基于 Shader 的切割效果。&lt;br /&gt;
* Volume render mode: 为所有 [[Manual#Bakery_Volume|Volumes]] 使用哪种 [[Manual#Render_mode|渲染模式]]？Auto 使用当前活动的渲染模式（默认）。&lt;br /&gt;
* Delete previous lightmaps before bake: 在烘焙新光照贴图之前，实际删除该场景中所有之前渲染的光照贴图文件。&lt;br /&gt;
* Log level: 定义烘焙过程中在控制台输出的信息量。可能的值：&lt;br /&gt;
** 0: 不输出任何内容。&lt;br /&gt;
** 1: 仅输出进度信息。&lt;br /&gt;
** 2: 仅输出警告。&lt;br /&gt;
** 3: 输出全部信息。&lt;br /&gt;
* Alternative scale in lightmap: 使渲染器属性 'Scale in Lightmap' 的行为更类似于 Unity 内置的行为。&lt;br /&gt;
* Align to texture compression blocks with xatlas: 使 xatlas 将 chart 对齐到 4x4 块边界，从而获得更适合压缩的结果。&lt;br /&gt;
* Generate smooth positions: 是否应调整采样位置以防止低多边形几何体在平滑法线下产生错误阴影？在使用法线差异极大的几何体时，可在极少数情况下禁用。技术说明见 [https://ndotl.wordpress.com/2018/08/29/baking-artifact-free-lightmaps/#shadowterm 这篇文章]。&lt;br /&gt;
* Smooth positions per-triangle: 是否应按三角形决定平滑/平面位置？在使用法线差异极大的几何体时，可在极少数情况下禁用。&lt;br /&gt;
* Use 'Receive GI' values: 在渲染器上考虑 “Receive Global Illumination” 值。最初 Bakery 会忽略它。&lt;br /&gt;
* Remove ringing in Legacy light probes: 在 Legacy 模式下启用更柔和的光探针卷积，以防止高对比度区域出现伪影。&lt;br /&gt;
* Always render reflection probes: 在每次 Render/Render Light Probes 后自动渲染反射探针。&lt;br /&gt;
* Ringing removal for L2 light probes: 对 [[Manual#Light_probe_mode|L2 光探针]] 应用去振铃处理。值越高，探针光照越平滑；这种平滑可以减少 [[https://docs.unity3d.com/6000.2/Documentation/Manual/light-probes-troubleshooting.html](https://docs.unity3d.com/6000.2/Documentation/Manual/light-probes-troubleshooting.html) 振铃] 伪影（如果存在）。&lt;br /&gt;
* Put menu under Tools: 将 Bakery 菜单放入 Tools 菜单下。&lt;br /&gt;
&lt;br /&gt;
如果任何格式设置为 Asset 且启用 mipmapping，会显示额外选项：&lt;br /&gt;
&lt;br /&gt;
* Maximum mipmap count: 定义 mipmap 的最大数量。例如，设置为 2，则 8K 光照贴图仅有两个额外 mipmap：4K 和 2K。更低分辨率将被省略，从而在 mipmapping 过程中限制泄漏伪影。&lt;br /&gt;
&lt;br /&gt;
= SkinnedMeshRenderer 支持 =&lt;br /&gt;
Bakery 自 v1.65 起支持蒙皮网格 (skinned meshes)。但是，有一些限制：&lt;br /&gt;
&lt;br /&gt;
* 某些 Unity 版本不支持蒙皮网格的 UV1，并会悄无声息地忽略 “Generate lightmap UVs”。请确保场景中实际使用的网格具有 UV1，并在可能的情况下使用非重叠的 UV0；&lt;br /&gt;
* UV 填充调整在蒙皮网格上不起作用（Unity 在尝试调用 Unwrap 函数时似乎会崩溃）；&lt;br /&gt;
* 蒙皮网格不能使用每顶点光照贴图 (per-vertex lightmaps)（引擎不支持带蒙皮的 additionalVertexStreams）。&lt;br /&gt;
&lt;br /&gt;
= Shader Tweaks =&lt;br /&gt;
[[File:Image2.jpg|thumb|左：默认双线性过滤。右：双三次过滤。]]&lt;br /&gt;
[[File:Image34.jpg|thumb|左：两个阴影都已烘焙。&amp;lt;br&amp;gt;中：球形阴影为动态，另一个阴影为静态。通过相乘组合在一起。&amp;lt;br&amp;gt;右：与中间相同，但使用默认最小值组合。]]&lt;br /&gt;
&lt;br /&gt;
Bakery 提供可选的着色器修改，可以应用到 Unity 着色器上，以改善光照贴图采样并使实时光照更接近光照贴图效果。着色器调整菜单可以通过 Bakery-&amp;gt;Shader Tweaks 访问。&lt;br /&gt;
&lt;br /&gt;
这些选项会修补基础 Unity 着色器包含文件（来自 CGIncludes 文件夹），这些文件被大多数内置和第三方着色器使用。所有修改都会影响使用该版本编辑器打开的所有项目，但也可以轻松恢复。着色器调整会影响标准和表面着色器的工作方式。HDRP、URP 以及其他 SRP 不受影响。&lt;br /&gt;
&lt;br /&gt;
所有可用修改显示为按钮。点击按钮应用修改，按钮将保持按下状态。再次点击按钮即可移除修改。目前可用选项：&lt;br /&gt;
&lt;br /&gt;
{{note| 可能需要以管理员身份运行 Unity 编辑器以使 CGIncludes 修补生效}}&lt;br /&gt;
&lt;br /&gt;
* Use bicubic interpolation for lightmaps: 光照贴图将使用双三次插值代替默认双线性。此调整能很好地修复低分辨率光照贴图的许多锯齿边缘。目前仅适用于 DX11 和现代主机，其他平台仍使用双线性。&lt;br /&gt;
* Use multiplication for shadowmask: 使用相乘代替最小值组合静态和动态阴影。出于未知原因，Unity 默认使用最小值操作符，这会产生一些乘法不存在的伪影。&lt;br /&gt;
* Use physical light falloff (forward): 用更物理正确的平方反比替换实时点光/聚光灯的默认衰减。“Range” 只会在边缘略微淡出（与 Bakery 光源启用 Physical Falloff 复选框效果一致）。仅影响 Forward 渲染器。详情见 [[Point Light Attenuation]]。&lt;br /&gt;
* Use physical light falloff (deferred): 同上，但仅影响 Deferred 渲染器。&lt;br /&gt;
&lt;br /&gt;
'''衰减调整在 Unity &amp;gt;2017 版本上可能无法完全生效。此外，SRP 默认已经使用正确的衰减。'''&lt;br /&gt;
&lt;br /&gt;
= Bakery shaders =&lt;br /&gt;
Bakery 包含了自带着色器，支持顶点光照贴图，以及 RNM 和 SH 方向模式。它还允许从方向数据计算近似烘焙高光。&lt;br /&gt;
对于普通颜色光照贴图、阴影遮罩和 Dominant Direction 模式，Bakery 着色器 '''不是必需的'''，因为这些功能大多数 Unity 着色器本身已经支持。&lt;br /&gt;
&lt;br /&gt;
=== Standard render pipeline ===&lt;br /&gt;
'''Bakery/Standard''': 扩展了普通 Standard 着色器。额外选项：&lt;br /&gt;
&lt;br /&gt;
* Allow Vertex Lightmaps: 允许该材质用于 [[Vertex Lightmaps|顶点光照贴图]]。&lt;br /&gt;
* Allow RNM Lightmaps: 允许该材质用于 [[#RNM|RNM 方向模式]]。&lt;br /&gt;
* Allow SH Lightmaps: 允许该材质用于 [[#SH|SH 方向模式]]。&lt;br /&gt;
  {{note| 所有 “Allow” 选项会在着色器中启用特定的代码路径。为了性能考虑，建议每个材质仅使用一个 “allow” 选项。}}&lt;br /&gt;
* Enable Lightmap Specular: 使用 Dominant Direction、RNM 或 SH 方向模式的数据计算烘焙高光。注意，由于信息有限，该效果仅为近似。如果你曾在 Unity 4 中使用烘焙高光，效果应可比。与高度扰动的法线贴图搭配效果最佳，在平面表面上效果不佳。&lt;br /&gt;
* Enable VertexLM directional: 如果存在顶点光照贴图，指定 Dominant Direction 数据存储在顶点中并应被使用。&lt;br /&gt;
* Enable VertexLM SH: 如果存在顶点光照贴图，指定 SH 数据存储在顶点中并应被使用。&lt;br /&gt;
* Enable VertexLM Shadowmask: 如果存在顶点光照贴图，指定阴影遮罩存储在顶点中并应被使用。&lt;br /&gt;
* Enable MonoSH: 将方向贴图视为 MonoSH 贴图。&lt;br /&gt;
[[File:Image5.png|thumb|Standard SH light probe vs non-linear]]&lt;br /&gt;
[[File:Shspec.jpg|thumb|SH specular effect]]&lt;br /&gt;
* Non-linear SH：在 SH 方向模式下，此选项可以增强对比度（更接近真实效果），但会使着色器稍微变慢。该技巧基于 Geomerics 的论文《[https://drive.google.com/file/d/1MK6Clw93q8ljijRjb4gQOzzaIjn1uF9Y/view Reconstructing Diffuse Lighting from Spherical Harmonic Data]》。&lt;br /&gt;
* Non-linear Light Probe SH：与 Non-linear SH 类似，但用于光照探针。在探针的情况下，最显著的好处是消除错误的负值。这种问题常见于具有高对比度、明亮 HDR 光源的场景中。这是球谐函数的固有限制，而不是 Bakery 特有的问题（即使用 Unity 内置光照贴图器也可能出现类似伪影）。&lt;br /&gt;
* Force Bicubic Filter：为所有附加贴图启用双三次滤波。若要实现完整的双三次滤波（包括第一张颜色贴图），建议同时在 [[#Shader Tweaks|Shader Tweaks]] 中启用该功能。&lt;br /&gt;
&lt;br /&gt;
'''Bakery/Standard Specular'''：与 Standard 相同，但用于高光（Specular）工作流程。&lt;br /&gt;
&lt;br /&gt;
=== HDRP &amp;amp; URP ===&lt;br /&gt;
要提取额外的 HDRP/URP 着色器，请打开 Bakery 自带的 Bakery_ShaderGraphHDRP.unitypackage 或 Bakery_ShaderGraphURP.unitypackage。&lt;br /&gt;
在其中，你会找到可在自己 Shader Graph 中使用的 Shader Subgraph，以及一些示例材质。&lt;br /&gt;
&lt;br /&gt;
=== 各着色器功能支持对比 ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! 大多数 Unity 着色器&lt;br /&gt;
! 大多数 HDRP 和 URP 着色器&lt;br /&gt;
! Bakery Standard&lt;br /&gt;
! Bakery HDRP graphs&lt;br /&gt;
! Bakery URP graphs&lt;br /&gt;
|-&lt;br /&gt;
| HDR color lightmaps&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Shadowmask&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是 (&amp;gt;= URP 10.1)&lt;br /&gt;
|-&lt;br /&gt;
| Dominant Direction&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| RNM&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| SH&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Mo否SH&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Lightmap specular&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持 Dominant Direction 和 SH&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持 Dominant Direction&lt;br /&gt;
|-&lt;br /&gt;
| Bicubic filtering&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是,&lt;br /&gt;
通过 [[#Shader Tweaks|Shader Tweaks]] 支持&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是,&lt;br /&gt;
通过 [[#Shader Tweaks|Shader Tweaks]] 支持&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
|-&lt;br /&gt;
| Vertex lightmaps&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 单一颜色，没有每顶点 SH、方向或阴影遮罩（Shader Graph 限制）&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 单一颜色，没有每顶点 SH、方向或阴影遮罩（Shader Graph 限制）&lt;br /&gt;
|-&lt;br /&gt;
| Non-Linear Light Probes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Volumes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Volume shadowmask&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Compressed volumes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{note| 除了普通颜色光照贴图之外，所有功能都至少需要 Shader Model 3.0 才能运行。}}&lt;br /&gt;
{{note| 使用 SH 模式的顶点光照贴图由于插值器数量限制，至少需要 Shader Model 4.0。}}&lt;br /&gt;
{{note| 含有从 Dominant Direction 生成高光的更新版 URP 图表可在 [[Bakery_-_GPU_Lightmapper|主维基页面]] 下载。}}&lt;br /&gt;
&lt;br /&gt;
另请参阅：[[Integrating_Bakery_shader_features_to_custom_shaders| 将 Bakery 着色器特性集成到自定义着色器中]]&lt;br /&gt;
&lt;br /&gt;
= 关于 HDRP/URP 的说明 =&lt;br /&gt;
将该插件导入到 HDRP 或 URP 项目后，一般即可直接使用，但需要注意以下几点：&lt;br /&gt;
&lt;br /&gt;
* 示例场景中同时使用了普通 Standard 着色器以及部分 “Bakery Standard” 着色器。HDRP 和 URP 提供了将项目着色器从 Standard 升级到 Lit 的机制，但无法从 Bakery Standard 升级。请将 Bakery Standard 材质替换为来自 Bakery_ShaderGraphHDRP.unitypackage 或 Bakery_ShaderGraphURP.unitypackage 中的材质。&lt;br /&gt;
&lt;br /&gt;
* 在 HDRP 中，默认 HDRI 天空亮度较高（11），且天空反射默认不会被遮蔽。再加上默认的自动曝光，可能导致某些示例场景几乎不可见，因为它们使用了更低的亮度进行烘焙。此时可将 HDRI 天空亮度降低到 1。HDRI 设置通常位于 Assets/HDRPDefaultResources/DefaultSettingsVolumeProfile 中。&lt;br /&gt;
&lt;br /&gt;
* 在 HDRP 中，如果示例场景中的灯光过亮，可在 Bakery 灯光组件上点击 “match real-time to lightmapped” 按钮。&lt;br /&gt;
&lt;br /&gt;
* 在 HDRP 中建议使用 OpenImageDenoise 2（最佳）或 OptiX 7 去噪器，因为它们对高亮度值更适合。&lt;br /&gt;
&lt;br /&gt;
* 在 HDRP 中，“distance” 与普通 Shadowmask 的切换可直接在 Light 组件上完成，而不是在全局设置中。&lt;br /&gt;
&lt;br /&gt;
* 不要在 Skylight 上使用 “match” 按钮，因为 HDRP 使用的是非常特定的程序化天空着色器。请改为将其烘焙为 HDRI [[How_do_I...#How_do_I_use_Skylight_with_a_procedural_sky_shader.3F|这种方式]]。&lt;br /&gt;
&lt;br /&gt;
* 建议在使用 HDRP 时始终将 Light Probe Mode 设置为 L2 或 L1，因为 HDRP 的渲染器并未针对 Legacy 模式进行优化。&lt;br /&gt;
&lt;br /&gt;
* 最新版本的 HDRP/URP 自带自己的 IES 文件导入器。由于资源类型不匹配，Unity 会将旧版本 Bakery IES 灯光断开连接，使其显示为普通点光源。它们可以重新连接并重新保存。&lt;br /&gt;
&lt;br /&gt;
Bakery 的示例场景是为内置渲染管线设计的，因此在 HDRP/URP 中正确渲染它们需要一些步骤。以下是一些提示；假设新建项目使用默认的 HDRP/URP 设置：&lt;br /&gt;
&lt;br /&gt;
=== 在 HDRP 中查看示例场景 ===&lt;br /&gt;
&lt;br /&gt;
* 导入 Bakery 后，将标准材质升级为 HDRP：Edit-&amp;gt;Rendering-&amp;gt;Materials-&amp;gt;Convert All Built-in Materials To HDRP。&lt;br /&gt;
* 将 Bakery_ShaderGraphHDRP.unitypackage 导入项目，因为它包含实现高级 Bakery 功能的特殊 Shader Graph（对于经典颜色/方向/遮罩光照贴图不需要）。&lt;br /&gt;
* 选择 DefaultSettingsVolumeProfile.asset。在 HDRI Sky 部分，将 Exposure Compensation 设置为 1。否则，与示例场景相比，默认 HDRP 会过亮，因曝光调整而使场景看起来很暗。&lt;br /&gt;
* 选择示例场景中的灯光时，HDRP 会初始化其自身的灯光数据。有时会导致灯光立即变得更亮。点击 “Match real-time to lightmapped” 以同步。&lt;br /&gt;
* 在渲染光探针前，将 Light Probe Mode 设置为 L2。&lt;br /&gt;
* '''example_directional''': 将 Shader 更改为 BakeryDirSpecGraph 以查看烘焙高光（或仅使用常规 HDRP/Lit 用于仅漫反射法线映射）。删除球体，因为当前没有支持逐顶点方向的 Shader Graph。&lt;br /&gt;
* '''example_directional_MonoSH''': 将 Shader 更改为 BakerySpecMonoSHGraph（或 BakeryMonoSHGraph，用于没有高光的略微低成本版本）。删除球体，因为当前没有支持逐顶点 MonoSH 的 Shader Graph。&lt;br /&gt;
* '''example_RNM''': 将 Shader 更改为 BakeryRNMGraph。&lt;br /&gt;
* '''example_SH''': 将 Shader 更改为 BakerySpecSHGraph（或 BakerySHGraph，用于没有高光的略微低成本版本）。删除球体，因为当前没有支持逐顶点 SH 的 Shader Graph。&lt;br /&gt;
* '''example_mixed_directional_mode''': 对 MonoSH/RNM/SH 平面，同样需要不同的 Graph。&lt;br /&gt;
* '''example_lights''': 将顶点光照球体的 Shader 更改为 BakeryVertexColorGraph。&lt;br /&gt;
* '''example_prefabs_bake''': 无需进一步调整。&lt;br /&gt;
* '''example_sectors''': 无需进一步调整。&lt;br /&gt;
* '''example_shadowmask''': 选择 DirectLight 并点击 “Match real-time to lightmapped” 修正亮度。将所有 HDRP 灯光的 Shadowmask Mode 设置为 Shadowmask。&lt;br /&gt;
* '''example_sponza_day''': 将 OpenImageDenoise 2（或 Optix 7，如果不支持）设置为首选去噪器。&lt;br /&gt;
* '''example_sponza_evening''': 将 OpenImageDenoise 2（或 Optix 7，如果不支持）设置为首选去噪器。&lt;br /&gt;
* '''example_subtractive''': HDRP 不支持减法模式。&lt;br /&gt;
* '''example_volumes_simple''': 将火车 Shader 更改为 BakeryVolumeSpecGraph（或 BakeryVolumeGraph，用于没有高光的略微低成本版本）。&lt;br /&gt;
* '''example_volumes_simple_shadowmask''': HDRP 当前不支持 Shadowmask Volumes。&lt;br /&gt;
* '''example_volumes_advanced''': 与 example_volumes_simple 相同。&lt;br /&gt;
* '''example_translucency''': 场景大部分应显示正常。对于 “Dynamic sphere lit by volume”，将 Shader 设置为 BakeryVolumeGraph。&lt;br /&gt;
&lt;br /&gt;
=== 在 URP 中查看示例场景 ===&lt;br /&gt;
&lt;br /&gt;
* 导入 Bakery 后，将标准材质升级为 URP：打开 Assets/Bakery/examples/content，输入 &amp;quot;t:material&amp;quot; 选择所有材质，并仅在 &amp;quot;content&amp;quot; 文件夹下搜索。点击 Edit-&amp;gt;Rendering-&amp;gt;Materials-&amp;gt;Convert Selected Built-in Materials To URP。&lt;br /&gt;
* 将 Bakery_ShaderGraphURP.unitypackage 导入项目，因为它包含实现高级 Bakery 功能的特殊 Shader Graph（对于经典颜色/方向/遮罩光照贴图不需要）。&lt;br /&gt;
* '''example_directional''': 将 Shader 更改为 BakeryURPLit，启用 &amp;quot;Bakery Lightmapped Specular&amp;quot;（或者仅保持常规 URP/Lit 用于仅漫反射法线映射）。删除球体，因为当前没有支持逐顶点方向的 Shader Graph。&lt;br /&gt;
* '''example_directional_MonoSH''': 将 Shader 更改为 BakeryURPLit，将 Bakery Mode 设置为 MonoSH，启用 &amp;quot;Bakery Lightmapped Specular&amp;quot;。在顶点光照球体上也启用 &amp;quot;Per-vertex&amp;quot;。&lt;br /&gt;
* '''example_RNM''': 将 Shader 更改为 BakeryURPLit，将 Bakery Mode 设置为 RNM，启用 &amp;quot;Bakery Lightmapped Specular&amp;quot;。&lt;br /&gt;
* '''example_SH''': 将 Shader 更改为 BakeryURPLit，将 Bakery Mode 设置为 SH，启用 &amp;quot;Bakery Lightmapped Specular&amp;quot;。删除球体，因为当前没有支持逐顶点 SH 的 Shader Graph。&lt;br /&gt;
* '''example_mixed_directional_mode''': 类似地使用 BakeryURPLit 并设置不同的 Bakery Mode（MonoSH、RNM、SH）。非方向性/主方向/烘焙法线贴图可使用常规 URP/Lit。&lt;br /&gt;
* '''example_lights''': 无需进一步调整。&lt;br /&gt;
* '''example_prefabs_bake''': 无需进一步调整。&lt;br /&gt;
* '''example_sectors''': 无需进一步调整。&lt;br /&gt;
* '''example_shadowmask''': 类似于 Built-in 渲染管线，在 Bakery 窗口（或项目 Quality Settings）中取消选中 Distance Shadowmask，以在摄像机附近查看实际烘焙/实时阴影混合效果。&lt;br /&gt;
* '''example_sponza_day''': 在植被材质上启用 alpha clipping。&lt;br /&gt;
* '''example_sponza_evening''': 同 example_sponza_day。&lt;br /&gt;
* '''example_subtractive''': 无需进一步调整。&lt;br /&gt;
* '''example_volumes_simple''': 将火车 Shader 更改为 BakeryURPLit，并将 Bakery Mode 设置为 Volume。可选启用 &amp;quot;Bakery Lightmapped Specular&amp;quot;。&lt;br /&gt;
* '''example_volumes_simple_shadowmask''': 与 example_volumes_simple 相同，但也启用 &amp;quot;Volume Shadowmask&amp;quot;。&lt;br /&gt;
* '''example_volumes_advanced''': 与 example_volumes_simple 相同。&lt;br /&gt;
* '''example_translucency''': 场景大部分应显示正常。对于 &amp;quot;Dynamic sphere lit by volume&amp;quot;，将 Shader 设置为 BakeryURPLit 并将 Bakery Mode 设置为 Volume。&lt;br /&gt;
&lt;br /&gt;
= 升级 Bakery =&lt;br /&gt;
在升级该资源时，建议遵循以下步骤：&lt;br /&gt;
&lt;br /&gt;
* 关闭 Bakery 窗口。&lt;br /&gt;
* 关闭 Unity。&lt;br /&gt;
* 重新打开 Unity。&lt;br /&gt;
* 导入更新后的包。&lt;br /&gt;
&lt;br /&gt;
请注意，如果不先关闭 Unity，导入可能会失败，因为 DLL 文件被锁定（会出现类似 &amp;quot;alphabuffergen.dll: Access is denied.&amp;quot; 的提示）。&lt;br /&gt;
&lt;br /&gt;
如果你移动过 Bakery 文件夹（Assets/Bakery 和 Assets/Editor/x64/Bakery）到其他位置，可能需要在更新前将它们移回原处，以避免出现两个冲突的包副本。&lt;br /&gt;
&lt;br /&gt;
= 脚本 API =&lt;br /&gt;
&lt;br /&gt;
== 基本用法 ==&lt;br /&gt;
&lt;br /&gt;
获取并修改渲染设置：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ftLightmapsStorage storage = ftRenderLightmap.FindRenderSettingsStorage();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mr F</name></author>
		
	</entry>
	<entry>
		<id>https://geom.io/bakery/wiki/index.php?title=%E4%BD%BF%E7%94%A8%E6%89%8B%E5%86%8C&amp;diff=1831</id>
		<title>使用手册</title>
		<link rel="alternate" type="text/html" href="https://geom.io/bakery/wiki/index.php?title=%E4%BD%BF%E7%94%A8%E6%89%8B%E5%86%8C&amp;diff=1831"/>
		<updated>2025-11-05T14:32:10Z</updated>

		<summary type="html">&lt;p&gt;Mr F: /* Bakery shaders */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== 系统要求 ==&lt;br /&gt;
&lt;br /&gt;
使用 Bakery 需要：&lt;br /&gt;
&lt;br /&gt;
Windows（7 或更高版本）电脑。&lt;br /&gt;
&lt;br /&gt;
Nvidia 显卡。最低支持型号为 Kepler（GeForce 650 或更新型号，Quadro 显卡请查看规格）。&lt;br /&gt;
&lt;br /&gt;
64 位 Unity 编辑器。Bakery 已在 5.6 到 6 及更高版本上测试过，同时也在 Tuanjie 1.6.7 上通过测试。&lt;br /&gt;
&lt;br /&gt;
{{note|系统要求仅适用于开发者的电脑，而非目标平台。使用 Bakery 烘焙的光照贴图可以在任何地方使用。}}&lt;br /&gt;
&lt;br /&gt;
== 前提条件 ==&lt;br /&gt;
* 确保你的项目中没有任何脚本编译错误，否则也会导致 Bakery 的脚本无法编译。&lt;br /&gt;
* 确保你的显卡驱动是最新版本，如有需要请[https://www.nvidia.com/Download/index.aspx?lang=en-US 更新]。&lt;br /&gt;
&lt;br /&gt;
'''请使用 Game-Ready（标准）驱动程序，而不是 “Studio” 驱动。'''&lt;br /&gt;
&lt;br /&gt;
== 安装 ==&lt;br /&gt;
&lt;br /&gt;
1. 通过 [https://assetstore.unity.com/packages/tools/level-design/bakery-gpu-lightmapper-122218 Asset Store] 将 Bakery 导入到你的项目中。&lt;br /&gt;
&lt;br /&gt;
2. Unity 会显示要导入的文件列表。如果这是你第一次使用 Bakery，建议直接 点击 Import（导入）。有经验的用户可以取消选中 examples 文件夹，以进行更轻量的安装。&lt;br /&gt;
&lt;br /&gt;
文件将被导入到 `Assets/Bakery` 和 `Assets/Editor/x64/Bakery` 文件夹中。&lt;br /&gt;
这些文件夹之后可以移动。&lt;br /&gt;
&lt;br /&gt;
3. Unity 随后会导入 Bakery 并编译脚本。此时可能会弹出如下窗口：&lt;br /&gt;
&lt;br /&gt;
[[File:Goahead.png]]&lt;br /&gt;
&lt;br /&gt;
此时你应点击 “Go Ahead”（继续）。&lt;br /&gt;
&lt;br /&gt;
现在你应该能在编辑器中看到新增的 Bakery 菜单：&lt;br /&gt;
&lt;br /&gt;
[[File:bmenu.jpg]]&lt;br /&gt;
&lt;br /&gt;
== 快速开始 ==&lt;br /&gt;
&lt;br /&gt;
1. 添加一些模型或基础体，并将其标记为静态（Static）。&lt;br /&gt;
&lt;br /&gt;
'''用于光照贴图的网格必须具有不重叠的 UV2。如果存在 UV2，则会使用 UV2（否则使用 UV1）。如果你的模型没有为光照贴图进行展开，请在资源中勾选 Generate Lightmap UVs（生成光照贴图 UV）。'''&lt;br /&gt;
Unity 的基础体已经具有正确的 UV2。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Staticmarked.jpg|320px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. 选择方向光（Unity 为你创建的那个），并添加 '''Bakery Direct Light''' 组件。&lt;br /&gt;
   {{note|Bakery 和 Unity 使用独立的光源组件。}}&lt;br /&gt;
&lt;br /&gt;
3. Bakery Direct Light 有许多可调选项，但你可以轻松将其与 Unity 光源匹配。点击 '''Match lightmapped to real-time'''。现在 Bakery 光源的颜色应与 Unity 默认的方向光相同，呈黄色调。&lt;br /&gt;
&lt;br /&gt;
[[File:Matching.jpg|640px]]&lt;br /&gt;
&lt;br /&gt;
{{note|Direct Light 组件可能会提示项目未使用线性光强度。问题在于，Unity 默认会对光源颜色应用伽马校正 [https://twitter.com/guycalledfrank/status/1001108508614553600 不正确]。&lt;br /&gt;
可以通过[https://docs.unity3d.com/ScriptReference/Rendering.GraphicsSettings-lightsUseLinearIntensity.html 脚本]启用正确模式。&lt;br /&gt;
这就是 “Fix” 按钮的作用。如果你已经在非线性光强模式下设置了许多光源，并且不想再次更改它们，可以跳过修复。即使你按了 “Fix”，也可以随时撤销此更改。&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. 要获得带阴影的环境光，请创建 Skylight（Bakery-&amp;gt;Create-&amp;gt;Skylight）。&lt;br /&gt;
&lt;br /&gt;
[[File:Menusky.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. 选择 Skylight，为它设置一些偏蓝的颜色，然后点击 '''Match scene skybox to this light'''。   这将使场景的 skybox 与光照完全匹配。&lt;br /&gt;
   {{note|将 Unity 的 skybox 与 Bakery Skylight 匹配是可选的，但对正确性很有用，可以确保可见环境和引擎内的反射探针与烘焙光照一致。目前此选项仅适用于 Standard 渲染管线。}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Skycomp.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. 点击 Bakery-&amp;gt;Render Lightmap。默认情况下，Full Lighting 模式是激活的。它会烘焙所有光源的直接和间接光照贡献。如果你想将实时阴影与烘焙全局光照（GI）结合使用，请将模式更改为 '''Indirect'''。&lt;br /&gt;
&lt;br /&gt;
[[File:Bakerywindow.jpg]]&lt;br /&gt;
&lt;br /&gt;
{{note| Bakery 可能会提示你正在使用旧的 [https://docs.unity3d.com/Manual/LinearLighting.html gamma mode]。如果你在意光照质量，强烈建议使用线性模式。如果你的项目已经在错误的伽马模式下设置好了，并且不想更改，或者是发布到不支持线性模式的移动设备上，也可以忽略此提示。}}&lt;br /&gt;
&lt;br /&gt;
7. 点击 '''Render'''。&lt;br /&gt;
&lt;br /&gt;
8. 完成！现在你应该已经得到烘焙的全局光照（GI）：&lt;br /&gt;
&lt;br /&gt;
[[File:Bakedgi.jpg]]&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 ==&lt;br /&gt;
&lt;br /&gt;
所有渲染设置都可以通过 Bakery-&amp;gt;Render Lightmap 访问。设置会为每个场景单独保存。Bakery 窗口顶部的选项允许你在 Simple（简单）、Advanced（高级）和 Experimental（实验）设置之间切换，每个后续模式都会显示更多可调选项。对于大多数场景，Simple 模式已经足够，是入门的好方法。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render mode ===  &lt;br /&gt;
定义要烘焙的光照贴图类型。  &lt;br /&gt;
&lt;br /&gt;
===== Full Lighting =====&lt;br /&gt;
烘焙所有 Bakery 光源的完整直接光和间接光。&lt;br /&gt;
{{note|在 2017.3 之前的 Unity 版本中，如果同一对象上同时有 Unity 和 Bakery 组件，你需要手动禁用 Unity 组件以避免亮度加倍。在较新版本中，实时效果会自动对烘焙光源禁用，就像内置光照烘焙器一样。}}&lt;br /&gt;
&lt;br /&gt;
===== Indirect =====&lt;br /&gt;
[[File:Image26.png|thumb|Unity 支持的不同渲染模式对比]]&lt;br /&gt;
基础混合模式。它会查看每个光源上的 Baked Contribution 选择器：如果设置为 ''Direct And Indirect''，则光源会像在 Full Lighting 模式下一样被烘焙。如果设置为 ''Indirect Only''，则只会烘焙该光源的间接光照（GI）。在后一种情况下，你应保持对象上的 Unity 光源和 Bakery 光源同时存在，一个提供实时直接光照，另一个提供预计算的全局光照（GI）。&lt;br /&gt;
&lt;br /&gt;
[[File:Indirectonly.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== Shadowmask =====&lt;br /&gt;
[[File:Image21.png|thumb|左：完全烘焙的光照。中：动态光源 + 烘焙 GI。右：胶囊形阴影、凹凸贴图和高光为动态光照，但立方体阴影和 GI 为烘焙光照。]]&lt;br /&gt;
[[File:Image6.png|thumb|当相机足够远离场景，或者动态阴影被禁用时，场景将呈现如下效果]]&lt;br /&gt;
更高级的混合模式。它通过生成两种类型的光照贴图来工作——一种包含烘焙颜色（如 Indirect 模式），另一种包含静态物体的阴影。它有几个优点：&lt;br /&gt;
* 实时阴影只需渲染少量动态对象，而不是整个场景。&lt;br /&gt;
* 实时阴影与烘焙阴影可以正确融合。&lt;br /&gt;
* 实时光源可以渲染凹凸贴图、高光和其他表面效果，同时仍会被高质量烘焙阴影遮挡。&lt;br /&gt;
[https://docs.unity3d.com/Manual/LightMode-Mixed-Shadowmask.html 更多详情]&lt;br /&gt;
&lt;br /&gt;
要启用此行为，你必须在同一对象上同时存在 Unity 光源和 Bakery 光源，并将 Baked Contribution 设置为 ''Shadowmask and Indirect''。未标记的光源将按 Indirect 模式进行烘焙。&lt;br /&gt;
&lt;br /&gt;
[[File:Smask22.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== Distance Shadowmask =====&lt;br /&gt;
此复选框仅在你选择 Shadowmask 时可见，并且只是切换项目 [https://docs.unity3d.com/Manual/LightMode-Mixed-ShadowmaskMode.html Quality Settings] 中同名的设置。&lt;br /&gt;
[https://docs.unity3d.com/Manual/LightMode-Mixed-DistanceShadowmask.html 更多详情]&lt;br /&gt;
{{note|由于缺少对应的脚本 API，该复选框在 Unity 5.6.x 上不可见。你可以在 Window-&amp;gt;Lighting-&amp;gt;Mixed Lighting-&amp;gt;Lighting Mode 中切换该设置。}}&lt;br /&gt;
{{note|在 Unity 版本 &amp;lt; 2017.3 中，由于 API 限制，渲染 Shadowmask 光照贴图会清除光照探针。烘焙后需要重新渲染光照探针。在较新版本中不应发生此问题。}}&lt;br /&gt;
&lt;br /&gt;
===== Subtractive =====&lt;br /&gt;
&lt;br /&gt;
启用 [https://docs.unity3d.com/Manual/LightMode-Mixed-Subtractive.html Subtractive] 光照模式。&lt;br /&gt;
&lt;br /&gt;
此选项对光照贴图本身没有任何特殊作用，实际上它的工作方式与 Full Lighting 相同。&lt;br /&gt;
&lt;br /&gt;
唯一的区别是，它还会将实时 Unity 光源设置为与 Subtractive 模式兼容（因为无法通过 UI 完成此操作）。&lt;br /&gt;
&lt;br /&gt;
你还需要在 [https://docs.unity3d.com/Manual/GlobalIllumination.html#MixedLighting Unity Lighting] 窗口中额外设置全局减法参数（例如全局阴影颜色）。&lt;br /&gt;
&lt;br /&gt;
===== Ambient Occlusion Only =====&lt;br /&gt;
仅烘焙环境光遮蔽（AO）。如果你很清楚自己在做什么，这可能会有用。请确保设置 [[#Ambient_occlusion|AO 选项]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Directional mode ===&lt;br /&gt;
[[File:Image3.png|thumb|不同方向模式的对比]]&lt;br /&gt;
定义了方向信息的烘焙方式。标准光照贴图每个像素只存储单一颜色，而方向光照贴图为着色器提供了关于该像素周围半球内光照变化的提示。这些数据用于在完全烘焙的区域中结合法线贴图。如果将其应用到内置的 [[#Bakery_shaders|Bakery]] 着色器中，还可以产生**近似高光反射**效果。&lt;br /&gt;
&lt;br /&gt;
===== None =====&lt;br /&gt;
不包含方向数据，每个像素仅有单一颜色。&lt;br /&gt;
&lt;br /&gt;
===== Baked Normal Maps =====&lt;br /&gt;
依然没有方向数据，但在渲染光照贴图时会考虑法线贴图。此方式在运行时没有额外开销。由于光照贴图的分辨率通常低于法线贴图，结果可能显得模糊。其他问题包括：由于缺乏 mipmapping，远处可能出现锯齿，以及降噪步骤可能导致细节被涂抹。要了解如何在此模式下使用具有程序化法线的自定义着色器，请参阅 [[#Normal_mapping|Normal Mapping]] 章节。&lt;br /&gt;
&lt;br /&gt;
===== Dominant Direction =====&lt;br /&gt;
此模式类似于 Unity 中 Enlighten 和 Progressive 烘焙器的实现。它与大多数着色器兼容，仅生成一张额外的贴图，运行时开销极小。缺点是凹凸贴图的效果较弱，略显灰暗，与实时光照下的同一物体相比可能差异较大。&lt;br /&gt;
&lt;br /&gt;
===== RNM =====&lt;br /&gt;
基于最初为《Half-Life 2》开发的 [https://steamcdn-a.akamaihd.net/apps/valve/2004/GDC2004_Half-Life2_Shading.pdf Radiosity Normal Mapping] 技术（相关演示文稿），后来被许多游戏采用（如《Mirror's Edge》）。此模式总共生成三张 HDR 贴图，是内存占用最高的模式之一，但运行时开销仍相对较低。该模式比 Dominant Direction 更精确，能更好地再现表面反差，并能正确处理来自不同角度、具有不同颜色的光照对法线贴图的影响。&lt;br /&gt;
&lt;br /&gt;
===== SH =====&lt;br /&gt;
基于论文《[https://media.contentapi.ea.com/content/dam/eacom/frostbite/files/gdc2018-precomputedgiobalilluminationinfrostbite.pdf Precomputed Global Illumination in Frostbite]》。这是最高质量的模式，能提供更好的表面对比度，并准确表现来自不同方向、不同颜色的光照。总共生成四张贴图，其中仅一张为 HDR，因此比 RNM 占用更少内存。运行时开销略高于 RNM。&lt;br /&gt;
&lt;br /&gt;
===== MonoSH =====&lt;br /&gt;
[[File:FY8Ru8hWIAAdYYH.jpg|thumb|Dominant Direction、完整 SH 与 MonoSH 的尺寸/质量对比]]&lt;br /&gt;
与 SH 类似，但使用单色的 L1 方向系数。表面对比度同样良好，虽然无法准确表现来自不同方向的不同颜色光照，但对多数场景来说已经足够。仅生成一张额外贴图，因此显存占用与带宽需求与 Dominant Direction 相近；事实上更低，因为 Dominant Direction 使用 RGBA 贴图，而 MonoSH 只需 RGB。该贴图通过内置的方向光照贴图系统传递，但''在标准着色器下显示不正确''。请务必使用兼容的着色器。&lt;br /&gt;
&lt;br /&gt;
===== 限制 =====&lt;br /&gt;
&lt;br /&gt;
* RNM 和 SH/MonoSH 只能与 [[#Bakery_shaders|Bakery shader]] 一起使用，或者需要对你的着色器进行调整。&lt;br /&gt;
* 在 RNM 和 SH 模式下，不会生成标准的颜色光照贴图。你需要确保场景中所有材质都使用 Bakery Shader，或者使用 [[#Bakery_Lightmap_Group_Selector|Lightmap Groups]] 将 RNM/SH 对象与其他对象分开。&lt;br /&gt;
* RNM 和 SH 贴图是通过 [https://docs.unity3d.com/ScriptReference/MaterialPropertyBlock.html MaterialPropertyBlock] 应用于对象的，因此在 Unity 的 Lighting 窗口中可能无法完全显示。&lt;br /&gt;
* Dominant Direction、RNM 和 SH/MonoSH 模式可能需要为全局光照（GI）和光照网格使用更多采样，以获得相近的质量。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Texels per unit ===&lt;br /&gt;
[[File:Texelscomp.jpg|thumb|1 vs 10 texels per unit]]&lt;br /&gt;
每个世界单位的光照贴图像素（Texels）近似数量。它会影响生成光照贴图的数量和分辨率。&lt;br /&gt;
&lt;br /&gt;
入门示例值：&lt;br /&gt;
&lt;br /&gt;
* 大型户外区域（城市）：1 - 5&lt;br /&gt;
* 中型户外区域（几条小巷）：10 - 20&lt;br /&gt;
* 高质量室内场景：100&lt;br /&gt;
&lt;br /&gt;
假设场景比例大约为 1 单位 = 1 米。在 Unity 中使用这种比例通常是推荐的，以便更好地导航和进行物理模拟。如果你的比例不同，请相应地调整 Texels。&lt;br /&gt;
&lt;br /&gt;
请注意，Texels Per Unit 是基础分辨率，但每个对象还可以通过 Mesh Renderer 上的 &amp;quot;Scale in Lightmap&amp;quot; 选项以及 Bakery 窗口中的 &amp;quot;Scale per map type&amp;quot; 进行额外调整。&lt;br /&gt;
&lt;br /&gt;
{{note| 将 &amp;quot;Scale in Lightmap&amp;quot; 设置为 0 的对象不会被烘焙，但仍会投射阴影并影响全局光照（GI）。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Max resolution ===&lt;br /&gt;
光照贴图的最大尺寸限制。如果对象无法容纳在单张光照贴图中（根据当前的 Texels Per Unit 值），将会分配额外的光照贴图。同样的四个正方形对象可以使用四张 512x512 的贴图，也可以使用一张 1024x1024 的贴图。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bounces ===&lt;br /&gt;
[[File:Image36.png|thumb|注意更多的反弹会为封闭空间带来更多光照。]]&lt;br /&gt;
定义光线在表面上反弹的次数。通常，对于户外场景（例如城市），较低的反弹次数就足够了，而对于封闭场景（室内、洞穴），则需要较高的反弹次数。&lt;br /&gt;
&lt;br /&gt;
虽然滑块最多限制为 5 次反弹，但可以在数字输入框中输入任意反弹次数。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Samples ===&lt;br /&gt;
[[File:Image7.png|thumb|左：Samples = 4，右：Samples = 16。为了演示，去噪功能已关闭。]]&lt;br /&gt;
影响全局光照（GI）的质量。典型值为 16 到 32。&lt;br /&gt;
&lt;br /&gt;
{{note| 可以输入超出滑块最大值的任意数字，但请注意，该数字表示最终光线数量的平方根，例如 32 表示 1024 条光线，64 表示 4096 条光线，依此类推。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GPU Priority ===&lt;br /&gt;
在 GPU 处理光照贴图时，操作系统和其他软件的响应可能会变慢。此选项允许你在烘焙速度和系统响应之间进行平衡。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render ===&lt;br /&gt;
为所有打开的场景烘焙光照贴图。&lt;br /&gt;
如果 [[使用手册#Light_probe_mode|Light Probe Mode]] 设置为 L1 或 L2，也会烘焙 [https://docs.unity3d.com/Manual/LightProbes.html 光照探针]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Render Light Probes ===&lt;br /&gt;
为所有打开的场景烘焙 [https://docs.unity3d.com/Manual/LightProbes.html 光照探针]。&lt;br /&gt;
&lt;br /&gt;
请注意，要在 Shadowmask 模式下对动态对象获得正确的混合光阴影，你还需要启用 [[使用手册#Occlusion_probes|occlusion probes]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Render Reflection Probes ===&lt;br /&gt;
为所有打开的场景烘焙反射探针。此按钮仅为方便起见，会调用引擎内置的反射探针更新功能。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update Skybox Probe ===&lt;br /&gt;
为当前的 skybox 烘焙全局漫反射和反射探针。与 “Render Reflection Probes” 一样，它仅调用引擎内置函数。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Occlusion probes ===&lt;br /&gt;
在渲染光照探针时，允许 Unity 使用当前选择的内置光照烘焙器烘焙遮挡探针（occlusion probes）。遮挡探针是存储在普通光照探针中的附加数据，可以防止动态对象在阴影区域被错误照亮。目前在 Unity 中无法使用自定义遮挡探针，必须调用内置光照烘焙器来完成此操作。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Warnings ===&lt;br /&gt;
这些选项会在按下任意 Render 按钮后对场景进行验证，并显示警告对话框，询问是否继续或停止烘焙过程。&lt;br /&gt;
&lt;br /&gt;
* Suppress all popups（屏蔽所有弹窗）：按下 Render 后不显示任何对话框。&lt;br /&gt;
* UV validation（UV 验证）：检查所有模型是否具有完全正确的光照贴图 UV，特别是 UV 是否位于 0-1 范围内且不重叠。&lt;br /&gt;
* Overwrite check（覆盖检查）：显示哪些光照贴图文件将被覆盖。&lt;br /&gt;
* Memory check（内存检查）：显示大致所需的视频内存量。&lt;br /&gt;
* Sample count check（采样数检查）：检查是否有光源、GI 或 AO 的采样数不合理，可能导致 GPU 超出可用资源。&lt;br /&gt;
* Lightmapped prefab validation（光照贴图预制体验证）：验证光照贴图预制体，并在某些预制体将被覆盖时发出通知。&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 (Advanced) ==&lt;br /&gt;
=== Light probe mode ===&lt;br /&gt;
更改光照探针的烘焙方式。&lt;br /&gt;
&lt;br /&gt;
* Legacy（传统模式）：使用 Render Light Probes 按钮生成探针。点光源和方向光在光照烘焙器中计算，而区域光/天空光/间接光则通过在每个探针位置渲染立方体贴图收集。结果以 [https://docs.unity3d.com/ScriptReference/Rendering.SphericalHarmonicsL2.html L2] 球谐（spherical harmonics）形式存储。缺点是立方体贴图渲染速度慢，并且在游戏中使用的着色器未物理正确表示光照表面，或者项目为移动平台设置时，光照贴图和探针可能不匹配（Unity 可能会裁剪高强度值）。&lt;br /&gt;
&lt;br /&gt;
* L1：在点击 Render 时，光照探针会与光照贴图一起渲染。此选项提供更高的烘焙性能，并保证探针光照与光照贴图匹配。结果以 L1 球谐形式存储（仍可被普通着色器使用）。使用 [[#Bakery_shaders|Bakery shader]] 的 Non-Linear Light Probe SH 选项可以进一步提升结果。&lt;br /&gt;
&lt;br /&gt;
* L2：更高质量（完整 L2 球谐）。与 L1 一样，会自动与光照贴图一起渲染。与 L1 相比，性能影响可忽略不计。应在所有着色器下显示正常。探针对比度/方向性/振铃去除可通过 Project Settings -&amp;gt; Bakery -&amp;gt; “Ringing removal for L2 light probes” 调整。&lt;br /&gt;
&lt;br /&gt;
'''在 Unity 2019.3 中似乎存在一个 bug，如果启用 Occlusion Probes 选项，Legacy 光照探针的颜色无法正确保存。使用 Occlusion Probes 时，默认且推荐使用 L2 模式。'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Asset UV Processing ===&lt;br /&gt;
配置资产的 UV 间距（padding）调整。可选值：&lt;br /&gt;
&lt;br /&gt;
* Don't change（不更改）：不修改资产。&lt;br /&gt;
* Adjust UV padding（调整 UV 间距）：会查找具有自动生成 UV 的模型（资产上启用 “Generate Lightmap UVs”），并进一步调整它们，使每个网格的 UV 岛之间具有适当间距。导入器设置中的全模型 Pack Margin 会被忽略。系统会根据每个网格的面积和光照贴图分辨率计算出最优值。&lt;br /&gt;
* Adjust UV padding for new meshes only（仅调整新网格的 UV 间距）：与上面相同，但会跳过之前至少调整过一次的模型。&lt;br /&gt;
* Remove UV adjustments（移除 UV 调整）：撤销所有之前的 UV 调整，使自动展开的模型恢复到 Unity 原始展开的样子。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser ===&lt;br /&gt;
设置所需的去噪器。可选值：&lt;br /&gt;
&lt;br /&gt;
* Optix 5：使用 OptiX 5.1 AI 去噪器（之前称为 “Legacy denoiser”）。在 GPU 上运行。支持从 [https://en.wikipedia.org/wiki/Kepler_(microarchitecture) Kepler]（通常是 GeForce 6xx）到 [https://en.wikipedia.org/wiki/Turing_(microarchitecture) Turing]（通常是 GeForce 20xx）的所有显卡。不支持 [https://en.wikipedia.org/wiki/Ampere_(microarchitecture) Ampere]（30xx）。OptiX 5.1 使用嵌入的静态训练数据集，因此不受驱动实现影响。&lt;br /&gt;
&lt;br /&gt;
* Optix 6：使用 OptiX 6.0 AI 去噪器（之前为默认选项）。在 GPU 上运行。在 Kepler（6xx）显卡上似乎无法使用，但在更新的显卡上均可运行，包括 Ampere（30xx）。自 6.0 起，OptiX 去噪器的训练数据集存储在驱动中。在 v442.50 之前，其行为类似于 OptiX 5.1；但之后 NVIDIA [https://forums.developer.nvidia.com/t/optix7-denoiser-different-results-with-different-version-of-drivers/117989/2 更改了数据集]，结果可能有所不同。更新后的数据集有时可能产生网格状图案和更亮的边缘（仍可通过 “Denoise: fix bright edges” 修复），但运行速度更快。&lt;br /&gt;
&lt;br /&gt;
* Optix 7：使用 OptiX 7.2 AI 去噪器。行为类似 OptiX 6.0，但在 Ampere（30xx）上可能支持更好。&lt;br /&gt;
&lt;br /&gt;
* OpenImageDenoise：使用 Intel Open Image Denoise 库。在 CPU 上运行（任何支持 SSE 4.1 的 CPU）。可能略慢于 OptiX，但质量可比。&lt;br /&gt;
&lt;br /&gt;
* OpenImageDenoise2：使用 Intel Open Image Denoise 2，CUDA 模式。在 GPU 上运行，性能与 OptiX 6/7 相当，质量与 CPU 版本相同。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Adjust sample positions ===&lt;br /&gt;
寻找最佳采样位置以防止光照泄漏。算法详情可参考 [https://ndotl.wordpress.com/2018/08/29/baking-artifact-free-lightmaps/#leaks 此处]。在某些情况下（通常是大型且多边形极少、法线平滑的几何体），可能会产生不正确的结果，此时可以将其禁用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Unload scenes before render ===&lt;br /&gt;
在烘焙前卸载 Unity 场景以释放显存。复杂场景仅在编辑器中显示就可能占用数 GB 的显存。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Denoise ===&lt;br /&gt;
[[File:Image31.png|thumb|左：未开启 “Denoise”，右：开启 “Denoise”。]]&lt;br /&gt;
如果启用，将应用去噪算法。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Fix Seams ===&lt;br /&gt;
[[File:Image22.png|thumb|左：缝隙（“Fix Seams” 关闭），右：缝隙已修复（“Fix Seams” 开启）。]]&lt;br /&gt;
如果启用，将尝试融合由 UV 不连续造成的缝隙。对平滑几何体很有用，包括 Unity 默认的球体。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Split by scene ===&lt;br /&gt;
如果同时加载多个场景，并且启用此选项，每个场景将拥有自己的一套光照贴图，而不会与其他场景共享。这对于在运行时流式加载场景时限制纹理占用量非常有用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hole filling ===&lt;br /&gt;
[[File:Holefilling.jpg|thumb|“Hole filling” 关闭与开启的对比。]]&lt;br /&gt;
如果 Atlas Packer 设置为 xatlas，将尝试填充每个孔洞，从而生成更高效的贴图集。对于几何体非常复杂的场景，可能会增加场景导出时间，但通常推荐开启。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Min resolution ===&lt;br /&gt;
光照贴图的最小尺寸限制。可用于在生成大量小而完全填充的光照贴图与少量未完全填充的光照贴图之间进行平衡。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Scale per map type ===&lt;br /&gt;
允许你对颜色贴图、Shadowmask 和方向贴图设置不同的分辨率缩放。例如，常见情况是间接光颜色分辨率较低，但 Shadowmask 分辨率较高。请注意，缩放在光照贴图渲染完成后才应用，因此不会节省烘焙时间。如果启用了 “Adjust UV padding”，间距将基于最低分辨率的贴图，以防止像素泄漏。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Checker preview ===&lt;br /&gt;
[[File:Image12.png|thumb|Checker Preview 功能演示。]]&lt;br /&gt;
如果勾选了 “Show checker” 选项，场景视图将在可见对象上渲染棋盘格图案，以展示光照贴图像素大小。这对于在烘焙前确保 Texels Per Unit 和其他影响分辨率的设置使用合理数值非常有用。&lt;br /&gt;
&lt;br /&gt;
启用 Checker Preview 将强制 Bakery 执行贴图集打包。可能需要一些时间，但通常不会超过几秒钟。在修改场景内容后，按下 “Refresh checker” 可重新打包场景以查看更改。&lt;br /&gt;
&lt;br /&gt;
Checker Preview 还使用随机颜色显示场景将如何被分割到不同的光照贴图中。&lt;br /&gt;
&lt;br /&gt;
{{note| 当前 Checker Preview 无法显示地形的正确像素大小。}}&lt;br /&gt;
&lt;br /&gt;
==== Atlas preview ====&lt;br /&gt;
[[File:FN-TmhRXwAE9i2I.png|thumb|Atlas Preview 功能演示]]&lt;br /&gt;
当 Checker Preview 开启时，会显示 Atlas Preview 按钮。点击它将打开一个新窗口，显示未来光照贴图的 UV 布局。点击 &amp;quot;&amp;lt;&amp;quot; 和 &amp;quot;&amp;gt;&amp;quot; 按钮可浏览各个光照贴图。&lt;br /&gt;
这对于在烘焙前检查打包质量和光照贴图数量非常有用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Emissive boost ===&lt;br /&gt;
将任何表面自发光（emission）乘以此数值。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Indirect boost ===&lt;br /&gt;
将所有反弹光照乘以此数值。作用与光源组件上的 Indirect Intensity 相同，但为全局设置。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Backface GI ===&lt;br /&gt;
[[File:Image30.jpg|thumb|Backface GI]]&lt;br /&gt;
[[File:Image35.png|thumb|左：“Backface GI” = 0，右：“Backface GI” = 1。注意阴影区域接收到更多的绿色光照。]]&lt;br /&gt;
决定光线通过前面表面到达背面并被全局光照（GI）反弹的程度。这对于薄的半透明表面（如树叶）尤其有用。取值范围为 0-1。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Ambient occlusion ===&lt;br /&gt;
[[File:Image15.png|thumb|左：AO intensity = 0，右：AO intensity = 1。]]&lt;br /&gt;
一种简单的非物理环境光遮蔽（Ambient Occlusion，AO），可在最终场景光照上叠加以增强美观效果。&lt;br /&gt;
&lt;br /&gt;
* Intensity（强度）：控制 AO 效果的可见度。值为 0 时禁用该效果。&lt;br /&gt;
* Radius（半径）：决定 AO 效果使用的光线距离。较小的值产生局部遮蔽（角落、褶皱），较大的值则更类似 Skylight，从远处物体产生阴影。&lt;br /&gt;
* Samples（采样数）：影响环境光遮蔽的质量。典型值为 4 到 32。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dither transparency ===&lt;br /&gt;
通过自动抖动不透明度贴图来启用半透明阴影。[[使用手册#Opacity|了解 Bakery 如何处理不透明度贴图]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== RTX Mode ===&lt;br /&gt;
启用 RTX 硬件加速。仅 RTX 显卡可受益于此选项。最低支持的驱动版本为 418。&lt;br /&gt;
&lt;br /&gt;
驱动可以在大多数非 RTX Nvidia 显卡上模拟 RTX 模式，但通常会更慢。&lt;br /&gt;
&lt;br /&gt;
在 Ampere（3xxx）或更新的显卡上，RTX 模式 ''必须'' 启用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Export terrain trees ===&lt;br /&gt;
如果启用，绘制在地形上的树木将影响光照。树木本身不会被烘焙。请注意，在烘焙过程中，每棵树都使用最高可能的 LOD 等级。对于多公里范围且模型高度复杂的森林场景，不建议使用此选项。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Terrain optimization ===&lt;br /&gt;
如果启用（默认），地形将使用独立的光线追踪技术以利用其高程图几何结构。否则，它们将像其他普通网格一样处理。地形优化可以显著减少高分辨率地形所需的内存占用。在某些情况下，它还能加快地形烘焙速度，但在其他情况下（尤其是简单低分辨率地形）可能需要禁用该选项。&lt;br /&gt;
&lt;br /&gt;
{{note| 地形优化当前不兼容绘制的地形洞。需禁用此选项才能使其正常工作。}}&lt;br /&gt;
{{note| 地形优化仅支持非 RTX 模式。}}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Light Mesh batch limit ===&lt;br /&gt;
如果该值大于 0，会将多个 Light Mesh 合并为一个，前提是它们具有相同设置并影响相同的 Lightmap Groups，同时将它们的总采样数限制为该值（例如，如果限制为 64，则可以合并 2 个采样数为 32 的灯光，或 4 个采样数为 16 的灯光，等等）。在拥有大量 Light Mesh 的场景中，这可以提升性能。但设置过高时需小心，因为 GPU 在一次处理过多采样时可能触发操作系统驱动超时。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Compress volumes ===&lt;br /&gt;
如果启用，将对体积 3D 贴图应用纹理压缩，并将 Bakery 着色器切换到相应的采样模式。不推荐对分辨率非常低的体积使用此选项。体积大小可能会被调整为 4 的倍数。&lt;br /&gt;
&lt;br /&gt;
注意事项：&lt;br /&gt;
&lt;br /&gt;
* 目前仅支持压缩为 BC6H/BC7 纹理格式（桌面/主机平台）。&lt;br /&gt;
* 体积压缩仅支持 Unity 2020.1 或更高版本。&lt;br /&gt;
* 目前仅标准渲染管线的 Bakery 着色器支持使用压缩体积贴图。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Samples multiplier ===&lt;br /&gt;
将所有阴影和 GI 采样数乘以指定因子。可用于在草稿质量和最终质量之间快速切换。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Tile size ===&lt;br /&gt;
与 [[#GPU Priority|GPU Priority]] 相同，但这里设置的是贴图块（tile）大小。Bakery 会将光照贴图拆分为更小的块，并一次更新一个块。块越小，GPU 工作被中断的次数越多，系统响应性可能更好。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Temp path ===&lt;br /&gt;
临时文件夹。在渲染过程中，Bakery 可能需要几个 GB 的可用空间。将此文件夹放在 SSD 上相比 HDD 可略微加快渲染速度。目前，该文件夹不会自动清理。你可以随时手动删除其内容（渲染时除外），或通过 Bakery -&amp;gt; Utilities -&amp;gt; Clear cache 清理。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Output path ===&lt;br /&gt;
光照贴图文件夹。所有光照贴图，以及 lightprobe 和顶点颜色（vertex color）资源都将保存在此处。该路径相对于你的 Assets 文件夹。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Use scene named output path ===&lt;br /&gt;
如果启用此选项，输出路径将自动设置为与当前活动场景同名的文件夹（Assets/CurrentSceneName/）。这与 Unity 内置光照贴图烘焙器的行为类似。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render Selected Groups ===&lt;br /&gt;
仅烘焙包含所选对象的 Lightmap Groups。&lt;br /&gt;
不仅仅是所选对象会被重新绘制，它们所属的所有 Lightmap Groups 都会被处理。其他光照贴图不会被更新。如果对象不属于某个手动分配的组，则使用相同光照贴图的场景部分将被重新烘焙。&lt;br /&gt;
&lt;br /&gt;
目前，使用 [[Partial_scene_baking|Sectors]] 进行场景部分烘焙更为方便。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Beep on finish ===&lt;br /&gt;
如果启用，Bakery 在烘焙完成时会播放提示音。&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 (Experimental) ==&lt;br /&gt;
=== Unwrapper ===&lt;br /&gt;
如果启用 [[#Asset_UV_Processing|Adjust UV Padding]]，则定义将使用的展开器（unwrapper）。&lt;br /&gt;
&lt;br /&gt;
* Default：使用 Unity 标准展开器。Bakery 会为每个具有不同间距参数的网格调用 [https://docs.unity3d.com/ScriptReference/Unwrapping.GenerateSecondaryUVSet.html Unwrapping.GenerateSecondaryUVSet]。&lt;br /&gt;
* xatlas：使用 [https://github.com/jpcy jpcy] 的 [https://github.com/jpcy/xatlas xatlas]，这是 [https://github.com/castano Ignacio Castaño] 的 [https://github.com/Thekla/thekla_atlas thekla_atlas] 的修改版。thekla_atlas 曾用于游戏《The Witness》（[http://the-witness.net/news/2010/03/graphics-tech-texture-parameterization/ 参见博客文章]）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Atlas Packer ===&lt;br /&gt;
选择在将不同对象的 UV 布局打包到大型光照贴图集时使用的算法。&lt;br /&gt;
* Default：Bakery 在 v1.7 之前使用的原始算法。&lt;br /&gt;
* xatlas：使用 xatlas。&lt;br /&gt;
&lt;br /&gt;
某些功能仅支持特定的贴图集打包器：&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Default&lt;br /&gt;
! xatlas&lt;br /&gt;
|-&lt;br /&gt;
| [[使用手册#Bakery_Lightmap_Group_Selector|Override resolution]]&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
|-&lt;br /&gt;
| 高效 LOD 打包&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
|-&lt;br /&gt;
| [[使用手册#Hole_filling|Hole filling]]&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
请注意，贴图集打包器（Atlas Packer）也可以为每个 Lightmap Group 单独选择。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Export geometry and maps ===&lt;br /&gt;
如果启用，Bakery 会在渲染前将场景导出为其专用格式。如果你确定场景的几何体和贴图以及光照贴图分辨率设置没有改变（例如，你只是调整 GI 或光源设置），可以禁用此选项以加快下一次渲染速度。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update unmodified lights ===&lt;br /&gt;
如果启用，Bakery 会重新计算自上次渲染以来未改变的光源。如果你只是调整某个光源，不想等待其他光源重新渲染，可以禁用此选项。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update modified lights and GI ===&lt;br /&gt;
如果启用，Bakery 会重新计算自上次渲染以来发生变化的 GI 和光源。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== UV padding: increase only ===&lt;br /&gt;
仅在启用 [[#Asset_UV_Processing|Adjust UV padding]] 时可见。默认情况下，模型资源的最佳 UV 间距仅基于当前加载的场景进行计算。如果同一模型有多个实例使用不同的光照贴图分辨率，最小的分辨率将决定间距，以确保 UV 图块之间的间距足够大，防止相互重叠。然而，在两个不同的独立场景中烘焙同一模型时，为新场景优化可能会破坏之前场景中的 UV。勾选此选项可以防止这种情况发生，即永远不减小间距值，从而始终为曾经烘焙过的最低分辨率实例进行优化。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoise: fix bright edges ===&lt;br /&gt;
[[File:Image19.png|thumb|左：去噪后可见明亮边缘；右：已修复。]]&lt;br /&gt;
仅在 [[#Denoise|Denoise]] 启用时可见。有时用于去噪的神经网络可能会在阴影周围产生明亮边缘，就像应用了锐化效果一样。如果启用此选项，Bakery 会尝试将其滤除。启用后，去噪阶段可能会略微变慢。&lt;br /&gt;
&lt;br /&gt;
此功能也可用于滤除“火花”（fireflies），即光照贴图中偶尔出现的亮点。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Post-packing ===&lt;br /&gt;
有时在渲染场景时，Bakery 会将光照贴图拆分为多个子光照贴图，例如在烘焙不同 LOD 或地形时。&lt;br /&gt;
Post-packing 会尝试通过将这些子光照贴图合并到同一纹理中来最小化最终贴图集数量。&lt;br /&gt;
建议保持此选项启用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Combine with Enlighten real-time GI ===&lt;br /&gt;
如果启用，则在按下 Render 按钮时，Bakery 会首先尝试使用 Enlighten 烘焙以计算实时 GI。之后，将进行常规的 Bakery 光照贴图烘焙过程。烘焙 GI 和实时 GI 将协同工作。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bake on remote server ===&lt;br /&gt;
启用网络烘焙（[[Network baking|Network baking]]）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Presets ===&lt;br /&gt;
当前在 Experimental 模式下的 Render/Update 按钮下显示。&lt;br /&gt;
&lt;br /&gt;
* 点击 '''New''' 将所有当前设置保存到预设文件中。&lt;br /&gt;
* 默认情况下，当一个预设处于激活状态时，所有设置都会被灰显，以防止覆盖预设。&lt;br /&gt;
* 点击 '''Modify preset''' 可更改设置并覆盖预设。&lt;br /&gt;
* 可以通过预设字段切换预设。将其设置为 None 可禁用预设使用。&lt;br /&gt;
&lt;br /&gt;
== 组件 ==&lt;br /&gt;
=== Bakery Lightmap Group Selector ===&lt;br /&gt;
指定对象及其所有子对象使用的 '''Lightmap Group'''。&lt;br /&gt;
Lightmap Group 是 Bakery 用来表示共享同一光照贴图的对象集合的术语。每个组都有属性，告诉 Bakery 如何打包对象、哪些光源影响它们，以及结果是烘焙到纹理还是顶点。&lt;br /&gt;
&lt;br /&gt;
默认情况下，所有静态对象会自动打包到多个光照贴图组（贴图集）中，因此通常无需手动管理。手动定义组仅用于特殊用途，例如：&lt;br /&gt;
&lt;br /&gt;
* 指定某些对象使用 [[Vertex Lightmaps|每顶点光照贴图]] 而非纹理。&lt;br /&gt;
* 使用建模软件中的原始未缩放 UV 烘焙光照贴图。&lt;br /&gt;
* 将关卡的特定区域分组以使用单张光照贴图，从而便于资源流式加载或通过脚本在运行时切换不同的烘焙光照。&lt;br /&gt;
* 使用 Render Selected Groups 按钮仅更新已分组的对象。&lt;br /&gt;
&lt;br /&gt;
要手动定义组，可以创建 '''Lightmap Group Assets'''，方法包括使用 Assets-&amp;gt;Create 菜单，或在组件中使用 Create New 按钮。使用 Create New 按钮时，将根据以下表单创建新的资源：&lt;br /&gt;
&lt;br /&gt;
* Name：要创建的 Lightmap Group 资源的名称。&lt;br /&gt;
* Packing Mode：此选择器定义 Lightmap Group 的打包模式，共有 3 种模式：&lt;br /&gt;
** Original UV：对象及其子对象将使用未修改的 UV 进行烘焙，不执行打包。适用于多个网格共享同一已打包 UV 布局的模型。&lt;br /&gt;
** Pack Atlas：对象及其子对象将打包到专用纹理贴图集中。在 v1.3 之前，每个可打包的子对象都需要有此组件，但现在不再需要。每个子对象将作为单独矩形打包，除非 Bakery 自动检测到子对象有非重叠的子对象，在这种情况下，多个对象可以使用同一个矩形。&lt;br /&gt;
** Vertex：对象及其子对象将使用顶点色烘焙光照而非纹理。注意，需要使用自定义着色器才能生效，例如 [[#Bakery_shaders|Bakery Shader]]。文档中也提供了一个简单的着色器（“Bakery/Simple Vertex Lightmapped”）用于演示和参考。[[Vertex Lightmaps|了解更多关于顶点光照贴图的信息]]。&lt;br /&gt;
* Directional mode：允许你覆盖该组的 [[#Directional mode|directional mode]]。选项与全局相同，Auto 将使用全局设置。&lt;br /&gt;
* Resolution：所需的光照贴图分辨率。&lt;br /&gt;
* Auto-resolution：使用 [[使用手册#Texels_per_unit|Texels Per Unit]] 来确定最接近的二次幂分辨率。&lt;br /&gt;
* Atlas packer：为该组选择 [[使用手册#Atlas_Packer|贴图集打包]] 算法。&lt;br /&gt;
* Bitmask：用于排除光源影响光照贴图的开关列表。每个 Bakery 光源也有一个位掩码设置。光源只会影响与其共享至少一个开关的 Lightmap Group。默认设置意味着所有光源影响所有光照贴图。&lt;br /&gt;
&lt;br /&gt;
[[File:Ts.jpg|thumb|Transparent selfshadow关闭 vs 开启：注意一些单面但背向的多边形如何被正确照亮。]]&lt;br /&gt;
&lt;br /&gt;
如果你有一个被分配了“Pack Atlas”模式的 Lightmap Group，组件上将会出现额外设置：&lt;br /&gt;
&lt;br /&gt;
* Override resolution：覆盖该对象及其子对象在光照贴图中占用的分辨率。&lt;br /&gt;
* Resolution：手动定义的分辨率。例如，如果你有一个分辨率为 512 的光照贴图，并且分配给 4 个对象，同时覆盖分辨率设置为 256，Bakery 将生成一个 512x512 的光照贴图，每个对象正好占据 256x256 的区域。&lt;br /&gt;
&lt;br /&gt;
如果你选择一个 Lightmap Group 资产，将会显示额外的实验性设置：&lt;br /&gt;
* [[Subsurface scattering|Subsurface scattering: (点击阅读更多)]]&lt;br /&gt;
* Normal offset：允许你将光线从表面偏移。这很少有用，主要用于实验目的。&lt;br /&gt;
* Transparent selfshadow：从表面后方发射光线，使其不会在自身投射阴影。对于半透明叶片可能有用。&lt;br /&gt;
* Vertex sampling density，(仅当 Packing Mode 设置为 Vertex 时可用）：默认情况下，每个顶点只计算一个值；如果采样密度 &amp;gt; 0，则会在三角形上分散采样并求平均，从而生成超采样、更平滑的结果。&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Lightmapped Prefab ===&lt;br /&gt;
此组件允许预制件存储光照贴图元数据。这样处理后的预制件可以在任意场景中实例化，无论是在编辑器中还是运行时。&lt;br /&gt;
该组件应直接添加到预制件的根对象上。不支持嵌套预制件。由于预制件在烘焙后会被覆盖（类似于按下“Apply”按钮的效果），因此要求预制件没有任何未应用的更改（子对象不应移动，材质和脚本参数应保持不变等）。如果检测到此类更改，组件界面会显示错误，烘焙后不会保存任何元数据。如果启用了 [[#Warnings|Lightmapped prefab validation]] 警告，所有预制件错误也会在烘焙前以对话框形式显示。&lt;br /&gt;
&lt;br /&gt;
光照贴图预制件支持所有 Bakery 功能，例如 LOD、地形、方向光贴图、RNM、SH、顶点模式和 Shadowmask。要使 Shadowmask 生效，光源也必须是同一预制件的一部分。&lt;br /&gt;
&lt;br /&gt;
{{note| 注意，由于 API 限制，预制件 Shadowmask 仅在 Unity 2017.4 或更高版本中可用。}}&lt;br /&gt;
&lt;br /&gt;
烘焙后，一个名为 “BakeryPrefabLightmapData” 的对象会被添加到预制件中。该对象包含一个脚本，存储应用光照贴图所需的所有数据。&lt;br /&gt;
&lt;br /&gt;
此外，光照贴图预制件允许保存当前渲染设置，并使用两个按钮将其加载回任意已打开的场景：&lt;br /&gt;
&lt;br /&gt;
* Save current render settings to prefab：在该预制件上存储当前渲染设置的副本。&lt;br /&gt;
* Load render settings from prefab：将当前渲染设置设置为预制件中存储的设置。&lt;br /&gt;
  [[File:Upload 2019-9-17 10-32-34.png|thumb|应用预制件]]&lt;br /&gt;
&lt;br /&gt;
烘焙光照贴图预制件时，建议检查：&lt;br /&gt;
&lt;br /&gt;
* 预制件已“应用”。在旧版 Unity 中，点击 Inspector 右上角的 “Apply” 按钮。在新版 Unity 中，点击 “Overrides” 列表，然后选择 “Apply All”。&lt;br /&gt;
* 预制件组件 UI 不显示任何错误。&lt;br /&gt;
* [推荐] 在主窗口启用 “Lightmapped prefab validation” 复选框。点击 Render 时不会显示任何关于预制件的警告对话框。&lt;br /&gt;
&lt;br /&gt;
{{note| 光照贴图以其烘焙所在的场景或所使用的 Lightmap Group 命名（如果有）。在同一场景中烘焙不同预制件时，请确保使用不同命名的 [[使用手册#Bakery_Lightmap_Group_Selector|Lightmap Group]] 或更改 [[使用手册#Output_path|输出路径]]。}}&lt;br /&gt;
&lt;br /&gt;
{{note| 当使用相同模型逐个烘焙多个预制件时，建议将 [[使用手册#Asset_UV_Processing|Asset UV Processing]] 设置为“Don't Change”，以防止修改共享模型的 UV。}}&lt;br /&gt;
&lt;br /&gt;
{{note| Bakery 的预制件工作流程是在 Unity 提供“预制件双击进入视图”功能之前实现的。因此，在隔离预制件视图中光照贴图可能无法正确应用，组件可能显示 “This GameObject is not a prefab” 信息。但在普通场景中使用时应能正常工作。}}&lt;br /&gt;
&lt;br /&gt;
{{note| 当解包已烘焙的预制件并取消与现有光照贴图的关联时，请确保删除保存预制件范围光照贴图/渲染器连接的 BakeryPrefabLightmapData 对象。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Direct Light ===&lt;br /&gt;
[[File:Directlight.jpg|thumb|纯直射光 + GI]]&lt;br /&gt;
[[File:Image4.png|thumb|左：“Shadow Spread” = 0.01，右：0.05。注意阴影从锐利逐渐变模糊的效果。]]&lt;br /&gt;
无限远方向光（例如太阳）。&lt;br /&gt;
&lt;br /&gt;
* Color：光的颜色。&lt;br /&gt;
* Intensity：线性色彩乘数。&lt;br /&gt;
* Shadow Spread：光源尺寸，或者简单说，阴影的模糊度。0 = 阴影最锐利，1 = 阴影最模糊。从技术上讲，它在单条光线与更宽光锥之间插值。&lt;br /&gt;
* Shadow Samples：影响阴影质量。Shadow Spread 值越小，所需样本越少即可得到干净图像。太阳阴影的典型值为 1 到 16。设置为 0 时，该光源的阴影将消失。&lt;br /&gt;
* Bitmask：用于排除此光源对特定 Lightmap Groups 影响的开关列表。&lt;br /&gt;
* Baked contribution：确定应烘焙哪类光照数据。仅在 Indirect 或 Shadowmask 模式可见。可选值：&lt;br /&gt;
** Direct and Indirect：直射光与间接光都完全烘焙。&lt;br /&gt;
** Indirect only：实时光提供直射贡献，仅烘焙间接光。&lt;br /&gt;
** Shadowmask and indirect：实时光提供直射贡献，静态几何体的阴影烘焙到单独贴图，动态与静态阴影混合。间接光正常烘焙。&lt;br /&gt;
** Direct, Indirect, Shadowmask（仅自定义光照）：与直射和间接相同，但 Shadowmask 也生成，可与自定义着色器一起使用。&lt;br /&gt;
* Denoise shadowmask：确定是否对该光源的 Shadowmask 应用去噪。通常不需要，因为阴影噪点不明显，但对非常宽且模糊的阴影（大 Shadow Spread）可能有用。&lt;br /&gt;
* Indirect intensity：非物理 GI 乘数。自然光照应为 1，可根据场景风格调整。&lt;br /&gt;
* Anti-alias：对阴影执行超采样。&lt;br /&gt;
* Texture projection：在光照上投射乘法平铺纹理，可用于模拟远处云影。&lt;br /&gt;
当设置了纹理投影时，可以使用“Tiling”和“Offset”字段调整其缩放和偏移。或者，点击 &amp;quot;Tweak projection in Scene View&amp;quot; 并使用额外的 Gizmo 可视化移动和缩放投影。点击“Render reference frame”可保存光源视角的 PNG，这对于在场景上绘制云影很有用。&lt;br /&gt;
&lt;br /&gt;
如果同一对象同时启用了 Unity 和 Bakery 光源且参数不匹配，会出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match lightmapped to real-time：将 Unity 光源的通用设置复制到 Bakery 光源。&lt;br /&gt;
* Match real-time to lightmapped：将 Bakery 光源的通用设置复制到 Unity 光源。&lt;br /&gt;
&lt;br /&gt;
{{note| 从物理角度看，Bakery 的方向光强度（Intensity）等于照度（Lux）除以 π。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Sky Light ===&lt;br /&gt;
[[File:Skylight.jpg|thumb|纯天空光与 GI]]&lt;br /&gt;
无限远的带阴影环境光（天空）。&lt;br /&gt;
&lt;br /&gt;
* Color: 颜色。&lt;br /&gt;
* Intensity: 线性色彩倍增。&lt;br /&gt;
* Sky texture: 可选的立方体贴图资源，例如 HDRI 全景图，用于从不同方向影响光照颜色。&lt;br /&gt;
  {{note| 旋转天空光的 GameObject 会相应旋转立方体贴图的光照。}}&lt;br /&gt;
* Samples: 影响阴影质量。典型值为 8 到 32。&lt;br /&gt;
* Hemispherical: 如果启用，光照仅来自上方（上半球）。否则来自所有方向。&lt;br /&gt;
* Bitmask: 用于排除此光源影响特定 Lightmap Groups 的开关列表。&lt;br /&gt;
* Baked contribution: 决定应烘焙哪种光照数据。仅在 Indirect/Shadowmask 模式下可见。可能值：&lt;br /&gt;
** Direct and Indirect: 直接和间接光照都将完全烘焙。这是默认且推荐的天空光行为，因为在 Unity 中没有实时版本可以模拟它们。&lt;br /&gt;
** Indirect only: 假定实时光源提供直接贡献；仅烘焙间接光照。&lt;br /&gt;
&lt;br /&gt;
如果天空光的设置与当前场景的天空盒不匹配，将出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match this light to scene skybox: 将活动天空盒材质的通用设置复制到 Bakery 天空光。当前仅支持使用 “Skybox/Cubemap” 或 “Skybox/Bakery skybox” 着色器的天空盒。&lt;br /&gt;
* Match scene skybox to this light: 将 Bakery 天空光的通用设置复制到场景天空盒。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bakery Light Mesh ===&lt;br /&gt;
[[File:Image29.png|thumb|Left: Samples Near = 0, Samples Far = 4096.&amp;lt;br&amp;gt;&lt;br /&gt;
Middle: Samples Near = 0, Samples Far = 128.&amp;lt;br&amp;gt;&lt;br /&gt;
Right: Samples Near = 16, Samples Far = 128.&amp;lt;br&amp;gt;&lt;br /&gt;
请注意，光照效果看起来相似，但使用的合并采样数量更少。]]&lt;br /&gt;
任何形状的自发光网格。应与 Mesh Renderer 组件或设置为 Area 模式的 Light 组件一起使用。&lt;br /&gt;
&lt;br /&gt;
* Color：颜色&lt;br /&gt;
* Intensity：线性颜色倍增器&lt;br /&gt;
* Cutoff：最大光照距离。Bakery 会在接近该限制时额外衰减正确的平方反比衰减。当 Cutoff 值刚好对应物理衰减变得非常暗的位置时效果最佳。Cutoff 可提升烘焙性能，也可以设置为非常高（不可达）的值以保证完全正确性。&lt;br /&gt;
* Self Shadow：决定光源网格自身是否投射阴影。此选项同时启用更精确的光照算法。&lt;br /&gt;
* Samples Near：影响靠近网格的光照质量。典型值为 16 到 64，仅当 Self Shadow 开启时可用。&lt;br /&gt;
* Samples Far：影响远离网格的光照质量。典型值为 4 到 4096。&lt;br /&gt;
&lt;br /&gt;
Bakery 基于光源表面距离混合两种不同的区域光算法。靠近光源时，算法类似 GI，而远处光源被近似为虚拟点光云。&lt;br /&gt;
&lt;br /&gt;
{{note| &amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;光源网格自身不会接收光照，也不会被烘焙到光照贴图中。&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;一个拥有大量多边形的光源网格比烘焙多个简单的光源网格要快&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;如果结果总是脏/噪点较多，可以尝试将 Samples Near 设置为 0，这样只使用 VPL 算法。对于不需要精度的简单光源（如建筑物的窗户光），这也非常有用。&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;}}  &lt;br /&gt;
[[File:Dd99d-QU0AEKFBK.jpg|thumb|弯曲的光源网格]]  &lt;br /&gt;
* Bitmask：用于排除此光源影响特定 Lightmap Groups 的开关列表。  &lt;br /&gt;
* Baked contribution：决定烘焙哪种类型的光照数据。仅在 Indirect 或 Shadowmask 模式下可见。可能的值：  &lt;br /&gt;
** Direct and Indirect：完全烘焙直接和间接光贡献。这是默认且推荐的光源网格行为，因为 Unity 中没有实时版本可以模拟它们。  &lt;br /&gt;
** Indirect only：实时光源提供直接光贡献，仅烘焙间接光。  &lt;br /&gt;
** Shadowmask and Indirect：实时光源提供直接光贡献，但静态几何体的阴影会烘焙到单独的贴图。动态和静态阴影将混合在一起。间接光照将照常烘焙。目前仅 HDRP（和自定义渲染器）支持混合区域光。  &lt;br /&gt;
** Direct, Indirect, Shadowmask (custom lighting only)：与 Direct and Indirect 相同，但同时生成 Shadowmask 并分配用于自定义着色器。  &lt;br /&gt;
* Indirect intensity：非物理 GI 倍增器。自然光照应设为 1，但可修改以实现更风格化的场景。  &lt;br /&gt;
* Shadowmask with falloff：将完整光衰减烘焙进 Shadowmask（仅对自定义着色器有用）。  &lt;br /&gt;
&lt;br /&gt;
如果网格材质和光源设置不匹配，将出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match light to material：将网格材质或区域光的通用设置复制到 Bakery 光源。&lt;br /&gt;
* Match material to light：将 Bakery 光源的通用设置复制到网格材质或区域光。&lt;br /&gt;
&lt;br /&gt;
==== Light Mesh 与自发光材质的区别 ====&lt;br /&gt;
自发光材质：&lt;br /&gt;
&lt;br /&gt;
* 在 GI 计算中传播光线，因此是“免费的”，无论有多少网格是自发光的。&lt;br /&gt;
* 小而明亮的光可能会产生不准确或有噪点的结果，这取决于 GI 的采样数量。&lt;br /&gt;
* 由于 Bakery 中 GI 的工作方式，它必须占用光照贴图空间，因此可能会浪费空间。同时，这意味着自发光对象需要有效的 UV，并且必须启用“投射阴影”。&lt;br /&gt;
&lt;br /&gt;
Light Mesh：&lt;br /&gt;
&lt;br /&gt;
* 光照会为每个光源单独计算，因此比自发光材质慢。&lt;br /&gt;
* 设计用于为小而明亮的光提供干净的光照效果，即使距离很远也能保持效果。&lt;br /&gt;
* 不占用光照贴图空间。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Point Light ===&lt;br /&gt;
[[File:Image11.png|thumb|左：“Shadow Spread” = 0.5，右：“Shadow Spread” = 1。]]&lt;br /&gt;
点光源，没有面积。尽管在物理上不可能，但在游戏中很有用，并且是匹配 Unity 点光源和聚光灯的唯一方式。&lt;br /&gt;
{{note| 聚光灯只是带有额外投影遮罩的点光源。}}&lt;br /&gt;
&lt;br /&gt;
* Color: 颜色&lt;br /&gt;
* Intensity: 线性色彩倍增&lt;br /&gt;
* Shadow spread: 阴影模糊度。虽然点光源没有面积，但通常希望它仍能产生模糊阴影。为此，阴影被模拟为从球形区域光源投射。此参数定义了虚拟球体的半径，直接影响阴影模糊度。&lt;br /&gt;
* Physical falloff: 如果启用，将使用正确的平方反比衰减，并在边界附近额外衰减。否则将尝试模拟 Unity 的衰减。&lt;br /&gt;
* Falloff min size: 详见 [[Point Light Attenuation]] 部分。&lt;br /&gt;
* Range: 如果物理衰减被禁用，则等于 Unity 的光源范围；如果启用，只会在边缘轻微衰减物理衰减。&lt;br /&gt;
* Samples: 影响阴影质量。典型值为 1 到 512。设置为 0 将使该光源的阴影消失。&lt;br /&gt;
  [[File:Image10.png|thumb|从左到右：Omni，Cookie（默认聚光灯纹理），Cubemap，IES。]]&lt;br /&gt;
* Projection mask: 遮罩/Cookie 类型。选项：&lt;br /&gt;
** Omni: 无遮罩，相当于 Unity 的点光源。&lt;br /&gt;
** Cookie: 纹理投影遮罩。附加选项：&lt;br /&gt;
*** Cookie texture: 2D 纹理资源。Bakery 包含原始 Unity 聚光灯纹理（名为 ftUnitySpotTexture），可用于模拟。&lt;br /&gt;
*** Angle: 纹理投影角度（类似 Unity 聚光灯）。&lt;br /&gt;
*** Correct distortion: 修正宽角下直线可见的 cookie 失真。&lt;br /&gt;
** Cubemap: 立方体贴图投影遮罩。附加选项：&lt;br /&gt;
*** Projected cubemap: 立方体贴图资源。&lt;br /&gt;
** IES: 光照由 IES 文件数据调制。附加选项：&lt;br /&gt;
*** IES file: .ies 扩展名文件。&lt;br /&gt;
* Bitmask: 用于排除该光源影响特定 Lightmap Groups 的开关列表。&lt;br /&gt;
* Baked contribution: 决定应烘焙哪种类型的光照数据。仅在 Indirect 或 Shadowmask 模式下可见。可能值：&lt;br /&gt;
** Direct and Indirect: 直接光和间接光完全烘焙。&lt;br /&gt;
** Indirect only: 实时光提供直接光，仅烘焙间接光。&lt;br /&gt;
** Shadowmask and Indirect: 实时光提供直接光，但静态几何体阴影烘焙到单独贴图中，动态和静态阴影混合，间接光正常烘焙。&lt;br /&gt;
** Direct, Indirect, Shadowmask (custom lighting only): 与 Direct and Indirect 相同，同时生成 Shadowmask 用于自定义着色器。&lt;br /&gt;
* Indirect intensity: 该光的非物理 GI 倍增。自然光应为 1，可根据风格化场景修改。&lt;br /&gt;
* Shadowmask with falloff: 将完整光衰减（除距离外）烘焙到 Shadowmask（仅自定义着色器有用）。&lt;br /&gt;
* Legacy sampling: 使用 Bakery 原始更偏置的阴影采样策略。产生无噪点阴影，但宽半影可能出现条纹。禁用后使用无偏但更有噪点的技术。&lt;br /&gt;
&lt;br /&gt;
如果同一对象同时启用了 Unity 和 Bakery 光源，且设置不匹配，则会出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match lightmapped to real-time: 将 Unity 光的常用设置复制到 Bakery 光。&lt;br /&gt;
* Match real-time to lightmapped: 将 Bakery 光的常用设置复制到 Unity 光。&lt;br /&gt;
&lt;br /&gt;
{{note| 从物理角度来看，Bakery 点光源的“Intensity”为 Candela 除以 Pi。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Volume ===&lt;br /&gt;
[[File:Voldemo notlonely.gif|由 BakeryVolume 照亮的动态门（动态 GIF，由 NOTLonely 制作）]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
体积（Volumes）生成存储每个体素光探针的 3D 纹理（L1 球面调和和阴影贴图），使其成为常规 Unity 光探针的可行替代方案。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Unity Light Probes&lt;br /&gt;
! Unity LPPV&lt;br /&gt;
! Bakery Volumes&lt;br /&gt;
|-&lt;br /&gt;
| 手动放置每个光探针&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 否&lt;br /&gt;
|-&lt;br /&gt;
| 在一个物体上插值多个光探针&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 运行时可移动&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 可以放入预制件&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 完整脚本 API&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| “Ringing” 伪影&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 可能出现&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 可能出现&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 已修正&lt;br /&gt;
|-&lt;br /&gt;
| 去噪&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 运行时开销&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | CPU：低开销；GPU：低开销&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | CPU：中等开销；GPU：中等开销&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#e4ead3;&amp;quot; | CPU：无开销；GPU：中等开销&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bakery Volume 是一个与一组 3D 纹理（3 个 SH 纹理和一个可选的 shadowmask）关联的边界盒，使其非常易于使用和编程。Volumes 可以在运行时轻松地交换、移动、加载或卸载，也可以与预制件关联。它们不需要任何 Light Probe Groups 或手动探针布置；整个 Volume 都由均匀的探针体素网格填充。光/影泄漏会自动像处理光照贴图一样修复（尽管对于较大的体素尺寸，薄的双面墙可能会出现问题，但可以通过在不同侧使用不同 Volume 避免）。由于体素网格的均匀特性，也可以对其应用类似光照贴图的降噪，这是常规光探针无法做到的。此外，Bakery 着色器使用 [https://drive.google.com/file/d/1MK6Clw93q8ljijRjb4gQOzzaIjn1uF9Y/view Geomerics] 采样技巧，完全消除了高对比度 HDR 光照下 SH 有时会产生的 “ringing” 伪影。&lt;br /&gt;
&lt;br /&gt;
因此，Volumes 可以为动态物体生成干净、精细、高质量的烘焙光照（即来自静态物体并影响动态物体的光照，而不是相反）。&lt;br /&gt;
&lt;br /&gt;
Volume 方法的唯一缺点是每像素着色开销较高。其开销类似于 LPPV（随着屏幕上受体素影响的像素数量而缩放），但与 LPPV 不同的是，一旦烘焙完成，Volumes 本身不会再更新。多个 Volume 的混合可以通过稍微重叠它们来避免。&lt;br /&gt;
&lt;br /&gt;
====设置 Volume 变换====&lt;br /&gt;
[[File:Bvolgizmo.jpg|thumb|Volume 控制柄]]&lt;br /&gt;
当 BakeryVolume 被添加到一个 GameObject 时，场景视图中会出现一个边界盒控制柄。拖动小方块即可缩放它。&lt;br /&gt;
&lt;br /&gt;
还有其他方法可以更改 Volume 的大小和位置：&lt;br /&gt;
&lt;br /&gt;
* 将任何可渲染的 GameObject 拖入 “Wrap to object” 字段。Volume 会包裹该对象（及其子对象），以将它们完全包含在内。&lt;br /&gt;
* 如果同一个对象上添加了 Box Collider，则会出现 “Set from box collider” 和 “Set to box collider” 按钮。可以用它们快速在 Volume 和 Collider 之间复制数值。&lt;br /&gt;
&lt;br /&gt;
====分辨率====&lt;br /&gt;
当启用 “Adaptive resolution” 时，体素数量由 “Voxels per unit” 控制。禁用它可以手动输入分辨率。对于大多数 1 单位 = 1 米 的游戏来说，一个合理的 “Voxels per unit” 值是 2，但在某些情况下（例如动态门）使用较小但更高分辨率的 Volume 会更有利。&lt;br /&gt;
&lt;br /&gt;
====其他设置====&lt;br /&gt;
&lt;br /&gt;
* Enable baking: 是否需要（重新）计算 Volume？禁用可防止覆盖已有数据。&lt;br /&gt;
* Denoise: 在烘焙 Volume 后应用去噪。推荐用于高分辨率 Volume。避免用于覆盖许多光源的低分辨率 Volume，因为去噪器难以区分实际内容和噪声。&lt;br /&gt;
* Global: 自动将此 Volume 分配给所有兼容 Volume 的 Shader，除非它们有覆盖设置。内部会调用 Shader.SetGlobalTexture()/SetGlobalVector()。&lt;br /&gt;
====使用方法====&lt;br /&gt;
Volumes 可以分配给使用 Volume 感知 Shader 的对象。Bakery 自带实现该功能的 “Bakery Standard” Shader，以及 HDRP 和 URP 的 Shader 图。请查看 example_volumes 场景，了解应用 Volume 的各种方式。&lt;br /&gt;
&lt;br /&gt;
====提示====&lt;br /&gt;
&lt;br /&gt;
* 确保查看示例。&lt;br /&gt;
* 如果两个 Volume 相连，让它们略微重叠。重叠大小应等于最大动态对象的尺寸。这样在运行时简单切换 Volume 就能正常工作。&lt;br /&gt;
* 仅在动态对象实际可达的区域放置 Volume。例如，使用玩家高度限制 Volume 的高度。&lt;br /&gt;
&lt;br /&gt;
====旋转 Volumes====&lt;br /&gt;
如果启用 “Rotate around Y” 选项，Volumes 可以绕 Y 轴旋转。旋转开销非常低，只使用 2 个额外的浮点数据（预计算的角度 sin/cos）。&lt;br /&gt;
&lt;br /&gt;
还可以在运行时旋转 Volumes（Experimental -&amp;gt; “Support rotation after bake” 以及 Bakery Shader 中的类似选项），这种情况下 Volume 必须在初始旋转为零时进行烘焙。&lt;br /&gt;
&lt;br /&gt;
在 URP 中，这种动态旋转可以与 `BakeryURPVolumeGraphRotatable.shadergraph` 一起使用。&lt;br /&gt;
&lt;br /&gt;
对于全局 Volume，动态旋转会在组件被（重新）启用或调用 `volume.SetGlobalParams()` 时更新。使用局部旋转 Volume 时，需要手动在材质或 MaterialPropertyBlock 上设置旋转：&lt;br /&gt;
{{code|&amp;lt;nowiki&amp;gt;SetMatrix(&amp;quot;_VolumeMatrix&amp;quot;, volume.GetMatrix())&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
====技术信息====&lt;br /&gt;
Volumes 可以自动工作（查看示例场景），也可以通过脚本控制其使用方式。&lt;br /&gt;
&lt;br /&gt;
可以通过组件的以下公共属性获取 Volume 数据：&lt;br /&gt;
&lt;br /&gt;
* `bakedTexture0`：存储 L0 RGB 系数和 L1 Z 红色通道在 alpha 中。&lt;br /&gt;
* `bakedTexture1`：存储 L1 X RGB 系数和 L1 Z 绿色通道在 alpha 中。&lt;br /&gt;
* `bakedTexture2`：存储 L1 Y RGB 系数和 L1 Z 蓝色通道在 alpha 中。&lt;br /&gt;
* `bakedMask`：存储体积阴影遮罩。&lt;br /&gt;
* `bounds`：Volume 的包围盒。&lt;br /&gt;
&lt;br /&gt;
所有 `bakedTexture*` 使用 RGBAHalf（每体素 8 字节）格式，mask 使用 ARGB32（每体素 4 字节）。阴影遮罩也可以使用单通道 R8 格式（每体素 1 字节）。&lt;br /&gt;
&lt;br /&gt;
因此 Volume 的字节大小 = width * height * depth * 3 * 8 + （仅当使用阴影遮罩时）width * height * depth * 4（或使用 R8 mask 时为 width * height * depth）。&lt;br /&gt;
&lt;br /&gt;
[[使用手册#Compress_volumes|可以对 Volume 启用纹理压缩]]，使其体积显著减小。&lt;br /&gt;
&lt;br /&gt;
采样 Volume 需要特殊 Shader，这些 Shader 已包含在 Bakery 中。要在自定义 Shader 中添加 Volumes，请查看 HDRP/URP 包中包含的 `BakeryVolume_float()` 函数（位于 `BakeryDecodeLightmap.hlsl`）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Light Filter ===&lt;br /&gt;
[[File:Output optimized.gif|彩色玻璃，如在 &amp;quot;Bakery Real-Time Preview&amp;quot; 中所见。Bakery lightmapper 烘焙出的结果相同。]]&lt;br /&gt;
&lt;br /&gt;
将渲染器标记为光过滤器（Light Filter）。过滤器会用其颜色着色所有直接和间接光线，类似于现实中的光学滤镜，从而实现彩色透明效果（例如彩色玻璃）。唯一的参数是用于着色的纹理。&lt;br /&gt;
&lt;br /&gt;
* 光过滤器对象仍然会像其他对象一样接收光照贴图。&lt;br /&gt;
* 过滤器不会散射或模糊光线（如需此效果，请尝试 [[Subsurface_scattering|Subsurface Scattering]] 或 [[使用手册#Backface_GI|Backface GI]]）。&lt;br /&gt;
* 过滤器可以产生带颜色的阴影。如果灯光使用 [[使用手册#Shadowmask|Shadowmask]] 模式，则结果只会保存 R 通道（因为 Unity 仅支持单通道遮罩）。对于完全烘焙的阴影，则没有限制。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Sector ===&lt;br /&gt;
参见 '''[[Partial_scene_baking|Partial scene baking]]'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Always Render ===&lt;br /&gt;
如果添加到一个物体上，Bakery 在烘焙时将始终考虑该物体，即使它的 Renderer 被禁用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
=== Bakery Pack As Single Square ===&lt;br /&gt;
如果添加到一个物体上，Bakery 会将该物体及其子物体的 UV 视为单个组合方块，在自动图集打包或 Lightmap Group 的 Pack Atlas 模式下，它们之间永远不会被移动。整个子层级将作为一个整体打包。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
=== Bakery Shared LOD UV ===&lt;br /&gt;
如果添加到一个 LODGroup 上，将标记所有同名 LOD 共享同一个光照贴图。默认情况下，每个 LOD 网格会获得独立的光照贴图，占用图集空间；但如果已知同一个物体的 LOD 拥有相似的 UV2（或者在没有 UV2 且 UV1 不重叠的情况下），它们可以映射到图集的同一部分，从而节省内存。&lt;br /&gt;
这种技术也称为 [https://github.com/laurenth-personal/LODLightmapScripts/ Lightmap Stealing]。&lt;br /&gt;
&lt;br /&gt;
= 材质兼容性 =&lt;br /&gt;
&lt;br /&gt;
=== 漫反射和发光 ===&lt;br /&gt;
Bakery 利用 [https://docs.unity3d.com/Manual/MetaPass.html Meta Pass] 系统支持大多数 Unity 材质。所有内置、Surface、URP 和 HDRP 着色器都已经定义了正确的 Meta Pass。&lt;br /&gt;
&lt;br /&gt;
如果你使用的是 Unlit 着色器，需要按照 Unity 文档手动添加 Meta Pass。&lt;br /&gt;
&lt;br /&gt;
如果未定义该 Pass，Bakery 将假定 {{codeVar|_MainTex}}、{{codeVar|_BaseColorMap}} 或 {{codeVar|_Color}}（如果未设置纹理）为材质的漫反射（Albedo），并将 {{codeVar|_EmissionMap}} 和 {{codeVar|_EmissionColor}} 作为发光颜色。&lt;br /&gt;
&lt;br /&gt;
为了使发光生效，[https://docs.unity3d.com/ScriptReference/Material-globalIlluminationFlags.html Material.globalIlluminationFlags] 必须设置为 [https://docs.unity3d.com/ScriptReference/MaterialGlobalIlluminationFlags.BakedEmissive.html MaterialGlobalIlluminationFlags.BakedEmissive]。标准着色器会自动设置此值。&lt;br /&gt;
&lt;br /&gt;
=== 不透明度 ===&lt;br /&gt;
[[File:Upload 2019-1-25 0-4-30.png|thumb|材质参数被转换为 Cutout（默认）]]&lt;br /&gt;
[[File:Alphacombos dither.jpg|thumb|通过“Dither Transparency”选项添加半透明值]]&lt;br /&gt;
[[File:Alphacombos filter.jpg|thumb|Light Filter 组件用于红色平面，生成彩色阴影]]&lt;br /&gt;
&lt;br /&gt;
默认情况下，Bakery 始终从 {{codeVar|_MainTex}}、{{codeVar|_BaseColorMap}} 或 {{codeVar|_BaseMap}} 的 alpha 值获取全分辨率的不透明度，并将其视为 Cutout（1 位透明）。&lt;br /&gt;
&lt;br /&gt;
当启用 '''Dither Transparency''' 选项时，半透明值会自动转换为可变蓝噪声，然后被滤波/模糊，产生部分透明效果（以前可以通过自定义手动抖动贴图实现，但从 v1.97 起自动完成）。&lt;br /&gt;
&lt;br /&gt;
为了使不透明度生效，着色器的 [https://docs.unity3d.com/Manual/SL-SubShaderTags.html RenderType 标签] 必须为以下值之一：&lt;br /&gt;
&lt;br /&gt;
* {{codeVar|Transparent}}&lt;br /&gt;
* {{codeVar|TransparentCutout}}&lt;br /&gt;
* {{codeVar|TreeLeaf}}&lt;br /&gt;
&lt;br /&gt;
如果存在名为 {{codeVar|_Cutoff}} 的属性，它将影响 Cutout（因此 Standard 着色器的 Cutoff 滑块会自动生效）。&lt;br /&gt;
&lt;br /&gt;
在没有 Dither Transparency 的情况下，如果材质 RenderType 为 {{codeVar|Transparent}} 或 {{codeVar|TreeLeaf}}，则 {{codeVar|_Color}} 的 alpha 值会额外修改 Cutoff：&lt;br /&gt;
''finalCutoff = 1 - (1 - cutoff) * alpha''&lt;br /&gt;
&lt;br /&gt;
对于彩色透明效果，请使用 [[Manual#Bakery_Light_Filter|Light Filter]] 组件。&lt;br /&gt;
&lt;br /&gt;
有关漫反射半透明效果，请参考 [[#Backface GI|Backface GI]] 和 [[subsurface scattering]]。&lt;br /&gt;
&lt;br /&gt;
==== Alpha Meta Pass ====&lt;br /&gt;
从 v1.9 起，Bakery 还支持指定基于自定义着色器的透明度，但这需要使用兼容的着色器。要使用 ''Alpha Meta Pass''，需要执行以下步骤：&lt;br /&gt;
&lt;br /&gt;
* 在着色器中添加一个名为 '''BAKERY_META_ALPHA_ENABLE''' 的属性。例如：&lt;br /&gt;
  {{code|&amp;lt;nowiki&amp;gt;[HideInInspector] BAKERY_META_ALPHA_ENABLE (&amp;quot;Enable Bakery alpha meta pass&amp;quot;, Float) = 1.0&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
* 确保 RenderType 标签设置为上文提到的某个值。&lt;br /&gt;
* 声明一个名为 '''META_BAKERY''' 的 Pass。&lt;br /&gt;
* 在该 Pass 中检查 '''unity_MetaFragmentControl.w''' 是否非零，如果是，则返回计算出的透明度值。&lt;br /&gt;
&lt;br /&gt;
示例可参考包内的 ''Baked_Alpha_meta.shader''。&lt;br /&gt;
&lt;br /&gt;
注意：当前 Alpha Meta Pass 需要将 Light Probe Mode 设置为 L1 或 L2。&lt;br /&gt;
&lt;br /&gt;
=== Normal mapping ===&lt;br /&gt;
自定义表面法线可以与 [[#Baked Normal Maps|烘焙法线贴图]] 模式一起使用。不幸的是，Unity 的 Meta Pass 默认不输出法线信息，因此默认情况下，法线取自名为 {{codeVar|_BumpMap}} 的贴图，并通过 {{codeVar|_MainTex_ST}} 进行额外变换。&lt;br /&gt;
&lt;br /&gt;
然而，可以制作完全自定义的着色器，带有高级法线映射功能（例如混合多层法线），并使其兼容烘焙。要实现这一点，需要执行以下步骤：&lt;br /&gt;
&lt;br /&gt;
1. 在着色器中定义一个 Meta Pass，具体方法请参考 [https://docs.unity3d.com/Manual/MetaPass.html#ExampleMetaPassUnity 文档]。&lt;br /&gt;
&lt;br /&gt;
2. 将该 Pass 命名为 {{codeVar|&amp;quot;META_BAKERY&amp;quot;}}，而不仅仅是 {{codeVar|&amp;quot;META&amp;quot;}}。&lt;br /&gt;
&lt;br /&gt;
3. 包含文件 {{codeVar|&amp;quot;BakeryMetaPass.cginc&amp;quot;}}。&lt;br /&gt;
&lt;br /&gt;
4. 添加 {{codeVar|#pragma vertex vert_bakerymt}}。&lt;br /&gt;
&lt;br /&gt;
5. 如果 {{codeVar|unity_MetaFragmentControl.z}} 变量不为 0，着色器应返回世界空间法线。返回的法线应使用 {{codeVar|BakeryEncodeNormal}} 函数编码。&lt;br /&gt;
&lt;br /&gt;
在 Assets/Bakery/examples/shaders 中包含了两个实现了扩展 Meta Pass 的示例着色器。&lt;br /&gt;
&lt;br /&gt;
你也可以复制并修改 BakeryMetaPass.cginc 以满足你的需求，例如从顶点着色器传递额外数据。&lt;br /&gt;
&lt;br /&gt;
=== 正/背面 ===&lt;br /&gt;
无论着色器使用何种剔除模式，Bakery 都将所有背面视为不透明，这意味着任何直接光线都不会穿过背面，就像它不会穿过正面一样。&lt;br /&gt;
然而，如果使用 [[使用手册#Backface_GI|Backface GI]]，背面可以部分发出正面接收到的光照。&lt;br /&gt;
&lt;br /&gt;
= 扩展 Lightmap Parameters 资源 =&lt;br /&gt;
[[File:Lp.jpg|thumb|扩展 Lightmap Parameters]]&lt;br /&gt;
类似于 Bakery 的 [[#Bakery_Lightmap_Group_Selector|Lightmap Group]]，Unity 也有 [https://docs.unity3d.com/Manual/class-LightmapParameters.html Lightmap Parameters]，可以作为资源创建并分配给 Mesh Renderer。它们的逻辑有相似之处也有不同之处：&lt;br /&gt;
&lt;br /&gt;
* Lightmap Group 的主要用途是将多个对象组合到同一个图集。此外，它还允许覆盖该图集的烘焙设置。&lt;br /&gt;
* Lightmap Parameters 主要用于覆盖对象的烘焙设置，但通过使用“Baked Tag”选项，它们也可以影响打包：具有不同 Baked Tag 的对象将永远不会共享同一个图集。&lt;br /&gt;
&lt;br /&gt;
由于有些用户更习惯 Lightmap Parameters 的工作流程，Bakery 现在支持并扩展了它们：&lt;br /&gt;
&lt;br /&gt;
* Bakery 会遵循 Baked Tag 设置。&lt;br /&gt;
* Lightmap Parameters UI 中将显示额外的 Bakery 特定选项。有关其含义，请参考 [[#Bakery_Lightmap_Group_Selector|Lightmap Group]] 部分。&lt;br /&gt;
&lt;br /&gt;
= 项目设置 =&lt;br /&gt;
一些全局设置可以在 Project Settings -&amp;gt; Bakery GPU Lightmapper 中调整（此选项仅在 Unity 2018.3 或更新版本可见；旧版本请编辑 BakeryProjectSettings.asset）：&lt;br /&gt;
&lt;br /&gt;
* Mipmap lightmaps：启用光照贴图的 mipmap。随着图集变小，可能会导致 UV 图块之间的泄漏；另一方面，它可以减少远处高分辨率光照贴图的锯齿。总体上，建议对非常远的物体使用单独烘焙的 LOD 以及较低分辨率的光照贴图。&lt;br /&gt;
* Color file format：常规 HDR 颜色光照贴图的文件格式。可选值：&lt;br /&gt;
**HDR：Radiance HDR 格式（默认）。可用多种图像编辑器打开。&lt;br /&gt;
**Asset：Unity 原生格式。可自定义 mipmap 数量。&lt;br /&gt;
* Mask/Direction file format：额外 LDR 地图的格式，如阴影遮罩或方向数据。可选值：&lt;br /&gt;
**TGA：8 位 Targa（默认）。&lt;br /&gt;
**PNG：8 位 PNG。通常比 TGA 占用更少磁盘空间。&lt;br /&gt;
**Asset：Unity 原生格式。可自定义 mipmap 数量。&lt;br /&gt;
* Compress lightmaps：定义光照贴图资源的压缩行为。压缩光照贴图占用更少的显存，但可能会出现一些视觉伪影（例如色带或色斑），具体取决于压缩类型（移动端压缩问题请参见[[Troubleshooting#I_have_an_Android_project.2C_and_lightmaps_don.27t_look_good|此处]]）。可选值：&lt;br /&gt;
*** Compress but allow overriding asset: 新的光照贴图将在启用压缩的情况下创建。创建后，可以在 Inspector 中更改它们的压缩设置。修改后的值将在重新烘焙后保留（默认）。&lt;br /&gt;
*** Force compress: 始终压缩所有光照贴图。&lt;br /&gt;
*** Force no compress: 始终生成未压缩的光照贴图。&lt;br /&gt;
* High quality direction: 为方向贴图启用“高”质量压缩。实际格式取决于平台。例如在 PC 上，它会从 DXT1 改为 BC7，这提供了更高的质量，但 VRAM 使用量会翻倍。&lt;br /&gt;
* Texel padding (default atlas packer): 定义在使用默认 atlas 打包器时，在光照贴图 atlas 中对象 UV 布局之间添加多少空白 texel。&lt;br /&gt;
* Texel padding (xatlas packer): 同上，但在使用 xatlas 时。&lt;br /&gt;
* Alpha Meta Pass resolution multiplier: 乘以 [[Manual#Alpha_Meta_Pass|Alpha Meta Pass]] 的分辨率，使在低分辨率光照贴图烘焙时仍能实现精确的基于 Shader 的切割效果。&lt;br /&gt;
* Volume render mode: 为所有 [[Manual#Bakery_Volume|Volumes]] 使用哪种 [[Manual#Render_mode|渲染模式]]？Auto 使用当前活动的渲染模式（默认）。&lt;br /&gt;
* Delete previous lightmaps before bake: 在烘焙新光照贴图之前，实际删除该场景中所有之前渲染的光照贴图文件。&lt;br /&gt;
* Log level: 定义烘焙过程中在控制台输出的信息量。可能的值：&lt;br /&gt;
** 0: 不输出任何内容。&lt;br /&gt;
** 1: 仅输出进度信息。&lt;br /&gt;
** 2: 仅输出警告。&lt;br /&gt;
** 3: 输出全部信息。&lt;br /&gt;
* Alternative scale in lightmap: 使渲染器属性 'Scale in Lightmap' 的行为更类似于 Unity 内置的行为。&lt;br /&gt;
* Align to texture compression blocks with xatlas: 使 xatlas 将 chart 对齐到 4x4 块边界，从而获得更适合压缩的结果。&lt;br /&gt;
* Generate smooth positions: 是否应调整采样位置以防止低多边形几何体在平滑法线下产生错误阴影？在使用法线差异极大的几何体时，可在极少数情况下禁用。技术说明见 [https://ndotl.wordpress.com/2018/08/29/baking-artifact-free-lightmaps/#shadowterm 这篇文章]。&lt;br /&gt;
* Smooth positions per-triangle: 是否应按三角形决定平滑/平面位置？在使用法线差异极大的几何体时，可在极少数情况下禁用。&lt;br /&gt;
* Use 'Receive GI' values: 在渲染器上考虑 “Receive Global Illumination” 值。最初 Bakery 会忽略它。&lt;br /&gt;
* Remove ringing in Legacy light probes: 在 Legacy 模式下启用更柔和的光探针卷积，以防止高对比度区域出现伪影。&lt;br /&gt;
* Always render reflection probes: 在每次 Render/Render Light Probes 后自动渲染反射探针。&lt;br /&gt;
* Ringing removal for L2 light probes: 对 [[Manual#Light_probe_mode|L2 光探针]] 应用去振铃处理。值越高，探针光照越平滑；这种平滑可以减少 [[https://docs.unity3d.com/6000.2/Documentation/Manual/light-probes-troubleshooting.html](https://docs.unity3d.com/6000.2/Documentation/Manual/light-probes-troubleshooting.html) 振铃] 伪影（如果存在）。&lt;br /&gt;
* Put menu under Tools: 将 Bakery 菜单放入 Tools 菜单下。&lt;br /&gt;
&lt;br /&gt;
如果任何格式设置为 Asset 且启用 mipmapping，会显示额外选项：&lt;br /&gt;
&lt;br /&gt;
* Maximum mipmap count: 定义 mipmap 的最大数量。例如，设置为 2，则 8K 光照贴图仅有两个额外 mipmap：4K 和 2K。更低分辨率将被省略，从而在 mipmapping 过程中限制泄漏伪影。&lt;br /&gt;
&lt;br /&gt;
= SkinnedMeshRenderer 支持 =&lt;br /&gt;
Bakery 自 v1.65 起支持蒙皮网格 (skinned meshes)。但是，有一些限制：&lt;br /&gt;
&lt;br /&gt;
* 某些 Unity 版本不支持蒙皮网格的 UV1，并会悄无声息地忽略 “Generate lightmap UVs”。请确保场景中实际使用的网格具有 UV1，并在可能的情况下使用非重叠的 UV0；&lt;br /&gt;
* UV 填充调整在蒙皮网格上不起作用（Unity 在尝试调用 Unwrap 函数时似乎会崩溃）；&lt;br /&gt;
* 蒙皮网格不能使用每顶点光照贴图 (per-vertex lightmaps)（引擎不支持带蒙皮的 additionalVertexStreams）。&lt;br /&gt;
&lt;br /&gt;
= Shader Tweaks =&lt;br /&gt;
[[File:Image2.jpg|thumb|左：默认双线性过滤。右：双三次过滤。]]&lt;br /&gt;
[[File:Image34.jpg|thumb|左：两个阴影都已烘焙。&amp;lt;br&amp;gt;中：球形阴影为动态，另一个阴影为静态。通过相乘组合在一起。&amp;lt;br&amp;gt;右：与中间相同，但使用默认最小值组合。]]&lt;br /&gt;
&lt;br /&gt;
Bakery 提供可选的着色器修改，可以应用到 Unity 着色器上，以改善光照贴图采样并使实时光照更接近光照贴图效果。着色器调整菜单可以通过 Bakery-&amp;gt;Shader Tweaks 访问。&lt;br /&gt;
&lt;br /&gt;
这些选项会修补基础 Unity 着色器包含文件（来自 CGIncludes 文件夹），这些文件被大多数内置和第三方着色器使用。所有修改都会影响使用该版本编辑器打开的所有项目，但也可以轻松恢复。着色器调整会影响标准和表面着色器的工作方式。HDRP、URP 以及其他 SRP 不受影响。&lt;br /&gt;
&lt;br /&gt;
所有可用修改显示为按钮。点击按钮应用修改，按钮将保持按下状态。再次点击按钮即可移除修改。目前可用选项：&lt;br /&gt;
&lt;br /&gt;
{{note| 可能需要以管理员身份运行 Unity 编辑器以使 CGIncludes 修补生效}}&lt;br /&gt;
&lt;br /&gt;
* Use bicubic interpolation for lightmaps: 光照贴图将使用双三次插值代替默认双线性。此调整能很好地修复低分辨率光照贴图的许多锯齿边缘。目前仅适用于 DX11 和现代主机，其他平台仍使用双线性。&lt;br /&gt;
* Use multiplication for shadowmask: 使用相乘代替最小值组合静态和动态阴影。出于未知原因，Unity 默认使用最小值操作符，这会产生一些乘法不存在的伪影。&lt;br /&gt;
* Use physical light falloff (forward): 用更物理正确的平方反比替换实时点光/聚光灯的默认衰减。“Range” 只会在边缘略微淡出（与 Bakery 光源启用 Physical Falloff 复选框效果一致）。仅影响 Forward 渲染器。详情见 [[Point Light Attenuation]]。&lt;br /&gt;
* Use physical light falloff (deferred): 同上，但仅影响 Deferred 渲染器。&lt;br /&gt;
&lt;br /&gt;
'''衰减调整在 Unity &amp;gt;2017 版本上可能无法完全生效。此外，SRP 默认已经使用正确的衰减。'''&lt;br /&gt;
&lt;br /&gt;
= Bakery shaders =&lt;br /&gt;
Bakery 包含了自带着色器，支持顶点光照贴图，以及 RNM 和 SH 方向模式。它还允许从方向数据计算近似烘焙高光。&lt;br /&gt;
对于普通颜色光照贴图、阴影遮罩和 Dominant Direction 模式，Bakery 着色器 '''不是必需的'''，因为这些功能大多数 Unity 着色器本身已经支持。&lt;br /&gt;
&lt;br /&gt;
=== Standard render pipeline ===&lt;br /&gt;
'''Bakery/Standard''': 扩展了普通 Standard 着色器。额外选项：&lt;br /&gt;
&lt;br /&gt;
* Allow Vertex Lightmaps: 允许该材质用于 [[Vertex Lightmaps|顶点光照贴图]]。&lt;br /&gt;
* Allow RNM Lightmaps: 允许该材质用于 [[#RNM|RNM 方向模式]]。&lt;br /&gt;
* Allow SH Lightmaps: 允许该材质用于 [[#SH|SH 方向模式]]。&lt;br /&gt;
  {{note| 所有 “Allow” 选项会在着色器中启用特定的代码路径。为了性能考虑，建议每个材质仅使用一个 “allow” 选项。}}&lt;br /&gt;
* Enable Lightmap Specular: 使用 Dominant Direction、RNM 或 SH 方向模式的数据计算烘焙高光。注意，由于信息有限，该效果仅为近似。如果你曾在 Unity 4 中使用烘焙高光，效果应可比。与高度扰动的法线贴图搭配效果最佳，在平面表面上效果不佳。&lt;br /&gt;
* Enable VertexLM directional: 如果存在顶点光照贴图，指定 Dominant Direction 数据存储在顶点中并应被使用。&lt;br /&gt;
* Enable VertexLM SH: 如果存在顶点光照贴图，指定 SH 数据存储在顶点中并应被使用。&lt;br /&gt;
* Enable VertexLM Shadowmask: 如果存在顶点光照贴图，指定阴影遮罩存储在顶点中并应被使用。&lt;br /&gt;
* Enable MonoSH: 将方向贴图视为 MonoSH 贴图。&lt;br /&gt;
[[File:Image5.png|thumb|Standard SH light probe vs non-linear]]&lt;br /&gt;
[[File:Shspec.jpg|thumb|SH specular effect]]&lt;br /&gt;
* Non-linear SH：在 SH 方向模式下，此选项可以增强对比度（更接近真实效果），但会使着色器稍微变慢。该技巧基于 Geomerics 的论文《[https://drive.google.com/file/d/1MK6Clw93q8ljijRjb4gQOzzaIjn1uF9Y/view Reconstructing Diffuse Lighting from Spherical Harmonic Data]》。&lt;br /&gt;
* Non-linear Light Probe SH：与 Non-linear SH 类似，但用于光照探针。在探针的情况下，最显著的好处是消除错误的负值。这种问题常见于具有高对比度、明亮 HDR 光源的场景中。这是球谐函数的固有限制，而不是 Bakery 特有的问题（即使用 Unity 内置光照贴图器也可能出现类似伪影）。&lt;br /&gt;
* Force Bicubic Filter：为所有附加贴图启用双三次滤波。若要实现完整的双三次滤波（包括第一张颜色贴图），建议同时在 [[#Shader Tweaks|Shader Tweaks]] 中启用该功能。&lt;br /&gt;
&lt;br /&gt;
'''Bakery/Standard Specular'''：与 Standard 相同，但用于高光（Specular）工作流程。&lt;br /&gt;
&lt;br /&gt;
=== HDRP &amp;amp; URP ===&lt;br /&gt;
要提取额外的 HDRP/URP 着色器，请打开 Bakery 自带的 Bakery_ShaderGraphHDRP.unitypackage 或 Bakery_ShaderGraphURP.unitypackage。&lt;br /&gt;
在其中，你会找到可在自己 Shader Graph 中使用的 Shader Subgraph，以及一些示例材质。&lt;br /&gt;
&lt;br /&gt;
=== 各着色器功能支持对比 ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! 大多数 Unity 着色器&lt;br /&gt;
! 大多数 HDRP 和 URP 着色器&lt;br /&gt;
! Bakery Standard&lt;br /&gt;
! Bakery HDRP graphs&lt;br /&gt;
! Bakery URP graphs&lt;br /&gt;
|-&lt;br /&gt;
| HDR color lightmaps&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Shadowmask&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是 (&amp;gt;= URP 10.1)&lt;br /&gt;
|-&lt;br /&gt;
| Dominant Direction&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| RNM&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| SH&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Mo否SH&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Lightmap specular&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持 Dominant Direction 和 SH&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持 Dominant Direction&lt;br /&gt;
|-&lt;br /&gt;
| Bicubic filtering&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是,&lt;br /&gt;
通过 [[#Shader Tweaks|Shader Tweaks]] 支持&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是,&lt;br /&gt;
通过 [[#Shader Tweaks|Shader Tweaks]] 支持&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
|-&lt;br /&gt;
| Vertex lightmaps&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 单一颜色，没有每顶点 SH、方向或阴影遮罩（Shader Graph 限制）&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 单一颜色，没有每顶点 SH、方向或阴影遮罩（Shader Graph 限制）&lt;br /&gt;
|-&lt;br /&gt;
| Non-Linear Light Probes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Volumes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Volume shadowmask&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Compressed volumes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{note| 除了普通颜色光照贴图之外，所有功能都至少需要 Shader Model 3.0 才能运行。}}&lt;br /&gt;
{{note| 使用 SH 模式的顶点光照贴图由于插值器数量限制，至少需要 Shader Model 4.0。}}&lt;br /&gt;
{{note| 含有从 Dominant Direction 生成高光的更新版 URP 图表可在 [[Bakery_-_GPU_Lightmapper|主维基页面]] 下载。}}&lt;br /&gt;
&lt;br /&gt;
另请参阅：[[Integrating_Bakery_shader_features_to_custom_shaders| 将 Bakery 着色器特性集成到自定义着色器中]]&lt;/div&gt;</summary>
		<author><name>Mr F</name></author>
		
	</entry>
	<entry>
		<id>https://geom.io/bakery/wiki/index.php?title=%E4%BD%BF%E7%94%A8%E6%89%8B%E5%86%8C&amp;diff=1830</id>
		<title>使用手册</title>
		<link rel="alternate" type="text/html" href="https://geom.io/bakery/wiki/index.php?title=%E4%BD%BF%E7%94%A8%E6%89%8B%E5%86%8C&amp;diff=1830"/>
		<updated>2025-11-05T14:30:31Z</updated>

		<summary type="html">&lt;p&gt;Mr F: /* 各着色器功能支持对比 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== 系统要求 ==&lt;br /&gt;
&lt;br /&gt;
使用 Bakery 需要：&lt;br /&gt;
&lt;br /&gt;
Windows（7 或更高版本）电脑。&lt;br /&gt;
&lt;br /&gt;
Nvidia 显卡。最低支持型号为 Kepler（GeForce 650 或更新型号，Quadro 显卡请查看规格）。&lt;br /&gt;
&lt;br /&gt;
64 位 Unity 编辑器。Bakery 已在 5.6 到 6 及更高版本上测试过，同时也在 Tuanjie 1.6.7 上通过测试。&lt;br /&gt;
&lt;br /&gt;
{{note|系统要求仅适用于开发者的电脑，而非目标平台。使用 Bakery 烘焙的光照贴图可以在任何地方使用。}}&lt;br /&gt;
&lt;br /&gt;
== 前提条件 ==&lt;br /&gt;
* 确保你的项目中没有任何脚本编译错误，否则也会导致 Bakery 的脚本无法编译。&lt;br /&gt;
* 确保你的显卡驱动是最新版本，如有需要请[https://www.nvidia.com/Download/index.aspx?lang=en-US 更新]。&lt;br /&gt;
&lt;br /&gt;
'''请使用 Game-Ready（标准）驱动程序，而不是 “Studio” 驱动。'''&lt;br /&gt;
&lt;br /&gt;
== 安装 ==&lt;br /&gt;
&lt;br /&gt;
1. 通过 [https://assetstore.unity.com/packages/tools/level-design/bakery-gpu-lightmapper-122218 Asset Store] 将 Bakery 导入到你的项目中。&lt;br /&gt;
&lt;br /&gt;
2. Unity 会显示要导入的文件列表。如果这是你第一次使用 Bakery，建议直接 点击 Import（导入）。有经验的用户可以取消选中 examples 文件夹，以进行更轻量的安装。&lt;br /&gt;
&lt;br /&gt;
文件将被导入到 `Assets/Bakery` 和 `Assets/Editor/x64/Bakery` 文件夹中。&lt;br /&gt;
这些文件夹之后可以移动。&lt;br /&gt;
&lt;br /&gt;
3. Unity 随后会导入 Bakery 并编译脚本。此时可能会弹出如下窗口：&lt;br /&gt;
&lt;br /&gt;
[[File:Goahead.png]]&lt;br /&gt;
&lt;br /&gt;
此时你应点击 “Go Ahead”（继续）。&lt;br /&gt;
&lt;br /&gt;
现在你应该能在编辑器中看到新增的 Bakery 菜单：&lt;br /&gt;
&lt;br /&gt;
[[File:bmenu.jpg]]&lt;br /&gt;
&lt;br /&gt;
== 快速开始 ==&lt;br /&gt;
&lt;br /&gt;
1. 添加一些模型或基础体，并将其标记为静态（Static）。&lt;br /&gt;
&lt;br /&gt;
'''用于光照贴图的网格必须具有不重叠的 UV2。如果存在 UV2，则会使用 UV2（否则使用 UV1）。如果你的模型没有为光照贴图进行展开，请在资源中勾选 Generate Lightmap UVs（生成光照贴图 UV）。'''&lt;br /&gt;
Unity 的基础体已经具有正确的 UV2。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Staticmarked.jpg|320px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. 选择方向光（Unity 为你创建的那个），并添加 '''Bakery Direct Light''' 组件。&lt;br /&gt;
   {{note|Bakery 和 Unity 使用独立的光源组件。}}&lt;br /&gt;
&lt;br /&gt;
3. Bakery Direct Light 有许多可调选项，但你可以轻松将其与 Unity 光源匹配。点击 '''Match lightmapped to real-time'''。现在 Bakery 光源的颜色应与 Unity 默认的方向光相同，呈黄色调。&lt;br /&gt;
&lt;br /&gt;
[[File:Matching.jpg|640px]]&lt;br /&gt;
&lt;br /&gt;
{{note|Direct Light 组件可能会提示项目未使用线性光强度。问题在于，Unity 默认会对光源颜色应用伽马校正 [https://twitter.com/guycalledfrank/status/1001108508614553600 不正确]。&lt;br /&gt;
可以通过[https://docs.unity3d.com/ScriptReference/Rendering.GraphicsSettings-lightsUseLinearIntensity.html 脚本]启用正确模式。&lt;br /&gt;
这就是 “Fix” 按钮的作用。如果你已经在非线性光强模式下设置了许多光源，并且不想再次更改它们，可以跳过修复。即使你按了 “Fix”，也可以随时撤销此更改。&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. 要获得带阴影的环境光，请创建 Skylight（Bakery-&amp;gt;Create-&amp;gt;Skylight）。&lt;br /&gt;
&lt;br /&gt;
[[File:Menusky.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. 选择 Skylight，为它设置一些偏蓝的颜色，然后点击 '''Match scene skybox to this light'''。   这将使场景的 skybox 与光照完全匹配。&lt;br /&gt;
   {{note|将 Unity 的 skybox 与 Bakery Skylight 匹配是可选的，但对正确性很有用，可以确保可见环境和引擎内的反射探针与烘焙光照一致。目前此选项仅适用于 Standard 渲染管线。}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Skycomp.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. 点击 Bakery-&amp;gt;Render Lightmap。默认情况下，Full Lighting 模式是激活的。它会烘焙所有光源的直接和间接光照贡献。如果你想将实时阴影与烘焙全局光照（GI）结合使用，请将模式更改为 '''Indirect'''。&lt;br /&gt;
&lt;br /&gt;
[[File:Bakerywindow.jpg]]&lt;br /&gt;
&lt;br /&gt;
{{note| Bakery 可能会提示你正在使用旧的 [https://docs.unity3d.com/Manual/LinearLighting.html gamma mode]。如果你在意光照质量，强烈建议使用线性模式。如果你的项目已经在错误的伽马模式下设置好了，并且不想更改，或者是发布到不支持线性模式的移动设备上，也可以忽略此提示。}}&lt;br /&gt;
&lt;br /&gt;
7. 点击 '''Render'''。&lt;br /&gt;
&lt;br /&gt;
8. 完成！现在你应该已经得到烘焙的全局光照（GI）：&lt;br /&gt;
&lt;br /&gt;
[[File:Bakedgi.jpg]]&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 ==&lt;br /&gt;
&lt;br /&gt;
所有渲染设置都可以通过 Bakery-&amp;gt;Render Lightmap 访问。设置会为每个场景单独保存。Bakery 窗口顶部的选项允许你在 Simple（简单）、Advanced（高级）和 Experimental（实验）设置之间切换，每个后续模式都会显示更多可调选项。对于大多数场景，Simple 模式已经足够，是入门的好方法。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render mode ===  &lt;br /&gt;
定义要烘焙的光照贴图类型。  &lt;br /&gt;
&lt;br /&gt;
===== Full Lighting =====&lt;br /&gt;
烘焙所有 Bakery 光源的完整直接光和间接光。&lt;br /&gt;
{{note|在 2017.3 之前的 Unity 版本中，如果同一对象上同时有 Unity 和 Bakery 组件，你需要手动禁用 Unity 组件以避免亮度加倍。在较新版本中，实时效果会自动对烘焙光源禁用，就像内置光照烘焙器一样。}}&lt;br /&gt;
&lt;br /&gt;
===== Indirect =====&lt;br /&gt;
[[File:Image26.png|thumb|Unity 支持的不同渲染模式对比]]&lt;br /&gt;
基础混合模式。它会查看每个光源上的 Baked Contribution 选择器：如果设置为 ''Direct And Indirect''，则光源会像在 Full Lighting 模式下一样被烘焙。如果设置为 ''Indirect Only''，则只会烘焙该光源的间接光照（GI）。在后一种情况下，你应保持对象上的 Unity 光源和 Bakery 光源同时存在，一个提供实时直接光照，另一个提供预计算的全局光照（GI）。&lt;br /&gt;
&lt;br /&gt;
[[File:Indirectonly.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== Shadowmask =====&lt;br /&gt;
[[File:Image21.png|thumb|左：完全烘焙的光照。中：动态光源 + 烘焙 GI。右：胶囊形阴影、凹凸贴图和高光为动态光照，但立方体阴影和 GI 为烘焙光照。]]&lt;br /&gt;
[[File:Image6.png|thumb|当相机足够远离场景，或者动态阴影被禁用时，场景将呈现如下效果]]&lt;br /&gt;
更高级的混合模式。它通过生成两种类型的光照贴图来工作——一种包含烘焙颜色（如 Indirect 模式），另一种包含静态物体的阴影。它有几个优点：&lt;br /&gt;
* 实时阴影只需渲染少量动态对象，而不是整个场景。&lt;br /&gt;
* 实时阴影与烘焙阴影可以正确融合。&lt;br /&gt;
* 实时光源可以渲染凹凸贴图、高光和其他表面效果，同时仍会被高质量烘焙阴影遮挡。&lt;br /&gt;
[https://docs.unity3d.com/Manual/LightMode-Mixed-Shadowmask.html 更多详情]&lt;br /&gt;
&lt;br /&gt;
要启用此行为，你必须在同一对象上同时存在 Unity 光源和 Bakery 光源，并将 Baked Contribution 设置为 ''Shadowmask and Indirect''。未标记的光源将按 Indirect 模式进行烘焙。&lt;br /&gt;
&lt;br /&gt;
[[File:Smask22.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== Distance Shadowmask =====&lt;br /&gt;
此复选框仅在你选择 Shadowmask 时可见，并且只是切换项目 [https://docs.unity3d.com/Manual/LightMode-Mixed-ShadowmaskMode.html Quality Settings] 中同名的设置。&lt;br /&gt;
[https://docs.unity3d.com/Manual/LightMode-Mixed-DistanceShadowmask.html 更多详情]&lt;br /&gt;
{{note|由于缺少对应的脚本 API，该复选框在 Unity 5.6.x 上不可见。你可以在 Window-&amp;gt;Lighting-&amp;gt;Mixed Lighting-&amp;gt;Lighting Mode 中切换该设置。}}&lt;br /&gt;
{{note|在 Unity 版本 &amp;lt; 2017.3 中，由于 API 限制，渲染 Shadowmask 光照贴图会清除光照探针。烘焙后需要重新渲染光照探针。在较新版本中不应发生此问题。}}&lt;br /&gt;
&lt;br /&gt;
===== Subtractive =====&lt;br /&gt;
&lt;br /&gt;
启用 [https://docs.unity3d.com/Manual/LightMode-Mixed-Subtractive.html Subtractive] 光照模式。&lt;br /&gt;
&lt;br /&gt;
此选项对光照贴图本身没有任何特殊作用，实际上它的工作方式与 Full Lighting 相同。&lt;br /&gt;
&lt;br /&gt;
唯一的区别是，它还会将实时 Unity 光源设置为与 Subtractive 模式兼容（因为无法通过 UI 完成此操作）。&lt;br /&gt;
&lt;br /&gt;
你还需要在 [https://docs.unity3d.com/Manual/GlobalIllumination.html#MixedLighting Unity Lighting] 窗口中额外设置全局减法参数（例如全局阴影颜色）。&lt;br /&gt;
&lt;br /&gt;
===== Ambient Occlusion Only =====&lt;br /&gt;
仅烘焙环境光遮蔽（AO）。如果你很清楚自己在做什么，这可能会有用。请确保设置 [[#Ambient_occlusion|AO 选项]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Directional mode ===&lt;br /&gt;
[[File:Image3.png|thumb|不同方向模式的对比]]&lt;br /&gt;
定义了方向信息的烘焙方式。标准光照贴图每个像素只存储单一颜色，而方向光照贴图为着色器提供了关于该像素周围半球内光照变化的提示。这些数据用于在完全烘焙的区域中结合法线贴图。如果将其应用到内置的 [[#Bakery_shaders|Bakery]] 着色器中，还可以产生**近似高光反射**效果。&lt;br /&gt;
&lt;br /&gt;
===== None =====&lt;br /&gt;
不包含方向数据，每个像素仅有单一颜色。&lt;br /&gt;
&lt;br /&gt;
===== Baked Normal Maps =====&lt;br /&gt;
依然没有方向数据，但在渲染光照贴图时会考虑法线贴图。此方式在运行时没有额外开销。由于光照贴图的分辨率通常低于法线贴图，结果可能显得模糊。其他问题包括：由于缺乏 mipmapping，远处可能出现锯齿，以及降噪步骤可能导致细节被涂抹。要了解如何在此模式下使用具有程序化法线的自定义着色器，请参阅 [[#Normal_mapping|Normal Mapping]] 章节。&lt;br /&gt;
&lt;br /&gt;
===== Dominant Direction =====&lt;br /&gt;
此模式类似于 Unity 中 Enlighten 和 Progressive 烘焙器的实现。它与大多数着色器兼容，仅生成一张额外的贴图，运行时开销极小。缺点是凹凸贴图的效果较弱，略显灰暗，与实时光照下的同一物体相比可能差异较大。&lt;br /&gt;
&lt;br /&gt;
===== RNM =====&lt;br /&gt;
基于最初为《Half-Life 2》开发的 [https://steamcdn-a.akamaihd.net/apps/valve/2004/GDC2004_Half-Life2_Shading.pdf Radiosity Normal Mapping] 技术（相关演示文稿），后来被许多游戏采用（如《Mirror's Edge》）。此模式总共生成三张 HDR 贴图，是内存占用最高的模式之一，但运行时开销仍相对较低。该模式比 Dominant Direction 更精确，能更好地再现表面反差，并能正确处理来自不同角度、具有不同颜色的光照对法线贴图的影响。&lt;br /&gt;
&lt;br /&gt;
===== SH =====&lt;br /&gt;
基于论文《[https://media.contentapi.ea.com/content/dam/eacom/frostbite/files/gdc2018-precomputedgiobalilluminationinfrostbite.pdf Precomputed Global Illumination in Frostbite]》。这是最高质量的模式，能提供更好的表面对比度，并准确表现来自不同方向、不同颜色的光照。总共生成四张贴图，其中仅一张为 HDR，因此比 RNM 占用更少内存。运行时开销略高于 RNM。&lt;br /&gt;
&lt;br /&gt;
===== MonoSH =====&lt;br /&gt;
[[File:FY8Ru8hWIAAdYYH.jpg|thumb|Dominant Direction、完整 SH 与 MonoSH 的尺寸/质量对比]]&lt;br /&gt;
与 SH 类似，但使用单色的 L1 方向系数。表面对比度同样良好，虽然无法准确表现来自不同方向的不同颜色光照，但对多数场景来说已经足够。仅生成一张额外贴图，因此显存占用与带宽需求与 Dominant Direction 相近；事实上更低，因为 Dominant Direction 使用 RGBA 贴图，而 MonoSH 只需 RGB。该贴图通过内置的方向光照贴图系统传递，但''在标准着色器下显示不正确''。请务必使用兼容的着色器。&lt;br /&gt;
&lt;br /&gt;
===== 限制 =====&lt;br /&gt;
&lt;br /&gt;
* RNM 和 SH/MonoSH 只能与 [[#Bakery_shaders|Bakery shader]] 一起使用，或者需要对你的着色器进行调整。&lt;br /&gt;
* 在 RNM 和 SH 模式下，不会生成标准的颜色光照贴图。你需要确保场景中所有材质都使用 Bakery Shader，或者使用 [[#Bakery_Lightmap_Group_Selector|Lightmap Groups]] 将 RNM/SH 对象与其他对象分开。&lt;br /&gt;
* RNM 和 SH 贴图是通过 [https://docs.unity3d.com/ScriptReference/MaterialPropertyBlock.html MaterialPropertyBlock] 应用于对象的，因此在 Unity 的 Lighting 窗口中可能无法完全显示。&lt;br /&gt;
* Dominant Direction、RNM 和 SH/MonoSH 模式可能需要为全局光照（GI）和光照网格使用更多采样，以获得相近的质量。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Texels per unit ===&lt;br /&gt;
[[File:Texelscomp.jpg|thumb|1 vs 10 texels per unit]]&lt;br /&gt;
每个世界单位的光照贴图像素（Texels）近似数量。它会影响生成光照贴图的数量和分辨率。&lt;br /&gt;
&lt;br /&gt;
入门示例值：&lt;br /&gt;
&lt;br /&gt;
* 大型户外区域（城市）：1 - 5&lt;br /&gt;
* 中型户外区域（几条小巷）：10 - 20&lt;br /&gt;
* 高质量室内场景：100&lt;br /&gt;
&lt;br /&gt;
假设场景比例大约为 1 单位 = 1 米。在 Unity 中使用这种比例通常是推荐的，以便更好地导航和进行物理模拟。如果你的比例不同，请相应地调整 Texels。&lt;br /&gt;
&lt;br /&gt;
请注意，Texels Per Unit 是基础分辨率，但每个对象还可以通过 Mesh Renderer 上的 &amp;quot;Scale in Lightmap&amp;quot; 选项以及 Bakery 窗口中的 &amp;quot;Scale per map type&amp;quot; 进行额外调整。&lt;br /&gt;
&lt;br /&gt;
{{note| 将 &amp;quot;Scale in Lightmap&amp;quot; 设置为 0 的对象不会被烘焙，但仍会投射阴影并影响全局光照（GI）。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Max resolution ===&lt;br /&gt;
光照贴图的最大尺寸限制。如果对象无法容纳在单张光照贴图中（根据当前的 Texels Per Unit 值），将会分配额外的光照贴图。同样的四个正方形对象可以使用四张 512x512 的贴图，也可以使用一张 1024x1024 的贴图。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bounces ===&lt;br /&gt;
[[File:Image36.png|thumb|注意更多的反弹会为封闭空间带来更多光照。]]&lt;br /&gt;
定义光线在表面上反弹的次数。通常，对于户外场景（例如城市），较低的反弹次数就足够了，而对于封闭场景（室内、洞穴），则需要较高的反弹次数。&lt;br /&gt;
&lt;br /&gt;
虽然滑块最多限制为 5 次反弹，但可以在数字输入框中输入任意反弹次数。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Samples ===&lt;br /&gt;
[[File:Image7.png|thumb|左：Samples = 4，右：Samples = 16。为了演示，去噪功能已关闭。]]&lt;br /&gt;
影响全局光照（GI）的质量。典型值为 16 到 32。&lt;br /&gt;
&lt;br /&gt;
{{note| 可以输入超出滑块最大值的任意数字，但请注意，该数字表示最终光线数量的平方根，例如 32 表示 1024 条光线，64 表示 4096 条光线，依此类推。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GPU Priority ===&lt;br /&gt;
在 GPU 处理光照贴图时，操作系统和其他软件的响应可能会变慢。此选项允许你在烘焙速度和系统响应之间进行平衡。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render ===&lt;br /&gt;
为所有打开的场景烘焙光照贴图。&lt;br /&gt;
如果 [[使用手册#Light_probe_mode|Light Probe Mode]] 设置为 L1 或 L2，也会烘焙 [https://docs.unity3d.com/Manual/LightProbes.html 光照探针]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Render Light Probes ===&lt;br /&gt;
为所有打开的场景烘焙 [https://docs.unity3d.com/Manual/LightProbes.html 光照探针]。&lt;br /&gt;
&lt;br /&gt;
请注意，要在 Shadowmask 模式下对动态对象获得正确的混合光阴影，你还需要启用 [[使用手册#Occlusion_probes|occlusion probes]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Render Reflection Probes ===&lt;br /&gt;
为所有打开的场景烘焙反射探针。此按钮仅为方便起见，会调用引擎内置的反射探针更新功能。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update Skybox Probe ===&lt;br /&gt;
为当前的 skybox 烘焙全局漫反射和反射探针。与 “Render Reflection Probes” 一样，它仅调用引擎内置函数。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Occlusion probes ===&lt;br /&gt;
在渲染光照探针时，允许 Unity 使用当前选择的内置光照烘焙器烘焙遮挡探针（occlusion probes）。遮挡探针是存储在普通光照探针中的附加数据，可以防止动态对象在阴影区域被错误照亮。目前在 Unity 中无法使用自定义遮挡探针，必须调用内置光照烘焙器来完成此操作。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Warnings ===&lt;br /&gt;
这些选项会在按下任意 Render 按钮后对场景进行验证，并显示警告对话框，询问是否继续或停止烘焙过程。&lt;br /&gt;
&lt;br /&gt;
* Suppress all popups（屏蔽所有弹窗）：按下 Render 后不显示任何对话框。&lt;br /&gt;
* UV validation（UV 验证）：检查所有模型是否具有完全正确的光照贴图 UV，特别是 UV 是否位于 0-1 范围内且不重叠。&lt;br /&gt;
* Overwrite check（覆盖检查）：显示哪些光照贴图文件将被覆盖。&lt;br /&gt;
* Memory check（内存检查）：显示大致所需的视频内存量。&lt;br /&gt;
* Sample count check（采样数检查）：检查是否有光源、GI 或 AO 的采样数不合理，可能导致 GPU 超出可用资源。&lt;br /&gt;
* Lightmapped prefab validation（光照贴图预制体验证）：验证光照贴图预制体，并在某些预制体将被覆盖时发出通知。&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 (Advanced) ==&lt;br /&gt;
=== Light probe mode ===&lt;br /&gt;
更改光照探针的烘焙方式。&lt;br /&gt;
&lt;br /&gt;
* Legacy（传统模式）：使用 Render Light Probes 按钮生成探针。点光源和方向光在光照烘焙器中计算，而区域光/天空光/间接光则通过在每个探针位置渲染立方体贴图收集。结果以 [https://docs.unity3d.com/ScriptReference/Rendering.SphericalHarmonicsL2.html L2] 球谐（spherical harmonics）形式存储。缺点是立方体贴图渲染速度慢，并且在游戏中使用的着色器未物理正确表示光照表面，或者项目为移动平台设置时，光照贴图和探针可能不匹配（Unity 可能会裁剪高强度值）。&lt;br /&gt;
&lt;br /&gt;
* L1：在点击 Render 时，光照探针会与光照贴图一起渲染。此选项提供更高的烘焙性能，并保证探针光照与光照贴图匹配。结果以 L1 球谐形式存储（仍可被普通着色器使用）。使用 [[#Bakery_shaders|Bakery shader]] 的 Non-Linear Light Probe SH 选项可以进一步提升结果。&lt;br /&gt;
&lt;br /&gt;
* L2：更高质量（完整 L2 球谐）。与 L1 一样，会自动与光照贴图一起渲染。与 L1 相比，性能影响可忽略不计。应在所有着色器下显示正常。探针对比度/方向性/振铃去除可通过 Project Settings -&amp;gt; Bakery -&amp;gt; “Ringing removal for L2 light probes” 调整。&lt;br /&gt;
&lt;br /&gt;
'''在 Unity 2019.3 中似乎存在一个 bug，如果启用 Occlusion Probes 选项，Legacy 光照探针的颜色无法正确保存。使用 Occlusion Probes 时，默认且推荐使用 L2 模式。'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Asset UV Processing ===&lt;br /&gt;
配置资产的 UV 间距（padding）调整。可选值：&lt;br /&gt;
&lt;br /&gt;
* Don't change（不更改）：不修改资产。&lt;br /&gt;
* Adjust UV padding（调整 UV 间距）：会查找具有自动生成 UV 的模型（资产上启用 “Generate Lightmap UVs”），并进一步调整它们，使每个网格的 UV 岛之间具有适当间距。导入器设置中的全模型 Pack Margin 会被忽略。系统会根据每个网格的面积和光照贴图分辨率计算出最优值。&lt;br /&gt;
* Adjust UV padding for new meshes only（仅调整新网格的 UV 间距）：与上面相同，但会跳过之前至少调整过一次的模型。&lt;br /&gt;
* Remove UV adjustments（移除 UV 调整）：撤销所有之前的 UV 调整，使自动展开的模型恢复到 Unity 原始展开的样子。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser ===&lt;br /&gt;
设置所需的去噪器。可选值：&lt;br /&gt;
&lt;br /&gt;
* Optix 5：使用 OptiX 5.1 AI 去噪器（之前称为 “Legacy denoiser”）。在 GPU 上运行。支持从 [https://en.wikipedia.org/wiki/Kepler_(microarchitecture) Kepler]（通常是 GeForce 6xx）到 [https://en.wikipedia.org/wiki/Turing_(microarchitecture) Turing]（通常是 GeForce 20xx）的所有显卡。不支持 [https://en.wikipedia.org/wiki/Ampere_(microarchitecture) Ampere]（30xx）。OptiX 5.1 使用嵌入的静态训练数据集，因此不受驱动实现影响。&lt;br /&gt;
&lt;br /&gt;
* Optix 6：使用 OptiX 6.0 AI 去噪器（之前为默认选项）。在 GPU 上运行。在 Kepler（6xx）显卡上似乎无法使用，但在更新的显卡上均可运行，包括 Ampere（30xx）。自 6.0 起，OptiX 去噪器的训练数据集存储在驱动中。在 v442.50 之前，其行为类似于 OptiX 5.1；但之后 NVIDIA [https://forums.developer.nvidia.com/t/optix7-denoiser-different-results-with-different-version-of-drivers/117989/2 更改了数据集]，结果可能有所不同。更新后的数据集有时可能产生网格状图案和更亮的边缘（仍可通过 “Denoise: fix bright edges” 修复），但运行速度更快。&lt;br /&gt;
&lt;br /&gt;
* Optix 7：使用 OptiX 7.2 AI 去噪器。行为类似 OptiX 6.0，但在 Ampere（30xx）上可能支持更好。&lt;br /&gt;
&lt;br /&gt;
* OpenImageDenoise：使用 Intel Open Image Denoise 库。在 CPU 上运行（任何支持 SSE 4.1 的 CPU）。可能略慢于 OptiX，但质量可比。&lt;br /&gt;
&lt;br /&gt;
* OpenImageDenoise2：使用 Intel Open Image Denoise 2，CUDA 模式。在 GPU 上运行，性能与 OptiX 6/7 相当，质量与 CPU 版本相同。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Adjust sample positions ===&lt;br /&gt;
寻找最佳采样位置以防止光照泄漏。算法详情可参考 [https://ndotl.wordpress.com/2018/08/29/baking-artifact-free-lightmaps/#leaks 此处]。在某些情况下（通常是大型且多边形极少、法线平滑的几何体），可能会产生不正确的结果，此时可以将其禁用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Unload scenes before render ===&lt;br /&gt;
在烘焙前卸载 Unity 场景以释放显存。复杂场景仅在编辑器中显示就可能占用数 GB 的显存。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Denoise ===&lt;br /&gt;
[[File:Image31.png|thumb|左：未开启 “Denoise”，右：开启 “Denoise”。]]&lt;br /&gt;
如果启用，将应用去噪算法。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Fix Seams ===&lt;br /&gt;
[[File:Image22.png|thumb|左：缝隙（“Fix Seams” 关闭），右：缝隙已修复（“Fix Seams” 开启）。]]&lt;br /&gt;
如果启用，将尝试融合由 UV 不连续造成的缝隙。对平滑几何体很有用，包括 Unity 默认的球体。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Split by scene ===&lt;br /&gt;
如果同时加载多个场景，并且启用此选项，每个场景将拥有自己的一套光照贴图，而不会与其他场景共享。这对于在运行时流式加载场景时限制纹理占用量非常有用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hole filling ===&lt;br /&gt;
[[File:Holefilling.jpg|thumb|“Hole filling” 关闭与开启的对比。]]&lt;br /&gt;
如果 Atlas Packer 设置为 xatlas，将尝试填充每个孔洞，从而生成更高效的贴图集。对于几何体非常复杂的场景，可能会增加场景导出时间，但通常推荐开启。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Min resolution ===&lt;br /&gt;
光照贴图的最小尺寸限制。可用于在生成大量小而完全填充的光照贴图与少量未完全填充的光照贴图之间进行平衡。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Scale per map type ===&lt;br /&gt;
允许你对颜色贴图、Shadowmask 和方向贴图设置不同的分辨率缩放。例如，常见情况是间接光颜色分辨率较低，但 Shadowmask 分辨率较高。请注意，缩放在光照贴图渲染完成后才应用，因此不会节省烘焙时间。如果启用了 “Adjust UV padding”，间距将基于最低分辨率的贴图，以防止像素泄漏。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Checker preview ===&lt;br /&gt;
[[File:Image12.png|thumb|Checker Preview 功能演示。]]&lt;br /&gt;
如果勾选了 “Show checker” 选项，场景视图将在可见对象上渲染棋盘格图案，以展示光照贴图像素大小。这对于在烘焙前确保 Texels Per Unit 和其他影响分辨率的设置使用合理数值非常有用。&lt;br /&gt;
&lt;br /&gt;
启用 Checker Preview 将强制 Bakery 执行贴图集打包。可能需要一些时间，但通常不会超过几秒钟。在修改场景内容后，按下 “Refresh checker” 可重新打包场景以查看更改。&lt;br /&gt;
&lt;br /&gt;
Checker Preview 还使用随机颜色显示场景将如何被分割到不同的光照贴图中。&lt;br /&gt;
&lt;br /&gt;
{{note| 当前 Checker Preview 无法显示地形的正确像素大小。}}&lt;br /&gt;
&lt;br /&gt;
==== Atlas preview ====&lt;br /&gt;
[[File:FN-TmhRXwAE9i2I.png|thumb|Atlas Preview 功能演示]]&lt;br /&gt;
当 Checker Preview 开启时，会显示 Atlas Preview 按钮。点击它将打开一个新窗口，显示未来光照贴图的 UV 布局。点击 &amp;quot;&amp;lt;&amp;quot; 和 &amp;quot;&amp;gt;&amp;quot; 按钮可浏览各个光照贴图。&lt;br /&gt;
这对于在烘焙前检查打包质量和光照贴图数量非常有用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Emissive boost ===&lt;br /&gt;
将任何表面自发光（emission）乘以此数值。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Indirect boost ===&lt;br /&gt;
将所有反弹光照乘以此数值。作用与光源组件上的 Indirect Intensity 相同，但为全局设置。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Backface GI ===&lt;br /&gt;
[[File:Image30.jpg|thumb|Backface GI]]&lt;br /&gt;
[[File:Image35.png|thumb|左：“Backface GI” = 0，右：“Backface GI” = 1。注意阴影区域接收到更多的绿色光照。]]&lt;br /&gt;
决定光线通过前面表面到达背面并被全局光照（GI）反弹的程度。这对于薄的半透明表面（如树叶）尤其有用。取值范围为 0-1。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Ambient occlusion ===&lt;br /&gt;
[[File:Image15.png|thumb|左：AO intensity = 0，右：AO intensity = 1。]]&lt;br /&gt;
一种简单的非物理环境光遮蔽（Ambient Occlusion，AO），可在最终场景光照上叠加以增强美观效果。&lt;br /&gt;
&lt;br /&gt;
* Intensity（强度）：控制 AO 效果的可见度。值为 0 时禁用该效果。&lt;br /&gt;
* Radius（半径）：决定 AO 效果使用的光线距离。较小的值产生局部遮蔽（角落、褶皱），较大的值则更类似 Skylight，从远处物体产生阴影。&lt;br /&gt;
* Samples（采样数）：影响环境光遮蔽的质量。典型值为 4 到 32。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dither transparency ===&lt;br /&gt;
通过自动抖动不透明度贴图来启用半透明阴影。[[使用手册#Opacity|了解 Bakery 如何处理不透明度贴图]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== RTX Mode ===&lt;br /&gt;
启用 RTX 硬件加速。仅 RTX 显卡可受益于此选项。最低支持的驱动版本为 418。&lt;br /&gt;
&lt;br /&gt;
驱动可以在大多数非 RTX Nvidia 显卡上模拟 RTX 模式，但通常会更慢。&lt;br /&gt;
&lt;br /&gt;
在 Ampere（3xxx）或更新的显卡上，RTX 模式 ''必须'' 启用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Export terrain trees ===&lt;br /&gt;
如果启用，绘制在地形上的树木将影响光照。树木本身不会被烘焙。请注意，在烘焙过程中，每棵树都使用最高可能的 LOD 等级。对于多公里范围且模型高度复杂的森林场景，不建议使用此选项。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Terrain optimization ===&lt;br /&gt;
如果启用（默认），地形将使用独立的光线追踪技术以利用其高程图几何结构。否则，它们将像其他普通网格一样处理。地形优化可以显著减少高分辨率地形所需的内存占用。在某些情况下，它还能加快地形烘焙速度，但在其他情况下（尤其是简单低分辨率地形）可能需要禁用该选项。&lt;br /&gt;
&lt;br /&gt;
{{note| 地形优化当前不兼容绘制的地形洞。需禁用此选项才能使其正常工作。}}&lt;br /&gt;
{{note| 地形优化仅支持非 RTX 模式。}}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Light Mesh batch limit ===&lt;br /&gt;
如果该值大于 0，会将多个 Light Mesh 合并为一个，前提是它们具有相同设置并影响相同的 Lightmap Groups，同时将它们的总采样数限制为该值（例如，如果限制为 64，则可以合并 2 个采样数为 32 的灯光，或 4 个采样数为 16 的灯光，等等）。在拥有大量 Light Mesh 的场景中，这可以提升性能。但设置过高时需小心，因为 GPU 在一次处理过多采样时可能触发操作系统驱动超时。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Compress volumes ===&lt;br /&gt;
如果启用，将对体积 3D 贴图应用纹理压缩，并将 Bakery 着色器切换到相应的采样模式。不推荐对分辨率非常低的体积使用此选项。体积大小可能会被调整为 4 的倍数。&lt;br /&gt;
&lt;br /&gt;
注意事项：&lt;br /&gt;
&lt;br /&gt;
* 目前仅支持压缩为 BC6H/BC7 纹理格式（桌面/主机平台）。&lt;br /&gt;
* 体积压缩仅支持 Unity 2020.1 或更高版本。&lt;br /&gt;
* 目前仅标准渲染管线的 Bakery 着色器支持使用压缩体积贴图。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Samples multiplier ===&lt;br /&gt;
将所有阴影和 GI 采样数乘以指定因子。可用于在草稿质量和最终质量之间快速切换。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Tile size ===&lt;br /&gt;
与 [[#GPU Priority|GPU Priority]] 相同，但这里设置的是贴图块（tile）大小。Bakery 会将光照贴图拆分为更小的块，并一次更新一个块。块越小，GPU 工作被中断的次数越多，系统响应性可能更好。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Temp path ===&lt;br /&gt;
临时文件夹。在渲染过程中，Bakery 可能需要几个 GB 的可用空间。将此文件夹放在 SSD 上相比 HDD 可略微加快渲染速度。目前，该文件夹不会自动清理。你可以随时手动删除其内容（渲染时除外），或通过 Bakery -&amp;gt; Utilities -&amp;gt; Clear cache 清理。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Output path ===&lt;br /&gt;
光照贴图文件夹。所有光照贴图，以及 lightprobe 和顶点颜色（vertex color）资源都将保存在此处。该路径相对于你的 Assets 文件夹。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Use scene named output path ===&lt;br /&gt;
如果启用此选项，输出路径将自动设置为与当前活动场景同名的文件夹（Assets/CurrentSceneName/）。这与 Unity 内置光照贴图烘焙器的行为类似。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render Selected Groups ===&lt;br /&gt;
仅烘焙包含所选对象的 Lightmap Groups。&lt;br /&gt;
不仅仅是所选对象会被重新绘制，它们所属的所有 Lightmap Groups 都会被处理。其他光照贴图不会被更新。如果对象不属于某个手动分配的组，则使用相同光照贴图的场景部分将被重新烘焙。&lt;br /&gt;
&lt;br /&gt;
目前，使用 [[Partial_scene_baking|Sectors]] 进行场景部分烘焙更为方便。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Beep on finish ===&lt;br /&gt;
如果启用，Bakery 在烘焙完成时会播放提示音。&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 (Experimental) ==&lt;br /&gt;
=== Unwrapper ===&lt;br /&gt;
如果启用 [[#Asset_UV_Processing|Adjust UV Padding]]，则定义将使用的展开器（unwrapper）。&lt;br /&gt;
&lt;br /&gt;
* Default：使用 Unity 标准展开器。Bakery 会为每个具有不同间距参数的网格调用 [https://docs.unity3d.com/ScriptReference/Unwrapping.GenerateSecondaryUVSet.html Unwrapping.GenerateSecondaryUVSet]。&lt;br /&gt;
* xatlas：使用 [https://github.com/jpcy jpcy] 的 [https://github.com/jpcy/xatlas xatlas]，这是 [https://github.com/castano Ignacio Castaño] 的 [https://github.com/Thekla/thekla_atlas thekla_atlas] 的修改版。thekla_atlas 曾用于游戏《The Witness》（[http://the-witness.net/news/2010/03/graphics-tech-texture-parameterization/ 参见博客文章]）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Atlas Packer ===&lt;br /&gt;
选择在将不同对象的 UV 布局打包到大型光照贴图集时使用的算法。&lt;br /&gt;
* Default：Bakery 在 v1.7 之前使用的原始算法。&lt;br /&gt;
* xatlas：使用 xatlas。&lt;br /&gt;
&lt;br /&gt;
某些功能仅支持特定的贴图集打包器：&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Default&lt;br /&gt;
! xatlas&lt;br /&gt;
|-&lt;br /&gt;
| [[使用手册#Bakery_Lightmap_Group_Selector|Override resolution]]&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
|-&lt;br /&gt;
| 高效 LOD 打包&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
|-&lt;br /&gt;
| [[使用手册#Hole_filling|Hole filling]]&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
请注意，贴图集打包器（Atlas Packer）也可以为每个 Lightmap Group 单独选择。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Export geometry and maps ===&lt;br /&gt;
如果启用，Bakery 会在渲染前将场景导出为其专用格式。如果你确定场景的几何体和贴图以及光照贴图分辨率设置没有改变（例如，你只是调整 GI 或光源设置），可以禁用此选项以加快下一次渲染速度。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update unmodified lights ===&lt;br /&gt;
如果启用，Bakery 会重新计算自上次渲染以来未改变的光源。如果你只是调整某个光源，不想等待其他光源重新渲染，可以禁用此选项。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update modified lights and GI ===&lt;br /&gt;
如果启用，Bakery 会重新计算自上次渲染以来发生变化的 GI 和光源。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== UV padding: increase only ===&lt;br /&gt;
仅在启用 [[#Asset_UV_Processing|Adjust UV padding]] 时可见。默认情况下，模型资源的最佳 UV 间距仅基于当前加载的场景进行计算。如果同一模型有多个实例使用不同的光照贴图分辨率，最小的分辨率将决定间距，以确保 UV 图块之间的间距足够大，防止相互重叠。然而，在两个不同的独立场景中烘焙同一模型时，为新场景优化可能会破坏之前场景中的 UV。勾选此选项可以防止这种情况发生，即永远不减小间距值，从而始终为曾经烘焙过的最低分辨率实例进行优化。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoise: fix bright edges ===&lt;br /&gt;
[[File:Image19.png|thumb|左：去噪后可见明亮边缘；右：已修复。]]&lt;br /&gt;
仅在 [[#Denoise|Denoise]] 启用时可见。有时用于去噪的神经网络可能会在阴影周围产生明亮边缘，就像应用了锐化效果一样。如果启用此选项，Bakery 会尝试将其滤除。启用后，去噪阶段可能会略微变慢。&lt;br /&gt;
&lt;br /&gt;
此功能也可用于滤除“火花”（fireflies），即光照贴图中偶尔出现的亮点。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Post-packing ===&lt;br /&gt;
有时在渲染场景时，Bakery 会将光照贴图拆分为多个子光照贴图，例如在烘焙不同 LOD 或地形时。&lt;br /&gt;
Post-packing 会尝试通过将这些子光照贴图合并到同一纹理中来最小化最终贴图集数量。&lt;br /&gt;
建议保持此选项启用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Combine with Enlighten real-time GI ===&lt;br /&gt;
如果启用，则在按下 Render 按钮时，Bakery 会首先尝试使用 Enlighten 烘焙以计算实时 GI。之后，将进行常规的 Bakery 光照贴图烘焙过程。烘焙 GI 和实时 GI 将协同工作。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bake on remote server ===&lt;br /&gt;
启用网络烘焙（[[Network baking|Network baking]]）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Presets ===&lt;br /&gt;
当前在 Experimental 模式下的 Render/Update 按钮下显示。&lt;br /&gt;
&lt;br /&gt;
* 点击 '''New''' 将所有当前设置保存到预设文件中。&lt;br /&gt;
* 默认情况下，当一个预设处于激活状态时，所有设置都会被灰显，以防止覆盖预设。&lt;br /&gt;
* 点击 '''Modify preset''' 可更改设置并覆盖预设。&lt;br /&gt;
* 可以通过预设字段切换预设。将其设置为 None 可禁用预设使用。&lt;br /&gt;
&lt;br /&gt;
== 组件 ==&lt;br /&gt;
=== Bakery Lightmap Group Selector ===&lt;br /&gt;
指定对象及其所有子对象使用的 '''Lightmap Group'''。&lt;br /&gt;
Lightmap Group 是 Bakery 用来表示共享同一光照贴图的对象集合的术语。每个组都有属性，告诉 Bakery 如何打包对象、哪些光源影响它们，以及结果是烘焙到纹理还是顶点。&lt;br /&gt;
&lt;br /&gt;
默认情况下，所有静态对象会自动打包到多个光照贴图组（贴图集）中，因此通常无需手动管理。手动定义组仅用于特殊用途，例如：&lt;br /&gt;
&lt;br /&gt;
* 指定某些对象使用 [[Vertex Lightmaps|每顶点光照贴图]] 而非纹理。&lt;br /&gt;
* 使用建模软件中的原始未缩放 UV 烘焙光照贴图。&lt;br /&gt;
* 将关卡的特定区域分组以使用单张光照贴图，从而便于资源流式加载或通过脚本在运行时切换不同的烘焙光照。&lt;br /&gt;
* 使用 Render Selected Groups 按钮仅更新已分组的对象。&lt;br /&gt;
&lt;br /&gt;
要手动定义组，可以创建 '''Lightmap Group Assets'''，方法包括使用 Assets-&amp;gt;Create 菜单，或在组件中使用 Create New 按钮。使用 Create New 按钮时，将根据以下表单创建新的资源：&lt;br /&gt;
&lt;br /&gt;
* Name：要创建的 Lightmap Group 资源的名称。&lt;br /&gt;
* Packing Mode：此选择器定义 Lightmap Group 的打包模式，共有 3 种模式：&lt;br /&gt;
** Original UV：对象及其子对象将使用未修改的 UV 进行烘焙，不执行打包。适用于多个网格共享同一已打包 UV 布局的模型。&lt;br /&gt;
** Pack Atlas：对象及其子对象将打包到专用纹理贴图集中。在 v1.3 之前，每个可打包的子对象都需要有此组件，但现在不再需要。每个子对象将作为单独矩形打包，除非 Bakery 自动检测到子对象有非重叠的子对象，在这种情况下，多个对象可以使用同一个矩形。&lt;br /&gt;
** Vertex：对象及其子对象将使用顶点色烘焙光照而非纹理。注意，需要使用自定义着色器才能生效，例如 [[#Bakery_shaders|Bakery Shader]]。文档中也提供了一个简单的着色器（“Bakery/Simple Vertex Lightmapped”）用于演示和参考。[[Vertex Lightmaps|了解更多关于顶点光照贴图的信息]]。&lt;br /&gt;
* Directional mode：允许你覆盖该组的 [[#Directional mode|directional mode]]。选项与全局相同，Auto 将使用全局设置。&lt;br /&gt;
* Resolution：所需的光照贴图分辨率。&lt;br /&gt;
* Auto-resolution：使用 [[使用手册#Texels_per_unit|Texels Per Unit]] 来确定最接近的二次幂分辨率。&lt;br /&gt;
* Atlas packer：为该组选择 [[使用手册#Atlas_Packer|贴图集打包]] 算法。&lt;br /&gt;
* Bitmask：用于排除光源影响光照贴图的开关列表。每个 Bakery 光源也有一个位掩码设置。光源只会影响与其共享至少一个开关的 Lightmap Group。默认设置意味着所有光源影响所有光照贴图。&lt;br /&gt;
&lt;br /&gt;
[[File:Ts.jpg|thumb|Transparent selfshadow关闭 vs 开启：注意一些单面但背向的多边形如何被正确照亮。]]&lt;br /&gt;
&lt;br /&gt;
如果你有一个被分配了“Pack Atlas”模式的 Lightmap Group，组件上将会出现额外设置：&lt;br /&gt;
&lt;br /&gt;
* Override resolution：覆盖该对象及其子对象在光照贴图中占用的分辨率。&lt;br /&gt;
* Resolution：手动定义的分辨率。例如，如果你有一个分辨率为 512 的光照贴图，并且分配给 4 个对象，同时覆盖分辨率设置为 256，Bakery 将生成一个 512x512 的光照贴图，每个对象正好占据 256x256 的区域。&lt;br /&gt;
&lt;br /&gt;
如果你选择一个 Lightmap Group 资产，将会显示额外的实验性设置：&lt;br /&gt;
* [[Subsurface scattering|Subsurface scattering: (点击阅读更多)]]&lt;br /&gt;
* Normal offset：允许你将光线从表面偏移。这很少有用，主要用于实验目的。&lt;br /&gt;
* Transparent selfshadow：从表面后方发射光线，使其不会在自身投射阴影。对于半透明叶片可能有用。&lt;br /&gt;
* Vertex sampling density，(仅当 Packing Mode 设置为 Vertex 时可用）：默认情况下，每个顶点只计算一个值；如果采样密度 &amp;gt; 0，则会在三角形上分散采样并求平均，从而生成超采样、更平滑的结果。&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Lightmapped Prefab ===&lt;br /&gt;
此组件允许预制件存储光照贴图元数据。这样处理后的预制件可以在任意场景中实例化，无论是在编辑器中还是运行时。&lt;br /&gt;
该组件应直接添加到预制件的根对象上。不支持嵌套预制件。由于预制件在烘焙后会被覆盖（类似于按下“Apply”按钮的效果），因此要求预制件没有任何未应用的更改（子对象不应移动，材质和脚本参数应保持不变等）。如果检测到此类更改，组件界面会显示错误，烘焙后不会保存任何元数据。如果启用了 [[#Warnings|Lightmapped prefab validation]] 警告，所有预制件错误也会在烘焙前以对话框形式显示。&lt;br /&gt;
&lt;br /&gt;
光照贴图预制件支持所有 Bakery 功能，例如 LOD、地形、方向光贴图、RNM、SH、顶点模式和 Shadowmask。要使 Shadowmask 生效，光源也必须是同一预制件的一部分。&lt;br /&gt;
&lt;br /&gt;
{{note| 注意，由于 API 限制，预制件 Shadowmask 仅在 Unity 2017.4 或更高版本中可用。}}&lt;br /&gt;
&lt;br /&gt;
烘焙后，一个名为 “BakeryPrefabLightmapData” 的对象会被添加到预制件中。该对象包含一个脚本，存储应用光照贴图所需的所有数据。&lt;br /&gt;
&lt;br /&gt;
此外，光照贴图预制件允许保存当前渲染设置，并使用两个按钮将其加载回任意已打开的场景：&lt;br /&gt;
&lt;br /&gt;
* Save current render settings to prefab：在该预制件上存储当前渲染设置的副本。&lt;br /&gt;
* Load render settings from prefab：将当前渲染设置设置为预制件中存储的设置。&lt;br /&gt;
  [[File:Upload 2019-9-17 10-32-34.png|thumb|应用预制件]]&lt;br /&gt;
&lt;br /&gt;
烘焙光照贴图预制件时，建议检查：&lt;br /&gt;
&lt;br /&gt;
* 预制件已“应用”。在旧版 Unity 中，点击 Inspector 右上角的 “Apply” 按钮。在新版 Unity 中，点击 “Overrides” 列表，然后选择 “Apply All”。&lt;br /&gt;
* 预制件组件 UI 不显示任何错误。&lt;br /&gt;
* [推荐] 在主窗口启用 “Lightmapped prefab validation” 复选框。点击 Render 时不会显示任何关于预制件的警告对话框。&lt;br /&gt;
&lt;br /&gt;
{{note| 光照贴图以其烘焙所在的场景或所使用的 Lightmap Group 命名（如果有）。在同一场景中烘焙不同预制件时，请确保使用不同命名的 [[使用手册#Bakery_Lightmap_Group_Selector|Lightmap Group]] 或更改 [[使用手册#Output_path|输出路径]]。}}&lt;br /&gt;
&lt;br /&gt;
{{note| 当使用相同模型逐个烘焙多个预制件时，建议将 [[使用手册#Asset_UV_Processing|Asset UV Processing]] 设置为“Don't Change”，以防止修改共享模型的 UV。}}&lt;br /&gt;
&lt;br /&gt;
{{note| Bakery 的预制件工作流程是在 Unity 提供“预制件双击进入视图”功能之前实现的。因此，在隔离预制件视图中光照贴图可能无法正确应用，组件可能显示 “This GameObject is not a prefab” 信息。但在普通场景中使用时应能正常工作。}}&lt;br /&gt;
&lt;br /&gt;
{{note| 当解包已烘焙的预制件并取消与现有光照贴图的关联时，请确保删除保存预制件范围光照贴图/渲染器连接的 BakeryPrefabLightmapData 对象。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Direct Light ===&lt;br /&gt;
[[File:Directlight.jpg|thumb|纯直射光 + GI]]&lt;br /&gt;
[[File:Image4.png|thumb|左：“Shadow Spread” = 0.01，右：0.05。注意阴影从锐利逐渐变模糊的效果。]]&lt;br /&gt;
无限远方向光（例如太阳）。&lt;br /&gt;
&lt;br /&gt;
* Color：光的颜色。&lt;br /&gt;
* Intensity：线性色彩乘数。&lt;br /&gt;
* Shadow Spread：光源尺寸，或者简单说，阴影的模糊度。0 = 阴影最锐利，1 = 阴影最模糊。从技术上讲，它在单条光线与更宽光锥之间插值。&lt;br /&gt;
* Shadow Samples：影响阴影质量。Shadow Spread 值越小，所需样本越少即可得到干净图像。太阳阴影的典型值为 1 到 16。设置为 0 时，该光源的阴影将消失。&lt;br /&gt;
* Bitmask：用于排除此光源对特定 Lightmap Groups 影响的开关列表。&lt;br /&gt;
* Baked contribution：确定应烘焙哪类光照数据。仅在 Indirect 或 Shadowmask 模式可见。可选值：&lt;br /&gt;
** Direct and Indirect：直射光与间接光都完全烘焙。&lt;br /&gt;
** Indirect only：实时光提供直射贡献，仅烘焙间接光。&lt;br /&gt;
** Shadowmask and indirect：实时光提供直射贡献，静态几何体的阴影烘焙到单独贴图，动态与静态阴影混合。间接光正常烘焙。&lt;br /&gt;
** Direct, Indirect, Shadowmask（仅自定义光照）：与直射和间接相同，但 Shadowmask 也生成，可与自定义着色器一起使用。&lt;br /&gt;
* Denoise shadowmask：确定是否对该光源的 Shadowmask 应用去噪。通常不需要，因为阴影噪点不明显，但对非常宽且模糊的阴影（大 Shadow Spread）可能有用。&lt;br /&gt;
* Indirect intensity：非物理 GI 乘数。自然光照应为 1，可根据场景风格调整。&lt;br /&gt;
* Anti-alias：对阴影执行超采样。&lt;br /&gt;
* Texture projection：在光照上投射乘法平铺纹理，可用于模拟远处云影。&lt;br /&gt;
当设置了纹理投影时，可以使用“Tiling”和“Offset”字段调整其缩放和偏移。或者，点击 &amp;quot;Tweak projection in Scene View&amp;quot; 并使用额外的 Gizmo 可视化移动和缩放投影。点击“Render reference frame”可保存光源视角的 PNG，这对于在场景上绘制云影很有用。&lt;br /&gt;
&lt;br /&gt;
如果同一对象同时启用了 Unity 和 Bakery 光源且参数不匹配，会出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match lightmapped to real-time：将 Unity 光源的通用设置复制到 Bakery 光源。&lt;br /&gt;
* Match real-time to lightmapped：将 Bakery 光源的通用设置复制到 Unity 光源。&lt;br /&gt;
&lt;br /&gt;
{{note| 从物理角度看，Bakery 的方向光强度（Intensity）等于照度（Lux）除以 π。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Sky Light ===&lt;br /&gt;
[[File:Skylight.jpg|thumb|纯天空光与 GI]]&lt;br /&gt;
无限远的带阴影环境光（天空）。&lt;br /&gt;
&lt;br /&gt;
* Color: 颜色。&lt;br /&gt;
* Intensity: 线性色彩倍增。&lt;br /&gt;
* Sky texture: 可选的立方体贴图资源，例如 HDRI 全景图，用于从不同方向影响光照颜色。&lt;br /&gt;
  {{note| 旋转天空光的 GameObject 会相应旋转立方体贴图的光照。}}&lt;br /&gt;
* Samples: 影响阴影质量。典型值为 8 到 32。&lt;br /&gt;
* Hemispherical: 如果启用，光照仅来自上方（上半球）。否则来自所有方向。&lt;br /&gt;
* Bitmask: 用于排除此光源影响特定 Lightmap Groups 的开关列表。&lt;br /&gt;
* Baked contribution: 决定应烘焙哪种光照数据。仅在 Indirect/Shadowmask 模式下可见。可能值：&lt;br /&gt;
** Direct and Indirect: 直接和间接光照都将完全烘焙。这是默认且推荐的天空光行为，因为在 Unity 中没有实时版本可以模拟它们。&lt;br /&gt;
** Indirect only: 假定实时光源提供直接贡献；仅烘焙间接光照。&lt;br /&gt;
&lt;br /&gt;
如果天空光的设置与当前场景的天空盒不匹配，将出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match this light to scene skybox: 将活动天空盒材质的通用设置复制到 Bakery 天空光。当前仅支持使用 “Skybox/Cubemap” 或 “Skybox/Bakery skybox” 着色器的天空盒。&lt;br /&gt;
* Match scene skybox to this light: 将 Bakery 天空光的通用设置复制到场景天空盒。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bakery Light Mesh ===&lt;br /&gt;
[[File:Image29.png|thumb|Left: Samples Near = 0, Samples Far = 4096.&amp;lt;br&amp;gt;&lt;br /&gt;
Middle: Samples Near = 0, Samples Far = 128.&amp;lt;br&amp;gt;&lt;br /&gt;
Right: Samples Near = 16, Samples Far = 128.&amp;lt;br&amp;gt;&lt;br /&gt;
请注意，光照效果看起来相似，但使用的合并采样数量更少。]]&lt;br /&gt;
任何形状的自发光网格。应与 Mesh Renderer 组件或设置为 Area 模式的 Light 组件一起使用。&lt;br /&gt;
&lt;br /&gt;
* Color：颜色&lt;br /&gt;
* Intensity：线性颜色倍增器&lt;br /&gt;
* Cutoff：最大光照距离。Bakery 会在接近该限制时额外衰减正确的平方反比衰减。当 Cutoff 值刚好对应物理衰减变得非常暗的位置时效果最佳。Cutoff 可提升烘焙性能，也可以设置为非常高（不可达）的值以保证完全正确性。&lt;br /&gt;
* Self Shadow：决定光源网格自身是否投射阴影。此选项同时启用更精确的光照算法。&lt;br /&gt;
* Samples Near：影响靠近网格的光照质量。典型值为 16 到 64，仅当 Self Shadow 开启时可用。&lt;br /&gt;
* Samples Far：影响远离网格的光照质量。典型值为 4 到 4096。&lt;br /&gt;
&lt;br /&gt;
Bakery 基于光源表面距离混合两种不同的区域光算法。靠近光源时，算法类似 GI，而远处光源被近似为虚拟点光云。&lt;br /&gt;
&lt;br /&gt;
{{note| &amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;光源网格自身不会接收光照，也不会被烘焙到光照贴图中。&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;一个拥有大量多边形的光源网格比烘焙多个简单的光源网格要快&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;如果结果总是脏/噪点较多，可以尝试将 Samples Near 设置为 0，这样只使用 VPL 算法。对于不需要精度的简单光源（如建筑物的窗户光），这也非常有用。&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;}}  &lt;br /&gt;
[[File:Dd99d-QU0AEKFBK.jpg|thumb|弯曲的光源网格]]  &lt;br /&gt;
* Bitmask：用于排除此光源影响特定 Lightmap Groups 的开关列表。  &lt;br /&gt;
* Baked contribution：决定烘焙哪种类型的光照数据。仅在 Indirect 或 Shadowmask 模式下可见。可能的值：  &lt;br /&gt;
** Direct and Indirect：完全烘焙直接和间接光贡献。这是默认且推荐的光源网格行为，因为 Unity 中没有实时版本可以模拟它们。  &lt;br /&gt;
** Indirect only：实时光源提供直接光贡献，仅烘焙间接光。  &lt;br /&gt;
** Shadowmask and Indirect：实时光源提供直接光贡献，但静态几何体的阴影会烘焙到单独的贴图。动态和静态阴影将混合在一起。间接光照将照常烘焙。目前仅 HDRP（和自定义渲染器）支持混合区域光。  &lt;br /&gt;
** Direct, Indirect, Shadowmask (custom lighting only)：与 Direct and Indirect 相同，但同时生成 Shadowmask 并分配用于自定义着色器。  &lt;br /&gt;
* Indirect intensity：非物理 GI 倍增器。自然光照应设为 1，但可修改以实现更风格化的场景。  &lt;br /&gt;
* Shadowmask with falloff：将完整光衰减烘焙进 Shadowmask（仅对自定义着色器有用）。  &lt;br /&gt;
&lt;br /&gt;
如果网格材质和光源设置不匹配，将出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match light to material：将网格材质或区域光的通用设置复制到 Bakery 光源。&lt;br /&gt;
* Match material to light：将 Bakery 光源的通用设置复制到网格材质或区域光。&lt;br /&gt;
&lt;br /&gt;
==== Light Mesh 与自发光材质的区别 ====&lt;br /&gt;
自发光材质：&lt;br /&gt;
&lt;br /&gt;
* 在 GI 计算中传播光线，因此是“免费的”，无论有多少网格是自发光的。&lt;br /&gt;
* 小而明亮的光可能会产生不准确或有噪点的结果，这取决于 GI 的采样数量。&lt;br /&gt;
* 由于 Bakery 中 GI 的工作方式，它必须占用光照贴图空间，因此可能会浪费空间。同时，这意味着自发光对象需要有效的 UV，并且必须启用“投射阴影”。&lt;br /&gt;
&lt;br /&gt;
Light Mesh：&lt;br /&gt;
&lt;br /&gt;
* 光照会为每个光源单独计算，因此比自发光材质慢。&lt;br /&gt;
* 设计用于为小而明亮的光提供干净的光照效果，即使距离很远也能保持效果。&lt;br /&gt;
* 不占用光照贴图空间。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Point Light ===&lt;br /&gt;
[[File:Image11.png|thumb|左：“Shadow Spread” = 0.5，右：“Shadow Spread” = 1。]]&lt;br /&gt;
点光源，没有面积。尽管在物理上不可能，但在游戏中很有用，并且是匹配 Unity 点光源和聚光灯的唯一方式。&lt;br /&gt;
{{note| 聚光灯只是带有额外投影遮罩的点光源。}}&lt;br /&gt;
&lt;br /&gt;
* Color: 颜色&lt;br /&gt;
* Intensity: 线性色彩倍增&lt;br /&gt;
* Shadow spread: 阴影模糊度。虽然点光源没有面积，但通常希望它仍能产生模糊阴影。为此，阴影被模拟为从球形区域光源投射。此参数定义了虚拟球体的半径，直接影响阴影模糊度。&lt;br /&gt;
* Physical falloff: 如果启用，将使用正确的平方反比衰减，并在边界附近额外衰减。否则将尝试模拟 Unity 的衰减。&lt;br /&gt;
* Falloff min size: 详见 [[Point Light Attenuation]] 部分。&lt;br /&gt;
* Range: 如果物理衰减被禁用，则等于 Unity 的光源范围；如果启用，只会在边缘轻微衰减物理衰减。&lt;br /&gt;
* Samples: 影响阴影质量。典型值为 1 到 512。设置为 0 将使该光源的阴影消失。&lt;br /&gt;
  [[File:Image10.png|thumb|从左到右：Omni，Cookie（默认聚光灯纹理），Cubemap，IES。]]&lt;br /&gt;
* Projection mask: 遮罩/Cookie 类型。选项：&lt;br /&gt;
** Omni: 无遮罩，相当于 Unity 的点光源。&lt;br /&gt;
** Cookie: 纹理投影遮罩。附加选项：&lt;br /&gt;
*** Cookie texture: 2D 纹理资源。Bakery 包含原始 Unity 聚光灯纹理（名为 ftUnitySpotTexture），可用于模拟。&lt;br /&gt;
*** Angle: 纹理投影角度（类似 Unity 聚光灯）。&lt;br /&gt;
*** Correct distortion: 修正宽角下直线可见的 cookie 失真。&lt;br /&gt;
** Cubemap: 立方体贴图投影遮罩。附加选项：&lt;br /&gt;
*** Projected cubemap: 立方体贴图资源。&lt;br /&gt;
** IES: 光照由 IES 文件数据调制。附加选项：&lt;br /&gt;
*** IES file: .ies 扩展名文件。&lt;br /&gt;
* Bitmask: 用于排除该光源影响特定 Lightmap Groups 的开关列表。&lt;br /&gt;
* Baked contribution: 决定应烘焙哪种类型的光照数据。仅在 Indirect 或 Shadowmask 模式下可见。可能值：&lt;br /&gt;
** Direct and Indirect: 直接光和间接光完全烘焙。&lt;br /&gt;
** Indirect only: 实时光提供直接光，仅烘焙间接光。&lt;br /&gt;
** Shadowmask and Indirect: 实时光提供直接光，但静态几何体阴影烘焙到单独贴图中，动态和静态阴影混合，间接光正常烘焙。&lt;br /&gt;
** Direct, Indirect, Shadowmask (custom lighting only): 与 Direct and Indirect 相同，同时生成 Shadowmask 用于自定义着色器。&lt;br /&gt;
* Indirect intensity: 该光的非物理 GI 倍增。自然光应为 1，可根据风格化场景修改。&lt;br /&gt;
* Shadowmask with falloff: 将完整光衰减（除距离外）烘焙到 Shadowmask（仅自定义着色器有用）。&lt;br /&gt;
* Legacy sampling: 使用 Bakery 原始更偏置的阴影采样策略。产生无噪点阴影，但宽半影可能出现条纹。禁用后使用无偏但更有噪点的技术。&lt;br /&gt;
&lt;br /&gt;
如果同一对象同时启用了 Unity 和 Bakery 光源，且设置不匹配，则会出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match lightmapped to real-time: 将 Unity 光的常用设置复制到 Bakery 光。&lt;br /&gt;
* Match real-time to lightmapped: 将 Bakery 光的常用设置复制到 Unity 光。&lt;br /&gt;
&lt;br /&gt;
{{note| 从物理角度来看，Bakery 点光源的“Intensity”为 Candela 除以 Pi。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Volume ===&lt;br /&gt;
[[File:Voldemo notlonely.gif|由 BakeryVolume 照亮的动态门（动态 GIF，由 NOTLonely 制作）]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
体积（Volumes）生成存储每个体素光探针的 3D 纹理（L1 球面调和和阴影贴图），使其成为常规 Unity 光探针的可行替代方案。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Unity Light Probes&lt;br /&gt;
! Unity LPPV&lt;br /&gt;
! Bakery Volumes&lt;br /&gt;
|-&lt;br /&gt;
| 手动放置每个光探针&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 否&lt;br /&gt;
|-&lt;br /&gt;
| 在一个物体上插值多个光探针&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 运行时可移动&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 可以放入预制件&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 完整脚本 API&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| “Ringing” 伪影&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 可能出现&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 可能出现&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 已修正&lt;br /&gt;
|-&lt;br /&gt;
| 去噪&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 运行时开销&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | CPU：低开销；GPU：低开销&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | CPU：中等开销；GPU：中等开销&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#e4ead3;&amp;quot; | CPU：无开销；GPU：中等开销&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bakery Volume 是一个与一组 3D 纹理（3 个 SH 纹理和一个可选的 shadowmask）关联的边界盒，使其非常易于使用和编程。Volumes 可以在运行时轻松地交换、移动、加载或卸载，也可以与预制件关联。它们不需要任何 Light Probe Groups 或手动探针布置；整个 Volume 都由均匀的探针体素网格填充。光/影泄漏会自动像处理光照贴图一样修复（尽管对于较大的体素尺寸，薄的双面墙可能会出现问题，但可以通过在不同侧使用不同 Volume 避免）。由于体素网格的均匀特性，也可以对其应用类似光照贴图的降噪，这是常规光探针无法做到的。此外，Bakery 着色器使用 [https://drive.google.com/file/d/1MK6Clw93q8ljijRjb4gQOzzaIjn1uF9Y/view Geomerics] 采样技巧，完全消除了高对比度 HDR 光照下 SH 有时会产生的 “ringing” 伪影。&lt;br /&gt;
&lt;br /&gt;
因此，Volumes 可以为动态物体生成干净、精细、高质量的烘焙光照（即来自静态物体并影响动态物体的光照，而不是相反）。&lt;br /&gt;
&lt;br /&gt;
Volume 方法的唯一缺点是每像素着色开销较高。其开销类似于 LPPV（随着屏幕上受体素影响的像素数量而缩放），但与 LPPV 不同的是，一旦烘焙完成，Volumes 本身不会再更新。多个 Volume 的混合可以通过稍微重叠它们来避免。&lt;br /&gt;
&lt;br /&gt;
====设置 Volume 变换====&lt;br /&gt;
[[File:Bvolgizmo.jpg|thumb|Volume 控制柄]]&lt;br /&gt;
当 BakeryVolume 被添加到一个 GameObject 时，场景视图中会出现一个边界盒控制柄。拖动小方块即可缩放它。&lt;br /&gt;
&lt;br /&gt;
还有其他方法可以更改 Volume 的大小和位置：&lt;br /&gt;
&lt;br /&gt;
* 将任何可渲染的 GameObject 拖入 “Wrap to object” 字段。Volume 会包裹该对象（及其子对象），以将它们完全包含在内。&lt;br /&gt;
* 如果同一个对象上添加了 Box Collider，则会出现 “Set from box collider” 和 “Set to box collider” 按钮。可以用它们快速在 Volume 和 Collider 之间复制数值。&lt;br /&gt;
&lt;br /&gt;
====分辨率====&lt;br /&gt;
当启用 “Adaptive resolution” 时，体素数量由 “Voxels per unit” 控制。禁用它可以手动输入分辨率。对于大多数 1 单位 = 1 米 的游戏来说，一个合理的 “Voxels per unit” 值是 2，但在某些情况下（例如动态门）使用较小但更高分辨率的 Volume 会更有利。&lt;br /&gt;
&lt;br /&gt;
====其他设置====&lt;br /&gt;
&lt;br /&gt;
* Enable baking: 是否需要（重新）计算 Volume？禁用可防止覆盖已有数据。&lt;br /&gt;
* Denoise: 在烘焙 Volume 后应用去噪。推荐用于高分辨率 Volume。避免用于覆盖许多光源的低分辨率 Volume，因为去噪器难以区分实际内容和噪声。&lt;br /&gt;
* Global: 自动将此 Volume 分配给所有兼容 Volume 的 Shader，除非它们有覆盖设置。内部会调用 Shader.SetGlobalTexture()/SetGlobalVector()。&lt;br /&gt;
====使用方法====&lt;br /&gt;
Volumes 可以分配给使用 Volume 感知 Shader 的对象。Bakery 自带实现该功能的 “Bakery Standard” Shader，以及 HDRP 和 URP 的 Shader 图。请查看 example_volumes 场景，了解应用 Volume 的各种方式。&lt;br /&gt;
&lt;br /&gt;
====提示====&lt;br /&gt;
&lt;br /&gt;
* 确保查看示例。&lt;br /&gt;
* 如果两个 Volume 相连，让它们略微重叠。重叠大小应等于最大动态对象的尺寸。这样在运行时简单切换 Volume 就能正常工作。&lt;br /&gt;
* 仅在动态对象实际可达的区域放置 Volume。例如，使用玩家高度限制 Volume 的高度。&lt;br /&gt;
&lt;br /&gt;
====旋转 Volumes====&lt;br /&gt;
如果启用 “Rotate around Y” 选项，Volumes 可以绕 Y 轴旋转。旋转开销非常低，只使用 2 个额外的浮点数据（预计算的角度 sin/cos）。&lt;br /&gt;
&lt;br /&gt;
还可以在运行时旋转 Volumes（Experimental -&amp;gt; “Support rotation after bake” 以及 Bakery Shader 中的类似选项），这种情况下 Volume 必须在初始旋转为零时进行烘焙。&lt;br /&gt;
&lt;br /&gt;
在 URP 中，这种动态旋转可以与 `BakeryURPVolumeGraphRotatable.shadergraph` 一起使用。&lt;br /&gt;
&lt;br /&gt;
对于全局 Volume，动态旋转会在组件被（重新）启用或调用 `volume.SetGlobalParams()` 时更新。使用局部旋转 Volume 时，需要手动在材质或 MaterialPropertyBlock 上设置旋转：&lt;br /&gt;
{{code|&amp;lt;nowiki&amp;gt;SetMatrix(&amp;quot;_VolumeMatrix&amp;quot;, volume.GetMatrix())&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
====技术信息====&lt;br /&gt;
Volumes 可以自动工作（查看示例场景），也可以通过脚本控制其使用方式。&lt;br /&gt;
&lt;br /&gt;
可以通过组件的以下公共属性获取 Volume 数据：&lt;br /&gt;
&lt;br /&gt;
* `bakedTexture0`：存储 L0 RGB 系数和 L1 Z 红色通道在 alpha 中。&lt;br /&gt;
* `bakedTexture1`：存储 L1 X RGB 系数和 L1 Z 绿色通道在 alpha 中。&lt;br /&gt;
* `bakedTexture2`：存储 L1 Y RGB 系数和 L1 Z 蓝色通道在 alpha 中。&lt;br /&gt;
* `bakedMask`：存储体积阴影遮罩。&lt;br /&gt;
* `bounds`：Volume 的包围盒。&lt;br /&gt;
&lt;br /&gt;
所有 `bakedTexture*` 使用 RGBAHalf（每体素 8 字节）格式，mask 使用 ARGB32（每体素 4 字节）。阴影遮罩也可以使用单通道 R8 格式（每体素 1 字节）。&lt;br /&gt;
&lt;br /&gt;
因此 Volume 的字节大小 = width * height * depth * 3 * 8 + （仅当使用阴影遮罩时）width * height * depth * 4（或使用 R8 mask 时为 width * height * depth）。&lt;br /&gt;
&lt;br /&gt;
[[使用手册#Compress_volumes|可以对 Volume 启用纹理压缩]]，使其体积显著减小。&lt;br /&gt;
&lt;br /&gt;
采样 Volume 需要特殊 Shader，这些 Shader 已包含在 Bakery 中。要在自定义 Shader 中添加 Volumes，请查看 HDRP/URP 包中包含的 `BakeryVolume_float()` 函数（位于 `BakeryDecodeLightmap.hlsl`）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Light Filter ===&lt;br /&gt;
[[File:Output optimized.gif|彩色玻璃，如在 &amp;quot;Bakery Real-Time Preview&amp;quot; 中所见。Bakery lightmapper 烘焙出的结果相同。]]&lt;br /&gt;
&lt;br /&gt;
将渲染器标记为光过滤器（Light Filter）。过滤器会用其颜色着色所有直接和间接光线，类似于现实中的光学滤镜，从而实现彩色透明效果（例如彩色玻璃）。唯一的参数是用于着色的纹理。&lt;br /&gt;
&lt;br /&gt;
* 光过滤器对象仍然会像其他对象一样接收光照贴图。&lt;br /&gt;
* 过滤器不会散射或模糊光线（如需此效果，请尝试 [[Subsurface_scattering|Subsurface Scattering]] 或 [[使用手册#Backface_GI|Backface GI]]）。&lt;br /&gt;
* 过滤器可以产生带颜色的阴影。如果灯光使用 [[使用手册#Shadowmask|Shadowmask]] 模式，则结果只会保存 R 通道（因为 Unity 仅支持单通道遮罩）。对于完全烘焙的阴影，则没有限制。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Sector ===&lt;br /&gt;
参见 '''[[Partial_scene_baking|Partial scene baking]]'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Always Render ===&lt;br /&gt;
如果添加到一个物体上，Bakery 在烘焙时将始终考虑该物体，即使它的 Renderer 被禁用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
=== Bakery Pack As Single Square ===&lt;br /&gt;
如果添加到一个物体上，Bakery 会将该物体及其子物体的 UV 视为单个组合方块，在自动图集打包或 Lightmap Group 的 Pack Atlas 模式下，它们之间永远不会被移动。整个子层级将作为一个整体打包。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
=== Bakery Shared LOD UV ===&lt;br /&gt;
如果添加到一个 LODGroup 上，将标记所有同名 LOD 共享同一个光照贴图。默认情况下，每个 LOD 网格会获得独立的光照贴图，占用图集空间；但如果已知同一个物体的 LOD 拥有相似的 UV2（或者在没有 UV2 且 UV1 不重叠的情况下），它们可以映射到图集的同一部分，从而节省内存。&lt;br /&gt;
这种技术也称为 [https://github.com/laurenth-personal/LODLightmapScripts/ Lightmap Stealing]。&lt;br /&gt;
&lt;br /&gt;
= 材质兼容性 =&lt;br /&gt;
&lt;br /&gt;
=== 漫反射和发光 ===&lt;br /&gt;
Bakery 利用 [https://docs.unity3d.com/Manual/MetaPass.html Meta Pass] 系统支持大多数 Unity 材质。所有内置、Surface、URP 和 HDRP 着色器都已经定义了正确的 Meta Pass。&lt;br /&gt;
&lt;br /&gt;
如果你使用的是 Unlit 着色器，需要按照 Unity 文档手动添加 Meta Pass。&lt;br /&gt;
&lt;br /&gt;
如果未定义该 Pass，Bakery 将假定 {{codeVar|_MainTex}}、{{codeVar|_BaseColorMap}} 或 {{codeVar|_Color}}（如果未设置纹理）为材质的漫反射（Albedo），并将 {{codeVar|_EmissionMap}} 和 {{codeVar|_EmissionColor}} 作为发光颜色。&lt;br /&gt;
&lt;br /&gt;
为了使发光生效，[https://docs.unity3d.com/ScriptReference/Material-globalIlluminationFlags.html Material.globalIlluminationFlags] 必须设置为 [https://docs.unity3d.com/ScriptReference/MaterialGlobalIlluminationFlags.BakedEmissive.html MaterialGlobalIlluminationFlags.BakedEmissive]。标准着色器会自动设置此值。&lt;br /&gt;
&lt;br /&gt;
=== 不透明度 ===&lt;br /&gt;
[[File:Upload 2019-1-25 0-4-30.png|thumb|材质参数被转换为 Cutout（默认）]]&lt;br /&gt;
[[File:Alphacombos dither.jpg|thumb|通过“Dither Transparency”选项添加半透明值]]&lt;br /&gt;
[[File:Alphacombos filter.jpg|thumb|Light Filter 组件用于红色平面，生成彩色阴影]]&lt;br /&gt;
&lt;br /&gt;
默认情况下，Bakery 始终从 {{codeVar|_MainTex}}、{{codeVar|_BaseColorMap}} 或 {{codeVar|_BaseMap}} 的 alpha 值获取全分辨率的不透明度，并将其视为 Cutout（1 位透明）。&lt;br /&gt;
&lt;br /&gt;
当启用 '''Dither Transparency''' 选项时，半透明值会自动转换为可变蓝噪声，然后被滤波/模糊，产生部分透明效果（以前可以通过自定义手动抖动贴图实现，但从 v1.97 起自动完成）。&lt;br /&gt;
&lt;br /&gt;
为了使不透明度生效，着色器的 [https://docs.unity3d.com/Manual/SL-SubShaderTags.html RenderType 标签] 必须为以下值之一：&lt;br /&gt;
&lt;br /&gt;
* {{codeVar|Transparent}}&lt;br /&gt;
* {{codeVar|TransparentCutout}}&lt;br /&gt;
* {{codeVar|TreeLeaf}}&lt;br /&gt;
&lt;br /&gt;
如果存在名为 {{codeVar|_Cutoff}} 的属性，它将影响 Cutout（因此 Standard 着色器的 Cutoff 滑块会自动生效）。&lt;br /&gt;
&lt;br /&gt;
在没有 Dither Transparency 的情况下，如果材质 RenderType 为 {{codeVar|Transparent}} 或 {{codeVar|TreeLeaf}}，则 {{codeVar|_Color}} 的 alpha 值会额外修改 Cutoff：&lt;br /&gt;
''finalCutoff = 1 - (1 - cutoff) * alpha''&lt;br /&gt;
&lt;br /&gt;
对于彩色透明效果，请使用 [[Manual#Bakery_Light_Filter|Light Filter]] 组件。&lt;br /&gt;
&lt;br /&gt;
有关漫反射半透明效果，请参考 [[#Backface GI|Backface GI]] 和 [[subsurface scattering]]。&lt;br /&gt;
&lt;br /&gt;
==== Alpha Meta Pass ====&lt;br /&gt;
从 v1.9 起，Bakery 还支持指定基于自定义着色器的透明度，但这需要使用兼容的着色器。要使用 ''Alpha Meta Pass''，需要执行以下步骤：&lt;br /&gt;
&lt;br /&gt;
* 在着色器中添加一个名为 '''BAKERY_META_ALPHA_ENABLE''' 的属性。例如：&lt;br /&gt;
  {{code|&amp;lt;nowiki&amp;gt;[HideInInspector] BAKERY_META_ALPHA_ENABLE (&amp;quot;Enable Bakery alpha meta pass&amp;quot;, Float) = 1.0&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
* 确保 RenderType 标签设置为上文提到的某个值。&lt;br /&gt;
* 声明一个名为 '''META_BAKERY''' 的 Pass。&lt;br /&gt;
* 在该 Pass 中检查 '''unity_MetaFragmentControl.w''' 是否非零，如果是，则返回计算出的透明度值。&lt;br /&gt;
&lt;br /&gt;
示例可参考包内的 ''Baked_Alpha_meta.shader''。&lt;br /&gt;
&lt;br /&gt;
注意：当前 Alpha Meta Pass 需要将 Light Probe Mode 设置为 L1 或 L2。&lt;br /&gt;
&lt;br /&gt;
=== Normal mapping ===&lt;br /&gt;
自定义表面法线可以与 [[#Baked Normal Maps|烘焙法线贴图]] 模式一起使用。不幸的是，Unity 的 Meta Pass 默认不输出法线信息，因此默认情况下，法线取自名为 {{codeVar|_BumpMap}} 的贴图，并通过 {{codeVar|_MainTex_ST}} 进行额外变换。&lt;br /&gt;
&lt;br /&gt;
然而，可以制作完全自定义的着色器，带有高级法线映射功能（例如混合多层法线），并使其兼容烘焙。要实现这一点，需要执行以下步骤：&lt;br /&gt;
&lt;br /&gt;
1. 在着色器中定义一个 Meta Pass，具体方法请参考 [https://docs.unity3d.com/Manual/MetaPass.html#ExampleMetaPassUnity 文档]。&lt;br /&gt;
&lt;br /&gt;
2. 将该 Pass 命名为 {{codeVar|&amp;quot;META_BAKERY&amp;quot;}}，而不仅仅是 {{codeVar|&amp;quot;META&amp;quot;}}。&lt;br /&gt;
&lt;br /&gt;
3. 包含文件 {{codeVar|&amp;quot;BakeryMetaPass.cginc&amp;quot;}}。&lt;br /&gt;
&lt;br /&gt;
4. 添加 {{codeVar|#pragma vertex vert_bakerymt}}。&lt;br /&gt;
&lt;br /&gt;
5. 如果 {{codeVar|unity_MetaFragmentControl.z}} 变量不为 0，着色器应返回世界空间法线。返回的法线应使用 {{codeVar|BakeryEncodeNormal}} 函数编码。&lt;br /&gt;
&lt;br /&gt;
在 Assets/Bakery/examples/shaders 中包含了两个实现了扩展 Meta Pass 的示例着色器。&lt;br /&gt;
&lt;br /&gt;
你也可以复制并修改 BakeryMetaPass.cginc 以满足你的需求，例如从顶点着色器传递额外数据。&lt;br /&gt;
&lt;br /&gt;
=== 正/背面 ===&lt;br /&gt;
无论着色器使用何种剔除模式，Bakery 都将所有背面视为不透明，这意味着任何直接光线都不会穿过背面，就像它不会穿过正面一样。&lt;br /&gt;
然而，如果使用 [[使用手册#Backface_GI|Backface GI]]，背面可以部分发出正面接收到的光照。&lt;br /&gt;
&lt;br /&gt;
= 扩展 Lightmap Parameters 资源 =&lt;br /&gt;
[[File:Lp.jpg|thumb|扩展 Lightmap Parameters]]&lt;br /&gt;
类似于 Bakery 的 [[#Bakery_Lightmap_Group_Selector|Lightmap Group]]，Unity 也有 [https://docs.unity3d.com/Manual/class-LightmapParameters.html Lightmap Parameters]，可以作为资源创建并分配给 Mesh Renderer。它们的逻辑有相似之处也有不同之处：&lt;br /&gt;
&lt;br /&gt;
* Lightmap Group 的主要用途是将多个对象组合到同一个图集。此外，它还允许覆盖该图集的烘焙设置。&lt;br /&gt;
* Lightmap Parameters 主要用于覆盖对象的烘焙设置，但通过使用“Baked Tag”选项，它们也可以影响打包：具有不同 Baked Tag 的对象将永远不会共享同一个图集。&lt;br /&gt;
&lt;br /&gt;
由于有些用户更习惯 Lightmap Parameters 的工作流程，Bakery 现在支持并扩展了它们：&lt;br /&gt;
&lt;br /&gt;
* Bakery 会遵循 Baked Tag 设置。&lt;br /&gt;
* Lightmap Parameters UI 中将显示额外的 Bakery 特定选项。有关其含义，请参考 [[#Bakery_Lightmap_Group_Selector|Lightmap Group]] 部分。&lt;br /&gt;
&lt;br /&gt;
= 项目设置 =&lt;br /&gt;
一些全局设置可以在 Project Settings -&amp;gt; Bakery GPU Lightmapper 中调整（此选项仅在 Unity 2018.3 或更新版本可见；旧版本请编辑 BakeryProjectSettings.asset）：&lt;br /&gt;
&lt;br /&gt;
* Mipmap lightmaps：启用光照贴图的 mipmap。随着图集变小，可能会导致 UV 图块之间的泄漏；另一方面，它可以减少远处高分辨率光照贴图的锯齿。总体上，建议对非常远的物体使用单独烘焙的 LOD 以及较低分辨率的光照贴图。&lt;br /&gt;
* Color file format：常规 HDR 颜色光照贴图的文件格式。可选值：&lt;br /&gt;
**HDR：Radiance HDR 格式（默认）。可用多种图像编辑器打开。&lt;br /&gt;
**Asset：Unity 原生格式。可自定义 mipmap 数量。&lt;br /&gt;
* Mask/Direction file format：额外 LDR 地图的格式，如阴影遮罩或方向数据。可选值：&lt;br /&gt;
**TGA：8 位 Targa（默认）。&lt;br /&gt;
**PNG：8 位 PNG。通常比 TGA 占用更少磁盘空间。&lt;br /&gt;
**Asset：Unity 原生格式。可自定义 mipmap 数量。&lt;br /&gt;
* Compress lightmaps：定义光照贴图资源的压缩行为。压缩光照贴图占用更少的显存，但可能会出现一些视觉伪影（例如色带或色斑），具体取决于压缩类型（移动端压缩问题请参见[[Troubleshooting#I_have_an_Android_project.2C_and_lightmaps_don.27t_look_good|此处]]）。可选值：&lt;br /&gt;
*** Compress but allow overriding asset: 新的光照贴图将在启用压缩的情况下创建。创建后，可以在 Inspector 中更改它们的压缩设置。修改后的值将在重新烘焙后保留（默认）。&lt;br /&gt;
*** Force compress: 始终压缩所有光照贴图。&lt;br /&gt;
*** Force no compress: 始终生成未压缩的光照贴图。&lt;br /&gt;
* High quality direction: 为方向贴图启用“高”质量压缩。实际格式取决于平台。例如在 PC 上，它会从 DXT1 改为 BC7，这提供了更高的质量，但 VRAM 使用量会翻倍。&lt;br /&gt;
* Texel padding (default atlas packer): 定义在使用默认 atlas 打包器时，在光照贴图 atlas 中对象 UV 布局之间添加多少空白 texel。&lt;br /&gt;
* Texel padding (xatlas packer): 同上，但在使用 xatlas 时。&lt;br /&gt;
* Alpha Meta Pass resolution multiplier: 乘以 [[Manual#Alpha_Meta_Pass|Alpha Meta Pass]] 的分辨率，使在低分辨率光照贴图烘焙时仍能实现精确的基于 Shader 的切割效果。&lt;br /&gt;
* Volume render mode: 为所有 [[Manual#Bakery_Volume|Volumes]] 使用哪种 [[Manual#Render_mode|渲染模式]]？Auto 使用当前活动的渲染模式（默认）。&lt;br /&gt;
* Delete previous lightmaps before bake: 在烘焙新光照贴图之前，实际删除该场景中所有之前渲染的光照贴图文件。&lt;br /&gt;
* Log level: 定义烘焙过程中在控制台输出的信息量。可能的值：&lt;br /&gt;
** 0: 不输出任何内容。&lt;br /&gt;
** 1: 仅输出进度信息。&lt;br /&gt;
** 2: 仅输出警告。&lt;br /&gt;
** 3: 输出全部信息。&lt;br /&gt;
* Alternative scale in lightmap: 使渲染器属性 'Scale in Lightmap' 的行为更类似于 Unity 内置的行为。&lt;br /&gt;
* Align to texture compression blocks with xatlas: 使 xatlas 将 chart 对齐到 4x4 块边界，从而获得更适合压缩的结果。&lt;br /&gt;
* Generate smooth positions: 是否应调整采样位置以防止低多边形几何体在平滑法线下产生错误阴影？在使用法线差异极大的几何体时，可在极少数情况下禁用。技术说明见 [https://ndotl.wordpress.com/2018/08/29/baking-artifact-free-lightmaps/#shadowterm 这篇文章]。&lt;br /&gt;
* Smooth positions per-triangle: 是否应按三角形决定平滑/平面位置？在使用法线差异极大的几何体时，可在极少数情况下禁用。&lt;br /&gt;
* Use 'Receive GI' values: 在渲染器上考虑 “Receive Global Illumination” 值。最初 Bakery 会忽略它。&lt;br /&gt;
* Remove ringing in Legacy light probes: 在 Legacy 模式下启用更柔和的光探针卷积，以防止高对比度区域出现伪影。&lt;br /&gt;
* Always render reflection probes: 在每次 Render/Render Light Probes 后自动渲染反射探针。&lt;br /&gt;
* Ringing removal for L2 light probes: 对 [[Manual#Light_probe_mode|L2 光探针]] 应用去振铃处理。值越高，探针光照越平滑；这种平滑可以减少 [[https://docs.unity3d.com/6000.2/Documentation/Manual/light-probes-troubleshooting.html](https://docs.unity3d.com/6000.2/Documentation/Manual/light-probes-troubleshooting.html) 振铃] 伪影（如果存在）。&lt;br /&gt;
* Put menu under Tools: 将 Bakery 菜单放入 Tools 菜单下。&lt;br /&gt;
&lt;br /&gt;
如果任何格式设置为 Asset 且启用 mipmapping，会显示额外选项：&lt;br /&gt;
&lt;br /&gt;
* Maximum mipmap count: 定义 mipmap 的最大数量。例如，设置为 2，则 8K 光照贴图仅有两个额外 mipmap：4K 和 2K。更低分辨率将被省略，从而在 mipmapping 过程中限制泄漏伪影。&lt;br /&gt;
&lt;br /&gt;
= SkinnedMeshRenderer 支持 =&lt;br /&gt;
Bakery 自 v1.65 起支持蒙皮网格 (skinned meshes)。但是，有一些限制：&lt;br /&gt;
&lt;br /&gt;
* 某些 Unity 版本不支持蒙皮网格的 UV1，并会悄无声息地忽略 “Generate lightmap UVs”。请确保场景中实际使用的网格具有 UV1，并在可能的情况下使用非重叠的 UV0；&lt;br /&gt;
* UV 填充调整在蒙皮网格上不起作用（Unity 在尝试调用 Unwrap 函数时似乎会崩溃）；&lt;br /&gt;
* 蒙皮网格不能使用每顶点光照贴图 (per-vertex lightmaps)（引擎不支持带蒙皮的 additionalVertexStreams）。&lt;br /&gt;
&lt;br /&gt;
= Shader Tweaks =&lt;br /&gt;
[[File:Image2.jpg|thumb|左：默认双线性过滤。右：双三次过滤。]]&lt;br /&gt;
[[File:Image34.jpg|thumb|左：两个阴影都已烘焙。&amp;lt;br&amp;gt;中：球形阴影为动态，另一个阴影为静态。通过相乘组合在一起。&amp;lt;br&amp;gt;右：与中间相同，但使用默认最小值组合。]]&lt;br /&gt;
&lt;br /&gt;
Bakery 提供可选的着色器修改，可以应用到 Unity 着色器上，以改善光照贴图采样并使实时光照更接近光照贴图效果。着色器调整菜单可以通过 Bakery-&amp;gt;Shader Tweaks 访问。&lt;br /&gt;
&lt;br /&gt;
这些选项会修补基础 Unity 着色器包含文件（来自 CGIncludes 文件夹），这些文件被大多数内置和第三方着色器使用。所有修改都会影响使用该版本编辑器打开的所有项目，但也可以轻松恢复。着色器调整会影响标准和表面着色器的工作方式。HDRP、URP 以及其他 SRP 不受影响。&lt;br /&gt;
&lt;br /&gt;
所有可用修改显示为按钮。点击按钮应用修改，按钮将保持按下状态。再次点击按钮即可移除修改。目前可用选项：&lt;br /&gt;
&lt;br /&gt;
{{note| 可能需要以管理员身份运行 Unity 编辑器以使 CGIncludes 修补生效}}&lt;br /&gt;
&lt;br /&gt;
* Use bicubic interpolation for lightmaps: 光照贴图将使用双三次插值代替默认双线性。此调整能很好地修复低分辨率光照贴图的许多锯齿边缘。目前仅适用于 DX11 和现代主机，其他平台仍使用双线性。&lt;br /&gt;
* Use multiplication for shadowmask: 使用相乘代替最小值组合静态和动态阴影。出于未知原因，Unity 默认使用最小值操作符，这会产生一些乘法不存在的伪影。&lt;br /&gt;
* Use physical light falloff (forward): 用更物理正确的平方反比替换实时点光/聚光灯的默认衰减。“Range” 只会在边缘略微淡出（与 Bakery 光源启用 Physical Falloff 复选框效果一致）。仅影响 Forward 渲染器。详情见 [[Point Light Attenuation]]。&lt;br /&gt;
* Use physical light falloff (deferred): 同上，但仅影响 Deferred 渲染器。&lt;br /&gt;
&lt;br /&gt;
'''衰减调整在 Unity &amp;gt;2017 版本上可能无法完全生效。此外，SRP 默认已经使用正确的衰减。'''&lt;br /&gt;
&lt;br /&gt;
= Bakery shaders =&lt;br /&gt;
Bakery 包含了自带着色器，支持顶点光照贴图，以及 RNM 和 SH 方向模式。它还允许从方向数据计算近似烘焙高光。&lt;br /&gt;
对于普通颜色光照贴图、阴影遮罩和 Dominant Direction 模式，Bakery 着色器 '''不是必需的'''，因为这些功能大多数 Unity 着色器本身已经支持。&lt;br /&gt;
&lt;br /&gt;
=== Standard render pipeline ===&lt;br /&gt;
'''Bakery/Standard''': 扩展了普通 Standard 着色器。额外选项：&lt;br /&gt;
&lt;br /&gt;
* Allow Vertex Lightmaps: 允许该材质用于 [[Vertex Lightmaps|顶点光照贴图]]。&lt;br /&gt;
* Allow RNM Lightmaps: 允许该材质用于 [[#RNM|RNM 方向模式]]。&lt;br /&gt;
* Allow SH Lightmaps: 允许该材质用于 [[#SH|SH 方向模式]]。&lt;br /&gt;
  {{note| 所有 “Allow” 选项会在着色器中启用特定的代码路径。为了性能考虑，建议每个材质仅使用一个 “allow” 选项。}}&lt;br /&gt;
* Enable Lightmap Specular: 使用 Dominant Direction、RNM 或 SH 方向模式的数据计算烘焙高光。注意，由于信息有限，该效果仅为近似。如果你曾在 Unity 4 中使用烘焙高光，效果应可比。与高度扰动的法线贴图搭配效果最佳，在平面表面上效果不佳。&lt;br /&gt;
* Enable VertexLM directional: 如果存在顶点光照贴图，指定 Dominant Direction 数据存储在顶点中并应被使用。&lt;br /&gt;
* Enable VertexLM SH: 如果存在顶点光照贴图，指定 SH 数据存储在顶点中并应被使用。&lt;br /&gt;
* Enable VertexLM Shadowmask: 如果存在顶点光照贴图，指定阴影遮罩存储在顶点中并应被使用。&lt;br /&gt;
* Enable MonoSH: 将方向贴图视为 MonoSH 贴图。&lt;br /&gt;
[[File:Image5.png|thumb|Standard SH light probe vs non-linear]]&lt;br /&gt;
[[File:Shspec.jpg|thumb|SH specular effect]]&lt;br /&gt;
* Non-linear SH：在 SH 方向模式下，此选项可以增强对比度（更接近真实效果），但会使着色器稍微变慢。该技巧基于 Geomerics 的论文《[https://drive.google.com/file/d/1MK6Clw93q8ljijRjb4gQOzzaIjn1uF9Y/view Reconstructing Diffuse Lighting from Spherical Harmonic Data]》。&lt;br /&gt;
* Non-linear Light Probe SH：与 Non-linear SH 类似，但用于光照探针。在探针的情况下，最显著的好处是消除错误的负值。这种问题常见于具有高对比度、明亮 HDR 光源的场景中。这是球谐函数的固有限制，而不是 Bakery 特有的问题（即使用 Unity 内置光照贴图器也可能出现类似伪影）。&lt;br /&gt;
* Force Bicubic Filter：为所有附加贴图启用双三次滤波。若要实现完整的双三次滤波（包括第一张颜色贴图），建议同时在 [[#Shader Tweaks|Shader Tweaks]] 中启用该功能。&lt;br /&gt;
&lt;br /&gt;
'''Bakery/Standard Specular'''：与 Standard 相同，但用于高光（Specular）工作流程。&lt;br /&gt;
&lt;br /&gt;
=== HDRP &amp;amp; URP ===&lt;br /&gt;
要提取额外的 HDRP/URP 着色器，请打开 Bakery 自带的 Bakery_ShaderGraphHDRP.unitypackage 或 Bakery_ShaderGraphURP.unitypackage。&lt;br /&gt;
在其中，你会找到可在自己 Shader Graph 中使用的 Shader Subgraph，以及一些示例材质。&lt;br /&gt;
&lt;br /&gt;
=== 各着色器功能支持对比 ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! 大多数 Unity 着色器&lt;br /&gt;
! 大多数 HDRP 和 URP 着色器&lt;br /&gt;
! Bakery Standard&lt;br /&gt;
! Bakery HDRP graphs&lt;br /&gt;
! Bakery URP graphs&lt;br /&gt;
|-&lt;br /&gt;
| HDR color lightmaps&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Shadowmask&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是 (&amp;gt;= URP 10.1)&lt;br /&gt;
|-&lt;br /&gt;
| Dominant Direction&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| RNM&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| SH&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Mo否SH&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Lightmap specular&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持 Dominant Direction 和 SH&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持 Dominant Direction&lt;br /&gt;
|-&lt;br /&gt;
| Bicubic filtering&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是,&lt;br /&gt;
通过 [[#Shader Tweaks|Shader Tweaks]] 支持&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是,&lt;br /&gt;
通过 [[#Shader Tweaks|Shader Tweaks]] 支持&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
|-&lt;br /&gt;
| Vertex lightmaps&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 单一颜色，没有每顶点 SH、方向或阴影遮罩（Shader Graph 限制）&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 单一颜色，没有每顶点 SH、方向或阴影遮罩（Shader Graph 限制）&lt;br /&gt;
|-&lt;br /&gt;
| Non-Linear Light Probes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Volumes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Volume shadowmask&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Compressed volumes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Mr F</name></author>
		
	</entry>
	<entry>
		<id>https://geom.io/bakery/wiki/index.php?title=%E4%BD%BF%E7%94%A8%E6%89%8B%E5%86%8C&amp;diff=1829</id>
		<title>使用手册</title>
		<link rel="alternate" type="text/html" href="https://geom.io/bakery/wiki/index.php?title=%E4%BD%BF%E7%94%A8%E6%89%8B%E5%86%8C&amp;diff=1829"/>
		<updated>2025-11-05T14:29:22Z</updated>

		<summary type="html">&lt;p&gt;Mr F: /* 各着色器功能支持对比 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== 系统要求 ==&lt;br /&gt;
&lt;br /&gt;
使用 Bakery 需要：&lt;br /&gt;
&lt;br /&gt;
Windows（7 或更高版本）电脑。&lt;br /&gt;
&lt;br /&gt;
Nvidia 显卡。最低支持型号为 Kepler（GeForce 650 或更新型号，Quadro 显卡请查看规格）。&lt;br /&gt;
&lt;br /&gt;
64 位 Unity 编辑器。Bakery 已在 5.6 到 6 及更高版本上测试过，同时也在 Tuanjie 1.6.7 上通过测试。&lt;br /&gt;
&lt;br /&gt;
{{note|系统要求仅适用于开发者的电脑，而非目标平台。使用 Bakery 烘焙的光照贴图可以在任何地方使用。}}&lt;br /&gt;
&lt;br /&gt;
== 前提条件 ==&lt;br /&gt;
* 确保你的项目中没有任何脚本编译错误，否则也会导致 Bakery 的脚本无法编译。&lt;br /&gt;
* 确保你的显卡驱动是最新版本，如有需要请[https://www.nvidia.com/Download/index.aspx?lang=en-US 更新]。&lt;br /&gt;
&lt;br /&gt;
'''请使用 Game-Ready（标准）驱动程序，而不是 “Studio” 驱动。'''&lt;br /&gt;
&lt;br /&gt;
== 安装 ==&lt;br /&gt;
&lt;br /&gt;
1. 通过 [https://assetstore.unity.com/packages/tools/level-design/bakery-gpu-lightmapper-122218 Asset Store] 将 Bakery 导入到你的项目中。&lt;br /&gt;
&lt;br /&gt;
2. Unity 会显示要导入的文件列表。如果这是你第一次使用 Bakery，建议直接 点击 Import（导入）。有经验的用户可以取消选中 examples 文件夹，以进行更轻量的安装。&lt;br /&gt;
&lt;br /&gt;
文件将被导入到 `Assets/Bakery` 和 `Assets/Editor/x64/Bakery` 文件夹中。&lt;br /&gt;
这些文件夹之后可以移动。&lt;br /&gt;
&lt;br /&gt;
3. Unity 随后会导入 Bakery 并编译脚本。此时可能会弹出如下窗口：&lt;br /&gt;
&lt;br /&gt;
[[File:Goahead.png]]&lt;br /&gt;
&lt;br /&gt;
此时你应点击 “Go Ahead”（继续）。&lt;br /&gt;
&lt;br /&gt;
现在你应该能在编辑器中看到新增的 Bakery 菜单：&lt;br /&gt;
&lt;br /&gt;
[[File:bmenu.jpg]]&lt;br /&gt;
&lt;br /&gt;
== 快速开始 ==&lt;br /&gt;
&lt;br /&gt;
1. 添加一些模型或基础体，并将其标记为静态（Static）。&lt;br /&gt;
&lt;br /&gt;
'''用于光照贴图的网格必须具有不重叠的 UV2。如果存在 UV2，则会使用 UV2（否则使用 UV1）。如果你的模型没有为光照贴图进行展开，请在资源中勾选 Generate Lightmap UVs（生成光照贴图 UV）。'''&lt;br /&gt;
Unity 的基础体已经具有正确的 UV2。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Staticmarked.jpg|320px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. 选择方向光（Unity 为你创建的那个），并添加 '''Bakery Direct Light''' 组件。&lt;br /&gt;
   {{note|Bakery 和 Unity 使用独立的光源组件。}}&lt;br /&gt;
&lt;br /&gt;
3. Bakery Direct Light 有许多可调选项，但你可以轻松将其与 Unity 光源匹配。点击 '''Match lightmapped to real-time'''。现在 Bakery 光源的颜色应与 Unity 默认的方向光相同，呈黄色调。&lt;br /&gt;
&lt;br /&gt;
[[File:Matching.jpg|640px]]&lt;br /&gt;
&lt;br /&gt;
{{note|Direct Light 组件可能会提示项目未使用线性光强度。问题在于，Unity 默认会对光源颜色应用伽马校正 [https://twitter.com/guycalledfrank/status/1001108508614553600 不正确]。&lt;br /&gt;
可以通过[https://docs.unity3d.com/ScriptReference/Rendering.GraphicsSettings-lightsUseLinearIntensity.html 脚本]启用正确模式。&lt;br /&gt;
这就是 “Fix” 按钮的作用。如果你已经在非线性光强模式下设置了许多光源，并且不想再次更改它们，可以跳过修复。即使你按了 “Fix”，也可以随时撤销此更改。&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. 要获得带阴影的环境光，请创建 Skylight（Bakery-&amp;gt;Create-&amp;gt;Skylight）。&lt;br /&gt;
&lt;br /&gt;
[[File:Menusky.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. 选择 Skylight，为它设置一些偏蓝的颜色，然后点击 '''Match scene skybox to this light'''。   这将使场景的 skybox 与光照完全匹配。&lt;br /&gt;
   {{note|将 Unity 的 skybox 与 Bakery Skylight 匹配是可选的，但对正确性很有用，可以确保可见环境和引擎内的反射探针与烘焙光照一致。目前此选项仅适用于 Standard 渲染管线。}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Skycomp.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. 点击 Bakery-&amp;gt;Render Lightmap。默认情况下，Full Lighting 模式是激活的。它会烘焙所有光源的直接和间接光照贡献。如果你想将实时阴影与烘焙全局光照（GI）结合使用，请将模式更改为 '''Indirect'''。&lt;br /&gt;
&lt;br /&gt;
[[File:Bakerywindow.jpg]]&lt;br /&gt;
&lt;br /&gt;
{{note| Bakery 可能会提示你正在使用旧的 [https://docs.unity3d.com/Manual/LinearLighting.html gamma mode]。如果你在意光照质量，强烈建议使用线性模式。如果你的项目已经在错误的伽马模式下设置好了，并且不想更改，或者是发布到不支持线性模式的移动设备上，也可以忽略此提示。}}&lt;br /&gt;
&lt;br /&gt;
7. 点击 '''Render'''。&lt;br /&gt;
&lt;br /&gt;
8. 完成！现在你应该已经得到烘焙的全局光照（GI）：&lt;br /&gt;
&lt;br /&gt;
[[File:Bakedgi.jpg]]&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 ==&lt;br /&gt;
&lt;br /&gt;
所有渲染设置都可以通过 Bakery-&amp;gt;Render Lightmap 访问。设置会为每个场景单独保存。Bakery 窗口顶部的选项允许你在 Simple（简单）、Advanced（高级）和 Experimental（实验）设置之间切换，每个后续模式都会显示更多可调选项。对于大多数场景，Simple 模式已经足够，是入门的好方法。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render mode ===  &lt;br /&gt;
定义要烘焙的光照贴图类型。  &lt;br /&gt;
&lt;br /&gt;
===== Full Lighting =====&lt;br /&gt;
烘焙所有 Bakery 光源的完整直接光和间接光。&lt;br /&gt;
{{note|在 2017.3 之前的 Unity 版本中，如果同一对象上同时有 Unity 和 Bakery 组件，你需要手动禁用 Unity 组件以避免亮度加倍。在较新版本中，实时效果会自动对烘焙光源禁用，就像内置光照烘焙器一样。}}&lt;br /&gt;
&lt;br /&gt;
===== Indirect =====&lt;br /&gt;
[[File:Image26.png|thumb|Unity 支持的不同渲染模式对比]]&lt;br /&gt;
基础混合模式。它会查看每个光源上的 Baked Contribution 选择器：如果设置为 ''Direct And Indirect''，则光源会像在 Full Lighting 模式下一样被烘焙。如果设置为 ''Indirect Only''，则只会烘焙该光源的间接光照（GI）。在后一种情况下，你应保持对象上的 Unity 光源和 Bakery 光源同时存在，一个提供实时直接光照，另一个提供预计算的全局光照（GI）。&lt;br /&gt;
&lt;br /&gt;
[[File:Indirectonly.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== Shadowmask =====&lt;br /&gt;
[[File:Image21.png|thumb|左：完全烘焙的光照。中：动态光源 + 烘焙 GI。右：胶囊形阴影、凹凸贴图和高光为动态光照，但立方体阴影和 GI 为烘焙光照。]]&lt;br /&gt;
[[File:Image6.png|thumb|当相机足够远离场景，或者动态阴影被禁用时，场景将呈现如下效果]]&lt;br /&gt;
更高级的混合模式。它通过生成两种类型的光照贴图来工作——一种包含烘焙颜色（如 Indirect 模式），另一种包含静态物体的阴影。它有几个优点：&lt;br /&gt;
* 实时阴影只需渲染少量动态对象，而不是整个场景。&lt;br /&gt;
* 实时阴影与烘焙阴影可以正确融合。&lt;br /&gt;
* 实时光源可以渲染凹凸贴图、高光和其他表面效果，同时仍会被高质量烘焙阴影遮挡。&lt;br /&gt;
[https://docs.unity3d.com/Manual/LightMode-Mixed-Shadowmask.html 更多详情]&lt;br /&gt;
&lt;br /&gt;
要启用此行为，你必须在同一对象上同时存在 Unity 光源和 Bakery 光源，并将 Baked Contribution 设置为 ''Shadowmask and Indirect''。未标记的光源将按 Indirect 模式进行烘焙。&lt;br /&gt;
&lt;br /&gt;
[[File:Smask22.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== Distance Shadowmask =====&lt;br /&gt;
此复选框仅在你选择 Shadowmask 时可见，并且只是切换项目 [https://docs.unity3d.com/Manual/LightMode-Mixed-ShadowmaskMode.html Quality Settings] 中同名的设置。&lt;br /&gt;
[https://docs.unity3d.com/Manual/LightMode-Mixed-DistanceShadowmask.html 更多详情]&lt;br /&gt;
{{note|由于缺少对应的脚本 API，该复选框在 Unity 5.6.x 上不可见。你可以在 Window-&amp;gt;Lighting-&amp;gt;Mixed Lighting-&amp;gt;Lighting Mode 中切换该设置。}}&lt;br /&gt;
{{note|在 Unity 版本 &amp;lt; 2017.3 中，由于 API 限制，渲染 Shadowmask 光照贴图会清除光照探针。烘焙后需要重新渲染光照探针。在较新版本中不应发生此问题。}}&lt;br /&gt;
&lt;br /&gt;
===== Subtractive =====&lt;br /&gt;
&lt;br /&gt;
启用 [https://docs.unity3d.com/Manual/LightMode-Mixed-Subtractive.html Subtractive] 光照模式。&lt;br /&gt;
&lt;br /&gt;
此选项对光照贴图本身没有任何特殊作用，实际上它的工作方式与 Full Lighting 相同。&lt;br /&gt;
&lt;br /&gt;
唯一的区别是，它还会将实时 Unity 光源设置为与 Subtractive 模式兼容（因为无法通过 UI 完成此操作）。&lt;br /&gt;
&lt;br /&gt;
你还需要在 [https://docs.unity3d.com/Manual/GlobalIllumination.html#MixedLighting Unity Lighting] 窗口中额外设置全局减法参数（例如全局阴影颜色）。&lt;br /&gt;
&lt;br /&gt;
===== Ambient Occlusion Only =====&lt;br /&gt;
仅烘焙环境光遮蔽（AO）。如果你很清楚自己在做什么，这可能会有用。请确保设置 [[#Ambient_occlusion|AO 选项]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Directional mode ===&lt;br /&gt;
[[File:Image3.png|thumb|不同方向模式的对比]]&lt;br /&gt;
定义了方向信息的烘焙方式。标准光照贴图每个像素只存储单一颜色，而方向光照贴图为着色器提供了关于该像素周围半球内光照变化的提示。这些数据用于在完全烘焙的区域中结合法线贴图。如果将其应用到内置的 [[#Bakery_shaders|Bakery]] 着色器中，还可以产生**近似高光反射**效果。&lt;br /&gt;
&lt;br /&gt;
===== None =====&lt;br /&gt;
不包含方向数据，每个像素仅有单一颜色。&lt;br /&gt;
&lt;br /&gt;
===== Baked Normal Maps =====&lt;br /&gt;
依然没有方向数据，但在渲染光照贴图时会考虑法线贴图。此方式在运行时没有额外开销。由于光照贴图的分辨率通常低于法线贴图，结果可能显得模糊。其他问题包括：由于缺乏 mipmapping，远处可能出现锯齿，以及降噪步骤可能导致细节被涂抹。要了解如何在此模式下使用具有程序化法线的自定义着色器，请参阅 [[#Normal_mapping|Normal Mapping]] 章节。&lt;br /&gt;
&lt;br /&gt;
===== Dominant Direction =====&lt;br /&gt;
此模式类似于 Unity 中 Enlighten 和 Progressive 烘焙器的实现。它与大多数着色器兼容，仅生成一张额外的贴图，运行时开销极小。缺点是凹凸贴图的效果较弱，略显灰暗，与实时光照下的同一物体相比可能差异较大。&lt;br /&gt;
&lt;br /&gt;
===== RNM =====&lt;br /&gt;
基于最初为《Half-Life 2》开发的 [https://steamcdn-a.akamaihd.net/apps/valve/2004/GDC2004_Half-Life2_Shading.pdf Radiosity Normal Mapping] 技术（相关演示文稿），后来被许多游戏采用（如《Mirror's Edge》）。此模式总共生成三张 HDR 贴图，是内存占用最高的模式之一，但运行时开销仍相对较低。该模式比 Dominant Direction 更精确，能更好地再现表面反差，并能正确处理来自不同角度、具有不同颜色的光照对法线贴图的影响。&lt;br /&gt;
&lt;br /&gt;
===== SH =====&lt;br /&gt;
基于论文《[https://media.contentapi.ea.com/content/dam/eacom/frostbite/files/gdc2018-precomputedgiobalilluminationinfrostbite.pdf Precomputed Global Illumination in Frostbite]》。这是最高质量的模式，能提供更好的表面对比度，并准确表现来自不同方向、不同颜色的光照。总共生成四张贴图，其中仅一张为 HDR，因此比 RNM 占用更少内存。运行时开销略高于 RNM。&lt;br /&gt;
&lt;br /&gt;
===== MonoSH =====&lt;br /&gt;
[[File:FY8Ru8hWIAAdYYH.jpg|thumb|Dominant Direction、完整 SH 与 MonoSH 的尺寸/质量对比]]&lt;br /&gt;
与 SH 类似，但使用单色的 L1 方向系数。表面对比度同样良好，虽然无法准确表现来自不同方向的不同颜色光照，但对多数场景来说已经足够。仅生成一张额外贴图，因此显存占用与带宽需求与 Dominant Direction 相近；事实上更低，因为 Dominant Direction 使用 RGBA 贴图，而 MonoSH 只需 RGB。该贴图通过内置的方向光照贴图系统传递，但''在标准着色器下显示不正确''。请务必使用兼容的着色器。&lt;br /&gt;
&lt;br /&gt;
===== 限制 =====&lt;br /&gt;
&lt;br /&gt;
* RNM 和 SH/MonoSH 只能与 [[#Bakery_shaders|Bakery shader]] 一起使用，或者需要对你的着色器进行调整。&lt;br /&gt;
* 在 RNM 和 SH 模式下，不会生成标准的颜色光照贴图。你需要确保场景中所有材质都使用 Bakery Shader，或者使用 [[#Bakery_Lightmap_Group_Selector|Lightmap Groups]] 将 RNM/SH 对象与其他对象分开。&lt;br /&gt;
* RNM 和 SH 贴图是通过 [https://docs.unity3d.com/ScriptReference/MaterialPropertyBlock.html MaterialPropertyBlock] 应用于对象的，因此在 Unity 的 Lighting 窗口中可能无法完全显示。&lt;br /&gt;
* Dominant Direction、RNM 和 SH/MonoSH 模式可能需要为全局光照（GI）和光照网格使用更多采样，以获得相近的质量。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Texels per unit ===&lt;br /&gt;
[[File:Texelscomp.jpg|thumb|1 vs 10 texels per unit]]&lt;br /&gt;
每个世界单位的光照贴图像素（Texels）近似数量。它会影响生成光照贴图的数量和分辨率。&lt;br /&gt;
&lt;br /&gt;
入门示例值：&lt;br /&gt;
&lt;br /&gt;
* 大型户外区域（城市）：1 - 5&lt;br /&gt;
* 中型户外区域（几条小巷）：10 - 20&lt;br /&gt;
* 高质量室内场景：100&lt;br /&gt;
&lt;br /&gt;
假设场景比例大约为 1 单位 = 1 米。在 Unity 中使用这种比例通常是推荐的，以便更好地导航和进行物理模拟。如果你的比例不同，请相应地调整 Texels。&lt;br /&gt;
&lt;br /&gt;
请注意，Texels Per Unit 是基础分辨率，但每个对象还可以通过 Mesh Renderer 上的 &amp;quot;Scale in Lightmap&amp;quot; 选项以及 Bakery 窗口中的 &amp;quot;Scale per map type&amp;quot; 进行额外调整。&lt;br /&gt;
&lt;br /&gt;
{{note| 将 &amp;quot;Scale in Lightmap&amp;quot; 设置为 0 的对象不会被烘焙，但仍会投射阴影并影响全局光照（GI）。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Max resolution ===&lt;br /&gt;
光照贴图的最大尺寸限制。如果对象无法容纳在单张光照贴图中（根据当前的 Texels Per Unit 值），将会分配额外的光照贴图。同样的四个正方形对象可以使用四张 512x512 的贴图，也可以使用一张 1024x1024 的贴图。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bounces ===&lt;br /&gt;
[[File:Image36.png|thumb|注意更多的反弹会为封闭空间带来更多光照。]]&lt;br /&gt;
定义光线在表面上反弹的次数。通常，对于户外场景（例如城市），较低的反弹次数就足够了，而对于封闭场景（室内、洞穴），则需要较高的反弹次数。&lt;br /&gt;
&lt;br /&gt;
虽然滑块最多限制为 5 次反弹，但可以在数字输入框中输入任意反弹次数。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Samples ===&lt;br /&gt;
[[File:Image7.png|thumb|左：Samples = 4，右：Samples = 16。为了演示，去噪功能已关闭。]]&lt;br /&gt;
影响全局光照（GI）的质量。典型值为 16 到 32。&lt;br /&gt;
&lt;br /&gt;
{{note| 可以输入超出滑块最大值的任意数字，但请注意，该数字表示最终光线数量的平方根，例如 32 表示 1024 条光线，64 表示 4096 条光线，依此类推。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GPU Priority ===&lt;br /&gt;
在 GPU 处理光照贴图时，操作系统和其他软件的响应可能会变慢。此选项允许你在烘焙速度和系统响应之间进行平衡。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render ===&lt;br /&gt;
为所有打开的场景烘焙光照贴图。&lt;br /&gt;
如果 [[使用手册#Light_probe_mode|Light Probe Mode]] 设置为 L1 或 L2，也会烘焙 [https://docs.unity3d.com/Manual/LightProbes.html 光照探针]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Render Light Probes ===&lt;br /&gt;
为所有打开的场景烘焙 [https://docs.unity3d.com/Manual/LightProbes.html 光照探针]。&lt;br /&gt;
&lt;br /&gt;
请注意，要在 Shadowmask 模式下对动态对象获得正确的混合光阴影，你还需要启用 [[使用手册#Occlusion_probes|occlusion probes]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Render Reflection Probes ===&lt;br /&gt;
为所有打开的场景烘焙反射探针。此按钮仅为方便起见，会调用引擎内置的反射探针更新功能。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update Skybox Probe ===&lt;br /&gt;
为当前的 skybox 烘焙全局漫反射和反射探针。与 “Render Reflection Probes” 一样，它仅调用引擎内置函数。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Occlusion probes ===&lt;br /&gt;
在渲染光照探针时，允许 Unity 使用当前选择的内置光照烘焙器烘焙遮挡探针（occlusion probes）。遮挡探针是存储在普通光照探针中的附加数据，可以防止动态对象在阴影区域被错误照亮。目前在 Unity 中无法使用自定义遮挡探针，必须调用内置光照烘焙器来完成此操作。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Warnings ===&lt;br /&gt;
这些选项会在按下任意 Render 按钮后对场景进行验证，并显示警告对话框，询问是否继续或停止烘焙过程。&lt;br /&gt;
&lt;br /&gt;
* Suppress all popups（屏蔽所有弹窗）：按下 Render 后不显示任何对话框。&lt;br /&gt;
* UV validation（UV 验证）：检查所有模型是否具有完全正确的光照贴图 UV，特别是 UV 是否位于 0-1 范围内且不重叠。&lt;br /&gt;
* Overwrite check（覆盖检查）：显示哪些光照贴图文件将被覆盖。&lt;br /&gt;
* Memory check（内存检查）：显示大致所需的视频内存量。&lt;br /&gt;
* Sample count check（采样数检查）：检查是否有光源、GI 或 AO 的采样数不合理，可能导致 GPU 超出可用资源。&lt;br /&gt;
* Lightmapped prefab validation（光照贴图预制体验证）：验证光照贴图预制体，并在某些预制体将被覆盖时发出通知。&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 (Advanced) ==&lt;br /&gt;
=== Light probe mode ===&lt;br /&gt;
更改光照探针的烘焙方式。&lt;br /&gt;
&lt;br /&gt;
* Legacy（传统模式）：使用 Render Light Probes 按钮生成探针。点光源和方向光在光照烘焙器中计算，而区域光/天空光/间接光则通过在每个探针位置渲染立方体贴图收集。结果以 [https://docs.unity3d.com/ScriptReference/Rendering.SphericalHarmonicsL2.html L2] 球谐（spherical harmonics）形式存储。缺点是立方体贴图渲染速度慢，并且在游戏中使用的着色器未物理正确表示光照表面，或者项目为移动平台设置时，光照贴图和探针可能不匹配（Unity 可能会裁剪高强度值）。&lt;br /&gt;
&lt;br /&gt;
* L1：在点击 Render 时，光照探针会与光照贴图一起渲染。此选项提供更高的烘焙性能，并保证探针光照与光照贴图匹配。结果以 L1 球谐形式存储（仍可被普通着色器使用）。使用 [[#Bakery_shaders|Bakery shader]] 的 Non-Linear Light Probe SH 选项可以进一步提升结果。&lt;br /&gt;
&lt;br /&gt;
* L2：更高质量（完整 L2 球谐）。与 L1 一样，会自动与光照贴图一起渲染。与 L1 相比，性能影响可忽略不计。应在所有着色器下显示正常。探针对比度/方向性/振铃去除可通过 Project Settings -&amp;gt; Bakery -&amp;gt; “Ringing removal for L2 light probes” 调整。&lt;br /&gt;
&lt;br /&gt;
'''在 Unity 2019.3 中似乎存在一个 bug，如果启用 Occlusion Probes 选项，Legacy 光照探针的颜色无法正确保存。使用 Occlusion Probes 时，默认且推荐使用 L2 模式。'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Asset UV Processing ===&lt;br /&gt;
配置资产的 UV 间距（padding）调整。可选值：&lt;br /&gt;
&lt;br /&gt;
* Don't change（不更改）：不修改资产。&lt;br /&gt;
* Adjust UV padding（调整 UV 间距）：会查找具有自动生成 UV 的模型（资产上启用 “Generate Lightmap UVs”），并进一步调整它们，使每个网格的 UV 岛之间具有适当间距。导入器设置中的全模型 Pack Margin 会被忽略。系统会根据每个网格的面积和光照贴图分辨率计算出最优值。&lt;br /&gt;
* Adjust UV padding for new meshes only（仅调整新网格的 UV 间距）：与上面相同，但会跳过之前至少调整过一次的模型。&lt;br /&gt;
* Remove UV adjustments（移除 UV 调整）：撤销所有之前的 UV 调整，使自动展开的模型恢复到 Unity 原始展开的样子。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser ===&lt;br /&gt;
设置所需的去噪器。可选值：&lt;br /&gt;
&lt;br /&gt;
* Optix 5：使用 OptiX 5.1 AI 去噪器（之前称为 “Legacy denoiser”）。在 GPU 上运行。支持从 [https://en.wikipedia.org/wiki/Kepler_(microarchitecture) Kepler]（通常是 GeForce 6xx）到 [https://en.wikipedia.org/wiki/Turing_(microarchitecture) Turing]（通常是 GeForce 20xx）的所有显卡。不支持 [https://en.wikipedia.org/wiki/Ampere_(microarchitecture) Ampere]（30xx）。OptiX 5.1 使用嵌入的静态训练数据集，因此不受驱动实现影响。&lt;br /&gt;
&lt;br /&gt;
* Optix 6：使用 OptiX 6.0 AI 去噪器（之前为默认选项）。在 GPU 上运行。在 Kepler（6xx）显卡上似乎无法使用，但在更新的显卡上均可运行，包括 Ampere（30xx）。自 6.0 起，OptiX 去噪器的训练数据集存储在驱动中。在 v442.50 之前，其行为类似于 OptiX 5.1；但之后 NVIDIA [https://forums.developer.nvidia.com/t/optix7-denoiser-different-results-with-different-version-of-drivers/117989/2 更改了数据集]，结果可能有所不同。更新后的数据集有时可能产生网格状图案和更亮的边缘（仍可通过 “Denoise: fix bright edges” 修复），但运行速度更快。&lt;br /&gt;
&lt;br /&gt;
* Optix 7：使用 OptiX 7.2 AI 去噪器。行为类似 OptiX 6.0，但在 Ampere（30xx）上可能支持更好。&lt;br /&gt;
&lt;br /&gt;
* OpenImageDenoise：使用 Intel Open Image Denoise 库。在 CPU 上运行（任何支持 SSE 4.1 的 CPU）。可能略慢于 OptiX，但质量可比。&lt;br /&gt;
&lt;br /&gt;
* OpenImageDenoise2：使用 Intel Open Image Denoise 2，CUDA 模式。在 GPU 上运行，性能与 OptiX 6/7 相当，质量与 CPU 版本相同。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Adjust sample positions ===&lt;br /&gt;
寻找最佳采样位置以防止光照泄漏。算法详情可参考 [https://ndotl.wordpress.com/2018/08/29/baking-artifact-free-lightmaps/#leaks 此处]。在某些情况下（通常是大型且多边形极少、法线平滑的几何体），可能会产生不正确的结果，此时可以将其禁用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Unload scenes before render ===&lt;br /&gt;
在烘焙前卸载 Unity 场景以释放显存。复杂场景仅在编辑器中显示就可能占用数 GB 的显存。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Denoise ===&lt;br /&gt;
[[File:Image31.png|thumb|左：未开启 “Denoise”，右：开启 “Denoise”。]]&lt;br /&gt;
如果启用，将应用去噪算法。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Fix Seams ===&lt;br /&gt;
[[File:Image22.png|thumb|左：缝隙（“Fix Seams” 关闭），右：缝隙已修复（“Fix Seams” 开启）。]]&lt;br /&gt;
如果启用，将尝试融合由 UV 不连续造成的缝隙。对平滑几何体很有用，包括 Unity 默认的球体。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Split by scene ===&lt;br /&gt;
如果同时加载多个场景，并且启用此选项，每个场景将拥有自己的一套光照贴图，而不会与其他场景共享。这对于在运行时流式加载场景时限制纹理占用量非常有用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hole filling ===&lt;br /&gt;
[[File:Holefilling.jpg|thumb|“Hole filling” 关闭与开启的对比。]]&lt;br /&gt;
如果 Atlas Packer 设置为 xatlas，将尝试填充每个孔洞，从而生成更高效的贴图集。对于几何体非常复杂的场景，可能会增加场景导出时间，但通常推荐开启。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Min resolution ===&lt;br /&gt;
光照贴图的最小尺寸限制。可用于在生成大量小而完全填充的光照贴图与少量未完全填充的光照贴图之间进行平衡。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Scale per map type ===&lt;br /&gt;
允许你对颜色贴图、Shadowmask 和方向贴图设置不同的分辨率缩放。例如，常见情况是间接光颜色分辨率较低，但 Shadowmask 分辨率较高。请注意，缩放在光照贴图渲染完成后才应用，因此不会节省烘焙时间。如果启用了 “Adjust UV padding”，间距将基于最低分辨率的贴图，以防止像素泄漏。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Checker preview ===&lt;br /&gt;
[[File:Image12.png|thumb|Checker Preview 功能演示。]]&lt;br /&gt;
如果勾选了 “Show checker” 选项，场景视图将在可见对象上渲染棋盘格图案，以展示光照贴图像素大小。这对于在烘焙前确保 Texels Per Unit 和其他影响分辨率的设置使用合理数值非常有用。&lt;br /&gt;
&lt;br /&gt;
启用 Checker Preview 将强制 Bakery 执行贴图集打包。可能需要一些时间，但通常不会超过几秒钟。在修改场景内容后，按下 “Refresh checker” 可重新打包场景以查看更改。&lt;br /&gt;
&lt;br /&gt;
Checker Preview 还使用随机颜色显示场景将如何被分割到不同的光照贴图中。&lt;br /&gt;
&lt;br /&gt;
{{note| 当前 Checker Preview 无法显示地形的正确像素大小。}}&lt;br /&gt;
&lt;br /&gt;
==== Atlas preview ====&lt;br /&gt;
[[File:FN-TmhRXwAE9i2I.png|thumb|Atlas Preview 功能演示]]&lt;br /&gt;
当 Checker Preview 开启时，会显示 Atlas Preview 按钮。点击它将打开一个新窗口，显示未来光照贴图的 UV 布局。点击 &amp;quot;&amp;lt;&amp;quot; 和 &amp;quot;&amp;gt;&amp;quot; 按钮可浏览各个光照贴图。&lt;br /&gt;
这对于在烘焙前检查打包质量和光照贴图数量非常有用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Emissive boost ===&lt;br /&gt;
将任何表面自发光（emission）乘以此数值。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Indirect boost ===&lt;br /&gt;
将所有反弹光照乘以此数值。作用与光源组件上的 Indirect Intensity 相同，但为全局设置。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Backface GI ===&lt;br /&gt;
[[File:Image30.jpg|thumb|Backface GI]]&lt;br /&gt;
[[File:Image35.png|thumb|左：“Backface GI” = 0，右：“Backface GI” = 1。注意阴影区域接收到更多的绿色光照。]]&lt;br /&gt;
决定光线通过前面表面到达背面并被全局光照（GI）反弹的程度。这对于薄的半透明表面（如树叶）尤其有用。取值范围为 0-1。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Ambient occlusion ===&lt;br /&gt;
[[File:Image15.png|thumb|左：AO intensity = 0，右：AO intensity = 1。]]&lt;br /&gt;
一种简单的非物理环境光遮蔽（Ambient Occlusion，AO），可在最终场景光照上叠加以增强美观效果。&lt;br /&gt;
&lt;br /&gt;
* Intensity（强度）：控制 AO 效果的可见度。值为 0 时禁用该效果。&lt;br /&gt;
* Radius（半径）：决定 AO 效果使用的光线距离。较小的值产生局部遮蔽（角落、褶皱），较大的值则更类似 Skylight，从远处物体产生阴影。&lt;br /&gt;
* Samples（采样数）：影响环境光遮蔽的质量。典型值为 4 到 32。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dither transparency ===&lt;br /&gt;
通过自动抖动不透明度贴图来启用半透明阴影。[[使用手册#Opacity|了解 Bakery 如何处理不透明度贴图]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== RTX Mode ===&lt;br /&gt;
启用 RTX 硬件加速。仅 RTX 显卡可受益于此选项。最低支持的驱动版本为 418。&lt;br /&gt;
&lt;br /&gt;
驱动可以在大多数非 RTX Nvidia 显卡上模拟 RTX 模式，但通常会更慢。&lt;br /&gt;
&lt;br /&gt;
在 Ampere（3xxx）或更新的显卡上，RTX 模式 ''必须'' 启用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Export terrain trees ===&lt;br /&gt;
如果启用，绘制在地形上的树木将影响光照。树木本身不会被烘焙。请注意，在烘焙过程中，每棵树都使用最高可能的 LOD 等级。对于多公里范围且模型高度复杂的森林场景，不建议使用此选项。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Terrain optimization ===&lt;br /&gt;
如果启用（默认），地形将使用独立的光线追踪技术以利用其高程图几何结构。否则，它们将像其他普通网格一样处理。地形优化可以显著减少高分辨率地形所需的内存占用。在某些情况下，它还能加快地形烘焙速度，但在其他情况下（尤其是简单低分辨率地形）可能需要禁用该选项。&lt;br /&gt;
&lt;br /&gt;
{{note| 地形优化当前不兼容绘制的地形洞。需禁用此选项才能使其正常工作。}}&lt;br /&gt;
{{note| 地形优化仅支持非 RTX 模式。}}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Light Mesh batch limit ===&lt;br /&gt;
如果该值大于 0，会将多个 Light Mesh 合并为一个，前提是它们具有相同设置并影响相同的 Lightmap Groups，同时将它们的总采样数限制为该值（例如，如果限制为 64，则可以合并 2 个采样数为 32 的灯光，或 4 个采样数为 16 的灯光，等等）。在拥有大量 Light Mesh 的场景中，这可以提升性能。但设置过高时需小心，因为 GPU 在一次处理过多采样时可能触发操作系统驱动超时。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Compress volumes ===&lt;br /&gt;
如果启用，将对体积 3D 贴图应用纹理压缩，并将 Bakery 着色器切换到相应的采样模式。不推荐对分辨率非常低的体积使用此选项。体积大小可能会被调整为 4 的倍数。&lt;br /&gt;
&lt;br /&gt;
注意事项：&lt;br /&gt;
&lt;br /&gt;
* 目前仅支持压缩为 BC6H/BC7 纹理格式（桌面/主机平台）。&lt;br /&gt;
* 体积压缩仅支持 Unity 2020.1 或更高版本。&lt;br /&gt;
* 目前仅标准渲染管线的 Bakery 着色器支持使用压缩体积贴图。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Samples multiplier ===&lt;br /&gt;
将所有阴影和 GI 采样数乘以指定因子。可用于在草稿质量和最终质量之间快速切换。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Tile size ===&lt;br /&gt;
与 [[#GPU Priority|GPU Priority]] 相同，但这里设置的是贴图块（tile）大小。Bakery 会将光照贴图拆分为更小的块，并一次更新一个块。块越小，GPU 工作被中断的次数越多，系统响应性可能更好。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Temp path ===&lt;br /&gt;
临时文件夹。在渲染过程中，Bakery 可能需要几个 GB 的可用空间。将此文件夹放在 SSD 上相比 HDD 可略微加快渲染速度。目前，该文件夹不会自动清理。你可以随时手动删除其内容（渲染时除外），或通过 Bakery -&amp;gt; Utilities -&amp;gt; Clear cache 清理。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Output path ===&lt;br /&gt;
光照贴图文件夹。所有光照贴图，以及 lightprobe 和顶点颜色（vertex color）资源都将保存在此处。该路径相对于你的 Assets 文件夹。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Use scene named output path ===&lt;br /&gt;
如果启用此选项，输出路径将自动设置为与当前活动场景同名的文件夹（Assets/CurrentSceneName/）。这与 Unity 内置光照贴图烘焙器的行为类似。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render Selected Groups ===&lt;br /&gt;
仅烘焙包含所选对象的 Lightmap Groups。&lt;br /&gt;
不仅仅是所选对象会被重新绘制，它们所属的所有 Lightmap Groups 都会被处理。其他光照贴图不会被更新。如果对象不属于某个手动分配的组，则使用相同光照贴图的场景部分将被重新烘焙。&lt;br /&gt;
&lt;br /&gt;
目前，使用 [[Partial_scene_baking|Sectors]] 进行场景部分烘焙更为方便。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Beep on finish ===&lt;br /&gt;
如果启用，Bakery 在烘焙完成时会播放提示音。&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 (Experimental) ==&lt;br /&gt;
=== Unwrapper ===&lt;br /&gt;
如果启用 [[#Asset_UV_Processing|Adjust UV Padding]]，则定义将使用的展开器（unwrapper）。&lt;br /&gt;
&lt;br /&gt;
* Default：使用 Unity 标准展开器。Bakery 会为每个具有不同间距参数的网格调用 [https://docs.unity3d.com/ScriptReference/Unwrapping.GenerateSecondaryUVSet.html Unwrapping.GenerateSecondaryUVSet]。&lt;br /&gt;
* xatlas：使用 [https://github.com/jpcy jpcy] 的 [https://github.com/jpcy/xatlas xatlas]，这是 [https://github.com/castano Ignacio Castaño] 的 [https://github.com/Thekla/thekla_atlas thekla_atlas] 的修改版。thekla_atlas 曾用于游戏《The Witness》（[http://the-witness.net/news/2010/03/graphics-tech-texture-parameterization/ 参见博客文章]）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Atlas Packer ===&lt;br /&gt;
选择在将不同对象的 UV 布局打包到大型光照贴图集时使用的算法。&lt;br /&gt;
* Default：Bakery 在 v1.7 之前使用的原始算法。&lt;br /&gt;
* xatlas：使用 xatlas。&lt;br /&gt;
&lt;br /&gt;
某些功能仅支持特定的贴图集打包器：&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Default&lt;br /&gt;
! xatlas&lt;br /&gt;
|-&lt;br /&gt;
| [[使用手册#Bakery_Lightmap_Group_Selector|Override resolution]]&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
|-&lt;br /&gt;
| 高效 LOD 打包&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
|-&lt;br /&gt;
| [[使用手册#Hole_filling|Hole filling]]&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
请注意，贴图集打包器（Atlas Packer）也可以为每个 Lightmap Group 单独选择。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Export geometry and maps ===&lt;br /&gt;
如果启用，Bakery 会在渲染前将场景导出为其专用格式。如果你确定场景的几何体和贴图以及光照贴图分辨率设置没有改变（例如，你只是调整 GI 或光源设置），可以禁用此选项以加快下一次渲染速度。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update unmodified lights ===&lt;br /&gt;
如果启用，Bakery 会重新计算自上次渲染以来未改变的光源。如果你只是调整某个光源，不想等待其他光源重新渲染，可以禁用此选项。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update modified lights and GI ===&lt;br /&gt;
如果启用，Bakery 会重新计算自上次渲染以来发生变化的 GI 和光源。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== UV padding: increase only ===&lt;br /&gt;
仅在启用 [[#Asset_UV_Processing|Adjust UV padding]] 时可见。默认情况下，模型资源的最佳 UV 间距仅基于当前加载的场景进行计算。如果同一模型有多个实例使用不同的光照贴图分辨率，最小的分辨率将决定间距，以确保 UV 图块之间的间距足够大，防止相互重叠。然而，在两个不同的独立场景中烘焙同一模型时，为新场景优化可能会破坏之前场景中的 UV。勾选此选项可以防止这种情况发生，即永远不减小间距值，从而始终为曾经烘焙过的最低分辨率实例进行优化。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoise: fix bright edges ===&lt;br /&gt;
[[File:Image19.png|thumb|左：去噪后可见明亮边缘；右：已修复。]]&lt;br /&gt;
仅在 [[#Denoise|Denoise]] 启用时可见。有时用于去噪的神经网络可能会在阴影周围产生明亮边缘，就像应用了锐化效果一样。如果启用此选项，Bakery 会尝试将其滤除。启用后，去噪阶段可能会略微变慢。&lt;br /&gt;
&lt;br /&gt;
此功能也可用于滤除“火花”（fireflies），即光照贴图中偶尔出现的亮点。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Post-packing ===&lt;br /&gt;
有时在渲染场景时，Bakery 会将光照贴图拆分为多个子光照贴图，例如在烘焙不同 LOD 或地形时。&lt;br /&gt;
Post-packing 会尝试通过将这些子光照贴图合并到同一纹理中来最小化最终贴图集数量。&lt;br /&gt;
建议保持此选项启用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Combine with Enlighten real-time GI ===&lt;br /&gt;
如果启用，则在按下 Render 按钮时，Bakery 会首先尝试使用 Enlighten 烘焙以计算实时 GI。之后，将进行常规的 Bakery 光照贴图烘焙过程。烘焙 GI 和实时 GI 将协同工作。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bake on remote server ===&lt;br /&gt;
启用网络烘焙（[[Network baking|Network baking]]）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Presets ===&lt;br /&gt;
当前在 Experimental 模式下的 Render/Update 按钮下显示。&lt;br /&gt;
&lt;br /&gt;
* 点击 '''New''' 将所有当前设置保存到预设文件中。&lt;br /&gt;
* 默认情况下，当一个预设处于激活状态时，所有设置都会被灰显，以防止覆盖预设。&lt;br /&gt;
* 点击 '''Modify preset''' 可更改设置并覆盖预设。&lt;br /&gt;
* 可以通过预设字段切换预设。将其设置为 None 可禁用预设使用。&lt;br /&gt;
&lt;br /&gt;
== 组件 ==&lt;br /&gt;
=== Bakery Lightmap Group Selector ===&lt;br /&gt;
指定对象及其所有子对象使用的 '''Lightmap Group'''。&lt;br /&gt;
Lightmap Group 是 Bakery 用来表示共享同一光照贴图的对象集合的术语。每个组都有属性，告诉 Bakery 如何打包对象、哪些光源影响它们，以及结果是烘焙到纹理还是顶点。&lt;br /&gt;
&lt;br /&gt;
默认情况下，所有静态对象会自动打包到多个光照贴图组（贴图集）中，因此通常无需手动管理。手动定义组仅用于特殊用途，例如：&lt;br /&gt;
&lt;br /&gt;
* 指定某些对象使用 [[Vertex Lightmaps|每顶点光照贴图]] 而非纹理。&lt;br /&gt;
* 使用建模软件中的原始未缩放 UV 烘焙光照贴图。&lt;br /&gt;
* 将关卡的特定区域分组以使用单张光照贴图，从而便于资源流式加载或通过脚本在运行时切换不同的烘焙光照。&lt;br /&gt;
* 使用 Render Selected Groups 按钮仅更新已分组的对象。&lt;br /&gt;
&lt;br /&gt;
要手动定义组，可以创建 '''Lightmap Group Assets'''，方法包括使用 Assets-&amp;gt;Create 菜单，或在组件中使用 Create New 按钮。使用 Create New 按钮时，将根据以下表单创建新的资源：&lt;br /&gt;
&lt;br /&gt;
* Name：要创建的 Lightmap Group 资源的名称。&lt;br /&gt;
* Packing Mode：此选择器定义 Lightmap Group 的打包模式，共有 3 种模式：&lt;br /&gt;
** Original UV：对象及其子对象将使用未修改的 UV 进行烘焙，不执行打包。适用于多个网格共享同一已打包 UV 布局的模型。&lt;br /&gt;
** Pack Atlas：对象及其子对象将打包到专用纹理贴图集中。在 v1.3 之前，每个可打包的子对象都需要有此组件，但现在不再需要。每个子对象将作为单独矩形打包，除非 Bakery 自动检测到子对象有非重叠的子对象，在这种情况下，多个对象可以使用同一个矩形。&lt;br /&gt;
** Vertex：对象及其子对象将使用顶点色烘焙光照而非纹理。注意，需要使用自定义着色器才能生效，例如 [[#Bakery_shaders|Bakery Shader]]。文档中也提供了一个简单的着色器（“Bakery/Simple Vertex Lightmapped”）用于演示和参考。[[Vertex Lightmaps|了解更多关于顶点光照贴图的信息]]。&lt;br /&gt;
* Directional mode：允许你覆盖该组的 [[#Directional mode|directional mode]]。选项与全局相同，Auto 将使用全局设置。&lt;br /&gt;
* Resolution：所需的光照贴图分辨率。&lt;br /&gt;
* Auto-resolution：使用 [[使用手册#Texels_per_unit|Texels Per Unit]] 来确定最接近的二次幂分辨率。&lt;br /&gt;
* Atlas packer：为该组选择 [[使用手册#Atlas_Packer|贴图集打包]] 算法。&lt;br /&gt;
* Bitmask：用于排除光源影响光照贴图的开关列表。每个 Bakery 光源也有一个位掩码设置。光源只会影响与其共享至少一个开关的 Lightmap Group。默认设置意味着所有光源影响所有光照贴图。&lt;br /&gt;
&lt;br /&gt;
[[File:Ts.jpg|thumb|Transparent selfshadow关闭 vs 开启：注意一些单面但背向的多边形如何被正确照亮。]]&lt;br /&gt;
&lt;br /&gt;
如果你有一个被分配了“Pack Atlas”模式的 Lightmap Group，组件上将会出现额外设置：&lt;br /&gt;
&lt;br /&gt;
* Override resolution：覆盖该对象及其子对象在光照贴图中占用的分辨率。&lt;br /&gt;
* Resolution：手动定义的分辨率。例如，如果你有一个分辨率为 512 的光照贴图，并且分配给 4 个对象，同时覆盖分辨率设置为 256，Bakery 将生成一个 512x512 的光照贴图，每个对象正好占据 256x256 的区域。&lt;br /&gt;
&lt;br /&gt;
如果你选择一个 Lightmap Group 资产，将会显示额外的实验性设置：&lt;br /&gt;
* [[Subsurface scattering|Subsurface scattering: (点击阅读更多)]]&lt;br /&gt;
* Normal offset：允许你将光线从表面偏移。这很少有用，主要用于实验目的。&lt;br /&gt;
* Transparent selfshadow：从表面后方发射光线，使其不会在自身投射阴影。对于半透明叶片可能有用。&lt;br /&gt;
* Vertex sampling density，(仅当 Packing Mode 设置为 Vertex 时可用）：默认情况下，每个顶点只计算一个值；如果采样密度 &amp;gt; 0，则会在三角形上分散采样并求平均，从而生成超采样、更平滑的结果。&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Lightmapped Prefab ===&lt;br /&gt;
此组件允许预制件存储光照贴图元数据。这样处理后的预制件可以在任意场景中实例化，无论是在编辑器中还是运行时。&lt;br /&gt;
该组件应直接添加到预制件的根对象上。不支持嵌套预制件。由于预制件在烘焙后会被覆盖（类似于按下“Apply”按钮的效果），因此要求预制件没有任何未应用的更改（子对象不应移动，材质和脚本参数应保持不变等）。如果检测到此类更改，组件界面会显示错误，烘焙后不会保存任何元数据。如果启用了 [[#Warnings|Lightmapped prefab validation]] 警告，所有预制件错误也会在烘焙前以对话框形式显示。&lt;br /&gt;
&lt;br /&gt;
光照贴图预制件支持所有 Bakery 功能，例如 LOD、地形、方向光贴图、RNM、SH、顶点模式和 Shadowmask。要使 Shadowmask 生效，光源也必须是同一预制件的一部分。&lt;br /&gt;
&lt;br /&gt;
{{note| 注意，由于 API 限制，预制件 Shadowmask 仅在 Unity 2017.4 或更高版本中可用。}}&lt;br /&gt;
&lt;br /&gt;
烘焙后，一个名为 “BakeryPrefabLightmapData” 的对象会被添加到预制件中。该对象包含一个脚本，存储应用光照贴图所需的所有数据。&lt;br /&gt;
&lt;br /&gt;
此外，光照贴图预制件允许保存当前渲染设置，并使用两个按钮将其加载回任意已打开的场景：&lt;br /&gt;
&lt;br /&gt;
* Save current render settings to prefab：在该预制件上存储当前渲染设置的副本。&lt;br /&gt;
* Load render settings from prefab：将当前渲染设置设置为预制件中存储的设置。&lt;br /&gt;
  [[File:Upload 2019-9-17 10-32-34.png|thumb|应用预制件]]&lt;br /&gt;
&lt;br /&gt;
烘焙光照贴图预制件时，建议检查：&lt;br /&gt;
&lt;br /&gt;
* 预制件已“应用”。在旧版 Unity 中，点击 Inspector 右上角的 “Apply” 按钮。在新版 Unity 中，点击 “Overrides” 列表，然后选择 “Apply All”。&lt;br /&gt;
* 预制件组件 UI 不显示任何错误。&lt;br /&gt;
* [推荐] 在主窗口启用 “Lightmapped prefab validation” 复选框。点击 Render 时不会显示任何关于预制件的警告对话框。&lt;br /&gt;
&lt;br /&gt;
{{note| 光照贴图以其烘焙所在的场景或所使用的 Lightmap Group 命名（如果有）。在同一场景中烘焙不同预制件时，请确保使用不同命名的 [[使用手册#Bakery_Lightmap_Group_Selector|Lightmap Group]] 或更改 [[使用手册#Output_path|输出路径]]。}}&lt;br /&gt;
&lt;br /&gt;
{{note| 当使用相同模型逐个烘焙多个预制件时，建议将 [[使用手册#Asset_UV_Processing|Asset UV Processing]] 设置为“Don't Change”，以防止修改共享模型的 UV。}}&lt;br /&gt;
&lt;br /&gt;
{{note| Bakery 的预制件工作流程是在 Unity 提供“预制件双击进入视图”功能之前实现的。因此，在隔离预制件视图中光照贴图可能无法正确应用，组件可能显示 “This GameObject is not a prefab” 信息。但在普通场景中使用时应能正常工作。}}&lt;br /&gt;
&lt;br /&gt;
{{note| 当解包已烘焙的预制件并取消与现有光照贴图的关联时，请确保删除保存预制件范围光照贴图/渲染器连接的 BakeryPrefabLightmapData 对象。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Direct Light ===&lt;br /&gt;
[[File:Directlight.jpg|thumb|纯直射光 + GI]]&lt;br /&gt;
[[File:Image4.png|thumb|左：“Shadow Spread” = 0.01，右：0.05。注意阴影从锐利逐渐变模糊的效果。]]&lt;br /&gt;
无限远方向光（例如太阳）。&lt;br /&gt;
&lt;br /&gt;
* Color：光的颜色。&lt;br /&gt;
* Intensity：线性色彩乘数。&lt;br /&gt;
* Shadow Spread：光源尺寸，或者简单说，阴影的模糊度。0 = 阴影最锐利，1 = 阴影最模糊。从技术上讲，它在单条光线与更宽光锥之间插值。&lt;br /&gt;
* Shadow Samples：影响阴影质量。Shadow Spread 值越小，所需样本越少即可得到干净图像。太阳阴影的典型值为 1 到 16。设置为 0 时，该光源的阴影将消失。&lt;br /&gt;
* Bitmask：用于排除此光源对特定 Lightmap Groups 影响的开关列表。&lt;br /&gt;
* Baked contribution：确定应烘焙哪类光照数据。仅在 Indirect 或 Shadowmask 模式可见。可选值：&lt;br /&gt;
** Direct and Indirect：直射光与间接光都完全烘焙。&lt;br /&gt;
** Indirect only：实时光提供直射贡献，仅烘焙间接光。&lt;br /&gt;
** Shadowmask and indirect：实时光提供直射贡献，静态几何体的阴影烘焙到单独贴图，动态与静态阴影混合。间接光正常烘焙。&lt;br /&gt;
** Direct, Indirect, Shadowmask（仅自定义光照）：与直射和间接相同，但 Shadowmask 也生成，可与自定义着色器一起使用。&lt;br /&gt;
* Denoise shadowmask：确定是否对该光源的 Shadowmask 应用去噪。通常不需要，因为阴影噪点不明显，但对非常宽且模糊的阴影（大 Shadow Spread）可能有用。&lt;br /&gt;
* Indirect intensity：非物理 GI 乘数。自然光照应为 1，可根据场景风格调整。&lt;br /&gt;
* Anti-alias：对阴影执行超采样。&lt;br /&gt;
* Texture projection：在光照上投射乘法平铺纹理，可用于模拟远处云影。&lt;br /&gt;
当设置了纹理投影时，可以使用“Tiling”和“Offset”字段调整其缩放和偏移。或者，点击 &amp;quot;Tweak projection in Scene View&amp;quot; 并使用额外的 Gizmo 可视化移动和缩放投影。点击“Render reference frame”可保存光源视角的 PNG，这对于在场景上绘制云影很有用。&lt;br /&gt;
&lt;br /&gt;
如果同一对象同时启用了 Unity 和 Bakery 光源且参数不匹配，会出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match lightmapped to real-time：将 Unity 光源的通用设置复制到 Bakery 光源。&lt;br /&gt;
* Match real-time to lightmapped：将 Bakery 光源的通用设置复制到 Unity 光源。&lt;br /&gt;
&lt;br /&gt;
{{note| 从物理角度看，Bakery 的方向光强度（Intensity）等于照度（Lux）除以 π。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Sky Light ===&lt;br /&gt;
[[File:Skylight.jpg|thumb|纯天空光与 GI]]&lt;br /&gt;
无限远的带阴影环境光（天空）。&lt;br /&gt;
&lt;br /&gt;
* Color: 颜色。&lt;br /&gt;
* Intensity: 线性色彩倍增。&lt;br /&gt;
* Sky texture: 可选的立方体贴图资源，例如 HDRI 全景图，用于从不同方向影响光照颜色。&lt;br /&gt;
  {{note| 旋转天空光的 GameObject 会相应旋转立方体贴图的光照。}}&lt;br /&gt;
* Samples: 影响阴影质量。典型值为 8 到 32。&lt;br /&gt;
* Hemispherical: 如果启用，光照仅来自上方（上半球）。否则来自所有方向。&lt;br /&gt;
* Bitmask: 用于排除此光源影响特定 Lightmap Groups 的开关列表。&lt;br /&gt;
* Baked contribution: 决定应烘焙哪种光照数据。仅在 Indirect/Shadowmask 模式下可见。可能值：&lt;br /&gt;
** Direct and Indirect: 直接和间接光照都将完全烘焙。这是默认且推荐的天空光行为，因为在 Unity 中没有实时版本可以模拟它们。&lt;br /&gt;
** Indirect only: 假定实时光源提供直接贡献；仅烘焙间接光照。&lt;br /&gt;
&lt;br /&gt;
如果天空光的设置与当前场景的天空盒不匹配，将出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match this light to scene skybox: 将活动天空盒材质的通用设置复制到 Bakery 天空光。当前仅支持使用 “Skybox/Cubemap” 或 “Skybox/Bakery skybox” 着色器的天空盒。&lt;br /&gt;
* Match scene skybox to this light: 将 Bakery 天空光的通用设置复制到场景天空盒。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bakery Light Mesh ===&lt;br /&gt;
[[File:Image29.png|thumb|Left: Samples Near = 0, Samples Far = 4096.&amp;lt;br&amp;gt;&lt;br /&gt;
Middle: Samples Near = 0, Samples Far = 128.&amp;lt;br&amp;gt;&lt;br /&gt;
Right: Samples Near = 16, Samples Far = 128.&amp;lt;br&amp;gt;&lt;br /&gt;
请注意，光照效果看起来相似，但使用的合并采样数量更少。]]&lt;br /&gt;
任何形状的自发光网格。应与 Mesh Renderer 组件或设置为 Area 模式的 Light 组件一起使用。&lt;br /&gt;
&lt;br /&gt;
* Color：颜色&lt;br /&gt;
* Intensity：线性颜色倍增器&lt;br /&gt;
* Cutoff：最大光照距离。Bakery 会在接近该限制时额外衰减正确的平方反比衰减。当 Cutoff 值刚好对应物理衰减变得非常暗的位置时效果最佳。Cutoff 可提升烘焙性能，也可以设置为非常高（不可达）的值以保证完全正确性。&lt;br /&gt;
* Self Shadow：决定光源网格自身是否投射阴影。此选项同时启用更精确的光照算法。&lt;br /&gt;
* Samples Near：影响靠近网格的光照质量。典型值为 16 到 64，仅当 Self Shadow 开启时可用。&lt;br /&gt;
* Samples Far：影响远离网格的光照质量。典型值为 4 到 4096。&lt;br /&gt;
&lt;br /&gt;
Bakery 基于光源表面距离混合两种不同的区域光算法。靠近光源时，算法类似 GI，而远处光源被近似为虚拟点光云。&lt;br /&gt;
&lt;br /&gt;
{{note| &amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;光源网格自身不会接收光照，也不会被烘焙到光照贴图中。&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;一个拥有大量多边形的光源网格比烘焙多个简单的光源网格要快&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;如果结果总是脏/噪点较多，可以尝试将 Samples Near 设置为 0，这样只使用 VPL 算法。对于不需要精度的简单光源（如建筑物的窗户光），这也非常有用。&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;}}  &lt;br /&gt;
[[File:Dd99d-QU0AEKFBK.jpg|thumb|弯曲的光源网格]]  &lt;br /&gt;
* Bitmask：用于排除此光源影响特定 Lightmap Groups 的开关列表。  &lt;br /&gt;
* Baked contribution：决定烘焙哪种类型的光照数据。仅在 Indirect 或 Shadowmask 模式下可见。可能的值：  &lt;br /&gt;
** Direct and Indirect：完全烘焙直接和间接光贡献。这是默认且推荐的光源网格行为，因为 Unity 中没有实时版本可以模拟它们。  &lt;br /&gt;
** Indirect only：实时光源提供直接光贡献，仅烘焙间接光。  &lt;br /&gt;
** Shadowmask and Indirect：实时光源提供直接光贡献，但静态几何体的阴影会烘焙到单独的贴图。动态和静态阴影将混合在一起。间接光照将照常烘焙。目前仅 HDRP（和自定义渲染器）支持混合区域光。  &lt;br /&gt;
** Direct, Indirect, Shadowmask (custom lighting only)：与 Direct and Indirect 相同，但同时生成 Shadowmask 并分配用于自定义着色器。  &lt;br /&gt;
* Indirect intensity：非物理 GI 倍增器。自然光照应设为 1，但可修改以实现更风格化的场景。  &lt;br /&gt;
* Shadowmask with falloff：将完整光衰减烘焙进 Shadowmask（仅对自定义着色器有用）。  &lt;br /&gt;
&lt;br /&gt;
如果网格材质和光源设置不匹配，将出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match light to material：将网格材质或区域光的通用设置复制到 Bakery 光源。&lt;br /&gt;
* Match material to light：将 Bakery 光源的通用设置复制到网格材质或区域光。&lt;br /&gt;
&lt;br /&gt;
==== Light Mesh 与自发光材质的区别 ====&lt;br /&gt;
自发光材质：&lt;br /&gt;
&lt;br /&gt;
* 在 GI 计算中传播光线，因此是“免费的”，无论有多少网格是自发光的。&lt;br /&gt;
* 小而明亮的光可能会产生不准确或有噪点的结果，这取决于 GI 的采样数量。&lt;br /&gt;
* 由于 Bakery 中 GI 的工作方式，它必须占用光照贴图空间，因此可能会浪费空间。同时，这意味着自发光对象需要有效的 UV，并且必须启用“投射阴影”。&lt;br /&gt;
&lt;br /&gt;
Light Mesh：&lt;br /&gt;
&lt;br /&gt;
* 光照会为每个光源单独计算，因此比自发光材质慢。&lt;br /&gt;
* 设计用于为小而明亮的光提供干净的光照效果，即使距离很远也能保持效果。&lt;br /&gt;
* 不占用光照贴图空间。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Point Light ===&lt;br /&gt;
[[File:Image11.png|thumb|左：“Shadow Spread” = 0.5，右：“Shadow Spread” = 1。]]&lt;br /&gt;
点光源，没有面积。尽管在物理上不可能，但在游戏中很有用，并且是匹配 Unity 点光源和聚光灯的唯一方式。&lt;br /&gt;
{{note| 聚光灯只是带有额外投影遮罩的点光源。}}&lt;br /&gt;
&lt;br /&gt;
* Color: 颜色&lt;br /&gt;
* Intensity: 线性色彩倍增&lt;br /&gt;
* Shadow spread: 阴影模糊度。虽然点光源没有面积，但通常希望它仍能产生模糊阴影。为此，阴影被模拟为从球形区域光源投射。此参数定义了虚拟球体的半径，直接影响阴影模糊度。&lt;br /&gt;
* Physical falloff: 如果启用，将使用正确的平方反比衰减，并在边界附近额外衰减。否则将尝试模拟 Unity 的衰减。&lt;br /&gt;
* Falloff min size: 详见 [[Point Light Attenuation]] 部分。&lt;br /&gt;
* Range: 如果物理衰减被禁用，则等于 Unity 的光源范围；如果启用，只会在边缘轻微衰减物理衰减。&lt;br /&gt;
* Samples: 影响阴影质量。典型值为 1 到 512。设置为 0 将使该光源的阴影消失。&lt;br /&gt;
  [[File:Image10.png|thumb|从左到右：Omni，Cookie（默认聚光灯纹理），Cubemap，IES。]]&lt;br /&gt;
* Projection mask: 遮罩/Cookie 类型。选项：&lt;br /&gt;
** Omni: 无遮罩，相当于 Unity 的点光源。&lt;br /&gt;
** Cookie: 纹理投影遮罩。附加选项：&lt;br /&gt;
*** Cookie texture: 2D 纹理资源。Bakery 包含原始 Unity 聚光灯纹理（名为 ftUnitySpotTexture），可用于模拟。&lt;br /&gt;
*** Angle: 纹理投影角度（类似 Unity 聚光灯）。&lt;br /&gt;
*** Correct distortion: 修正宽角下直线可见的 cookie 失真。&lt;br /&gt;
** Cubemap: 立方体贴图投影遮罩。附加选项：&lt;br /&gt;
*** Projected cubemap: 立方体贴图资源。&lt;br /&gt;
** IES: 光照由 IES 文件数据调制。附加选项：&lt;br /&gt;
*** IES file: .ies 扩展名文件。&lt;br /&gt;
* Bitmask: 用于排除该光源影响特定 Lightmap Groups 的开关列表。&lt;br /&gt;
* Baked contribution: 决定应烘焙哪种类型的光照数据。仅在 Indirect 或 Shadowmask 模式下可见。可能值：&lt;br /&gt;
** Direct and Indirect: 直接光和间接光完全烘焙。&lt;br /&gt;
** Indirect only: 实时光提供直接光，仅烘焙间接光。&lt;br /&gt;
** Shadowmask and Indirect: 实时光提供直接光，但静态几何体阴影烘焙到单独贴图中，动态和静态阴影混合，间接光正常烘焙。&lt;br /&gt;
** Direct, Indirect, Shadowmask (custom lighting only): 与 Direct and Indirect 相同，同时生成 Shadowmask 用于自定义着色器。&lt;br /&gt;
* Indirect intensity: 该光的非物理 GI 倍增。自然光应为 1，可根据风格化场景修改。&lt;br /&gt;
* Shadowmask with falloff: 将完整光衰减（除距离外）烘焙到 Shadowmask（仅自定义着色器有用）。&lt;br /&gt;
* Legacy sampling: 使用 Bakery 原始更偏置的阴影采样策略。产生无噪点阴影，但宽半影可能出现条纹。禁用后使用无偏但更有噪点的技术。&lt;br /&gt;
&lt;br /&gt;
如果同一对象同时启用了 Unity 和 Bakery 光源，且设置不匹配，则会出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match lightmapped to real-time: 将 Unity 光的常用设置复制到 Bakery 光。&lt;br /&gt;
* Match real-time to lightmapped: 将 Bakery 光的常用设置复制到 Unity 光。&lt;br /&gt;
&lt;br /&gt;
{{note| 从物理角度来看，Bakery 点光源的“Intensity”为 Candela 除以 Pi。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Volume ===&lt;br /&gt;
[[File:Voldemo notlonely.gif|由 BakeryVolume 照亮的动态门（动态 GIF，由 NOTLonely 制作）]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
体积（Volumes）生成存储每个体素光探针的 3D 纹理（L1 球面调和和阴影贴图），使其成为常规 Unity 光探针的可行替代方案。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Unity Light Probes&lt;br /&gt;
! Unity LPPV&lt;br /&gt;
! Bakery Volumes&lt;br /&gt;
|-&lt;br /&gt;
| 手动放置每个光探针&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 否&lt;br /&gt;
|-&lt;br /&gt;
| 在一个物体上插值多个光探针&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 运行时可移动&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 可以放入预制件&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 完整脚本 API&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| “Ringing” 伪影&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 可能出现&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 可能出现&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 已修正&lt;br /&gt;
|-&lt;br /&gt;
| 去噪&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 运行时开销&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | CPU：低开销；GPU：低开销&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | CPU：中等开销；GPU：中等开销&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#e4ead3;&amp;quot; | CPU：无开销；GPU：中等开销&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bakery Volume 是一个与一组 3D 纹理（3 个 SH 纹理和一个可选的 shadowmask）关联的边界盒，使其非常易于使用和编程。Volumes 可以在运行时轻松地交换、移动、加载或卸载，也可以与预制件关联。它们不需要任何 Light Probe Groups 或手动探针布置；整个 Volume 都由均匀的探针体素网格填充。光/影泄漏会自动像处理光照贴图一样修复（尽管对于较大的体素尺寸，薄的双面墙可能会出现问题，但可以通过在不同侧使用不同 Volume 避免）。由于体素网格的均匀特性，也可以对其应用类似光照贴图的降噪，这是常规光探针无法做到的。此外，Bakery 着色器使用 [https://drive.google.com/file/d/1MK6Clw93q8ljijRjb4gQOzzaIjn1uF9Y/view Geomerics] 采样技巧，完全消除了高对比度 HDR 光照下 SH 有时会产生的 “ringing” 伪影。&lt;br /&gt;
&lt;br /&gt;
因此，Volumes 可以为动态物体生成干净、精细、高质量的烘焙光照（即来自静态物体并影响动态物体的光照，而不是相反）。&lt;br /&gt;
&lt;br /&gt;
Volume 方法的唯一缺点是每像素着色开销较高。其开销类似于 LPPV（随着屏幕上受体素影响的像素数量而缩放），但与 LPPV 不同的是，一旦烘焙完成，Volumes 本身不会再更新。多个 Volume 的混合可以通过稍微重叠它们来避免。&lt;br /&gt;
&lt;br /&gt;
====设置 Volume 变换====&lt;br /&gt;
[[File:Bvolgizmo.jpg|thumb|Volume 控制柄]]&lt;br /&gt;
当 BakeryVolume 被添加到一个 GameObject 时，场景视图中会出现一个边界盒控制柄。拖动小方块即可缩放它。&lt;br /&gt;
&lt;br /&gt;
还有其他方法可以更改 Volume 的大小和位置：&lt;br /&gt;
&lt;br /&gt;
* 将任何可渲染的 GameObject 拖入 “Wrap to object” 字段。Volume 会包裹该对象（及其子对象），以将它们完全包含在内。&lt;br /&gt;
* 如果同一个对象上添加了 Box Collider，则会出现 “Set from box collider” 和 “Set to box collider” 按钮。可以用它们快速在 Volume 和 Collider 之间复制数值。&lt;br /&gt;
&lt;br /&gt;
====分辨率====&lt;br /&gt;
当启用 “Adaptive resolution” 时，体素数量由 “Voxels per unit” 控制。禁用它可以手动输入分辨率。对于大多数 1 单位 = 1 米 的游戏来说，一个合理的 “Voxels per unit” 值是 2，但在某些情况下（例如动态门）使用较小但更高分辨率的 Volume 会更有利。&lt;br /&gt;
&lt;br /&gt;
====其他设置====&lt;br /&gt;
&lt;br /&gt;
* Enable baking: 是否需要（重新）计算 Volume？禁用可防止覆盖已有数据。&lt;br /&gt;
* Denoise: 在烘焙 Volume 后应用去噪。推荐用于高分辨率 Volume。避免用于覆盖许多光源的低分辨率 Volume，因为去噪器难以区分实际内容和噪声。&lt;br /&gt;
* Global: 自动将此 Volume 分配给所有兼容 Volume 的 Shader，除非它们有覆盖设置。内部会调用 Shader.SetGlobalTexture()/SetGlobalVector()。&lt;br /&gt;
====使用方法====&lt;br /&gt;
Volumes 可以分配给使用 Volume 感知 Shader 的对象。Bakery 自带实现该功能的 “Bakery Standard” Shader，以及 HDRP 和 URP 的 Shader 图。请查看 example_volumes 场景，了解应用 Volume 的各种方式。&lt;br /&gt;
&lt;br /&gt;
====提示====&lt;br /&gt;
&lt;br /&gt;
* 确保查看示例。&lt;br /&gt;
* 如果两个 Volume 相连，让它们略微重叠。重叠大小应等于最大动态对象的尺寸。这样在运行时简单切换 Volume 就能正常工作。&lt;br /&gt;
* 仅在动态对象实际可达的区域放置 Volume。例如，使用玩家高度限制 Volume 的高度。&lt;br /&gt;
&lt;br /&gt;
====旋转 Volumes====&lt;br /&gt;
如果启用 “Rotate around Y” 选项，Volumes 可以绕 Y 轴旋转。旋转开销非常低，只使用 2 个额外的浮点数据（预计算的角度 sin/cos）。&lt;br /&gt;
&lt;br /&gt;
还可以在运行时旋转 Volumes（Experimental -&amp;gt; “Support rotation after bake” 以及 Bakery Shader 中的类似选项），这种情况下 Volume 必须在初始旋转为零时进行烘焙。&lt;br /&gt;
&lt;br /&gt;
在 URP 中，这种动态旋转可以与 `BakeryURPVolumeGraphRotatable.shadergraph` 一起使用。&lt;br /&gt;
&lt;br /&gt;
对于全局 Volume，动态旋转会在组件被（重新）启用或调用 `volume.SetGlobalParams()` 时更新。使用局部旋转 Volume 时，需要手动在材质或 MaterialPropertyBlock 上设置旋转：&lt;br /&gt;
{{code|&amp;lt;nowiki&amp;gt;SetMatrix(&amp;quot;_VolumeMatrix&amp;quot;, volume.GetMatrix())&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
====技术信息====&lt;br /&gt;
Volumes 可以自动工作（查看示例场景），也可以通过脚本控制其使用方式。&lt;br /&gt;
&lt;br /&gt;
可以通过组件的以下公共属性获取 Volume 数据：&lt;br /&gt;
&lt;br /&gt;
* `bakedTexture0`：存储 L0 RGB 系数和 L1 Z 红色通道在 alpha 中。&lt;br /&gt;
* `bakedTexture1`：存储 L1 X RGB 系数和 L1 Z 绿色通道在 alpha 中。&lt;br /&gt;
* `bakedTexture2`：存储 L1 Y RGB 系数和 L1 Z 蓝色通道在 alpha 中。&lt;br /&gt;
* `bakedMask`：存储体积阴影遮罩。&lt;br /&gt;
* `bounds`：Volume 的包围盒。&lt;br /&gt;
&lt;br /&gt;
所有 `bakedTexture*` 使用 RGBAHalf（每体素 8 字节）格式，mask 使用 ARGB32（每体素 4 字节）。阴影遮罩也可以使用单通道 R8 格式（每体素 1 字节）。&lt;br /&gt;
&lt;br /&gt;
因此 Volume 的字节大小 = width * height * depth * 3 * 8 + （仅当使用阴影遮罩时）width * height * depth * 4（或使用 R8 mask 时为 width * height * depth）。&lt;br /&gt;
&lt;br /&gt;
[[使用手册#Compress_volumes|可以对 Volume 启用纹理压缩]]，使其体积显著减小。&lt;br /&gt;
&lt;br /&gt;
采样 Volume 需要特殊 Shader，这些 Shader 已包含在 Bakery 中。要在自定义 Shader 中添加 Volumes，请查看 HDRP/URP 包中包含的 `BakeryVolume_float()` 函数（位于 `BakeryDecodeLightmap.hlsl`）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Light Filter ===&lt;br /&gt;
[[File:Output optimized.gif|彩色玻璃，如在 &amp;quot;Bakery Real-Time Preview&amp;quot; 中所见。Bakery lightmapper 烘焙出的结果相同。]]&lt;br /&gt;
&lt;br /&gt;
将渲染器标记为光过滤器（Light Filter）。过滤器会用其颜色着色所有直接和间接光线，类似于现实中的光学滤镜，从而实现彩色透明效果（例如彩色玻璃）。唯一的参数是用于着色的纹理。&lt;br /&gt;
&lt;br /&gt;
* 光过滤器对象仍然会像其他对象一样接收光照贴图。&lt;br /&gt;
* 过滤器不会散射或模糊光线（如需此效果，请尝试 [[Subsurface_scattering|Subsurface Scattering]] 或 [[使用手册#Backface_GI|Backface GI]]）。&lt;br /&gt;
* 过滤器可以产生带颜色的阴影。如果灯光使用 [[使用手册#Shadowmask|Shadowmask]] 模式，则结果只会保存 R 通道（因为 Unity 仅支持单通道遮罩）。对于完全烘焙的阴影，则没有限制。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Sector ===&lt;br /&gt;
参见 '''[[Partial_scene_baking|Partial scene baking]]'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Always Render ===&lt;br /&gt;
如果添加到一个物体上，Bakery 在烘焙时将始终考虑该物体，即使它的 Renderer 被禁用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
=== Bakery Pack As Single Square ===&lt;br /&gt;
如果添加到一个物体上，Bakery 会将该物体及其子物体的 UV 视为单个组合方块，在自动图集打包或 Lightmap Group 的 Pack Atlas 模式下，它们之间永远不会被移动。整个子层级将作为一个整体打包。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
=== Bakery Shared LOD UV ===&lt;br /&gt;
如果添加到一个 LODGroup 上，将标记所有同名 LOD 共享同一个光照贴图。默认情况下，每个 LOD 网格会获得独立的光照贴图，占用图集空间；但如果已知同一个物体的 LOD 拥有相似的 UV2（或者在没有 UV2 且 UV1 不重叠的情况下），它们可以映射到图集的同一部分，从而节省内存。&lt;br /&gt;
这种技术也称为 [https://github.com/laurenth-personal/LODLightmapScripts/ Lightmap Stealing]。&lt;br /&gt;
&lt;br /&gt;
= 材质兼容性 =&lt;br /&gt;
&lt;br /&gt;
=== 漫反射和发光 ===&lt;br /&gt;
Bakery 利用 [https://docs.unity3d.com/Manual/MetaPass.html Meta Pass] 系统支持大多数 Unity 材质。所有内置、Surface、URP 和 HDRP 着色器都已经定义了正确的 Meta Pass。&lt;br /&gt;
&lt;br /&gt;
如果你使用的是 Unlit 着色器，需要按照 Unity 文档手动添加 Meta Pass。&lt;br /&gt;
&lt;br /&gt;
如果未定义该 Pass，Bakery 将假定 {{codeVar|_MainTex}}、{{codeVar|_BaseColorMap}} 或 {{codeVar|_Color}}（如果未设置纹理）为材质的漫反射（Albedo），并将 {{codeVar|_EmissionMap}} 和 {{codeVar|_EmissionColor}} 作为发光颜色。&lt;br /&gt;
&lt;br /&gt;
为了使发光生效，[https://docs.unity3d.com/ScriptReference/Material-globalIlluminationFlags.html Material.globalIlluminationFlags] 必须设置为 [https://docs.unity3d.com/ScriptReference/MaterialGlobalIlluminationFlags.BakedEmissive.html MaterialGlobalIlluminationFlags.BakedEmissive]。标准着色器会自动设置此值。&lt;br /&gt;
&lt;br /&gt;
=== 不透明度 ===&lt;br /&gt;
[[File:Upload 2019-1-25 0-4-30.png|thumb|材质参数被转换为 Cutout（默认）]]&lt;br /&gt;
[[File:Alphacombos dither.jpg|thumb|通过“Dither Transparency”选项添加半透明值]]&lt;br /&gt;
[[File:Alphacombos filter.jpg|thumb|Light Filter 组件用于红色平面，生成彩色阴影]]&lt;br /&gt;
&lt;br /&gt;
默认情况下，Bakery 始终从 {{codeVar|_MainTex}}、{{codeVar|_BaseColorMap}} 或 {{codeVar|_BaseMap}} 的 alpha 值获取全分辨率的不透明度，并将其视为 Cutout（1 位透明）。&lt;br /&gt;
&lt;br /&gt;
当启用 '''Dither Transparency''' 选项时，半透明值会自动转换为可变蓝噪声，然后被滤波/模糊，产生部分透明效果（以前可以通过自定义手动抖动贴图实现，但从 v1.97 起自动完成）。&lt;br /&gt;
&lt;br /&gt;
为了使不透明度生效，着色器的 [https://docs.unity3d.com/Manual/SL-SubShaderTags.html RenderType 标签] 必须为以下值之一：&lt;br /&gt;
&lt;br /&gt;
* {{codeVar|Transparent}}&lt;br /&gt;
* {{codeVar|TransparentCutout}}&lt;br /&gt;
* {{codeVar|TreeLeaf}}&lt;br /&gt;
&lt;br /&gt;
如果存在名为 {{codeVar|_Cutoff}} 的属性，它将影响 Cutout（因此 Standard 着色器的 Cutoff 滑块会自动生效）。&lt;br /&gt;
&lt;br /&gt;
在没有 Dither Transparency 的情况下，如果材质 RenderType 为 {{codeVar|Transparent}} 或 {{codeVar|TreeLeaf}}，则 {{codeVar|_Color}} 的 alpha 值会额外修改 Cutoff：&lt;br /&gt;
''finalCutoff = 1 - (1 - cutoff) * alpha''&lt;br /&gt;
&lt;br /&gt;
对于彩色透明效果，请使用 [[Manual#Bakery_Light_Filter|Light Filter]] 组件。&lt;br /&gt;
&lt;br /&gt;
有关漫反射半透明效果，请参考 [[#Backface GI|Backface GI]] 和 [[subsurface scattering]]。&lt;br /&gt;
&lt;br /&gt;
==== Alpha Meta Pass ====&lt;br /&gt;
从 v1.9 起，Bakery 还支持指定基于自定义着色器的透明度，但这需要使用兼容的着色器。要使用 ''Alpha Meta Pass''，需要执行以下步骤：&lt;br /&gt;
&lt;br /&gt;
* 在着色器中添加一个名为 '''BAKERY_META_ALPHA_ENABLE''' 的属性。例如：&lt;br /&gt;
  {{code|&amp;lt;nowiki&amp;gt;[HideInInspector] BAKERY_META_ALPHA_ENABLE (&amp;quot;Enable Bakery alpha meta pass&amp;quot;, Float) = 1.0&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
* 确保 RenderType 标签设置为上文提到的某个值。&lt;br /&gt;
* 声明一个名为 '''META_BAKERY''' 的 Pass。&lt;br /&gt;
* 在该 Pass 中检查 '''unity_MetaFragmentControl.w''' 是否非零，如果是，则返回计算出的透明度值。&lt;br /&gt;
&lt;br /&gt;
示例可参考包内的 ''Baked_Alpha_meta.shader''。&lt;br /&gt;
&lt;br /&gt;
注意：当前 Alpha Meta Pass 需要将 Light Probe Mode 设置为 L1 或 L2。&lt;br /&gt;
&lt;br /&gt;
=== Normal mapping ===&lt;br /&gt;
自定义表面法线可以与 [[#Baked Normal Maps|烘焙法线贴图]] 模式一起使用。不幸的是，Unity 的 Meta Pass 默认不输出法线信息，因此默认情况下，法线取自名为 {{codeVar|_BumpMap}} 的贴图，并通过 {{codeVar|_MainTex_ST}} 进行额外变换。&lt;br /&gt;
&lt;br /&gt;
然而，可以制作完全自定义的着色器，带有高级法线映射功能（例如混合多层法线），并使其兼容烘焙。要实现这一点，需要执行以下步骤：&lt;br /&gt;
&lt;br /&gt;
1. 在着色器中定义一个 Meta Pass，具体方法请参考 [https://docs.unity3d.com/Manual/MetaPass.html#ExampleMetaPassUnity 文档]。&lt;br /&gt;
&lt;br /&gt;
2. 将该 Pass 命名为 {{codeVar|&amp;quot;META_BAKERY&amp;quot;}}，而不仅仅是 {{codeVar|&amp;quot;META&amp;quot;}}。&lt;br /&gt;
&lt;br /&gt;
3. 包含文件 {{codeVar|&amp;quot;BakeryMetaPass.cginc&amp;quot;}}。&lt;br /&gt;
&lt;br /&gt;
4. 添加 {{codeVar|#pragma vertex vert_bakerymt}}。&lt;br /&gt;
&lt;br /&gt;
5. 如果 {{codeVar|unity_MetaFragmentControl.z}} 变量不为 0，着色器应返回世界空间法线。返回的法线应使用 {{codeVar|BakeryEncodeNormal}} 函数编码。&lt;br /&gt;
&lt;br /&gt;
在 Assets/Bakery/examples/shaders 中包含了两个实现了扩展 Meta Pass 的示例着色器。&lt;br /&gt;
&lt;br /&gt;
你也可以复制并修改 BakeryMetaPass.cginc 以满足你的需求，例如从顶点着色器传递额外数据。&lt;br /&gt;
&lt;br /&gt;
=== 正/背面 ===&lt;br /&gt;
无论着色器使用何种剔除模式，Bakery 都将所有背面视为不透明，这意味着任何直接光线都不会穿过背面，就像它不会穿过正面一样。&lt;br /&gt;
然而，如果使用 [[使用手册#Backface_GI|Backface GI]]，背面可以部分发出正面接收到的光照。&lt;br /&gt;
&lt;br /&gt;
= 扩展 Lightmap Parameters 资源 =&lt;br /&gt;
[[File:Lp.jpg|thumb|扩展 Lightmap Parameters]]&lt;br /&gt;
类似于 Bakery 的 [[#Bakery_Lightmap_Group_Selector|Lightmap Group]]，Unity 也有 [https://docs.unity3d.com/Manual/class-LightmapParameters.html Lightmap Parameters]，可以作为资源创建并分配给 Mesh Renderer。它们的逻辑有相似之处也有不同之处：&lt;br /&gt;
&lt;br /&gt;
* Lightmap Group 的主要用途是将多个对象组合到同一个图集。此外，它还允许覆盖该图集的烘焙设置。&lt;br /&gt;
* Lightmap Parameters 主要用于覆盖对象的烘焙设置，但通过使用“Baked Tag”选项，它们也可以影响打包：具有不同 Baked Tag 的对象将永远不会共享同一个图集。&lt;br /&gt;
&lt;br /&gt;
由于有些用户更习惯 Lightmap Parameters 的工作流程，Bakery 现在支持并扩展了它们：&lt;br /&gt;
&lt;br /&gt;
* Bakery 会遵循 Baked Tag 设置。&lt;br /&gt;
* Lightmap Parameters UI 中将显示额外的 Bakery 特定选项。有关其含义，请参考 [[#Bakery_Lightmap_Group_Selector|Lightmap Group]] 部分。&lt;br /&gt;
&lt;br /&gt;
= 项目设置 =&lt;br /&gt;
一些全局设置可以在 Project Settings -&amp;gt; Bakery GPU Lightmapper 中调整（此选项仅在 Unity 2018.3 或更新版本可见；旧版本请编辑 BakeryProjectSettings.asset）：&lt;br /&gt;
&lt;br /&gt;
* Mipmap lightmaps：启用光照贴图的 mipmap。随着图集变小，可能会导致 UV 图块之间的泄漏；另一方面，它可以减少远处高分辨率光照贴图的锯齿。总体上，建议对非常远的物体使用单独烘焙的 LOD 以及较低分辨率的光照贴图。&lt;br /&gt;
* Color file format：常规 HDR 颜色光照贴图的文件格式。可选值：&lt;br /&gt;
**HDR：Radiance HDR 格式（默认）。可用多种图像编辑器打开。&lt;br /&gt;
**Asset：Unity 原生格式。可自定义 mipmap 数量。&lt;br /&gt;
* Mask/Direction file format：额外 LDR 地图的格式，如阴影遮罩或方向数据。可选值：&lt;br /&gt;
**TGA：8 位 Targa（默认）。&lt;br /&gt;
**PNG：8 位 PNG。通常比 TGA 占用更少磁盘空间。&lt;br /&gt;
**Asset：Unity 原生格式。可自定义 mipmap 数量。&lt;br /&gt;
* Compress lightmaps：定义光照贴图资源的压缩行为。压缩光照贴图占用更少的显存，但可能会出现一些视觉伪影（例如色带或色斑），具体取决于压缩类型（移动端压缩问题请参见[[Troubleshooting#I_have_an_Android_project.2C_and_lightmaps_don.27t_look_good|此处]]）。可选值：&lt;br /&gt;
*** Compress but allow overriding asset: 新的光照贴图将在启用压缩的情况下创建。创建后，可以在 Inspector 中更改它们的压缩设置。修改后的值将在重新烘焙后保留（默认）。&lt;br /&gt;
*** Force compress: 始终压缩所有光照贴图。&lt;br /&gt;
*** Force no compress: 始终生成未压缩的光照贴图。&lt;br /&gt;
* High quality direction: 为方向贴图启用“高”质量压缩。实际格式取决于平台。例如在 PC 上，它会从 DXT1 改为 BC7，这提供了更高的质量，但 VRAM 使用量会翻倍。&lt;br /&gt;
* Texel padding (default atlas packer): 定义在使用默认 atlas 打包器时，在光照贴图 atlas 中对象 UV 布局之间添加多少空白 texel。&lt;br /&gt;
* Texel padding (xatlas packer): 同上，但在使用 xatlas 时。&lt;br /&gt;
* Alpha Meta Pass resolution multiplier: 乘以 [[Manual#Alpha_Meta_Pass|Alpha Meta Pass]] 的分辨率，使在低分辨率光照贴图烘焙时仍能实现精确的基于 Shader 的切割效果。&lt;br /&gt;
* Volume render mode: 为所有 [[Manual#Bakery_Volume|Volumes]] 使用哪种 [[Manual#Render_mode|渲染模式]]？Auto 使用当前活动的渲染模式（默认）。&lt;br /&gt;
* Delete previous lightmaps before bake: 在烘焙新光照贴图之前，实际删除该场景中所有之前渲染的光照贴图文件。&lt;br /&gt;
* Log level: 定义烘焙过程中在控制台输出的信息量。可能的值：&lt;br /&gt;
** 0: 不输出任何内容。&lt;br /&gt;
** 1: 仅输出进度信息。&lt;br /&gt;
** 2: 仅输出警告。&lt;br /&gt;
** 3: 输出全部信息。&lt;br /&gt;
* Alternative scale in lightmap: 使渲染器属性 'Scale in Lightmap' 的行为更类似于 Unity 内置的行为。&lt;br /&gt;
* Align to texture compression blocks with xatlas: 使 xatlas 将 chart 对齐到 4x4 块边界，从而获得更适合压缩的结果。&lt;br /&gt;
* Generate smooth positions: 是否应调整采样位置以防止低多边形几何体在平滑法线下产生错误阴影？在使用法线差异极大的几何体时，可在极少数情况下禁用。技术说明见 [https://ndotl.wordpress.com/2018/08/29/baking-artifact-free-lightmaps/#shadowterm 这篇文章]。&lt;br /&gt;
* Smooth positions per-triangle: 是否应按三角形决定平滑/平面位置？在使用法线差异极大的几何体时，可在极少数情况下禁用。&lt;br /&gt;
* Use 'Receive GI' values: 在渲染器上考虑 “Receive Global Illumination” 值。最初 Bakery 会忽略它。&lt;br /&gt;
* Remove ringing in Legacy light probes: 在 Legacy 模式下启用更柔和的光探针卷积，以防止高对比度区域出现伪影。&lt;br /&gt;
* Always render reflection probes: 在每次 Render/Render Light Probes 后自动渲染反射探针。&lt;br /&gt;
* Ringing removal for L2 light probes: 对 [[Manual#Light_probe_mode|L2 光探针]] 应用去振铃处理。值越高，探针光照越平滑；这种平滑可以减少 [[https://docs.unity3d.com/6000.2/Documentation/Manual/light-probes-troubleshooting.html](https://docs.unity3d.com/6000.2/Documentation/Manual/light-probes-troubleshooting.html) 振铃] 伪影（如果存在）。&lt;br /&gt;
* Put menu under Tools: 将 Bakery 菜单放入 Tools 菜单下。&lt;br /&gt;
&lt;br /&gt;
如果任何格式设置为 Asset 且启用 mipmapping，会显示额外选项：&lt;br /&gt;
&lt;br /&gt;
* Maximum mipmap count: 定义 mipmap 的最大数量。例如，设置为 2，则 8K 光照贴图仅有两个额外 mipmap：4K 和 2K。更低分辨率将被省略，从而在 mipmapping 过程中限制泄漏伪影。&lt;br /&gt;
&lt;br /&gt;
= SkinnedMeshRenderer 支持 =&lt;br /&gt;
Bakery 自 v1.65 起支持蒙皮网格 (skinned meshes)。但是，有一些限制：&lt;br /&gt;
&lt;br /&gt;
* 某些 Unity 版本不支持蒙皮网格的 UV1，并会悄无声息地忽略 “Generate lightmap UVs”。请确保场景中实际使用的网格具有 UV1，并在可能的情况下使用非重叠的 UV0；&lt;br /&gt;
* UV 填充调整在蒙皮网格上不起作用（Unity 在尝试调用 Unwrap 函数时似乎会崩溃）；&lt;br /&gt;
* 蒙皮网格不能使用每顶点光照贴图 (per-vertex lightmaps)（引擎不支持带蒙皮的 additionalVertexStreams）。&lt;br /&gt;
&lt;br /&gt;
= Shader Tweaks =&lt;br /&gt;
[[File:Image2.jpg|thumb|左：默认双线性过滤。右：双三次过滤。]]&lt;br /&gt;
[[File:Image34.jpg|thumb|左：两个阴影都已烘焙。&amp;lt;br&amp;gt;中：球形阴影为动态，另一个阴影为静态。通过相乘组合在一起。&amp;lt;br&amp;gt;右：与中间相同，但使用默认最小值组合。]]&lt;br /&gt;
&lt;br /&gt;
Bakery 提供可选的着色器修改，可以应用到 Unity 着色器上，以改善光照贴图采样并使实时光照更接近光照贴图效果。着色器调整菜单可以通过 Bakery-&amp;gt;Shader Tweaks 访问。&lt;br /&gt;
&lt;br /&gt;
这些选项会修补基础 Unity 着色器包含文件（来自 CGIncludes 文件夹），这些文件被大多数内置和第三方着色器使用。所有修改都会影响使用该版本编辑器打开的所有项目，但也可以轻松恢复。着色器调整会影响标准和表面着色器的工作方式。HDRP、URP 以及其他 SRP 不受影响。&lt;br /&gt;
&lt;br /&gt;
所有可用修改显示为按钮。点击按钮应用修改，按钮将保持按下状态。再次点击按钮即可移除修改。目前可用选项：&lt;br /&gt;
&lt;br /&gt;
{{note| 可能需要以管理员身份运行 Unity 编辑器以使 CGIncludes 修补生效}}&lt;br /&gt;
&lt;br /&gt;
* Use bicubic interpolation for lightmaps: 光照贴图将使用双三次插值代替默认双线性。此调整能很好地修复低分辨率光照贴图的许多锯齿边缘。目前仅适用于 DX11 和现代主机，其他平台仍使用双线性。&lt;br /&gt;
* Use multiplication for shadowmask: 使用相乘代替最小值组合静态和动态阴影。出于未知原因，Unity 默认使用最小值操作符，这会产生一些乘法不存在的伪影。&lt;br /&gt;
* Use physical light falloff (forward): 用更物理正确的平方反比替换实时点光/聚光灯的默认衰减。“Range” 只会在边缘略微淡出（与 Bakery 光源启用 Physical Falloff 复选框效果一致）。仅影响 Forward 渲染器。详情见 [[Point Light Attenuation]]。&lt;br /&gt;
* Use physical light falloff (deferred): 同上，但仅影响 Deferred 渲染器。&lt;br /&gt;
&lt;br /&gt;
'''衰减调整在 Unity &amp;gt;2017 版本上可能无法完全生效。此外，SRP 默认已经使用正确的衰减。'''&lt;br /&gt;
&lt;br /&gt;
= Bakery shaders =&lt;br /&gt;
Bakery 包含了自带着色器，支持顶点光照贴图，以及 RNM 和 SH 方向模式。它还允许从方向数据计算近似烘焙高光。&lt;br /&gt;
对于普通颜色光照贴图、阴影遮罩和 Dominant Direction 模式，Bakery 着色器 '''不是必需的'''，因为这些功能大多数 Unity 着色器本身已经支持。&lt;br /&gt;
&lt;br /&gt;
=== Standard render pipeline ===&lt;br /&gt;
'''Bakery/Standard''': 扩展了普通 Standard 着色器。额外选项：&lt;br /&gt;
&lt;br /&gt;
* Allow Vertex Lightmaps: 允许该材质用于 [[Vertex Lightmaps|顶点光照贴图]]。&lt;br /&gt;
* Allow RNM Lightmaps: 允许该材质用于 [[#RNM|RNM 方向模式]]。&lt;br /&gt;
* Allow SH Lightmaps: 允许该材质用于 [[#SH|SH 方向模式]]。&lt;br /&gt;
  {{note| 所有 “Allow” 选项会在着色器中启用特定的代码路径。为了性能考虑，建议每个材质仅使用一个 “allow” 选项。}}&lt;br /&gt;
* Enable Lightmap Specular: 使用 Dominant Direction、RNM 或 SH 方向模式的数据计算烘焙高光。注意，由于信息有限，该效果仅为近似。如果你曾在 Unity 4 中使用烘焙高光，效果应可比。与高度扰动的法线贴图搭配效果最佳，在平面表面上效果不佳。&lt;br /&gt;
* Enable VertexLM directional: 如果存在顶点光照贴图，指定 Dominant Direction 数据存储在顶点中并应被使用。&lt;br /&gt;
* Enable VertexLM SH: 如果存在顶点光照贴图，指定 SH 数据存储在顶点中并应被使用。&lt;br /&gt;
* Enable VertexLM Shadowmask: 如果存在顶点光照贴图，指定阴影遮罩存储在顶点中并应被使用。&lt;br /&gt;
* Enable MonoSH: 将方向贴图视为 MonoSH 贴图。&lt;br /&gt;
[[File:Image5.png|thumb|Standard SH light probe vs non-linear]]&lt;br /&gt;
[[File:Shspec.jpg|thumb|SH specular effect]]&lt;br /&gt;
* Non-linear SH：在 SH 方向模式下，此选项可以增强对比度（更接近真实效果），但会使着色器稍微变慢。该技巧基于 Geomerics 的论文《[https://drive.google.com/file/d/1MK6Clw93q8ljijRjb4gQOzzaIjn1uF9Y/view Reconstructing Diffuse Lighting from Spherical Harmonic Data]》。&lt;br /&gt;
* Non-linear Light Probe SH：与 Non-linear SH 类似，但用于光照探针。在探针的情况下，最显著的好处是消除错误的负值。这种问题常见于具有高对比度、明亮 HDR 光源的场景中。这是球谐函数的固有限制，而不是 Bakery 特有的问题（即使用 Unity 内置光照贴图器也可能出现类似伪影）。&lt;br /&gt;
* Force Bicubic Filter：为所有附加贴图启用双三次滤波。若要实现完整的双三次滤波（包括第一张颜色贴图），建议同时在 [[#Shader Tweaks|Shader Tweaks]] 中启用该功能。&lt;br /&gt;
&lt;br /&gt;
'''Bakery/Standard Specular'''：与 Standard 相同，但用于高光（Specular）工作流程。&lt;br /&gt;
&lt;br /&gt;
=== HDRP &amp;amp; URP ===&lt;br /&gt;
要提取额外的 HDRP/URP 着色器，请打开 Bakery 自带的 Bakery_ShaderGraphHDRP.unitypackage 或 Bakery_ShaderGraphURP.unitypackage。&lt;br /&gt;
在其中，你会找到可在自己 Shader Graph 中使用的 Shader Subgraph，以及一些示例材质。&lt;br /&gt;
&lt;br /&gt;
=== 各着色器功能支持对比 ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! 大多数 Unity 着色器&lt;br /&gt;
! 大多数 HDRP 和 URP 着色器&lt;br /&gt;
! Bakery Standard&lt;br /&gt;
! Bakery HDRP graphs&lt;br /&gt;
! Bakery URP graphs&lt;br /&gt;
|-&lt;br /&gt;
| HDR color lightmaps&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Shadowmask&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是 (&amp;gt;= URP 10.1)&lt;br /&gt;
|-&lt;br /&gt;
| Dominant Direction&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| RNM&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| SH&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Mo否SH&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Lightmap specular&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持 Dominant Direction 和 SH&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持 Dominant Direction&lt;br /&gt;
|-&lt;br /&gt;
| Bicubic filtering&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是,&lt;br /&gt;
with [[#Shader Tweaks|Shader Tweaks]]&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是,&lt;br /&gt;
with [[#Shader Tweaks|Shader Tweaks]]&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
|-&lt;br /&gt;
| Vertex lightmaps&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 单一颜色，没有每顶点 SH、方向或阴影遮罩（Shader Graph 限制）&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 单一颜色，没有每顶点 SH、方向或阴影遮罩（Shader Graph 限制）&lt;br /&gt;
|-&lt;br /&gt;
| Non-Linear Light Probes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Volumes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Volume shadowmask&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Compressed volumes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Mr F</name></author>
		
	</entry>
	<entry>
		<id>https://geom.io/bakery/wiki/index.php?title=%E4%BD%BF%E7%94%A8%E6%89%8B%E5%86%8C&amp;diff=1828</id>
		<title>使用手册</title>
		<link rel="alternate" type="text/html" href="https://geom.io/bakery/wiki/index.php?title=%E4%BD%BF%E7%94%A8%E6%89%8B%E5%86%8C&amp;diff=1828"/>
		<updated>2025-11-05T14:28:37Z</updated>

		<summary type="html">&lt;p&gt;Mr F: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== 系统要求 ==&lt;br /&gt;
&lt;br /&gt;
使用 Bakery 需要：&lt;br /&gt;
&lt;br /&gt;
Windows（7 或更高版本）电脑。&lt;br /&gt;
&lt;br /&gt;
Nvidia 显卡。最低支持型号为 Kepler（GeForce 650 或更新型号，Quadro 显卡请查看规格）。&lt;br /&gt;
&lt;br /&gt;
64 位 Unity 编辑器。Bakery 已在 5.6 到 6 及更高版本上测试过，同时也在 Tuanjie 1.6.7 上通过测试。&lt;br /&gt;
&lt;br /&gt;
{{note|系统要求仅适用于开发者的电脑，而非目标平台。使用 Bakery 烘焙的光照贴图可以在任何地方使用。}}&lt;br /&gt;
&lt;br /&gt;
== 前提条件 ==&lt;br /&gt;
* 确保你的项目中没有任何脚本编译错误，否则也会导致 Bakery 的脚本无法编译。&lt;br /&gt;
* 确保你的显卡驱动是最新版本，如有需要请[https://www.nvidia.com/Download/index.aspx?lang=en-US 更新]。&lt;br /&gt;
&lt;br /&gt;
'''请使用 Game-Ready（标准）驱动程序，而不是 “Studio” 驱动。'''&lt;br /&gt;
&lt;br /&gt;
== 安装 ==&lt;br /&gt;
&lt;br /&gt;
1. 通过 [https://assetstore.unity.com/packages/tools/level-design/bakery-gpu-lightmapper-122218 Asset Store] 将 Bakery 导入到你的项目中。&lt;br /&gt;
&lt;br /&gt;
2. Unity 会显示要导入的文件列表。如果这是你第一次使用 Bakery，建议直接 点击 Import（导入）。有经验的用户可以取消选中 examples 文件夹，以进行更轻量的安装。&lt;br /&gt;
&lt;br /&gt;
文件将被导入到 `Assets/Bakery` 和 `Assets/Editor/x64/Bakery` 文件夹中。&lt;br /&gt;
这些文件夹之后可以移动。&lt;br /&gt;
&lt;br /&gt;
3. Unity 随后会导入 Bakery 并编译脚本。此时可能会弹出如下窗口：&lt;br /&gt;
&lt;br /&gt;
[[File:Goahead.png]]&lt;br /&gt;
&lt;br /&gt;
此时你应点击 “Go Ahead”（继续）。&lt;br /&gt;
&lt;br /&gt;
现在你应该能在编辑器中看到新增的 Bakery 菜单：&lt;br /&gt;
&lt;br /&gt;
[[File:bmenu.jpg]]&lt;br /&gt;
&lt;br /&gt;
== 快速开始 ==&lt;br /&gt;
&lt;br /&gt;
1. 添加一些模型或基础体，并将其标记为静态（Static）。&lt;br /&gt;
&lt;br /&gt;
'''用于光照贴图的网格必须具有不重叠的 UV2。如果存在 UV2，则会使用 UV2（否则使用 UV1）。如果你的模型没有为光照贴图进行展开，请在资源中勾选 Generate Lightmap UVs（生成光照贴图 UV）。'''&lt;br /&gt;
Unity 的基础体已经具有正确的 UV2。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Staticmarked.jpg|320px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. 选择方向光（Unity 为你创建的那个），并添加 '''Bakery Direct Light''' 组件。&lt;br /&gt;
   {{note|Bakery 和 Unity 使用独立的光源组件。}}&lt;br /&gt;
&lt;br /&gt;
3. Bakery Direct Light 有许多可调选项，但你可以轻松将其与 Unity 光源匹配。点击 '''Match lightmapped to real-time'''。现在 Bakery 光源的颜色应与 Unity 默认的方向光相同，呈黄色调。&lt;br /&gt;
&lt;br /&gt;
[[File:Matching.jpg|640px]]&lt;br /&gt;
&lt;br /&gt;
{{note|Direct Light 组件可能会提示项目未使用线性光强度。问题在于，Unity 默认会对光源颜色应用伽马校正 [https://twitter.com/guycalledfrank/status/1001108508614553600 不正确]。&lt;br /&gt;
可以通过[https://docs.unity3d.com/ScriptReference/Rendering.GraphicsSettings-lightsUseLinearIntensity.html 脚本]启用正确模式。&lt;br /&gt;
这就是 “Fix” 按钮的作用。如果你已经在非线性光强模式下设置了许多光源，并且不想再次更改它们，可以跳过修复。即使你按了 “Fix”，也可以随时撤销此更改。&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. 要获得带阴影的环境光，请创建 Skylight（Bakery-&amp;gt;Create-&amp;gt;Skylight）。&lt;br /&gt;
&lt;br /&gt;
[[File:Menusky.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. 选择 Skylight，为它设置一些偏蓝的颜色，然后点击 '''Match scene skybox to this light'''。   这将使场景的 skybox 与光照完全匹配。&lt;br /&gt;
   {{note|将 Unity 的 skybox 与 Bakery Skylight 匹配是可选的，但对正确性很有用，可以确保可见环境和引擎内的反射探针与烘焙光照一致。目前此选项仅适用于 Standard 渲染管线。}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Skycomp.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. 点击 Bakery-&amp;gt;Render Lightmap。默认情况下，Full Lighting 模式是激活的。它会烘焙所有光源的直接和间接光照贡献。如果你想将实时阴影与烘焙全局光照（GI）结合使用，请将模式更改为 '''Indirect'''。&lt;br /&gt;
&lt;br /&gt;
[[File:Bakerywindow.jpg]]&lt;br /&gt;
&lt;br /&gt;
{{note| Bakery 可能会提示你正在使用旧的 [https://docs.unity3d.com/Manual/LinearLighting.html gamma mode]。如果你在意光照质量，强烈建议使用线性模式。如果你的项目已经在错误的伽马模式下设置好了，并且不想更改，或者是发布到不支持线性模式的移动设备上，也可以忽略此提示。}}&lt;br /&gt;
&lt;br /&gt;
7. 点击 '''Render'''。&lt;br /&gt;
&lt;br /&gt;
8. 完成！现在你应该已经得到烘焙的全局光照（GI）：&lt;br /&gt;
&lt;br /&gt;
[[File:Bakedgi.jpg]]&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 ==&lt;br /&gt;
&lt;br /&gt;
所有渲染设置都可以通过 Bakery-&amp;gt;Render Lightmap 访问。设置会为每个场景单独保存。Bakery 窗口顶部的选项允许你在 Simple（简单）、Advanced（高级）和 Experimental（实验）设置之间切换，每个后续模式都会显示更多可调选项。对于大多数场景，Simple 模式已经足够，是入门的好方法。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render mode ===  &lt;br /&gt;
定义要烘焙的光照贴图类型。  &lt;br /&gt;
&lt;br /&gt;
===== Full Lighting =====&lt;br /&gt;
烘焙所有 Bakery 光源的完整直接光和间接光。&lt;br /&gt;
{{note|在 2017.3 之前的 Unity 版本中，如果同一对象上同时有 Unity 和 Bakery 组件，你需要手动禁用 Unity 组件以避免亮度加倍。在较新版本中，实时效果会自动对烘焙光源禁用，就像内置光照烘焙器一样。}}&lt;br /&gt;
&lt;br /&gt;
===== Indirect =====&lt;br /&gt;
[[File:Image26.png|thumb|Unity 支持的不同渲染模式对比]]&lt;br /&gt;
基础混合模式。它会查看每个光源上的 Baked Contribution 选择器：如果设置为 ''Direct And Indirect''，则光源会像在 Full Lighting 模式下一样被烘焙。如果设置为 ''Indirect Only''，则只会烘焙该光源的间接光照（GI）。在后一种情况下，你应保持对象上的 Unity 光源和 Bakery 光源同时存在，一个提供实时直接光照，另一个提供预计算的全局光照（GI）。&lt;br /&gt;
&lt;br /&gt;
[[File:Indirectonly.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== Shadowmask =====&lt;br /&gt;
[[File:Image21.png|thumb|左：完全烘焙的光照。中：动态光源 + 烘焙 GI。右：胶囊形阴影、凹凸贴图和高光为动态光照，但立方体阴影和 GI 为烘焙光照。]]&lt;br /&gt;
[[File:Image6.png|thumb|当相机足够远离场景，或者动态阴影被禁用时，场景将呈现如下效果]]&lt;br /&gt;
更高级的混合模式。它通过生成两种类型的光照贴图来工作——一种包含烘焙颜色（如 Indirect 模式），另一种包含静态物体的阴影。它有几个优点：&lt;br /&gt;
* 实时阴影只需渲染少量动态对象，而不是整个场景。&lt;br /&gt;
* 实时阴影与烘焙阴影可以正确融合。&lt;br /&gt;
* 实时光源可以渲染凹凸贴图、高光和其他表面效果，同时仍会被高质量烘焙阴影遮挡。&lt;br /&gt;
[https://docs.unity3d.com/Manual/LightMode-Mixed-Shadowmask.html 更多详情]&lt;br /&gt;
&lt;br /&gt;
要启用此行为，你必须在同一对象上同时存在 Unity 光源和 Bakery 光源，并将 Baked Contribution 设置为 ''Shadowmask and Indirect''。未标记的光源将按 Indirect 模式进行烘焙。&lt;br /&gt;
&lt;br /&gt;
[[File:Smask22.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== Distance Shadowmask =====&lt;br /&gt;
此复选框仅在你选择 Shadowmask 时可见，并且只是切换项目 [https://docs.unity3d.com/Manual/LightMode-Mixed-ShadowmaskMode.html Quality Settings] 中同名的设置。&lt;br /&gt;
[https://docs.unity3d.com/Manual/LightMode-Mixed-DistanceShadowmask.html 更多详情]&lt;br /&gt;
{{note|由于缺少对应的脚本 API，该复选框在 Unity 5.6.x 上不可见。你可以在 Window-&amp;gt;Lighting-&amp;gt;Mixed Lighting-&amp;gt;Lighting Mode 中切换该设置。}}&lt;br /&gt;
{{note|在 Unity 版本 &amp;lt; 2017.3 中，由于 API 限制，渲染 Shadowmask 光照贴图会清除光照探针。烘焙后需要重新渲染光照探针。在较新版本中不应发生此问题。}}&lt;br /&gt;
&lt;br /&gt;
===== Subtractive =====&lt;br /&gt;
&lt;br /&gt;
启用 [https://docs.unity3d.com/Manual/LightMode-Mixed-Subtractive.html Subtractive] 光照模式。&lt;br /&gt;
&lt;br /&gt;
此选项对光照贴图本身没有任何特殊作用，实际上它的工作方式与 Full Lighting 相同。&lt;br /&gt;
&lt;br /&gt;
唯一的区别是，它还会将实时 Unity 光源设置为与 Subtractive 模式兼容（因为无法通过 UI 完成此操作）。&lt;br /&gt;
&lt;br /&gt;
你还需要在 [https://docs.unity3d.com/Manual/GlobalIllumination.html#MixedLighting Unity Lighting] 窗口中额外设置全局减法参数（例如全局阴影颜色）。&lt;br /&gt;
&lt;br /&gt;
===== Ambient Occlusion Only =====&lt;br /&gt;
仅烘焙环境光遮蔽（AO）。如果你很清楚自己在做什么，这可能会有用。请确保设置 [[#Ambient_occlusion|AO 选项]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Directional mode ===&lt;br /&gt;
[[File:Image3.png|thumb|不同方向模式的对比]]&lt;br /&gt;
定义了方向信息的烘焙方式。标准光照贴图每个像素只存储单一颜色，而方向光照贴图为着色器提供了关于该像素周围半球内光照变化的提示。这些数据用于在完全烘焙的区域中结合法线贴图。如果将其应用到内置的 [[#Bakery_shaders|Bakery]] 着色器中，还可以产生**近似高光反射**效果。&lt;br /&gt;
&lt;br /&gt;
===== None =====&lt;br /&gt;
不包含方向数据，每个像素仅有单一颜色。&lt;br /&gt;
&lt;br /&gt;
===== Baked Normal Maps =====&lt;br /&gt;
依然没有方向数据，但在渲染光照贴图时会考虑法线贴图。此方式在运行时没有额外开销。由于光照贴图的分辨率通常低于法线贴图，结果可能显得模糊。其他问题包括：由于缺乏 mipmapping，远处可能出现锯齿，以及降噪步骤可能导致细节被涂抹。要了解如何在此模式下使用具有程序化法线的自定义着色器，请参阅 [[#Normal_mapping|Normal Mapping]] 章节。&lt;br /&gt;
&lt;br /&gt;
===== Dominant Direction =====&lt;br /&gt;
此模式类似于 Unity 中 Enlighten 和 Progressive 烘焙器的实现。它与大多数着色器兼容，仅生成一张额外的贴图，运行时开销极小。缺点是凹凸贴图的效果较弱，略显灰暗，与实时光照下的同一物体相比可能差异较大。&lt;br /&gt;
&lt;br /&gt;
===== RNM =====&lt;br /&gt;
基于最初为《Half-Life 2》开发的 [https://steamcdn-a.akamaihd.net/apps/valve/2004/GDC2004_Half-Life2_Shading.pdf Radiosity Normal Mapping] 技术（相关演示文稿），后来被许多游戏采用（如《Mirror's Edge》）。此模式总共生成三张 HDR 贴图，是内存占用最高的模式之一，但运行时开销仍相对较低。该模式比 Dominant Direction 更精确，能更好地再现表面反差，并能正确处理来自不同角度、具有不同颜色的光照对法线贴图的影响。&lt;br /&gt;
&lt;br /&gt;
===== SH =====&lt;br /&gt;
基于论文《[https://media.contentapi.ea.com/content/dam/eacom/frostbite/files/gdc2018-precomputedgiobalilluminationinfrostbite.pdf Precomputed Global Illumination in Frostbite]》。这是最高质量的模式，能提供更好的表面对比度，并准确表现来自不同方向、不同颜色的光照。总共生成四张贴图，其中仅一张为 HDR，因此比 RNM 占用更少内存。运行时开销略高于 RNM。&lt;br /&gt;
&lt;br /&gt;
===== MonoSH =====&lt;br /&gt;
[[File:FY8Ru8hWIAAdYYH.jpg|thumb|Dominant Direction、完整 SH 与 MonoSH 的尺寸/质量对比]]&lt;br /&gt;
与 SH 类似，但使用单色的 L1 方向系数。表面对比度同样良好，虽然无法准确表现来自不同方向的不同颜色光照，但对多数场景来说已经足够。仅生成一张额外贴图，因此显存占用与带宽需求与 Dominant Direction 相近；事实上更低，因为 Dominant Direction 使用 RGBA 贴图，而 MonoSH 只需 RGB。该贴图通过内置的方向光照贴图系统传递，但''在标准着色器下显示不正确''。请务必使用兼容的着色器。&lt;br /&gt;
&lt;br /&gt;
===== 限制 =====&lt;br /&gt;
&lt;br /&gt;
* RNM 和 SH/MonoSH 只能与 [[#Bakery_shaders|Bakery shader]] 一起使用，或者需要对你的着色器进行调整。&lt;br /&gt;
* 在 RNM 和 SH 模式下，不会生成标准的颜色光照贴图。你需要确保场景中所有材质都使用 Bakery Shader，或者使用 [[#Bakery_Lightmap_Group_Selector|Lightmap Groups]] 将 RNM/SH 对象与其他对象分开。&lt;br /&gt;
* RNM 和 SH 贴图是通过 [https://docs.unity3d.com/ScriptReference/MaterialPropertyBlock.html MaterialPropertyBlock] 应用于对象的，因此在 Unity 的 Lighting 窗口中可能无法完全显示。&lt;br /&gt;
* Dominant Direction、RNM 和 SH/MonoSH 模式可能需要为全局光照（GI）和光照网格使用更多采样，以获得相近的质量。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Texels per unit ===&lt;br /&gt;
[[File:Texelscomp.jpg|thumb|1 vs 10 texels per unit]]&lt;br /&gt;
每个世界单位的光照贴图像素（Texels）近似数量。它会影响生成光照贴图的数量和分辨率。&lt;br /&gt;
&lt;br /&gt;
入门示例值：&lt;br /&gt;
&lt;br /&gt;
* 大型户外区域（城市）：1 - 5&lt;br /&gt;
* 中型户外区域（几条小巷）：10 - 20&lt;br /&gt;
* 高质量室内场景：100&lt;br /&gt;
&lt;br /&gt;
假设场景比例大约为 1 单位 = 1 米。在 Unity 中使用这种比例通常是推荐的，以便更好地导航和进行物理模拟。如果你的比例不同，请相应地调整 Texels。&lt;br /&gt;
&lt;br /&gt;
请注意，Texels Per Unit 是基础分辨率，但每个对象还可以通过 Mesh Renderer 上的 &amp;quot;Scale in Lightmap&amp;quot; 选项以及 Bakery 窗口中的 &amp;quot;Scale per map type&amp;quot; 进行额外调整。&lt;br /&gt;
&lt;br /&gt;
{{note| 将 &amp;quot;Scale in Lightmap&amp;quot; 设置为 0 的对象不会被烘焙，但仍会投射阴影并影响全局光照（GI）。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Max resolution ===&lt;br /&gt;
光照贴图的最大尺寸限制。如果对象无法容纳在单张光照贴图中（根据当前的 Texels Per Unit 值），将会分配额外的光照贴图。同样的四个正方形对象可以使用四张 512x512 的贴图，也可以使用一张 1024x1024 的贴图。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bounces ===&lt;br /&gt;
[[File:Image36.png|thumb|注意更多的反弹会为封闭空间带来更多光照。]]&lt;br /&gt;
定义光线在表面上反弹的次数。通常，对于户外场景（例如城市），较低的反弹次数就足够了，而对于封闭场景（室内、洞穴），则需要较高的反弹次数。&lt;br /&gt;
&lt;br /&gt;
虽然滑块最多限制为 5 次反弹，但可以在数字输入框中输入任意反弹次数。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Samples ===&lt;br /&gt;
[[File:Image7.png|thumb|左：Samples = 4，右：Samples = 16。为了演示，去噪功能已关闭。]]&lt;br /&gt;
影响全局光照（GI）的质量。典型值为 16 到 32。&lt;br /&gt;
&lt;br /&gt;
{{note| 可以输入超出滑块最大值的任意数字，但请注意，该数字表示最终光线数量的平方根，例如 32 表示 1024 条光线，64 表示 4096 条光线，依此类推。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GPU Priority ===&lt;br /&gt;
在 GPU 处理光照贴图时，操作系统和其他软件的响应可能会变慢。此选项允许你在烘焙速度和系统响应之间进行平衡。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render ===&lt;br /&gt;
为所有打开的场景烘焙光照贴图。&lt;br /&gt;
如果 [[使用手册#Light_probe_mode|Light Probe Mode]] 设置为 L1 或 L2，也会烘焙 [https://docs.unity3d.com/Manual/LightProbes.html 光照探针]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Render Light Probes ===&lt;br /&gt;
为所有打开的场景烘焙 [https://docs.unity3d.com/Manual/LightProbes.html 光照探针]。&lt;br /&gt;
&lt;br /&gt;
请注意，要在 Shadowmask 模式下对动态对象获得正确的混合光阴影，你还需要启用 [[使用手册#Occlusion_probes|occlusion probes]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Render Reflection Probes ===&lt;br /&gt;
为所有打开的场景烘焙反射探针。此按钮仅为方便起见，会调用引擎内置的反射探针更新功能。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update Skybox Probe ===&lt;br /&gt;
为当前的 skybox 烘焙全局漫反射和反射探针。与 “Render Reflection Probes” 一样，它仅调用引擎内置函数。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Occlusion probes ===&lt;br /&gt;
在渲染光照探针时，允许 Unity 使用当前选择的内置光照烘焙器烘焙遮挡探针（occlusion probes）。遮挡探针是存储在普通光照探针中的附加数据，可以防止动态对象在阴影区域被错误照亮。目前在 Unity 中无法使用自定义遮挡探针，必须调用内置光照烘焙器来完成此操作。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Warnings ===&lt;br /&gt;
这些选项会在按下任意 Render 按钮后对场景进行验证，并显示警告对话框，询问是否继续或停止烘焙过程。&lt;br /&gt;
&lt;br /&gt;
* Suppress all popups（屏蔽所有弹窗）：按下 Render 后不显示任何对话框。&lt;br /&gt;
* UV validation（UV 验证）：检查所有模型是否具有完全正确的光照贴图 UV，特别是 UV 是否位于 0-1 范围内且不重叠。&lt;br /&gt;
* Overwrite check（覆盖检查）：显示哪些光照贴图文件将被覆盖。&lt;br /&gt;
* Memory check（内存检查）：显示大致所需的视频内存量。&lt;br /&gt;
* Sample count check（采样数检查）：检查是否有光源、GI 或 AO 的采样数不合理，可能导致 GPU 超出可用资源。&lt;br /&gt;
* Lightmapped prefab validation（光照贴图预制体验证）：验证光照贴图预制体，并在某些预制体将被覆盖时发出通知。&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 (Advanced) ==&lt;br /&gt;
=== Light probe mode ===&lt;br /&gt;
更改光照探针的烘焙方式。&lt;br /&gt;
&lt;br /&gt;
* Legacy（传统模式）：使用 Render Light Probes 按钮生成探针。点光源和方向光在光照烘焙器中计算，而区域光/天空光/间接光则通过在每个探针位置渲染立方体贴图收集。结果以 [https://docs.unity3d.com/ScriptReference/Rendering.SphericalHarmonicsL2.html L2] 球谐（spherical harmonics）形式存储。缺点是立方体贴图渲染速度慢，并且在游戏中使用的着色器未物理正确表示光照表面，或者项目为移动平台设置时，光照贴图和探针可能不匹配（Unity 可能会裁剪高强度值）。&lt;br /&gt;
&lt;br /&gt;
* L1：在点击 Render 时，光照探针会与光照贴图一起渲染。此选项提供更高的烘焙性能，并保证探针光照与光照贴图匹配。结果以 L1 球谐形式存储（仍可被普通着色器使用）。使用 [[#Bakery_shaders|Bakery shader]] 的 Non-Linear Light Probe SH 选项可以进一步提升结果。&lt;br /&gt;
&lt;br /&gt;
* L2：更高质量（完整 L2 球谐）。与 L1 一样，会自动与光照贴图一起渲染。与 L1 相比，性能影响可忽略不计。应在所有着色器下显示正常。探针对比度/方向性/振铃去除可通过 Project Settings -&amp;gt; Bakery -&amp;gt; “Ringing removal for L2 light probes” 调整。&lt;br /&gt;
&lt;br /&gt;
'''在 Unity 2019.3 中似乎存在一个 bug，如果启用 Occlusion Probes 选项，Legacy 光照探针的颜色无法正确保存。使用 Occlusion Probes 时，默认且推荐使用 L2 模式。'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Asset UV Processing ===&lt;br /&gt;
配置资产的 UV 间距（padding）调整。可选值：&lt;br /&gt;
&lt;br /&gt;
* Don't change（不更改）：不修改资产。&lt;br /&gt;
* Adjust UV padding（调整 UV 间距）：会查找具有自动生成 UV 的模型（资产上启用 “Generate Lightmap UVs”），并进一步调整它们，使每个网格的 UV 岛之间具有适当间距。导入器设置中的全模型 Pack Margin 会被忽略。系统会根据每个网格的面积和光照贴图分辨率计算出最优值。&lt;br /&gt;
* Adjust UV padding for new meshes only（仅调整新网格的 UV 间距）：与上面相同，但会跳过之前至少调整过一次的模型。&lt;br /&gt;
* Remove UV adjustments（移除 UV 调整）：撤销所有之前的 UV 调整，使自动展开的模型恢复到 Unity 原始展开的样子。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser ===&lt;br /&gt;
设置所需的去噪器。可选值：&lt;br /&gt;
&lt;br /&gt;
* Optix 5：使用 OptiX 5.1 AI 去噪器（之前称为 “Legacy denoiser”）。在 GPU 上运行。支持从 [https://en.wikipedia.org/wiki/Kepler_(microarchitecture) Kepler]（通常是 GeForce 6xx）到 [https://en.wikipedia.org/wiki/Turing_(microarchitecture) Turing]（通常是 GeForce 20xx）的所有显卡。不支持 [https://en.wikipedia.org/wiki/Ampere_(microarchitecture) Ampere]（30xx）。OptiX 5.1 使用嵌入的静态训练数据集，因此不受驱动实现影响。&lt;br /&gt;
&lt;br /&gt;
* Optix 6：使用 OptiX 6.0 AI 去噪器（之前为默认选项）。在 GPU 上运行。在 Kepler（6xx）显卡上似乎无法使用，但在更新的显卡上均可运行，包括 Ampere（30xx）。自 6.0 起，OptiX 去噪器的训练数据集存储在驱动中。在 v442.50 之前，其行为类似于 OptiX 5.1；但之后 NVIDIA [https://forums.developer.nvidia.com/t/optix7-denoiser-different-results-with-different-version-of-drivers/117989/2 更改了数据集]，结果可能有所不同。更新后的数据集有时可能产生网格状图案和更亮的边缘（仍可通过 “Denoise: fix bright edges” 修复），但运行速度更快。&lt;br /&gt;
&lt;br /&gt;
* Optix 7：使用 OptiX 7.2 AI 去噪器。行为类似 OptiX 6.0，但在 Ampere（30xx）上可能支持更好。&lt;br /&gt;
&lt;br /&gt;
* OpenImageDenoise：使用 Intel Open Image Denoise 库。在 CPU 上运行（任何支持 SSE 4.1 的 CPU）。可能略慢于 OptiX，但质量可比。&lt;br /&gt;
&lt;br /&gt;
* OpenImageDenoise2：使用 Intel Open Image Denoise 2，CUDA 模式。在 GPU 上运行，性能与 OptiX 6/7 相当，质量与 CPU 版本相同。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Adjust sample positions ===&lt;br /&gt;
寻找最佳采样位置以防止光照泄漏。算法详情可参考 [https://ndotl.wordpress.com/2018/08/29/baking-artifact-free-lightmaps/#leaks 此处]。在某些情况下（通常是大型且多边形极少、法线平滑的几何体），可能会产生不正确的结果，此时可以将其禁用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Unload scenes before render ===&lt;br /&gt;
在烘焙前卸载 Unity 场景以释放显存。复杂场景仅在编辑器中显示就可能占用数 GB 的显存。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Denoise ===&lt;br /&gt;
[[File:Image31.png|thumb|左：未开启 “Denoise”，右：开启 “Denoise”。]]&lt;br /&gt;
如果启用，将应用去噪算法。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Fix Seams ===&lt;br /&gt;
[[File:Image22.png|thumb|左：缝隙（“Fix Seams” 关闭），右：缝隙已修复（“Fix Seams” 开启）。]]&lt;br /&gt;
如果启用，将尝试融合由 UV 不连续造成的缝隙。对平滑几何体很有用，包括 Unity 默认的球体。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Split by scene ===&lt;br /&gt;
如果同时加载多个场景，并且启用此选项，每个场景将拥有自己的一套光照贴图，而不会与其他场景共享。这对于在运行时流式加载场景时限制纹理占用量非常有用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hole filling ===&lt;br /&gt;
[[File:Holefilling.jpg|thumb|“Hole filling” 关闭与开启的对比。]]&lt;br /&gt;
如果 Atlas Packer 设置为 xatlas，将尝试填充每个孔洞，从而生成更高效的贴图集。对于几何体非常复杂的场景，可能会增加场景导出时间，但通常推荐开启。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Min resolution ===&lt;br /&gt;
光照贴图的最小尺寸限制。可用于在生成大量小而完全填充的光照贴图与少量未完全填充的光照贴图之间进行平衡。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Scale per map type ===&lt;br /&gt;
允许你对颜色贴图、Shadowmask 和方向贴图设置不同的分辨率缩放。例如，常见情况是间接光颜色分辨率较低，但 Shadowmask 分辨率较高。请注意，缩放在光照贴图渲染完成后才应用，因此不会节省烘焙时间。如果启用了 “Adjust UV padding”，间距将基于最低分辨率的贴图，以防止像素泄漏。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Checker preview ===&lt;br /&gt;
[[File:Image12.png|thumb|Checker Preview 功能演示。]]&lt;br /&gt;
如果勾选了 “Show checker” 选项，场景视图将在可见对象上渲染棋盘格图案，以展示光照贴图像素大小。这对于在烘焙前确保 Texels Per Unit 和其他影响分辨率的设置使用合理数值非常有用。&lt;br /&gt;
&lt;br /&gt;
启用 Checker Preview 将强制 Bakery 执行贴图集打包。可能需要一些时间，但通常不会超过几秒钟。在修改场景内容后，按下 “Refresh checker” 可重新打包场景以查看更改。&lt;br /&gt;
&lt;br /&gt;
Checker Preview 还使用随机颜色显示场景将如何被分割到不同的光照贴图中。&lt;br /&gt;
&lt;br /&gt;
{{note| 当前 Checker Preview 无法显示地形的正确像素大小。}}&lt;br /&gt;
&lt;br /&gt;
==== Atlas preview ====&lt;br /&gt;
[[File:FN-TmhRXwAE9i2I.png|thumb|Atlas Preview 功能演示]]&lt;br /&gt;
当 Checker Preview 开启时，会显示 Atlas Preview 按钮。点击它将打开一个新窗口，显示未来光照贴图的 UV 布局。点击 &amp;quot;&amp;lt;&amp;quot; 和 &amp;quot;&amp;gt;&amp;quot; 按钮可浏览各个光照贴图。&lt;br /&gt;
这对于在烘焙前检查打包质量和光照贴图数量非常有用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Emissive boost ===&lt;br /&gt;
将任何表面自发光（emission）乘以此数值。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Indirect boost ===&lt;br /&gt;
将所有反弹光照乘以此数值。作用与光源组件上的 Indirect Intensity 相同，但为全局设置。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Backface GI ===&lt;br /&gt;
[[File:Image30.jpg|thumb|Backface GI]]&lt;br /&gt;
[[File:Image35.png|thumb|左：“Backface GI” = 0，右：“Backface GI” = 1。注意阴影区域接收到更多的绿色光照。]]&lt;br /&gt;
决定光线通过前面表面到达背面并被全局光照（GI）反弹的程度。这对于薄的半透明表面（如树叶）尤其有用。取值范围为 0-1。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Ambient occlusion ===&lt;br /&gt;
[[File:Image15.png|thumb|左：AO intensity = 0，右：AO intensity = 1。]]&lt;br /&gt;
一种简单的非物理环境光遮蔽（Ambient Occlusion，AO），可在最终场景光照上叠加以增强美观效果。&lt;br /&gt;
&lt;br /&gt;
* Intensity（强度）：控制 AO 效果的可见度。值为 0 时禁用该效果。&lt;br /&gt;
* Radius（半径）：决定 AO 效果使用的光线距离。较小的值产生局部遮蔽（角落、褶皱），较大的值则更类似 Skylight，从远处物体产生阴影。&lt;br /&gt;
* Samples（采样数）：影响环境光遮蔽的质量。典型值为 4 到 32。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dither transparency ===&lt;br /&gt;
通过自动抖动不透明度贴图来启用半透明阴影。[[使用手册#Opacity|了解 Bakery 如何处理不透明度贴图]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== RTX Mode ===&lt;br /&gt;
启用 RTX 硬件加速。仅 RTX 显卡可受益于此选项。最低支持的驱动版本为 418。&lt;br /&gt;
&lt;br /&gt;
驱动可以在大多数非 RTX Nvidia 显卡上模拟 RTX 模式，但通常会更慢。&lt;br /&gt;
&lt;br /&gt;
在 Ampere（3xxx）或更新的显卡上，RTX 模式 ''必须'' 启用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Export terrain trees ===&lt;br /&gt;
如果启用，绘制在地形上的树木将影响光照。树木本身不会被烘焙。请注意，在烘焙过程中，每棵树都使用最高可能的 LOD 等级。对于多公里范围且模型高度复杂的森林场景，不建议使用此选项。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Terrain optimization ===&lt;br /&gt;
如果启用（默认），地形将使用独立的光线追踪技术以利用其高程图几何结构。否则，它们将像其他普通网格一样处理。地形优化可以显著减少高分辨率地形所需的内存占用。在某些情况下，它还能加快地形烘焙速度，但在其他情况下（尤其是简单低分辨率地形）可能需要禁用该选项。&lt;br /&gt;
&lt;br /&gt;
{{note| 地形优化当前不兼容绘制的地形洞。需禁用此选项才能使其正常工作。}}&lt;br /&gt;
{{note| 地形优化仅支持非 RTX 模式。}}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Light Mesh batch limit ===&lt;br /&gt;
如果该值大于 0，会将多个 Light Mesh 合并为一个，前提是它们具有相同设置并影响相同的 Lightmap Groups，同时将它们的总采样数限制为该值（例如，如果限制为 64，则可以合并 2 个采样数为 32 的灯光，或 4 个采样数为 16 的灯光，等等）。在拥有大量 Light Mesh 的场景中，这可以提升性能。但设置过高时需小心，因为 GPU 在一次处理过多采样时可能触发操作系统驱动超时。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Compress volumes ===&lt;br /&gt;
如果启用，将对体积 3D 贴图应用纹理压缩，并将 Bakery 着色器切换到相应的采样模式。不推荐对分辨率非常低的体积使用此选项。体积大小可能会被调整为 4 的倍数。&lt;br /&gt;
&lt;br /&gt;
注意事项：&lt;br /&gt;
&lt;br /&gt;
* 目前仅支持压缩为 BC6H/BC7 纹理格式（桌面/主机平台）。&lt;br /&gt;
* 体积压缩仅支持 Unity 2020.1 或更高版本。&lt;br /&gt;
* 目前仅标准渲染管线的 Bakery 着色器支持使用压缩体积贴图。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Samples multiplier ===&lt;br /&gt;
将所有阴影和 GI 采样数乘以指定因子。可用于在草稿质量和最终质量之间快速切换。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Tile size ===&lt;br /&gt;
与 [[#GPU Priority|GPU Priority]] 相同，但这里设置的是贴图块（tile）大小。Bakery 会将光照贴图拆分为更小的块，并一次更新一个块。块越小，GPU 工作被中断的次数越多，系统响应性可能更好。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Temp path ===&lt;br /&gt;
临时文件夹。在渲染过程中，Bakery 可能需要几个 GB 的可用空间。将此文件夹放在 SSD 上相比 HDD 可略微加快渲染速度。目前，该文件夹不会自动清理。你可以随时手动删除其内容（渲染时除外），或通过 Bakery -&amp;gt; Utilities -&amp;gt; Clear cache 清理。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Output path ===&lt;br /&gt;
光照贴图文件夹。所有光照贴图，以及 lightprobe 和顶点颜色（vertex color）资源都将保存在此处。该路径相对于你的 Assets 文件夹。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Use scene named output path ===&lt;br /&gt;
如果启用此选项，输出路径将自动设置为与当前活动场景同名的文件夹（Assets/CurrentSceneName/）。这与 Unity 内置光照贴图烘焙器的行为类似。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render Selected Groups ===&lt;br /&gt;
仅烘焙包含所选对象的 Lightmap Groups。&lt;br /&gt;
不仅仅是所选对象会被重新绘制，它们所属的所有 Lightmap Groups 都会被处理。其他光照贴图不会被更新。如果对象不属于某个手动分配的组，则使用相同光照贴图的场景部分将被重新烘焙。&lt;br /&gt;
&lt;br /&gt;
目前，使用 [[Partial_scene_baking|Sectors]] 进行场景部分烘焙更为方便。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Beep on finish ===&lt;br /&gt;
如果启用，Bakery 在烘焙完成时会播放提示音。&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 (Experimental) ==&lt;br /&gt;
=== Unwrapper ===&lt;br /&gt;
如果启用 [[#Asset_UV_Processing|Adjust UV Padding]]，则定义将使用的展开器（unwrapper）。&lt;br /&gt;
&lt;br /&gt;
* Default：使用 Unity 标准展开器。Bakery 会为每个具有不同间距参数的网格调用 [https://docs.unity3d.com/ScriptReference/Unwrapping.GenerateSecondaryUVSet.html Unwrapping.GenerateSecondaryUVSet]。&lt;br /&gt;
* xatlas：使用 [https://github.com/jpcy jpcy] 的 [https://github.com/jpcy/xatlas xatlas]，这是 [https://github.com/castano Ignacio Castaño] 的 [https://github.com/Thekla/thekla_atlas thekla_atlas] 的修改版。thekla_atlas 曾用于游戏《The Witness》（[http://the-witness.net/news/2010/03/graphics-tech-texture-parameterization/ 参见博客文章]）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Atlas Packer ===&lt;br /&gt;
选择在将不同对象的 UV 布局打包到大型光照贴图集时使用的算法。&lt;br /&gt;
* Default：Bakery 在 v1.7 之前使用的原始算法。&lt;br /&gt;
* xatlas：使用 xatlas。&lt;br /&gt;
&lt;br /&gt;
某些功能仅支持特定的贴图集打包器：&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Default&lt;br /&gt;
! xatlas&lt;br /&gt;
|-&lt;br /&gt;
| [[使用手册#Bakery_Lightmap_Group_Selector|Override resolution]]&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
|-&lt;br /&gt;
| 高效 LOD 打包&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
|-&lt;br /&gt;
| [[使用手册#Hole_filling|Hole filling]]&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
请注意，贴图集打包器（Atlas Packer）也可以为每个 Lightmap Group 单独选择。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Export geometry and maps ===&lt;br /&gt;
如果启用，Bakery 会在渲染前将场景导出为其专用格式。如果你确定场景的几何体和贴图以及光照贴图分辨率设置没有改变（例如，你只是调整 GI 或光源设置），可以禁用此选项以加快下一次渲染速度。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update unmodified lights ===&lt;br /&gt;
如果启用，Bakery 会重新计算自上次渲染以来未改变的光源。如果你只是调整某个光源，不想等待其他光源重新渲染，可以禁用此选项。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update modified lights and GI ===&lt;br /&gt;
如果启用，Bakery 会重新计算自上次渲染以来发生变化的 GI 和光源。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== UV padding: increase only ===&lt;br /&gt;
仅在启用 [[#Asset_UV_Processing|Adjust UV padding]] 时可见。默认情况下，模型资源的最佳 UV 间距仅基于当前加载的场景进行计算。如果同一模型有多个实例使用不同的光照贴图分辨率，最小的分辨率将决定间距，以确保 UV 图块之间的间距足够大，防止相互重叠。然而，在两个不同的独立场景中烘焙同一模型时，为新场景优化可能会破坏之前场景中的 UV。勾选此选项可以防止这种情况发生，即永远不减小间距值，从而始终为曾经烘焙过的最低分辨率实例进行优化。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoise: fix bright edges ===&lt;br /&gt;
[[File:Image19.png|thumb|左：去噪后可见明亮边缘；右：已修复。]]&lt;br /&gt;
仅在 [[#Denoise|Denoise]] 启用时可见。有时用于去噪的神经网络可能会在阴影周围产生明亮边缘，就像应用了锐化效果一样。如果启用此选项，Bakery 会尝试将其滤除。启用后，去噪阶段可能会略微变慢。&lt;br /&gt;
&lt;br /&gt;
此功能也可用于滤除“火花”（fireflies），即光照贴图中偶尔出现的亮点。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Post-packing ===&lt;br /&gt;
有时在渲染场景时，Bakery 会将光照贴图拆分为多个子光照贴图，例如在烘焙不同 LOD 或地形时。&lt;br /&gt;
Post-packing 会尝试通过将这些子光照贴图合并到同一纹理中来最小化最终贴图集数量。&lt;br /&gt;
建议保持此选项启用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Combine with Enlighten real-time GI ===&lt;br /&gt;
如果启用，则在按下 Render 按钮时，Bakery 会首先尝试使用 Enlighten 烘焙以计算实时 GI。之后，将进行常规的 Bakery 光照贴图烘焙过程。烘焙 GI 和实时 GI 将协同工作。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bake on remote server ===&lt;br /&gt;
启用网络烘焙（[[Network baking|Network baking]]）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Presets ===&lt;br /&gt;
当前在 Experimental 模式下的 Render/Update 按钮下显示。&lt;br /&gt;
&lt;br /&gt;
* 点击 '''New''' 将所有当前设置保存到预设文件中。&lt;br /&gt;
* 默认情况下，当一个预设处于激活状态时，所有设置都会被灰显，以防止覆盖预设。&lt;br /&gt;
* 点击 '''Modify preset''' 可更改设置并覆盖预设。&lt;br /&gt;
* 可以通过预设字段切换预设。将其设置为 None 可禁用预设使用。&lt;br /&gt;
&lt;br /&gt;
== 组件 ==&lt;br /&gt;
=== Bakery Lightmap Group Selector ===&lt;br /&gt;
指定对象及其所有子对象使用的 '''Lightmap Group'''。&lt;br /&gt;
Lightmap Group 是 Bakery 用来表示共享同一光照贴图的对象集合的术语。每个组都有属性，告诉 Bakery 如何打包对象、哪些光源影响它们，以及结果是烘焙到纹理还是顶点。&lt;br /&gt;
&lt;br /&gt;
默认情况下，所有静态对象会自动打包到多个光照贴图组（贴图集）中，因此通常无需手动管理。手动定义组仅用于特殊用途，例如：&lt;br /&gt;
&lt;br /&gt;
* 指定某些对象使用 [[Vertex Lightmaps|每顶点光照贴图]] 而非纹理。&lt;br /&gt;
* 使用建模软件中的原始未缩放 UV 烘焙光照贴图。&lt;br /&gt;
* 将关卡的特定区域分组以使用单张光照贴图，从而便于资源流式加载或通过脚本在运行时切换不同的烘焙光照。&lt;br /&gt;
* 使用 Render Selected Groups 按钮仅更新已分组的对象。&lt;br /&gt;
&lt;br /&gt;
要手动定义组，可以创建 '''Lightmap Group Assets'''，方法包括使用 Assets-&amp;gt;Create 菜单，或在组件中使用 Create New 按钮。使用 Create New 按钮时，将根据以下表单创建新的资源：&lt;br /&gt;
&lt;br /&gt;
* Name：要创建的 Lightmap Group 资源的名称。&lt;br /&gt;
* Packing Mode：此选择器定义 Lightmap Group 的打包模式，共有 3 种模式：&lt;br /&gt;
** Original UV：对象及其子对象将使用未修改的 UV 进行烘焙，不执行打包。适用于多个网格共享同一已打包 UV 布局的模型。&lt;br /&gt;
** Pack Atlas：对象及其子对象将打包到专用纹理贴图集中。在 v1.3 之前，每个可打包的子对象都需要有此组件，但现在不再需要。每个子对象将作为单独矩形打包，除非 Bakery 自动检测到子对象有非重叠的子对象，在这种情况下，多个对象可以使用同一个矩形。&lt;br /&gt;
** Vertex：对象及其子对象将使用顶点色烘焙光照而非纹理。注意，需要使用自定义着色器才能生效，例如 [[#Bakery_shaders|Bakery Shader]]。文档中也提供了一个简单的着色器（“Bakery/Simple Vertex Lightmapped”）用于演示和参考。[[Vertex Lightmaps|了解更多关于顶点光照贴图的信息]]。&lt;br /&gt;
* Directional mode：允许你覆盖该组的 [[#Directional mode|directional mode]]。选项与全局相同，Auto 将使用全局设置。&lt;br /&gt;
* Resolution：所需的光照贴图分辨率。&lt;br /&gt;
* Auto-resolution：使用 [[使用手册#Texels_per_unit|Texels Per Unit]] 来确定最接近的二次幂分辨率。&lt;br /&gt;
* Atlas packer：为该组选择 [[使用手册#Atlas_Packer|贴图集打包]] 算法。&lt;br /&gt;
* Bitmask：用于排除光源影响光照贴图的开关列表。每个 Bakery 光源也有一个位掩码设置。光源只会影响与其共享至少一个开关的 Lightmap Group。默认设置意味着所有光源影响所有光照贴图。&lt;br /&gt;
&lt;br /&gt;
[[File:Ts.jpg|thumb|Transparent selfshadow关闭 vs 开启：注意一些单面但背向的多边形如何被正确照亮。]]&lt;br /&gt;
&lt;br /&gt;
如果你有一个被分配了“Pack Atlas”模式的 Lightmap Group，组件上将会出现额外设置：&lt;br /&gt;
&lt;br /&gt;
* Override resolution：覆盖该对象及其子对象在光照贴图中占用的分辨率。&lt;br /&gt;
* Resolution：手动定义的分辨率。例如，如果你有一个分辨率为 512 的光照贴图，并且分配给 4 个对象，同时覆盖分辨率设置为 256，Bakery 将生成一个 512x512 的光照贴图，每个对象正好占据 256x256 的区域。&lt;br /&gt;
&lt;br /&gt;
如果你选择一个 Lightmap Group 资产，将会显示额外的实验性设置：&lt;br /&gt;
* [[Subsurface scattering|Subsurface scattering: (点击阅读更多)]]&lt;br /&gt;
* Normal offset：允许你将光线从表面偏移。这很少有用，主要用于实验目的。&lt;br /&gt;
* Transparent selfshadow：从表面后方发射光线，使其不会在自身投射阴影。对于半透明叶片可能有用。&lt;br /&gt;
* Vertex sampling density，(仅当 Packing Mode 设置为 Vertex 时可用）：默认情况下，每个顶点只计算一个值；如果采样密度 &amp;gt; 0，则会在三角形上分散采样并求平均，从而生成超采样、更平滑的结果。&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Lightmapped Prefab ===&lt;br /&gt;
此组件允许预制件存储光照贴图元数据。这样处理后的预制件可以在任意场景中实例化，无论是在编辑器中还是运行时。&lt;br /&gt;
该组件应直接添加到预制件的根对象上。不支持嵌套预制件。由于预制件在烘焙后会被覆盖（类似于按下“Apply”按钮的效果），因此要求预制件没有任何未应用的更改（子对象不应移动，材质和脚本参数应保持不变等）。如果检测到此类更改，组件界面会显示错误，烘焙后不会保存任何元数据。如果启用了 [[#Warnings|Lightmapped prefab validation]] 警告，所有预制件错误也会在烘焙前以对话框形式显示。&lt;br /&gt;
&lt;br /&gt;
光照贴图预制件支持所有 Bakery 功能，例如 LOD、地形、方向光贴图、RNM、SH、顶点模式和 Shadowmask。要使 Shadowmask 生效，光源也必须是同一预制件的一部分。&lt;br /&gt;
&lt;br /&gt;
{{note| 注意，由于 API 限制，预制件 Shadowmask 仅在 Unity 2017.4 或更高版本中可用。}}&lt;br /&gt;
&lt;br /&gt;
烘焙后，一个名为 “BakeryPrefabLightmapData” 的对象会被添加到预制件中。该对象包含一个脚本，存储应用光照贴图所需的所有数据。&lt;br /&gt;
&lt;br /&gt;
此外，光照贴图预制件允许保存当前渲染设置，并使用两个按钮将其加载回任意已打开的场景：&lt;br /&gt;
&lt;br /&gt;
* Save current render settings to prefab：在该预制件上存储当前渲染设置的副本。&lt;br /&gt;
* Load render settings from prefab：将当前渲染设置设置为预制件中存储的设置。&lt;br /&gt;
  [[File:Upload 2019-9-17 10-32-34.png|thumb|应用预制件]]&lt;br /&gt;
&lt;br /&gt;
烘焙光照贴图预制件时，建议检查：&lt;br /&gt;
&lt;br /&gt;
* 预制件已“应用”。在旧版 Unity 中，点击 Inspector 右上角的 “Apply” 按钮。在新版 Unity 中，点击 “Overrides” 列表，然后选择 “Apply All”。&lt;br /&gt;
* 预制件组件 UI 不显示任何错误。&lt;br /&gt;
* [推荐] 在主窗口启用 “Lightmapped prefab validation” 复选框。点击 Render 时不会显示任何关于预制件的警告对话框。&lt;br /&gt;
&lt;br /&gt;
{{note| 光照贴图以其烘焙所在的场景或所使用的 Lightmap Group 命名（如果有）。在同一场景中烘焙不同预制件时，请确保使用不同命名的 [[使用手册#Bakery_Lightmap_Group_Selector|Lightmap Group]] 或更改 [[使用手册#Output_path|输出路径]]。}}&lt;br /&gt;
&lt;br /&gt;
{{note| 当使用相同模型逐个烘焙多个预制件时，建议将 [[使用手册#Asset_UV_Processing|Asset UV Processing]] 设置为“Don't Change”，以防止修改共享模型的 UV。}}&lt;br /&gt;
&lt;br /&gt;
{{note| Bakery 的预制件工作流程是在 Unity 提供“预制件双击进入视图”功能之前实现的。因此，在隔离预制件视图中光照贴图可能无法正确应用，组件可能显示 “This GameObject is not a prefab” 信息。但在普通场景中使用时应能正常工作。}}&lt;br /&gt;
&lt;br /&gt;
{{note| 当解包已烘焙的预制件并取消与现有光照贴图的关联时，请确保删除保存预制件范围光照贴图/渲染器连接的 BakeryPrefabLightmapData 对象。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Direct Light ===&lt;br /&gt;
[[File:Directlight.jpg|thumb|纯直射光 + GI]]&lt;br /&gt;
[[File:Image4.png|thumb|左：“Shadow Spread” = 0.01，右：0.05。注意阴影从锐利逐渐变模糊的效果。]]&lt;br /&gt;
无限远方向光（例如太阳）。&lt;br /&gt;
&lt;br /&gt;
* Color：光的颜色。&lt;br /&gt;
* Intensity：线性色彩乘数。&lt;br /&gt;
* Shadow Spread：光源尺寸，或者简单说，阴影的模糊度。0 = 阴影最锐利，1 = 阴影最模糊。从技术上讲，它在单条光线与更宽光锥之间插值。&lt;br /&gt;
* Shadow Samples：影响阴影质量。Shadow Spread 值越小，所需样本越少即可得到干净图像。太阳阴影的典型值为 1 到 16。设置为 0 时，该光源的阴影将消失。&lt;br /&gt;
* Bitmask：用于排除此光源对特定 Lightmap Groups 影响的开关列表。&lt;br /&gt;
* Baked contribution：确定应烘焙哪类光照数据。仅在 Indirect 或 Shadowmask 模式可见。可选值：&lt;br /&gt;
** Direct and Indirect：直射光与间接光都完全烘焙。&lt;br /&gt;
** Indirect only：实时光提供直射贡献，仅烘焙间接光。&lt;br /&gt;
** Shadowmask and indirect：实时光提供直射贡献，静态几何体的阴影烘焙到单独贴图，动态与静态阴影混合。间接光正常烘焙。&lt;br /&gt;
** Direct, Indirect, Shadowmask（仅自定义光照）：与直射和间接相同，但 Shadowmask 也生成，可与自定义着色器一起使用。&lt;br /&gt;
* Denoise shadowmask：确定是否对该光源的 Shadowmask 应用去噪。通常不需要，因为阴影噪点不明显，但对非常宽且模糊的阴影（大 Shadow Spread）可能有用。&lt;br /&gt;
* Indirect intensity：非物理 GI 乘数。自然光照应为 1，可根据场景风格调整。&lt;br /&gt;
* Anti-alias：对阴影执行超采样。&lt;br /&gt;
* Texture projection：在光照上投射乘法平铺纹理，可用于模拟远处云影。&lt;br /&gt;
当设置了纹理投影时，可以使用“Tiling”和“Offset”字段调整其缩放和偏移。或者，点击 &amp;quot;Tweak projection in Scene View&amp;quot; 并使用额外的 Gizmo 可视化移动和缩放投影。点击“Render reference frame”可保存光源视角的 PNG，这对于在场景上绘制云影很有用。&lt;br /&gt;
&lt;br /&gt;
如果同一对象同时启用了 Unity 和 Bakery 光源且参数不匹配，会出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match lightmapped to real-time：将 Unity 光源的通用设置复制到 Bakery 光源。&lt;br /&gt;
* Match real-time to lightmapped：将 Bakery 光源的通用设置复制到 Unity 光源。&lt;br /&gt;
&lt;br /&gt;
{{note| 从物理角度看，Bakery 的方向光强度（Intensity）等于照度（Lux）除以 π。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Sky Light ===&lt;br /&gt;
[[File:Skylight.jpg|thumb|纯天空光与 GI]]&lt;br /&gt;
无限远的带阴影环境光（天空）。&lt;br /&gt;
&lt;br /&gt;
* Color: 颜色。&lt;br /&gt;
* Intensity: 线性色彩倍增。&lt;br /&gt;
* Sky texture: 可选的立方体贴图资源，例如 HDRI 全景图，用于从不同方向影响光照颜色。&lt;br /&gt;
  {{note| 旋转天空光的 GameObject 会相应旋转立方体贴图的光照。}}&lt;br /&gt;
* Samples: 影响阴影质量。典型值为 8 到 32。&lt;br /&gt;
* Hemispherical: 如果启用，光照仅来自上方（上半球）。否则来自所有方向。&lt;br /&gt;
* Bitmask: 用于排除此光源影响特定 Lightmap Groups 的开关列表。&lt;br /&gt;
* Baked contribution: 决定应烘焙哪种光照数据。仅在 Indirect/Shadowmask 模式下可见。可能值：&lt;br /&gt;
** Direct and Indirect: 直接和间接光照都将完全烘焙。这是默认且推荐的天空光行为，因为在 Unity 中没有实时版本可以模拟它们。&lt;br /&gt;
** Indirect only: 假定实时光源提供直接贡献；仅烘焙间接光照。&lt;br /&gt;
&lt;br /&gt;
如果天空光的设置与当前场景的天空盒不匹配，将出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match this light to scene skybox: 将活动天空盒材质的通用设置复制到 Bakery 天空光。当前仅支持使用 “Skybox/Cubemap” 或 “Skybox/Bakery skybox” 着色器的天空盒。&lt;br /&gt;
* Match scene skybox to this light: 将 Bakery 天空光的通用设置复制到场景天空盒。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bakery Light Mesh ===&lt;br /&gt;
[[File:Image29.png|thumb|Left: Samples Near = 0, Samples Far = 4096.&amp;lt;br&amp;gt;&lt;br /&gt;
Middle: Samples Near = 0, Samples Far = 128.&amp;lt;br&amp;gt;&lt;br /&gt;
Right: Samples Near = 16, Samples Far = 128.&amp;lt;br&amp;gt;&lt;br /&gt;
请注意，光照效果看起来相似，但使用的合并采样数量更少。]]&lt;br /&gt;
任何形状的自发光网格。应与 Mesh Renderer 组件或设置为 Area 模式的 Light 组件一起使用。&lt;br /&gt;
&lt;br /&gt;
* Color：颜色&lt;br /&gt;
* Intensity：线性颜色倍增器&lt;br /&gt;
* Cutoff：最大光照距离。Bakery 会在接近该限制时额外衰减正确的平方反比衰减。当 Cutoff 值刚好对应物理衰减变得非常暗的位置时效果最佳。Cutoff 可提升烘焙性能，也可以设置为非常高（不可达）的值以保证完全正确性。&lt;br /&gt;
* Self Shadow：决定光源网格自身是否投射阴影。此选项同时启用更精确的光照算法。&lt;br /&gt;
* Samples Near：影响靠近网格的光照质量。典型值为 16 到 64，仅当 Self Shadow 开启时可用。&lt;br /&gt;
* Samples Far：影响远离网格的光照质量。典型值为 4 到 4096。&lt;br /&gt;
&lt;br /&gt;
Bakery 基于光源表面距离混合两种不同的区域光算法。靠近光源时，算法类似 GI，而远处光源被近似为虚拟点光云。&lt;br /&gt;
&lt;br /&gt;
{{note| &amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;光源网格自身不会接收光照，也不会被烘焙到光照贴图中。&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;一个拥有大量多边形的光源网格比烘焙多个简单的光源网格要快&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;如果结果总是脏/噪点较多，可以尝试将 Samples Near 设置为 0，这样只使用 VPL 算法。对于不需要精度的简单光源（如建筑物的窗户光），这也非常有用。&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;}}  &lt;br /&gt;
[[File:Dd99d-QU0AEKFBK.jpg|thumb|弯曲的光源网格]]  &lt;br /&gt;
* Bitmask：用于排除此光源影响特定 Lightmap Groups 的开关列表。  &lt;br /&gt;
* Baked contribution：决定烘焙哪种类型的光照数据。仅在 Indirect 或 Shadowmask 模式下可见。可能的值：  &lt;br /&gt;
** Direct and Indirect：完全烘焙直接和间接光贡献。这是默认且推荐的光源网格行为，因为 Unity 中没有实时版本可以模拟它们。  &lt;br /&gt;
** Indirect only：实时光源提供直接光贡献，仅烘焙间接光。  &lt;br /&gt;
** Shadowmask and Indirect：实时光源提供直接光贡献，但静态几何体的阴影会烘焙到单独的贴图。动态和静态阴影将混合在一起。间接光照将照常烘焙。目前仅 HDRP（和自定义渲染器）支持混合区域光。  &lt;br /&gt;
** Direct, Indirect, Shadowmask (custom lighting only)：与 Direct and Indirect 相同，但同时生成 Shadowmask 并分配用于自定义着色器。  &lt;br /&gt;
* Indirect intensity：非物理 GI 倍增器。自然光照应设为 1，但可修改以实现更风格化的场景。  &lt;br /&gt;
* Shadowmask with falloff：将完整光衰减烘焙进 Shadowmask（仅对自定义着色器有用）。  &lt;br /&gt;
&lt;br /&gt;
如果网格材质和光源设置不匹配，将出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match light to material：将网格材质或区域光的通用设置复制到 Bakery 光源。&lt;br /&gt;
* Match material to light：将 Bakery 光源的通用设置复制到网格材质或区域光。&lt;br /&gt;
&lt;br /&gt;
==== Light Mesh 与自发光材质的区别 ====&lt;br /&gt;
自发光材质：&lt;br /&gt;
&lt;br /&gt;
* 在 GI 计算中传播光线，因此是“免费的”，无论有多少网格是自发光的。&lt;br /&gt;
* 小而明亮的光可能会产生不准确或有噪点的结果，这取决于 GI 的采样数量。&lt;br /&gt;
* 由于 Bakery 中 GI 的工作方式，它必须占用光照贴图空间，因此可能会浪费空间。同时，这意味着自发光对象需要有效的 UV，并且必须启用“投射阴影”。&lt;br /&gt;
&lt;br /&gt;
Light Mesh：&lt;br /&gt;
&lt;br /&gt;
* 光照会为每个光源单独计算，因此比自发光材质慢。&lt;br /&gt;
* 设计用于为小而明亮的光提供干净的光照效果，即使距离很远也能保持效果。&lt;br /&gt;
* 不占用光照贴图空间。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Point Light ===&lt;br /&gt;
[[File:Image11.png|thumb|左：“Shadow Spread” = 0.5，右：“Shadow Spread” = 1。]]&lt;br /&gt;
点光源，没有面积。尽管在物理上不可能，但在游戏中很有用，并且是匹配 Unity 点光源和聚光灯的唯一方式。&lt;br /&gt;
{{note| 聚光灯只是带有额外投影遮罩的点光源。}}&lt;br /&gt;
&lt;br /&gt;
* Color: 颜色&lt;br /&gt;
* Intensity: 线性色彩倍增&lt;br /&gt;
* Shadow spread: 阴影模糊度。虽然点光源没有面积，但通常希望它仍能产生模糊阴影。为此，阴影被模拟为从球形区域光源投射。此参数定义了虚拟球体的半径，直接影响阴影模糊度。&lt;br /&gt;
* Physical falloff: 如果启用，将使用正确的平方反比衰减，并在边界附近额外衰减。否则将尝试模拟 Unity 的衰减。&lt;br /&gt;
* Falloff min size: 详见 [[Point Light Attenuation]] 部分。&lt;br /&gt;
* Range: 如果物理衰减被禁用，则等于 Unity 的光源范围；如果启用，只会在边缘轻微衰减物理衰减。&lt;br /&gt;
* Samples: 影响阴影质量。典型值为 1 到 512。设置为 0 将使该光源的阴影消失。&lt;br /&gt;
  [[File:Image10.png|thumb|从左到右：Omni，Cookie（默认聚光灯纹理），Cubemap，IES。]]&lt;br /&gt;
* Projection mask: 遮罩/Cookie 类型。选项：&lt;br /&gt;
** Omni: 无遮罩，相当于 Unity 的点光源。&lt;br /&gt;
** Cookie: 纹理投影遮罩。附加选项：&lt;br /&gt;
*** Cookie texture: 2D 纹理资源。Bakery 包含原始 Unity 聚光灯纹理（名为 ftUnitySpotTexture），可用于模拟。&lt;br /&gt;
*** Angle: 纹理投影角度（类似 Unity 聚光灯）。&lt;br /&gt;
*** Correct distortion: 修正宽角下直线可见的 cookie 失真。&lt;br /&gt;
** Cubemap: 立方体贴图投影遮罩。附加选项：&lt;br /&gt;
*** Projected cubemap: 立方体贴图资源。&lt;br /&gt;
** IES: 光照由 IES 文件数据调制。附加选项：&lt;br /&gt;
*** IES file: .ies 扩展名文件。&lt;br /&gt;
* Bitmask: 用于排除该光源影响特定 Lightmap Groups 的开关列表。&lt;br /&gt;
* Baked contribution: 决定应烘焙哪种类型的光照数据。仅在 Indirect 或 Shadowmask 模式下可见。可能值：&lt;br /&gt;
** Direct and Indirect: 直接光和间接光完全烘焙。&lt;br /&gt;
** Indirect only: 实时光提供直接光，仅烘焙间接光。&lt;br /&gt;
** Shadowmask and Indirect: 实时光提供直接光，但静态几何体阴影烘焙到单独贴图中，动态和静态阴影混合，间接光正常烘焙。&lt;br /&gt;
** Direct, Indirect, Shadowmask (custom lighting only): 与 Direct and Indirect 相同，同时生成 Shadowmask 用于自定义着色器。&lt;br /&gt;
* Indirect intensity: 该光的非物理 GI 倍增。自然光应为 1，可根据风格化场景修改。&lt;br /&gt;
* Shadowmask with falloff: 将完整光衰减（除距离外）烘焙到 Shadowmask（仅自定义着色器有用）。&lt;br /&gt;
* Legacy sampling: 使用 Bakery 原始更偏置的阴影采样策略。产生无噪点阴影，但宽半影可能出现条纹。禁用后使用无偏但更有噪点的技术。&lt;br /&gt;
&lt;br /&gt;
如果同一对象同时启用了 Unity 和 Bakery 光源，且设置不匹配，则会出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match lightmapped to real-time: 将 Unity 光的常用设置复制到 Bakery 光。&lt;br /&gt;
* Match real-time to lightmapped: 将 Bakery 光的常用设置复制到 Unity 光。&lt;br /&gt;
&lt;br /&gt;
{{note| 从物理角度来看，Bakery 点光源的“Intensity”为 Candela 除以 Pi。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Volume ===&lt;br /&gt;
[[File:Voldemo notlonely.gif|由 BakeryVolume 照亮的动态门（动态 GIF，由 NOTLonely 制作）]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
体积（Volumes）生成存储每个体素光探针的 3D 纹理（L1 球面调和和阴影贴图），使其成为常规 Unity 光探针的可行替代方案。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Unity Light Probes&lt;br /&gt;
! Unity LPPV&lt;br /&gt;
! Bakery Volumes&lt;br /&gt;
|-&lt;br /&gt;
| 手动放置每个光探针&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 否&lt;br /&gt;
|-&lt;br /&gt;
| 在一个物体上插值多个光探针&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 运行时可移动&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 可以放入预制件&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 完整脚本 API&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| “Ringing” 伪影&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 可能出现&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 可能出现&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 已修正&lt;br /&gt;
|-&lt;br /&gt;
| 去噪&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 运行时开销&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | CPU：低开销；GPU：低开销&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | CPU：中等开销；GPU：中等开销&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#e4ead3;&amp;quot; | CPU：无开销；GPU：中等开销&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bakery Volume 是一个与一组 3D 纹理（3 个 SH 纹理和一个可选的 shadowmask）关联的边界盒，使其非常易于使用和编程。Volumes 可以在运行时轻松地交换、移动、加载或卸载，也可以与预制件关联。它们不需要任何 Light Probe Groups 或手动探针布置；整个 Volume 都由均匀的探针体素网格填充。光/影泄漏会自动像处理光照贴图一样修复（尽管对于较大的体素尺寸，薄的双面墙可能会出现问题，但可以通过在不同侧使用不同 Volume 避免）。由于体素网格的均匀特性，也可以对其应用类似光照贴图的降噪，这是常规光探针无法做到的。此外，Bakery 着色器使用 [https://drive.google.com/file/d/1MK6Clw93q8ljijRjb4gQOzzaIjn1uF9Y/view Geomerics] 采样技巧，完全消除了高对比度 HDR 光照下 SH 有时会产生的 “ringing” 伪影。&lt;br /&gt;
&lt;br /&gt;
因此，Volumes 可以为动态物体生成干净、精细、高质量的烘焙光照（即来自静态物体并影响动态物体的光照，而不是相反）。&lt;br /&gt;
&lt;br /&gt;
Volume 方法的唯一缺点是每像素着色开销较高。其开销类似于 LPPV（随着屏幕上受体素影响的像素数量而缩放），但与 LPPV 不同的是，一旦烘焙完成，Volumes 本身不会再更新。多个 Volume 的混合可以通过稍微重叠它们来避免。&lt;br /&gt;
&lt;br /&gt;
====设置 Volume 变换====&lt;br /&gt;
[[File:Bvolgizmo.jpg|thumb|Volume 控制柄]]&lt;br /&gt;
当 BakeryVolume 被添加到一个 GameObject 时，场景视图中会出现一个边界盒控制柄。拖动小方块即可缩放它。&lt;br /&gt;
&lt;br /&gt;
还有其他方法可以更改 Volume 的大小和位置：&lt;br /&gt;
&lt;br /&gt;
* 将任何可渲染的 GameObject 拖入 “Wrap to object” 字段。Volume 会包裹该对象（及其子对象），以将它们完全包含在内。&lt;br /&gt;
* 如果同一个对象上添加了 Box Collider，则会出现 “Set from box collider” 和 “Set to box collider” 按钮。可以用它们快速在 Volume 和 Collider 之间复制数值。&lt;br /&gt;
&lt;br /&gt;
====分辨率====&lt;br /&gt;
当启用 “Adaptive resolution” 时，体素数量由 “Voxels per unit” 控制。禁用它可以手动输入分辨率。对于大多数 1 单位 = 1 米 的游戏来说，一个合理的 “Voxels per unit” 值是 2，但在某些情况下（例如动态门）使用较小但更高分辨率的 Volume 会更有利。&lt;br /&gt;
&lt;br /&gt;
====其他设置====&lt;br /&gt;
&lt;br /&gt;
* Enable baking: 是否需要（重新）计算 Volume？禁用可防止覆盖已有数据。&lt;br /&gt;
* Denoise: 在烘焙 Volume 后应用去噪。推荐用于高分辨率 Volume。避免用于覆盖许多光源的低分辨率 Volume，因为去噪器难以区分实际内容和噪声。&lt;br /&gt;
* Global: 自动将此 Volume 分配给所有兼容 Volume 的 Shader，除非它们有覆盖设置。内部会调用 Shader.SetGlobalTexture()/SetGlobalVector()。&lt;br /&gt;
====使用方法====&lt;br /&gt;
Volumes 可以分配给使用 Volume 感知 Shader 的对象。Bakery 自带实现该功能的 “Bakery Standard” Shader，以及 HDRP 和 URP 的 Shader 图。请查看 example_volumes 场景，了解应用 Volume 的各种方式。&lt;br /&gt;
&lt;br /&gt;
====提示====&lt;br /&gt;
&lt;br /&gt;
* 确保查看示例。&lt;br /&gt;
* 如果两个 Volume 相连，让它们略微重叠。重叠大小应等于最大动态对象的尺寸。这样在运行时简单切换 Volume 就能正常工作。&lt;br /&gt;
* 仅在动态对象实际可达的区域放置 Volume。例如，使用玩家高度限制 Volume 的高度。&lt;br /&gt;
&lt;br /&gt;
====旋转 Volumes====&lt;br /&gt;
如果启用 “Rotate around Y” 选项，Volumes 可以绕 Y 轴旋转。旋转开销非常低，只使用 2 个额外的浮点数据（预计算的角度 sin/cos）。&lt;br /&gt;
&lt;br /&gt;
还可以在运行时旋转 Volumes（Experimental -&amp;gt; “Support rotation after bake” 以及 Bakery Shader 中的类似选项），这种情况下 Volume 必须在初始旋转为零时进行烘焙。&lt;br /&gt;
&lt;br /&gt;
在 URP 中，这种动态旋转可以与 `BakeryURPVolumeGraphRotatable.shadergraph` 一起使用。&lt;br /&gt;
&lt;br /&gt;
对于全局 Volume，动态旋转会在组件被（重新）启用或调用 `volume.SetGlobalParams()` 时更新。使用局部旋转 Volume 时，需要手动在材质或 MaterialPropertyBlock 上设置旋转：&lt;br /&gt;
{{code|&amp;lt;nowiki&amp;gt;SetMatrix(&amp;quot;_VolumeMatrix&amp;quot;, volume.GetMatrix())&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
====技术信息====&lt;br /&gt;
Volumes 可以自动工作（查看示例场景），也可以通过脚本控制其使用方式。&lt;br /&gt;
&lt;br /&gt;
可以通过组件的以下公共属性获取 Volume 数据：&lt;br /&gt;
&lt;br /&gt;
* `bakedTexture0`：存储 L0 RGB 系数和 L1 Z 红色通道在 alpha 中。&lt;br /&gt;
* `bakedTexture1`：存储 L1 X RGB 系数和 L1 Z 绿色通道在 alpha 中。&lt;br /&gt;
* `bakedTexture2`：存储 L1 Y RGB 系数和 L1 Z 蓝色通道在 alpha 中。&lt;br /&gt;
* `bakedMask`：存储体积阴影遮罩。&lt;br /&gt;
* `bounds`：Volume 的包围盒。&lt;br /&gt;
&lt;br /&gt;
所有 `bakedTexture*` 使用 RGBAHalf（每体素 8 字节）格式，mask 使用 ARGB32（每体素 4 字节）。阴影遮罩也可以使用单通道 R8 格式（每体素 1 字节）。&lt;br /&gt;
&lt;br /&gt;
因此 Volume 的字节大小 = width * height * depth * 3 * 8 + （仅当使用阴影遮罩时）width * height * depth * 4（或使用 R8 mask 时为 width * height * depth）。&lt;br /&gt;
&lt;br /&gt;
[[使用手册#Compress_volumes|可以对 Volume 启用纹理压缩]]，使其体积显著减小。&lt;br /&gt;
&lt;br /&gt;
采样 Volume 需要特殊 Shader，这些 Shader 已包含在 Bakery 中。要在自定义 Shader 中添加 Volumes，请查看 HDRP/URP 包中包含的 `BakeryVolume_float()` 函数（位于 `BakeryDecodeLightmap.hlsl`）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Light Filter ===&lt;br /&gt;
[[File:Output optimized.gif|彩色玻璃，如在 &amp;quot;Bakery Real-Time Preview&amp;quot; 中所见。Bakery lightmapper 烘焙出的结果相同。]]&lt;br /&gt;
&lt;br /&gt;
将渲染器标记为光过滤器（Light Filter）。过滤器会用其颜色着色所有直接和间接光线，类似于现实中的光学滤镜，从而实现彩色透明效果（例如彩色玻璃）。唯一的参数是用于着色的纹理。&lt;br /&gt;
&lt;br /&gt;
* 光过滤器对象仍然会像其他对象一样接收光照贴图。&lt;br /&gt;
* 过滤器不会散射或模糊光线（如需此效果，请尝试 [[Subsurface_scattering|Subsurface Scattering]] 或 [[使用手册#Backface_GI|Backface GI]]）。&lt;br /&gt;
* 过滤器可以产生带颜色的阴影。如果灯光使用 [[使用手册#Shadowmask|Shadowmask]] 模式，则结果只会保存 R 通道（因为 Unity 仅支持单通道遮罩）。对于完全烘焙的阴影，则没有限制。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Sector ===&lt;br /&gt;
参见 '''[[Partial_scene_baking|Partial scene baking]]'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Always Render ===&lt;br /&gt;
如果添加到一个物体上，Bakery 在烘焙时将始终考虑该物体，即使它的 Renderer 被禁用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
=== Bakery Pack As Single Square ===&lt;br /&gt;
如果添加到一个物体上，Bakery 会将该物体及其子物体的 UV 视为单个组合方块，在自动图集打包或 Lightmap Group 的 Pack Atlas 模式下，它们之间永远不会被移动。整个子层级将作为一个整体打包。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
=== Bakery Shared LOD UV ===&lt;br /&gt;
如果添加到一个 LODGroup 上，将标记所有同名 LOD 共享同一个光照贴图。默认情况下，每个 LOD 网格会获得独立的光照贴图，占用图集空间；但如果已知同一个物体的 LOD 拥有相似的 UV2（或者在没有 UV2 且 UV1 不重叠的情况下），它们可以映射到图集的同一部分，从而节省内存。&lt;br /&gt;
这种技术也称为 [https://github.com/laurenth-personal/LODLightmapScripts/ Lightmap Stealing]。&lt;br /&gt;
&lt;br /&gt;
= 材质兼容性 =&lt;br /&gt;
&lt;br /&gt;
=== 漫反射和发光 ===&lt;br /&gt;
Bakery 利用 [https://docs.unity3d.com/Manual/MetaPass.html Meta Pass] 系统支持大多数 Unity 材质。所有内置、Surface、URP 和 HDRP 着色器都已经定义了正确的 Meta Pass。&lt;br /&gt;
&lt;br /&gt;
如果你使用的是 Unlit 着色器，需要按照 Unity 文档手动添加 Meta Pass。&lt;br /&gt;
&lt;br /&gt;
如果未定义该 Pass，Bakery 将假定 {{codeVar|_MainTex}}、{{codeVar|_BaseColorMap}} 或 {{codeVar|_Color}}（如果未设置纹理）为材质的漫反射（Albedo），并将 {{codeVar|_EmissionMap}} 和 {{codeVar|_EmissionColor}} 作为发光颜色。&lt;br /&gt;
&lt;br /&gt;
为了使发光生效，[https://docs.unity3d.com/ScriptReference/Material-globalIlluminationFlags.html Material.globalIlluminationFlags] 必须设置为 [https://docs.unity3d.com/ScriptReference/MaterialGlobalIlluminationFlags.BakedEmissive.html MaterialGlobalIlluminationFlags.BakedEmissive]。标准着色器会自动设置此值。&lt;br /&gt;
&lt;br /&gt;
=== 不透明度 ===&lt;br /&gt;
[[File:Upload 2019-1-25 0-4-30.png|thumb|材质参数被转换为 Cutout（默认）]]&lt;br /&gt;
[[File:Alphacombos dither.jpg|thumb|通过“Dither Transparency”选项添加半透明值]]&lt;br /&gt;
[[File:Alphacombos filter.jpg|thumb|Light Filter 组件用于红色平面，生成彩色阴影]]&lt;br /&gt;
&lt;br /&gt;
默认情况下，Bakery 始终从 {{codeVar|_MainTex}}、{{codeVar|_BaseColorMap}} 或 {{codeVar|_BaseMap}} 的 alpha 值获取全分辨率的不透明度，并将其视为 Cutout（1 位透明）。&lt;br /&gt;
&lt;br /&gt;
当启用 '''Dither Transparency''' 选项时，半透明值会自动转换为可变蓝噪声，然后被滤波/模糊，产生部分透明效果（以前可以通过自定义手动抖动贴图实现，但从 v1.97 起自动完成）。&lt;br /&gt;
&lt;br /&gt;
为了使不透明度生效，着色器的 [https://docs.unity3d.com/Manual/SL-SubShaderTags.html RenderType 标签] 必须为以下值之一：&lt;br /&gt;
&lt;br /&gt;
* {{codeVar|Transparent}}&lt;br /&gt;
* {{codeVar|TransparentCutout}}&lt;br /&gt;
* {{codeVar|TreeLeaf}}&lt;br /&gt;
&lt;br /&gt;
如果存在名为 {{codeVar|_Cutoff}} 的属性，它将影响 Cutout（因此 Standard 着色器的 Cutoff 滑块会自动生效）。&lt;br /&gt;
&lt;br /&gt;
在没有 Dither Transparency 的情况下，如果材质 RenderType 为 {{codeVar|Transparent}} 或 {{codeVar|TreeLeaf}}，则 {{codeVar|_Color}} 的 alpha 值会额外修改 Cutoff：&lt;br /&gt;
''finalCutoff = 1 - (1 - cutoff) * alpha''&lt;br /&gt;
&lt;br /&gt;
对于彩色透明效果，请使用 [[Manual#Bakery_Light_Filter|Light Filter]] 组件。&lt;br /&gt;
&lt;br /&gt;
有关漫反射半透明效果，请参考 [[#Backface GI|Backface GI]] 和 [[subsurface scattering]]。&lt;br /&gt;
&lt;br /&gt;
==== Alpha Meta Pass ====&lt;br /&gt;
从 v1.9 起，Bakery 还支持指定基于自定义着色器的透明度，但这需要使用兼容的着色器。要使用 ''Alpha Meta Pass''，需要执行以下步骤：&lt;br /&gt;
&lt;br /&gt;
* 在着色器中添加一个名为 '''BAKERY_META_ALPHA_ENABLE''' 的属性。例如：&lt;br /&gt;
  {{code|&amp;lt;nowiki&amp;gt;[HideInInspector] BAKERY_META_ALPHA_ENABLE (&amp;quot;Enable Bakery alpha meta pass&amp;quot;, Float) = 1.0&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
* 确保 RenderType 标签设置为上文提到的某个值。&lt;br /&gt;
* 声明一个名为 '''META_BAKERY''' 的 Pass。&lt;br /&gt;
* 在该 Pass 中检查 '''unity_MetaFragmentControl.w''' 是否非零，如果是，则返回计算出的透明度值。&lt;br /&gt;
&lt;br /&gt;
示例可参考包内的 ''Baked_Alpha_meta.shader''。&lt;br /&gt;
&lt;br /&gt;
注意：当前 Alpha Meta Pass 需要将 Light Probe Mode 设置为 L1 或 L2。&lt;br /&gt;
&lt;br /&gt;
=== Normal mapping ===&lt;br /&gt;
自定义表面法线可以与 [[#Baked Normal Maps|烘焙法线贴图]] 模式一起使用。不幸的是，Unity 的 Meta Pass 默认不输出法线信息，因此默认情况下，法线取自名为 {{codeVar|_BumpMap}} 的贴图，并通过 {{codeVar|_MainTex_ST}} 进行额外变换。&lt;br /&gt;
&lt;br /&gt;
然而，可以制作完全自定义的着色器，带有高级法线映射功能（例如混合多层法线），并使其兼容烘焙。要实现这一点，需要执行以下步骤：&lt;br /&gt;
&lt;br /&gt;
1. 在着色器中定义一个 Meta Pass，具体方法请参考 [https://docs.unity3d.com/Manual/MetaPass.html#ExampleMetaPassUnity 文档]。&lt;br /&gt;
&lt;br /&gt;
2. 将该 Pass 命名为 {{codeVar|&amp;quot;META_BAKERY&amp;quot;}}，而不仅仅是 {{codeVar|&amp;quot;META&amp;quot;}}。&lt;br /&gt;
&lt;br /&gt;
3. 包含文件 {{codeVar|&amp;quot;BakeryMetaPass.cginc&amp;quot;}}。&lt;br /&gt;
&lt;br /&gt;
4. 添加 {{codeVar|#pragma vertex vert_bakerymt}}。&lt;br /&gt;
&lt;br /&gt;
5. 如果 {{codeVar|unity_MetaFragmentControl.z}} 变量不为 0，着色器应返回世界空间法线。返回的法线应使用 {{codeVar|BakeryEncodeNormal}} 函数编码。&lt;br /&gt;
&lt;br /&gt;
在 Assets/Bakery/examples/shaders 中包含了两个实现了扩展 Meta Pass 的示例着色器。&lt;br /&gt;
&lt;br /&gt;
你也可以复制并修改 BakeryMetaPass.cginc 以满足你的需求，例如从顶点着色器传递额外数据。&lt;br /&gt;
&lt;br /&gt;
=== 正/背面 ===&lt;br /&gt;
无论着色器使用何种剔除模式，Bakery 都将所有背面视为不透明，这意味着任何直接光线都不会穿过背面，就像它不会穿过正面一样。&lt;br /&gt;
然而，如果使用 [[使用手册#Backface_GI|Backface GI]]，背面可以部分发出正面接收到的光照。&lt;br /&gt;
&lt;br /&gt;
= 扩展 Lightmap Parameters 资源 =&lt;br /&gt;
[[File:Lp.jpg|thumb|扩展 Lightmap Parameters]]&lt;br /&gt;
类似于 Bakery 的 [[#Bakery_Lightmap_Group_Selector|Lightmap Group]]，Unity 也有 [https://docs.unity3d.com/Manual/class-LightmapParameters.html Lightmap Parameters]，可以作为资源创建并分配给 Mesh Renderer。它们的逻辑有相似之处也有不同之处：&lt;br /&gt;
&lt;br /&gt;
* Lightmap Group 的主要用途是将多个对象组合到同一个图集。此外，它还允许覆盖该图集的烘焙设置。&lt;br /&gt;
* Lightmap Parameters 主要用于覆盖对象的烘焙设置，但通过使用“Baked Tag”选项，它们也可以影响打包：具有不同 Baked Tag 的对象将永远不会共享同一个图集。&lt;br /&gt;
&lt;br /&gt;
由于有些用户更习惯 Lightmap Parameters 的工作流程，Bakery 现在支持并扩展了它们：&lt;br /&gt;
&lt;br /&gt;
* Bakery 会遵循 Baked Tag 设置。&lt;br /&gt;
* Lightmap Parameters UI 中将显示额外的 Bakery 特定选项。有关其含义，请参考 [[#Bakery_Lightmap_Group_Selector|Lightmap Group]] 部分。&lt;br /&gt;
&lt;br /&gt;
= 项目设置 =&lt;br /&gt;
一些全局设置可以在 Project Settings -&amp;gt; Bakery GPU Lightmapper 中调整（此选项仅在 Unity 2018.3 或更新版本可见；旧版本请编辑 BakeryProjectSettings.asset）：&lt;br /&gt;
&lt;br /&gt;
* Mipmap lightmaps：启用光照贴图的 mipmap。随着图集变小，可能会导致 UV 图块之间的泄漏；另一方面，它可以减少远处高分辨率光照贴图的锯齿。总体上，建议对非常远的物体使用单独烘焙的 LOD 以及较低分辨率的光照贴图。&lt;br /&gt;
* Color file format：常规 HDR 颜色光照贴图的文件格式。可选值：&lt;br /&gt;
**HDR：Radiance HDR 格式（默认）。可用多种图像编辑器打开。&lt;br /&gt;
**Asset：Unity 原生格式。可自定义 mipmap 数量。&lt;br /&gt;
* Mask/Direction file format：额外 LDR 地图的格式，如阴影遮罩或方向数据。可选值：&lt;br /&gt;
**TGA：8 位 Targa（默认）。&lt;br /&gt;
**PNG：8 位 PNG。通常比 TGA 占用更少磁盘空间。&lt;br /&gt;
**Asset：Unity 原生格式。可自定义 mipmap 数量。&lt;br /&gt;
* Compress lightmaps：定义光照贴图资源的压缩行为。压缩光照贴图占用更少的显存，但可能会出现一些视觉伪影（例如色带或色斑），具体取决于压缩类型（移动端压缩问题请参见[[Troubleshooting#I_have_an_Android_project.2C_and_lightmaps_don.27t_look_good|此处]]）。可选值：&lt;br /&gt;
*** Compress but allow overriding asset: 新的光照贴图将在启用压缩的情况下创建。创建后，可以在 Inspector 中更改它们的压缩设置。修改后的值将在重新烘焙后保留（默认）。&lt;br /&gt;
*** Force compress: 始终压缩所有光照贴图。&lt;br /&gt;
*** Force no compress: 始终生成未压缩的光照贴图。&lt;br /&gt;
* High quality direction: 为方向贴图启用“高”质量压缩。实际格式取决于平台。例如在 PC 上，它会从 DXT1 改为 BC7，这提供了更高的质量，但 VRAM 使用量会翻倍。&lt;br /&gt;
* Texel padding (default atlas packer): 定义在使用默认 atlas 打包器时，在光照贴图 atlas 中对象 UV 布局之间添加多少空白 texel。&lt;br /&gt;
* Texel padding (xatlas packer): 同上，但在使用 xatlas 时。&lt;br /&gt;
* Alpha Meta Pass resolution multiplier: 乘以 [[Manual#Alpha_Meta_Pass|Alpha Meta Pass]] 的分辨率，使在低分辨率光照贴图烘焙时仍能实现精确的基于 Shader 的切割效果。&lt;br /&gt;
* Volume render mode: 为所有 [[Manual#Bakery_Volume|Volumes]] 使用哪种 [[Manual#Render_mode|渲染模式]]？Auto 使用当前活动的渲染模式（默认）。&lt;br /&gt;
* Delete previous lightmaps before bake: 在烘焙新光照贴图之前，实际删除该场景中所有之前渲染的光照贴图文件。&lt;br /&gt;
* Log level: 定义烘焙过程中在控制台输出的信息量。可能的值：&lt;br /&gt;
** 0: 不输出任何内容。&lt;br /&gt;
** 1: 仅输出进度信息。&lt;br /&gt;
** 2: 仅输出警告。&lt;br /&gt;
** 3: 输出全部信息。&lt;br /&gt;
* Alternative scale in lightmap: 使渲染器属性 'Scale in Lightmap' 的行为更类似于 Unity 内置的行为。&lt;br /&gt;
* Align to texture compression blocks with xatlas: 使 xatlas 将 chart 对齐到 4x4 块边界，从而获得更适合压缩的结果。&lt;br /&gt;
* Generate smooth positions: 是否应调整采样位置以防止低多边形几何体在平滑法线下产生错误阴影？在使用法线差异极大的几何体时，可在极少数情况下禁用。技术说明见 [https://ndotl.wordpress.com/2018/08/29/baking-artifact-free-lightmaps/#shadowterm 这篇文章]。&lt;br /&gt;
* Smooth positions per-triangle: 是否应按三角形决定平滑/平面位置？在使用法线差异极大的几何体时，可在极少数情况下禁用。&lt;br /&gt;
* Use 'Receive GI' values: 在渲染器上考虑 “Receive Global Illumination” 值。最初 Bakery 会忽略它。&lt;br /&gt;
* Remove ringing in Legacy light probes: 在 Legacy 模式下启用更柔和的光探针卷积，以防止高对比度区域出现伪影。&lt;br /&gt;
* Always render reflection probes: 在每次 Render/Render Light Probes 后自动渲染反射探针。&lt;br /&gt;
* Ringing removal for L2 light probes: 对 [[Manual#Light_probe_mode|L2 光探针]] 应用去振铃处理。值越高，探针光照越平滑；这种平滑可以减少 [[https://docs.unity3d.com/6000.2/Documentation/Manual/light-probes-troubleshooting.html](https://docs.unity3d.com/6000.2/Documentation/Manual/light-probes-troubleshooting.html) 振铃] 伪影（如果存在）。&lt;br /&gt;
* Put menu under Tools: 将 Bakery 菜单放入 Tools 菜单下。&lt;br /&gt;
&lt;br /&gt;
如果任何格式设置为 Asset 且启用 mipmapping，会显示额外选项：&lt;br /&gt;
&lt;br /&gt;
* Maximum mipmap count: 定义 mipmap 的最大数量。例如，设置为 2，则 8K 光照贴图仅有两个额外 mipmap：4K 和 2K。更低分辨率将被省略，从而在 mipmapping 过程中限制泄漏伪影。&lt;br /&gt;
&lt;br /&gt;
= SkinnedMeshRenderer 支持 =&lt;br /&gt;
Bakery 自 v1.65 起支持蒙皮网格 (skinned meshes)。但是，有一些限制：&lt;br /&gt;
&lt;br /&gt;
* 某些 Unity 版本不支持蒙皮网格的 UV1，并会悄无声息地忽略 “Generate lightmap UVs”。请确保场景中实际使用的网格具有 UV1，并在可能的情况下使用非重叠的 UV0；&lt;br /&gt;
* UV 填充调整在蒙皮网格上不起作用（Unity 在尝试调用 Unwrap 函数时似乎会崩溃）；&lt;br /&gt;
* 蒙皮网格不能使用每顶点光照贴图 (per-vertex lightmaps)（引擎不支持带蒙皮的 additionalVertexStreams）。&lt;br /&gt;
&lt;br /&gt;
= Shader Tweaks =&lt;br /&gt;
[[File:Image2.jpg|thumb|左：默认双线性过滤。右：双三次过滤。]]&lt;br /&gt;
[[File:Image34.jpg|thumb|左：两个阴影都已烘焙。&amp;lt;br&amp;gt;中：球形阴影为动态，另一个阴影为静态。通过相乘组合在一起。&amp;lt;br&amp;gt;右：与中间相同，但使用默认最小值组合。]]&lt;br /&gt;
&lt;br /&gt;
Bakery 提供可选的着色器修改，可以应用到 Unity 着色器上，以改善光照贴图采样并使实时光照更接近光照贴图效果。着色器调整菜单可以通过 Bakery-&amp;gt;Shader Tweaks 访问。&lt;br /&gt;
&lt;br /&gt;
这些选项会修补基础 Unity 着色器包含文件（来自 CGIncludes 文件夹），这些文件被大多数内置和第三方着色器使用。所有修改都会影响使用该版本编辑器打开的所有项目，但也可以轻松恢复。着色器调整会影响标准和表面着色器的工作方式。HDRP、URP 以及其他 SRP 不受影响。&lt;br /&gt;
&lt;br /&gt;
所有可用修改显示为按钮。点击按钮应用修改，按钮将保持按下状态。再次点击按钮即可移除修改。目前可用选项：&lt;br /&gt;
&lt;br /&gt;
{{note| 可能需要以管理员身份运行 Unity 编辑器以使 CGIncludes 修补生效}}&lt;br /&gt;
&lt;br /&gt;
* Use bicubic interpolation for lightmaps: 光照贴图将使用双三次插值代替默认双线性。此调整能很好地修复低分辨率光照贴图的许多锯齿边缘。目前仅适用于 DX11 和现代主机，其他平台仍使用双线性。&lt;br /&gt;
* Use multiplication for shadowmask: 使用相乘代替最小值组合静态和动态阴影。出于未知原因，Unity 默认使用最小值操作符，这会产生一些乘法不存在的伪影。&lt;br /&gt;
* Use physical light falloff (forward): 用更物理正确的平方反比替换实时点光/聚光灯的默认衰减。“Range” 只会在边缘略微淡出（与 Bakery 光源启用 Physical Falloff 复选框效果一致）。仅影响 Forward 渲染器。详情见 [[Point Light Attenuation]]。&lt;br /&gt;
* Use physical light falloff (deferred): 同上，但仅影响 Deferred 渲染器。&lt;br /&gt;
&lt;br /&gt;
'''衰减调整在 Unity &amp;gt;2017 版本上可能无法完全生效。此外，SRP 默认已经使用正确的衰减。'''&lt;br /&gt;
&lt;br /&gt;
= Bakery shaders =&lt;br /&gt;
Bakery 包含了自带着色器，支持顶点光照贴图，以及 RNM 和 SH 方向模式。它还允许从方向数据计算近似烘焙高光。&lt;br /&gt;
对于普通颜色光照贴图、阴影遮罩和 Dominant Direction 模式，Bakery 着色器 '''不是必需的'''，因为这些功能大多数 Unity 着色器本身已经支持。&lt;br /&gt;
&lt;br /&gt;
=== Standard render pipeline ===&lt;br /&gt;
'''Bakery/Standard''': 扩展了普通 Standard 着色器。额外选项：&lt;br /&gt;
&lt;br /&gt;
* Allow Vertex Lightmaps: 允许该材质用于 [[Vertex Lightmaps|顶点光照贴图]]。&lt;br /&gt;
* Allow RNM Lightmaps: 允许该材质用于 [[#RNM|RNM 方向模式]]。&lt;br /&gt;
* Allow SH Lightmaps: 允许该材质用于 [[#SH|SH 方向模式]]。&lt;br /&gt;
  {{note| 所有 “Allow” 选项会在着色器中启用特定的代码路径。为了性能考虑，建议每个材质仅使用一个 “allow” 选项。}}&lt;br /&gt;
* Enable Lightmap Specular: 使用 Dominant Direction、RNM 或 SH 方向模式的数据计算烘焙高光。注意，由于信息有限，该效果仅为近似。如果你曾在 Unity 4 中使用烘焙高光，效果应可比。与高度扰动的法线贴图搭配效果最佳，在平面表面上效果不佳。&lt;br /&gt;
* Enable VertexLM directional: 如果存在顶点光照贴图，指定 Dominant Direction 数据存储在顶点中并应被使用。&lt;br /&gt;
* Enable VertexLM SH: 如果存在顶点光照贴图，指定 SH 数据存储在顶点中并应被使用。&lt;br /&gt;
* Enable VertexLM Shadowmask: 如果存在顶点光照贴图，指定阴影遮罩存储在顶点中并应被使用。&lt;br /&gt;
* Enable MonoSH: 将方向贴图视为 MonoSH 贴图。&lt;br /&gt;
[[File:Image5.png|thumb|Standard SH light probe vs non-linear]]&lt;br /&gt;
[[File:Shspec.jpg|thumb|SH specular effect]]&lt;br /&gt;
* Non-linear SH：在 SH 方向模式下，此选项可以增强对比度（更接近真实效果），但会使着色器稍微变慢。该技巧基于 Geomerics 的论文《[https://drive.google.com/file/d/1MK6Clw93q8ljijRjb4gQOzzaIjn1uF9Y/view Reconstructing Diffuse Lighting from Spherical Harmonic Data]》。&lt;br /&gt;
* Non-linear Light Probe SH：与 Non-linear SH 类似，但用于光照探针。在探针的情况下，最显著的好处是消除错误的负值。这种问题常见于具有高对比度、明亮 HDR 光源的场景中。这是球谐函数的固有限制，而不是 Bakery 特有的问题（即使用 Unity 内置光照贴图器也可能出现类似伪影）。&lt;br /&gt;
* Force Bicubic Filter：为所有附加贴图启用双三次滤波。若要实现完整的双三次滤波（包括第一张颜色贴图），建议同时在 [[#Shader Tweaks|Shader Tweaks]] 中启用该功能。&lt;br /&gt;
&lt;br /&gt;
'''Bakery/Standard Specular'''：与 Standard 相同，但用于高光（Specular）工作流程。&lt;br /&gt;
&lt;br /&gt;
=== HDRP &amp;amp; URP ===&lt;br /&gt;
要提取额外的 HDRP/URP 着色器，请打开 Bakery 自带的 Bakery_ShaderGraphHDRP.unitypackage 或 Bakery_ShaderGraphURP.unitypackage。&lt;br /&gt;
在其中，你会找到可在自己 Shader Graph 中使用的 Shader Subgraph，以及一些示例材质。&lt;br /&gt;
&lt;br /&gt;
=== 各着色器功能支持对比 ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! 大多数 Unity 着色器&lt;br /&gt;
! 大多数 HDRP 和 URP 着色器&lt;br /&gt;
! Bakery Standard&lt;br /&gt;
! HDRP 图表&lt;br /&gt;
! URP 图表&lt;br /&gt;
|-&lt;br /&gt;
| HDR color lightmaps&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Shadowmask&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是 (&amp;gt;= URP 10.1)&lt;br /&gt;
|-&lt;br /&gt;
| Dominant Direction&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| RNM&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| SH&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Mo否SH&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Lightmap specular&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持 Dominant Direction 和 SH&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持 Dominant Direction&lt;br /&gt;
|-&lt;br /&gt;
| Bicubic filtering&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是,&lt;br /&gt;
with [[#Shader Tweaks|Shader Tweaks]]&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是,&lt;br /&gt;
with [[#Shader Tweaks|Shader Tweaks]]&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
|-&lt;br /&gt;
| Vertex lightmaps&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 单一颜色，没有每顶点 SH、方向或阴影遮罩（Shader Graph 限制）&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 单一颜色，没有每顶点 SH、方向或阴影遮罩（Shader Graph 限制）&lt;br /&gt;
|-&lt;br /&gt;
| Non-Linear Light Probes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Volumes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Volume shadowmask&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| Compressed volumes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Mr F</name></author>
		
	</entry>
	<entry>
		<id>https://geom.io/bakery/wiki/index.php?title=%E4%BD%BF%E7%94%A8%E6%89%8B%E5%86%8C&amp;diff=1827</id>
		<title>使用手册</title>
		<link rel="alternate" type="text/html" href="https://geom.io/bakery/wiki/index.php?title=%E4%BD%BF%E7%94%A8%E6%89%8B%E5%86%8C&amp;diff=1827"/>
		<updated>2025-11-05T14:03:05Z</updated>

		<summary type="html">&lt;p&gt;Mr F: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== 系统要求 ==&lt;br /&gt;
&lt;br /&gt;
使用 Bakery 需要：&lt;br /&gt;
&lt;br /&gt;
Windows（7 或更高版本）电脑。&lt;br /&gt;
&lt;br /&gt;
Nvidia 显卡。最低支持型号为 Kepler（GeForce 650 或更新型号，Quadro 显卡请查看规格）。&lt;br /&gt;
&lt;br /&gt;
64 位 Unity 编辑器。Bakery 已在 5.6 到 6 及更高版本上测试过，同时也在 Tuanjie 1.6.7 上通过测试。&lt;br /&gt;
&lt;br /&gt;
{{note|系统要求仅适用于开发者的电脑，而非目标平台。使用 Bakery 烘焙的光照贴图可以在任何地方使用。}}&lt;br /&gt;
&lt;br /&gt;
== 前提条件 ==&lt;br /&gt;
* 确保你的项目中没有任何脚本编译错误，否则也会导致 Bakery 的脚本无法编译。&lt;br /&gt;
* 确保你的显卡驱动是最新版本，如有需要请[https://www.nvidia.com/Download/index.aspx?lang=en-US 更新]。&lt;br /&gt;
&lt;br /&gt;
'''请使用 Game-Ready（标准）驱动程序，而不是 “Studio” 驱动。'''&lt;br /&gt;
&lt;br /&gt;
== 安装 ==&lt;br /&gt;
&lt;br /&gt;
1. 通过 [https://assetstore.unity.com/packages/tools/level-design/bakery-gpu-lightmapper-122218 Asset Store] 将 Bakery 导入到你的项目中。&lt;br /&gt;
&lt;br /&gt;
2. Unity 会显示要导入的文件列表。如果这是你第一次使用 Bakery，建议直接 点击 Import（导入）。有经验的用户可以取消选中 examples 文件夹，以进行更轻量的安装。&lt;br /&gt;
&lt;br /&gt;
文件将被导入到 `Assets/Bakery` 和 `Assets/Editor/x64/Bakery` 文件夹中。&lt;br /&gt;
这些文件夹之后可以移动。&lt;br /&gt;
&lt;br /&gt;
3. Unity 随后会导入 Bakery 并编译脚本。此时可能会弹出如下窗口：&lt;br /&gt;
&lt;br /&gt;
[[File:Goahead.png]]&lt;br /&gt;
&lt;br /&gt;
此时你应点击 “Go Ahead”（继续）。&lt;br /&gt;
&lt;br /&gt;
现在你应该能在编辑器中看到新增的 Bakery 菜单：&lt;br /&gt;
&lt;br /&gt;
[[File:bmenu.jpg]]&lt;br /&gt;
&lt;br /&gt;
== 快速开始 ==&lt;br /&gt;
&lt;br /&gt;
1. 添加一些模型或基础体，并将其标记为静态（Static）。&lt;br /&gt;
&lt;br /&gt;
'''用于光照贴图的网格必须具有不重叠的 UV2。如果存在 UV2，则会使用 UV2（否则使用 UV1）。如果你的模型没有为光照贴图进行展开，请在资源中勾选 Generate Lightmap UVs（生成光照贴图 UV）。'''&lt;br /&gt;
Unity 的基础体已经具有正确的 UV2。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Staticmarked.jpg|320px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. 选择方向光（Unity 为你创建的那个），并添加 '''Bakery Direct Light''' 组件。&lt;br /&gt;
   {{note|Bakery 和 Unity 使用独立的光源组件。}}&lt;br /&gt;
&lt;br /&gt;
3. Bakery Direct Light 有许多可调选项，但你可以轻松将其与 Unity 光源匹配。点击 '''Match lightmapped to real-time'''。现在 Bakery 光源的颜色应与 Unity 默认的方向光相同，呈黄色调。&lt;br /&gt;
&lt;br /&gt;
[[File:Matching.jpg|640px]]&lt;br /&gt;
&lt;br /&gt;
{{note|Direct Light 组件可能会提示项目未使用线性光强度。问题在于，Unity 默认会对光源颜色应用伽马校正 [https://twitter.com/guycalledfrank/status/1001108508614553600 不正确]。&lt;br /&gt;
可以通过[https://docs.unity3d.com/ScriptReference/Rendering.GraphicsSettings-lightsUseLinearIntensity.html 脚本]启用正确模式。&lt;br /&gt;
这就是 “Fix” 按钮的作用。如果你已经在非线性光强模式下设置了许多光源，并且不想再次更改它们，可以跳过修复。即使你按了 “Fix”，也可以随时撤销此更改。&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. 要获得带阴影的环境光，请创建 Skylight（Bakery-&amp;gt;Create-&amp;gt;Skylight）。&lt;br /&gt;
&lt;br /&gt;
[[File:Menusky.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. 选择 Skylight，为它设置一些偏蓝的颜色，然后点击 '''Match scene skybox to this light'''。   这将使场景的 skybox 与光照完全匹配。&lt;br /&gt;
   {{note|将 Unity 的 skybox 与 Bakery Skylight 匹配是可选的，但对正确性很有用，可以确保可见环境和引擎内的反射探针与烘焙光照一致。目前此选项仅适用于 Standard 渲染管线。}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Skycomp.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. 点击 Bakery-&amp;gt;Render Lightmap。默认情况下，Full Lighting 模式是激活的。它会烘焙所有光源的直接和间接光照贡献。如果你想将实时阴影与烘焙全局光照（GI）结合使用，请将模式更改为 '''Indirect'''。&lt;br /&gt;
&lt;br /&gt;
[[File:Bakerywindow.jpg]]&lt;br /&gt;
&lt;br /&gt;
{{note| Bakery 可能会提示你正在使用旧的 [https://docs.unity3d.com/Manual/LinearLighting.html gamma mode]。如果你在意光照质量，强烈建议使用线性模式。如果你的项目已经在错误的伽马模式下设置好了，并且不想更改，或者是发布到不支持线性模式的移动设备上，也可以忽略此提示。}}&lt;br /&gt;
&lt;br /&gt;
7. 点击 '''Render'''。&lt;br /&gt;
&lt;br /&gt;
8. 完成！现在你应该已经得到烘焙的全局光照（GI）：&lt;br /&gt;
&lt;br /&gt;
[[File:Bakedgi.jpg]]&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 ==&lt;br /&gt;
&lt;br /&gt;
所有渲染设置都可以通过 Bakery-&amp;gt;Render Lightmap 访问。设置会为每个场景单独保存。Bakery 窗口顶部的选项允许你在 Simple（简单）、Advanced（高级）和 Experimental（实验）设置之间切换，每个后续模式都会显示更多可调选项。对于大多数场景，Simple 模式已经足够，是入门的好方法。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render mode ===  &lt;br /&gt;
定义要烘焙的光照贴图类型。  &lt;br /&gt;
&lt;br /&gt;
===== Full Lighting =====&lt;br /&gt;
烘焙所有 Bakery 光源的完整直接光和间接光。&lt;br /&gt;
{{note|在 2017.3 之前的 Unity 版本中，如果同一对象上同时有 Unity 和 Bakery 组件，你需要手动禁用 Unity 组件以避免亮度加倍。在较新版本中，实时效果会自动对烘焙光源禁用，就像内置光照烘焙器一样。}}&lt;br /&gt;
&lt;br /&gt;
===== Indirect =====&lt;br /&gt;
[[File:Image26.png|thumb|Unity 支持的不同渲染模式对比]]&lt;br /&gt;
基础混合模式。它会查看每个光源上的 Baked Contribution 选择器：如果设置为 ''Direct And Indirect''，则光源会像在 Full Lighting 模式下一样被烘焙。如果设置为 ''Indirect Only''，则只会烘焙该光源的间接光照（GI）。在后一种情况下，你应保持对象上的 Unity 光源和 Bakery 光源同时存在，一个提供实时直接光照，另一个提供预计算的全局光照（GI）。&lt;br /&gt;
&lt;br /&gt;
[[File:Indirectonly.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== Shadowmask =====&lt;br /&gt;
[[File:Image21.png|thumb|左：完全烘焙的光照。中：动态光源 + 烘焙 GI。右：胶囊形阴影、凹凸贴图和高光为动态光照，但立方体阴影和 GI 为烘焙光照。]]&lt;br /&gt;
[[File:Image6.png|thumb|当相机足够远离场景，或者动态阴影被禁用时，场景将呈现如下效果]]&lt;br /&gt;
更高级的混合模式。它通过生成两种类型的光照贴图来工作——一种包含烘焙颜色（如 Indirect 模式），另一种包含静态物体的阴影。它有几个优点：&lt;br /&gt;
* 实时阴影只需渲染少量动态对象，而不是整个场景。&lt;br /&gt;
* 实时阴影与烘焙阴影可以正确融合。&lt;br /&gt;
* 实时光源可以渲染凹凸贴图、高光和其他表面效果，同时仍会被高质量烘焙阴影遮挡。&lt;br /&gt;
[https://docs.unity3d.com/Manual/LightMode-Mixed-Shadowmask.html 更多详情]&lt;br /&gt;
&lt;br /&gt;
要启用此行为，你必须在同一对象上同时存在 Unity 光源和 Bakery 光源，并将 Baked Contribution 设置为 ''Shadowmask and Indirect''。未标记的光源将按 Indirect 模式进行烘焙。&lt;br /&gt;
&lt;br /&gt;
[[File:Smask22.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== Distance Shadowmask =====&lt;br /&gt;
此复选框仅在你选择 Shadowmask 时可见，并且只是切换项目 [https://docs.unity3d.com/Manual/LightMode-Mixed-ShadowmaskMode.html Quality Settings] 中同名的设置。&lt;br /&gt;
[https://docs.unity3d.com/Manual/LightMode-Mixed-DistanceShadowmask.html 更多详情]&lt;br /&gt;
{{note|由于缺少对应的脚本 API，该复选框在 Unity 5.6.x 上不可见。你可以在 Window-&amp;gt;Lighting-&amp;gt;Mixed Lighting-&amp;gt;Lighting Mode 中切换该设置。}}&lt;br /&gt;
{{note|在 Unity 版本 &amp;lt; 2017.3 中，由于 API 限制，渲染 Shadowmask 光照贴图会清除光照探针。烘焙后需要重新渲染光照探针。在较新版本中不应发生此问题。}}&lt;br /&gt;
&lt;br /&gt;
===== Subtractive =====&lt;br /&gt;
&lt;br /&gt;
启用 [https://docs.unity3d.com/Manual/LightMode-Mixed-Subtractive.html Subtractive] 光照模式。&lt;br /&gt;
&lt;br /&gt;
此选项对光照贴图本身没有任何特殊作用，实际上它的工作方式与 Full Lighting 相同。&lt;br /&gt;
&lt;br /&gt;
唯一的区别是，它还会将实时 Unity 光源设置为与 Subtractive 模式兼容（因为无法通过 UI 完成此操作）。&lt;br /&gt;
&lt;br /&gt;
你还需要在 [https://docs.unity3d.com/Manual/GlobalIllumination.html#MixedLighting Unity Lighting] 窗口中额外设置全局减法参数（例如全局阴影颜色）。&lt;br /&gt;
&lt;br /&gt;
===== Ambient Occlusion Only =====&lt;br /&gt;
仅烘焙环境光遮蔽（AO）。如果你很清楚自己在做什么，这可能会有用。请确保设置 [[#Ambient_occlusion|AO 选项]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Directional mode ===&lt;br /&gt;
[[File:Image3.png|thumb|不同方向模式的对比]]&lt;br /&gt;
定义了方向信息的烘焙方式。标准光照贴图每个像素只存储单一颜色，而方向光照贴图为着色器提供了关于该像素周围半球内光照变化的提示。这些数据用于在完全烘焙的区域中结合法线贴图。如果将其应用到内置的 [[#Bakery_shaders|Bakery]] 着色器中，还可以产生**近似高光反射**效果。&lt;br /&gt;
&lt;br /&gt;
===== None =====&lt;br /&gt;
不包含方向数据，每个像素仅有单一颜色。&lt;br /&gt;
&lt;br /&gt;
===== Baked Normal Maps =====&lt;br /&gt;
依然没有方向数据，但在渲染光照贴图时会考虑法线贴图。此方式在运行时没有额外开销。由于光照贴图的分辨率通常低于法线贴图，结果可能显得模糊。其他问题包括：由于缺乏 mipmapping，远处可能出现锯齿，以及降噪步骤可能导致细节被涂抹。要了解如何在此模式下使用具有程序化法线的自定义着色器，请参阅 [[#Normal_mapping|Normal Mapping]] 章节。&lt;br /&gt;
&lt;br /&gt;
===== Dominant Direction =====&lt;br /&gt;
此模式类似于 Unity 中 Enlighten 和 Progressive 烘焙器的实现。它与大多数着色器兼容，仅生成一张额外的贴图，运行时开销极小。缺点是凹凸贴图的效果较弱，略显灰暗，与实时光照下的同一物体相比可能差异较大。&lt;br /&gt;
&lt;br /&gt;
===== RNM =====&lt;br /&gt;
基于最初为《Half-Life 2》开发的 [https://steamcdn-a.akamaihd.net/apps/valve/2004/GDC2004_Half-Life2_Shading.pdf Radiosity Normal Mapping] 技术（相关演示文稿），后来被许多游戏采用（如《Mirror's Edge》）。此模式总共生成三张 HDR 贴图，是内存占用最高的模式之一，但运行时开销仍相对较低。该模式比 Dominant Direction 更精确，能更好地再现表面反差，并能正确处理来自不同角度、具有不同颜色的光照对法线贴图的影响。&lt;br /&gt;
&lt;br /&gt;
===== SH =====&lt;br /&gt;
基于论文《[https://media.contentapi.ea.com/content/dam/eacom/frostbite/files/gdc2018-precomputedgiobalilluminationinfrostbite.pdf Precomputed Global Illumination in Frostbite]》。这是最高质量的模式，能提供更好的表面对比度，并准确表现来自不同方向、不同颜色的光照。总共生成四张贴图，其中仅一张为 HDR，因此比 RNM 占用更少内存。运行时开销略高于 RNM。&lt;br /&gt;
&lt;br /&gt;
===== MonoSH =====&lt;br /&gt;
[[File:FY8Ru8hWIAAdYYH.jpg|thumb|Dominant Direction、完整 SH 与 MonoSH 的尺寸/质量对比]]&lt;br /&gt;
与 SH 类似，但使用单色的 L1 方向系数。表面对比度同样良好，虽然无法准确表现来自不同方向的不同颜色光照，但对多数场景来说已经足够。仅生成一张额外贴图，因此显存占用与带宽需求与 Dominant Direction 相近；事实上更低，因为 Dominant Direction 使用 RGBA 贴图，而 MonoSH 只需 RGB。该贴图通过内置的方向光照贴图系统传递，但''在标准着色器下显示不正确''。请务必使用兼容的着色器。&lt;br /&gt;
&lt;br /&gt;
===== 限制 =====&lt;br /&gt;
&lt;br /&gt;
* RNM 和 SH/MonoSH 只能与 [[#Bakery_shaders|Bakery shader]] 一起使用，或者需要对你的着色器进行调整。&lt;br /&gt;
* 在 RNM 和 SH 模式下，不会生成标准的颜色光照贴图。你需要确保场景中所有材质都使用 Bakery Shader，或者使用 [[#Bakery_Lightmap_Group_Selector|Lightmap Groups]] 将 RNM/SH 对象与其他对象分开。&lt;br /&gt;
* RNM 和 SH 贴图是通过 [https://docs.unity3d.com/ScriptReference/MaterialPropertyBlock.html MaterialPropertyBlock] 应用于对象的，因此在 Unity 的 Lighting 窗口中可能无法完全显示。&lt;br /&gt;
* Dominant Direction、RNM 和 SH/MonoSH 模式可能需要为全局光照（GI）和光照网格使用更多采样，以获得相近的质量。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Texels per unit ===&lt;br /&gt;
[[File:Texelscomp.jpg|thumb|1 vs 10 texels per unit]]&lt;br /&gt;
每个世界单位的光照贴图像素（Texels）近似数量。它会影响生成光照贴图的数量和分辨率。&lt;br /&gt;
&lt;br /&gt;
入门示例值：&lt;br /&gt;
&lt;br /&gt;
* 大型户外区域（城市）：1 - 5&lt;br /&gt;
* 中型户外区域（几条小巷）：10 - 20&lt;br /&gt;
* 高质量室内场景：100&lt;br /&gt;
&lt;br /&gt;
假设场景比例大约为 1 单位 = 1 米。在 Unity 中使用这种比例通常是推荐的，以便更好地导航和进行物理模拟。如果你的比例不同，请相应地调整 Texels。&lt;br /&gt;
&lt;br /&gt;
请注意，Texels Per Unit 是基础分辨率，但每个对象还可以通过 Mesh Renderer 上的 &amp;quot;Scale in Lightmap&amp;quot; 选项以及 Bakery 窗口中的 &amp;quot;Scale per map type&amp;quot; 进行额外调整。&lt;br /&gt;
&lt;br /&gt;
{{note| 将 &amp;quot;Scale in Lightmap&amp;quot; 设置为 0 的对象不会被烘焙，但仍会投射阴影并影响全局光照（GI）。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Max resolution ===&lt;br /&gt;
光照贴图的最大尺寸限制。如果对象无法容纳在单张光照贴图中（根据当前的 Texels Per Unit 值），将会分配额外的光照贴图。同样的四个正方形对象可以使用四张 512x512 的贴图，也可以使用一张 1024x1024 的贴图。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bounces ===&lt;br /&gt;
[[File:Image36.png|thumb|注意更多的反弹会为封闭空间带来更多光照。]]&lt;br /&gt;
定义光线在表面上反弹的次数。通常，对于户外场景（例如城市），较低的反弹次数就足够了，而对于封闭场景（室内、洞穴），则需要较高的反弹次数。&lt;br /&gt;
&lt;br /&gt;
虽然滑块最多限制为 5 次反弹，但可以在数字输入框中输入任意反弹次数。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Samples ===&lt;br /&gt;
[[File:Image7.png|thumb|左：Samples = 4，右：Samples = 16。为了演示，去噪功能已关闭。]]&lt;br /&gt;
影响全局光照（GI）的质量。典型值为 16 到 32。&lt;br /&gt;
&lt;br /&gt;
{{note| 可以输入超出滑块最大值的任意数字，但请注意，该数字表示最终光线数量的平方根，例如 32 表示 1024 条光线，64 表示 4096 条光线，依此类推。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GPU Priority ===&lt;br /&gt;
在 GPU 处理光照贴图时，操作系统和其他软件的响应可能会变慢。此选项允许你在烘焙速度和系统响应之间进行平衡。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render ===&lt;br /&gt;
为所有打开的场景烘焙光照贴图。&lt;br /&gt;
如果 [[使用手册#Light_probe_mode|Light Probe Mode]] 设置为 L1 或 L2，也会烘焙 [https://docs.unity3d.com/Manual/LightProbes.html 光照探针]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Render Light Probes ===&lt;br /&gt;
为所有打开的场景烘焙 [https://docs.unity3d.com/Manual/LightProbes.html 光照探针]。&lt;br /&gt;
&lt;br /&gt;
请注意，要在 Shadowmask 模式下对动态对象获得正确的混合光阴影，你还需要启用 [[使用手册#Occlusion_probes|occlusion probes]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Render Reflection Probes ===&lt;br /&gt;
为所有打开的场景烘焙反射探针。此按钮仅为方便起见，会调用引擎内置的反射探针更新功能。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update Skybox Probe ===&lt;br /&gt;
为当前的 skybox 烘焙全局漫反射和反射探针。与 “Render Reflection Probes” 一样，它仅调用引擎内置函数。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Occlusion probes ===&lt;br /&gt;
在渲染光照探针时，允许 Unity 使用当前选择的内置光照烘焙器烘焙遮挡探针（occlusion probes）。遮挡探针是存储在普通光照探针中的附加数据，可以防止动态对象在阴影区域被错误照亮。目前在 Unity 中无法使用自定义遮挡探针，必须调用内置光照烘焙器来完成此操作。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Warnings ===&lt;br /&gt;
这些选项会在按下任意 Render 按钮后对场景进行验证，并显示警告对话框，询问是否继续或停止烘焙过程。&lt;br /&gt;
&lt;br /&gt;
* Suppress all popups（屏蔽所有弹窗）：按下 Render 后不显示任何对话框。&lt;br /&gt;
* UV validation（UV 验证）：检查所有模型是否具有完全正确的光照贴图 UV，特别是 UV 是否位于 0-1 范围内且不重叠。&lt;br /&gt;
* Overwrite check（覆盖检查）：显示哪些光照贴图文件将被覆盖。&lt;br /&gt;
* Memory check（内存检查）：显示大致所需的视频内存量。&lt;br /&gt;
* Sample count check（采样数检查）：检查是否有光源、GI 或 AO 的采样数不合理，可能导致 GPU 超出可用资源。&lt;br /&gt;
* Lightmapped prefab validation（光照贴图预制体验证）：验证光照贴图预制体，并在某些预制体将被覆盖时发出通知。&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 (Advanced) ==&lt;br /&gt;
=== Light probe mode ===&lt;br /&gt;
更改光照探针的烘焙方式。&lt;br /&gt;
&lt;br /&gt;
* Legacy（传统模式）：使用 Render Light Probes 按钮生成探针。点光源和方向光在光照烘焙器中计算，而区域光/天空光/间接光则通过在每个探针位置渲染立方体贴图收集。结果以 [https://docs.unity3d.com/ScriptReference/Rendering.SphericalHarmonicsL2.html L2] 球谐（spherical harmonics）形式存储。缺点是立方体贴图渲染速度慢，并且在游戏中使用的着色器未物理正确表示光照表面，或者项目为移动平台设置时，光照贴图和探针可能不匹配（Unity 可能会裁剪高强度值）。&lt;br /&gt;
&lt;br /&gt;
* L1：在点击 Render 时，光照探针会与光照贴图一起渲染。此选项提供更高的烘焙性能，并保证探针光照与光照贴图匹配。结果以 L1 球谐形式存储（仍可被普通着色器使用）。使用 [[#Bakery_shaders|Bakery shader]] 的 Non-Linear Light Probe SH 选项可以进一步提升结果。&lt;br /&gt;
&lt;br /&gt;
* L2：更高质量（完整 L2 球谐）。与 L1 一样，会自动与光照贴图一起渲染。与 L1 相比，性能影响可忽略不计。应在所有着色器下显示正常。探针对比度/方向性/振铃去除可通过 Project Settings -&amp;gt; Bakery -&amp;gt; “Ringing removal for L2 light probes” 调整。&lt;br /&gt;
&lt;br /&gt;
'''在 Unity 2019.3 中似乎存在一个 bug，如果启用 Occlusion Probes 选项，Legacy 光照探针的颜色无法正确保存。使用 Occlusion Probes 时，默认且推荐使用 L2 模式。'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Asset UV Processing ===&lt;br /&gt;
配置资产的 UV 间距（padding）调整。可选值：&lt;br /&gt;
&lt;br /&gt;
* Don't change（不更改）：不修改资产。&lt;br /&gt;
* Adjust UV padding（调整 UV 间距）：会查找具有自动生成 UV 的模型（资产上启用 “Generate Lightmap UVs”），并进一步调整它们，使每个网格的 UV 岛之间具有适当间距。导入器设置中的全模型 Pack Margin 会被忽略。系统会根据每个网格的面积和光照贴图分辨率计算出最优值。&lt;br /&gt;
* Adjust UV padding for new meshes only（仅调整新网格的 UV 间距）：与上面相同，但会跳过之前至少调整过一次的模型。&lt;br /&gt;
* Remove UV adjustments（移除 UV 调整）：撤销所有之前的 UV 调整，使自动展开的模型恢复到 Unity 原始展开的样子。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser ===&lt;br /&gt;
设置所需的去噪器。可选值：&lt;br /&gt;
&lt;br /&gt;
* Optix 5：使用 OptiX 5.1 AI 去噪器（之前称为 “Legacy denoiser”）。在 GPU 上运行。支持从 [https://en.wikipedia.org/wiki/Kepler_(microarchitecture) Kepler]（通常是 GeForce 6xx）到 [https://en.wikipedia.org/wiki/Turing_(microarchitecture) Turing]（通常是 GeForce 20xx）的所有显卡。不支持 [https://en.wikipedia.org/wiki/Ampere_(microarchitecture) Ampere]（30xx）。OptiX 5.1 使用嵌入的静态训练数据集，因此不受驱动实现影响。&lt;br /&gt;
&lt;br /&gt;
* Optix 6：使用 OptiX 6.0 AI 去噪器（之前为默认选项）。在 GPU 上运行。在 Kepler（6xx）显卡上似乎无法使用，但在更新的显卡上均可运行，包括 Ampere（30xx）。自 6.0 起，OptiX 去噪器的训练数据集存储在驱动中。在 v442.50 之前，其行为类似于 OptiX 5.1；但之后 NVIDIA [https://forums.developer.nvidia.com/t/optix7-denoiser-different-results-with-different-version-of-drivers/117989/2 更改了数据集]，结果可能有所不同。更新后的数据集有时可能产生网格状图案和更亮的边缘（仍可通过 “Denoise: fix bright edges” 修复），但运行速度更快。&lt;br /&gt;
&lt;br /&gt;
* Optix 7：使用 OptiX 7.2 AI 去噪器。行为类似 OptiX 6.0，但在 Ampere（30xx）上可能支持更好。&lt;br /&gt;
&lt;br /&gt;
* OpenImageDenoise：使用 Intel Open Image Denoise 库。在 CPU 上运行（任何支持 SSE 4.1 的 CPU）。可能略慢于 OptiX，但质量可比。&lt;br /&gt;
&lt;br /&gt;
* OpenImageDenoise2：使用 Intel Open Image Denoise 2，CUDA 模式。在 GPU 上运行，性能与 OptiX 6/7 相当，质量与 CPU 版本相同。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Adjust sample positions ===&lt;br /&gt;
寻找最佳采样位置以防止光照泄漏。算法详情可参考 [https://ndotl.wordpress.com/2018/08/29/baking-artifact-free-lightmaps/#leaks 此处]。在某些情况下（通常是大型且多边形极少、法线平滑的几何体），可能会产生不正确的结果，此时可以将其禁用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Unload scenes before render ===&lt;br /&gt;
在烘焙前卸载 Unity 场景以释放显存。复杂场景仅在编辑器中显示就可能占用数 GB 的显存。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Denoise ===&lt;br /&gt;
[[File:Image31.png|thumb|左：未开启 “Denoise”，右：开启 “Denoise”。]]&lt;br /&gt;
如果启用，将应用去噪算法。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Fix Seams ===&lt;br /&gt;
[[File:Image22.png|thumb|左：缝隙（“Fix Seams” 关闭），右：缝隙已修复（“Fix Seams” 开启）。]]&lt;br /&gt;
如果启用，将尝试融合由 UV 不连续造成的缝隙。对平滑几何体很有用，包括 Unity 默认的球体。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Split by scene ===&lt;br /&gt;
如果同时加载多个场景，并且启用此选项，每个场景将拥有自己的一套光照贴图，而不会与其他场景共享。这对于在运行时流式加载场景时限制纹理占用量非常有用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hole filling ===&lt;br /&gt;
[[File:Holefilling.jpg|thumb|“Hole filling” 关闭与开启的对比。]]&lt;br /&gt;
如果 Atlas Packer 设置为 xatlas，将尝试填充每个孔洞，从而生成更高效的贴图集。对于几何体非常复杂的场景，可能会增加场景导出时间，但通常推荐开启。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Min resolution ===&lt;br /&gt;
光照贴图的最小尺寸限制。可用于在生成大量小而完全填充的光照贴图与少量未完全填充的光照贴图之间进行平衡。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Scale per map type ===&lt;br /&gt;
允许你对颜色贴图、Shadowmask 和方向贴图设置不同的分辨率缩放。例如，常见情况是间接光颜色分辨率较低，但 Shadowmask 分辨率较高。请注意，缩放在光照贴图渲染完成后才应用，因此不会节省烘焙时间。如果启用了 “Adjust UV padding”，间距将基于最低分辨率的贴图，以防止像素泄漏。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Checker preview ===&lt;br /&gt;
[[File:Image12.png|thumb|Checker Preview 功能演示。]]&lt;br /&gt;
如果勾选了 “Show checker” 选项，场景视图将在可见对象上渲染棋盘格图案，以展示光照贴图像素大小。这对于在烘焙前确保 Texels Per Unit 和其他影响分辨率的设置使用合理数值非常有用。&lt;br /&gt;
&lt;br /&gt;
启用 Checker Preview 将强制 Bakery 执行贴图集打包。可能需要一些时间，但通常不会超过几秒钟。在修改场景内容后，按下 “Refresh checker” 可重新打包场景以查看更改。&lt;br /&gt;
&lt;br /&gt;
Checker Preview 还使用随机颜色显示场景将如何被分割到不同的光照贴图中。&lt;br /&gt;
&lt;br /&gt;
{{note| 当前 Checker Preview 无法显示地形的正确像素大小。}}&lt;br /&gt;
&lt;br /&gt;
==== Atlas preview ====&lt;br /&gt;
[[File:FN-TmhRXwAE9i2I.png|thumb|Atlas Preview 功能演示]]&lt;br /&gt;
当 Checker Preview 开启时，会显示 Atlas Preview 按钮。点击它将打开一个新窗口，显示未来光照贴图的 UV 布局。点击 &amp;quot;&amp;lt;&amp;quot; 和 &amp;quot;&amp;gt;&amp;quot; 按钮可浏览各个光照贴图。&lt;br /&gt;
这对于在烘焙前检查打包质量和光照贴图数量非常有用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Emissive boost ===&lt;br /&gt;
将任何表面自发光（emission）乘以此数值。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Indirect boost ===&lt;br /&gt;
将所有反弹光照乘以此数值。作用与光源组件上的 Indirect Intensity 相同，但为全局设置。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Backface GI ===&lt;br /&gt;
[[File:Image30.jpg|thumb|Backface GI]]&lt;br /&gt;
[[File:Image35.png|thumb|左：“Backface GI” = 0，右：“Backface GI” = 1。注意阴影区域接收到更多的绿色光照。]]&lt;br /&gt;
决定光线通过前面表面到达背面并被全局光照（GI）反弹的程度。这对于薄的半透明表面（如树叶）尤其有用。取值范围为 0-1。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Ambient occlusion ===&lt;br /&gt;
[[File:Image15.png|thumb|左：AO intensity = 0，右：AO intensity = 1。]]&lt;br /&gt;
一种简单的非物理环境光遮蔽（Ambient Occlusion，AO），可在最终场景光照上叠加以增强美观效果。&lt;br /&gt;
&lt;br /&gt;
* Intensity（强度）：控制 AO 效果的可见度。值为 0 时禁用该效果。&lt;br /&gt;
* Radius（半径）：决定 AO 效果使用的光线距离。较小的值产生局部遮蔽（角落、褶皱），较大的值则更类似 Skylight，从远处物体产生阴影。&lt;br /&gt;
* Samples（采样数）：影响环境光遮蔽的质量。典型值为 4 到 32。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dither transparency ===&lt;br /&gt;
通过自动抖动不透明度贴图来启用半透明阴影。[[使用手册#Opacity|了解 Bakery 如何处理不透明度贴图]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== RTX Mode ===&lt;br /&gt;
启用 RTX 硬件加速。仅 RTX 显卡可受益于此选项。最低支持的驱动版本为 418。&lt;br /&gt;
&lt;br /&gt;
驱动可以在大多数非 RTX Nvidia 显卡上模拟 RTX 模式，但通常会更慢。&lt;br /&gt;
&lt;br /&gt;
在 Ampere（3xxx）或更新的显卡上，RTX 模式 ''必须'' 启用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Export terrain trees ===&lt;br /&gt;
如果启用，绘制在地形上的树木将影响光照。树木本身不会被烘焙。请注意，在烘焙过程中，每棵树都使用最高可能的 LOD 等级。对于多公里范围且模型高度复杂的森林场景，不建议使用此选项。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Terrain optimization ===&lt;br /&gt;
如果启用（默认），地形将使用独立的光线追踪技术以利用其高程图几何结构。否则，它们将像其他普通网格一样处理。地形优化可以显著减少高分辨率地形所需的内存占用。在某些情况下，它还能加快地形烘焙速度，但在其他情况下（尤其是简单低分辨率地形）可能需要禁用该选项。&lt;br /&gt;
&lt;br /&gt;
{{note| 地形优化当前不兼容绘制的地形洞。需禁用此选项才能使其正常工作。}}&lt;br /&gt;
{{note| 地形优化仅支持非 RTX 模式。}}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Light Mesh batch limit ===&lt;br /&gt;
如果该值大于 0，会将多个 Light Mesh 合并为一个，前提是它们具有相同设置并影响相同的 Lightmap Groups，同时将它们的总采样数限制为该值（例如，如果限制为 64，则可以合并 2 个采样数为 32 的灯光，或 4 个采样数为 16 的灯光，等等）。在拥有大量 Light Mesh 的场景中，这可以提升性能。但设置过高时需小心，因为 GPU 在一次处理过多采样时可能触发操作系统驱动超时。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Compress volumes ===&lt;br /&gt;
如果启用，将对体积 3D 贴图应用纹理压缩，并将 Bakery 着色器切换到相应的采样模式。不推荐对分辨率非常低的体积使用此选项。体积大小可能会被调整为 4 的倍数。&lt;br /&gt;
&lt;br /&gt;
注意事项：&lt;br /&gt;
&lt;br /&gt;
* 目前仅支持压缩为 BC6H/BC7 纹理格式（桌面/主机平台）。&lt;br /&gt;
* 体积压缩仅支持 Unity 2020.1 或更高版本。&lt;br /&gt;
* 目前仅标准渲染管线的 Bakery 着色器支持使用压缩体积贴图。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Samples multiplier ===&lt;br /&gt;
将所有阴影和 GI 采样数乘以指定因子。可用于在草稿质量和最终质量之间快速切换。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Tile size ===&lt;br /&gt;
与 [[#GPU Priority|GPU Priority]] 相同，但这里设置的是贴图块（tile）大小。Bakery 会将光照贴图拆分为更小的块，并一次更新一个块。块越小，GPU 工作被中断的次数越多，系统响应性可能更好。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Temp path ===&lt;br /&gt;
临时文件夹。在渲染过程中，Bakery 可能需要几个 GB 的可用空间。将此文件夹放在 SSD 上相比 HDD 可略微加快渲染速度。目前，该文件夹不会自动清理。你可以随时手动删除其内容（渲染时除外），或通过 Bakery -&amp;gt; Utilities -&amp;gt; Clear cache 清理。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Output path ===&lt;br /&gt;
光照贴图文件夹。所有光照贴图，以及 lightprobe 和顶点颜色（vertex color）资源都将保存在此处。该路径相对于你的 Assets 文件夹。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Use scene named output path ===&lt;br /&gt;
如果启用此选项，输出路径将自动设置为与当前活动场景同名的文件夹（Assets/CurrentSceneName/）。这与 Unity 内置光照贴图烘焙器的行为类似。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render Selected Groups ===&lt;br /&gt;
仅烘焙包含所选对象的 Lightmap Groups。&lt;br /&gt;
不仅仅是所选对象会被重新绘制，它们所属的所有 Lightmap Groups 都会被处理。其他光照贴图不会被更新。如果对象不属于某个手动分配的组，则使用相同光照贴图的场景部分将被重新烘焙。&lt;br /&gt;
&lt;br /&gt;
目前，使用 [[Partial_scene_baking|Sectors]] 进行场景部分烘焙更为方便。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Beep on finish ===&lt;br /&gt;
如果启用，Bakery 在烘焙完成时会播放提示音。&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 (Experimental) ==&lt;br /&gt;
=== Unwrapper ===&lt;br /&gt;
如果启用 [[#Asset_UV_Processing|Adjust UV Padding]]，则定义将使用的展开器（unwrapper）。&lt;br /&gt;
&lt;br /&gt;
* Default：使用 Unity 标准展开器。Bakery 会为每个具有不同间距参数的网格调用 [https://docs.unity3d.com/ScriptReference/Unwrapping.GenerateSecondaryUVSet.html Unwrapping.GenerateSecondaryUVSet]。&lt;br /&gt;
* xatlas：使用 [https://github.com/jpcy jpcy] 的 [https://github.com/jpcy/xatlas xatlas]，这是 [https://github.com/castano Ignacio Castaño] 的 [https://github.com/Thekla/thekla_atlas thekla_atlas] 的修改版。thekla_atlas 曾用于游戏《The Witness》（[http://the-witness.net/news/2010/03/graphics-tech-texture-parameterization/ 参见博客文章]）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Atlas Packer ===&lt;br /&gt;
选择在将不同对象的 UV 布局打包到大型光照贴图集时使用的算法。&lt;br /&gt;
* Default：Bakery 在 v1.7 之前使用的原始算法。&lt;br /&gt;
* xatlas：使用 xatlas。&lt;br /&gt;
&lt;br /&gt;
某些功能仅支持特定的贴图集打包器：&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Default&lt;br /&gt;
! xatlas&lt;br /&gt;
|-&lt;br /&gt;
| [[使用手册#Bakery_Lightmap_Group_Selector|Override resolution]]&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
|-&lt;br /&gt;
| 高效 LOD 打包&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
|-&lt;br /&gt;
| [[使用手册#Hole_filling|Hole filling]]&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
请注意，贴图集打包器（Atlas Packer）也可以为每个 Lightmap Group 单独选择。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Export geometry and maps ===&lt;br /&gt;
如果启用，Bakery 会在渲染前将场景导出为其专用格式。如果你确定场景的几何体和贴图以及光照贴图分辨率设置没有改变（例如，你只是调整 GI 或光源设置），可以禁用此选项以加快下一次渲染速度。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update unmodified lights ===&lt;br /&gt;
如果启用，Bakery 会重新计算自上次渲染以来未改变的光源。如果你只是调整某个光源，不想等待其他光源重新渲染，可以禁用此选项。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update modified lights and GI ===&lt;br /&gt;
如果启用，Bakery 会重新计算自上次渲染以来发生变化的 GI 和光源。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== UV padding: increase only ===&lt;br /&gt;
仅在启用 [[#Asset_UV_Processing|Adjust UV padding]] 时可见。默认情况下，模型资源的最佳 UV 间距仅基于当前加载的场景进行计算。如果同一模型有多个实例使用不同的光照贴图分辨率，最小的分辨率将决定间距，以确保 UV 图块之间的间距足够大，防止相互重叠。然而，在两个不同的独立场景中烘焙同一模型时，为新场景优化可能会破坏之前场景中的 UV。勾选此选项可以防止这种情况发生，即永远不减小间距值，从而始终为曾经烘焙过的最低分辨率实例进行优化。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoise: fix bright edges ===&lt;br /&gt;
[[File:Image19.png|thumb|左：去噪后可见明亮边缘；右：已修复。]]&lt;br /&gt;
仅在 [[#Denoise|Denoise]] 启用时可见。有时用于去噪的神经网络可能会在阴影周围产生明亮边缘，就像应用了锐化效果一样。如果启用此选项，Bakery 会尝试将其滤除。启用后，去噪阶段可能会略微变慢。&lt;br /&gt;
&lt;br /&gt;
此功能也可用于滤除“火花”（fireflies），即光照贴图中偶尔出现的亮点。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Post-packing ===&lt;br /&gt;
有时在渲染场景时，Bakery 会将光照贴图拆分为多个子光照贴图，例如在烘焙不同 LOD 或地形时。&lt;br /&gt;
Post-packing 会尝试通过将这些子光照贴图合并到同一纹理中来最小化最终贴图集数量。&lt;br /&gt;
建议保持此选项启用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Combine with Enlighten real-time GI ===&lt;br /&gt;
如果启用，则在按下 Render 按钮时，Bakery 会首先尝试使用 Enlighten 烘焙以计算实时 GI。之后，将进行常规的 Bakery 光照贴图烘焙过程。烘焙 GI 和实时 GI 将协同工作。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bake on remote server ===&lt;br /&gt;
启用网络烘焙（[[Network baking|Network baking]]）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Presets ===&lt;br /&gt;
当前在 Experimental 模式下的 Render/Update 按钮下显示。&lt;br /&gt;
&lt;br /&gt;
* 点击 '''New''' 将所有当前设置保存到预设文件中。&lt;br /&gt;
* 默认情况下，当一个预设处于激活状态时，所有设置都会被灰显，以防止覆盖预设。&lt;br /&gt;
* 点击 '''Modify preset''' 可更改设置并覆盖预设。&lt;br /&gt;
* 可以通过预设字段切换预设。将其设置为 None 可禁用预设使用。&lt;br /&gt;
&lt;br /&gt;
== 组件 ==&lt;br /&gt;
=== Bakery Lightmap Group Selector ===&lt;br /&gt;
指定对象及其所有子对象使用的 '''Lightmap Group'''。&lt;br /&gt;
Lightmap Group 是 Bakery 用来表示共享同一光照贴图的对象集合的术语。每个组都有属性，告诉 Bakery 如何打包对象、哪些光源影响它们，以及结果是烘焙到纹理还是顶点。&lt;br /&gt;
&lt;br /&gt;
默认情况下，所有静态对象会自动打包到多个光照贴图组（贴图集）中，因此通常无需手动管理。手动定义组仅用于特殊用途，例如：&lt;br /&gt;
&lt;br /&gt;
* 指定某些对象使用 [[Vertex Lightmaps|每顶点光照贴图]] 而非纹理。&lt;br /&gt;
* 使用建模软件中的原始未缩放 UV 烘焙光照贴图。&lt;br /&gt;
* 将关卡的特定区域分组以使用单张光照贴图，从而便于资源流式加载或通过脚本在运行时切换不同的烘焙光照。&lt;br /&gt;
* 使用 Render Selected Groups 按钮仅更新已分组的对象。&lt;br /&gt;
&lt;br /&gt;
要手动定义组，可以创建 '''Lightmap Group Assets'''，方法包括使用 Assets-&amp;gt;Create 菜单，或在组件中使用 Create New 按钮。使用 Create New 按钮时，将根据以下表单创建新的资源：&lt;br /&gt;
&lt;br /&gt;
* Name：要创建的 Lightmap Group 资源的名称。&lt;br /&gt;
* Packing Mode：此选择器定义 Lightmap Group 的打包模式，共有 3 种模式：&lt;br /&gt;
** Original UV：对象及其子对象将使用未修改的 UV 进行烘焙，不执行打包。适用于多个网格共享同一已打包 UV 布局的模型。&lt;br /&gt;
** Pack Atlas：对象及其子对象将打包到专用纹理贴图集中。在 v1.3 之前，每个可打包的子对象都需要有此组件，但现在不再需要。每个子对象将作为单独矩形打包，除非 Bakery 自动检测到子对象有非重叠的子对象，在这种情况下，多个对象可以使用同一个矩形。&lt;br /&gt;
** Vertex：对象及其子对象将使用顶点色烘焙光照而非纹理。注意，需要使用自定义着色器才能生效，例如 [[#Bakery_shaders|Bakery Shader]]。文档中也提供了一个简单的着色器（“Bakery/Simple Vertex Lightmapped”）用于演示和参考。[[Vertex Lightmaps|了解更多关于顶点光照贴图的信息]]。&lt;br /&gt;
* Directional mode：允许你覆盖该组的 [[#Directional mode|directional mode]]。选项与全局相同，Auto 将使用全局设置。&lt;br /&gt;
* Resolution：所需的光照贴图分辨率。&lt;br /&gt;
* Auto-resolution：使用 [[使用手册#Texels_per_unit|Texels Per Unit]] 来确定最接近的二次幂分辨率。&lt;br /&gt;
* Atlas packer：为该组选择 [[使用手册#Atlas_Packer|贴图集打包]] 算法。&lt;br /&gt;
* Bitmask：用于排除光源影响光照贴图的开关列表。每个 Bakery 光源也有一个位掩码设置。光源只会影响与其共享至少一个开关的 Lightmap Group。默认设置意味着所有光源影响所有光照贴图。&lt;br /&gt;
&lt;br /&gt;
[[File:Ts.jpg|thumb|Transparent selfshadow关闭 vs 开启：注意一些单面但背向的多边形如何被正确照亮。]]&lt;br /&gt;
&lt;br /&gt;
如果你有一个被分配了“Pack Atlas”模式的 Lightmap Group，组件上将会出现额外设置：&lt;br /&gt;
&lt;br /&gt;
* Override resolution：覆盖该对象及其子对象在光照贴图中占用的分辨率。&lt;br /&gt;
* Resolution：手动定义的分辨率。例如，如果你有一个分辨率为 512 的光照贴图，并且分配给 4 个对象，同时覆盖分辨率设置为 256，Bakery 将生成一个 512x512 的光照贴图，每个对象正好占据 256x256 的区域。&lt;br /&gt;
&lt;br /&gt;
如果你选择一个 Lightmap Group 资产，将会显示额外的实验性设置：&lt;br /&gt;
* [[Subsurface scattering|Subsurface scattering: (点击阅读更多)]]&lt;br /&gt;
* Normal offset：允许你将光线从表面偏移。这很少有用，主要用于实验目的。&lt;br /&gt;
* Transparent selfshadow：从表面后方发射光线，使其不会在自身投射阴影。对于半透明叶片可能有用。&lt;br /&gt;
* Vertex sampling density，(仅当 Packing Mode 设置为 Vertex 时可用）：默认情况下，每个顶点只计算一个值；如果采样密度 &amp;gt; 0，则会在三角形上分散采样并求平均，从而生成超采样、更平滑的结果。&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Lightmapped Prefab ===&lt;br /&gt;
此组件允许预制件存储光照贴图元数据。这样处理后的预制件可以在任意场景中实例化，无论是在编辑器中还是运行时。&lt;br /&gt;
该组件应直接添加到预制件的根对象上。不支持嵌套预制件。由于预制件在烘焙后会被覆盖（类似于按下“Apply”按钮的效果），因此要求预制件没有任何未应用的更改（子对象不应移动，材质和脚本参数应保持不变等）。如果检测到此类更改，组件界面会显示错误，烘焙后不会保存任何元数据。如果启用了 [[#Warnings|Lightmapped prefab validation]] 警告，所有预制件错误也会在烘焙前以对话框形式显示。&lt;br /&gt;
&lt;br /&gt;
光照贴图预制件支持所有 Bakery 功能，例如 LOD、地形、方向光贴图、RNM、SH、顶点模式和 Shadowmask。要使 Shadowmask 生效，光源也必须是同一预制件的一部分。&lt;br /&gt;
&lt;br /&gt;
{{note| 注意，由于 API 限制，预制件 Shadowmask 仅在 Unity 2017.4 或更高版本中可用。}}&lt;br /&gt;
&lt;br /&gt;
烘焙后，一个名为 “BakeryPrefabLightmapData” 的对象会被添加到预制件中。该对象包含一个脚本，存储应用光照贴图所需的所有数据。&lt;br /&gt;
&lt;br /&gt;
此外，光照贴图预制件允许保存当前渲染设置，并使用两个按钮将其加载回任意已打开的场景：&lt;br /&gt;
&lt;br /&gt;
* Save current render settings to prefab：在该预制件上存储当前渲染设置的副本。&lt;br /&gt;
* Load render settings from prefab：将当前渲染设置设置为预制件中存储的设置。&lt;br /&gt;
  [[File:Upload 2019-9-17 10-32-34.png|thumb|应用预制件]]&lt;br /&gt;
&lt;br /&gt;
烘焙光照贴图预制件时，建议检查：&lt;br /&gt;
&lt;br /&gt;
* 预制件已“应用”。在旧版 Unity 中，点击 Inspector 右上角的 “Apply” 按钮。在新版 Unity 中，点击 “Overrides” 列表，然后选择 “Apply All”。&lt;br /&gt;
* 预制件组件 UI 不显示任何错误。&lt;br /&gt;
* [推荐] 在主窗口启用 “Lightmapped prefab validation” 复选框。点击 Render 时不会显示任何关于预制件的警告对话框。&lt;br /&gt;
&lt;br /&gt;
{{note| 光照贴图以其烘焙所在的场景或所使用的 Lightmap Group 命名（如果有）。在同一场景中烘焙不同预制件时，请确保使用不同命名的 [[使用手册#Bakery_Lightmap_Group_Selector|Lightmap Group]] 或更改 [[使用手册#Output_path|输出路径]]。}}&lt;br /&gt;
&lt;br /&gt;
{{note| 当使用相同模型逐个烘焙多个预制件时，建议将 [[使用手册#Asset_UV_Processing|Asset UV Processing]] 设置为“Don't Change”，以防止修改共享模型的 UV。}}&lt;br /&gt;
&lt;br /&gt;
{{note| Bakery 的预制件工作流程是在 Unity 提供“预制件双击进入视图”功能之前实现的。因此，在隔离预制件视图中光照贴图可能无法正确应用，组件可能显示 “This GameObject is not a prefab” 信息。但在普通场景中使用时应能正常工作。}}&lt;br /&gt;
&lt;br /&gt;
{{note| 当解包已烘焙的预制件并取消与现有光照贴图的关联时，请确保删除保存预制件范围光照贴图/渲染器连接的 BakeryPrefabLightmapData 对象。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Direct Light ===&lt;br /&gt;
[[File:Directlight.jpg|thumb|纯直射光 + GI]]&lt;br /&gt;
[[File:Image4.png|thumb|左：“Shadow Spread” = 0.01，右：0.05。注意阴影从锐利逐渐变模糊的效果。]]&lt;br /&gt;
无限远方向光（例如太阳）。&lt;br /&gt;
&lt;br /&gt;
* Color：光的颜色。&lt;br /&gt;
* Intensity：线性色彩乘数。&lt;br /&gt;
* Shadow Spread：光源尺寸，或者简单说，阴影的模糊度。0 = 阴影最锐利，1 = 阴影最模糊。从技术上讲，它在单条光线与更宽光锥之间插值。&lt;br /&gt;
* Shadow Samples：影响阴影质量。Shadow Spread 值越小，所需样本越少即可得到干净图像。太阳阴影的典型值为 1 到 16。设置为 0 时，该光源的阴影将消失。&lt;br /&gt;
* Bitmask：用于排除此光源对特定 Lightmap Groups 影响的开关列表。&lt;br /&gt;
* Baked contribution：确定应烘焙哪类光照数据。仅在 Indirect 或 Shadowmask 模式可见。可选值：&lt;br /&gt;
** Direct and Indirect：直射光与间接光都完全烘焙。&lt;br /&gt;
** Indirect only：实时光提供直射贡献，仅烘焙间接光。&lt;br /&gt;
** Shadowmask and indirect：实时光提供直射贡献，静态几何体的阴影烘焙到单独贴图，动态与静态阴影混合。间接光正常烘焙。&lt;br /&gt;
** Direct, Indirect, Shadowmask（仅自定义光照）：与直射和间接相同，但 Shadowmask 也生成，可与自定义着色器一起使用。&lt;br /&gt;
* Denoise shadowmask：确定是否对该光源的 Shadowmask 应用去噪。通常不需要，因为阴影噪点不明显，但对非常宽且模糊的阴影（大 Shadow Spread）可能有用。&lt;br /&gt;
* Indirect intensity：非物理 GI 乘数。自然光照应为 1，可根据场景风格调整。&lt;br /&gt;
* Anti-alias：对阴影执行超采样。&lt;br /&gt;
* Texture projection：在光照上投射乘法平铺纹理，可用于模拟远处云影。&lt;br /&gt;
当设置了纹理投影时，可以使用“Tiling”和“Offset”字段调整其缩放和偏移。或者，点击 &amp;quot;Tweak projection in Scene View&amp;quot; 并使用额外的 Gizmo 可视化移动和缩放投影。点击“Render reference frame”可保存光源视角的 PNG，这对于在场景上绘制云影很有用。&lt;br /&gt;
&lt;br /&gt;
如果同一对象同时启用了 Unity 和 Bakery 光源且参数不匹配，会出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match lightmapped to real-time：将 Unity 光源的通用设置复制到 Bakery 光源。&lt;br /&gt;
* Match real-time to lightmapped：将 Bakery 光源的通用设置复制到 Unity 光源。&lt;br /&gt;
&lt;br /&gt;
{{note| 从物理角度看，Bakery 的方向光强度（Intensity）等于照度（Lux）除以 π。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Sky Light ===&lt;br /&gt;
[[File:Skylight.jpg|thumb|纯天空光与 GI]]&lt;br /&gt;
无限远的带阴影环境光（天空）。&lt;br /&gt;
&lt;br /&gt;
* Color: 颜色。&lt;br /&gt;
* Intensity: 线性色彩倍增。&lt;br /&gt;
* Sky texture: 可选的立方体贴图资源，例如 HDRI 全景图，用于从不同方向影响光照颜色。&lt;br /&gt;
  {{note| 旋转天空光的 GameObject 会相应旋转立方体贴图的光照。}}&lt;br /&gt;
* Samples: 影响阴影质量。典型值为 8 到 32。&lt;br /&gt;
* Hemispherical: 如果启用，光照仅来自上方（上半球）。否则来自所有方向。&lt;br /&gt;
* Bitmask: 用于排除此光源影响特定 Lightmap Groups 的开关列表。&lt;br /&gt;
* Baked contribution: 决定应烘焙哪种光照数据。仅在 Indirect/Shadowmask 模式下可见。可能值：&lt;br /&gt;
** Direct and Indirect: 直接和间接光照都将完全烘焙。这是默认且推荐的天空光行为，因为在 Unity 中没有实时版本可以模拟它们。&lt;br /&gt;
** Indirect only: 假定实时光源提供直接贡献；仅烘焙间接光照。&lt;br /&gt;
&lt;br /&gt;
如果天空光的设置与当前场景的天空盒不匹配，将出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match this light to scene skybox: 将活动天空盒材质的通用设置复制到 Bakery 天空光。当前仅支持使用 “Skybox/Cubemap” 或 “Skybox/Bakery skybox” 着色器的天空盒。&lt;br /&gt;
* Match scene skybox to this light: 将 Bakery 天空光的通用设置复制到场景天空盒。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bakery Light Mesh ===&lt;br /&gt;
[[File:Image29.png|thumb|Left: Samples Near = 0, Samples Far = 4096.&amp;lt;br&amp;gt;&lt;br /&gt;
Middle: Samples Near = 0, Samples Far = 128.&amp;lt;br&amp;gt;&lt;br /&gt;
Right: Samples Near = 16, Samples Far = 128.&amp;lt;br&amp;gt;&lt;br /&gt;
请注意，光照效果看起来相似，但使用的合并采样数量更少。]]&lt;br /&gt;
任何形状的自发光网格。应与 Mesh Renderer 组件或设置为 Area 模式的 Light 组件一起使用。&lt;br /&gt;
&lt;br /&gt;
* Color：颜色&lt;br /&gt;
* Intensity：线性颜色倍增器&lt;br /&gt;
* Cutoff：最大光照距离。Bakery 会在接近该限制时额外衰减正确的平方反比衰减。当 Cutoff 值刚好对应物理衰减变得非常暗的位置时效果最佳。Cutoff 可提升烘焙性能，也可以设置为非常高（不可达）的值以保证完全正确性。&lt;br /&gt;
* Self Shadow：决定光源网格自身是否投射阴影。此选项同时启用更精确的光照算法。&lt;br /&gt;
* Samples Near：影响靠近网格的光照质量。典型值为 16 到 64，仅当 Self Shadow 开启时可用。&lt;br /&gt;
* Samples Far：影响远离网格的光照质量。典型值为 4 到 4096。&lt;br /&gt;
&lt;br /&gt;
Bakery 基于光源表面距离混合两种不同的区域光算法。靠近光源时，算法类似 GI，而远处光源被近似为虚拟点光云。&lt;br /&gt;
&lt;br /&gt;
{{note| &amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;光源网格自身不会接收光照，也不会被烘焙到光照贴图中。&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;一个拥有大量多边形的光源网格比烘焙多个简单的光源网格要快&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;如果结果总是脏/噪点较多，可以尝试将 Samples Near 设置为 0，这样只使用 VPL 算法。对于不需要精度的简单光源（如建筑物的窗户光），这也非常有用。&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;}}  &lt;br /&gt;
[[File:Dd99d-QU0AEKFBK.jpg|thumb|弯曲的光源网格]]  &lt;br /&gt;
* Bitmask：用于排除此光源影响特定 Lightmap Groups 的开关列表。  &lt;br /&gt;
* Baked contribution：决定烘焙哪种类型的光照数据。仅在 Indirect 或 Shadowmask 模式下可见。可能的值：  &lt;br /&gt;
** Direct and Indirect：完全烘焙直接和间接光贡献。这是默认且推荐的光源网格行为，因为 Unity 中没有实时版本可以模拟它们。  &lt;br /&gt;
** Indirect only：实时光源提供直接光贡献，仅烘焙间接光。  &lt;br /&gt;
** Shadowmask and Indirect：实时光源提供直接光贡献，但静态几何体的阴影会烘焙到单独的贴图。动态和静态阴影将混合在一起。间接光照将照常烘焙。目前仅 HDRP（和自定义渲染器）支持混合区域光。  &lt;br /&gt;
** Direct, Indirect, Shadowmask (custom lighting only)：与 Direct and Indirect 相同，但同时生成 Shadowmask 并分配用于自定义着色器。  &lt;br /&gt;
* Indirect intensity：非物理 GI 倍增器。自然光照应设为 1，但可修改以实现更风格化的场景。  &lt;br /&gt;
* Shadowmask with falloff：将完整光衰减烘焙进 Shadowmask（仅对自定义着色器有用）。  &lt;br /&gt;
&lt;br /&gt;
如果网格材质和光源设置不匹配，将出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match light to material：将网格材质或区域光的通用设置复制到 Bakery 光源。&lt;br /&gt;
* Match material to light：将 Bakery 光源的通用设置复制到网格材质或区域光。&lt;br /&gt;
&lt;br /&gt;
==== Light Mesh 与自发光材质的区别 ====&lt;br /&gt;
自发光材质：&lt;br /&gt;
&lt;br /&gt;
* 在 GI 计算中传播光线，因此是“免费的”，无论有多少网格是自发光的。&lt;br /&gt;
* 小而明亮的光可能会产生不准确或有噪点的结果，这取决于 GI 的采样数量。&lt;br /&gt;
* 由于 Bakery 中 GI 的工作方式，它必须占用光照贴图空间，因此可能会浪费空间。同时，这意味着自发光对象需要有效的 UV，并且必须启用“投射阴影”。&lt;br /&gt;
&lt;br /&gt;
Light Mesh：&lt;br /&gt;
&lt;br /&gt;
* 光照会为每个光源单独计算，因此比自发光材质慢。&lt;br /&gt;
* 设计用于为小而明亮的光提供干净的光照效果，即使距离很远也能保持效果。&lt;br /&gt;
* 不占用光照贴图空间。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Point Light ===&lt;br /&gt;
[[File:Image11.png|thumb|左：“Shadow Spread” = 0.5，右：“Shadow Spread” = 1。]]&lt;br /&gt;
点光源，没有面积。尽管在物理上不可能，但在游戏中很有用，并且是匹配 Unity 点光源和聚光灯的唯一方式。&lt;br /&gt;
{{note| 聚光灯只是带有额外投影遮罩的点光源。}}&lt;br /&gt;
&lt;br /&gt;
* Color: 颜色&lt;br /&gt;
* Intensity: 线性色彩倍增&lt;br /&gt;
* Shadow spread: 阴影模糊度。虽然点光源没有面积，但通常希望它仍能产生模糊阴影。为此，阴影被模拟为从球形区域光源投射。此参数定义了虚拟球体的半径，直接影响阴影模糊度。&lt;br /&gt;
* Physical falloff: 如果启用，将使用正确的平方反比衰减，并在边界附近额外衰减。否则将尝试模拟 Unity 的衰减。&lt;br /&gt;
* Falloff min size: 详见 [[Point Light Attenuation]] 部分。&lt;br /&gt;
* Range: 如果物理衰减被禁用，则等于 Unity 的光源范围；如果启用，只会在边缘轻微衰减物理衰减。&lt;br /&gt;
* Samples: 影响阴影质量。典型值为 1 到 512。设置为 0 将使该光源的阴影消失。&lt;br /&gt;
  [[File:Image10.png|thumb|从左到右：Omni，Cookie（默认聚光灯纹理），Cubemap，IES。]]&lt;br /&gt;
* Projection mask: 遮罩/Cookie 类型。选项：&lt;br /&gt;
** Omni: 无遮罩，相当于 Unity 的点光源。&lt;br /&gt;
** Cookie: 纹理投影遮罩。附加选项：&lt;br /&gt;
*** Cookie texture: 2D 纹理资源。Bakery 包含原始 Unity 聚光灯纹理（名为 ftUnitySpotTexture），可用于模拟。&lt;br /&gt;
*** Angle: 纹理投影角度（类似 Unity 聚光灯）。&lt;br /&gt;
*** Correct distortion: 修正宽角下直线可见的 cookie 失真。&lt;br /&gt;
** Cubemap: 立方体贴图投影遮罩。附加选项：&lt;br /&gt;
*** Projected cubemap: 立方体贴图资源。&lt;br /&gt;
** IES: 光照由 IES 文件数据调制。附加选项：&lt;br /&gt;
*** IES file: .ies 扩展名文件。&lt;br /&gt;
* Bitmask: 用于排除该光源影响特定 Lightmap Groups 的开关列表。&lt;br /&gt;
* Baked contribution: 决定应烘焙哪种类型的光照数据。仅在 Indirect 或 Shadowmask 模式下可见。可能值：&lt;br /&gt;
** Direct and Indirect: 直接光和间接光完全烘焙。&lt;br /&gt;
** Indirect only: 实时光提供直接光，仅烘焙间接光。&lt;br /&gt;
** Shadowmask and Indirect: 实时光提供直接光，但静态几何体阴影烘焙到单独贴图中，动态和静态阴影混合，间接光正常烘焙。&lt;br /&gt;
** Direct, Indirect, Shadowmask (custom lighting only): 与 Direct and Indirect 相同，同时生成 Shadowmask 用于自定义着色器。&lt;br /&gt;
* Indirect intensity: 该光的非物理 GI 倍增。自然光应为 1，可根据风格化场景修改。&lt;br /&gt;
* Shadowmask with falloff: 将完整光衰减（除距离外）烘焙到 Shadowmask（仅自定义着色器有用）。&lt;br /&gt;
* Legacy sampling: 使用 Bakery 原始更偏置的阴影采样策略。产生无噪点阴影，但宽半影可能出现条纹。禁用后使用无偏但更有噪点的技术。&lt;br /&gt;
&lt;br /&gt;
如果同一对象同时启用了 Unity 和 Bakery 光源，且设置不匹配，则会出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match lightmapped to real-time: 将 Unity 光的常用设置复制到 Bakery 光。&lt;br /&gt;
* Match real-time to lightmapped: 将 Bakery 光的常用设置复制到 Unity 光。&lt;br /&gt;
&lt;br /&gt;
{{note| 从物理角度来看，Bakery 点光源的“Intensity”为 Candela 除以 Pi。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Volume ===&lt;br /&gt;
[[File:Voldemo notlonely.gif|由 BakeryVolume 照亮的动态门（动态 GIF，由 NOTLonely 制作）]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
体积（Volumes）生成存储每个体素光探针的 3D 纹理（L1 球面调和和阴影贴图），使其成为常规 Unity 光探针的可行替代方案。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Unity Light Probes&lt;br /&gt;
! Unity LPPV&lt;br /&gt;
! Bakery Volumes&lt;br /&gt;
|-&lt;br /&gt;
| 手动放置每个光探针&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 否&lt;br /&gt;
|-&lt;br /&gt;
| 在一个物体上插值多个光探针&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 运行时可移动&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 可以放入预制件&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 完整脚本 API&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| “Ringing” 伪影&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 可能出现&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 可能出现&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 已修正&lt;br /&gt;
|-&lt;br /&gt;
| 去噪&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 运行时开销&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | CPU：低开销；GPU：低开销&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | CPU：中等开销；GPU：中等开销&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#e4ead3;&amp;quot; | CPU：无开销；GPU：中等开销&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bakery Volume 是一个与一组 3D 纹理（3 个 SH 纹理和一个可选的 shadowmask）关联的边界盒，使其非常易于使用和编程。Volumes 可以在运行时轻松地交换、移动、加载或卸载，也可以与预制件关联。它们不需要任何 Light Probe Groups 或手动探针布置；整个 Volume 都由均匀的探针体素网格填充。光/影泄漏会自动像处理光照贴图一样修复（尽管对于较大的体素尺寸，薄的双面墙可能会出现问题，但可以通过在不同侧使用不同 Volume 避免）。由于体素网格的均匀特性，也可以对其应用类似光照贴图的降噪，这是常规光探针无法做到的。此外，Bakery 着色器使用 [https://drive.google.com/file/d/1MK6Clw93q8ljijRjb4gQOzzaIjn1uF9Y/view Geomerics] 采样技巧，完全消除了高对比度 HDR 光照下 SH 有时会产生的 “ringing” 伪影。&lt;br /&gt;
&lt;br /&gt;
因此，Volumes 可以为动态物体生成干净、精细、高质量的烘焙光照（即来自静态物体并影响动态物体的光照，而不是相反）。&lt;br /&gt;
&lt;br /&gt;
Volume 方法的唯一缺点是每像素着色开销较高。其开销类似于 LPPV（随着屏幕上受体素影响的像素数量而缩放），但与 LPPV 不同的是，一旦烘焙完成，Volumes 本身不会再更新。多个 Volume 的混合可以通过稍微重叠它们来避免。&lt;br /&gt;
&lt;br /&gt;
====设置 Volume 变换====&lt;br /&gt;
[[File:Bvolgizmo.jpg|thumb|Volume 控制柄]]&lt;br /&gt;
当 BakeryVolume 被添加到一个 GameObject 时，场景视图中会出现一个边界盒控制柄。拖动小方块即可缩放它。&lt;br /&gt;
&lt;br /&gt;
还有其他方法可以更改 Volume 的大小和位置：&lt;br /&gt;
&lt;br /&gt;
* 将任何可渲染的 GameObject 拖入 “Wrap to object” 字段。Volume 会包裹该对象（及其子对象），以将它们完全包含在内。&lt;br /&gt;
* 如果同一个对象上添加了 Box Collider，则会出现 “Set from box collider” 和 “Set to box collider” 按钮。可以用它们快速在 Volume 和 Collider 之间复制数值。&lt;br /&gt;
&lt;br /&gt;
====分辨率====&lt;br /&gt;
当启用 “Adaptive resolution” 时，体素数量由 “Voxels per unit” 控制。禁用它可以手动输入分辨率。对于大多数 1 单位 = 1 米 的游戏来说，一个合理的 “Voxels per unit” 值是 2，但在某些情况下（例如动态门）使用较小但更高分辨率的 Volume 会更有利。&lt;br /&gt;
&lt;br /&gt;
====其他设置====&lt;br /&gt;
&lt;br /&gt;
* Enable baking: 是否需要（重新）计算 Volume？禁用可防止覆盖已有数据。&lt;br /&gt;
* Denoise: 在烘焙 Volume 后应用去噪。推荐用于高分辨率 Volume。避免用于覆盖许多光源的低分辨率 Volume，因为去噪器难以区分实际内容和噪声。&lt;br /&gt;
* Global: 自动将此 Volume 分配给所有兼容 Volume 的 Shader，除非它们有覆盖设置。内部会调用 Shader.SetGlobalTexture()/SetGlobalVector()。&lt;br /&gt;
====使用方法====&lt;br /&gt;
Volumes 可以分配给使用 Volume 感知 Shader 的对象。Bakery 自带实现该功能的 “Bakery Standard” Shader，以及 HDRP 和 URP 的 Shader 图。请查看 example_volumes 场景，了解应用 Volume 的各种方式。&lt;br /&gt;
&lt;br /&gt;
====提示====&lt;br /&gt;
&lt;br /&gt;
* 确保查看示例。&lt;br /&gt;
* 如果两个 Volume 相连，让它们略微重叠。重叠大小应等于最大动态对象的尺寸。这样在运行时简单切换 Volume 就能正常工作。&lt;br /&gt;
* 仅在动态对象实际可达的区域放置 Volume。例如，使用玩家高度限制 Volume 的高度。&lt;br /&gt;
&lt;br /&gt;
====旋转 Volumes====&lt;br /&gt;
如果启用 “Rotate around Y” 选项，Volumes 可以绕 Y 轴旋转。旋转开销非常低，只使用 2 个额外的浮点数据（预计算的角度 sin/cos）。&lt;br /&gt;
&lt;br /&gt;
还可以在运行时旋转 Volumes（Experimental -&amp;gt; “Support rotation after bake” 以及 Bakery Shader 中的类似选项），这种情况下 Volume 必须在初始旋转为零时进行烘焙。&lt;br /&gt;
&lt;br /&gt;
在 URP 中，这种动态旋转可以与 `BakeryURPVolumeGraphRotatable.shadergraph` 一起使用。&lt;br /&gt;
&lt;br /&gt;
对于全局 Volume，动态旋转会在组件被（重新）启用或调用 `volume.SetGlobalParams()` 时更新。使用局部旋转 Volume 时，需要手动在材质或 MaterialPropertyBlock 上设置旋转：&lt;br /&gt;
{{code|&amp;lt;nowiki&amp;gt;SetMatrix(&amp;quot;_VolumeMatrix&amp;quot;, volume.GetMatrix())&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
====技术信息====&lt;br /&gt;
Volumes 可以自动工作（查看示例场景），也可以通过脚本控制其使用方式。&lt;br /&gt;
&lt;br /&gt;
可以通过组件的以下公共属性获取 Volume 数据：&lt;br /&gt;
&lt;br /&gt;
* `bakedTexture0`：存储 L0 RGB 系数和 L1 Z 红色通道在 alpha 中。&lt;br /&gt;
* `bakedTexture1`：存储 L1 X RGB 系数和 L1 Z 绿色通道在 alpha 中。&lt;br /&gt;
* `bakedTexture2`：存储 L1 Y RGB 系数和 L1 Z 蓝色通道在 alpha 中。&lt;br /&gt;
* `bakedMask`：存储体积阴影遮罩。&lt;br /&gt;
* `bounds`：Volume 的包围盒。&lt;br /&gt;
&lt;br /&gt;
所有 `bakedTexture*` 使用 RGBAHalf（每体素 8 字节）格式，mask 使用 ARGB32（每体素 4 字节）。阴影遮罩也可以使用单通道 R8 格式（每体素 1 字节）。&lt;br /&gt;
&lt;br /&gt;
因此 Volume 的字节大小 = width * height * depth * 3 * 8 + （仅当使用阴影遮罩时）width * height * depth * 4（或使用 R8 mask 时为 width * height * depth）。&lt;br /&gt;
&lt;br /&gt;
[[使用手册#Compress_volumes|可以对 Volume 启用纹理压缩]]，使其体积显著减小。&lt;br /&gt;
&lt;br /&gt;
采样 Volume 需要特殊 Shader，这些 Shader 已包含在 Bakery 中。要在自定义 Shader 中添加 Volumes，请查看 HDRP/URP 包中包含的 `BakeryVolume_float()` 函数（位于 `BakeryDecodeLightmap.hlsl`）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Light Filter ===&lt;br /&gt;
[[File:Output optimized.gif|彩色玻璃，如在 &amp;quot;Bakery Real-Time Preview&amp;quot; 中所见。Bakery lightmapper 烘焙出的结果相同。]]&lt;br /&gt;
&lt;br /&gt;
将渲染器标记为光过滤器（Light Filter）。过滤器会用其颜色着色所有直接和间接光线，类似于现实中的光学滤镜，从而实现彩色透明效果（例如彩色玻璃）。唯一的参数是用于着色的纹理。&lt;br /&gt;
&lt;br /&gt;
* 光过滤器对象仍然会像其他对象一样接收光照贴图。&lt;br /&gt;
* 过滤器不会散射或模糊光线（如需此效果，请尝试 [[Subsurface_scattering|Subsurface Scattering]] 或 [[使用手册#Backface_GI|Backface GI]]）。&lt;br /&gt;
* 过滤器可以产生带颜色的阴影。如果灯光使用 [[使用手册#Shadowmask|Shadowmask]] 模式，则结果只会保存 R 通道（因为 Unity 仅支持单通道遮罩）。对于完全烘焙的阴影，则没有限制。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Sector ===&lt;br /&gt;
参见 '''[[Partial_scene_baking|Partial scene baking]]'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Always Render ===&lt;br /&gt;
如果添加到一个物体上，Bakery 在烘焙时将始终考虑该物体，即使它的 Renderer 被禁用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
=== Bakery Pack As Single Square ===&lt;br /&gt;
如果添加到一个物体上，Bakery 会将该物体及其子物体的 UV 视为单个组合方块，在自动图集打包或 Lightmap Group 的 Pack Atlas 模式下，它们之间永远不会被移动。整个子层级将作为一个整体打包。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
=== Bakery Shared LOD UV ===&lt;br /&gt;
如果添加到一个 LODGroup 上，将标记所有同名 LOD 共享同一个光照贴图。默认情况下，每个 LOD 网格会获得独立的光照贴图，占用图集空间；但如果已知同一个物体的 LOD 拥有相似的 UV2（或者在没有 UV2 且 UV1 不重叠的情况下），它们可以映射到图集的同一部分，从而节省内存。&lt;br /&gt;
这种技术也称为 [https://github.com/laurenth-personal/LODLightmapScripts/ Lightmap Stealing]。&lt;br /&gt;
&lt;br /&gt;
= 材质兼容性 =&lt;br /&gt;
&lt;br /&gt;
=== 漫反射和发光 ===&lt;br /&gt;
Bakery 利用 [https://docs.unity3d.com/Manual/MetaPass.html Meta Pass] 系统支持大多数 Unity 材质。所有内置、Surface、URP 和 HDRP 着色器都已经定义了正确的 Meta Pass。&lt;br /&gt;
&lt;br /&gt;
如果你使用的是 Unlit 着色器，需要按照 Unity 文档手动添加 Meta Pass。&lt;br /&gt;
&lt;br /&gt;
如果未定义该 Pass，Bakery 将假定 {{codeVar|_MainTex}}、{{codeVar|_BaseColorMap}} 或 {{codeVar|_Color}}（如果未设置纹理）为材质的漫反射（Albedo），并将 {{codeVar|_EmissionMap}} 和 {{codeVar|_EmissionColor}} 作为发光颜色。&lt;br /&gt;
&lt;br /&gt;
为了使发光生效，[https://docs.unity3d.com/ScriptReference/Material-globalIlluminationFlags.html Material.globalIlluminationFlags] 必须设置为 [https://docs.unity3d.com/ScriptReference/MaterialGlobalIlluminationFlags.BakedEmissive.html MaterialGlobalIlluminationFlags.BakedEmissive]。标准着色器会自动设置此值。&lt;br /&gt;
&lt;br /&gt;
=== 不透明度 ===&lt;br /&gt;
[[File:Upload 2019-1-25 0-4-30.png|thumb|材质参数被转换为 Cutout（默认）]]&lt;br /&gt;
[[File:Alphacombos dither.jpg|thumb|通过“Dither Transparency”选项添加半透明值]]&lt;br /&gt;
[[File:Alphacombos filter.jpg|thumb|Light Filter 组件用于红色平面，生成彩色阴影]]&lt;br /&gt;
&lt;br /&gt;
默认情况下，Bakery 始终从 {{codeVar|_MainTex}}、{{codeVar|_BaseColorMap}} 或 {{codeVar|_BaseMap}} 的 alpha 值获取全分辨率的不透明度，并将其视为 Cutout（1 位透明）。&lt;br /&gt;
&lt;br /&gt;
当启用 '''Dither Transparency''' 选项时，半透明值会自动转换为可变蓝噪声，然后被滤波/模糊，产生部分透明效果（以前可以通过自定义手动抖动贴图实现，但从 v1.97 起自动完成）。&lt;br /&gt;
&lt;br /&gt;
为了使不透明度生效，着色器的 [https://docs.unity3d.com/Manual/SL-SubShaderTags.html RenderType 标签] 必须为以下值之一：&lt;br /&gt;
&lt;br /&gt;
* {{codeVar|Transparent}}&lt;br /&gt;
* {{codeVar|TransparentCutout}}&lt;br /&gt;
* {{codeVar|TreeLeaf}}&lt;br /&gt;
&lt;br /&gt;
如果存在名为 {{codeVar|_Cutoff}} 的属性，它将影响 Cutout（因此 Standard 着色器的 Cutoff 滑块会自动生效）。&lt;br /&gt;
&lt;br /&gt;
在没有 Dither Transparency 的情况下，如果材质 RenderType 为 {{codeVar|Transparent}} 或 {{codeVar|TreeLeaf}}，则 {{codeVar|_Color}} 的 alpha 值会额外修改 Cutoff：&lt;br /&gt;
''finalCutoff = 1 - (1 - cutoff) * alpha''&lt;br /&gt;
&lt;br /&gt;
对于彩色透明效果，请使用 [[Manual#Bakery_Light_Filter|Light Filter]] 组件。&lt;br /&gt;
&lt;br /&gt;
有关漫反射半透明效果，请参考 [[#Backface GI|Backface GI]] 和 [[subsurface scattering]]。&lt;br /&gt;
&lt;br /&gt;
==== Alpha Meta Pass ====&lt;br /&gt;
从 v1.9 起，Bakery 还支持指定基于自定义着色器的透明度，但这需要使用兼容的着色器。要使用 ''Alpha Meta Pass''，需要执行以下步骤：&lt;br /&gt;
&lt;br /&gt;
* 在着色器中添加一个名为 '''BAKERY_META_ALPHA_ENABLE''' 的属性。例如：&lt;br /&gt;
  {{code|&amp;lt;nowiki&amp;gt;[HideInInspector] BAKERY_META_ALPHA_ENABLE (&amp;quot;Enable Bakery alpha meta pass&amp;quot;, Float) = 1.0&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
* 确保 RenderType 标签设置为上文提到的某个值。&lt;br /&gt;
* 声明一个名为 '''META_BAKERY''' 的 Pass。&lt;br /&gt;
* 在该 Pass 中检查 '''unity_MetaFragmentControl.w''' 是否非零，如果是，则返回计算出的透明度值。&lt;br /&gt;
&lt;br /&gt;
示例可参考包内的 ''Baked_Alpha_meta.shader''。&lt;br /&gt;
&lt;br /&gt;
注意：当前 Alpha Meta Pass 需要将 Light Probe Mode 设置为 L1 或 L2。&lt;br /&gt;
&lt;br /&gt;
=== Normal mapping ===&lt;br /&gt;
自定义表面法线可以与 [[#Baked Normal Maps|烘焙法线贴图]] 模式一起使用。不幸的是，Unity 的 Meta Pass 默认不输出法线信息，因此默认情况下，法线取自名为 {{codeVar|_BumpMap}} 的贴图，并通过 {{codeVar|_MainTex_ST}} 进行额外变换。&lt;br /&gt;
&lt;br /&gt;
然而，可以制作完全自定义的着色器，带有高级法线映射功能（例如混合多层法线），并使其兼容烘焙。要实现这一点，需要执行以下步骤：&lt;br /&gt;
&lt;br /&gt;
1. 在着色器中定义一个 Meta Pass，具体方法请参考 [https://docs.unity3d.com/Manual/MetaPass.html#ExampleMetaPassUnity 文档]。&lt;br /&gt;
&lt;br /&gt;
2. 将该 Pass 命名为 {{codeVar|&amp;quot;META_BAKERY&amp;quot;}}，而不仅仅是 {{codeVar|&amp;quot;META&amp;quot;}}。&lt;br /&gt;
&lt;br /&gt;
3. 包含文件 {{codeVar|&amp;quot;BakeryMetaPass.cginc&amp;quot;}}。&lt;br /&gt;
&lt;br /&gt;
4. 添加 {{codeVar|#pragma vertex vert_bakerymt}}。&lt;br /&gt;
&lt;br /&gt;
5. 如果 {{codeVar|unity_MetaFragmentControl.z}} 变量不为 0，着色器应返回世界空间法线。返回的法线应使用 {{codeVar|BakeryEncodeNormal}} 函数编码。&lt;br /&gt;
&lt;br /&gt;
在 Assets/Bakery/examples/shaders 中包含了两个实现了扩展 Meta Pass 的示例着色器。&lt;br /&gt;
&lt;br /&gt;
你也可以复制并修改 BakeryMetaPass.cginc 以满足你的需求，例如从顶点着色器传递额外数据。&lt;br /&gt;
&lt;br /&gt;
=== 正/背面 ===&lt;br /&gt;
无论着色器使用何种剔除模式，Bakery 都将所有背面视为不透明，这意味着任何直接光线都不会穿过背面，就像它不会穿过正面一样。&lt;br /&gt;
然而，如果使用 [[使用手册#Backface_GI|Backface GI]]，背面可以部分发出正面接收到的光照。&lt;br /&gt;
&lt;br /&gt;
= 扩展 Lightmap Parameters 资源 =&lt;br /&gt;
[[File:Lp.jpg|thumb|扩展 Lightmap Parameters]]&lt;br /&gt;
类似于 Bakery 的 [[#Bakery_Lightmap_Group_Selector|Lightmap Group]]，Unity 也有 [https://docs.unity3d.com/Manual/class-LightmapParameters.html Lightmap Parameters]，可以作为资源创建并分配给 Mesh Renderer。它们的逻辑有相似之处也有不同之处：&lt;br /&gt;
&lt;br /&gt;
* Lightmap Group 的主要用途是将多个对象组合到同一个图集。此外，它还允许覆盖该图集的烘焙设置。&lt;br /&gt;
* Lightmap Parameters 主要用于覆盖对象的烘焙设置，但通过使用“Baked Tag”选项，它们也可以影响打包：具有不同 Baked Tag 的对象将永远不会共享同一个图集。&lt;br /&gt;
&lt;br /&gt;
由于有些用户更习惯 Lightmap Parameters 的工作流程，Bakery 现在支持并扩展了它们：&lt;br /&gt;
&lt;br /&gt;
* Bakery 会遵循 Baked Tag 设置。&lt;br /&gt;
* Lightmap Parameters UI 中将显示额外的 Bakery 特定选项。有关其含义，请参考 [[#Bakery_Lightmap_Group_Selector|Lightmap Group]] 部分。&lt;br /&gt;
&lt;br /&gt;
= 项目设置 =&lt;br /&gt;
一些全局设置可以在 Project Settings -&amp;gt; Bakery GPU Lightmapper 中调整（此选项仅在 Unity 2018.3 或更新版本可见；旧版本请编辑 BakeryProjectSettings.asset）：&lt;br /&gt;
&lt;br /&gt;
* Mipmap lightmaps：启用光照贴图的 mipmap。随着图集变小，可能会导致 UV 图块之间的泄漏；另一方面，它可以减少远处高分辨率光照贴图的锯齿。总体上，建议对非常远的物体使用单独烘焙的 LOD 以及较低分辨率的光照贴图。&lt;br /&gt;
* Color file format：常规 HDR 颜色光照贴图的文件格式。可选值：&lt;br /&gt;
**HDR：Radiance HDR 格式（默认）。可用多种图像编辑器打开。&lt;br /&gt;
**Asset：Unity 原生格式。可自定义 mipmap 数量。&lt;br /&gt;
* Mask/Direction file format：额外 LDR 地图的格式，如阴影遮罩或方向数据。可选值：&lt;br /&gt;
**TGA：8 位 Targa（默认）。&lt;br /&gt;
**PNG：8 位 PNG。通常比 TGA 占用更少磁盘空间。&lt;br /&gt;
**Asset：Unity 原生格式。可自定义 mipmap 数量。&lt;br /&gt;
* Compress lightmaps：定义光照贴图资源的压缩行为。压缩光照贴图占用更少的显存，但可能会出现一些视觉伪影（例如色带或色斑），具体取决于压缩类型（移动端压缩问题请参见[[Troubleshooting#I_have_an_Android_project.2C_and_lightmaps_don.27t_look_good|此处]]）。可选值：&lt;br /&gt;
*** Compress but allow overriding asset: 新的光照贴图将在启用压缩的情况下创建。创建后，可以在 Inspector 中更改它们的压缩设置。修改后的值将在重新烘焙后保留（默认）。&lt;br /&gt;
*** Force compress: 始终压缩所有光照贴图。&lt;br /&gt;
*** Force no compress: 始终生成未压缩的光照贴图。&lt;br /&gt;
* High quality direction: 为方向贴图启用“高”质量压缩。实际格式取决于平台。例如在 PC 上，它会从 DXT1 改为 BC7，这提供了更高的质量，但 VRAM 使用量会翻倍。&lt;br /&gt;
* Texel padding (default atlas packer): 定义在使用默认 atlas 打包器时，在光照贴图 atlas 中对象 UV 布局之间添加多少空白 texel。&lt;br /&gt;
* Texel padding (xatlas packer): 同上，但在使用 xatlas 时。&lt;br /&gt;
* Alpha Meta Pass resolution multiplier: 乘以 [[Manual#Alpha_Meta_Pass|Alpha Meta Pass]] 的分辨率，使在低分辨率光照贴图烘焙时仍能实现精确的基于 Shader 的切割效果。&lt;br /&gt;
* Volume render mode: 为所有 [[Manual#Bakery_Volume|Volumes]] 使用哪种 [[Manual#Render_mode|渲染模式]]？Auto 使用当前活动的渲染模式（默认）。&lt;br /&gt;
* Delete previous lightmaps before bake: 在烘焙新光照贴图之前，实际删除该场景中所有之前渲染的光照贴图文件。&lt;br /&gt;
* Log level: 定义烘焙过程中在控制台输出的信息量。可能的值：&lt;br /&gt;
** 0: 不输出任何内容。&lt;br /&gt;
** 1: 仅输出进度信息。&lt;br /&gt;
** 2: 仅输出警告。&lt;br /&gt;
** 3: 输出全部信息。&lt;br /&gt;
* Alternative scale in lightmap: 使渲染器属性 'Scale in Lightmap' 的行为更类似于 Unity 内置的行为。&lt;br /&gt;
* Align to texture compression blocks with xatlas: 使 xatlas 将 chart 对齐到 4x4 块边界，从而获得更适合压缩的结果。&lt;br /&gt;
* Generate smooth positions: 是否应调整采样位置以防止低多边形几何体在平滑法线下产生错误阴影？在使用法线差异极大的几何体时，可在极少数情况下禁用。技术说明见 [https://ndotl.wordpress.com/2018/08/29/baking-artifact-free-lightmaps/#shadowterm 这篇文章]。&lt;br /&gt;
* Smooth positions per-triangle: 是否应按三角形决定平滑/平面位置？在使用法线差异极大的几何体时，可在极少数情况下禁用。&lt;br /&gt;
* Use 'Receive GI' values: 在渲染器上考虑 “Receive Global Illumination” 值。最初 Bakery 会忽略它。&lt;br /&gt;
* Remove ringing in Legacy light probes: 在 Legacy 模式下启用更柔和的光探针卷积，以防止高对比度区域出现伪影。&lt;br /&gt;
* Always render reflection probes: 在每次 Render/Render Light Probes 后自动渲染反射探针。&lt;br /&gt;
* Ringing removal for L2 light probes: 对 [[Manual#Light_probe_mode|L2 光探针]] 应用去振铃处理。值越高，探针光照越平滑；这种平滑可以减少 [[https://docs.unity3d.com/6000.2/Documentation/Manual/light-probes-troubleshooting.html](https://docs.unity3d.com/6000.2/Documentation/Manual/light-probes-troubleshooting.html) 振铃] 伪影（如果存在）。&lt;br /&gt;
* Put menu under Tools: 将 Bakery 菜单放入 Tools 菜单下。&lt;br /&gt;
&lt;br /&gt;
如果任何格式设置为 Asset 且启用 mipmapping，会显示额外选项：&lt;br /&gt;
&lt;br /&gt;
* Maximum mipmap count: 定义 mipmap 的最大数量。例如，设置为 2，则 8K 光照贴图仅有两个额外 mipmap：4K 和 2K。更低分辨率将被省略，从而在 mipmapping 过程中限制泄漏伪影。&lt;br /&gt;
&lt;br /&gt;
= SkinnedMeshRenderer 支持 =&lt;br /&gt;
Bakery 自 v1.65 起支持蒙皮网格 (skinned meshes)。但是，有一些限制：&lt;br /&gt;
&lt;br /&gt;
* 某些 Unity 版本不支持蒙皮网格的 UV1，并会悄无声息地忽略 “Generate lightmap UVs”。请确保场景中实际使用的网格具有 UV1，并在可能的情况下使用非重叠的 UV0；&lt;br /&gt;
* UV 填充调整在蒙皮网格上不起作用（Unity 在尝试调用 Unwrap 函数时似乎会崩溃）；&lt;br /&gt;
* 蒙皮网格不能使用每顶点光照贴图 (per-vertex lightmaps)（引擎不支持带蒙皮的 additionalVertexStreams）。&lt;br /&gt;
&lt;br /&gt;
= Shader Tweaks =&lt;br /&gt;
[[File:Image2.jpg|thumb|左：默认双线性过滤。右：双三次过滤。]]&lt;br /&gt;
[[File:Image34.jpg|thumb|左：两个阴影都已烘焙。&amp;lt;br&amp;gt;中：球形阴影为动态，另一个阴影为静态。通过相乘组合在一起。&amp;lt;br&amp;gt;右：与中间相同，但使用默认最小值组合。]]&lt;br /&gt;
&lt;br /&gt;
Bakery 提供可选的着色器修改，可以应用到 Unity 着色器上，以改善光照贴图采样并使实时光照更接近光照贴图效果。着色器调整菜单可以通过 Bakery-&amp;gt;Shader Tweaks 访问。&lt;br /&gt;
&lt;br /&gt;
这些选项会修补基础 Unity 着色器包含文件（来自 CGIncludes 文件夹），这些文件被大多数内置和第三方着色器使用。所有修改都会影响使用该版本编辑器打开的所有项目，但也可以轻松恢复。着色器调整会影响标准和表面着色器的工作方式。HDRP、URP 以及其他 SRP 不受影响。&lt;br /&gt;
&lt;br /&gt;
所有可用修改显示为按钮。点击按钮应用修改，按钮将保持按下状态。再次点击按钮即可移除修改。目前可用选项：&lt;br /&gt;
&lt;br /&gt;
{{note| 可能需要以管理员身份运行 Unity 编辑器以使 CGIncludes 修补生效}}&lt;br /&gt;
&lt;br /&gt;
* Use bicubic interpolation for lightmaps: 光照贴图将使用双三次插值代替默认双线性。此调整能很好地修复低分辨率光照贴图的许多锯齿边缘。目前仅适用于 DX11 和现代主机，其他平台仍使用双线性。&lt;br /&gt;
* Use multiplication for shadowmask: 使用相乘代替最小值组合静态和动态阴影。出于未知原因，Unity 默认使用最小值操作符，这会产生一些乘法不存在的伪影。&lt;br /&gt;
* Use physical light falloff (forward): 用更物理正确的平方反比替换实时点光/聚光灯的默认衰减。“Range” 只会在边缘略微淡出（与 Bakery 光源启用 Physical Falloff 复选框效果一致）。仅影响 Forward 渲染器。详情见 [[Point Light Attenuation]]。&lt;br /&gt;
* Use physical light falloff (deferred): 同上，但仅影响 Deferred 渲染器。&lt;br /&gt;
&lt;br /&gt;
'''衰减调整在 Unity &amp;gt;2017 版本上可能无法完全生效。此外，SRP 默认已经使用正确的衰减。'''&lt;/div&gt;</summary>
		<author><name>Mr F</name></author>
		
	</entry>
	<entry>
		<id>https://geom.io/bakery/wiki/index.php?title=Manual&amp;diff=1826</id>
		<title>Manual</title>
		<link rel="alternate" type="text/html" href="https://geom.io/bakery/wiki/index.php?title=Manual&amp;diff=1826"/>
		<updated>2025-11-05T14:01:34Z</updated>

		<summary type="html">&lt;p&gt;Mr F: /* Shader Tweaks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== System requirements ==&lt;br /&gt;
To use Bakery you'll need:&lt;br /&gt;
* Windows (7 or higher) PC.&lt;br /&gt;
* Nvidia GPU. Minimum supported model is Kepler (GeForce 650 or newer. For Quadro cards check the specs).&lt;br /&gt;
* 64-bit Unity editor. Bakery was tested on all versions from 5.6 to 6 or higher.&lt;br /&gt;
&lt;br /&gt;
{{note|System requirements are for developer machine, not target platform. You can use lightmaps baked with Bakery anywhere.}}&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
* Make sure your project does not have any script compilation errors, as it will prevent Bakery scripts from compiling as well.&lt;br /&gt;
* Make sure you have the latest GPU driver. [https://www.nvidia.com/Download/index.aspx?lang=en-US Update it] if needed.&lt;br /&gt;
&lt;br /&gt;
'''Use the Game-Ready (standard) driver, not the &amp;quot;Studio&amp;quot; one.'''&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
1. Import Bakery to your project via [https://assetstore.unity.com/packages/tools/level-design/bakery-gpu-lightmapper-122218 Asset Store].&lt;br /&gt;
&lt;br /&gt;
2. Unity will show a list of files to import. If it's your first time using Bakery, it is recommended you just '''click Import'''. Experienced users may want to untick the ''examples'' folder for a more lightweight installation.&lt;br /&gt;
&lt;br /&gt;
Files will be imported to Assets/Bakery and Assets/Editor/x64/Bakery. These folders can be moved later.&lt;br /&gt;
&lt;br /&gt;
3. Unity will then import Bakery and compile the scripts. It may show a window like this:&lt;br /&gt;
&lt;br /&gt;
[[File:Goahead.png]]&lt;br /&gt;
&lt;br /&gt;
In which case you should click &amp;quot;Go Ahead&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
You should now see Bakery menu added to the editor:&lt;br /&gt;
&lt;br /&gt;
[[File:bmenu.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Quickstart ==&lt;br /&gt;
&lt;br /&gt;
1. Add some model or primitive and mark it as Static.&lt;br /&gt;
&lt;br /&gt;
'''Meshes must have non-overlapping UV for lightmapping. UV2 is used if present (otherwise UV1). If you did not unwrap models for lightmapping, make sure to check [https://docs.unity3d.com/Manual/LightingGiUvs-GeneratingLightmappingUVs.html Generate Lightmap UVs] on the asset.''' Unity primitives already have correct UV2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Staticmarked.jpg|320px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Select Directional Light (the one Unity created for you) and add '''Bakery Direct Light''' component to it.&lt;br /&gt;
{{note| Bakery and Unity use separate light source components.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Bakery Direct Light has many options to tweak, but you can easily match it to Unity light. Click '''Match lightmapped to real-time'''. Now Bakery light should have the same yellowish color as Unity’s default Directional.&lt;br /&gt;
&lt;br /&gt;
[[File:Matching.jpg|640px]]&lt;br /&gt;
&lt;br /&gt;
{{note| Direct Light component may complain about project not using linear light intensity. The problem is that by default Unity applies gamma correction to light source colors [https://twitter.com/guycalledfrank/status/1001108508614553600 incorrectly]. Correct mode can be enabled by [https://docs.unity3d.com/ScriptReference/Rendering.GraphicsSettings-lightsUseLinearIntensity.html scripting], and that’s what the “Fix” button does. If you already have many light sources set up in non-linear intensity mode, and you don’t want to change them again, you may skip fixing. Even if you press “Fix”, you can always revert the change anytime.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. To get shadowed ambient lighting, create Skylight (Bakery-&amp;gt;Create-&amp;gt;Skylight).&lt;br /&gt;
&lt;br /&gt;
[[File:Menusky.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Select Skylight, give it some bluish color and click '''Match scene skybox to this light'''. This will make scene skybox match lighting exactly.&lt;br /&gt;
{{note| Matching Unity skybox to Bakery skylight is optional but useful for correctness, as to ensure that visible environment and in-engine reflection probes match baked lighting. Currently this option only works for Standard render pipeline.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Skycomp.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Click Bakery-&amp;gt;Render Lightmap. By default, Full Lighting mode is active. It will bake both direct and indirect contribution from all lights. If you want to combine real-time shadows with baked GI, change it to '''Indirect'''.&lt;br /&gt;
&lt;br /&gt;
[[File:Bakerywindow.jpg]]&lt;br /&gt;
&lt;br /&gt;
{{note| Bakery may complain that you are using old [https://docs.unity3d.com/Manual/LinearLighting.html gamma mode] and suggest to change it. If you care about quality of lighting, using Linear mode is highly recommended. You may ignore it if you already have a big project set up with incorrect gamma and don’t want to change it or when shipping to mobile devices that don't support it.}}&lt;br /&gt;
&lt;br /&gt;
7. Click '''Render'''.&lt;br /&gt;
&lt;br /&gt;
8. Done! You should now have baked GI:&lt;br /&gt;
&lt;br /&gt;
[[File:Bakedgi.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Render settings ==&lt;br /&gt;
&lt;br /&gt;
All render settings can be accessed via Bakery-&amp;gt;Render Lightmap. Settings are saved for every scene. The topmost option in Bakery window allows you to switch between Simple, Advanced and Experimental settings, each succeeding mode revealing more tweakable options. Simple mode is enough for most scenes and it's a good way to get started.&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render mode ===&lt;br /&gt;
Defines the type of lightmaps to bake. &lt;br /&gt;
&lt;br /&gt;
===== Full Lighting =====&lt;br /&gt;
Complete direct and indirect lighting for all Bakery lights.&lt;br /&gt;
{{note| On pre-2017.3 Unity versions if you have both Unity and Bakery components on the same object, you will need to disable Unity ones manually to avoid double brightness. On newer versions real-time effects are automatically disabled for baked lights, as with built-in lightmappers.}}&lt;br /&gt;
&lt;br /&gt;
===== Indirect =====&lt;br /&gt;
[[File:Image26.png|thumb|Comparison of different render modes supported by Unity]]&lt;br /&gt;
Basic mixed mode. It will look at the Baked Contribution selector on every light: if it’s set to ''Direct And Indirect'', the light is baked as in Full Lighting mode. If it’s set to ''Indirect Only'', only indirect contribution (GI) from this light is baked. In latter case you should keep both Unity and Bakery lights on the object, one giving real-time direct contribution, and another for precomputed GI.&lt;br /&gt;
&lt;br /&gt;
[[File:Indirectonly.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== Shadowmask =====&lt;br /&gt;
[[File:Image21.png|thumb|Left: completely baked light. Center: dynamic light with baked GI. Right: capsule shadow, bump and specular are dynamic, but cube shadow and GI are baked.]]&lt;br /&gt;
[[File:Image6.png|thumb|When camera gets far away enough or if dynamic shadows are disabled, the same scene will look like this]]&lt;br /&gt;
A more advanced mixed mode. It works by generating two types of lightmaps - one with baked color (as in Indirect mode), and another with shadows from static objects. It has several benefits:&lt;br /&gt;
* Real-time shadows can render only a handful of dynamic objects, instead of the whole scene.&lt;br /&gt;
* Real-time and baked shadows blend together properly.&lt;br /&gt;
* Real-time lights can render bump, specular and other surface effects, while still being occluded by high-quality baked shadows.&lt;br /&gt;
[https://docs.unity3d.com/Manual/LightMode-Mixed-Shadowmask.html More details]&lt;br /&gt;
&lt;br /&gt;
To enable this behaviour, you must have both Unity and Bakery lights on the same object, with Baked Contribution set to ''Shadowmask and Indirect''. Unmarked lights will be baked as in Indirect mode.&lt;br /&gt;
&lt;br /&gt;
[[File:Smask22.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== Distance Shadowmask =====&lt;br /&gt;
This checkbox is only visible if you chose shadowmask and simply toggles [https://docs.unity3d.com/Manual/LightMode-Mixed-ShadowmaskMode.html equally named setting] in project’s Quality Settings.&lt;br /&gt;
[https://docs.unity3d.com/Manual/LightMode-Mixed-DistanceShadowmask.html More details.]&lt;br /&gt;
{{note| Checkbox is not visible on Unity 5.6.x due to the lack of corresponding scripting API. Instead you can toggle it in Window-&amp;gt;Lighting-&amp;gt;Mixed Lighting-&amp;gt;Lighting Mode.}}&lt;br /&gt;
{{note| On Unity versions &amp;lt; 2017.3 rendering Shadowmask lightmaps will clear the light probes due to API limitations. They will need to be re-rendered again after bake. It shouldn’t happen on newer versions.}}&lt;br /&gt;
&lt;br /&gt;
===== Subtractive =====&lt;br /&gt;
Enables [https://docs.unity3d.com/Manual/LightMode-Mixed-Subtractive.html Subtractive] lighting mode. &lt;br /&gt;
&lt;br /&gt;
This option does not do anything special to lightmaps and, in fact, works just like Full Lighting.&lt;br /&gt;
&lt;br /&gt;
The only difference is that it also sets up real-time Unity lights to work with Subtractive mode (as it cannot be done through UI).&lt;br /&gt;
&lt;br /&gt;
You will need to additionally set up global subtractive parameters (like the global shadow color) in [https://docs.unity3d.com/Manual/GlobalIllumination.html#MixedLighting Unity lighting window].&lt;br /&gt;
&lt;br /&gt;
===== Ambient Occlusion Only =====&lt;br /&gt;
Only bakes AO. May be useful if you know what you're doing. Make sure to set up [[#Ambient_occlusion|AO options]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Directional mode ===&lt;br /&gt;
[[File:Image3.png|thumb|Comparison of different directional modes]]&lt;br /&gt;
Defines how directional information is baked. Standard lightmaps only store a single color per texel, while directional lightmaps give shaders a hint of how lighting changes over a hemisphere around the texel. This data is required to combine fully lightmapped areas with normal maps. Plugging it into the built-in [[#Bakery_shaders|Bakery shader]] can also produce approximate specular response.&lt;br /&gt;
&lt;br /&gt;
===== None =====&lt;br /&gt;
No directional data, single color per texel.&lt;br /&gt;
&lt;br /&gt;
===== Baked Normal Maps =====&lt;br /&gt;
Still no directional data, but normal maps are taken into account when rendering the lightmap. There is no additional runtime overhead. Since lightmaps usually have lower resolution than normal maps, the result may look blurry. Other problems include aliasing at distance due to lack of mipmapping and denoising step potentially smudging the detail. To learn how to use custom shaders with procedural normals in this mode, read [[#Normal_mapping|Normal Mapping]] section.&lt;br /&gt;
&lt;br /&gt;
===== Dominant Direction =====&lt;br /&gt;
This mode is similar to what Enlighten and Progressive bake in Unity. It is compatible will most shaders, only generates one additional map and the runtime overhead is minimal. The downside is that bump-mapping looks rather faint and gray-ish and can be quite different comparing to the same object under real-time lighting.&lt;br /&gt;
&lt;br /&gt;
===== RNM =====&lt;br /&gt;
Based on Radiosity Normal Mapping technique originally invented for HL2 ([https://steamcdn-a.akamaihd.net/apps/valve/2004/GDC2004_Half-Life2_Shading.pdf slides]) and later used in many games (e.g. Mirror’s Edge). It generates 3 HDR maps in total, being the most memory-demanding mode of all. Runtime overhead is still relatively low. This mode is more precise than Dominant Direction. It is better at reproducing surface contrast and handling colored lights affecting normal maps from different angles.&lt;br /&gt;
&lt;br /&gt;
===== SH =====&lt;br /&gt;
Based on “Precomputed Global Illumination in Frostbite” [https://media.contentapi.ea.com/content/dam/eacom/frostbite/files/gdc2018-precomputedgiobalilluminationinfrostbite.pdf paper]. This is the highest quality mode, giving much better surface contrast and representing differently colored lighting coming from different directions. Generates 4 maps in total, only one of them being HDR, therefore takes less memory than RNM. Runtime overhead is slightly higher than that of RNM.&lt;br /&gt;
&lt;br /&gt;
===== MonoSH =====&lt;br /&gt;
[[File:FY8Ru8hWIAAdYYH.jpg|thumb|Size/quality comparison of Dominant Direction, full SH and MonoSH]]&lt;br /&gt;
Same as SH, but using a monochromatic L1 directional coefficients. Similarly good surface contrast, although not accurately representing different colors shining from different directions at one texel; but good enough for many scenes. Only generates one additional map, so the VRAM usage/bandwidth is similar to Dominant Direction; in fact it's even smaller, due to Dominant Direction using RGBA maps, while MonoSH only needing RGB. The map is fed via the built-in directional lightmap system, but ''won't look correct with standard shaders''. Make sure to use a compatible shader.&lt;br /&gt;
&lt;br /&gt;
===== Limitations =====&lt;br /&gt;
&lt;br /&gt;
* RNM and SH/MonoSH can be only used with [[#Bakery_shaders|Bakery shader]] or require adjustments to your shaders.&lt;br /&gt;
* In RNM and SH modes, standard color lightmaps are not created. You need to either have Bakery shader on all materials in the scene, or use [[#Bakery_Lightmap_Group_Selector|Lightmap Groups]] to separate RNM/SH objects from the rest.&lt;br /&gt;
* RNM and SH maps are applied to objects using [https://docs.unity3d.com/ScriptReference/MaterialPropertyBlock.html MaterialPropertyBlock] and so may be not shown completely in Unity’s Lighting window.&lt;br /&gt;
* Dominant Direction, RNM and SH/MonoSH modes may require slightly more samples for GI and Light Meshes to get comparable quality.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Texels per unit ===&lt;br /&gt;
[[File:Texelscomp.jpg|thumb|1 vs 10 texels per unit]]&lt;br /&gt;
Approximate amount of lightmap texels per world unit. Affects the amount and resolution of generated lightmaps.&lt;br /&gt;
&lt;br /&gt;
Example values to get you started:&lt;br /&gt;
* Large outdoor area (a city): 1 - 5&lt;br /&gt;
* Medium outdoor area (a few alleys): 10-20&lt;br /&gt;
* High quality interior: 100&lt;br /&gt;
&lt;br /&gt;
It is assumed that scene scale is roughly 1 unit = 1 meter. Such scale is generally recommended when working in Unity for better navigation and for physics simulation. If your scale is different, multiply Texels accordingly.&lt;br /&gt;
&lt;br /&gt;
Keep in mind that Texels Per Unit is base resolution, but every object can be additionally tweaked using [https://docs.unity3d.com/Manual/class-MeshRenderer.html Scale in Lightmap] option on Mesh Renderers as well as [[#Scale per map type|Scale per map type]] in Bakery window.&lt;br /&gt;
&lt;br /&gt;
{{note| Objects with Scale in Lightmap set to 0 will not be baked, but will still cast shadows and affect GI.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Max resolution ===&lt;br /&gt;
Maximum lightmap size limit. If objects can't fit in a single lightmap (given current Texels Per Unit value), additional lightmaps will be allocated. Same 4 square objects can take four 512x512 maps or one 1024x1024.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bounces ===&lt;br /&gt;
[[File:Image36.png|thumb|Note how more bounces bring more light to closed spaces.]]&lt;br /&gt;
Defines how many times light rays should bounce off surfaces. Usually lower values are sufficient for outdoor scenes (e.g. a city), while higher values are required for more closed scenes (interiors, caves).&lt;br /&gt;
&lt;br /&gt;
While the slider is limited by 5 bounces, it is possible to type any amount of bounces into the number field.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Samples ===&lt;br /&gt;
[[File:Image7.png|thumb|Left: samples = 4, right: samples = 16. Denoising is off for illustrative purposes.]]&lt;br /&gt;
Affects quality of GI. Typical values are from 16 to 32.&lt;br /&gt;
&lt;br /&gt;
{{note| It is possible to type in any number, beyond the maximum slider value, but be aware that this number represents a square root of the final ray count, i.e. 32 is 1024 rays, 64 is 4096 rays, etc.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GPU Priority ===&lt;br /&gt;
While GPU is working on lightmaps, OS and other software may become less responsive. This option allows you to balance between baking speed and system responsiveness.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render ===&lt;br /&gt;
Bakes lightmaps for all opened scenes.&lt;br /&gt;
If [[Manual#Light_probe_mode|Light Probe Mode]] is set to L1 or L2, also bakes light probes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Render Light Probes ===&lt;br /&gt;
Bakes [https://docs.unity3d.com/Manual/LightProbes.html light probes] for all opened scenes.&lt;br /&gt;
&lt;br /&gt;
Note that to get correct mixed light shadowing on dynamic objects in Shadowmask mode you also need to enable [[Manual#Occlusion_probes|occlusion probes]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Render Reflection Probes ===&lt;br /&gt;
Bakes [https://docs.unity3d.com/Manual/class-ReflectionProbe.html reflection probes] for all opened scenes. This button is just for convenience and will call built-in engine reflection probe update.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update Skybox Probe ===&lt;br /&gt;
Bakes global diffuse and reflection probe for the current skybox. As with &amp;quot;Render Reflection Probes&amp;quot;, it just calls built-in engine functions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Occlusion probes ===&lt;br /&gt;
When rendering light probes, lets Unity bake occlusion probes using currently selected built-in lightmapper. Occlusion probes is additional data stored inside regular light probes, and it prevents dynamic objects from getting lit in shadowed areas. Currently there is no way to use custom occlusion probes in Unity, and it has to call its own lightmappers instead to do the job.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Warnings ===&lt;br /&gt;
These options will validate the scene after one of the Render buttons is pressed and show warning dialog boxes asking to continue or stop the baking process.&lt;br /&gt;
* Suppress all popups: don't show any dialog boxes after pressing Render.&lt;br /&gt;
* UV validation: will check if all models have fully correct lightmapping UVs - specifically if they lie within 0-1 range and don’t overlap.&lt;br /&gt;
* Overwrite check: will tell which lightmap files are going to be overwritten.&lt;br /&gt;
* Memory check: will tell a very approximate amount of video memory required.&lt;br /&gt;
* Sample count check: will check if any lights, GI or AO have unreasonable sample counts that can make GPU go out of available resources.&lt;br /&gt;
* Lightmapped prefab validation: validates Lightmapped Prefabs and notifies if some prefabs are going to be overwritten.&lt;br /&gt;
&lt;br /&gt;
== Advanced render settings ==&lt;br /&gt;
=== Light probe mode ===&lt;br /&gt;
Changes the way light probes are baked.&lt;br /&gt;
&lt;br /&gt;
* Legacy:  use Render Light Probes button to generate the probes. Point and directional lights are calculated within the lightmapper, while area/sky/indirect lighting is gathered by rendering a cubemap at each probe position. Results are stored as [https://docs.unity3d.com/ScriptReference/Rendering.SphericalHarmonicsL2.html L2 spherical harmonics]. The downsides are slow cubemap rendering performance and possible mismatch between lightmaps and probes in cases where shaders in your game do not physically represent lit surfaces or your project is set up for mobile (Unity can clip high intensity values away).&lt;br /&gt;
&lt;br /&gt;
* L1: light probes will be rendered together with lightmaps when you click Render. This option provides superior baking performance and will guarantee that probe lighting matches the lightmaps. Results are stored as L1 spherical harmonics (can be still used by regular shaders). Results can be further improved by using Non-Linear Light Probe SH option in [[#Bakery_shaders|Bakery shader]].&lt;br /&gt;
&lt;br /&gt;
* L2: superior quality (full L2 spherical harmonics). As with L1, automatically rendered together with lightmaps. Negligible performance impact compared to L1. Should look OK with all shaders. Probe contrast/directionality/ringing removal can be tweaked via Project Settings -&amp;gt; Bakery -&amp;gt; &amp;quot;Ringing removal for L2 light probes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''There seems to be a bug in Unity 2019.3 preventing Legacy light probe colors from being properly saved IF [[Manual#Occlusion_probes|occlusion probes]] option is enabled. L2 mode is now default and recommended when using occlusion probes.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Asset UV Processing ===&lt;br /&gt;
Configures UV padding adjustment for assets. Possible values:&lt;br /&gt;
* Don't change: don't touch the assets.&lt;br /&gt;
* Adjust UV padding: will look for models with auto-generated UVs (“Generate Lightmap UVs” on the asset) and adjust them further to have proper padding between UV islands per-mesh. Model-wide Pack Margin in importer settings is ignored. Optimal values are calculated instead, given area of each mesh and lightmap resolution.&lt;br /&gt;
* Adjust UV padding for new meshes only: same, but skips any models that were previously adjusted at least once.&lt;br /&gt;
* Remove UV adjustments: reverts all previous UV adjustments, makes auto-unwrapped models look they way Unity originally unwrapped them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser ===&lt;br /&gt;
Sets the desired denoiser. Possible values:&lt;br /&gt;
* Optix 5: uses OptiX 5.1 AI denoiser (previously known as &amp;quot;Legacy denoiser&amp;quot;). Runs on the GPU. Supported on everything from [https://en.wikipedia.org/wiki/Kepler_(microarchitecture) Kepler] (typically GeForce 6xx) to [https://en.wikipedia.org/wiki/Turing_(microarchitecture) Turing] (typically Geforce 20xx). Not supported on [https://en.wikipedia.org/wiki/Ampere_(microarchitecture) Ampere] (30xx). OptiX 5.1 uses a static training dataset which is embedded into it, meaning it is not affected by the driver implementation.&lt;br /&gt;
* Optix 6: uses OptiX 6.0 AI denoiser (previously the default option). Runs on the GPU. Seems to fail on Kepler (6xx) GPUs, but runs on everything newer, including Ampere (30xx). Since 6.0 the training dataset for the OptiX denoiser is in the driver. Before driver v442.50 its behaviour was similar to OptiX 5.1; however, after it NVIDIA has [https://forums.developer.nvidia.com/t/optix7-denoiser-different-results-with-different-version-of-drivers/117989/2 changed the dataset], and results can be different. The updated dataset may sometimes produce grid-like patterns and more bright edges (still fixable with [[Manual#Denoise:_fix_bright_edges|&amp;quot;Denoise: fix bright edges&amp;quot;]]), but it runs faster.&lt;br /&gt;
* Optix 7: uses OptiX 7.2 AI denoiser. Behaves similarly to OptiX 6.0, but might be better supported on Ampere (30xx).&lt;br /&gt;
* OpenImageDenoise: uses Intel Open Image Denoise library. Runs on the CPU (any CPU that supports SSE 4.1). Can be slightly slower than OptiX, but the quality is comparable.&lt;br /&gt;
* OpenImageDenoise2: uses Intel Open Image Denoise 2, CUDA mode. Runs on the GPU, performance is comparable to OptiX 6/7, quality is identical to the CPU version.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Adjust sample positions ===&lt;br /&gt;
Find best sample positions to prevent lighting leaks. Details of the algorithm are outlined [https://ndotl.wordpress.com/2018/08/29/baking-artifact-free-lightmaps/#leaks here]. In some cases (usually large and very low poly geometry with smooth normals) it may produce incorrect results, in which case you can disable it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Unload scenes before render ===&lt;br /&gt;
Unloads Unity scenes before baking to free up video memory. Complex scenes can take a few gigabytes of VRAM by simply being shown in editor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Denoise ===&lt;br /&gt;
[[File:Image31.png|thumb|Left: denoising off, right: denoising on.]]&lt;br /&gt;
If enabled, will apply denoising algorithm. Bakery uses [https://developer.nvidia.com/optix-denoiser Nvidia’s AI denoiser (OptiX)] or Intel's Open Image Denoise (if selected).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Fix Seams ===&lt;br /&gt;
[[File:Image22.png|thumb|Left: seams, right: seams are fixed.]]&lt;br /&gt;
If enabled, will attempt to blend seams created by UV discontinuities. Useful for smooth geometry, including Unity’s default sphere.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Split by scene ===&lt;br /&gt;
If multiple scenes are loaded at once, and this option is enabled, each scene will have its own set of lightmaps, not shared with others. It can be useful for limiting the amount of textures loaded when scenes are streamed at runtime.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hole filling ===&lt;br /&gt;
[[File:Holefilling.jpg|thumb|Hole filling off vs on.]]&lt;br /&gt;
If [[Manual#Atlas_Packer|Atlas Packer]] is set to xatlas, will try to fill every hole, resulting in more efficient atlases. For scenes with very complex geometry it can increase scene export time, but otherwise recommended.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Min resolution ===&lt;br /&gt;
Minimum lightmap size limit. Can be used to balance between many small but fully occupied lightmaps vs few incompletely filled.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Scale per map type ===&lt;br /&gt;
Allows you to scale the resolution of color/shadowmask/direction maps differently. For example, a common case would be to have low resolution indirect color but highly detailed shadowmask. Note that scaling is applied after the lightmaps are rendered, so it won’t save baking time. If “Adjust UV padding” is on, padding will be based on the lowest resolution map to prevent texel leaking.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Checker preview ===&lt;br /&gt;
[[File:Image12.png|thumb|Checker preview in action]]&lt;br /&gt;
If Show checker checkbox is on, Scene View will render a checkerboard pattern on top of visible objects to demonstrate lightmap texel size. This is useful to make sure you are using adequate values for Texels Per Unit and other resolution-affecting settings before you bake.&lt;br /&gt;
&lt;br /&gt;
Enabling checker preview will force Bakery to perform atlas packing. It can take some time, but shouldn’t be longer than a few seconds. Press Refresh checker to re-atlas the scene after you changed something to see changes.&lt;br /&gt;
&lt;br /&gt;
Checker preview also uses random colors to show how the scene will be split into different lightmaps.&lt;br /&gt;
&lt;br /&gt;
{{note| Checker preview currently does not show correct texel sizes for Terrains.}}&lt;br /&gt;
&lt;br /&gt;
==== Atlas preview ====&lt;br /&gt;
[[File:FN-TmhRXwAE9i2I.png|thumb|Atlas preview in action]]&lt;br /&gt;
Atlas preview button is visible when Checker preview is on. Clicking it will open a new window where the UV layouts of future lightmaps are shown. Click &amp;quot;&amp;lt;&amp;quot; &amp;quot;&amp;gt;&amp;quot; buttons to browse the lightmaps.&lt;br /&gt;
This is useful for checking out packing quality and lightmap count before baking.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Emissive boost ===&lt;br /&gt;
Multiplies any surface emission by this number.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Indirect boost ===&lt;br /&gt;
Multiplies all bounced lighting by this number. Same as Indirect Intensity on light components, but global.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Backface GI ===&lt;br /&gt;
[[File:Image30.jpg|thumb|Backface GI]]&lt;br /&gt;
[[File:Image35.png|thumb|Left: backface GI = 0, right: backface GI = 1. Note how shadowed areas receive more green lighting.]]&lt;br /&gt;
Determines how much light is passed through front faces to back faces and then bounced off by GI. This is especially useful for thin translucent surfaces like leaves. Values are in 0-1 range.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Ambient occlusion ===&lt;br /&gt;
[[File:Image15.png|thumb|Left: AO intensity = 0. Right: AO intensity = 1.]]&lt;br /&gt;
Simple non-physical ambient occlusion you can apply over final scene lighting for aesthetic purposes.&lt;br /&gt;
* Intensity: controls visibility of the AO effect. Value of 0 disables the effect.&lt;br /&gt;
* Radius: determines the ray distance used in the AO effect. Smaller values give localized occlusion (corners, wrinkles), while larger values make it more similar to Skylight, giving shadows from distant objects.&lt;br /&gt;
* Samples: affects the quality of ambient occlusion. Typical values are from 4 to 32.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dither transparency ===&lt;br /&gt;
Enables semi-transparent shadows by automatically dithering alpha textures. See [[Manual#Opacity|how Bakery interprets opacity maps]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== RTX Mode ===&lt;br /&gt;
Enables RTX hardware acceleration. Only RTX GPUs will benefit from this option. Minimum supported driver version is 418.&lt;br /&gt;
&lt;br /&gt;
Drivers can emulate RTX mode on most non-RTX Nvidia cards, but the result is usually slower.&lt;br /&gt;
&lt;br /&gt;
RTX mode '''must''' be enabled on Ampere (3xxx) or newer cards.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Export terrain trees ===&lt;br /&gt;
If enabled, painted terrain trees will affect lighting. Trees themselves will not be baked. Note that highest possible LOD level is used for every tree during baking. It is not recommended to use this option for rendering multi-kilometer forests with highly detailed models.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Terrain optimization ===&lt;br /&gt;
If enabled (default), Terrains use separate ray tracing technique to take advantage of their heightfield geometry. Otherwise they are treated like any other mesh. Terrain optimization significantly reduces memory footprint required for high-resolution landscapes. In some cases it can also make terrain baking faster, in other cases (especially with simple low-resolution landscapes) it might make sense to disable it.&lt;br /&gt;
&lt;br /&gt;
{{note| Terrain Optimization is not currently compatible with painted terrain holes. Disable it to make them work.}}&lt;br /&gt;
{{note| Terrain Optimization is only supported in non-RTX mode.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Light Mesh batch limit ===&lt;br /&gt;
If this value is above 0, combines many [[Manual#Bakery_Light_Mesh|Light Meshes]] into one, given they have identical settings and affect the same [[Manual#Bakery_Lightmap_Group_Selector|Lightmap Groups]], but limiting their total sample count to this value (I.e. if the limit is 64, it can combine 2 lights with samples=32 or 4 lights with samples=16, etc). This will increase performance in scenes with many Light Meshes. Be careful setting this value too high, as the GPU may hit the OS driver timeout while processing too many samples at once.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Compress volumes ===&lt;br /&gt;
If enabled, applies texture compression to volume 3D textures and switches Bakery shaders to a corresponding sampling mode. Not recommended for very low resolution volumes. Volume size may be increased to be a multiple of 4.&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
* Currently it can only compress to BC6H/BC7 texture formats (desktop/consoles).&lt;br /&gt;
* Volume compression is only supported on Unity 2020.1 or newer.&lt;br /&gt;
* Currently only Bakery shader for the standard rendering pipeline supports using compressed volumes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Samples multiplier ===&lt;br /&gt;
Multiplies all shadow and GI samples by the specified factor. Use it to quickly change between draft and final quality.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Tile size ===&lt;br /&gt;
Same as [[#GPU Priority|GPU Priority]], but instead of abstract priority you set tile size. Bakery splits lightmaps into smaller tiles and updates one at a time. Smaller size means more GPU work interruptions, and can make system more responsive.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Temp path ===&lt;br /&gt;
Temporary files folder. Bakery may require a few gigabytes of free space during rendering. Having this folder on SSD can make rendering slightly faster comparing to HDD. At the moment, this folder is not cleaned automatically. You can delete its contents anytime (except during rendering) manually or via Bakery -&amp;gt; Utilities -&amp;gt; Clear cache.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Output path ===&lt;br /&gt;
Lightmap folder. This is where all lightmap, and also lightprobe and vertex color assets will be saved. This path is relative to your Assets folder.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Use scene named output path ===&lt;br /&gt;
If this option is enabled, output path will be automatically set to a folder with the same name as the currently active scene (Assets/CurrentSceneName/). This is similar to how built-in Unity lightmappers behave.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render Selected Groups ===&lt;br /&gt;
Only bakes [[#Bakery_Lightmap_Group_Selector|Lightmap Groups]] containing selected objects.&lt;br /&gt;
Not only selected objects will be redrawn, but all Lightmap Groups they belong to. Other lightmaps will not be updated. If objects are not a part of some manually assigned group, then a part of the scene using the same lightmap will be rebaked.&lt;br /&gt;
&lt;br /&gt;
Currently it is more convenient to use [[Partial_scene_baking|Sectors for partial scene baking]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Beep on finish ===&lt;br /&gt;
If enabled, Bakery will play a sound when the bake is finished.&lt;br /&gt;
&lt;br /&gt;
== Experimental render settings ==&lt;br /&gt;
=== Unwrapper ===&lt;br /&gt;
If [[#Asset_UV_Processing|Adjust UV Padding]] is enabled, defines the unwrapper that will be used.&lt;br /&gt;
* Default: standard Unity unwrapper. Bakery will call [https://docs.unity3d.com/ScriptReference/Unwrapping.GenerateSecondaryUVSet.html Unwrapping.GenerateSecondaryUVSet] for every mesh with different padding parameters.&lt;br /&gt;
* xatlas: uses [https://github.com/jpcy/xatlas xatlas] by [https://github.com/jpcy jpcy], a modified version of [https://github.com/Thekla/thekla_atlas thekla_atlas] by [https://github.com/castano Ignacio Castaño]. thekla_atlas was used in The Witness ([http://the-witness.net/news/2010/03/graphics-tech-texture-parameterization/ blog post]).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Atlas Packer ===&lt;br /&gt;
Selects the algorithm to use when packing different object UV layouts into large lightmap atlases.&lt;br /&gt;
* Default: original algorithm Bakery used before v1.7.&lt;br /&gt;
* xatlas: uses xatlas.&lt;br /&gt;
&lt;br /&gt;
Some features are only supported with one atlas packer:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Default&lt;br /&gt;
! xatlas&lt;br /&gt;
|-&lt;br /&gt;
| [[Manual#Bakery_Lightmap_Group_Selector|Override resolution]]&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
|-&lt;br /&gt;
| Efficient LOD packing&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| [[Manual#Hole_filling|Hole filling]]&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that atlas packer can be also chosen separately for every Lightmap Group.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Export geometry and maps ===&lt;br /&gt;
If enabled, Bakery will export the scene to its format before rendering. If you are sure that geometry and textures of the scene and lightmap resolution settings were not changed (e.g. you are only tweaking GI or light settings), you can disable this checkbox to make next rendering faster.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update unmodified lights ===&lt;br /&gt;
If enabled, Bakery will recalculate light sources that didn’t change since last rendering. If you are only tweaking one light and don’t want to wait for other lights to re-render, you can disable this checkbox.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update modified lights and GI ===&lt;br /&gt;
If enabled, Bakery will recalculate GI and lights that were changed since last rendering.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== UV padding: increase only ===&lt;br /&gt;
Only visible if [[#Asset_UV_Processing|Adjust UV padding]] is on. By default, optimal UV padding for a model asset is calculated only based on currently loaded scenes. If there are multiple instances of the same model using different lightmap resolution, the smallest one will define padding, so spacing between UV charts is large enough to prevent them from leaking over each other. However, baking the same model in 2 different isolated scenes will possibly break UVs in previous scenes while optimizing for the new one. This checkbox allows to prevent such behaviour by never decreasing the padding value, so it will be always optimized for the lowest resolution instance ever baked.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoise: fix bright edges ===&lt;br /&gt;
[[File:Image19.png|thumb|Left: a bright edge is visible after denoising; Right: fixed.]]&lt;br /&gt;
Only visible if [[#Denoise|Denoise]] is on. Sometimes the neural net used for denoising may produce bright edges around shadows, like if a sharpening effect was applied. If this option is enabled, Bakery will try to filter them away. Denoising stage may get slightly slower, when enabled.&lt;br /&gt;
&lt;br /&gt;
This feature may also be used to filter &amp;quot;fireflies&amp;quot;, i.e. occasional bright dots from the lightmap.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Post-packing ===&lt;br /&gt;
Sometimes when rendering a scene, Bakery can split the lightmap into multiple sub-lightmaps, e.g. when baking different LODs or terrains.&lt;br /&gt;
Post-packing tries to minimize final atlas count by combining these sub-lightmaps in one texture.&lt;br /&gt;
It is recommended to keep this option enabled.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Combine with Enlighten real-time GI ===&lt;br /&gt;
If enabled, then when the Render button is pressed, it will first try to bake with Enlighten to calculate real-time GI. After that, regular Bakery lightmapping process will happen. Both baked and real-time GI will work together.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bake on remote server ===&lt;br /&gt;
Enables [[Network baking|network baking]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Presets ===&lt;br /&gt;
Currently shown under Render/Update buttons when settings are in Experimental mode.&lt;br /&gt;
* Click '''New''' to save all current settings to a preset file.&lt;br /&gt;
* By default, when a preset is active, all settings are grayed out to prevent overwriting the preset.&lt;br /&gt;
* Click '''Modify preset''' to be able to change settings and overwrite the preset.&lt;br /&gt;
* Presets can be swapped via the preset field. Disable preset usage by setting it to None.&lt;br /&gt;
&lt;br /&gt;
== Components ==&lt;br /&gt;
=== Bakery Lightmap Group Selector ===&lt;br /&gt;
&lt;br /&gt;
Specifies which '''Lightmap Group''' to use for the object and all of its children.&lt;br /&gt;
Lightmap Group is a term Bakery uses for a collection of objects sharing one lightmap. Groups have properties telling Bakery how to pack the objects, which lights should affect them, should the result be baked into a texture or vertices.&lt;br /&gt;
By default all static objects are automatically packed into multiple lightmaps groups (atlases), so you don’t have to worry. Defining groups manually should be only used for special purposes, for example:&lt;br /&gt;
* Marking certain objects use [[Vertex Lightmaps|per-vertex lightmap]] instead of textures.&lt;br /&gt;
* Baking a lightmap using exact unscaled UVs as they were in a modeling package.&lt;br /&gt;
* Grouping certain areas of the level to use single lightmap to facilitate resource streaming or to switch different baked lighting at runtime via scripts.&lt;br /&gt;
* Using Render Selected Groups button to only update grouped objects.&lt;br /&gt;
&lt;br /&gt;
To manually define a group, you create '''Lightmap Group Assets''', either by using Assets-&amp;gt;Create menu, or using the Create New button in the component. When using the Create New button, new asset will be created based on these forms:&lt;br /&gt;
* Name: name of the Lightmap Group Asset to create.&lt;br /&gt;
* Packing mode: this selector defines the packing mode of the Lightmap Group. There are 3 modes:&lt;br /&gt;
** Original UV: object and its children will be baked with unmodified UVs. No packing is performed. This is useful for models when multiple meshes share the same already packed UV layout.&lt;br /&gt;
** Pack Atlas: object and its children are packed into a dedicated texture atlas. Before v1.3 every packable child needed to have the component, but it’s no longer necessary. Every child will be packed as its own rectangle, except when Bakery auto-detects a child having non-overlapping sub-children, in which case multiple objects can use a single rectangle.&lt;br /&gt;
** Vertex: object and its children will use vertex-colored baked lighting instead of textures. Note that you’ll need a custom shader for this to work, like [[#Bakery_shaders|Bakery Shader]]. One simple shader (&amp;quot;Bakery/Simple Vertex Lightmapped&amp;quot;) is also included for demonstration and reference. [[Vertex Lightmaps|Learn more about vertex lightmaps.]]&lt;br /&gt;
* Directional mode: allows you to override [[#Directional mode|directional mode]] on the group. Options are the same except for Auto, which will simply use the global setting.&lt;br /&gt;
* Resolution: desired lightmap resolution.&lt;br /&gt;
* Auto-resolution: use [[Manual#Texels_per_unit|Texels Per Unit]] to determine closest power-of-two resolution.&lt;br /&gt;
* Atlas packer: select [[Manual#Atlas_Packer|atlas packing]] algorithm for this group.&lt;br /&gt;
* Bitmask: a list of toggles used to exclude light sources from affecting the lightmap. Every Bakery light source also has a bitmask setting. Lights only affects Lightmap Groups with which they share at least one of these toggles. Default settings mean all lights affect all lightmaps.&lt;br /&gt;
&lt;br /&gt;
[[File:Ts.jpg|thumb|Transparent selfshadow OFF vs ON: note how some single-sided but back-facing polygons become properly lit]]&lt;br /&gt;
&lt;br /&gt;
If you have a Lightmap Group with the Pack Atlas mode assigned, additional settings will appear on the component:&lt;br /&gt;
* Override resolution: override the resolution this object and its children occupy in the lightmap.&lt;br /&gt;
* Resolution: manually defined resolution. For example, if you have a lightmap with a resolution of 512 and it is assigned to 4 objects with override resolution set to 256, Bakery will generate a single 512x512 lightmap where each object takes exactly 256x256 square.&lt;br /&gt;
&lt;br /&gt;
If you select a Lightmap Group asset, additional experimental settings will be visible:&lt;br /&gt;
* [[Subsurface scattering|Subsurface scattering: (click to read more)]]&lt;br /&gt;
* Normal offset: allows you to offset rays from the surface. This is rarely useful and mostly present for experimental purposes.&lt;br /&gt;
* Transparent selfshadow: start rays behind the surface so it doesn't cast shadows on self. Might be useful for translucent foliage.&lt;br /&gt;
* Vertex sampling density (only if Packing Mode is set to Vertex): by default per-vertex bakes only compute 1 value for every vertex; if sampling density is &amp;gt; 0, it will instead average many samples scattered across triangles, yielding super-sampled, smoother results.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Lightmapped Prefab ===&lt;br /&gt;
This component allows prefabs to store lightmapping metadata. Such prefabs can be then instantiated in any scene, both in editor and at runtime.&lt;br /&gt;
The component should be added directly to the root object of the prefab. Nested prefabs are not supported. Because the prefab is going to be overwritten after bake (the same way as when the “Apply” button is pressed), it is required that the prefab does not have any unapplied changes (child objects shouldn’t be moved, materials and script parameters should be unchanged, etc). If such changes are detected, an error will be printed in the component UI and no metadata will be saved after bake. If [[#Warnings|Lightmapped prefab validation]] warning is enabled, all prefab errors will be also shown in a dialog box before the bake.&lt;br /&gt;
&lt;br /&gt;
Lightmapped prefabs support all Bakery features, such as LODs, terrains, directional lightmaps, RNM, SH, per-vertex modes and shadowmasks. For shadowmasks to work, you need lights to also be a part of the same prefab.&lt;br /&gt;
&lt;br /&gt;
{{note| Note that prefab shadowmasks only work on Unity 2017.4 or newer due to API limitations.}}&lt;br /&gt;
&lt;br /&gt;
After baking, an object named “BakeryPrefabLightmapData” will be added to prefab. This object holds a script with all necessary data to apply the lightmaps.&lt;br /&gt;
&lt;br /&gt;
Additionally, Lightmapped Prefab allows to save current render settings and load them back to any currently open scene, using two buttons:&lt;br /&gt;
* Save current render settings to prefab: stores a copy of current Render Settings on  this prefab.&lt;br /&gt;
* Load render settings from prefab: sets current Render Settings to those stored on the prefab.&lt;br /&gt;
[[File:Upload 2019-9-17 10-32-34.png|thumb|Applying the prefab]]&lt;br /&gt;
When baking a Lightmapped Prefab, it is recommended to check that:&lt;br /&gt;
* Prefab is &amp;quot;Applied&amp;quot;. On older Unity versions, click &amp;quot;Apply&amp;quot; button on the top right corner on the Inspector. On newer versions click the &amp;quot;Overrides&amp;quot; list and then &amp;quot;Apply all&amp;quot;.&lt;br /&gt;
* Prefab component UI does not show any errors.&lt;br /&gt;
* [Recommended] &amp;quot;Lightmapped prefab validation&amp;quot; checkbox is enabled in the main window. Clicking Render you doesn't show any warning dialog boxes about the prefabs.&lt;br /&gt;
&lt;br /&gt;
{{note| Lightmaps are named after the scene they are baked in or a Lightmap Group they use (if any). When baking different prefabs in the same scene, make sure to either use a differently named [[Manual#Bakery_Lightmap_Group_Selector|Lightmap Group]] or change the [[Manual#Output_path|Output Path]].}}&lt;br /&gt;
&lt;br /&gt;
{{note| When baking multiple prefabs using identical models one by one, it is recommended to set [[Manual#Asset_UV_Processing|Asset UV Processing]] to ''Don't Change'', to prevent alteration of shared model UVs.}}&lt;br /&gt;
&lt;br /&gt;
{{note| Bakery's prefab workflow was implemented before Unity had a &amp;quot;double-click into prefab&amp;quot; view feature. Thus, lightmaps may be not correctly applied in the isolated prefab view, and the component may show a &amp;quot;This GameObject is not a prefab&amp;quot; message. It should work as expected when working in a normal scene.}}&lt;br /&gt;
&lt;br /&gt;
{{note|When unpacking previously baked prefabs and unlinking them from existing lightmaps, make sure to remove the BakeryPrefabLightmapData object which holds the prefab-wide lightmap/renderer connections.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Direct Light ===&lt;br /&gt;
[[File:Directlight.jpg|thumb|Pure direct light with GI]]&lt;br /&gt;
[[File:Image4.png|thumb|Left: shadow spread = 0.01, right: 0.05. Note how shadows start sharp and get gradually blurrier with distance.]]&lt;br /&gt;
Infinitely distant directional light (e.g. Sun).&lt;br /&gt;
* Color: color.&lt;br /&gt;
* Intensity: linear color multiplier.&lt;br /&gt;
* Shadow spread: size of the light source or, simply put, shadow blurriness. 0 = max sharp shadows, 1 = max blurred shadows. Technically it interpolates from a single ray to a wider cone of rays.&lt;br /&gt;
* Shadow samples: affect shadows quality. The smaller the Shadow Spread value, the less samples are needed for a clean image. Typical values for sun shadows are from 1 to 16. Setting samples to 0 will make shadows from this light disappear.&lt;br /&gt;
* Bitmask: a list of toggles used to exclude this light source from affecting particular Lightmap Groups.&lt;br /&gt;
* Baked contribution: determines what kind of lighting data should be baked. Only visible in Indirect or Shadowmask modes. Possible values:&lt;br /&gt;
** Direct and Indirect: both direct and indirect contribution will be completely baked.&lt;br /&gt;
** Indirect only: a realtime light is supposed to provide direct contribution; only indirect lighting is baked.&lt;br /&gt;
** Shadowmask and indirect: a realtime light is supposed to provide direct contribution, but shadows from static geometry will be baked to a separate map. Dynamic and static shadows will be mixed together. Indirect lighting will be baked as usual.&lt;br /&gt;
** Direct, Indirect, Shadowmask (custom lighting only): same as Direct and Indirect, but the Shadowmask is also produced and assigned to use with custom shaders.&lt;br /&gt;
* Denoise shadowmask: determines if denoising should be applied to this light’s shadowmask. Usually it’s not necessary as shadows don’t exhibit much noise, but can be useful for very wide blurry shadows (large shadow spread).&lt;br /&gt;
* Indirect intensity: non-physical GI multiplier for this light. Should be 1 for natural lighting, but can be modified for more stylized scenes.&lt;br /&gt;
* Anti-alias: performs super-sampling for the shadow.&lt;br /&gt;
* Texture projection: projects a multiplicative tiled texture over lighting. Can be used to emulate distant cloud shadows.&lt;br /&gt;
When texture projection is set, its scale/offset can be manipulated using &amp;quot;Tiling&amp;quot; and &amp;quot;Offset&amp;quot; fields. Alternatively, click &amp;quot;Tweak projection in Scene View&amp;quot; and use additional gizmo to move and scale the projection visually. Click &amp;quot;Render reference frame&amp;quot; to save a PNG of &amp;quot;light's point of view&amp;quot;. This is useful to paint cloud shadows over the scene.&lt;br /&gt;
&lt;br /&gt;
If the same object has both Unity and Bakery light sources enabled, and they don’t match, two buttons will appear:&lt;br /&gt;
* Match lightmapped to real-time: copy common settings from Unity light to Bakery light.&lt;br /&gt;
* Match real-time to lightmapped: copy common settings from Bakery light to Unity light.&lt;br /&gt;
&lt;br /&gt;
{{note| In physical terms, Bakery's &amp;quot;Intensity&amp;quot; for directional lights is Lux divided by Pi.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Sky Light ===&lt;br /&gt;
[[File:Skylight.jpg|thumb|Pure sky light with GI]]&lt;br /&gt;
Infinitely distant shadowed ambient light (sky).&lt;br /&gt;
* Color: color.&lt;br /&gt;
* Intensity: linear color multiplier.&lt;br /&gt;
* Sky texture: optional cubemap asset, e.g. HDRI panorama to affect lighting colors from different directions.&lt;br /&gt;
{{note| Rotating sky light’s GameObject will rotate lighting from the cubemap accordingly.}}&lt;br /&gt;
* Samples: affects shadows quality. Typical values are from 8 to 32.&lt;br /&gt;
* Hemispherical: if enabled, lighting will only come from above (upper hemisphere). Otherwise from all directions.&lt;br /&gt;
* Bitmask: a list of toggles used to exclude this light source from affecting particular Lightmap Groups.&lt;br /&gt;
* Baked contribution: determines what kind of lighting data should be baked. Only visible in Indirect or Shadowmask modes. Possible values:&lt;br /&gt;
** Direct and Indirect: both direct and indirect contribution will be completely baked. This is the default and recommended behaviour for all Sky Lights, as there is no real-time version to emulate them in Unity.&lt;br /&gt;
** Indirect only: a realtime light is supposed to provide direct contribution; only indirect lighting is baked.&lt;br /&gt;
&lt;br /&gt;
If sky light’s settings and current scene skybox don’t match, two buttons will appear:&lt;br /&gt;
* Match this light to scene skybox: copy common settings from active skybox material to Bakery sky light. Currently it can only match skyboxes using the “Skybox/Cubemap” or “Skybox/Bakery skybox” shaders.&lt;br /&gt;
* Match scene skybox to this light: copy common settings from Bakery sky light to scene skybox.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bakery Light Mesh ===&lt;br /&gt;
[[File:Image29.png|thumb|Left: Samples Near = 0, Samples Far = 4096.&amp;lt;br&amp;gt;&lt;br /&gt;
Middle: Samples Near = 0, Samples Far = 128.&amp;lt;br&amp;gt;&lt;br /&gt;
Right: Samples Near = 16, Samples Far = 128.&amp;lt;br&amp;gt;&lt;br /&gt;
Note how the lighting appearance is similar, yet less combined samples are used.]]&lt;br /&gt;
Emissive mesh of any shape. Should be used together with the Mesh Renderer component or with a Light component set to Area mode.&lt;br /&gt;
* Color: color&lt;br /&gt;
* Intensity: linear color multiplier.&lt;br /&gt;
* Cutoff: maximum lighting distance. Bakery will additionally attenuate correct inverse-squared falloff near the limit. It works best when cutoff value is just where physical falloff gets very dim. Cutoff can improve baking performance, but you also can set it to a very high (unreachable) value for complete correctness.&lt;br /&gt;
* Self Shadow: determines if light mesh itself casts shadows. This option also enables a more precise lighting algorithm.&lt;br /&gt;
* Samples Near: affect lighting quality near the mesh. Typical values are from 16 to 64. This option is only available when Self Shadow is on.&lt;br /&gt;
* Samples Far: affects lighting quality far away from the mesh. Typical values are from 4 to 4096.&lt;br /&gt;
&lt;br /&gt;
Bakery mixes two different algorithms for area lights based on emissive surface proximity. Close to the light it works similar to the GI algorithm, while at a distance the light is approximated as a cloud of virtual point lights.&lt;br /&gt;
&lt;br /&gt;
{{note| &amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;Light Meshes don’t receive lighting on their own and don’t get lightmapped.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;One Light Mesh with many polygons is faster to bake than many simple Light Meshes.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;If you keep getting dirty/noisy results, try setting Samples Near to 0. Then only the VPL algorithm is used. It is also useful for very simple lights where precision is not important (e.g. window lights on a building).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;}}&lt;br /&gt;
[[File:Dd99d-QU0AEKFBK.jpg|thumb|A curved Light Mesh]]&lt;br /&gt;
* Bitmask: a list of toggles used to exclude this light source from affecting particular Lightmap Groups.&lt;br /&gt;
* Baked contribution: determines what kind of lighting data should be baked. Only visible in Indirect or Shadowmask modes. Possible values:&lt;br /&gt;
** Direct and Indirect: both direct and indirect contribution will be completely baked. This is the default and recommended behaviour for all Light Meshes, as there is no real-time version to emulate them in Unity.&lt;br /&gt;
** Indirect only: a realtime light is supposed to provide direct contribution; only indirect lighting is baked.&lt;br /&gt;
** Shadowmask and Indirect: a realtime light is supposed to provide direct contribution, but shadows from static geometry will be baked to a separate map. Dynamic and static shadows will be mixed together. Indirect lighting will be baked as usual. Currently only HDRP (and custom renderers) support mixed area lights.&lt;br /&gt;
** Direct, Indirect, Shadowmask (custom lighting only): same as Direct and Indirect, but the Shadowmask is also produced and assigned to use with custom shaders.&lt;br /&gt;
* Indirect intensity: non-physical GI multiplier for this light. Should be 1 for natural lighting, but can be modified for more stylized scenes.&lt;br /&gt;
* Shadowmask with falloff: bakes complete light attenuation into the shadowmask (only useful with custom shaders).&lt;br /&gt;
&lt;br /&gt;
If mesh material and light settings do not match, two buttons will appear:&lt;br /&gt;
* Match light to material:  copy common settings from unlit mesh material or area light to Bakery light.&lt;br /&gt;
* Match material to light: copy common settings from Bakery light to unlit mesh material or area light.&lt;br /&gt;
&lt;br /&gt;
==== Differences between Light Mesh and emissive materials ====&lt;br /&gt;
Emissive material:&lt;br /&gt;
* Propagates light during GI calculation, therefore is “free”, no matter how many meshes are emissive.&lt;br /&gt;
* Small and bright lights can give inaccurate noisy results, depending on GI sample count.&lt;br /&gt;
* Has to occupy space in lightmap due to the way GI in Bakery works, therefore possibly wasting it. Also it means that emissive objects require valid UVs and have “Cast shadows” enabled..&lt;br /&gt;
&lt;br /&gt;
Light Mesh:&lt;br /&gt;
* Lighting is calculated separately for each light, therefore is slower than emissive materials.&lt;br /&gt;
* Designed to give clean results for small and bright lights, even very far away from them.&lt;br /&gt;
* Doesn’t take space in lightmaps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Point Light ===&lt;br /&gt;
[[File:Image11.png|thumb|Left: Shadow Spread = 0.5, right: Shadow Spread = 1.]]&lt;br /&gt;
Point light, doesn’t have area. Despite physical impossibility it is useful for games and the only way to match Unity’s point and spot lights.&lt;br /&gt;
{{note|Spot lights are just point lights with additional projection mask.}}&lt;br /&gt;
* Color: color.&lt;br /&gt;
* Intensity: linear color multiplier.&lt;br /&gt;
* Shadow spread: shadow blurriness. Although point lights don’t have area, it is often desired to still have blurred shadows from them. For this purpose shadows are simulated as if they were cast from a spherical area light. This parameter defines the radius of such virtual sphere, directly affecting blurriness.&lt;br /&gt;
* Physical falloff: if enabled, will use correct inverse-squared falloff with additional attenuation near the limit. Otherwise will try to mimic Unity’s falloff.&lt;br /&gt;
* Falloff min size: learn more in [[Point Light Attenuation]] section.&lt;br /&gt;
* Range: if physical falloff is disabled, equals to Unity’s light range. If it’s enabled, will only slightly fade away physical falloff at the edge.&lt;br /&gt;
* Samples: affects shadows quality. Typical values are from 1 to 512. Setting samples to 0 will make shadows from this light disappear.&lt;br /&gt;
[[File:Image10.png|thumb|Left to right: Omni, Cookie (default spot texture), Cubemap, IES.]]&lt;br /&gt;
* Projection mask: type of mask/cookie. Options:&lt;br /&gt;
** Omni: no mask, equals to Unity’s Point Light.&lt;br /&gt;
** Cookie: cookie texture projection. Additional options:&lt;br /&gt;
*** Cookie texture: 2D texture asset. Bakery includes the original Unity’s Spot Light texture (named ftUnitySpotTexture) that you can use to mimic it.&lt;br /&gt;
*** Angle: texture projection angle (similar to Unity’s Spot Light).&lt;br /&gt;
*** Correct distortion: corrects cookie distortion visible on straight lines at wide angles.&lt;br /&gt;
** Cubemap: cubemap cookie projection. Additional options:&lt;br /&gt;
*** Projected cubemap: cubemap asset.&lt;br /&gt;
** IES: lighting is modulated by the IES file data. Additional options:&lt;br /&gt;
*** IES file: file with .ies extension.&lt;br /&gt;
* Bitmask: a list of toggles used to exclude this light source from affecting particular Lightmap Groups.&lt;br /&gt;
* Baked contribution: determines what kind of lighting data should be baked. Only visible in Indirect or Shadowmask modes. Possible values:&lt;br /&gt;
** Direct and Indirect: both direct and indirect contribution will be completely baked.&lt;br /&gt;
** Indirect only: a realtime light is supposed to provide direct contribution; only indirect lighting is baked.&lt;br /&gt;
** Shadowmask and Indirect: a realtime light is supposed to provide direct contribution, but shadows from static geometry will be baked to a separate map. Dynamic and static shadows will be mixed together. Indirect lighting will be baked as usual.&lt;br /&gt;
** Direct, Indirect, Shadowmask (custom lighting only): same as Direct and Indirect, but the Shadowmask is also produced and assigned to use with custom shaders.&lt;br /&gt;
* Indirect intensity: non-physical GI multiplier for this light. Should be 1 for natural lighting, but can be modified for more stylized scenes.&lt;br /&gt;
* Shadowmask with falloff: bakes complete light attenuation (except for distance) into the shadowmask (only useful with custom shaders).&lt;br /&gt;
* Legacy sampling: use Bakery's original more biased shadow sampling strategy. Produces noise-free shadows, but wide penumbras can exhibit banding. If disabled, an unbiased, but noisier technique is used.&lt;br /&gt;
&lt;br /&gt;
If the same object has both Unity and Bakery light sources enabled, and they don’t match, two buttons will appear:&lt;br /&gt;
* Match lightmapped to real-time: copy common settings from Unity light to Bakery light.&lt;br /&gt;
* Match real-time to lightmapped: copy common settings from Bakery light to Unity light.&lt;br /&gt;
&lt;br /&gt;
{{note| In physical terms, Bakery's &amp;quot;Intensity&amp;quot; for points lights is (Candela/Pi).}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Volume ===&lt;br /&gt;
[[File:Voldemo notlonely.gif|A dynamic door being lit by a BakeryVolume (animated GIF by NOTLonely)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Volumes generate 3D textures that store light probes per voxel (L1 spherical harmonics and shadowmasks) making them a viable replacement for regular Unity light probes.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Unity Light Probes&lt;br /&gt;
! Unity LPPV&lt;br /&gt;
! Bakery Volumes&lt;br /&gt;
|-&lt;br /&gt;
| Manually placing each probe&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | No&lt;br /&gt;
|-&lt;br /&gt;
| Interpolate multiple probes on one object&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Movable at runtime&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Can put in a prefab&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Full scripting API&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Ringing&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Possible&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | Possible&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Fixed&lt;br /&gt;
|-&lt;br /&gt;
| Denoising&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Runtime overhead&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | CPU: low; GPU: low.&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | CPU: medium; GPU: medium.&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#e4ead3;&amp;quot; | CPU: none; GPU: medium.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bakery Volume is a bounding box linked to a set of 3D textures (3 SH textures and one shadowmask, if needed), making it very easy to use and script. Volumes can be trivially swapped, moved, loaded or unloaded at runtime or linked to prefabs. They also do not need any Light Probe Groups and manual probe placement; the whole volume is filled with a uniform grid of probe voxels. Light/shadow leaking is automatically fixed the same way it is done for lightmaps (although thin double-sided walls may be a problem with large voxel size, but it can be avoided by using different volumes on different sides). Because of the uniform nature of voxel grids, it is also possible to apply lightmap-like denoising to them, which is not possible with regular light probes. Additionally, Bakery shaders use the [https://drive.google.com/file/d/1MK6Clw93q8ljijRjb4gQOzzaIjn1uF9Y/view Geomerics sampling trick] to completely get rid of the &amp;quot;ringing&amp;quot; artifact spherical harmonics can sometimes produce with high-contrast HDR lighting.&lt;br /&gt;
&lt;br /&gt;
Because of that, Volumes can produce clean, detailed, high-quality baked lighting for dynamic objects (that is, the lighting that comes from the static objects and affects dynamic objects, not the other way around).&lt;br /&gt;
&lt;br /&gt;
The only downside of the Volume approach is the higher per-pixel shading cost. The cost is similar to LPPV (scaling with the amount of shaded volume-affected pixels on the screen) but unlike LPPV, the Volumes themselves are never updated once they are baked. Multiple volume blending can be avoided by slightly overlapping them instead.&lt;br /&gt;
&lt;br /&gt;
====Setting volume transform====&lt;br /&gt;
[[File:Bvolgizmo.jpg|thumb|Volume gizmo]]&lt;br /&gt;
When BakeryVolume is added to a GameObject, a bounding box gizmo will appear in scene view. Dragging it by the little squares will scale it.&lt;br /&gt;
There are also other ways to change volume size and position:&lt;br /&gt;
* Drag any renderable GameObject into &amp;quot;Wrap to object&amp;quot; field. The volume will wrap around this object (and its children) to encapsulate them.&lt;br /&gt;
* If there is a Box Collider added to the same object, &amp;quot;Set from box collider&amp;quot; and &amp;quot;Set to box collider&amp;quot; buttons will appear. These can be used to quickly copy values between Volume/Collider.&lt;br /&gt;
&lt;br /&gt;
====Resolution====&lt;br /&gt;
When &amp;quot;Adaptive resolution&amp;quot; is enabled, the amount of voxels is governed by &amp;quot;Voxels per unit&amp;quot;. Disabling it allows to manually enter the resolution. For most games with 1 unit = 1 meter, a reasonable &amp;quot;Voxels per unit&amp;quot; value is 2, but there are cases (e.g. dynamic doors) when using a smaller, but higher resolution volume is beneficial.&lt;br /&gt;
&lt;br /&gt;
====Other settings====&lt;br /&gt;
* Enable baking: should the volume be (re)computed? Disable to prevent overwriting existing data.&lt;br /&gt;
* Denoise: apply denoising after baking the volume. Recommended for high-resolution volumes. Avoid using for very low-resolution volumes covering many lights, as it will be hard for denoisers to tell actual content from noise.&lt;br /&gt;
* Global: automatically assign this volume to all volume-compatible shaders, unless they have overrides. Internally it will call Shader.SetGlobalTexture()/SetGlobalVector().&lt;br /&gt;
&lt;br /&gt;
====Usage====&lt;br /&gt;
Volumes can be assigned to objects using a volume-aware shader. Bakery comes with &amp;quot;Bakery Standard&amp;quot; shader that implements it, as well as a HDRP and URP graphs. See example_volumes scenes for various ways of applying a volume.&lt;br /&gt;
&lt;br /&gt;
====Hints====&lt;br /&gt;
* Make sure to check the examples.&lt;br /&gt;
* If two volumes connect, make them overlap a bit. The size of the overlap should be equal to the size of the largest dynamic object. This way simply switching between volumes on the go will work.&lt;br /&gt;
* Only place volumes around areas dynamic objects can actually reach. E.g. use player height to limit volume height.&lt;br /&gt;
&lt;br /&gt;
====Rotating volumes====&lt;br /&gt;
Volumes can be rotated around Y axis, if &amp;quot;Rotate around Y&amp;quot; option is enabled. Rotation is very cheap and only uses 2 extra floats of data (precomputed sin/cos of the angle).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There is also an additional option to rotate volumes at runtime (Experimental -&amp;gt; &amp;quot;Support rotation after bake&amp;quot; and a similar option in Bakery Shader), in which case they need to be baked with zero initial rotation.&lt;br /&gt;
&lt;br /&gt;
In URP such dynamic rotation can be used with BakeryURPVolumeGraphRotatable.shadergraph.&lt;br /&gt;
&lt;br /&gt;
For global volumes dynamic rotation will be updated when the component is (re)enabled or volume.SetGlobalParams() is called. Using local rotated volumes requires manually setting the rotation on the material or the MaterialPropertyBlock:&lt;br /&gt;
{{code|&amp;lt;nowiki&amp;gt;SetMatrix(&amp;quot;_VolumeMatrix&amp;quot;, volume.GetMatrix())&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
====Technical information====&lt;br /&gt;
Volumes can work automatically (check example scenes), but it is also possible to script the way they are used.&lt;br /&gt;
&lt;br /&gt;
Volume data can be retrieved from the component via these public properties:&lt;br /&gt;
* bakedTexture0: stores L0 RGB coefficients and L1 Z red channel in alpha.&lt;br /&gt;
* bakedTexture1: stores L1 X RGB coefficients and L1 Z green channel in alpha.&lt;br /&gt;
* bakedTexture2: stores L1 Y RGB coefficients and L1 Z blue channel in alpha.&lt;br /&gt;
* bakedMask: stores the volumetric shadowmask.&lt;br /&gt;
* bounds: the bounding box of the volume.&lt;br /&gt;
&lt;br /&gt;
All bakedTexture* maps use RGBAHalf (8 bytes per voxel) format and the mask is ARGB32 (4 bytes per voxel). Shadowmask can also use single-channel R8 format (1 byte per voxel).&lt;br /&gt;
&lt;br /&gt;
Therefore volume byte size = width*height*depth*3*8 + (only if the shadowmask is used) width*height*depth*4 (or width*height*depth with an R8 mask).&lt;br /&gt;
&lt;br /&gt;
[[Manual#Compress_volumes|Texture compression]] can be enabled on volumes to make them much smaller.&lt;br /&gt;
&lt;br /&gt;
To sample the volume, a special shader is needed, and these are included in Bakery. To add volumes to a custom shader, check BakeryVolume_float() function in BakeryDecodeLightmap.hlsl which is included in HDRP/URP packages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Light Filter ===&lt;br /&gt;
[[File:Output optimized.gif|Stained glass, as seen in Bakery Real-Time Preview. Same results are baked by the Bakery lightmapper.]]&lt;br /&gt;
&lt;br /&gt;
Marks a renderer as a Light Filter. Filters tint all direct/indirect rays with their color, similar to real-life optical filters, allowing for colored transparencies (e.g. stained glass). The only parameter is the texture used for tinting.&lt;br /&gt;
* Light Filter objects still receive lightmaps like everything else.&lt;br /&gt;
* Filters don't scatter/blur rays (for that try [[Subsurface_scattering|Subsurface Scattering]] or [[Manual#Backface_GI|Backface GI]]).&lt;br /&gt;
* Filters can produce color-tinted shadows. If [[Manual#Shadowmask|Shadowmask]] mode is used on the light, only R channel of the result will be saved (as Unity only supports single-channel masks). For fully baked shadows there are no limitations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Sector ===&lt;br /&gt;
See '''[[Partial_scene_baking|Partial scene baking]]'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Always Render ===&lt;br /&gt;
If added to an object, Bakery will always take it into account when baking, even if its renderer is disabled.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Pack As Single Square ===&lt;br /&gt;
If added to an object, Bakery will treat UVs of this object and its children as a single combined square and never move them away from each other during automatic atlas packing or in a Lightmap Group with Pack Atlas mode. Whole children hierarchy will be packed as one.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Shared LOD UV ===&lt;br /&gt;
If added to a LODGroup, will mark all similarly-named LODs as sharing the same lightmap. By default, every LOD mesh receives a unique lightmap, taking space in the atlas; If, however, it is known that LODs of the same object have similar UV2 (or UV1, if it's non-overlapping, and UV2 is not present), they can map to the same part of the atlas, saving memory.&lt;br /&gt;
This technique is also known as [https://github.com/laurenth-personal/LODLightmapScripts/ Lightmap Stealing].&lt;br /&gt;
&lt;br /&gt;
= Material compatibility =&lt;br /&gt;
=== Albedo and emission ===&lt;br /&gt;
Bakery supports most Unity materials by utilizing the [https://docs.unity3d.com/Manual/MetaPass.html Meta Pass] system. All built-in, surface, URP and HDRP shaders already have a correct meta pass defined.&lt;br /&gt;
&lt;br /&gt;
If you have an Unlit shader, add meta pass manually, as described in Unity docs.&lt;br /&gt;
&lt;br /&gt;
If the pass is not present, Bakery will assume {{codeVar|_MainTex}}, {{codeVar|_BaseColorMap}} or {{codeVar|_Color}} (if no texture is set) properties as material albedo and {{codeVar|_EmissionMap}} and {{codeVar|_EmissionColor}} as emissive color.&lt;br /&gt;
&lt;br /&gt;
In order for emission to work, [https://docs.unity3d.com/ScriptReference/Material-globalIlluminationFlags.html Material.globalIlluminationFlags] must be set to [https://docs.unity3d.com/ScriptReference/MaterialGlobalIlluminationFlags.BakedEmissive.html MaterialGlobalIlluminationFlags.BakedEmissive]. Standard shaders set this value automatically.&lt;br /&gt;
&lt;br /&gt;
=== Opacity ===&lt;br /&gt;
[[File:Upload 2019-1-25 0-4-30.png|thumb|Material parameters converted to cutout (default)]]&lt;br /&gt;
[[File:Alphacombos dither.jpg|thumb|Semi-transparent values added via Dither Transparency option]]&lt;br /&gt;
[[File:Alphacombos filter.jpg|thumb|Light Filter components used on red planes, producing colored shadows]]&lt;br /&gt;
By default, Bakery always takes full resolution opacity from the alpha value of {{codeVar|_MainTex}}, {{codeVar|_BaseColorMap}} or {{codeVar|_BaseMap}} and treats it as cutout (1 bit tranparency).&lt;br /&gt;
&lt;br /&gt;
When '''Dither Transparency''' option is enabled, semi-transparent values are automatically converted to variable blue noise, which is then filtered/blurred, resulting in partial transparency (it was previously possible using custom manually dithered maps, but since v1.97 it is automatic).&lt;br /&gt;
&lt;br /&gt;
In order for opacity to work, [https://docs.unity3d.com/Manual/SL-SubShaderTags.html RenderType tag] of the shader must be one of these values:&lt;br /&gt;
* {{codeVar|Transparent}}&lt;br /&gt;
* {{codeVar|TransparentCutout}}&lt;br /&gt;
* {{codeVar|TreeLeaf}}&lt;br /&gt;
&lt;br /&gt;
If a property named {{codeVar|_Cutoff}} is present, it will affect the cutout (therefore Standard shader cutoff slider works automatically).&lt;br /&gt;
&lt;br /&gt;
Without Dither Transparency, if material RenderType is {{codeVar|Transparent}} or {{codeVar|TreeLeaf}}, then alpha value of {{codeVar|_Color}} will additionally modify the cutoff: ''finalCutoff = 1 - (1 - cutoff) * alpha''&lt;br /&gt;
&lt;br /&gt;
For colored transparency, use the [[Manual#Bakery_Light_Filter|Light Filter]] component.&lt;br /&gt;
&lt;br /&gt;
For diffuse translucency effects read about [[#Backface GI|Backface GI]] and [[subsurface scattering]].&lt;br /&gt;
&lt;br /&gt;
==== Alpha Meta Pass ====&lt;br /&gt;
Since v1.9 Bakery also supports specifying custom shader-based transparency, but it requires a compatible shader. To take advantage of ''Alpha Meta Pass'', following steps must be taken:&lt;br /&gt;
* Add a property named '''BAKERY_META_ALPHA_ENABLE''' to the shader. For example:&lt;br /&gt;
{{code|&amp;lt;nowiki&amp;gt;[HideInInspector] BAKERY_META_ALPHA_ENABLE (&amp;quot;Enable Bakery alpha meta pass&amp;quot;, Float) = 1.0&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
* Make sure that RenderType tag is set to one of the values above.&lt;br /&gt;
* Declare a pass named '''META_BAKERY'''. &lt;br /&gt;
* In that pass check if '''unity_MetaFragmentControl.w''' is non-zero, in which case, return the computed transparency value. &lt;br /&gt;
&lt;br /&gt;
See ''Baked_Alpha_meta.shader'' included in the package as an example.&lt;br /&gt;
&lt;br /&gt;
Note: currently Alpha Meta Pass requires Light Probe Mode to be set to L1 or L2.&lt;br /&gt;
&lt;br /&gt;
=== Normal mapping ===&lt;br /&gt;
Custom surface normals can be used in conjunction with [[#Baked Normal Maps|Baked Normal Maps]] mode. Unfortunately, Unity's Meta Pass does not output normal information, so by default normals are taken from a texture named {{codeVar|_BumpMap}}, additionally transformed by {{codeVar|_MainTex_ST}}.&lt;br /&gt;
&lt;br /&gt;
It is however possible to make completely custom shaders with advanced normal mapping features (e.g. blending multiple layers) compatible with baking. To do that you'll need:&lt;br /&gt;
&lt;br /&gt;
1. Define a Meta Pass in your shader, just [https://docs.unity3d.com/Manual/MetaPass.html#ExampleMetaPass as described in Unity docs].&lt;br /&gt;
&lt;br /&gt;
2. Name it {{codeVar|&amp;quot;META_BAKERY&amp;quot;}}, instead of just {{codeVar|&amp;quot;META&amp;quot;}}.&lt;br /&gt;
&lt;br /&gt;
3. Include {{codeVar|&amp;quot;BakeryMetaPass.cginc&amp;quot;}}.&lt;br /&gt;
&lt;br /&gt;
4. Add {{codeVar|#pragma vertex vert_bakerymt}}&lt;br /&gt;
&lt;br /&gt;
5. If {{codeVar|unity_MetaFragmentControl.z}} variable is not 0, shader should return world-space normal. Returned normal should be encoded using {{codeVar|BakeryEncodeNormal}} function.&lt;br /&gt;
&lt;br /&gt;
Two example shaders implementing this extended Meta Pass are included in Assets/Bakery/examples/shaders.&lt;br /&gt;
&lt;br /&gt;
You can copy and modify BakeryMetaPass.cginc to suit your needs, e.g. pass additional data from the vertex shader.&lt;br /&gt;
&lt;br /&gt;
=== Front/back faces ===&lt;br /&gt;
No matter what culling mode is used on the shader, Bakery treats all back-faces as opaque, meaning any direct light ray will not pass through a back-face, just as it will not pass through a front-face.&lt;br /&gt;
However, back-faces can partially emit lighting received by a front-face, if you use [[Manual#Backface_GI|Backface GI]].&lt;br /&gt;
&lt;br /&gt;
= &amp;quot;Lightmap Parameters&amp;quot; assets =&lt;br /&gt;
[[File:Lp.jpg|thumb|Extended Lightmap Parameters]]&lt;br /&gt;
Similar to Bakery's [[Manual#Bakery_Lightmap_Group_Selector|Lightmap Groups]], Unity has [https://docs.unity3d.com/Manual/class-LightmapParameters.html Lightmap Parameters] that can be created as assets and assigned to Mesh Renderers. Their logic has differences and similarities:&lt;br /&gt;
* Lightmap Group's primary usage is to group multiple objects in one atlas. Additionally it allows overriding baking settings for this atlas.&lt;br /&gt;
* Lightmap Parameters are primarily used to override baking settings for an object. But additionally they can influence packing by using the &amp;quot;Baked Tag&amp;quot; option: objects with a different Baked Tag will never share the same atlas.&lt;br /&gt;
&lt;br /&gt;
Since some users are more used to the Lightmap Parameters workflow, Bakery now supports and extends them:&lt;br /&gt;
* Baked Tag is respected by Bakery.&lt;br /&gt;
* Additional Bakery-specific options will be shown in the Lightmap Parameters UI. Refer to the [[Manual#Bakery_Lightmap_Group_Selector|Lightmap Group]] section for their meaning.&lt;br /&gt;
&lt;br /&gt;
= Project Settings =&lt;br /&gt;
Some global settings can be tweaked in Project Settings -&amp;gt; Bakery GPU Lightmapper (this option is only visible in Unity 2018.3 or newer; for older versions, edit BakeryProjectSettings.asset instead):&lt;br /&gt;
* Mipmap lightmaps: enables mipmapping on lightmap assets. Can cause leaks across UV charts as atlases get smaller; on the other hand, it reduces high resolution lightmap aliasing in the distance. Overall it is recommended to use separately baked LODs with lower resolution lightmaps for very distant objects instead.&lt;br /&gt;
* Color file format: format for regular HDR color lightmaps. Possible values:&lt;br /&gt;
** HDR: Radiance HDR format (default). Can be opened in many image editors.&lt;br /&gt;
** Asset: native Unity format. Can have custom mipmap count.&lt;br /&gt;
* Mask/Direction file format: format for additional LDR maps, such as shadowmasks or directional data. Possible values:&lt;br /&gt;
** TGA: 8-bit Targa (default).&lt;br /&gt;
** PNG: 8-bit PNG. Usually takes less space on disk compared to TGA.&lt;br /&gt;
** Asset: native Unity format. Can have custom mipmap count.&lt;br /&gt;
* Compress lightmaps: defines lightmap asset compression behaviour. Compressed lightmaps take less VRAM, but may exhibit some visual artifacts (such as banding or colored blotches) depending on the type of compression (for mobile compression issues [[Troubleshooting#I_have_an_Android_project.2C_and_lightmaps_don.27t_look_good|see this]]). Possible values:&lt;br /&gt;
*** Compress but allow overriding asset: new lightmaps will be created with compression enabled. After they are created, it is possible to change their compression settings in Inspector. These modified values will be kept after rebaking (default).&lt;br /&gt;
*** Force compress: always compress all lightmaps.&lt;br /&gt;
*** Force no compress: always produce uncompressed lightmaps.&lt;br /&gt;
* High quality direction: enables &amp;quot;high&amp;quot; quality compression for directional maps. Actual formats depend on platform. On PC, for example, it will change it from DXT1 to BC7, which gives higher quality, but doubles the VRAM usage.&lt;br /&gt;
* Texel padding (default atlas packer): defines how many empty texels to add between objects' UV layouts in lightmap atlases, when using the default atlas packer.&lt;br /&gt;
* Texel padding (xatlas packer): same, but when using xatlas.&lt;br /&gt;
* Alpha Meta Pass resolution multiplier: multiplies resolution of the [[Manual#Alpha_Meta_Pass|Alpha Meta Pass]] allowing to have precise shader-based cutouts while baking low resolution lightmaps.&lt;br /&gt;
* Volume render mode: which [[Manual#Render_mode|render mode]] to use for all [[Manual#Bakery_Volume|Volumes]]? Auto uses current active render mode (default).&lt;br /&gt;
* Delete previous lightmaps before bake: actually delete all previously rendered lightmap files from this scene before baking new ones.&lt;br /&gt;
* Log level: defines how much information is printed to console during the bake. Possible values:&lt;br /&gt;
** 0: do not print anything.&lt;br /&gt;
** 1: only print progress information.&lt;br /&gt;
** 2: only print warnings.&lt;br /&gt;
** 3: print everything.&lt;br /&gt;
* Alternative scale in lightmap: makes 'Scale in Lightmap' renderer property act more similar to built-in Unity behaviour.&lt;br /&gt;
* Align to texture compression blocks with xatlas: makes xatlas align charts to 4x4 block boundaries, which gives more compression-friendly results.&lt;br /&gt;
* Generate smooth positions: should sample positions be adjusted to prevent incorrect shadowing on low-poly geometry with smooth normals? Can be disabled in very rare cases when using geometry with wildly mismatching normals. See [https://ndotl.wordpress.com/2018/08/29/baking-artifact-free-lightmaps/#shadowterm  this article] for technical explanation.&lt;br /&gt;
* Smooth positions per-triangle: should smooth/flat position be decided per-triangle? Can be disabled in very rare cases when using geometry with wildly mismatching normals.&lt;br /&gt;
* Use 'Receive GI' values: take 'Receive Global Illumination' values into account on renderers. Originally Bakery ignored it.&lt;br /&gt;
* Remove ringing in Legacy light probes: enables softer light probe convolution in Legacy mode to prevent artifacts in high-contrast areas.&lt;br /&gt;
* Always render reflection probes: automatically render reflection probes after every Render/Render Light Probes.&lt;br /&gt;
* Ringing removal for L2 light probes: applies de-ringing to [[Manual#Light_probe_mode|L2 light probes]]. The higher the value, the smoother the probe lighting is; this smoothing reduces [https://docs.unity3d.com/6000.2/Documentation/Manual/light-probes-troubleshooting.html ringing] artifacts (if present).&lt;br /&gt;
* Put menu under Tools: puts Bakery menu under the Tools menu.&lt;br /&gt;
&lt;br /&gt;
If any format is set to Asset, and mipmapping is enabled, an additional option is shown:&lt;br /&gt;
* Maximum mipmap count: defines maximum amount of mipmaps. For example, if set to 2, a 8K lightmap will only have two additional mipmaps: 4K and 2K. Lower resolutions will be omitted, thus limiting leaking artifacts during mipmapping.&lt;br /&gt;
&lt;br /&gt;
= Skinned mesh renderer support =&lt;br /&gt;
&lt;br /&gt;
Bakery supports skinned meshes since v1.65. However, there are some limitations:&lt;br /&gt;
* Some versions of Unity do not support UV1 on skinned meshes and silently ignore &amp;quot;Generate lightmap UVs&amp;quot;. Make sure the actual mesh used in your scene has UV1 and use non-overlapping UV0 if possible;&lt;br /&gt;
* UV padding adjustment does not work on skinned meshes (Unity seems to crash when attempting to call Unwrap function on them);&lt;br /&gt;
* Skinned meshes can't have per-vertex lightmaps (engine has no support for additionalVertexStreams with skinning).&lt;br /&gt;
&lt;br /&gt;
= Shader Tweaks =&lt;br /&gt;
[[File:Image2.jpg|thumb|Left: default bilinear filtering. Right: bicubic filtering.]]&lt;br /&gt;
[[File:Image34.jpg|thumb|Left: both shadows are baked.&amp;lt;br&amp;gt;&lt;br /&gt;
Center: spherical shadow is dynamic, and other shadow is static. Combined together with multiplication.&amp;lt;br&amp;gt;&lt;br /&gt;
Right: same as center, but combined with default minimum.]]&lt;br /&gt;
Bakery offers optional shader modifications that can be applied to Unity shaders to improve lightmap sampling and match real-time lighting closer to lightmaps. Shader tweaking menu can be accessed via Bakery-&amp;gt;Shader Tweaks.&lt;br /&gt;
&lt;br /&gt;
These options will patch base Unity shader includes (from the CGIncludes folder) that are used by most built-in and third party shaders. All modifications will affect all projects opened with this version of editor, but can be also easily reverted back. Shader tweaks affect the way standard and surface shaders work. HDRP, URP and other SRPs are not affected.&lt;br /&gt;
&lt;br /&gt;
All available modifications are shown as buttons. Press the button to apply modification, and it will remain pressed. Un-press the button to remove the modification. Currently available options:&lt;br /&gt;
&lt;br /&gt;
{{note| You may need to run Unity editor as admin to make CGIncludes patching work}}&lt;br /&gt;
&lt;br /&gt;
* Use bicubic interpolation for lightmaps: bicubic interpolation will be used instead of default bilinear. This tweak fixes many jagged edges of low resolution lightmaps pretty well. Currently it only works on DX11 and modern consoles, while other platforms will remain using bilinear.&lt;br /&gt;
&lt;br /&gt;
* Use multiplication for shadowmask: combine static and dynamic shadows using multiplication instead of minimum. For reasons unknown Unity decided to use minimum operator by default, and it produces artifacts that are not present with multiplication.&lt;br /&gt;
&lt;br /&gt;
* Use physical light falloff (forward): replace default attenuation of real-time point/spot lights with a more physically correct inverse-squared. “Range” will only slightly fade it out near the edge (matches Bakery lights with Physical Falloff checkbox). Only affects forward renderer. See [[Point Light Attenuation]] for more details.&lt;br /&gt;
&lt;br /&gt;
* Use physical light falloff (deferred): same as above, but only affects deferred renderer.&lt;br /&gt;
&lt;br /&gt;
'''Falloff tweaks may not fully work on &amp;gt; 2017 Unity versions. Also, SRPs have correct falloff by default.'''&lt;br /&gt;
&lt;br /&gt;
= Bakery shaders =&lt;br /&gt;
Bakery includes its own shaders with support for vertex lightmapping, as well as RNM and SH directional modes. It also allows approximate baked specular to be calculated from directional data. &lt;br /&gt;
Bakery shader is '''not required''' for regular color lightmaps, shadow masks and Dominant Direction mode, as these features are supported by most Unity shaders anyway.&lt;br /&gt;
&lt;br /&gt;
=== Standard render pipeline ===&lt;br /&gt;
'''Bakery/Standard''': extends regular Standard shader. Additional options:&lt;br /&gt;
* Allow Vertex Lightmaps: allows this material to be used with [[Vertex Lightmaps|vertex lightmapping]].&lt;br /&gt;
* Allow RNM Lightmaps: allows this material to be used with [[#RNM|RNM directional mode]].&lt;br /&gt;
* Allow SH Lightmaps: allows this material to be used with [[#SH|SH directional mode]].&lt;br /&gt;
{{note| All “Allow” toggles enable a certain code path in the shader. It is recommended to only use one “allow” option in a material for performance reasons.}}&lt;br /&gt;
* Enable Lightmap Specular: calculates baked specular using data from Dominant Direction, RNM or SH directional modes. Note that due to the lack of information, the effect is very approximate. If you ever used baked specular in Unity 4, it should be comparable. It looks best together with highly perturbed normal maps, not so good on flat surfaces.&lt;br /&gt;
* Enable VertexLM directional: if vertex lightmaps are present, specifies that Dominant Direction data is stored in vertices and should be used.&lt;br /&gt;
* Enable VertexLM SH: if vertex lightmaps are present, specifies that SH data is stored in vertices and should be used.&lt;br /&gt;
* Enable VertexLM Shadowmask: if vertex lightmaps are present, specifies that shadow mask is stored in vertices and should be used.&lt;br /&gt;
* Enable MonoSH: treat directional maps as MonoSH maps.&lt;br /&gt;
[[File:Image5.png|thumb|Standard SH light probe vs non-linear]]&lt;br /&gt;
[[File:Shspec.jpg|thumb|SH specular effect]]&lt;br /&gt;
* Non-linear SH: in SH directional mode this option can enhance contrast (closer to ground truth), but it makes the shader a bit slower. This trick is based on [https://drive.google.com/file/d/1MK6Clw93q8ljijRjb4gQOzzaIjn1uF9Y/view “Reconstructing Diffuse Lighting from Spherical Harmonic Data”] paper by Geomerics.&lt;br /&gt;
* Non-linear Light Probe SH: similar to Non-linear SH, but works for light probes instead. In case of probes the most notable benefit is getting rid of incorrect negative values. This problem often happens in high-contrast scenes with bright HDR light sources. It’s an inherent limitation of spherical harmonics and not specific to Bakery (i.e. you can get similar artifacts with built-in lightmappers as well).&lt;br /&gt;
* Force Bicubic Filter: enables bicubic filtering for all additional maps. For complete bicubic filtering (including the first color map) it is recommended to also enable it in [[#Shader Tweaks|Shader Tweaks]].&lt;br /&gt;
&lt;br /&gt;
'''Bakery/Standard Specular''': same as Standard, but for specular workflow.&lt;br /&gt;
&lt;br /&gt;
=== HDRP &amp;amp; URP ===&lt;br /&gt;
To extract additional HDRP/URP shaders, open Bakery_ShaderGraphHDRP.unitypackage or Bakery_ShaderGraphURP.unitypackage included with Bakery. Inside you will find Shader Subgraphs that you can use in your own Shader Graphs as well as some example materials.&lt;br /&gt;
&lt;br /&gt;
=== Feature support across shaders ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Most Unity shaders&lt;br /&gt;
! Most HDRP &amp;amp; URP shaders&lt;br /&gt;
! Bakery Standard&lt;br /&gt;
! HDRP graphs&lt;br /&gt;
! URP graphs&lt;br /&gt;
|-&lt;br /&gt;
| HDR color lightmaps&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Shadowmask&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes (Since URP 10.1)&lt;br /&gt;
|-&lt;br /&gt;
| Dominant Direction&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| RNM&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| SH&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| MonoSH&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Lightmap specular&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes for dominant direction and SH&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes for dominant direction (see link)&lt;br /&gt;
|-&lt;br /&gt;
| Bicubic filtering&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes,&lt;br /&gt;
with [[#Shader Tweaks|Shader Tweaks]]&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes,&lt;br /&gt;
with [[#Shader Tweaks|Shader Tweaks]]&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
|-&lt;br /&gt;
| Vertex lightmaps&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Single color, no per-vertex SH, direction or shadowmasks (shader graph limitation)&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Single color, no per-vertex SH, direction or shadowmasks (shader graph limitation)&lt;br /&gt;
|-&lt;br /&gt;
| Non-Linear Light Probes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Volumes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Volume shadowmask&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|-&lt;br /&gt;
| Compressed volumes&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | No&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | Yes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{note| Everything except for regular color lightmaps requires at least Shader Model 3.0 to work.}}&lt;br /&gt;
{{note| Vertex Lightmaps with SH mode require at least Shader Model 4.0 due to interpolator limit.}}&lt;br /&gt;
{{note| Updated URP graphs with specular from Dominant Direction can be downloaded [[Bakery_-_GPU_Lightmapper|from the main wiki page]].}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
See also: [[Integrating_Bakery_shader_features_to_custom_shaders| Integrating Bakery shader features to custom shaders]]&lt;br /&gt;
&lt;br /&gt;
= Notes on HDRP/URP =&lt;br /&gt;
Once the package is imported into an HDRP or URP project, in general it can be used right away, but there are some things to note:&lt;br /&gt;
&lt;br /&gt;
* Example scenes use both regular Standard and, in some cases, &amp;quot;Bakery Standard&amp;quot; shaders. HDRP and URP provide a mechanism to update project shaders from Standard to Lit, but they cannot upgrade from Bakery Standard. Replace Bakery Standard materials with the ones coming from Bakery_ShaderGraphHDRP.unitypackage or Bakery_ShaderGraphURP.unitypackage.&lt;br /&gt;
&lt;br /&gt;
* In HDRP, the default HDRI sky intensity is high (11) and sky reflection is not being occluded by default. Together with default eye adaption it may result in some example scenes being hardly visible, as they are baked using much lower intensities. Reduce HDRI sky intensity to 1 in this case. HDRI settings are usually located in Assets/HDRPDefaultResources/DefaultSettingsVolumeProfile.&lt;br /&gt;
&lt;br /&gt;
* In HDRP, if lights in example scenes are too bright, click &amp;quot;match real-time to lightmapped&amp;quot; on Bakery light components.&lt;br /&gt;
&lt;br /&gt;
* Use OpenImageDenoise 2 (best) or OptiX 7 denoiser in HDRP, as it is better suited for high intensity values.&lt;br /&gt;
&lt;br /&gt;
* In HDRP &amp;quot;distance&amp;quot; and regular Shadowmask can be switched on the Light component itself, not in global settings.&lt;br /&gt;
&lt;br /&gt;
* Don't use &amp;quot;match&amp;quot; buttons on the Skylight, as HDRP uses a very specific procedural sky shader. Instead, bake it into a HDRI [[How_do_I...#How_do_I_use_Skylight_with_a_procedural_sky_shader.3F|this way]].&lt;br /&gt;
&lt;br /&gt;
* It is recommended to always set Light Probe Mode to L2 or L1 when using HDRP, as HDRP's renderer is not optimized for the Legacy mode.&lt;br /&gt;
&lt;br /&gt;
* Newest version of HDRP/URP have their own IES file importer. Because of the asset type mismatch, Unity will unplug them from Bakery IES lights saved using older versions, meaning they will appear as regular point lights instead. They can be plugged back and re-saved.&lt;br /&gt;
&lt;br /&gt;
Bakery's example scenes are designed for the Built-in rendering pipeline, so there are a few steps to properly render them in HDRP/URP. Here are some tips; a fresh project with default HDRP/URP settings is assumed:&lt;br /&gt;
&lt;br /&gt;
=== Viewing example scenes on HDRP ===&lt;br /&gt;
* After importing Bakery, upgrade standard materials to HDRP: Edit-&amp;gt;Rendering-&amp;gt;Materials-&amp;gt;Convert All Built-in Materials To HDRP.&lt;br /&gt;
* Import Bakery_ShaderGraphHDRP.unitypackage into the project, as it contains special shader graphs implementing advanced Bakery features (not required for classic color/directional/mask lightmaps).&lt;br /&gt;
* Select DefaultSettingsVolumeProfile.asset. In HDRI Sky section, change Exposure Compensation to 1. Otherwise the default HDRP will be too bright compared to example scenes, and they will appear black due to this exposure adjustment.&lt;br /&gt;
* When selecting lights in example scenes, HDRP will initialize its own light data. Sometimes it may result in the light immediately becoming much brighter. Click &amp;quot;Match real-time to lightmapped&amp;quot; to synchronize.&lt;br /&gt;
* Set Light Probe Mode to L2 before rendering light probes.&lt;br /&gt;
* '''example_directional''': change shaders to BakeryDirSpecGraph to see baked highlights (or just regular HDRP/Lit for diffuse-only normal mapping). Delete the sphere, as there is currently no shader graph supporting per-vertex direction.&lt;br /&gt;
* '''example_directional_MonoSH''': change shaders to BakerySpecMonoSHGraph (or BakeryMonoSHGraph for a slightly cheaper version without highlights). Delete the sphere, as there is currently no shader graph supporting per-vertex MonoSH.&lt;br /&gt;
* '''example_RNM''': change shaders to BakeryRNMGraph.&lt;br /&gt;
* '''example_SH''': change shaders to BakerySpecSHGraph (or BakerySHGraph for a slightly cheaper version without highlights). Delete the sphere, as there is currently no shader graph supporting per-vertex SH.&lt;br /&gt;
* '''example_mixed_directional_mode''': similarly a different graph is needed for MonoSH/RNM/SH planes.&lt;br /&gt;
* '''example_lights''': change the shader of the vertex-lightmapped sphere to BakeryVertexColorGraph.&lt;br /&gt;
* '''example_prefabs_bake''': no further adjustments needed.&lt;br /&gt;
* '''example_sectors''': no further adjustments needed.&lt;br /&gt;
* '''example_shadowmask''': Select the DirectLight and click &amp;quot;Match real-time to lightmapped&amp;quot; to fix brightness. Set Shadowmask Mode to Shadowmask on all HDRP lights. &lt;br /&gt;
* '''example_sponza_day''': set OpenImageDenoise 2 (or Optix 7, if unsupported) as preferred denoiser.&lt;br /&gt;
* '''example_sponza_evening''': set OpenImageDenoise 2 (or Optix 7, if unsupported) as preferred denoiser.&lt;br /&gt;
* '''example_subtractive''': HDRP doesn't support the subtractive mode.&lt;br /&gt;
* '''example_volumes_simple''': change train shader to BakeryVolumeSpecGraph (or BakeryVolumeGraph for a slightly cheaper version without highlights).&lt;br /&gt;
* '''example_volumes_simple_shadowmask''': shadowmask volumes are not currently supported for HDRP.&lt;br /&gt;
* '''example_volumes_advanced''': same as with example_volumes_simple.&lt;br /&gt;
* '''example_translucency''': most of the scene should appear fine. For the &amp;quot;Dynamic sphere lit by volume&amp;quot;, set shader to BakeryVolumeGraph.&lt;br /&gt;
&lt;br /&gt;
=== Viewing example scenes on URP ===&lt;br /&gt;
* After importing Bakery, upgrade standard materials to URP: open Assets/Bakery/examples/content, select all materials by typing &amp;quot;t:material&amp;quot; and choosing to only search the &amp;quot;content&amp;quot; folder below. Click Edit-&amp;gt;Rendering-&amp;gt;Materials-&amp;gt;Convert Selected Built-in Materials To URP.&lt;br /&gt;
* Import Bakery_ShaderGraphURP.unitypackage into the project, as it contains special shader graphs implementing advanced Bakery features (not required for classic color/directional/mask lightmaps).&lt;br /&gt;
* '''example_directional''': change shaders to BakeryURPLit, enable &amp;quot;Bakery Lightmapped Specular&amp;quot; (or just keep regular URP/Lit for diffuse-only normal mapping). Delete the sphere, as there is currently no shader graph supporting per-vertex direction.&lt;br /&gt;
* '''example_directional_MonoSH''': change shaders to BakeryURPLit, set Bakery Mode to MonoSH, enable &amp;quot;Bakery Lightmapped Specular&amp;quot;. On the vertex-lit sphere also enable &amp;quot;Per-vertex&amp;quot;.&lt;br /&gt;
* '''example_RNM''': change shaders to BakeryURPLit, set Bakery Mode to RNM, enable &amp;quot;Bakery Lightmapped Specular&amp;quot;.&lt;br /&gt;
* '''example_SH''': change shaders to BakeryURPLit, set Bakery Mode to SH, enable &amp;quot;Bakery Lightmapped Specular&amp;quot;. Delete the sphere, as there is currently no shader graph supporting per-vertex SH.&lt;br /&gt;
* '''example_mixed_directional_mode''': similarly use BakeryURPLit with a different Bakery Mode (MonoSH, RNM, SH). Non-directional / dominant direction / baked normap maps can use regular URP/Lit.&lt;br /&gt;
* '''example_lights''': no further adjustments needed.&lt;br /&gt;
* '''example_prefabs_bake''': no further adjustments needed.&lt;br /&gt;
* '''example_sectors''': no further adjustments needed.&lt;br /&gt;
* '''example_shadowmask''': similarly to the Built-in pipeline, uncheck Distance Shadowmask in Bakery window (or project Quality Settings) to see actual baked/real-time shadow mixing near the camera.&lt;br /&gt;
* '''example_sponza_day''': enable alpha clipping on the foliage material.&lt;br /&gt;
* '''example_sponza_evening''': same as example_sponza_day.&lt;br /&gt;
* '''example_subtractive''': no further adjustments needed.&lt;br /&gt;
* '''example_volumes_simple''': change train shader to BakeryURPLit and set Bakery Mode to Volume. Optionally enable &amp;quot;Bakery Lightmapped Specular&amp;quot;.&lt;br /&gt;
* '''example_volumes_simple_shadowmask''': same as example_volumes_simple, but also enable &amp;quot;Volume Shadowmask&amp;quot;.&lt;br /&gt;
* '''example_volumes_advanced''': same as with example_volumes_simple.&lt;br /&gt;
* '''example_translucency''': most of the scene should appear fine. For the &amp;quot;Dynamic sphere lit by volume&amp;quot;, set shader to BakeryURPLit and Bakery Mode to Volume.&lt;br /&gt;
&lt;br /&gt;
= Upgrading Bakery =&lt;br /&gt;
When it comes to upgrading the asset, it is recommended to follow these steps:&lt;br /&gt;
* Close Bakery windows.&lt;br /&gt;
* Close Unity.&lt;br /&gt;
* Open it again.&lt;br /&gt;
* Import the updated package.&lt;br /&gt;
&lt;br /&gt;
Note that without first closing Unity importing may fail because of locked DLL files (printing messages like &amp;quot;alphabuffergen.dll: Access is denied.&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
If you moved Bakery folders (Assets/Bakery and Assets/Editor/x64/Bakery) to other locations, you might need to move them back before updating to prevent getting two conflicting copies of the package.&lt;br /&gt;
&lt;br /&gt;
= Scripting API =&lt;br /&gt;
&lt;br /&gt;
==Basic usage==&lt;br /&gt;
&lt;br /&gt;
Get and modify render settings:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ftLightmapsStorage storage = ftRenderLightmap.FindRenderSettingsStorage();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Full list of available settings can be seen in ftLightmapsStorage.cs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Get lightmapper instance and (re)load settings:&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap bakery = ftRenderLightmap.instance != null ? ftRenderLightmap.instance : new ftRenderLightmap();&lt;br /&gt;
bakery.LoadRenderSettings();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Render lightmaps (also probes if they're set to L1 or L2 mode):&lt;br /&gt;
&amp;lt;pre&amp;gt;bakery.RenderButton(bool showMsgWindows)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Render light probes only:&lt;br /&gt;
&amp;lt;pre&amp;gt;bakery.RenderLightProbesButton(bool showMsgWindows)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Render reflection probes only:&lt;br /&gt;
&amp;lt;pre&amp;gt;bakery.RenderReflectionProbesButton(bool showMsgWindows)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''showMsgWindows''' tells if any dialog boxes/confirmations can be shown. Supressed, if set to false.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Check if baking is in progress:&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.bakeInProgress&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For usage example check [[Community_extensions#Batch_scene_baker|Batch Scene Baker]] script.&lt;br /&gt;
&lt;br /&gt;
==Additional functions==&lt;br /&gt;
&lt;br /&gt;
Copies all render settings from one ftLightmapsStorage to another:&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmapsStorage.CopySettings(ftLightmapsStorage src, ftLightmapsStorage dest)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Gets global (per-project) storage object:&lt;br /&gt;
&amp;lt;pre&amp;gt;ftGlobalStorage gstorage = ftLightmaps.GetGlobalStorage()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copies all render settings from ftLightmapsStorage (per-scene) to ftGlobalStorage  (per-project):&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmapsStorage.CopySettings(ftLightmapsStorage src, ftGlobalStorage dest)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copies all render settings from ftGlobalStorage (per-project) to ftLightmapsStorage (per-scene):&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmapsStorage.CopySettings(ftGlobalStorage src, ftLightmapsStorage dest)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Gets the path to the folder containing Bakery binaries:&lt;br /&gt;
&amp;lt;pre&amp;gt;ftLightmaps.GetEditorPath()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Additional variables==&lt;br /&gt;
&lt;br /&gt;
Gets the current temporary files path (ftRenderLightmap instance must be created first):&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.scenePath&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Gets/sets UVGBuffer data compression (LZ4, if enabled, DDS if not):&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.compressedGBuffer&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Gets/sets output lightmap data compression (LZ4, if enabled, DDS if not):&lt;br /&gt;
&amp;lt;pre&amp;gt;ftRenderLightmap.compressedOutput&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Events==&lt;br /&gt;
&lt;br /&gt;
Scripts can subscribe to static events in ftRenderLightmap class.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Called before full Render:&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnPreFullRender&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Called before each light probe is rendered in Legacy light probe mode. ProbeEventArgs is a struct containing '''pos''' field with current light probe position:&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler&amp;lt;ProbeEventArgs&amp;gt; OnPreRenderProbe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Called after Legacy light probes were rendered:&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnFinishedProbes&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Called after full Render was finished:&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnFinishedFullRender&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Called before reflection probes are rendered:&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnPreReflectionProbeRender&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Called after reflection probes were rendered:&lt;br /&gt;
&amp;lt;pre&amp;gt;EventHandler OnFinishedReflectionProbes&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mr F</name></author>
		
	</entry>
	<entry>
		<id>https://geom.io/bakery/wiki/index.php?title=%E4%BD%BF%E7%94%A8%E6%89%8B%E5%86%8C&amp;diff=1825</id>
		<title>使用手册</title>
		<link rel="alternate" type="text/html" href="https://geom.io/bakery/wiki/index.php?title=%E4%BD%BF%E7%94%A8%E6%89%8B%E5%86%8C&amp;diff=1825"/>
		<updated>2025-11-05T13:59:36Z</updated>

		<summary type="html">&lt;p&gt;Mr F: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== 系统要求 ==&lt;br /&gt;
&lt;br /&gt;
使用 Bakery 需要：&lt;br /&gt;
&lt;br /&gt;
Windows（7 或更高版本）电脑。&lt;br /&gt;
&lt;br /&gt;
Nvidia 显卡。最低支持型号为 Kepler（GeForce 650 或更新型号，Quadro 显卡请查看规格）。&lt;br /&gt;
&lt;br /&gt;
64 位 Unity 编辑器。Bakery 已在 5.6 到 6 及更高版本上测试过，同时也在 Tuanjie 1.6.7 上通过测试。&lt;br /&gt;
&lt;br /&gt;
{{note|系统要求仅适用于开发者的电脑，而非目标平台。使用 Bakery 烘焙的光照贴图可以在任何地方使用。}}&lt;br /&gt;
&lt;br /&gt;
== 前提条件 ==&lt;br /&gt;
* 确保你的项目中没有任何脚本编译错误，否则也会导致 Bakery 的脚本无法编译。&lt;br /&gt;
* 确保你的显卡驱动是最新版本，如有需要请[https://www.nvidia.com/Download/index.aspx?lang=en-US 更新]。&lt;br /&gt;
&lt;br /&gt;
'''请使用 Game-Ready（标准）驱动程序，而不是 “Studio” 驱动。'''&lt;br /&gt;
&lt;br /&gt;
== 安装 ==&lt;br /&gt;
&lt;br /&gt;
1. 通过 [https://assetstore.unity.com/packages/tools/level-design/bakery-gpu-lightmapper-122218 Asset Store] 将 Bakery 导入到你的项目中。&lt;br /&gt;
&lt;br /&gt;
2. Unity 会显示要导入的文件列表。如果这是你第一次使用 Bakery，建议直接 点击 Import（导入）。有经验的用户可以取消选中 examples 文件夹，以进行更轻量的安装。&lt;br /&gt;
&lt;br /&gt;
文件将被导入到 `Assets/Bakery` 和 `Assets/Editor/x64/Bakery` 文件夹中。&lt;br /&gt;
这些文件夹之后可以移动。&lt;br /&gt;
&lt;br /&gt;
3. Unity 随后会导入 Bakery 并编译脚本。此时可能会弹出如下窗口：&lt;br /&gt;
&lt;br /&gt;
[[File:Goahead.png]]&lt;br /&gt;
&lt;br /&gt;
此时你应点击 “Go Ahead”（继续）。&lt;br /&gt;
&lt;br /&gt;
现在你应该能在编辑器中看到新增的 Bakery 菜单：&lt;br /&gt;
&lt;br /&gt;
[[File:bmenu.jpg]]&lt;br /&gt;
&lt;br /&gt;
== 快速开始 ==&lt;br /&gt;
&lt;br /&gt;
1. 添加一些模型或基础体，并将其标记为静态（Static）。&lt;br /&gt;
&lt;br /&gt;
'''用于光照贴图的网格必须具有不重叠的 UV2。如果存在 UV2，则会使用 UV2（否则使用 UV1）。如果你的模型没有为光照贴图进行展开，请在资源中勾选 Generate Lightmap UVs（生成光照贴图 UV）。'''&lt;br /&gt;
Unity 的基础体已经具有正确的 UV2。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Staticmarked.jpg|320px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. 选择方向光（Unity 为你创建的那个），并添加 '''Bakery Direct Light''' 组件。&lt;br /&gt;
   {{note|Bakery 和 Unity 使用独立的光源组件。}}&lt;br /&gt;
&lt;br /&gt;
3. Bakery Direct Light 有许多可调选项，但你可以轻松将其与 Unity 光源匹配。点击 '''Match lightmapped to real-time'''。现在 Bakery 光源的颜色应与 Unity 默认的方向光相同，呈黄色调。&lt;br /&gt;
&lt;br /&gt;
[[File:Matching.jpg|640px]]&lt;br /&gt;
&lt;br /&gt;
{{note|Direct Light 组件可能会提示项目未使用线性光强度。问题在于，Unity 默认会对光源颜色应用伽马校正 [https://twitter.com/guycalledfrank/status/1001108508614553600 不正确]。&lt;br /&gt;
可以通过[https://docs.unity3d.com/ScriptReference/Rendering.GraphicsSettings-lightsUseLinearIntensity.html 脚本]启用正确模式。&lt;br /&gt;
这就是 “Fix” 按钮的作用。如果你已经在非线性光强模式下设置了许多光源，并且不想再次更改它们，可以跳过修复。即使你按了 “Fix”，也可以随时撤销此更改。&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. 要获得带阴影的环境光，请创建 Skylight（Bakery-&amp;gt;Create-&amp;gt;Skylight）。&lt;br /&gt;
&lt;br /&gt;
[[File:Menusky.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. 选择 Skylight，为它设置一些偏蓝的颜色，然后点击 '''Match scene skybox to this light'''。   这将使场景的 skybox 与光照完全匹配。&lt;br /&gt;
   {{note|将 Unity 的 skybox 与 Bakery Skylight 匹配是可选的，但对正确性很有用，可以确保可见环境和引擎内的反射探针与烘焙光照一致。目前此选项仅适用于 Standard 渲染管线。}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Skycomp.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. 点击 Bakery-&amp;gt;Render Lightmap。默认情况下，Full Lighting 模式是激活的。它会烘焙所有光源的直接和间接光照贡献。如果你想将实时阴影与烘焙全局光照（GI）结合使用，请将模式更改为 '''Indirect'''。&lt;br /&gt;
&lt;br /&gt;
[[File:Bakerywindow.jpg]]&lt;br /&gt;
&lt;br /&gt;
{{note| Bakery 可能会提示你正在使用旧的 [https://docs.unity3d.com/Manual/LinearLighting.html gamma mode]。如果你在意光照质量，强烈建议使用线性模式。如果你的项目已经在错误的伽马模式下设置好了，并且不想更改，或者是发布到不支持线性模式的移动设备上，也可以忽略此提示。}}&lt;br /&gt;
&lt;br /&gt;
7. 点击 '''Render'''。&lt;br /&gt;
&lt;br /&gt;
8. 完成！现在你应该已经得到烘焙的全局光照（GI）：&lt;br /&gt;
&lt;br /&gt;
[[File:Bakedgi.jpg]]&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 ==&lt;br /&gt;
&lt;br /&gt;
所有渲染设置都可以通过 Bakery-&amp;gt;Render Lightmap 访问。设置会为每个场景单独保存。Bakery 窗口顶部的选项允许你在 Simple（简单）、Advanced（高级）和 Experimental（实验）设置之间切换，每个后续模式都会显示更多可调选项。对于大多数场景，Simple 模式已经足够，是入门的好方法。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render mode ===  &lt;br /&gt;
定义要烘焙的光照贴图类型。  &lt;br /&gt;
&lt;br /&gt;
===== Full Lighting =====&lt;br /&gt;
烘焙所有 Bakery 光源的完整直接光和间接光。&lt;br /&gt;
{{note|在 2017.3 之前的 Unity 版本中，如果同一对象上同时有 Unity 和 Bakery 组件，你需要手动禁用 Unity 组件以避免亮度加倍。在较新版本中，实时效果会自动对烘焙光源禁用，就像内置光照烘焙器一样。}}&lt;br /&gt;
&lt;br /&gt;
===== Indirect =====&lt;br /&gt;
[[File:Image26.png|thumb|Unity 支持的不同渲染模式对比]]&lt;br /&gt;
基础混合模式。它会查看每个光源上的 Baked Contribution 选择器：如果设置为 ''Direct And Indirect''，则光源会像在 Full Lighting 模式下一样被烘焙。如果设置为 ''Indirect Only''，则只会烘焙该光源的间接光照（GI）。在后一种情况下，你应保持对象上的 Unity 光源和 Bakery 光源同时存在，一个提供实时直接光照，另一个提供预计算的全局光照（GI）。&lt;br /&gt;
&lt;br /&gt;
[[File:Indirectonly.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== Shadowmask =====&lt;br /&gt;
[[File:Image21.png|thumb|左：完全烘焙的光照。中：动态光源 + 烘焙 GI。右：胶囊形阴影、凹凸贴图和高光为动态光照，但立方体阴影和 GI 为烘焙光照。]]&lt;br /&gt;
[[File:Image6.png|thumb|当相机足够远离场景，或者动态阴影被禁用时，场景将呈现如下效果]]&lt;br /&gt;
更高级的混合模式。它通过生成两种类型的光照贴图来工作——一种包含烘焙颜色（如 Indirect 模式），另一种包含静态物体的阴影。它有几个优点：&lt;br /&gt;
* 实时阴影只需渲染少量动态对象，而不是整个场景。&lt;br /&gt;
* 实时阴影与烘焙阴影可以正确融合。&lt;br /&gt;
* 实时光源可以渲染凹凸贴图、高光和其他表面效果，同时仍会被高质量烘焙阴影遮挡。&lt;br /&gt;
[https://docs.unity3d.com/Manual/LightMode-Mixed-Shadowmask.html 更多详情]&lt;br /&gt;
&lt;br /&gt;
要启用此行为，你必须在同一对象上同时存在 Unity 光源和 Bakery 光源，并将 Baked Contribution 设置为 ''Shadowmask and Indirect''。未标记的光源将按 Indirect 模式进行烘焙。&lt;br /&gt;
&lt;br /&gt;
[[File:Smask22.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== Distance Shadowmask =====&lt;br /&gt;
此复选框仅在你选择 Shadowmask 时可见，并且只是切换项目 [https://docs.unity3d.com/Manual/LightMode-Mixed-ShadowmaskMode.html Quality Settings] 中同名的设置。&lt;br /&gt;
[https://docs.unity3d.com/Manual/LightMode-Mixed-DistanceShadowmask.html 更多详情]&lt;br /&gt;
{{note|由于缺少对应的脚本 API，该复选框在 Unity 5.6.x 上不可见。你可以在 Window-&amp;gt;Lighting-&amp;gt;Mixed Lighting-&amp;gt;Lighting Mode 中切换该设置。}}&lt;br /&gt;
{{note|在 Unity 版本 &amp;lt; 2017.3 中，由于 API 限制，渲染 Shadowmask 光照贴图会清除光照探针。烘焙后需要重新渲染光照探针。在较新版本中不应发生此问题。}}&lt;br /&gt;
&lt;br /&gt;
===== Subtractive =====&lt;br /&gt;
&lt;br /&gt;
启用 [https://docs.unity3d.com/Manual/LightMode-Mixed-Subtractive.html Subtractive] 光照模式。&lt;br /&gt;
&lt;br /&gt;
此选项对光照贴图本身没有任何特殊作用，实际上它的工作方式与 Full Lighting 相同。&lt;br /&gt;
&lt;br /&gt;
唯一的区别是，它还会将实时 Unity 光源设置为与 Subtractive 模式兼容（因为无法通过 UI 完成此操作）。&lt;br /&gt;
&lt;br /&gt;
你还需要在 [https://docs.unity3d.com/Manual/GlobalIllumination.html#MixedLighting Unity Lighting] 窗口中额外设置全局减法参数（例如全局阴影颜色）。&lt;br /&gt;
&lt;br /&gt;
===== Ambient Occlusion Only =====&lt;br /&gt;
仅烘焙环境光遮蔽（AO）。如果你很清楚自己在做什么，这可能会有用。请确保设置 [[#Ambient_occlusion|AO 选项]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Directional mode ===&lt;br /&gt;
[[File:Image3.png|thumb|不同方向模式的对比]]&lt;br /&gt;
定义了方向信息的烘焙方式。标准光照贴图每个像素只存储单一颜色，而方向光照贴图为着色器提供了关于该像素周围半球内光照变化的提示。这些数据用于在完全烘焙的区域中结合法线贴图。如果将其应用到内置的 [[#Bakery_shaders|Bakery]] 着色器中，还可以产生**近似高光反射**效果。&lt;br /&gt;
&lt;br /&gt;
===== None =====&lt;br /&gt;
不包含方向数据，每个像素仅有单一颜色。&lt;br /&gt;
&lt;br /&gt;
===== Baked Normal Maps =====&lt;br /&gt;
依然没有方向数据，但在渲染光照贴图时会考虑法线贴图。此方式在运行时没有额外开销。由于光照贴图的分辨率通常低于法线贴图，结果可能显得模糊。其他问题包括：由于缺乏 mipmapping，远处可能出现锯齿，以及降噪步骤可能导致细节被涂抹。要了解如何在此模式下使用具有程序化法线的自定义着色器，请参阅 [[#Normal_mapping|Normal Mapping]] 章节。&lt;br /&gt;
&lt;br /&gt;
===== Dominant Direction =====&lt;br /&gt;
此模式类似于 Unity 中 Enlighten 和 Progressive 烘焙器的实现。它与大多数着色器兼容，仅生成一张额外的贴图，运行时开销极小。缺点是凹凸贴图的效果较弱，略显灰暗，与实时光照下的同一物体相比可能差异较大。&lt;br /&gt;
&lt;br /&gt;
===== RNM =====&lt;br /&gt;
基于最初为《Half-Life 2》开发的 [https://steamcdn-a.akamaihd.net/apps/valve/2004/GDC2004_Half-Life2_Shading.pdf Radiosity Normal Mapping] 技术（相关演示文稿），后来被许多游戏采用（如《Mirror's Edge》）。此模式总共生成三张 HDR 贴图，是内存占用最高的模式之一，但运行时开销仍相对较低。该模式比 Dominant Direction 更精确，能更好地再现表面反差，并能正确处理来自不同角度、具有不同颜色的光照对法线贴图的影响。&lt;br /&gt;
&lt;br /&gt;
===== SH =====&lt;br /&gt;
基于论文《[https://media.contentapi.ea.com/content/dam/eacom/frostbite/files/gdc2018-precomputedgiobalilluminationinfrostbite.pdf Precomputed Global Illumination in Frostbite]》。这是最高质量的模式，能提供更好的表面对比度，并准确表现来自不同方向、不同颜色的光照。总共生成四张贴图，其中仅一张为 HDR，因此比 RNM 占用更少内存。运行时开销略高于 RNM。&lt;br /&gt;
&lt;br /&gt;
===== MonoSH =====&lt;br /&gt;
[[File:FY8Ru8hWIAAdYYH.jpg|thumb|Dominant Direction、完整 SH 与 MonoSH 的尺寸/质量对比]]&lt;br /&gt;
与 SH 类似，但使用单色的 L1 方向系数。表面对比度同样良好，虽然无法准确表现来自不同方向的不同颜色光照，但对多数场景来说已经足够。仅生成一张额外贴图，因此显存占用与带宽需求与 Dominant Direction 相近；事实上更低，因为 Dominant Direction 使用 RGBA 贴图，而 MonoSH 只需 RGB。该贴图通过内置的方向光照贴图系统传递，但''在标准着色器下显示不正确''。请务必使用兼容的着色器。&lt;br /&gt;
&lt;br /&gt;
===== 限制 =====&lt;br /&gt;
&lt;br /&gt;
* RNM 和 SH/MonoSH 只能与 [[#Bakery_shaders|Bakery shader]] 一起使用，或者需要对你的着色器进行调整。&lt;br /&gt;
* 在 RNM 和 SH 模式下，不会生成标准的颜色光照贴图。你需要确保场景中所有材质都使用 Bakery Shader，或者使用 [[#Bakery_Lightmap_Group_Selector|Lightmap Groups]] 将 RNM/SH 对象与其他对象分开。&lt;br /&gt;
* RNM 和 SH 贴图是通过 [https://docs.unity3d.com/ScriptReference/MaterialPropertyBlock.html MaterialPropertyBlock] 应用于对象的，因此在 Unity 的 Lighting 窗口中可能无法完全显示。&lt;br /&gt;
* Dominant Direction、RNM 和 SH/MonoSH 模式可能需要为全局光照（GI）和光照网格使用更多采样，以获得相近的质量。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Texels per unit ===&lt;br /&gt;
[[File:Texelscomp.jpg|thumb|1 vs 10 texels per unit]]&lt;br /&gt;
每个世界单位的光照贴图像素（Texels）近似数量。它会影响生成光照贴图的数量和分辨率。&lt;br /&gt;
&lt;br /&gt;
入门示例值：&lt;br /&gt;
&lt;br /&gt;
* 大型户外区域（城市）：1 - 5&lt;br /&gt;
* 中型户外区域（几条小巷）：10 - 20&lt;br /&gt;
* 高质量室内场景：100&lt;br /&gt;
&lt;br /&gt;
假设场景比例大约为 1 单位 = 1 米。在 Unity 中使用这种比例通常是推荐的，以便更好地导航和进行物理模拟。如果你的比例不同，请相应地调整 Texels。&lt;br /&gt;
&lt;br /&gt;
请注意，Texels Per Unit 是基础分辨率，但每个对象还可以通过 Mesh Renderer 上的 &amp;quot;Scale in Lightmap&amp;quot; 选项以及 Bakery 窗口中的 &amp;quot;Scale per map type&amp;quot; 进行额外调整。&lt;br /&gt;
&lt;br /&gt;
{{note| 将 &amp;quot;Scale in Lightmap&amp;quot; 设置为 0 的对象不会被烘焙，但仍会投射阴影并影响全局光照（GI）。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Max resolution ===&lt;br /&gt;
光照贴图的最大尺寸限制。如果对象无法容纳在单张光照贴图中（根据当前的 Texels Per Unit 值），将会分配额外的光照贴图。同样的四个正方形对象可以使用四张 512x512 的贴图，也可以使用一张 1024x1024 的贴图。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bounces ===&lt;br /&gt;
[[File:Image36.png|thumb|注意更多的反弹会为封闭空间带来更多光照。]]&lt;br /&gt;
定义光线在表面上反弹的次数。通常，对于户外场景（例如城市），较低的反弹次数就足够了，而对于封闭场景（室内、洞穴），则需要较高的反弹次数。&lt;br /&gt;
&lt;br /&gt;
虽然滑块最多限制为 5 次反弹，但可以在数字输入框中输入任意反弹次数。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Samples ===&lt;br /&gt;
[[File:Image7.png|thumb|左：Samples = 4，右：Samples = 16。为了演示，去噪功能已关闭。]]&lt;br /&gt;
影响全局光照（GI）的质量。典型值为 16 到 32。&lt;br /&gt;
&lt;br /&gt;
{{note| 可以输入超出滑块最大值的任意数字，但请注意，该数字表示最终光线数量的平方根，例如 32 表示 1024 条光线，64 表示 4096 条光线，依此类推。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GPU Priority ===&lt;br /&gt;
在 GPU 处理光照贴图时，操作系统和其他软件的响应可能会变慢。此选项允许你在烘焙速度和系统响应之间进行平衡。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render ===&lt;br /&gt;
为所有打开的场景烘焙光照贴图。&lt;br /&gt;
如果 [[使用手册#Light_probe_mode|Light Probe Mode]] 设置为 L1 或 L2，也会烘焙 [https://docs.unity3d.com/Manual/LightProbes.html 光照探针]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Render Light Probes ===&lt;br /&gt;
为所有打开的场景烘焙 [https://docs.unity3d.com/Manual/LightProbes.html 光照探针]。&lt;br /&gt;
&lt;br /&gt;
请注意，要在 Shadowmask 模式下对动态对象获得正确的混合光阴影，你还需要启用 [[使用手册#Occlusion_probes|occlusion probes]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Render Reflection Probes ===&lt;br /&gt;
为所有打开的场景烘焙反射探针。此按钮仅为方便起见，会调用引擎内置的反射探针更新功能。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update Skybox Probe ===&lt;br /&gt;
为当前的 skybox 烘焙全局漫反射和反射探针。与 “Render Reflection Probes” 一样，它仅调用引擎内置函数。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Occlusion probes ===&lt;br /&gt;
在渲染光照探针时，允许 Unity 使用当前选择的内置光照烘焙器烘焙遮挡探针（occlusion probes）。遮挡探针是存储在普通光照探针中的附加数据，可以防止动态对象在阴影区域被错误照亮。目前在 Unity 中无法使用自定义遮挡探针，必须调用内置光照烘焙器来完成此操作。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Warnings ===&lt;br /&gt;
这些选项会在按下任意 Render 按钮后对场景进行验证，并显示警告对话框，询问是否继续或停止烘焙过程。&lt;br /&gt;
&lt;br /&gt;
* Suppress all popups（屏蔽所有弹窗）：按下 Render 后不显示任何对话框。&lt;br /&gt;
* UV validation（UV 验证）：检查所有模型是否具有完全正确的光照贴图 UV，特别是 UV 是否位于 0-1 范围内且不重叠。&lt;br /&gt;
* Overwrite check（覆盖检查）：显示哪些光照贴图文件将被覆盖。&lt;br /&gt;
* Memory check（内存检查）：显示大致所需的视频内存量。&lt;br /&gt;
* Sample count check（采样数检查）：检查是否有光源、GI 或 AO 的采样数不合理，可能导致 GPU 超出可用资源。&lt;br /&gt;
* Lightmapped prefab validation（光照贴图预制体验证）：验证光照贴图预制体，并在某些预制体将被覆盖时发出通知。&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 (Advanced) ==&lt;br /&gt;
=== Light probe mode ===&lt;br /&gt;
更改光照探针的烘焙方式。&lt;br /&gt;
&lt;br /&gt;
* Legacy（传统模式）：使用 Render Light Probes 按钮生成探针。点光源和方向光在光照烘焙器中计算，而区域光/天空光/间接光则通过在每个探针位置渲染立方体贴图收集。结果以 [https://docs.unity3d.com/ScriptReference/Rendering.SphericalHarmonicsL2.html L2] 球谐（spherical harmonics）形式存储。缺点是立方体贴图渲染速度慢，并且在游戏中使用的着色器未物理正确表示光照表面，或者项目为移动平台设置时，光照贴图和探针可能不匹配（Unity 可能会裁剪高强度值）。&lt;br /&gt;
&lt;br /&gt;
* L1：在点击 Render 时，光照探针会与光照贴图一起渲染。此选项提供更高的烘焙性能，并保证探针光照与光照贴图匹配。结果以 L1 球谐形式存储（仍可被普通着色器使用）。使用 [[#Bakery_shaders|Bakery shader]] 的 Non-Linear Light Probe SH 选项可以进一步提升结果。&lt;br /&gt;
&lt;br /&gt;
* L2：更高质量（完整 L2 球谐）。与 L1 一样，会自动与光照贴图一起渲染。与 L1 相比，性能影响可忽略不计。应在所有着色器下显示正常。探针对比度/方向性/振铃去除可通过 Project Settings -&amp;gt; Bakery -&amp;gt; “Ringing removal for L2 light probes” 调整。&lt;br /&gt;
&lt;br /&gt;
'''在 Unity 2019.3 中似乎存在一个 bug，如果启用 Occlusion Probes 选项，Legacy 光照探针的颜色无法正确保存。使用 Occlusion Probes 时，默认且推荐使用 L2 模式。'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Asset UV Processing ===&lt;br /&gt;
配置资产的 UV 间距（padding）调整。可选值：&lt;br /&gt;
&lt;br /&gt;
* Don't change（不更改）：不修改资产。&lt;br /&gt;
* Adjust UV padding（调整 UV 间距）：会查找具有自动生成 UV 的模型（资产上启用 “Generate Lightmap UVs”），并进一步调整它们，使每个网格的 UV 岛之间具有适当间距。导入器设置中的全模型 Pack Margin 会被忽略。系统会根据每个网格的面积和光照贴图分辨率计算出最优值。&lt;br /&gt;
* Adjust UV padding for new meshes only（仅调整新网格的 UV 间距）：与上面相同，但会跳过之前至少调整过一次的模型。&lt;br /&gt;
* Remove UV adjustments（移除 UV 调整）：撤销所有之前的 UV 调整，使自动展开的模型恢复到 Unity 原始展开的样子。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser ===&lt;br /&gt;
设置所需的去噪器。可选值：&lt;br /&gt;
&lt;br /&gt;
* Optix 5：使用 OptiX 5.1 AI 去噪器（之前称为 “Legacy denoiser”）。在 GPU 上运行。支持从 [https://en.wikipedia.org/wiki/Kepler_(microarchitecture) Kepler]（通常是 GeForce 6xx）到 [https://en.wikipedia.org/wiki/Turing_(microarchitecture) Turing]（通常是 GeForce 20xx）的所有显卡。不支持 [https://en.wikipedia.org/wiki/Ampere_(microarchitecture) Ampere]（30xx）。OptiX 5.1 使用嵌入的静态训练数据集，因此不受驱动实现影响。&lt;br /&gt;
&lt;br /&gt;
* Optix 6：使用 OptiX 6.0 AI 去噪器（之前为默认选项）。在 GPU 上运行。在 Kepler（6xx）显卡上似乎无法使用，但在更新的显卡上均可运行，包括 Ampere（30xx）。自 6.0 起，OptiX 去噪器的训练数据集存储在驱动中。在 v442.50 之前，其行为类似于 OptiX 5.1；但之后 NVIDIA [https://forums.developer.nvidia.com/t/optix7-denoiser-different-results-with-different-version-of-drivers/117989/2 更改了数据集]，结果可能有所不同。更新后的数据集有时可能产生网格状图案和更亮的边缘（仍可通过 “Denoise: fix bright edges” 修复），但运行速度更快。&lt;br /&gt;
&lt;br /&gt;
* Optix 7：使用 OptiX 7.2 AI 去噪器。行为类似 OptiX 6.0，但在 Ampere（30xx）上可能支持更好。&lt;br /&gt;
&lt;br /&gt;
* OpenImageDenoise：使用 Intel Open Image Denoise 库。在 CPU 上运行（任何支持 SSE 4.1 的 CPU）。可能略慢于 OptiX，但质量可比。&lt;br /&gt;
&lt;br /&gt;
* OpenImageDenoise2：使用 Intel Open Image Denoise 2，CUDA 模式。在 GPU 上运行，性能与 OptiX 6/7 相当，质量与 CPU 版本相同。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Adjust sample positions ===&lt;br /&gt;
寻找最佳采样位置以防止光照泄漏。算法详情可参考 [https://ndotl.wordpress.com/2018/08/29/baking-artifact-free-lightmaps/#leaks 此处]。在某些情况下（通常是大型且多边形极少、法线平滑的几何体），可能会产生不正确的结果，此时可以将其禁用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Unload scenes before render ===&lt;br /&gt;
在烘焙前卸载 Unity 场景以释放显存。复杂场景仅在编辑器中显示就可能占用数 GB 的显存。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Denoise ===&lt;br /&gt;
[[File:Image31.png|thumb|左：未开启 “Denoise”，右：开启 “Denoise”。]]&lt;br /&gt;
如果启用，将应用去噪算法。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Fix Seams ===&lt;br /&gt;
[[File:Image22.png|thumb|左：缝隙（“Fix Seams” 关闭），右：缝隙已修复（“Fix Seams” 开启）。]]&lt;br /&gt;
如果启用，将尝试融合由 UV 不连续造成的缝隙。对平滑几何体很有用，包括 Unity 默认的球体。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Split by scene ===&lt;br /&gt;
如果同时加载多个场景，并且启用此选项，每个场景将拥有自己的一套光照贴图，而不会与其他场景共享。这对于在运行时流式加载场景时限制纹理占用量非常有用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hole filling ===&lt;br /&gt;
[[File:Holefilling.jpg|thumb|“Hole filling” 关闭与开启的对比。]]&lt;br /&gt;
如果 Atlas Packer 设置为 xatlas，将尝试填充每个孔洞，从而生成更高效的贴图集。对于几何体非常复杂的场景，可能会增加场景导出时间，但通常推荐开启。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Min resolution ===&lt;br /&gt;
光照贴图的最小尺寸限制。可用于在生成大量小而完全填充的光照贴图与少量未完全填充的光照贴图之间进行平衡。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Scale per map type ===&lt;br /&gt;
允许你对颜色贴图、Shadowmask 和方向贴图设置不同的分辨率缩放。例如，常见情况是间接光颜色分辨率较低，但 Shadowmask 分辨率较高。请注意，缩放在光照贴图渲染完成后才应用，因此不会节省烘焙时间。如果启用了 “Adjust UV padding”，间距将基于最低分辨率的贴图，以防止像素泄漏。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Checker preview ===&lt;br /&gt;
[[File:Image12.png|thumb|Checker Preview 功能演示。]]&lt;br /&gt;
如果勾选了 “Show checker” 选项，场景视图将在可见对象上渲染棋盘格图案，以展示光照贴图像素大小。这对于在烘焙前确保 Texels Per Unit 和其他影响分辨率的设置使用合理数值非常有用。&lt;br /&gt;
&lt;br /&gt;
启用 Checker Preview 将强制 Bakery 执行贴图集打包。可能需要一些时间，但通常不会超过几秒钟。在修改场景内容后，按下 “Refresh checker” 可重新打包场景以查看更改。&lt;br /&gt;
&lt;br /&gt;
Checker Preview 还使用随机颜色显示场景将如何被分割到不同的光照贴图中。&lt;br /&gt;
&lt;br /&gt;
{{note| 当前 Checker Preview 无法显示地形的正确像素大小。}}&lt;br /&gt;
&lt;br /&gt;
==== Atlas preview ====&lt;br /&gt;
[[File:FN-TmhRXwAE9i2I.png|thumb|Atlas Preview 功能演示]]&lt;br /&gt;
当 Checker Preview 开启时，会显示 Atlas Preview 按钮。点击它将打开一个新窗口，显示未来光照贴图的 UV 布局。点击 &amp;quot;&amp;lt;&amp;quot; 和 &amp;quot;&amp;gt;&amp;quot; 按钮可浏览各个光照贴图。&lt;br /&gt;
这对于在烘焙前检查打包质量和光照贴图数量非常有用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Emissive boost ===&lt;br /&gt;
将任何表面自发光（emission）乘以此数值。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Indirect boost ===&lt;br /&gt;
将所有反弹光照乘以此数值。作用与光源组件上的 Indirect Intensity 相同，但为全局设置。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Backface GI ===&lt;br /&gt;
[[File:Image30.jpg|thumb|Backface GI]]&lt;br /&gt;
[[File:Image35.png|thumb|左：“Backface GI” = 0，右：“Backface GI” = 1。注意阴影区域接收到更多的绿色光照。]]&lt;br /&gt;
决定光线通过前面表面到达背面并被全局光照（GI）反弹的程度。这对于薄的半透明表面（如树叶）尤其有用。取值范围为 0-1。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Ambient occlusion ===&lt;br /&gt;
[[File:Image15.png|thumb|左：AO intensity = 0，右：AO intensity = 1。]]&lt;br /&gt;
一种简单的非物理环境光遮蔽（Ambient Occlusion，AO），可在最终场景光照上叠加以增强美观效果。&lt;br /&gt;
&lt;br /&gt;
* Intensity（强度）：控制 AO 效果的可见度。值为 0 时禁用该效果。&lt;br /&gt;
* Radius（半径）：决定 AO 效果使用的光线距离。较小的值产生局部遮蔽（角落、褶皱），较大的值则更类似 Skylight，从远处物体产生阴影。&lt;br /&gt;
* Samples（采样数）：影响环境光遮蔽的质量。典型值为 4 到 32。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dither transparency ===&lt;br /&gt;
通过自动抖动不透明度贴图来启用半透明阴影。[[使用手册#Opacity|了解 Bakery 如何处理不透明度贴图]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== RTX Mode ===&lt;br /&gt;
启用 RTX 硬件加速。仅 RTX 显卡可受益于此选项。最低支持的驱动版本为 418。&lt;br /&gt;
&lt;br /&gt;
驱动可以在大多数非 RTX Nvidia 显卡上模拟 RTX 模式，但通常会更慢。&lt;br /&gt;
&lt;br /&gt;
在 Ampere（3xxx）或更新的显卡上，RTX 模式 ''必须'' 启用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Export terrain trees ===&lt;br /&gt;
如果启用，绘制在地形上的树木将影响光照。树木本身不会被烘焙。请注意，在烘焙过程中，每棵树都使用最高可能的 LOD 等级。对于多公里范围且模型高度复杂的森林场景，不建议使用此选项。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Terrain optimization ===&lt;br /&gt;
如果启用（默认），地形将使用独立的光线追踪技术以利用其高程图几何结构。否则，它们将像其他普通网格一样处理。地形优化可以显著减少高分辨率地形所需的内存占用。在某些情况下，它还能加快地形烘焙速度，但在其他情况下（尤其是简单低分辨率地形）可能需要禁用该选项。&lt;br /&gt;
&lt;br /&gt;
{{note| 地形优化当前不兼容绘制的地形洞。需禁用此选项才能使其正常工作。}}&lt;br /&gt;
{{note| 地形优化仅支持非 RTX 模式。}}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Light Mesh batch limit ===&lt;br /&gt;
如果该值大于 0，会将多个 Light Mesh 合并为一个，前提是它们具有相同设置并影响相同的 Lightmap Groups，同时将它们的总采样数限制为该值（例如，如果限制为 64，则可以合并 2 个采样数为 32 的灯光，或 4 个采样数为 16 的灯光，等等）。在拥有大量 Light Mesh 的场景中，这可以提升性能。但设置过高时需小心，因为 GPU 在一次处理过多采样时可能触发操作系统驱动超时。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Compress volumes ===&lt;br /&gt;
如果启用，将对体积 3D 贴图应用纹理压缩，并将 Bakery 着色器切换到相应的采样模式。不推荐对分辨率非常低的体积使用此选项。体积大小可能会被调整为 4 的倍数。&lt;br /&gt;
&lt;br /&gt;
注意事项：&lt;br /&gt;
&lt;br /&gt;
* 目前仅支持压缩为 BC6H/BC7 纹理格式（桌面/主机平台）。&lt;br /&gt;
* 体积压缩仅支持 Unity 2020.1 或更高版本。&lt;br /&gt;
* 目前仅标准渲染管线的 Bakery 着色器支持使用压缩体积贴图。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Samples multiplier ===&lt;br /&gt;
将所有阴影和 GI 采样数乘以指定因子。可用于在草稿质量和最终质量之间快速切换。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Tile size ===&lt;br /&gt;
与 [[#GPU Priority|GPU Priority]] 相同，但这里设置的是贴图块（tile）大小。Bakery 会将光照贴图拆分为更小的块，并一次更新一个块。块越小，GPU 工作被中断的次数越多，系统响应性可能更好。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Temp path ===&lt;br /&gt;
临时文件夹。在渲染过程中，Bakery 可能需要几个 GB 的可用空间。将此文件夹放在 SSD 上相比 HDD 可略微加快渲染速度。目前，该文件夹不会自动清理。你可以随时手动删除其内容（渲染时除外），或通过 Bakery -&amp;gt; Utilities -&amp;gt; Clear cache 清理。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Output path ===&lt;br /&gt;
光照贴图文件夹。所有光照贴图，以及 lightprobe 和顶点颜色（vertex color）资源都将保存在此处。该路径相对于你的 Assets 文件夹。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Use scene named output path ===&lt;br /&gt;
如果启用此选项，输出路径将自动设置为与当前活动场景同名的文件夹（Assets/CurrentSceneName/）。这与 Unity 内置光照贴图烘焙器的行为类似。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render Selected Groups ===&lt;br /&gt;
仅烘焙包含所选对象的 Lightmap Groups。&lt;br /&gt;
不仅仅是所选对象会被重新绘制，它们所属的所有 Lightmap Groups 都会被处理。其他光照贴图不会被更新。如果对象不属于某个手动分配的组，则使用相同光照贴图的场景部分将被重新烘焙。&lt;br /&gt;
&lt;br /&gt;
目前，使用 [[Partial_scene_baking|Sectors]] 进行场景部分烘焙更为方便。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Beep on finish ===&lt;br /&gt;
如果启用，Bakery 在烘焙完成时会播放提示音。&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 (Experimental) ==&lt;br /&gt;
=== Unwrapper ===&lt;br /&gt;
如果启用 [[#Asset_UV_Processing|Adjust UV Padding]]，则定义将使用的展开器（unwrapper）。&lt;br /&gt;
&lt;br /&gt;
* Default：使用 Unity 标准展开器。Bakery 会为每个具有不同间距参数的网格调用 [https://docs.unity3d.com/ScriptReference/Unwrapping.GenerateSecondaryUVSet.html Unwrapping.GenerateSecondaryUVSet]。&lt;br /&gt;
* xatlas：使用 [https://github.com/jpcy jpcy] 的 [https://github.com/jpcy/xatlas xatlas]，这是 [https://github.com/castano Ignacio Castaño] 的 [https://github.com/Thekla/thekla_atlas thekla_atlas] 的修改版。thekla_atlas 曾用于游戏《The Witness》（[http://the-witness.net/news/2010/03/graphics-tech-texture-parameterization/ 参见博客文章]）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Atlas Packer ===&lt;br /&gt;
选择在将不同对象的 UV 布局打包到大型光照贴图集时使用的算法。&lt;br /&gt;
* Default：Bakery 在 v1.7 之前使用的原始算法。&lt;br /&gt;
* xatlas：使用 xatlas。&lt;br /&gt;
&lt;br /&gt;
某些功能仅支持特定的贴图集打包器：&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Default&lt;br /&gt;
! xatlas&lt;br /&gt;
|-&lt;br /&gt;
| [[使用手册#Bakery_Lightmap_Group_Selector|Override resolution]]&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
|-&lt;br /&gt;
| 高效 LOD 打包&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
|-&lt;br /&gt;
| [[使用手册#Hole_filling|Hole filling]]&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
请注意，贴图集打包器（Atlas Packer）也可以为每个 Lightmap Group 单独选择。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Export geometry and maps ===&lt;br /&gt;
如果启用，Bakery 会在渲染前将场景导出为其专用格式。如果你确定场景的几何体和贴图以及光照贴图分辨率设置没有改变（例如，你只是调整 GI 或光源设置），可以禁用此选项以加快下一次渲染速度。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update unmodified lights ===&lt;br /&gt;
如果启用，Bakery 会重新计算自上次渲染以来未改变的光源。如果你只是调整某个光源，不想等待其他光源重新渲染，可以禁用此选项。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update modified lights and GI ===&lt;br /&gt;
如果启用，Bakery 会重新计算自上次渲染以来发生变化的 GI 和光源。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== UV padding: increase only ===&lt;br /&gt;
仅在启用 [[#Asset_UV_Processing|Adjust UV padding]] 时可见。默认情况下，模型资源的最佳 UV 间距仅基于当前加载的场景进行计算。如果同一模型有多个实例使用不同的光照贴图分辨率，最小的分辨率将决定间距，以确保 UV 图块之间的间距足够大，防止相互重叠。然而，在两个不同的独立场景中烘焙同一模型时，为新场景优化可能会破坏之前场景中的 UV。勾选此选项可以防止这种情况发生，即永远不减小间距值，从而始终为曾经烘焙过的最低分辨率实例进行优化。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoise: fix bright edges ===&lt;br /&gt;
[[File:Image19.png|thumb|左：去噪后可见明亮边缘；右：已修复。]]&lt;br /&gt;
仅在 [[#Denoise|Denoise]] 启用时可见。有时用于去噪的神经网络可能会在阴影周围产生明亮边缘，就像应用了锐化效果一样。如果启用此选项，Bakery 会尝试将其滤除。启用后，去噪阶段可能会略微变慢。&lt;br /&gt;
&lt;br /&gt;
此功能也可用于滤除“火花”（fireflies），即光照贴图中偶尔出现的亮点。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Post-packing ===&lt;br /&gt;
有时在渲染场景时，Bakery 会将光照贴图拆分为多个子光照贴图，例如在烘焙不同 LOD 或地形时。&lt;br /&gt;
Post-packing 会尝试通过将这些子光照贴图合并到同一纹理中来最小化最终贴图集数量。&lt;br /&gt;
建议保持此选项启用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Combine with Enlighten real-time GI ===&lt;br /&gt;
如果启用，则在按下 Render 按钮时，Bakery 会首先尝试使用 Enlighten 烘焙以计算实时 GI。之后，将进行常规的 Bakery 光照贴图烘焙过程。烘焙 GI 和实时 GI 将协同工作。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bake on remote server ===&lt;br /&gt;
启用网络烘焙（[[Network baking|Network baking]]）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Presets ===&lt;br /&gt;
当前在 Experimental 模式下的 Render/Update 按钮下显示。&lt;br /&gt;
&lt;br /&gt;
* 点击 '''New''' 将所有当前设置保存到预设文件中。&lt;br /&gt;
* 默认情况下，当一个预设处于激活状态时，所有设置都会被灰显，以防止覆盖预设。&lt;br /&gt;
* 点击 '''Modify preset''' 可更改设置并覆盖预设。&lt;br /&gt;
* 可以通过预设字段切换预设。将其设置为 None 可禁用预设使用。&lt;br /&gt;
&lt;br /&gt;
== 组件 ==&lt;br /&gt;
=== Bakery Lightmap Group Selector ===&lt;br /&gt;
指定对象及其所有子对象使用的 '''Lightmap Group'''。&lt;br /&gt;
Lightmap Group 是 Bakery 用来表示共享同一光照贴图的对象集合的术语。每个组都有属性，告诉 Bakery 如何打包对象、哪些光源影响它们，以及结果是烘焙到纹理还是顶点。&lt;br /&gt;
&lt;br /&gt;
默认情况下，所有静态对象会自动打包到多个光照贴图组（贴图集）中，因此通常无需手动管理。手动定义组仅用于特殊用途，例如：&lt;br /&gt;
&lt;br /&gt;
* 指定某些对象使用 [[Vertex Lightmaps|每顶点光照贴图]] 而非纹理。&lt;br /&gt;
* 使用建模软件中的原始未缩放 UV 烘焙光照贴图。&lt;br /&gt;
* 将关卡的特定区域分组以使用单张光照贴图，从而便于资源流式加载或通过脚本在运行时切换不同的烘焙光照。&lt;br /&gt;
* 使用 Render Selected Groups 按钮仅更新已分组的对象。&lt;br /&gt;
&lt;br /&gt;
要手动定义组，可以创建 '''Lightmap Group Assets'''，方法包括使用 Assets-&amp;gt;Create 菜单，或在组件中使用 Create New 按钮。使用 Create New 按钮时，将根据以下表单创建新的资源：&lt;br /&gt;
&lt;br /&gt;
* Name：要创建的 Lightmap Group 资源的名称。&lt;br /&gt;
* Packing Mode：此选择器定义 Lightmap Group 的打包模式，共有 3 种模式：&lt;br /&gt;
** Original UV：对象及其子对象将使用未修改的 UV 进行烘焙，不执行打包。适用于多个网格共享同一已打包 UV 布局的模型。&lt;br /&gt;
** Pack Atlas：对象及其子对象将打包到专用纹理贴图集中。在 v1.3 之前，每个可打包的子对象都需要有此组件，但现在不再需要。每个子对象将作为单独矩形打包，除非 Bakery 自动检测到子对象有非重叠的子对象，在这种情况下，多个对象可以使用同一个矩形。&lt;br /&gt;
** Vertex：对象及其子对象将使用顶点色烘焙光照而非纹理。注意，需要使用自定义着色器才能生效，例如 [[#Bakery_shaders|Bakery Shader]]。文档中也提供了一个简单的着色器（“Bakery/Simple Vertex Lightmapped”）用于演示和参考。[[Vertex Lightmaps|了解更多关于顶点光照贴图的信息]]。&lt;br /&gt;
* Directional mode：允许你覆盖该组的 [[#Directional mode|directional mode]]。选项与全局相同，Auto 将使用全局设置。&lt;br /&gt;
* Resolution：所需的光照贴图分辨率。&lt;br /&gt;
* Auto-resolution：使用 [[使用手册#Texels_per_unit|Texels Per Unit]] 来确定最接近的二次幂分辨率。&lt;br /&gt;
* Atlas packer：为该组选择 [[使用手册#Atlas_Packer|贴图集打包]] 算法。&lt;br /&gt;
* Bitmask：用于排除光源影响光照贴图的开关列表。每个 Bakery 光源也有一个位掩码设置。光源只会影响与其共享至少一个开关的 Lightmap Group。默认设置意味着所有光源影响所有光照贴图。&lt;br /&gt;
&lt;br /&gt;
[[File:Ts.jpg|thumb|Transparent selfshadow关闭 vs 开启：注意一些单面但背向的多边形如何被正确照亮。]]&lt;br /&gt;
&lt;br /&gt;
如果你有一个被分配了“Pack Atlas”模式的 Lightmap Group，组件上将会出现额外设置：&lt;br /&gt;
&lt;br /&gt;
* Override resolution：覆盖该对象及其子对象在光照贴图中占用的分辨率。&lt;br /&gt;
* Resolution：手动定义的分辨率。例如，如果你有一个分辨率为 512 的光照贴图，并且分配给 4 个对象，同时覆盖分辨率设置为 256，Bakery 将生成一个 512x512 的光照贴图，每个对象正好占据 256x256 的区域。&lt;br /&gt;
&lt;br /&gt;
如果你选择一个 Lightmap Group 资产，将会显示额外的实验性设置：&lt;br /&gt;
* [[Subsurface scattering|Subsurface scattering: (点击阅读更多)]]&lt;br /&gt;
* Normal offset：允许你将光线从表面偏移。这很少有用，主要用于实验目的。&lt;br /&gt;
* Transparent selfshadow：从表面后方发射光线，使其不会在自身投射阴影。对于半透明叶片可能有用。&lt;br /&gt;
* Vertex sampling density，(仅当 Packing Mode 设置为 Vertex 时可用）：默认情况下，每个顶点只计算一个值；如果采样密度 &amp;gt; 0，则会在三角形上分散采样并求平均，从而生成超采样、更平滑的结果。&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Lightmapped Prefab ===&lt;br /&gt;
此组件允许预制件存储光照贴图元数据。这样处理后的预制件可以在任意场景中实例化，无论是在编辑器中还是运行时。&lt;br /&gt;
该组件应直接添加到预制件的根对象上。不支持嵌套预制件。由于预制件在烘焙后会被覆盖（类似于按下“Apply”按钮的效果），因此要求预制件没有任何未应用的更改（子对象不应移动，材质和脚本参数应保持不变等）。如果检测到此类更改，组件界面会显示错误，烘焙后不会保存任何元数据。如果启用了 [[#Warnings|Lightmapped prefab validation]] 警告，所有预制件错误也会在烘焙前以对话框形式显示。&lt;br /&gt;
&lt;br /&gt;
光照贴图预制件支持所有 Bakery 功能，例如 LOD、地形、方向光贴图、RNM、SH、顶点模式和 Shadowmask。要使 Shadowmask 生效，光源也必须是同一预制件的一部分。&lt;br /&gt;
&lt;br /&gt;
{{note| 注意，由于 API 限制，预制件 Shadowmask 仅在 Unity 2017.4 或更高版本中可用。}}&lt;br /&gt;
&lt;br /&gt;
烘焙后，一个名为 “BakeryPrefabLightmapData” 的对象会被添加到预制件中。该对象包含一个脚本，存储应用光照贴图所需的所有数据。&lt;br /&gt;
&lt;br /&gt;
此外，光照贴图预制件允许保存当前渲染设置，并使用两个按钮将其加载回任意已打开的场景：&lt;br /&gt;
&lt;br /&gt;
* Save current render settings to prefab：在该预制件上存储当前渲染设置的副本。&lt;br /&gt;
* Load render settings from prefab：将当前渲染设置设置为预制件中存储的设置。&lt;br /&gt;
  [[File:Upload 2019-9-17 10-32-34.png|thumb|应用预制件]]&lt;br /&gt;
&lt;br /&gt;
烘焙光照贴图预制件时，建议检查：&lt;br /&gt;
&lt;br /&gt;
* 预制件已“应用”。在旧版 Unity 中，点击 Inspector 右上角的 “Apply” 按钮。在新版 Unity 中，点击 “Overrides” 列表，然后选择 “Apply All”。&lt;br /&gt;
* 预制件组件 UI 不显示任何错误。&lt;br /&gt;
* [推荐] 在主窗口启用 “Lightmapped prefab validation” 复选框。点击 Render 时不会显示任何关于预制件的警告对话框。&lt;br /&gt;
&lt;br /&gt;
{{note| 光照贴图以其烘焙所在的场景或所使用的 Lightmap Group 命名（如果有）。在同一场景中烘焙不同预制件时，请确保使用不同命名的 [[使用手册#Bakery_Lightmap_Group_Selector|Lightmap Group]] 或更改 [[使用手册#Output_path|输出路径]]。}}&lt;br /&gt;
&lt;br /&gt;
{{note| 当使用相同模型逐个烘焙多个预制件时，建议将 [[使用手册#Asset_UV_Processing|Asset UV Processing]] 设置为“Don't Change”，以防止修改共享模型的 UV。}}&lt;br /&gt;
&lt;br /&gt;
{{note| Bakery 的预制件工作流程是在 Unity 提供“预制件双击进入视图”功能之前实现的。因此，在隔离预制件视图中光照贴图可能无法正确应用，组件可能显示 “This GameObject is not a prefab” 信息。但在普通场景中使用时应能正常工作。}}&lt;br /&gt;
&lt;br /&gt;
{{note| 当解包已烘焙的预制件并取消与现有光照贴图的关联时，请确保删除保存预制件范围光照贴图/渲染器连接的 BakeryPrefabLightmapData 对象。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Direct Light ===&lt;br /&gt;
[[File:Directlight.jpg|thumb|纯直射光 + GI]]&lt;br /&gt;
[[File:Image4.png|thumb|左：“Shadow Spread” = 0.01，右：0.05。注意阴影从锐利逐渐变模糊的效果。]]&lt;br /&gt;
无限远方向光（例如太阳）。&lt;br /&gt;
&lt;br /&gt;
* Color：光的颜色。&lt;br /&gt;
* Intensity：线性色彩乘数。&lt;br /&gt;
* Shadow Spread：光源尺寸，或者简单说，阴影的模糊度。0 = 阴影最锐利，1 = 阴影最模糊。从技术上讲，它在单条光线与更宽光锥之间插值。&lt;br /&gt;
* Shadow Samples：影响阴影质量。Shadow Spread 值越小，所需样本越少即可得到干净图像。太阳阴影的典型值为 1 到 16。设置为 0 时，该光源的阴影将消失。&lt;br /&gt;
* Bitmask：用于排除此光源对特定 Lightmap Groups 影响的开关列表。&lt;br /&gt;
* Baked contribution：确定应烘焙哪类光照数据。仅在 Indirect 或 Shadowmask 模式可见。可选值：&lt;br /&gt;
** Direct and Indirect：直射光与间接光都完全烘焙。&lt;br /&gt;
** Indirect only：实时光提供直射贡献，仅烘焙间接光。&lt;br /&gt;
** Shadowmask and indirect：实时光提供直射贡献，静态几何体的阴影烘焙到单独贴图，动态与静态阴影混合。间接光正常烘焙。&lt;br /&gt;
** Direct, Indirect, Shadowmask（仅自定义光照）：与直射和间接相同，但 Shadowmask 也生成，可与自定义着色器一起使用。&lt;br /&gt;
* Denoise shadowmask：确定是否对该光源的 Shadowmask 应用去噪。通常不需要，因为阴影噪点不明显，但对非常宽且模糊的阴影（大 Shadow Spread）可能有用。&lt;br /&gt;
* Indirect intensity：非物理 GI 乘数。自然光照应为 1，可根据场景风格调整。&lt;br /&gt;
* Anti-alias：对阴影执行超采样。&lt;br /&gt;
* Texture projection：在光照上投射乘法平铺纹理，可用于模拟远处云影。&lt;br /&gt;
当设置了纹理投影时，可以使用“Tiling”和“Offset”字段调整其缩放和偏移。或者，点击 &amp;quot;Tweak projection in Scene View&amp;quot; 并使用额外的 Gizmo 可视化移动和缩放投影。点击“Render reference frame”可保存光源视角的 PNG，这对于在场景上绘制云影很有用。&lt;br /&gt;
&lt;br /&gt;
如果同一对象同时启用了 Unity 和 Bakery 光源且参数不匹配，会出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match lightmapped to real-time：将 Unity 光源的通用设置复制到 Bakery 光源。&lt;br /&gt;
* Match real-time to lightmapped：将 Bakery 光源的通用设置复制到 Unity 光源。&lt;br /&gt;
&lt;br /&gt;
{{note| 从物理角度看，Bakery 的方向光强度（Intensity）等于照度（Lux）除以 π。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Sky Light ===&lt;br /&gt;
[[File:Skylight.jpg|thumb|纯天空光与 GI]]&lt;br /&gt;
无限远的带阴影环境光（天空）。&lt;br /&gt;
&lt;br /&gt;
* Color: 颜色。&lt;br /&gt;
* Intensity: 线性色彩倍增。&lt;br /&gt;
* Sky texture: 可选的立方体贴图资源，例如 HDRI 全景图，用于从不同方向影响光照颜色。&lt;br /&gt;
  {{note| 旋转天空光的 GameObject 会相应旋转立方体贴图的光照。}}&lt;br /&gt;
* Samples: 影响阴影质量。典型值为 8 到 32。&lt;br /&gt;
* Hemispherical: 如果启用，光照仅来自上方（上半球）。否则来自所有方向。&lt;br /&gt;
* Bitmask: 用于排除此光源影响特定 Lightmap Groups 的开关列表。&lt;br /&gt;
* Baked contribution: 决定应烘焙哪种光照数据。仅在 Indirect/Shadowmask 模式下可见。可能值：&lt;br /&gt;
** Direct and Indirect: 直接和间接光照都将完全烘焙。这是默认且推荐的天空光行为，因为在 Unity 中没有实时版本可以模拟它们。&lt;br /&gt;
** Indirect only: 假定实时光源提供直接贡献；仅烘焙间接光照。&lt;br /&gt;
&lt;br /&gt;
如果天空光的设置与当前场景的天空盒不匹配，将出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match this light to scene skybox: 将活动天空盒材质的通用设置复制到 Bakery 天空光。当前仅支持使用 “Skybox/Cubemap” 或 “Skybox/Bakery skybox” 着色器的天空盒。&lt;br /&gt;
* Match scene skybox to this light: 将 Bakery 天空光的通用设置复制到场景天空盒。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bakery Light Mesh ===&lt;br /&gt;
[[File:Image29.png|thumb|Left: Samples Near = 0, Samples Far = 4096.&amp;lt;br&amp;gt;&lt;br /&gt;
Middle: Samples Near = 0, Samples Far = 128.&amp;lt;br&amp;gt;&lt;br /&gt;
Right: Samples Near = 16, Samples Far = 128.&amp;lt;br&amp;gt;&lt;br /&gt;
请注意，光照效果看起来相似，但使用的合并采样数量更少。]]&lt;br /&gt;
任何形状的自发光网格。应与 Mesh Renderer 组件或设置为 Area 模式的 Light 组件一起使用。&lt;br /&gt;
&lt;br /&gt;
* Color：颜色&lt;br /&gt;
* Intensity：线性颜色倍增器&lt;br /&gt;
* Cutoff：最大光照距离。Bakery 会在接近该限制时额外衰减正确的平方反比衰减。当 Cutoff 值刚好对应物理衰减变得非常暗的位置时效果最佳。Cutoff 可提升烘焙性能，也可以设置为非常高（不可达）的值以保证完全正确性。&lt;br /&gt;
* Self Shadow：决定光源网格自身是否投射阴影。此选项同时启用更精确的光照算法。&lt;br /&gt;
* Samples Near：影响靠近网格的光照质量。典型值为 16 到 64，仅当 Self Shadow 开启时可用。&lt;br /&gt;
* Samples Far：影响远离网格的光照质量。典型值为 4 到 4096。&lt;br /&gt;
&lt;br /&gt;
Bakery 基于光源表面距离混合两种不同的区域光算法。靠近光源时，算法类似 GI，而远处光源被近似为虚拟点光云。&lt;br /&gt;
&lt;br /&gt;
{{note| &amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;光源网格自身不会接收光照，也不会被烘焙到光照贴图中。&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;一个拥有大量多边形的光源网格比烘焙多个简单的光源网格要快&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;如果结果总是脏/噪点较多，可以尝试将 Samples Near 设置为 0，这样只使用 VPL 算法。对于不需要精度的简单光源（如建筑物的窗户光），这也非常有用。&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;}}  &lt;br /&gt;
[[File:Dd99d-QU0AEKFBK.jpg|thumb|弯曲的光源网格]]  &lt;br /&gt;
* Bitmask：用于排除此光源影响特定 Lightmap Groups 的开关列表。  &lt;br /&gt;
* Baked contribution：决定烘焙哪种类型的光照数据。仅在 Indirect 或 Shadowmask 模式下可见。可能的值：  &lt;br /&gt;
** Direct and Indirect：完全烘焙直接和间接光贡献。这是默认且推荐的光源网格行为，因为 Unity 中没有实时版本可以模拟它们。  &lt;br /&gt;
** Indirect only：实时光源提供直接光贡献，仅烘焙间接光。  &lt;br /&gt;
** Shadowmask and Indirect：实时光源提供直接光贡献，但静态几何体的阴影会烘焙到单独的贴图。动态和静态阴影将混合在一起。间接光照将照常烘焙。目前仅 HDRP（和自定义渲染器）支持混合区域光。  &lt;br /&gt;
** Direct, Indirect, Shadowmask (custom lighting only)：与 Direct and Indirect 相同，但同时生成 Shadowmask 并分配用于自定义着色器。  &lt;br /&gt;
* Indirect intensity：非物理 GI 倍增器。自然光照应设为 1，但可修改以实现更风格化的场景。  &lt;br /&gt;
* Shadowmask with falloff：将完整光衰减烘焙进 Shadowmask（仅对自定义着色器有用）。  &lt;br /&gt;
&lt;br /&gt;
如果网格材质和光源设置不匹配，将出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match light to material：将网格材质或区域光的通用设置复制到 Bakery 光源。&lt;br /&gt;
* Match material to light：将 Bakery 光源的通用设置复制到网格材质或区域光。&lt;br /&gt;
&lt;br /&gt;
==== Light Mesh 与自发光材质的区别 ====&lt;br /&gt;
自发光材质：&lt;br /&gt;
&lt;br /&gt;
* 在 GI 计算中传播光线，因此是“免费的”，无论有多少网格是自发光的。&lt;br /&gt;
* 小而明亮的光可能会产生不准确或有噪点的结果，这取决于 GI 的采样数量。&lt;br /&gt;
* 由于 Bakery 中 GI 的工作方式，它必须占用光照贴图空间，因此可能会浪费空间。同时，这意味着自发光对象需要有效的 UV，并且必须启用“投射阴影”。&lt;br /&gt;
&lt;br /&gt;
Light Mesh：&lt;br /&gt;
&lt;br /&gt;
* 光照会为每个光源单独计算，因此比自发光材质慢。&lt;br /&gt;
* 设计用于为小而明亮的光提供干净的光照效果，即使距离很远也能保持效果。&lt;br /&gt;
* 不占用光照贴图空间。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Point Light ===&lt;br /&gt;
[[File:Image11.png|thumb|左：“Shadow Spread” = 0.5，右：“Shadow Spread” = 1。]]&lt;br /&gt;
点光源，没有面积。尽管在物理上不可能，但在游戏中很有用，并且是匹配 Unity 点光源和聚光灯的唯一方式。&lt;br /&gt;
{{note| 聚光灯只是带有额外投影遮罩的点光源。}}&lt;br /&gt;
&lt;br /&gt;
* Color: 颜色&lt;br /&gt;
* Intensity: 线性色彩倍增&lt;br /&gt;
* Shadow spread: 阴影模糊度。虽然点光源没有面积，但通常希望它仍能产生模糊阴影。为此，阴影被模拟为从球形区域光源投射。此参数定义了虚拟球体的半径，直接影响阴影模糊度。&lt;br /&gt;
* Physical falloff: 如果启用，将使用正确的平方反比衰减，并在边界附近额外衰减。否则将尝试模拟 Unity 的衰减。&lt;br /&gt;
* Falloff min size: 详见 [[Point Light Attenuation]] 部分。&lt;br /&gt;
* Range: 如果物理衰减被禁用，则等于 Unity 的光源范围；如果启用，只会在边缘轻微衰减物理衰减。&lt;br /&gt;
* Samples: 影响阴影质量。典型值为 1 到 512。设置为 0 将使该光源的阴影消失。&lt;br /&gt;
  [[File:Image10.png|thumb|从左到右：Omni，Cookie（默认聚光灯纹理），Cubemap，IES。]]&lt;br /&gt;
* Projection mask: 遮罩/Cookie 类型。选项：&lt;br /&gt;
** Omni: 无遮罩，相当于 Unity 的点光源。&lt;br /&gt;
** Cookie: 纹理投影遮罩。附加选项：&lt;br /&gt;
*** Cookie texture: 2D 纹理资源。Bakery 包含原始 Unity 聚光灯纹理（名为 ftUnitySpotTexture），可用于模拟。&lt;br /&gt;
*** Angle: 纹理投影角度（类似 Unity 聚光灯）。&lt;br /&gt;
*** Correct distortion: 修正宽角下直线可见的 cookie 失真。&lt;br /&gt;
** Cubemap: 立方体贴图投影遮罩。附加选项：&lt;br /&gt;
*** Projected cubemap: 立方体贴图资源。&lt;br /&gt;
** IES: 光照由 IES 文件数据调制。附加选项：&lt;br /&gt;
*** IES file: .ies 扩展名文件。&lt;br /&gt;
* Bitmask: 用于排除该光源影响特定 Lightmap Groups 的开关列表。&lt;br /&gt;
* Baked contribution: 决定应烘焙哪种类型的光照数据。仅在 Indirect 或 Shadowmask 模式下可见。可能值：&lt;br /&gt;
** Direct and Indirect: 直接光和间接光完全烘焙。&lt;br /&gt;
** Indirect only: 实时光提供直接光，仅烘焙间接光。&lt;br /&gt;
** Shadowmask and Indirect: 实时光提供直接光，但静态几何体阴影烘焙到单独贴图中，动态和静态阴影混合，间接光正常烘焙。&lt;br /&gt;
** Direct, Indirect, Shadowmask (custom lighting only): 与 Direct and Indirect 相同，同时生成 Shadowmask 用于自定义着色器。&lt;br /&gt;
* Indirect intensity: 该光的非物理 GI 倍增。自然光应为 1，可根据风格化场景修改。&lt;br /&gt;
* Shadowmask with falloff: 将完整光衰减（除距离外）烘焙到 Shadowmask（仅自定义着色器有用）。&lt;br /&gt;
* Legacy sampling: 使用 Bakery 原始更偏置的阴影采样策略。产生无噪点阴影，但宽半影可能出现条纹。禁用后使用无偏但更有噪点的技术。&lt;br /&gt;
&lt;br /&gt;
如果同一对象同时启用了 Unity 和 Bakery 光源，且设置不匹配，则会出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match lightmapped to real-time: 将 Unity 光的常用设置复制到 Bakery 光。&lt;br /&gt;
* Match real-time to lightmapped: 将 Bakery 光的常用设置复制到 Unity 光。&lt;br /&gt;
&lt;br /&gt;
{{note| 从物理角度来看，Bakery 点光源的“Intensity”为 Candela 除以 Pi。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Volume ===&lt;br /&gt;
[[File:Voldemo notlonely.gif|由 BakeryVolume 照亮的动态门（动态 GIF，由 NOTLonely 制作）]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
体积（Volumes）生成存储每个体素光探针的 3D 纹理（L1 球面调和和阴影贴图），使其成为常规 Unity 光探针的可行替代方案。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Unity Light Probes&lt;br /&gt;
! Unity LPPV&lt;br /&gt;
! Bakery Volumes&lt;br /&gt;
|-&lt;br /&gt;
| 手动放置每个光探针&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 否&lt;br /&gt;
|-&lt;br /&gt;
| 在一个物体上插值多个光探针&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 运行时可移动&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 可以放入预制件&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 完整脚本 API&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| “Ringing” 伪影&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 可能出现&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 可能出现&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 已修正&lt;br /&gt;
|-&lt;br /&gt;
| 去噪&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 运行时开销&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | CPU：低开销；GPU：低开销&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | CPU：中等开销；GPU：中等开销&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#e4ead3;&amp;quot; | CPU：无开销；GPU：中等开销&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bakery Volume 是一个与一组 3D 纹理（3 个 SH 纹理和一个可选的 shadowmask）关联的边界盒，使其非常易于使用和编程。Volumes 可以在运行时轻松地交换、移动、加载或卸载，也可以与预制件关联。它们不需要任何 Light Probe Groups 或手动探针布置；整个 Volume 都由均匀的探针体素网格填充。光/影泄漏会自动像处理光照贴图一样修复（尽管对于较大的体素尺寸，薄的双面墙可能会出现问题，但可以通过在不同侧使用不同 Volume 避免）。由于体素网格的均匀特性，也可以对其应用类似光照贴图的降噪，这是常规光探针无法做到的。此外，Bakery 着色器使用 [https://drive.google.com/file/d/1MK6Clw93q8ljijRjb4gQOzzaIjn1uF9Y/view Geomerics] 采样技巧，完全消除了高对比度 HDR 光照下 SH 有时会产生的 “ringing” 伪影。&lt;br /&gt;
&lt;br /&gt;
因此，Volumes 可以为动态物体生成干净、精细、高质量的烘焙光照（即来自静态物体并影响动态物体的光照，而不是相反）。&lt;br /&gt;
&lt;br /&gt;
Volume 方法的唯一缺点是每像素着色开销较高。其开销类似于 LPPV（随着屏幕上受体素影响的像素数量而缩放），但与 LPPV 不同的是，一旦烘焙完成，Volumes 本身不会再更新。多个 Volume 的混合可以通过稍微重叠它们来避免。&lt;br /&gt;
&lt;br /&gt;
====设置 Volume 变换====&lt;br /&gt;
[[File:Bvolgizmo.jpg|thumb|Volume 控制柄]]&lt;br /&gt;
当 BakeryVolume 被添加到一个 GameObject 时，场景视图中会出现一个边界盒控制柄。拖动小方块即可缩放它。&lt;br /&gt;
&lt;br /&gt;
还有其他方法可以更改 Volume 的大小和位置：&lt;br /&gt;
&lt;br /&gt;
* 将任何可渲染的 GameObject 拖入 “Wrap to object” 字段。Volume 会包裹该对象（及其子对象），以将它们完全包含在内。&lt;br /&gt;
* 如果同一个对象上添加了 Box Collider，则会出现 “Set from box collider” 和 “Set to box collider” 按钮。可以用它们快速在 Volume 和 Collider 之间复制数值。&lt;br /&gt;
&lt;br /&gt;
====分辨率====&lt;br /&gt;
当启用 “Adaptive resolution” 时，体素数量由 “Voxels per unit” 控制。禁用它可以手动输入分辨率。对于大多数 1 单位 = 1 米 的游戏来说，一个合理的 “Voxels per unit” 值是 2，但在某些情况下（例如动态门）使用较小但更高分辨率的 Volume 会更有利。&lt;br /&gt;
&lt;br /&gt;
====其他设置====&lt;br /&gt;
&lt;br /&gt;
* Enable baking: 是否需要（重新）计算 Volume？禁用可防止覆盖已有数据。&lt;br /&gt;
* Denoise: 在烘焙 Volume 后应用去噪。推荐用于高分辨率 Volume。避免用于覆盖许多光源的低分辨率 Volume，因为去噪器难以区分实际内容和噪声。&lt;br /&gt;
* Global: 自动将此 Volume 分配给所有兼容 Volume 的 Shader，除非它们有覆盖设置。内部会调用 Shader.SetGlobalTexture()/SetGlobalVector()。&lt;br /&gt;
====使用方法====&lt;br /&gt;
Volumes 可以分配给使用 Volume 感知 Shader 的对象。Bakery 自带实现该功能的 “Bakery Standard” Shader，以及 HDRP 和 URP 的 Shader 图。请查看 example_volumes 场景，了解应用 Volume 的各种方式。&lt;br /&gt;
&lt;br /&gt;
====提示====&lt;br /&gt;
&lt;br /&gt;
* 确保查看示例。&lt;br /&gt;
* 如果两个 Volume 相连，让它们略微重叠。重叠大小应等于最大动态对象的尺寸。这样在运行时简单切换 Volume 就能正常工作。&lt;br /&gt;
* 仅在动态对象实际可达的区域放置 Volume。例如，使用玩家高度限制 Volume 的高度。&lt;br /&gt;
&lt;br /&gt;
====旋转 Volumes====&lt;br /&gt;
如果启用 “Rotate around Y” 选项，Volumes 可以绕 Y 轴旋转。旋转开销非常低，只使用 2 个额外的浮点数据（预计算的角度 sin/cos）。&lt;br /&gt;
&lt;br /&gt;
还可以在运行时旋转 Volumes（Experimental -&amp;gt; “Support rotation after bake” 以及 Bakery Shader 中的类似选项），这种情况下 Volume 必须在初始旋转为零时进行烘焙。&lt;br /&gt;
&lt;br /&gt;
在 URP 中，这种动态旋转可以与 `BakeryURPVolumeGraphRotatable.shadergraph` 一起使用。&lt;br /&gt;
&lt;br /&gt;
对于全局 Volume，动态旋转会在组件被（重新）启用或调用 `volume.SetGlobalParams()` 时更新。使用局部旋转 Volume 时，需要手动在材质或 MaterialPropertyBlock 上设置旋转：&lt;br /&gt;
{{code|&amp;lt;nowiki&amp;gt;SetMatrix(&amp;quot;_VolumeMatrix&amp;quot;, volume.GetMatrix())&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
====技术信息====&lt;br /&gt;
Volumes 可以自动工作（查看示例场景），也可以通过脚本控制其使用方式。&lt;br /&gt;
&lt;br /&gt;
可以通过组件的以下公共属性获取 Volume 数据：&lt;br /&gt;
&lt;br /&gt;
* `bakedTexture0`：存储 L0 RGB 系数和 L1 Z 红色通道在 alpha 中。&lt;br /&gt;
* `bakedTexture1`：存储 L1 X RGB 系数和 L1 Z 绿色通道在 alpha 中。&lt;br /&gt;
* `bakedTexture2`：存储 L1 Y RGB 系数和 L1 Z 蓝色通道在 alpha 中。&lt;br /&gt;
* `bakedMask`：存储体积阴影遮罩。&lt;br /&gt;
* `bounds`：Volume 的包围盒。&lt;br /&gt;
&lt;br /&gt;
所有 `bakedTexture*` 使用 RGBAHalf（每体素 8 字节）格式，mask 使用 ARGB32（每体素 4 字节）。阴影遮罩也可以使用单通道 R8 格式（每体素 1 字节）。&lt;br /&gt;
&lt;br /&gt;
因此 Volume 的字节大小 = width * height * depth * 3 * 8 + （仅当使用阴影遮罩时）width * height * depth * 4（或使用 R8 mask 时为 width * height * depth）。&lt;br /&gt;
&lt;br /&gt;
[[使用手册#Compress_volumes|可以对 Volume 启用纹理压缩]]，使其体积显著减小。&lt;br /&gt;
&lt;br /&gt;
采样 Volume 需要特殊 Shader，这些 Shader 已包含在 Bakery 中。要在自定义 Shader 中添加 Volumes，请查看 HDRP/URP 包中包含的 `BakeryVolume_float()` 函数（位于 `BakeryDecodeLightmap.hlsl`）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Light Filter ===&lt;br /&gt;
[[File:Output optimized.gif|彩色玻璃，如在 &amp;quot;Bakery Real-Time Preview&amp;quot; 中所见。Bakery lightmapper 烘焙出的结果相同。]]&lt;br /&gt;
&lt;br /&gt;
将渲染器标记为光过滤器（Light Filter）。过滤器会用其颜色着色所有直接和间接光线，类似于现实中的光学滤镜，从而实现彩色透明效果（例如彩色玻璃）。唯一的参数是用于着色的纹理。&lt;br /&gt;
&lt;br /&gt;
* 光过滤器对象仍然会像其他对象一样接收光照贴图。&lt;br /&gt;
* 过滤器不会散射或模糊光线（如需此效果，请尝试 [[Subsurface_scattering|Subsurface Scattering]] 或 [[使用手册#Backface_GI|Backface GI]]）。&lt;br /&gt;
* 过滤器可以产生带颜色的阴影。如果灯光使用 [[使用手册#Shadowmask|Shadowmask]] 模式，则结果只会保存 R 通道（因为 Unity 仅支持单通道遮罩）。对于完全烘焙的阴影，则没有限制。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Sector ===&lt;br /&gt;
参见 '''[[Partial_scene_baking|Partial scene baking]]'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Always Render ===&lt;br /&gt;
如果添加到一个物体上，Bakery 在烘焙时将始终考虑该物体，即使它的 Renderer 被禁用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
=== Bakery Pack As Single Square ===&lt;br /&gt;
如果添加到一个物体上，Bakery 会将该物体及其子物体的 UV 视为单个组合方块，在自动图集打包或 Lightmap Group 的 Pack Atlas 模式下，它们之间永远不会被移动。整个子层级将作为一个整体打包。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
=== Bakery Shared LOD UV ===&lt;br /&gt;
如果添加到一个 LODGroup 上，将标记所有同名 LOD 共享同一个光照贴图。默认情况下，每个 LOD 网格会获得独立的光照贴图，占用图集空间；但如果已知同一个物体的 LOD 拥有相似的 UV2（或者在没有 UV2 且 UV1 不重叠的情况下），它们可以映射到图集的同一部分，从而节省内存。&lt;br /&gt;
这种技术也称为 [https://github.com/laurenth-personal/LODLightmapScripts/ Lightmap Stealing]。&lt;br /&gt;
&lt;br /&gt;
= 材质兼容性 =&lt;br /&gt;
&lt;br /&gt;
=== 漫反射和发光 ===&lt;br /&gt;
Bakery 利用 [https://docs.unity3d.com/Manual/MetaPass.html Meta Pass] 系统支持大多数 Unity 材质。所有内置、Surface、URP 和 HDRP 着色器都已经定义了正确的 Meta Pass。&lt;br /&gt;
&lt;br /&gt;
如果你使用的是 Unlit 着色器，需要按照 Unity 文档手动添加 Meta Pass。&lt;br /&gt;
&lt;br /&gt;
如果未定义该 Pass，Bakery 将假定 {{codeVar|_MainTex}}、{{codeVar|_BaseColorMap}} 或 {{codeVar|_Color}}（如果未设置纹理）为材质的漫反射（Albedo），并将 {{codeVar|_EmissionMap}} 和 {{codeVar|_EmissionColor}} 作为发光颜色。&lt;br /&gt;
&lt;br /&gt;
为了使发光生效，[https://docs.unity3d.com/ScriptReference/Material-globalIlluminationFlags.html Material.globalIlluminationFlags] 必须设置为 [https://docs.unity3d.com/ScriptReference/MaterialGlobalIlluminationFlags.BakedEmissive.html MaterialGlobalIlluminationFlags.BakedEmissive]。标准着色器会自动设置此值。&lt;br /&gt;
&lt;br /&gt;
=== 不透明度 ===&lt;br /&gt;
[[File:Upload 2019-1-25 0-4-30.png|thumb|材质参数被转换为 Cutout（默认）]]&lt;br /&gt;
[[File:Alphacombos dither.jpg|thumb|通过“Dither Transparency”选项添加半透明值]]&lt;br /&gt;
[[File:Alphacombos filter.jpg|thumb|Light Filter 组件用于红色平面，生成彩色阴影]]&lt;br /&gt;
&lt;br /&gt;
默认情况下，Bakery 始终从 {{codeVar|_MainTex}}、{{codeVar|_BaseColorMap}} 或 {{codeVar|_BaseMap}} 的 alpha 值获取全分辨率的不透明度，并将其视为 Cutout（1 位透明）。&lt;br /&gt;
&lt;br /&gt;
当启用 '''Dither Transparency''' 选项时，半透明值会自动转换为可变蓝噪声，然后被滤波/模糊，产生部分透明效果（以前可以通过自定义手动抖动贴图实现，但从 v1.97 起自动完成）。&lt;br /&gt;
&lt;br /&gt;
为了使不透明度生效，着色器的 [https://docs.unity3d.com/Manual/SL-SubShaderTags.html RenderType 标签] 必须为以下值之一：&lt;br /&gt;
&lt;br /&gt;
* {{codeVar|Transparent}}&lt;br /&gt;
* {{codeVar|TransparentCutout}}&lt;br /&gt;
* {{codeVar|TreeLeaf}}&lt;br /&gt;
&lt;br /&gt;
如果存在名为 {{codeVar|_Cutoff}} 的属性，它将影响 Cutout（因此 Standard 着色器的 Cutoff 滑块会自动生效）。&lt;br /&gt;
&lt;br /&gt;
在没有 Dither Transparency 的情况下，如果材质 RenderType 为 {{codeVar|Transparent}} 或 {{codeVar|TreeLeaf}}，则 {{codeVar|_Color}} 的 alpha 值会额外修改 Cutoff：&lt;br /&gt;
''finalCutoff = 1 - (1 - cutoff) * alpha''&lt;br /&gt;
&lt;br /&gt;
对于彩色透明效果，请使用 [[Manual#Bakery_Light_Filter|Light Filter]] 组件。&lt;br /&gt;
&lt;br /&gt;
有关漫反射半透明效果，请参考 [[#Backface GI|Backface GI]] 和 [[subsurface scattering]]。&lt;br /&gt;
&lt;br /&gt;
==== Alpha Meta Pass ====&lt;br /&gt;
从 v1.9 起，Bakery 还支持指定基于自定义着色器的透明度，但这需要使用兼容的着色器。要使用 ''Alpha Meta Pass''，需要执行以下步骤：&lt;br /&gt;
&lt;br /&gt;
* 在着色器中添加一个名为 '''BAKERY_META_ALPHA_ENABLE''' 的属性。例如：&lt;br /&gt;
  {{code|&amp;lt;nowiki&amp;gt;[HideInInspector] BAKERY_META_ALPHA_ENABLE (&amp;quot;Enable Bakery alpha meta pass&amp;quot;, Float) = 1.0&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
* 确保 RenderType 标签设置为上文提到的某个值。&lt;br /&gt;
* 声明一个名为 '''META_BAKERY''' 的 Pass。&lt;br /&gt;
* 在该 Pass 中检查 '''unity_MetaFragmentControl.w''' 是否非零，如果是，则返回计算出的透明度值。&lt;br /&gt;
&lt;br /&gt;
示例可参考包内的 ''Baked_Alpha_meta.shader''。&lt;br /&gt;
&lt;br /&gt;
注意：当前 Alpha Meta Pass 需要将 Light Probe Mode 设置为 L1 或 L2。&lt;br /&gt;
&lt;br /&gt;
=== Normal mapping ===&lt;br /&gt;
自定义表面法线可以与 [[#Baked Normal Maps|烘焙法线贴图]] 模式一起使用。不幸的是，Unity 的 Meta Pass 默认不输出法线信息，因此默认情况下，法线取自名为 {{codeVar|_BumpMap}} 的贴图，并通过 {{codeVar|_MainTex_ST}} 进行额外变换。&lt;br /&gt;
&lt;br /&gt;
然而，可以制作完全自定义的着色器，带有高级法线映射功能（例如混合多层法线），并使其兼容烘焙。要实现这一点，需要执行以下步骤：&lt;br /&gt;
&lt;br /&gt;
1. 在着色器中定义一个 Meta Pass，具体方法请参考 [https://docs.unity3d.com/Manual/MetaPass.html#ExampleMetaPassUnity 文档]。&lt;br /&gt;
&lt;br /&gt;
2. 将该 Pass 命名为 {{codeVar|&amp;quot;META_BAKERY&amp;quot;}}，而不仅仅是 {{codeVar|&amp;quot;META&amp;quot;}}。&lt;br /&gt;
&lt;br /&gt;
3. 包含文件 {{codeVar|&amp;quot;BakeryMetaPass.cginc&amp;quot;}}。&lt;br /&gt;
&lt;br /&gt;
4. 添加 {{codeVar|#pragma vertex vert_bakerymt}}。&lt;br /&gt;
&lt;br /&gt;
5. 如果 {{codeVar|unity_MetaFragmentControl.z}} 变量不为 0，着色器应返回世界空间法线。返回的法线应使用 {{codeVar|BakeryEncodeNormal}} 函数编码。&lt;br /&gt;
&lt;br /&gt;
在 Assets/Bakery/examples/shaders 中包含了两个实现了扩展 Meta Pass 的示例着色器。&lt;br /&gt;
&lt;br /&gt;
你也可以复制并修改 BakeryMetaPass.cginc 以满足你的需求，例如从顶点着色器传递额外数据。&lt;br /&gt;
&lt;br /&gt;
=== 正/背面 ===&lt;br /&gt;
无论着色器使用何种剔除模式，Bakery 都将所有背面视为不透明，这意味着任何直接光线都不会穿过背面，就像它不会穿过正面一样。&lt;br /&gt;
然而，如果使用 [[使用手册#Backface_GI|Backface GI]]，背面可以部分发出正面接收到的光照。&lt;br /&gt;
&lt;br /&gt;
= 扩展 Lightmap Parameters 资源 =&lt;br /&gt;
[[File:Lp.jpg|thumb|扩展 Lightmap Parameters]]&lt;br /&gt;
类似于 Bakery 的 [[#Bakery_Lightmap_Group_Selector|Lightmap Group]]，Unity 也有 [https://docs.unity3d.com/Manual/class-LightmapParameters.html Lightmap Parameters]，可以作为资源创建并分配给 Mesh Renderer。它们的逻辑有相似之处也有不同之处：&lt;br /&gt;
&lt;br /&gt;
* Lightmap Group 的主要用途是将多个对象组合到同一个图集。此外，它还允许覆盖该图集的烘焙设置。&lt;br /&gt;
* Lightmap Parameters 主要用于覆盖对象的烘焙设置，但通过使用“Baked Tag”选项，它们也可以影响打包：具有不同 Baked Tag 的对象将永远不会共享同一个图集。&lt;br /&gt;
&lt;br /&gt;
由于有些用户更习惯 Lightmap Parameters 的工作流程，Bakery 现在支持并扩展了它们：&lt;br /&gt;
&lt;br /&gt;
* Bakery 会遵循 Baked Tag 设置。&lt;br /&gt;
* Lightmap Parameters UI 中将显示额外的 Bakery 特定选项。有关其含义，请参考 [[#Bakery_Lightmap_Group_Selector|Lightmap Group]] 部分。&lt;br /&gt;
&lt;br /&gt;
= 项目设置 =&lt;br /&gt;
一些全局设置可以在 Project Settings -&amp;gt; Bakery GPU Lightmapper 中调整（此选项仅在 Unity 2018.3 或更新版本可见；旧版本请编辑 BakeryProjectSettings.asset）：&lt;br /&gt;
&lt;br /&gt;
* Mipmap lightmaps：启用光照贴图的 mipmap。随着图集变小，可能会导致 UV 图块之间的泄漏；另一方面，它可以减少远处高分辨率光照贴图的锯齿。总体上，建议对非常远的物体使用单独烘焙的 LOD 以及较低分辨率的光照贴图。&lt;br /&gt;
* Color file format：常规 HDR 颜色光照贴图的文件格式。可选值：&lt;br /&gt;
**HDR：Radiance HDR 格式（默认）。可用多种图像编辑器打开。&lt;br /&gt;
**Asset：Unity 原生格式。可自定义 mipmap 数量。&lt;br /&gt;
* Mask/Direction file format：额外 LDR 地图的格式，如阴影遮罩或方向数据。可选值：&lt;br /&gt;
**TGA：8 位 Targa（默认）。&lt;br /&gt;
**PNG：8 位 PNG。通常比 TGA 占用更少磁盘空间。&lt;br /&gt;
**Asset：Unity 原生格式。可自定义 mipmap 数量。&lt;br /&gt;
* Compress lightmaps：定义光照贴图资源的压缩行为。压缩光照贴图占用更少的显存，但可能会出现一些视觉伪影（例如色带或色斑），具体取决于压缩类型（移动端压缩问题请参见[[Troubleshooting#I_have_an_Android_project.2C_and_lightmaps_don.27t_look_good|此处]]）。可选值：&lt;br /&gt;
*** Compress but allow overriding asset: 新的光照贴图将在启用压缩的情况下创建。创建后，可以在 Inspector 中更改它们的压缩设置。修改后的值将在重新烘焙后保留（默认）。&lt;br /&gt;
*** Force compress: 始终压缩所有光照贴图。&lt;br /&gt;
*** Force no compress: 始终生成未压缩的光照贴图。&lt;br /&gt;
* High quality direction: 为方向贴图启用“高”质量压缩。实际格式取决于平台。例如在 PC 上，它会从 DXT1 改为 BC7，这提供了更高的质量，但 VRAM 使用量会翻倍。&lt;br /&gt;
* Texel padding (default atlas packer): 定义在使用默认 atlas 打包器时，在光照贴图 atlas 中对象 UV 布局之间添加多少空白 texel。&lt;br /&gt;
* Texel padding (xatlas packer): 同上，但在使用 xatlas 时。&lt;br /&gt;
* Alpha Meta Pass resolution multiplier: 乘以 [[Manual#Alpha_Meta_Pass|Alpha Meta Pass]] 的分辨率，使在低分辨率光照贴图烘焙时仍能实现精确的基于 Shader 的切割效果。&lt;br /&gt;
* Volume render mode: 为所有 [[Manual#Bakery_Volume|Volumes]] 使用哪种 [[Manual#Render_mode|渲染模式]]？Auto 使用当前活动的渲染模式（默认）。&lt;br /&gt;
* Delete previous lightmaps before bake: 在烘焙新光照贴图之前，实际删除该场景中所有之前渲染的光照贴图文件。&lt;br /&gt;
* Log level: 定义烘焙过程中在控制台输出的信息量。可能的值：&lt;br /&gt;
** 0: 不输出任何内容。&lt;br /&gt;
** 1: 仅输出进度信息。&lt;br /&gt;
** 2: 仅输出警告。&lt;br /&gt;
** 3: 输出全部信息。&lt;br /&gt;
* Alternative scale in lightmap: 使渲染器属性 'Scale in Lightmap' 的行为更类似于 Unity 内置的行为。&lt;br /&gt;
* Align to texture compression blocks with xatlas: 使 xatlas 将 chart 对齐到 4x4 块边界，从而获得更适合压缩的结果。&lt;br /&gt;
* Generate smooth positions: 是否应调整采样位置以防止低多边形几何体在平滑法线下产生错误阴影？在使用法线差异极大的几何体时，可在极少数情况下禁用。技术说明见 [https://ndotl.wordpress.com/2018/08/29/baking-artifact-free-lightmaps/#shadowterm 这篇文章]。&lt;br /&gt;
* Smooth positions per-triangle: 是否应按三角形决定平滑/平面位置？在使用法线差异极大的几何体时，可在极少数情况下禁用。&lt;br /&gt;
* Use 'Receive GI' values: 在渲染器上考虑 “Receive Global Illumination” 值。最初 Bakery 会忽略它。&lt;br /&gt;
* Remove ringing in Legacy light probes: 在 Legacy 模式下启用更柔和的光探针卷积，以防止高对比度区域出现伪影。&lt;br /&gt;
* Always render reflection probes: 在每次 Render/Render Light Probes 后自动渲染反射探针。&lt;br /&gt;
* Ringing removal for L2 light probes: 对 [[Manual#Light_probe_mode|L2 光探针]] 应用去振铃处理。值越高，探针光照越平滑；这种平滑可以减少 [[https://docs.unity3d.com/6000.2/Documentation/Manual/light-probes-troubleshooting.html](https://docs.unity3d.com/6000.2/Documentation/Manual/light-probes-troubleshooting.html) 振铃] 伪影（如果存在）。&lt;br /&gt;
* Put menu under Tools: 将 Bakery 菜单放入 Tools 菜单下。&lt;br /&gt;
&lt;br /&gt;
如果任何格式设置为 Asset 且启用 mipmapping，会显示额外选项：&lt;br /&gt;
&lt;br /&gt;
* Maximum mipmap count: 定义 mipmap 的最大数量。例如，设置为 2，则 8K 光照贴图仅有两个额外 mipmap：4K 和 2K。更低分辨率将被省略，从而在 mipmapping 过程中限制泄漏伪影。&lt;br /&gt;
&lt;br /&gt;
= SkinnedMeshRenderer 支持 =&lt;br /&gt;
Bakery 自 v1.65 起支持蒙皮网格 (skinned meshes)。但是，有一些限制：&lt;br /&gt;
&lt;br /&gt;
* 某些 Unity 版本不支持蒙皮网格的 UV1，并会悄无声息地忽略 “Generate lightmap UVs”。请确保场景中实际使用的网格具有 UV1，并在可能的情况下使用非重叠的 UV0；&lt;br /&gt;
* UV 填充调整在蒙皮网格上不起作用（Unity 在尝试调用 Unwrap 函数时似乎会崩溃）；&lt;br /&gt;
* 蒙皮网格不能使用每顶点光照贴图 (per-vertex lightmaps)（引擎不支持带蒙皮的 additionalVertexStreams）。&lt;/div&gt;</summary>
		<author><name>Mr F</name></author>
		
	</entry>
	<entry>
		<id>https://geom.io/bakery/wiki/index.php?title=%E4%BD%BF%E7%94%A8%E6%89%8B%E5%86%8C&amp;diff=1824</id>
		<title>使用手册</title>
		<link rel="alternate" type="text/html" href="https://geom.io/bakery/wiki/index.php?title=%E4%BD%BF%E7%94%A8%E6%89%8B%E5%86%8C&amp;diff=1824"/>
		<updated>2025-11-05T13:57:14Z</updated>

		<summary type="html">&lt;p&gt;Mr F: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== 系统要求 ==&lt;br /&gt;
&lt;br /&gt;
使用 Bakery 需要：&lt;br /&gt;
&lt;br /&gt;
Windows（7 或更高版本）电脑。&lt;br /&gt;
&lt;br /&gt;
Nvidia 显卡。最低支持型号为 Kepler（GeForce 650 或更新型号，Quadro 显卡请查看规格）。&lt;br /&gt;
&lt;br /&gt;
64 位 Unity 编辑器。Bakery 已在 5.6 到 6 及更高版本上测试过，同时也在 Tuanjie 1.6.7 上通过测试。&lt;br /&gt;
&lt;br /&gt;
{{note|系统要求仅适用于开发者的电脑，而非目标平台。使用 Bakery 烘焙的光照贴图可以在任何地方使用。}}&lt;br /&gt;
&lt;br /&gt;
== 前提条件 ==&lt;br /&gt;
* 确保你的项目中没有任何脚本编译错误，否则也会导致 Bakery 的脚本无法编译。&lt;br /&gt;
* 确保你的显卡驱动是最新版本，如有需要请[https://www.nvidia.com/Download/index.aspx?lang=en-US 更新]。&lt;br /&gt;
&lt;br /&gt;
'''请使用 Game-Ready（标准）驱动程序，而不是 “Studio” 驱动。'''&lt;br /&gt;
&lt;br /&gt;
== 安装 ==&lt;br /&gt;
&lt;br /&gt;
1. 通过 [https://assetstore.unity.com/packages/tools/level-design/bakery-gpu-lightmapper-122218 Asset Store] 将 Bakery 导入到你的项目中。&lt;br /&gt;
&lt;br /&gt;
2. Unity 会显示要导入的文件列表。如果这是你第一次使用 Bakery，建议直接 点击 Import（导入）。有经验的用户可以取消选中 examples 文件夹，以进行更轻量的安装。&lt;br /&gt;
&lt;br /&gt;
文件将被导入到 `Assets/Bakery` 和 `Assets/Editor/x64/Bakery` 文件夹中。&lt;br /&gt;
这些文件夹之后可以移动。&lt;br /&gt;
&lt;br /&gt;
3. Unity 随后会导入 Bakery 并编译脚本。此时可能会弹出如下窗口：&lt;br /&gt;
&lt;br /&gt;
[[File:Goahead.png]]&lt;br /&gt;
&lt;br /&gt;
此时你应点击 “Go Ahead”（继续）。&lt;br /&gt;
&lt;br /&gt;
现在你应该能在编辑器中看到新增的 Bakery 菜单：&lt;br /&gt;
&lt;br /&gt;
[[File:bmenu.jpg]]&lt;br /&gt;
&lt;br /&gt;
== 快速开始 ==&lt;br /&gt;
&lt;br /&gt;
1. 添加一些模型或基础体，并将其标记为静态（Static）。&lt;br /&gt;
&lt;br /&gt;
'''用于光照贴图的网格必须具有不重叠的 UV2。如果存在 UV2，则会使用 UV2（否则使用 UV1）。如果你的模型没有为光照贴图进行展开，请在资源中勾选 Generate Lightmap UVs（生成光照贴图 UV）。'''&lt;br /&gt;
Unity 的基础体已经具有正确的 UV2。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Staticmarked.jpg|320px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. 选择方向光（Unity 为你创建的那个），并添加 '''Bakery Direct Light''' 组件。&lt;br /&gt;
   {{note|Bakery 和 Unity 使用独立的光源组件。}}&lt;br /&gt;
&lt;br /&gt;
3. Bakery Direct Light 有许多可调选项，但你可以轻松将其与 Unity 光源匹配。点击 '''Match lightmapped to real-time'''。现在 Bakery 光源的颜色应与 Unity 默认的方向光相同，呈黄色调。&lt;br /&gt;
&lt;br /&gt;
[[File:Matching.jpg|640px]]&lt;br /&gt;
&lt;br /&gt;
{{note|Direct Light 组件可能会提示项目未使用线性光强度。问题在于，Unity 默认会对光源颜色应用伽马校正 [https://twitter.com/guycalledfrank/status/1001108508614553600 不正确]。&lt;br /&gt;
可以通过[https://docs.unity3d.com/ScriptReference/Rendering.GraphicsSettings-lightsUseLinearIntensity.html 脚本]启用正确模式。&lt;br /&gt;
这就是 “Fix” 按钮的作用。如果你已经在非线性光强模式下设置了许多光源，并且不想再次更改它们，可以跳过修复。即使你按了 “Fix”，也可以随时撤销此更改。&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. 要获得带阴影的环境光，请创建 Skylight（Bakery-&amp;gt;Create-&amp;gt;Skylight）。&lt;br /&gt;
&lt;br /&gt;
[[File:Menusky.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. 选择 Skylight，为它设置一些偏蓝的颜色，然后点击 '''Match scene skybox to this light'''。   这将使场景的 skybox 与光照完全匹配。&lt;br /&gt;
   {{note|将 Unity 的 skybox 与 Bakery Skylight 匹配是可选的，但对正确性很有用，可以确保可见环境和引擎内的反射探针与烘焙光照一致。目前此选项仅适用于 Standard 渲染管线。}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Skycomp.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. 点击 Bakery-&amp;gt;Render Lightmap。默认情况下，Full Lighting 模式是激活的。它会烘焙所有光源的直接和间接光照贡献。如果你想将实时阴影与烘焙全局光照（GI）结合使用，请将模式更改为 '''Indirect'''。&lt;br /&gt;
&lt;br /&gt;
[[File:Bakerywindow.jpg]]&lt;br /&gt;
&lt;br /&gt;
{{note| Bakery 可能会提示你正在使用旧的 [https://docs.unity3d.com/Manual/LinearLighting.html gamma mode]。如果你在意光照质量，强烈建议使用线性模式。如果你的项目已经在错误的伽马模式下设置好了，并且不想更改，或者是发布到不支持线性模式的移动设备上，也可以忽略此提示。}}&lt;br /&gt;
&lt;br /&gt;
7. 点击 '''Render'''。&lt;br /&gt;
&lt;br /&gt;
8. 完成！现在你应该已经得到烘焙的全局光照（GI）：&lt;br /&gt;
&lt;br /&gt;
[[File:Bakedgi.jpg]]&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 ==&lt;br /&gt;
&lt;br /&gt;
所有渲染设置都可以通过 Bakery-&amp;gt;Render Lightmap 访问。设置会为每个场景单独保存。Bakery 窗口顶部的选项允许你在 Simple（简单）、Advanced（高级）和 Experimental（实验）设置之间切换，每个后续模式都会显示更多可调选项。对于大多数场景，Simple 模式已经足够，是入门的好方法。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render mode ===  &lt;br /&gt;
定义要烘焙的光照贴图类型。  &lt;br /&gt;
&lt;br /&gt;
===== Full Lighting =====&lt;br /&gt;
烘焙所有 Bakery 光源的完整直接光和间接光。&lt;br /&gt;
{{note|在 2017.3 之前的 Unity 版本中，如果同一对象上同时有 Unity 和 Bakery 组件，你需要手动禁用 Unity 组件以避免亮度加倍。在较新版本中，实时效果会自动对烘焙光源禁用，就像内置光照烘焙器一样。}}&lt;br /&gt;
&lt;br /&gt;
===== Indirect =====&lt;br /&gt;
[[File:Image26.png|thumb|Unity 支持的不同渲染模式对比]]&lt;br /&gt;
基础混合模式。它会查看每个光源上的 Baked Contribution 选择器：如果设置为 ''Direct And Indirect''，则光源会像在 Full Lighting 模式下一样被烘焙。如果设置为 ''Indirect Only''，则只会烘焙该光源的间接光照（GI）。在后一种情况下，你应保持对象上的 Unity 光源和 Bakery 光源同时存在，一个提供实时直接光照，另一个提供预计算的全局光照（GI）。&lt;br /&gt;
&lt;br /&gt;
[[File:Indirectonly.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== Shadowmask =====&lt;br /&gt;
[[File:Image21.png|thumb|左：完全烘焙的光照。中：动态光源 + 烘焙 GI。右：胶囊形阴影、凹凸贴图和高光为动态光照，但立方体阴影和 GI 为烘焙光照。]]&lt;br /&gt;
[[File:Image6.png|thumb|当相机足够远离场景，或者动态阴影被禁用时，场景将呈现如下效果]]&lt;br /&gt;
更高级的混合模式。它通过生成两种类型的光照贴图来工作——一种包含烘焙颜色（如 Indirect 模式），另一种包含静态物体的阴影。它有几个优点：&lt;br /&gt;
* 实时阴影只需渲染少量动态对象，而不是整个场景。&lt;br /&gt;
* 实时阴影与烘焙阴影可以正确融合。&lt;br /&gt;
* 实时光源可以渲染凹凸贴图、高光和其他表面效果，同时仍会被高质量烘焙阴影遮挡。&lt;br /&gt;
[https://docs.unity3d.com/Manual/LightMode-Mixed-Shadowmask.html 更多详情]&lt;br /&gt;
&lt;br /&gt;
要启用此行为，你必须在同一对象上同时存在 Unity 光源和 Bakery 光源，并将 Baked Contribution 设置为 ''Shadowmask and Indirect''。未标记的光源将按 Indirect 模式进行烘焙。&lt;br /&gt;
&lt;br /&gt;
[[File:Smask22.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== Distance Shadowmask =====&lt;br /&gt;
此复选框仅在你选择 Shadowmask 时可见，并且只是切换项目 [https://docs.unity3d.com/Manual/LightMode-Mixed-ShadowmaskMode.html Quality Settings] 中同名的设置。&lt;br /&gt;
[https://docs.unity3d.com/Manual/LightMode-Mixed-DistanceShadowmask.html 更多详情]&lt;br /&gt;
{{note|由于缺少对应的脚本 API，该复选框在 Unity 5.6.x 上不可见。你可以在 Window-&amp;gt;Lighting-&amp;gt;Mixed Lighting-&amp;gt;Lighting Mode 中切换该设置。}}&lt;br /&gt;
{{note|在 Unity 版本 &amp;lt; 2017.3 中，由于 API 限制，渲染 Shadowmask 光照贴图会清除光照探针。烘焙后需要重新渲染光照探针。在较新版本中不应发生此问题。}}&lt;br /&gt;
&lt;br /&gt;
===== Subtractive =====&lt;br /&gt;
&lt;br /&gt;
启用 [https://docs.unity3d.com/Manual/LightMode-Mixed-Subtractive.html Subtractive] 光照模式。&lt;br /&gt;
&lt;br /&gt;
此选项对光照贴图本身没有任何特殊作用，实际上它的工作方式与 Full Lighting 相同。&lt;br /&gt;
&lt;br /&gt;
唯一的区别是，它还会将实时 Unity 光源设置为与 Subtractive 模式兼容（因为无法通过 UI 完成此操作）。&lt;br /&gt;
&lt;br /&gt;
你还需要在 [https://docs.unity3d.com/Manual/GlobalIllumination.html#MixedLighting Unity Lighting] 窗口中额外设置全局减法参数（例如全局阴影颜色）。&lt;br /&gt;
&lt;br /&gt;
===== Ambient Occlusion Only =====&lt;br /&gt;
仅烘焙环境光遮蔽（AO）。如果你很清楚自己在做什么，这可能会有用。请确保设置 [[#Ambient_occlusion|AO 选项]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Directional mode ===&lt;br /&gt;
[[File:Image3.png|thumb|不同方向模式的对比]]&lt;br /&gt;
定义了方向信息的烘焙方式。标准光照贴图每个像素只存储单一颜色，而方向光照贴图为着色器提供了关于该像素周围半球内光照变化的提示。这些数据用于在完全烘焙的区域中结合法线贴图。如果将其应用到内置的 [[#Bakery_shaders|Bakery]] 着色器中，还可以产生**近似高光反射**效果。&lt;br /&gt;
&lt;br /&gt;
===== None =====&lt;br /&gt;
不包含方向数据，每个像素仅有单一颜色。&lt;br /&gt;
&lt;br /&gt;
===== Baked Normal Maps =====&lt;br /&gt;
依然没有方向数据，但在渲染光照贴图时会考虑法线贴图。此方式在运行时没有额外开销。由于光照贴图的分辨率通常低于法线贴图，结果可能显得模糊。其他问题包括：由于缺乏 mipmapping，远处可能出现锯齿，以及降噪步骤可能导致细节被涂抹。要了解如何在此模式下使用具有程序化法线的自定义着色器，请参阅 [[#Normal_mapping|Normal Mapping]] 章节。&lt;br /&gt;
&lt;br /&gt;
===== Dominant Direction =====&lt;br /&gt;
此模式类似于 Unity 中 Enlighten 和 Progressive 烘焙器的实现。它与大多数着色器兼容，仅生成一张额外的贴图，运行时开销极小。缺点是凹凸贴图的效果较弱，略显灰暗，与实时光照下的同一物体相比可能差异较大。&lt;br /&gt;
&lt;br /&gt;
===== RNM =====&lt;br /&gt;
基于最初为《Half-Life 2》开发的 [https://steamcdn-a.akamaihd.net/apps/valve/2004/GDC2004_Half-Life2_Shading.pdf Radiosity Normal Mapping] 技术（相关演示文稿），后来被许多游戏采用（如《Mirror's Edge》）。此模式总共生成三张 HDR 贴图，是内存占用最高的模式之一，但运行时开销仍相对较低。该模式比 Dominant Direction 更精确，能更好地再现表面反差，并能正确处理来自不同角度、具有不同颜色的光照对法线贴图的影响。&lt;br /&gt;
&lt;br /&gt;
===== SH =====&lt;br /&gt;
基于论文《[https://media.contentapi.ea.com/content/dam/eacom/frostbite/files/gdc2018-precomputedgiobalilluminationinfrostbite.pdf Precomputed Global Illumination in Frostbite]》。这是最高质量的模式，能提供更好的表面对比度，并准确表现来自不同方向、不同颜色的光照。总共生成四张贴图，其中仅一张为 HDR，因此比 RNM 占用更少内存。运行时开销略高于 RNM。&lt;br /&gt;
&lt;br /&gt;
===== MonoSH =====&lt;br /&gt;
[[File:FY8Ru8hWIAAdYYH.jpg|thumb|Dominant Direction、完整 SH 与 MonoSH 的尺寸/质量对比]]&lt;br /&gt;
与 SH 类似，但使用单色的 L1 方向系数。表面对比度同样良好，虽然无法准确表现来自不同方向的不同颜色光照，但对多数场景来说已经足够。仅生成一张额外贴图，因此显存占用与带宽需求与 Dominant Direction 相近；事实上更低，因为 Dominant Direction 使用 RGBA 贴图，而 MonoSH 只需 RGB。该贴图通过内置的方向光照贴图系统传递，但''在标准着色器下显示不正确''。请务必使用兼容的着色器。&lt;br /&gt;
&lt;br /&gt;
===== 限制 =====&lt;br /&gt;
&lt;br /&gt;
* RNM 和 SH/MonoSH 只能与 [[#Bakery_shaders|Bakery shader]] 一起使用，或者需要对你的着色器进行调整。&lt;br /&gt;
* 在 RNM 和 SH 模式下，不会生成标准的颜色光照贴图。你需要确保场景中所有材质都使用 Bakery Shader，或者使用 [[#Bakery_Lightmap_Group_Selector|Lightmap Groups]] 将 RNM/SH 对象与其他对象分开。&lt;br /&gt;
* RNM 和 SH 贴图是通过 [https://docs.unity3d.com/ScriptReference/MaterialPropertyBlock.html MaterialPropertyBlock] 应用于对象的，因此在 Unity 的 Lighting 窗口中可能无法完全显示。&lt;br /&gt;
* Dominant Direction、RNM 和 SH/MonoSH 模式可能需要为全局光照（GI）和光照网格使用更多采样，以获得相近的质量。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Texels per unit ===&lt;br /&gt;
[[File:Texelscomp.jpg|thumb|1 vs 10 texels per unit]]&lt;br /&gt;
每个世界单位的光照贴图像素（Texels）近似数量。它会影响生成光照贴图的数量和分辨率。&lt;br /&gt;
&lt;br /&gt;
入门示例值：&lt;br /&gt;
&lt;br /&gt;
* 大型户外区域（城市）：1 - 5&lt;br /&gt;
* 中型户外区域（几条小巷）：10 - 20&lt;br /&gt;
* 高质量室内场景：100&lt;br /&gt;
&lt;br /&gt;
假设场景比例大约为 1 单位 = 1 米。在 Unity 中使用这种比例通常是推荐的，以便更好地导航和进行物理模拟。如果你的比例不同，请相应地调整 Texels。&lt;br /&gt;
&lt;br /&gt;
请注意，Texels Per Unit 是基础分辨率，但每个对象还可以通过 Mesh Renderer 上的 &amp;quot;Scale in Lightmap&amp;quot; 选项以及 Bakery 窗口中的 &amp;quot;Scale per map type&amp;quot; 进行额外调整。&lt;br /&gt;
&lt;br /&gt;
{{note| 将 &amp;quot;Scale in Lightmap&amp;quot; 设置为 0 的对象不会被烘焙，但仍会投射阴影并影响全局光照（GI）。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Max resolution ===&lt;br /&gt;
光照贴图的最大尺寸限制。如果对象无法容纳在单张光照贴图中（根据当前的 Texels Per Unit 值），将会分配额外的光照贴图。同样的四个正方形对象可以使用四张 512x512 的贴图，也可以使用一张 1024x1024 的贴图。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bounces ===&lt;br /&gt;
[[File:Image36.png|thumb|注意更多的反弹会为封闭空间带来更多光照。]]&lt;br /&gt;
定义光线在表面上反弹的次数。通常，对于户外场景（例如城市），较低的反弹次数就足够了，而对于封闭场景（室内、洞穴），则需要较高的反弹次数。&lt;br /&gt;
&lt;br /&gt;
虽然滑块最多限制为 5 次反弹，但可以在数字输入框中输入任意反弹次数。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Samples ===&lt;br /&gt;
[[File:Image7.png|thumb|左：Samples = 4，右：Samples = 16。为了演示，去噪功能已关闭。]]&lt;br /&gt;
影响全局光照（GI）的质量。典型值为 16 到 32。&lt;br /&gt;
&lt;br /&gt;
{{note| 可以输入超出滑块最大值的任意数字，但请注意，该数字表示最终光线数量的平方根，例如 32 表示 1024 条光线，64 表示 4096 条光线，依此类推。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GPU Priority ===&lt;br /&gt;
在 GPU 处理光照贴图时，操作系统和其他软件的响应可能会变慢。此选项允许你在烘焙速度和系统响应之间进行平衡。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render ===&lt;br /&gt;
为所有打开的场景烘焙光照贴图。&lt;br /&gt;
如果 [[使用手册#Light_probe_mode|Light Probe Mode]] 设置为 L1 或 L2，也会烘焙 [https://docs.unity3d.com/Manual/LightProbes.html 光照探针]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Render Light Probes ===&lt;br /&gt;
为所有打开的场景烘焙 [https://docs.unity3d.com/Manual/LightProbes.html 光照探针]。&lt;br /&gt;
&lt;br /&gt;
请注意，要在 Shadowmask 模式下对动态对象获得正确的混合光阴影，你还需要启用 [[使用手册#Occlusion_probes|occlusion probes]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Render Reflection Probes ===&lt;br /&gt;
为所有打开的场景烘焙反射探针。此按钮仅为方便起见，会调用引擎内置的反射探针更新功能。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update Skybox Probe ===&lt;br /&gt;
为当前的 skybox 烘焙全局漫反射和反射探针。与 “Render Reflection Probes” 一样，它仅调用引擎内置函数。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Occlusion probes ===&lt;br /&gt;
在渲染光照探针时，允许 Unity 使用当前选择的内置光照烘焙器烘焙遮挡探针（occlusion probes）。遮挡探针是存储在普通光照探针中的附加数据，可以防止动态对象在阴影区域被错误照亮。目前在 Unity 中无法使用自定义遮挡探针，必须调用内置光照烘焙器来完成此操作。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Warnings ===&lt;br /&gt;
这些选项会在按下任意 Render 按钮后对场景进行验证，并显示警告对话框，询问是否继续或停止烘焙过程。&lt;br /&gt;
&lt;br /&gt;
* Suppress all popups（屏蔽所有弹窗）：按下 Render 后不显示任何对话框。&lt;br /&gt;
* UV validation（UV 验证）：检查所有模型是否具有完全正确的光照贴图 UV，特别是 UV 是否位于 0-1 范围内且不重叠。&lt;br /&gt;
* Overwrite check（覆盖检查）：显示哪些光照贴图文件将被覆盖。&lt;br /&gt;
* Memory check（内存检查）：显示大致所需的视频内存量。&lt;br /&gt;
* Sample count check（采样数检查）：检查是否有光源、GI 或 AO 的采样数不合理，可能导致 GPU 超出可用资源。&lt;br /&gt;
* Lightmapped prefab validation（光照贴图预制体验证）：验证光照贴图预制体，并在某些预制体将被覆盖时发出通知。&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 (Advanced) ==&lt;br /&gt;
=== Light probe mode ===&lt;br /&gt;
更改光照探针的烘焙方式。&lt;br /&gt;
&lt;br /&gt;
* Legacy（传统模式）：使用 Render Light Probes 按钮生成探针。点光源和方向光在光照烘焙器中计算，而区域光/天空光/间接光则通过在每个探针位置渲染立方体贴图收集。结果以 [https://docs.unity3d.com/ScriptReference/Rendering.SphericalHarmonicsL2.html L2] 球谐（spherical harmonics）形式存储。缺点是立方体贴图渲染速度慢，并且在游戏中使用的着色器未物理正确表示光照表面，或者项目为移动平台设置时，光照贴图和探针可能不匹配（Unity 可能会裁剪高强度值）。&lt;br /&gt;
&lt;br /&gt;
* L1：在点击 Render 时，光照探针会与光照贴图一起渲染。此选项提供更高的烘焙性能，并保证探针光照与光照贴图匹配。结果以 L1 球谐形式存储（仍可被普通着色器使用）。使用 [[#Bakery_shaders|Bakery shader]] 的 Non-Linear Light Probe SH 选项可以进一步提升结果。&lt;br /&gt;
&lt;br /&gt;
* L2：更高质量（完整 L2 球谐）。与 L1 一样，会自动与光照贴图一起渲染。与 L1 相比，性能影响可忽略不计。应在所有着色器下显示正常。探针对比度/方向性/振铃去除可通过 Project Settings -&amp;gt; Bakery -&amp;gt; “Ringing removal for L2 light probes” 调整。&lt;br /&gt;
&lt;br /&gt;
'''在 Unity 2019.3 中似乎存在一个 bug，如果启用 Occlusion Probes 选项，Legacy 光照探针的颜色无法正确保存。使用 Occlusion Probes 时，默认且推荐使用 L2 模式。'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Asset UV Processing ===&lt;br /&gt;
配置资产的 UV 间距（padding）调整。可选值：&lt;br /&gt;
&lt;br /&gt;
* Don't change（不更改）：不修改资产。&lt;br /&gt;
* Adjust UV padding（调整 UV 间距）：会查找具有自动生成 UV 的模型（资产上启用 “Generate Lightmap UVs”），并进一步调整它们，使每个网格的 UV 岛之间具有适当间距。导入器设置中的全模型 Pack Margin 会被忽略。系统会根据每个网格的面积和光照贴图分辨率计算出最优值。&lt;br /&gt;
* Adjust UV padding for new meshes only（仅调整新网格的 UV 间距）：与上面相同，但会跳过之前至少调整过一次的模型。&lt;br /&gt;
* Remove UV adjustments（移除 UV 调整）：撤销所有之前的 UV 调整，使自动展开的模型恢复到 Unity 原始展开的样子。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser ===&lt;br /&gt;
设置所需的去噪器。可选值：&lt;br /&gt;
&lt;br /&gt;
* Optix 5：使用 OptiX 5.1 AI 去噪器（之前称为 “Legacy denoiser”）。在 GPU 上运行。支持从 [https://en.wikipedia.org/wiki/Kepler_(microarchitecture) Kepler]（通常是 GeForce 6xx）到 [https://en.wikipedia.org/wiki/Turing_(microarchitecture) Turing]（通常是 GeForce 20xx）的所有显卡。不支持 [https://en.wikipedia.org/wiki/Ampere_(microarchitecture) Ampere]（30xx）。OptiX 5.1 使用嵌入的静态训练数据集，因此不受驱动实现影响。&lt;br /&gt;
&lt;br /&gt;
* Optix 6：使用 OptiX 6.0 AI 去噪器（之前为默认选项）。在 GPU 上运行。在 Kepler（6xx）显卡上似乎无法使用，但在更新的显卡上均可运行，包括 Ampere（30xx）。自 6.0 起，OptiX 去噪器的训练数据集存储在驱动中。在 v442.50 之前，其行为类似于 OptiX 5.1；但之后 NVIDIA [https://forums.developer.nvidia.com/t/optix7-denoiser-different-results-with-different-version-of-drivers/117989/2 更改了数据集]，结果可能有所不同。更新后的数据集有时可能产生网格状图案和更亮的边缘（仍可通过 “Denoise: fix bright edges” 修复），但运行速度更快。&lt;br /&gt;
&lt;br /&gt;
* Optix 7：使用 OptiX 7.2 AI 去噪器。行为类似 OptiX 6.0，但在 Ampere（30xx）上可能支持更好。&lt;br /&gt;
&lt;br /&gt;
* OpenImageDenoise：使用 Intel Open Image Denoise 库。在 CPU 上运行（任何支持 SSE 4.1 的 CPU）。可能略慢于 OptiX，但质量可比。&lt;br /&gt;
&lt;br /&gt;
* OpenImageDenoise2：使用 Intel Open Image Denoise 2，CUDA 模式。在 GPU 上运行，性能与 OptiX 6/7 相当，质量与 CPU 版本相同。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Adjust sample positions ===&lt;br /&gt;
寻找最佳采样位置以防止光照泄漏。算法详情可参考 [https://ndotl.wordpress.com/2018/08/29/baking-artifact-free-lightmaps/#leaks 此处]。在某些情况下（通常是大型且多边形极少、法线平滑的几何体），可能会产生不正确的结果，此时可以将其禁用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Unload scenes before render ===&lt;br /&gt;
在烘焙前卸载 Unity 场景以释放显存。复杂场景仅在编辑器中显示就可能占用数 GB 的显存。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Denoise ===&lt;br /&gt;
[[File:Image31.png|thumb|左：未开启 “Denoise”，右：开启 “Denoise”。]]&lt;br /&gt;
如果启用，将应用去噪算法。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Fix Seams ===&lt;br /&gt;
[[File:Image22.png|thumb|左：缝隙（“Fix Seams” 关闭），右：缝隙已修复（“Fix Seams” 开启）。]]&lt;br /&gt;
如果启用，将尝试融合由 UV 不连续造成的缝隙。对平滑几何体很有用，包括 Unity 默认的球体。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Split by scene ===&lt;br /&gt;
如果同时加载多个场景，并且启用此选项，每个场景将拥有自己的一套光照贴图，而不会与其他场景共享。这对于在运行时流式加载场景时限制纹理占用量非常有用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hole filling ===&lt;br /&gt;
[[File:Holefilling.jpg|thumb|“Hole filling” 关闭与开启的对比。]]&lt;br /&gt;
如果 Atlas Packer 设置为 xatlas，将尝试填充每个孔洞，从而生成更高效的贴图集。对于几何体非常复杂的场景，可能会增加场景导出时间，但通常推荐开启。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Min resolution ===&lt;br /&gt;
光照贴图的最小尺寸限制。可用于在生成大量小而完全填充的光照贴图与少量未完全填充的光照贴图之间进行平衡。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Scale per map type ===&lt;br /&gt;
允许你对颜色贴图、Shadowmask 和方向贴图设置不同的分辨率缩放。例如，常见情况是间接光颜色分辨率较低，但 Shadowmask 分辨率较高。请注意，缩放在光照贴图渲染完成后才应用，因此不会节省烘焙时间。如果启用了 “Adjust UV padding”，间距将基于最低分辨率的贴图，以防止像素泄漏。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Checker preview ===&lt;br /&gt;
[[File:Image12.png|thumb|Checker Preview 功能演示。]]&lt;br /&gt;
如果勾选了 “Show checker” 选项，场景视图将在可见对象上渲染棋盘格图案，以展示光照贴图像素大小。这对于在烘焙前确保 Texels Per Unit 和其他影响分辨率的设置使用合理数值非常有用。&lt;br /&gt;
&lt;br /&gt;
启用 Checker Preview 将强制 Bakery 执行贴图集打包。可能需要一些时间，但通常不会超过几秒钟。在修改场景内容后，按下 “Refresh checker” 可重新打包场景以查看更改。&lt;br /&gt;
&lt;br /&gt;
Checker Preview 还使用随机颜色显示场景将如何被分割到不同的光照贴图中。&lt;br /&gt;
&lt;br /&gt;
{{note| 当前 Checker Preview 无法显示地形的正确像素大小。}}&lt;br /&gt;
&lt;br /&gt;
==== Atlas preview ====&lt;br /&gt;
[[File:FN-TmhRXwAE9i2I.png|thumb|Atlas Preview 功能演示]]&lt;br /&gt;
当 Checker Preview 开启时，会显示 Atlas Preview 按钮。点击它将打开一个新窗口，显示未来光照贴图的 UV 布局。点击 &amp;quot;&amp;lt;&amp;quot; 和 &amp;quot;&amp;gt;&amp;quot; 按钮可浏览各个光照贴图。&lt;br /&gt;
这对于在烘焙前检查打包质量和光照贴图数量非常有用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Emissive boost ===&lt;br /&gt;
将任何表面自发光（emission）乘以此数值。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Indirect boost ===&lt;br /&gt;
将所有反弹光照乘以此数值。作用与光源组件上的 Indirect Intensity 相同，但为全局设置。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Backface GI ===&lt;br /&gt;
[[File:Image30.jpg|thumb|Backface GI]]&lt;br /&gt;
[[File:Image35.png|thumb|左：“Backface GI” = 0，右：“Backface GI” = 1。注意阴影区域接收到更多的绿色光照。]]&lt;br /&gt;
决定光线通过前面表面到达背面并被全局光照（GI）反弹的程度。这对于薄的半透明表面（如树叶）尤其有用。取值范围为 0-1。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Ambient occlusion ===&lt;br /&gt;
[[File:Image15.png|thumb|左：AO intensity = 0，右：AO intensity = 1。]]&lt;br /&gt;
一种简单的非物理环境光遮蔽（Ambient Occlusion，AO），可在最终场景光照上叠加以增强美观效果。&lt;br /&gt;
&lt;br /&gt;
* Intensity（强度）：控制 AO 效果的可见度。值为 0 时禁用该效果。&lt;br /&gt;
* Radius（半径）：决定 AO 效果使用的光线距离。较小的值产生局部遮蔽（角落、褶皱），较大的值则更类似 Skylight，从远处物体产生阴影。&lt;br /&gt;
* Samples（采样数）：影响环境光遮蔽的质量。典型值为 4 到 32。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dither transparency ===&lt;br /&gt;
通过自动抖动不透明度贴图来启用半透明阴影。[[使用手册#Opacity|了解 Bakery 如何处理不透明度贴图]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== RTX Mode ===&lt;br /&gt;
启用 RTX 硬件加速。仅 RTX 显卡可受益于此选项。最低支持的驱动版本为 418。&lt;br /&gt;
&lt;br /&gt;
驱动可以在大多数非 RTX Nvidia 显卡上模拟 RTX 模式，但通常会更慢。&lt;br /&gt;
&lt;br /&gt;
在 Ampere（3xxx）或更新的显卡上，RTX 模式 ''必须'' 启用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Export terrain trees ===&lt;br /&gt;
如果启用，绘制在地形上的树木将影响光照。树木本身不会被烘焙。请注意，在烘焙过程中，每棵树都使用最高可能的 LOD 等级。对于多公里范围且模型高度复杂的森林场景，不建议使用此选项。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Terrain optimization ===&lt;br /&gt;
如果启用（默认），地形将使用独立的光线追踪技术以利用其高程图几何结构。否则，它们将像其他普通网格一样处理。地形优化可以显著减少高分辨率地形所需的内存占用。在某些情况下，它还能加快地形烘焙速度，但在其他情况下（尤其是简单低分辨率地形）可能需要禁用该选项。&lt;br /&gt;
&lt;br /&gt;
{{note| 地形优化当前不兼容绘制的地形洞。需禁用此选项才能使其正常工作。}}&lt;br /&gt;
{{note| 地形优化仅支持非 RTX 模式。}}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Light Mesh batch limit ===&lt;br /&gt;
如果该值大于 0，会将多个 Light Mesh 合并为一个，前提是它们具有相同设置并影响相同的 Lightmap Groups，同时将它们的总采样数限制为该值（例如，如果限制为 64，则可以合并 2 个采样数为 32 的灯光，或 4 个采样数为 16 的灯光，等等）。在拥有大量 Light Mesh 的场景中，这可以提升性能。但设置过高时需小心，因为 GPU 在一次处理过多采样时可能触发操作系统驱动超时。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Compress volumes ===&lt;br /&gt;
如果启用，将对体积 3D 贴图应用纹理压缩，并将 Bakery 着色器切换到相应的采样模式。不推荐对分辨率非常低的体积使用此选项。体积大小可能会被调整为 4 的倍数。&lt;br /&gt;
&lt;br /&gt;
注意事项：&lt;br /&gt;
&lt;br /&gt;
* 目前仅支持压缩为 BC6H/BC7 纹理格式（桌面/主机平台）。&lt;br /&gt;
* 体积压缩仅支持 Unity 2020.1 或更高版本。&lt;br /&gt;
* 目前仅标准渲染管线的 Bakery 着色器支持使用压缩体积贴图。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Samples multiplier ===&lt;br /&gt;
将所有阴影和 GI 采样数乘以指定因子。可用于在草稿质量和最终质量之间快速切换。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Tile size ===&lt;br /&gt;
与 [[#GPU Priority|GPU Priority]] 相同，但这里设置的是贴图块（tile）大小。Bakery 会将光照贴图拆分为更小的块，并一次更新一个块。块越小，GPU 工作被中断的次数越多，系统响应性可能更好。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Temp path ===&lt;br /&gt;
临时文件夹。在渲染过程中，Bakery 可能需要几个 GB 的可用空间。将此文件夹放在 SSD 上相比 HDD 可略微加快渲染速度。目前，该文件夹不会自动清理。你可以随时手动删除其内容（渲染时除外），或通过 Bakery -&amp;gt; Utilities -&amp;gt; Clear cache 清理。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Output path ===&lt;br /&gt;
光照贴图文件夹。所有光照贴图，以及 lightprobe 和顶点颜色（vertex color）资源都将保存在此处。该路径相对于你的 Assets 文件夹。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Use scene named output path ===&lt;br /&gt;
如果启用此选项，输出路径将自动设置为与当前活动场景同名的文件夹（Assets/CurrentSceneName/）。这与 Unity 内置光照贴图烘焙器的行为类似。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render Selected Groups ===&lt;br /&gt;
仅烘焙包含所选对象的 Lightmap Groups。&lt;br /&gt;
不仅仅是所选对象会被重新绘制，它们所属的所有 Lightmap Groups 都会被处理。其他光照贴图不会被更新。如果对象不属于某个手动分配的组，则使用相同光照贴图的场景部分将被重新烘焙。&lt;br /&gt;
&lt;br /&gt;
目前，使用 [[Partial_scene_baking|Sectors]] 进行场景部分烘焙更为方便。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Beep on finish ===&lt;br /&gt;
如果启用，Bakery 在烘焙完成时会播放提示音。&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 (Experimental) ==&lt;br /&gt;
=== Unwrapper ===&lt;br /&gt;
如果启用 [[#Asset_UV_Processing|Adjust UV Padding]]，则定义将使用的展开器（unwrapper）。&lt;br /&gt;
&lt;br /&gt;
* Default：使用 Unity 标准展开器。Bakery 会为每个具有不同间距参数的网格调用 [https://docs.unity3d.com/ScriptReference/Unwrapping.GenerateSecondaryUVSet.html Unwrapping.GenerateSecondaryUVSet]。&lt;br /&gt;
* xatlas：使用 [https://github.com/jpcy jpcy] 的 [https://github.com/jpcy/xatlas xatlas]，这是 [https://github.com/castano Ignacio Castaño] 的 [https://github.com/Thekla/thekla_atlas thekla_atlas] 的修改版。thekla_atlas 曾用于游戏《The Witness》（[http://the-witness.net/news/2010/03/graphics-tech-texture-parameterization/ 参见博客文章]）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Atlas Packer ===&lt;br /&gt;
选择在将不同对象的 UV 布局打包到大型光照贴图集时使用的算法。&lt;br /&gt;
* Default：Bakery 在 v1.7 之前使用的原始算法。&lt;br /&gt;
* xatlas：使用 xatlas。&lt;br /&gt;
&lt;br /&gt;
某些功能仅支持特定的贴图集打包器：&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Default&lt;br /&gt;
! xatlas&lt;br /&gt;
|-&lt;br /&gt;
| [[使用手册#Bakery_Lightmap_Group_Selector|Override resolution]]&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
|-&lt;br /&gt;
| 高效 LOD 打包&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
|-&lt;br /&gt;
| [[使用手册#Hole_filling|Hole filling]]&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
请注意，贴图集打包器（Atlas Packer）也可以为每个 Lightmap Group 单独选择。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Export geometry and maps ===&lt;br /&gt;
如果启用，Bakery 会在渲染前将场景导出为其专用格式。如果你确定场景的几何体和贴图以及光照贴图分辨率设置没有改变（例如，你只是调整 GI 或光源设置），可以禁用此选项以加快下一次渲染速度。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update unmodified lights ===&lt;br /&gt;
如果启用，Bakery 会重新计算自上次渲染以来未改变的光源。如果你只是调整某个光源，不想等待其他光源重新渲染，可以禁用此选项。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update modified lights and GI ===&lt;br /&gt;
如果启用，Bakery 会重新计算自上次渲染以来发生变化的 GI 和光源。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== UV padding: increase only ===&lt;br /&gt;
仅在启用 [[#Asset_UV_Processing|Adjust UV padding]] 时可见。默认情况下，模型资源的最佳 UV 间距仅基于当前加载的场景进行计算。如果同一模型有多个实例使用不同的光照贴图分辨率，最小的分辨率将决定间距，以确保 UV 图块之间的间距足够大，防止相互重叠。然而，在两个不同的独立场景中烘焙同一模型时，为新场景优化可能会破坏之前场景中的 UV。勾选此选项可以防止这种情况发生，即永远不减小间距值，从而始终为曾经烘焙过的最低分辨率实例进行优化。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoise: fix bright edges ===&lt;br /&gt;
[[File:Image19.png|thumb|左：去噪后可见明亮边缘；右：已修复。]]&lt;br /&gt;
仅在 [[#Denoise|Denoise]] 启用时可见。有时用于去噪的神经网络可能会在阴影周围产生明亮边缘，就像应用了锐化效果一样。如果启用此选项，Bakery 会尝试将其滤除。启用后，去噪阶段可能会略微变慢。&lt;br /&gt;
&lt;br /&gt;
此功能也可用于滤除“火花”（fireflies），即光照贴图中偶尔出现的亮点。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Post-packing ===&lt;br /&gt;
有时在渲染场景时，Bakery 会将光照贴图拆分为多个子光照贴图，例如在烘焙不同 LOD 或地形时。&lt;br /&gt;
Post-packing 会尝试通过将这些子光照贴图合并到同一纹理中来最小化最终贴图集数量。&lt;br /&gt;
建议保持此选项启用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Combine with Enlighten real-time GI ===&lt;br /&gt;
如果启用，则在按下 Render 按钮时，Bakery 会首先尝试使用 Enlighten 烘焙以计算实时 GI。之后，将进行常规的 Bakery 光照贴图烘焙过程。烘焙 GI 和实时 GI 将协同工作。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bake on remote server ===&lt;br /&gt;
启用网络烘焙（[[Network baking|Network baking]]）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Presets ===&lt;br /&gt;
当前在 Experimental 模式下的 Render/Update 按钮下显示。&lt;br /&gt;
&lt;br /&gt;
* 点击 '''New''' 将所有当前设置保存到预设文件中。&lt;br /&gt;
* 默认情况下，当一个预设处于激活状态时，所有设置都会被灰显，以防止覆盖预设。&lt;br /&gt;
* 点击 '''Modify preset''' 可更改设置并覆盖预设。&lt;br /&gt;
* 可以通过预设字段切换预设。将其设置为 None 可禁用预设使用。&lt;br /&gt;
&lt;br /&gt;
== 组件 ==&lt;br /&gt;
=== Bakery Lightmap Group Selector ===&lt;br /&gt;
指定对象及其所有子对象使用的 '''Lightmap Group'''。&lt;br /&gt;
Lightmap Group 是 Bakery 用来表示共享同一光照贴图的对象集合的术语。每个组都有属性，告诉 Bakery 如何打包对象、哪些光源影响它们，以及结果是烘焙到纹理还是顶点。&lt;br /&gt;
&lt;br /&gt;
默认情况下，所有静态对象会自动打包到多个光照贴图组（贴图集）中，因此通常无需手动管理。手动定义组仅用于特殊用途，例如：&lt;br /&gt;
&lt;br /&gt;
* 指定某些对象使用 [[Vertex Lightmaps|每顶点光照贴图]] 而非纹理。&lt;br /&gt;
* 使用建模软件中的原始未缩放 UV 烘焙光照贴图。&lt;br /&gt;
* 将关卡的特定区域分组以使用单张光照贴图，从而便于资源流式加载或通过脚本在运行时切换不同的烘焙光照。&lt;br /&gt;
* 使用 Render Selected Groups 按钮仅更新已分组的对象。&lt;br /&gt;
&lt;br /&gt;
要手动定义组，可以创建 '''Lightmap Group Assets'''，方法包括使用 Assets-&amp;gt;Create 菜单，或在组件中使用 Create New 按钮。使用 Create New 按钮时，将根据以下表单创建新的资源：&lt;br /&gt;
&lt;br /&gt;
* Name：要创建的 Lightmap Group 资源的名称。&lt;br /&gt;
* Packing Mode：此选择器定义 Lightmap Group 的打包模式，共有 3 种模式：&lt;br /&gt;
** Original UV：对象及其子对象将使用未修改的 UV 进行烘焙，不执行打包。适用于多个网格共享同一已打包 UV 布局的模型。&lt;br /&gt;
** Pack Atlas：对象及其子对象将打包到专用纹理贴图集中。在 v1.3 之前，每个可打包的子对象都需要有此组件，但现在不再需要。每个子对象将作为单独矩形打包，除非 Bakery 自动检测到子对象有非重叠的子对象，在这种情况下，多个对象可以使用同一个矩形。&lt;br /&gt;
** Vertex：对象及其子对象将使用顶点色烘焙光照而非纹理。注意，需要使用自定义着色器才能生效，例如 [[#Bakery_shaders|Bakery Shader]]。文档中也提供了一个简单的着色器（“Bakery/Simple Vertex Lightmapped”）用于演示和参考。[[Vertex Lightmaps|了解更多关于顶点光照贴图的信息]]。&lt;br /&gt;
* Directional mode：允许你覆盖该组的 [[#Directional mode|directional mode]]。选项与全局相同，Auto 将使用全局设置。&lt;br /&gt;
* Resolution：所需的光照贴图分辨率。&lt;br /&gt;
* Auto-resolution：使用 [[使用手册#Texels_per_unit|Texels Per Unit]] 来确定最接近的二次幂分辨率。&lt;br /&gt;
* Atlas packer：为该组选择 [[使用手册#Atlas_Packer|贴图集打包]] 算法。&lt;br /&gt;
* Bitmask：用于排除光源影响光照贴图的开关列表。每个 Bakery 光源也有一个位掩码设置。光源只会影响与其共享至少一个开关的 Lightmap Group。默认设置意味着所有光源影响所有光照贴图。&lt;br /&gt;
&lt;br /&gt;
[[File:Ts.jpg|thumb|Transparent selfshadow关闭 vs 开启：注意一些单面但背向的多边形如何被正确照亮。]]&lt;br /&gt;
&lt;br /&gt;
如果你有一个被分配了“Pack Atlas”模式的 Lightmap Group，组件上将会出现额外设置：&lt;br /&gt;
&lt;br /&gt;
* Override resolution：覆盖该对象及其子对象在光照贴图中占用的分辨率。&lt;br /&gt;
* Resolution：手动定义的分辨率。例如，如果你有一个分辨率为 512 的光照贴图，并且分配给 4 个对象，同时覆盖分辨率设置为 256，Bakery 将生成一个 512x512 的光照贴图，每个对象正好占据 256x256 的区域。&lt;br /&gt;
&lt;br /&gt;
如果你选择一个 Lightmap Group 资产，将会显示额外的实验性设置：&lt;br /&gt;
* [[Subsurface scattering|Subsurface scattering: (点击阅读更多)]]&lt;br /&gt;
* Normal offset：允许你将光线从表面偏移。这很少有用，主要用于实验目的。&lt;br /&gt;
* Transparent selfshadow：从表面后方发射光线，使其不会在自身投射阴影。对于半透明叶片可能有用。&lt;br /&gt;
* Vertex sampling density，(仅当 Packing Mode 设置为 Vertex 时可用）：默认情况下，每个顶点只计算一个值；如果采样密度 &amp;gt; 0，则会在三角形上分散采样并求平均，从而生成超采样、更平滑的结果。&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Lightmapped Prefab ===&lt;br /&gt;
此组件允许预制件存储光照贴图元数据。这样处理后的预制件可以在任意场景中实例化，无论是在编辑器中还是运行时。&lt;br /&gt;
该组件应直接添加到预制件的根对象上。不支持嵌套预制件。由于预制件在烘焙后会被覆盖（类似于按下“Apply”按钮的效果），因此要求预制件没有任何未应用的更改（子对象不应移动，材质和脚本参数应保持不变等）。如果检测到此类更改，组件界面会显示错误，烘焙后不会保存任何元数据。如果启用了 [[#Warnings|Lightmapped prefab validation]] 警告，所有预制件错误也会在烘焙前以对话框形式显示。&lt;br /&gt;
&lt;br /&gt;
光照贴图预制件支持所有 Bakery 功能，例如 LOD、地形、方向光贴图、RNM、SH、顶点模式和 Shadowmask。要使 Shadowmask 生效，光源也必须是同一预制件的一部分。&lt;br /&gt;
&lt;br /&gt;
{{note| 注意，由于 API 限制，预制件 Shadowmask 仅在 Unity 2017.4 或更高版本中可用。}}&lt;br /&gt;
&lt;br /&gt;
烘焙后，一个名为 “BakeryPrefabLightmapData” 的对象会被添加到预制件中。该对象包含一个脚本，存储应用光照贴图所需的所有数据。&lt;br /&gt;
&lt;br /&gt;
此外，光照贴图预制件允许保存当前渲染设置，并使用两个按钮将其加载回任意已打开的场景：&lt;br /&gt;
&lt;br /&gt;
* Save current render settings to prefab：在该预制件上存储当前渲染设置的副本。&lt;br /&gt;
* Load render settings from prefab：将当前渲染设置设置为预制件中存储的设置。&lt;br /&gt;
  [[File:Upload 2019-9-17 10-32-34.png|thumb|应用预制件]]&lt;br /&gt;
&lt;br /&gt;
烘焙光照贴图预制件时，建议检查：&lt;br /&gt;
&lt;br /&gt;
* 预制件已“应用”。在旧版 Unity 中，点击 Inspector 右上角的 “Apply” 按钮。在新版 Unity 中，点击 “Overrides” 列表，然后选择 “Apply All”。&lt;br /&gt;
* 预制件组件 UI 不显示任何错误。&lt;br /&gt;
* [推荐] 在主窗口启用 “Lightmapped prefab validation” 复选框。点击 Render 时不会显示任何关于预制件的警告对话框。&lt;br /&gt;
&lt;br /&gt;
{{note| 光照贴图以其烘焙所在的场景或所使用的 Lightmap Group 命名（如果有）。在同一场景中烘焙不同预制件时，请确保使用不同命名的 [[使用手册#Bakery_Lightmap_Group_Selector|Lightmap Group]] 或更改 [[使用手册#Output_path|输出路径]]。}}&lt;br /&gt;
&lt;br /&gt;
{{note| 当使用相同模型逐个烘焙多个预制件时，建议将 [[使用手册#Asset_UV_Processing|Asset UV Processing]] 设置为“Don't Change”，以防止修改共享模型的 UV。}}&lt;br /&gt;
&lt;br /&gt;
{{note| Bakery 的预制件工作流程是在 Unity 提供“预制件双击进入视图”功能之前实现的。因此，在隔离预制件视图中光照贴图可能无法正确应用，组件可能显示 “This GameObject is not a prefab” 信息。但在普通场景中使用时应能正常工作。}}&lt;br /&gt;
&lt;br /&gt;
{{note| 当解包已烘焙的预制件并取消与现有光照贴图的关联时，请确保删除保存预制件范围光照贴图/渲染器连接的 BakeryPrefabLightmapData 对象。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Direct Light ===&lt;br /&gt;
[[File:Directlight.jpg|thumb|纯直射光 + GI]]&lt;br /&gt;
[[File:Image4.png|thumb|左：“Shadow Spread” = 0.01，右：0.05。注意阴影从锐利逐渐变模糊的效果。]]&lt;br /&gt;
无限远方向光（例如太阳）。&lt;br /&gt;
&lt;br /&gt;
* Color：光的颜色。&lt;br /&gt;
* Intensity：线性色彩乘数。&lt;br /&gt;
* Shadow Spread：光源尺寸，或者简单说，阴影的模糊度。0 = 阴影最锐利，1 = 阴影最模糊。从技术上讲，它在单条光线与更宽光锥之间插值。&lt;br /&gt;
* Shadow Samples：影响阴影质量。Shadow Spread 值越小，所需样本越少即可得到干净图像。太阳阴影的典型值为 1 到 16。设置为 0 时，该光源的阴影将消失。&lt;br /&gt;
* Bitmask：用于排除此光源对特定 Lightmap Groups 影响的开关列表。&lt;br /&gt;
* Baked contribution：确定应烘焙哪类光照数据。仅在 Indirect 或 Shadowmask 模式可见。可选值：&lt;br /&gt;
** Direct and Indirect：直射光与间接光都完全烘焙。&lt;br /&gt;
** Indirect only：实时光提供直射贡献，仅烘焙间接光。&lt;br /&gt;
** Shadowmask and indirect：实时光提供直射贡献，静态几何体的阴影烘焙到单独贴图，动态与静态阴影混合。间接光正常烘焙。&lt;br /&gt;
** Direct, Indirect, Shadowmask（仅自定义光照）：与直射和间接相同，但 Shadowmask 也生成，可与自定义着色器一起使用。&lt;br /&gt;
* Denoise shadowmask：确定是否对该光源的 Shadowmask 应用去噪。通常不需要，因为阴影噪点不明显，但对非常宽且模糊的阴影（大 Shadow Spread）可能有用。&lt;br /&gt;
* Indirect intensity：非物理 GI 乘数。自然光照应为 1，可根据场景风格调整。&lt;br /&gt;
* Anti-alias：对阴影执行超采样。&lt;br /&gt;
* Texture projection：在光照上投射乘法平铺纹理，可用于模拟远处云影。&lt;br /&gt;
当设置了纹理投影时，可以使用“Tiling”和“Offset”字段调整其缩放和偏移。或者，点击 &amp;quot;Tweak projection in Scene View&amp;quot; 并使用额外的 Gizmo 可视化移动和缩放投影。点击“Render reference frame”可保存光源视角的 PNG，这对于在场景上绘制云影很有用。&lt;br /&gt;
&lt;br /&gt;
如果同一对象同时启用了 Unity 和 Bakery 光源且参数不匹配，会出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match lightmapped to real-time：将 Unity 光源的通用设置复制到 Bakery 光源。&lt;br /&gt;
* Match real-time to lightmapped：将 Bakery 光源的通用设置复制到 Unity 光源。&lt;br /&gt;
&lt;br /&gt;
{{note| 从物理角度看，Bakery 的方向光强度（Intensity）等于照度（Lux）除以 π。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Sky Light ===&lt;br /&gt;
[[File:Skylight.jpg|thumb|纯天空光与 GI]]&lt;br /&gt;
无限远的带阴影环境光（天空）。&lt;br /&gt;
&lt;br /&gt;
* Color: 颜色。&lt;br /&gt;
* Intensity: 线性色彩倍增。&lt;br /&gt;
* Sky texture: 可选的立方体贴图资源，例如 HDRI 全景图，用于从不同方向影响光照颜色。&lt;br /&gt;
  {{note| 旋转天空光的 GameObject 会相应旋转立方体贴图的光照。}}&lt;br /&gt;
* Samples: 影响阴影质量。典型值为 8 到 32。&lt;br /&gt;
* Hemispherical: 如果启用，光照仅来自上方（上半球）。否则来自所有方向。&lt;br /&gt;
* Bitmask: 用于排除此光源影响特定 Lightmap Groups 的开关列表。&lt;br /&gt;
* Baked contribution: 决定应烘焙哪种光照数据。仅在 Indirect/Shadowmask 模式下可见。可能值：&lt;br /&gt;
** Direct and Indirect: 直接和间接光照都将完全烘焙。这是默认且推荐的天空光行为，因为在 Unity 中没有实时版本可以模拟它们。&lt;br /&gt;
** Indirect only: 假定实时光源提供直接贡献；仅烘焙间接光照。&lt;br /&gt;
&lt;br /&gt;
如果天空光的设置与当前场景的天空盒不匹配，将出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match this light to scene skybox: 将活动天空盒材质的通用设置复制到 Bakery 天空光。当前仅支持使用 “Skybox/Cubemap” 或 “Skybox/Bakery skybox” 着色器的天空盒。&lt;br /&gt;
* Match scene skybox to this light: 将 Bakery 天空光的通用设置复制到场景天空盒。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bakery Light Mesh ===&lt;br /&gt;
[[File:Image29.png|thumb|Left: Samples Near = 0, Samples Far = 4096.&amp;lt;br&amp;gt;&lt;br /&gt;
Middle: Samples Near = 0, Samples Far = 128.&amp;lt;br&amp;gt;&lt;br /&gt;
Right: Samples Near = 16, Samples Far = 128.&amp;lt;br&amp;gt;&lt;br /&gt;
请注意，光照效果看起来相似，但使用的合并采样数量更少。]]&lt;br /&gt;
任何形状的自发光网格。应与 Mesh Renderer 组件或设置为 Area 模式的 Light 组件一起使用。&lt;br /&gt;
&lt;br /&gt;
* Color：颜色&lt;br /&gt;
* Intensity：线性颜色倍增器&lt;br /&gt;
* Cutoff：最大光照距离。Bakery 会在接近该限制时额外衰减正确的平方反比衰减。当 Cutoff 值刚好对应物理衰减变得非常暗的位置时效果最佳。Cutoff 可提升烘焙性能，也可以设置为非常高（不可达）的值以保证完全正确性。&lt;br /&gt;
* Self Shadow：决定光源网格自身是否投射阴影。此选项同时启用更精确的光照算法。&lt;br /&gt;
* Samples Near：影响靠近网格的光照质量。典型值为 16 到 64，仅当 Self Shadow 开启时可用。&lt;br /&gt;
* Samples Far：影响远离网格的光照质量。典型值为 4 到 4096。&lt;br /&gt;
&lt;br /&gt;
Bakery 基于光源表面距离混合两种不同的区域光算法。靠近光源时，算法类似 GI，而远处光源被近似为虚拟点光云。&lt;br /&gt;
&lt;br /&gt;
{{note| &amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;光源网格自身不会接收光照，也不会被烘焙到光照贴图中。&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;一个拥有大量多边形的光源网格比烘焙多个简单的光源网格要快&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;如果结果总是脏/噪点较多，可以尝试将 Samples Near 设置为 0，这样只使用 VPL 算法。对于不需要精度的简单光源（如建筑物的窗户光），这也非常有用。&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;}}  &lt;br /&gt;
[[File:Dd99d-QU0AEKFBK.jpg|thumb|弯曲的光源网格]]  &lt;br /&gt;
* Bitmask：用于排除此光源影响特定 Lightmap Groups 的开关列表。  &lt;br /&gt;
* Baked contribution：决定烘焙哪种类型的光照数据。仅在 Indirect 或 Shadowmask 模式下可见。可能的值：  &lt;br /&gt;
** Direct and Indirect：完全烘焙直接和间接光贡献。这是默认且推荐的光源网格行为，因为 Unity 中没有实时版本可以模拟它们。  &lt;br /&gt;
** Indirect only：实时光源提供直接光贡献，仅烘焙间接光。  &lt;br /&gt;
** Shadowmask and Indirect：实时光源提供直接光贡献，但静态几何体的阴影会烘焙到单独的贴图。动态和静态阴影将混合在一起。间接光照将照常烘焙。目前仅 HDRP（和自定义渲染器）支持混合区域光。  &lt;br /&gt;
** Direct, Indirect, Shadowmask (custom lighting only)：与 Direct and Indirect 相同，但同时生成 Shadowmask 并分配用于自定义着色器。  &lt;br /&gt;
* Indirect intensity：非物理 GI 倍增器。自然光照应设为 1，但可修改以实现更风格化的场景。  &lt;br /&gt;
* Shadowmask with falloff：将完整光衰减烘焙进 Shadowmask（仅对自定义着色器有用）。  &lt;br /&gt;
&lt;br /&gt;
如果网格材质和光源设置不匹配，将出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match light to material：将网格材质或区域光的通用设置复制到 Bakery 光源。&lt;br /&gt;
* Match material to light：将 Bakery 光源的通用设置复制到网格材质或区域光。&lt;br /&gt;
&lt;br /&gt;
==== Light Mesh 与自发光材质的区别 ====&lt;br /&gt;
自发光材质：&lt;br /&gt;
&lt;br /&gt;
* 在 GI 计算中传播光线，因此是“免费的”，无论有多少网格是自发光的。&lt;br /&gt;
* 小而明亮的光可能会产生不准确或有噪点的结果，这取决于 GI 的采样数量。&lt;br /&gt;
* 由于 Bakery 中 GI 的工作方式，它必须占用光照贴图空间，因此可能会浪费空间。同时，这意味着自发光对象需要有效的 UV，并且必须启用“投射阴影”。&lt;br /&gt;
&lt;br /&gt;
Light Mesh：&lt;br /&gt;
&lt;br /&gt;
* 光照会为每个光源单独计算，因此比自发光材质慢。&lt;br /&gt;
* 设计用于为小而明亮的光提供干净的光照效果，即使距离很远也能保持效果。&lt;br /&gt;
* 不占用光照贴图空间。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Point Light ===&lt;br /&gt;
[[File:Image11.png|thumb|左：“Shadow Spread” = 0.5，右：“Shadow Spread” = 1。]]&lt;br /&gt;
点光源，没有面积。尽管在物理上不可能，但在游戏中很有用，并且是匹配 Unity 点光源和聚光灯的唯一方式。&lt;br /&gt;
{{note| 聚光灯只是带有额外投影遮罩的点光源。}}&lt;br /&gt;
&lt;br /&gt;
* Color: 颜色&lt;br /&gt;
* Intensity: 线性色彩倍增&lt;br /&gt;
* Shadow spread: 阴影模糊度。虽然点光源没有面积，但通常希望它仍能产生模糊阴影。为此，阴影被模拟为从球形区域光源投射。此参数定义了虚拟球体的半径，直接影响阴影模糊度。&lt;br /&gt;
* Physical falloff: 如果启用，将使用正确的平方反比衰减，并在边界附近额外衰减。否则将尝试模拟 Unity 的衰减。&lt;br /&gt;
* Falloff min size: 详见 [[Point Light Attenuation]] 部分。&lt;br /&gt;
* Range: 如果物理衰减被禁用，则等于 Unity 的光源范围；如果启用，只会在边缘轻微衰减物理衰减。&lt;br /&gt;
* Samples: 影响阴影质量。典型值为 1 到 512。设置为 0 将使该光源的阴影消失。&lt;br /&gt;
  [[File:Image10.png|thumb|从左到右：Omni，Cookie（默认聚光灯纹理），Cubemap，IES。]]&lt;br /&gt;
* Projection mask: 遮罩/Cookie 类型。选项：&lt;br /&gt;
** Omni: 无遮罩，相当于 Unity 的点光源。&lt;br /&gt;
** Cookie: 纹理投影遮罩。附加选项：&lt;br /&gt;
*** Cookie texture: 2D 纹理资源。Bakery 包含原始 Unity 聚光灯纹理（名为 ftUnitySpotTexture），可用于模拟。&lt;br /&gt;
*** Angle: 纹理投影角度（类似 Unity 聚光灯）。&lt;br /&gt;
*** Correct distortion: 修正宽角下直线可见的 cookie 失真。&lt;br /&gt;
** Cubemap: 立方体贴图投影遮罩。附加选项：&lt;br /&gt;
*** Projected cubemap: 立方体贴图资源。&lt;br /&gt;
** IES: 光照由 IES 文件数据调制。附加选项：&lt;br /&gt;
*** IES file: .ies 扩展名文件。&lt;br /&gt;
* Bitmask: 用于排除该光源影响特定 Lightmap Groups 的开关列表。&lt;br /&gt;
* Baked contribution: 决定应烘焙哪种类型的光照数据。仅在 Indirect 或 Shadowmask 模式下可见。可能值：&lt;br /&gt;
** Direct and Indirect: 直接光和间接光完全烘焙。&lt;br /&gt;
** Indirect only: 实时光提供直接光，仅烘焙间接光。&lt;br /&gt;
** Shadowmask and Indirect: 实时光提供直接光，但静态几何体阴影烘焙到单独贴图中，动态和静态阴影混合，间接光正常烘焙。&lt;br /&gt;
** Direct, Indirect, Shadowmask (custom lighting only): 与 Direct and Indirect 相同，同时生成 Shadowmask 用于自定义着色器。&lt;br /&gt;
* Indirect intensity: 该光的非物理 GI 倍增。自然光应为 1，可根据风格化场景修改。&lt;br /&gt;
* Shadowmask with falloff: 将完整光衰减（除距离外）烘焙到 Shadowmask（仅自定义着色器有用）。&lt;br /&gt;
* Legacy sampling: 使用 Bakery 原始更偏置的阴影采样策略。产生无噪点阴影，但宽半影可能出现条纹。禁用后使用无偏但更有噪点的技术。&lt;br /&gt;
&lt;br /&gt;
如果同一对象同时启用了 Unity 和 Bakery 光源，且设置不匹配，则会出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match lightmapped to real-time: 将 Unity 光的常用设置复制到 Bakery 光。&lt;br /&gt;
* Match real-time to lightmapped: 将 Bakery 光的常用设置复制到 Unity 光。&lt;br /&gt;
&lt;br /&gt;
{{note| 从物理角度来看，Bakery 点光源的“Intensity”为 Candela 除以 Pi。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Volume ===&lt;br /&gt;
[[File:Voldemo notlonely.gif|由 BakeryVolume 照亮的动态门（动态 GIF，由 NOTLonely 制作）]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
体积（Volumes）生成存储每个体素光探针的 3D 纹理（L1 球面调和和阴影贴图），使其成为常规 Unity 光探针的可行替代方案。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Unity Light Probes&lt;br /&gt;
! Unity LPPV&lt;br /&gt;
! Bakery Volumes&lt;br /&gt;
|-&lt;br /&gt;
| 手动放置每个光探针&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 否&lt;br /&gt;
|-&lt;br /&gt;
| 在一个物体上插值多个光探针&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 运行时可移动&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 可以放入预制件&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 完整脚本 API&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| “Ringing” 伪影&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 可能出现&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 可能出现&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 已修正&lt;br /&gt;
|-&lt;br /&gt;
| 去噪&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 运行时开销&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | CPU：低开销；GPU：低开销&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | CPU：中等开销；GPU：中等开销&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#e4ead3;&amp;quot; | CPU：无开销；GPU：中等开销&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bakery Volume 是一个与一组 3D 纹理（3 个 SH 纹理和一个可选的 shadowmask）关联的边界盒，使其非常易于使用和编程。Volumes 可以在运行时轻松地交换、移动、加载或卸载，也可以与预制件关联。它们不需要任何 Light Probe Groups 或手动探针布置；整个 Volume 都由均匀的探针体素网格填充。光/影泄漏会自动像处理光照贴图一样修复（尽管对于较大的体素尺寸，薄的双面墙可能会出现问题，但可以通过在不同侧使用不同 Volume 避免）。由于体素网格的均匀特性，也可以对其应用类似光照贴图的降噪，这是常规光探针无法做到的。此外，Bakery 着色器使用 [https://drive.google.com/file/d/1MK6Clw93q8ljijRjb4gQOzzaIjn1uF9Y/view Geomerics] 采样技巧，完全消除了高对比度 HDR 光照下 SH 有时会产生的 “ringing” 伪影。&lt;br /&gt;
&lt;br /&gt;
因此，Volumes 可以为动态物体生成干净、精细、高质量的烘焙光照（即来自静态物体并影响动态物体的光照，而不是相反）。&lt;br /&gt;
&lt;br /&gt;
Volume 方法的唯一缺点是每像素着色开销较高。其开销类似于 LPPV（随着屏幕上受体素影响的像素数量而缩放），但与 LPPV 不同的是，一旦烘焙完成，Volumes 本身不会再更新。多个 Volume 的混合可以通过稍微重叠它们来避免。&lt;br /&gt;
&lt;br /&gt;
====设置 Volume 变换====&lt;br /&gt;
[[File:Bvolgizmo.jpg|thumb|Volume 控制柄]]&lt;br /&gt;
当 BakeryVolume 被添加到一个 GameObject 时，场景视图中会出现一个边界盒控制柄。拖动小方块即可缩放它。&lt;br /&gt;
&lt;br /&gt;
还有其他方法可以更改 Volume 的大小和位置：&lt;br /&gt;
&lt;br /&gt;
* 将任何可渲染的 GameObject 拖入 “Wrap to object” 字段。Volume 会包裹该对象（及其子对象），以将它们完全包含在内。&lt;br /&gt;
* 如果同一个对象上添加了 Box Collider，则会出现 “Set from box collider” 和 “Set to box collider” 按钮。可以用它们快速在 Volume 和 Collider 之间复制数值。&lt;br /&gt;
&lt;br /&gt;
====分辨率====&lt;br /&gt;
当启用 “Adaptive resolution” 时，体素数量由 “Voxels per unit” 控制。禁用它可以手动输入分辨率。对于大多数 1 单位 = 1 米 的游戏来说，一个合理的 “Voxels per unit” 值是 2，但在某些情况下（例如动态门）使用较小但更高分辨率的 Volume 会更有利。&lt;br /&gt;
&lt;br /&gt;
====其他设置====&lt;br /&gt;
&lt;br /&gt;
* Enable baking: 是否需要（重新）计算 Volume？禁用可防止覆盖已有数据。&lt;br /&gt;
* Denoise: 在烘焙 Volume 后应用去噪。推荐用于高分辨率 Volume。避免用于覆盖许多光源的低分辨率 Volume，因为去噪器难以区分实际内容和噪声。&lt;br /&gt;
* Global: 自动将此 Volume 分配给所有兼容 Volume 的 Shader，除非它们有覆盖设置。内部会调用 Shader.SetGlobalTexture()/SetGlobalVector()。&lt;br /&gt;
====使用方法====&lt;br /&gt;
Volumes 可以分配给使用 Volume 感知 Shader 的对象。Bakery 自带实现该功能的 “Bakery Standard” Shader，以及 HDRP 和 URP 的 Shader 图。请查看 example_volumes 场景，了解应用 Volume 的各种方式。&lt;br /&gt;
&lt;br /&gt;
====提示====&lt;br /&gt;
&lt;br /&gt;
* 确保查看示例。&lt;br /&gt;
* 如果两个 Volume 相连，让它们略微重叠。重叠大小应等于最大动态对象的尺寸。这样在运行时简单切换 Volume 就能正常工作。&lt;br /&gt;
* 仅在动态对象实际可达的区域放置 Volume。例如，使用玩家高度限制 Volume 的高度。&lt;br /&gt;
&lt;br /&gt;
====旋转 Volumes====&lt;br /&gt;
如果启用 “Rotate around Y” 选项，Volumes 可以绕 Y 轴旋转。旋转开销非常低，只使用 2 个额外的浮点数据（预计算的角度 sin/cos）。&lt;br /&gt;
&lt;br /&gt;
还可以在运行时旋转 Volumes（Experimental -&amp;gt; “Support rotation after bake” 以及 Bakery Shader 中的类似选项），这种情况下 Volume 必须在初始旋转为零时进行烘焙。&lt;br /&gt;
&lt;br /&gt;
在 URP 中，这种动态旋转可以与 `BakeryURPVolumeGraphRotatable.shadergraph` 一起使用。&lt;br /&gt;
&lt;br /&gt;
对于全局 Volume，动态旋转会在组件被（重新）启用或调用 `volume.SetGlobalParams()` 时更新。使用局部旋转 Volume 时，需要手动在材质或 MaterialPropertyBlock 上设置旋转：&lt;br /&gt;
{{code|&amp;lt;nowiki&amp;gt;SetMatrix(&amp;quot;_VolumeMatrix&amp;quot;, volume.GetMatrix())&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
====技术信息====&lt;br /&gt;
Volumes 可以自动工作（查看示例场景），也可以通过脚本控制其使用方式。&lt;br /&gt;
&lt;br /&gt;
可以通过组件的以下公共属性获取 Volume 数据：&lt;br /&gt;
&lt;br /&gt;
* `bakedTexture0`：存储 L0 RGB 系数和 L1 Z 红色通道在 alpha 中。&lt;br /&gt;
* `bakedTexture1`：存储 L1 X RGB 系数和 L1 Z 绿色通道在 alpha 中。&lt;br /&gt;
* `bakedTexture2`：存储 L1 Y RGB 系数和 L1 Z 蓝色通道在 alpha 中。&lt;br /&gt;
* `bakedMask`：存储体积阴影遮罩。&lt;br /&gt;
* `bounds`：Volume 的包围盒。&lt;br /&gt;
&lt;br /&gt;
所有 `bakedTexture*` 使用 RGBAHalf（每体素 8 字节）格式，mask 使用 ARGB32（每体素 4 字节）。阴影遮罩也可以使用单通道 R8 格式（每体素 1 字节）。&lt;br /&gt;
&lt;br /&gt;
因此 Volume 的字节大小 = width * height * depth * 3 * 8 + （仅当使用阴影遮罩时）width * height * depth * 4（或使用 R8 mask 时为 width * height * depth）。&lt;br /&gt;
&lt;br /&gt;
[[使用手册#Compress_volumes|可以对 Volume 启用纹理压缩]]，使其体积显著减小。&lt;br /&gt;
&lt;br /&gt;
采样 Volume 需要特殊 Shader，这些 Shader 已包含在 Bakery 中。要在自定义 Shader 中添加 Volumes，请查看 HDRP/URP 包中包含的 `BakeryVolume_float()` 函数（位于 `BakeryDecodeLightmap.hlsl`）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Light Filter ===&lt;br /&gt;
[[File:Output optimized.gif|彩色玻璃，如在 &amp;quot;Bakery Real-Time Preview&amp;quot; 中所见。Bakery lightmapper 烘焙出的结果相同。]]&lt;br /&gt;
&lt;br /&gt;
将渲染器标记为光过滤器（Light Filter）。过滤器会用其颜色着色所有直接和间接光线，类似于现实中的光学滤镜，从而实现彩色透明效果（例如彩色玻璃）。唯一的参数是用于着色的纹理。&lt;br /&gt;
&lt;br /&gt;
* 光过滤器对象仍然会像其他对象一样接收光照贴图。&lt;br /&gt;
* 过滤器不会散射或模糊光线（如需此效果，请尝试 [[Subsurface_scattering|Subsurface Scattering]] 或 [[使用手册#Backface_GI|Backface GI]]）。&lt;br /&gt;
* 过滤器可以产生带颜色的阴影。如果灯光使用 [[使用手册#Shadowmask|Shadowmask]] 模式，则结果只会保存 R 通道（因为 Unity 仅支持单通道遮罩）。对于完全烘焙的阴影，则没有限制。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Sector ===&lt;br /&gt;
参见 '''[[Partial_scene_baking|Partial scene baking]]'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Always Render ===&lt;br /&gt;
如果添加到一个物体上，Bakery 在烘焙时将始终考虑该物体，即使它的 Renderer 被禁用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
=== Bakery Pack As Single Square ===&lt;br /&gt;
如果添加到一个物体上，Bakery 会将该物体及其子物体的 UV 视为单个组合方块，在自动图集打包或 Lightmap Group 的 Pack Atlas 模式下，它们之间永远不会被移动。整个子层级将作为一个整体打包。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
=== Bakery Shared LOD UV ===&lt;br /&gt;
如果添加到一个 LODGroup 上，将标记所有同名 LOD 共享同一个光照贴图。默认情况下，每个 LOD 网格会获得独立的光照贴图，占用图集空间；但如果已知同一个物体的 LOD 拥有相似的 UV2（或者在没有 UV2 且 UV1 不重叠的情况下），它们可以映射到图集的同一部分，从而节省内存。&lt;br /&gt;
这种技术也称为 [https://github.com/laurenth-personal/LODLightmapScripts/ Lightmap Stealing]。&lt;br /&gt;
&lt;br /&gt;
= 材质兼容性 =&lt;br /&gt;
&lt;br /&gt;
=== 漫反射和发光 ===&lt;br /&gt;
Bakery 利用 [https://docs.unity3d.com/Manual/MetaPass.html Meta Pass] 系统支持大多数 Unity 材质。所有内置、Surface、URP 和 HDRP 着色器都已经定义了正确的 Meta Pass。&lt;br /&gt;
&lt;br /&gt;
如果你使用的是 Unlit 着色器，需要按照 Unity 文档手动添加 Meta Pass。&lt;br /&gt;
&lt;br /&gt;
如果未定义该 Pass，Bakery 将假定 {{codeVar|_MainTex}}、{{codeVar|_BaseColorMap}} 或 {{codeVar|_Color}}（如果未设置纹理）为材质的漫反射（Albedo），并将 {{codeVar|_EmissionMap}} 和 {{codeVar|_EmissionColor}} 作为发光颜色。&lt;br /&gt;
&lt;br /&gt;
为了使发光生效，[https://docs.unity3d.com/ScriptReference/Material-globalIlluminationFlags.html Material.globalIlluminationFlags] 必须设置为 [https://docs.unity3d.com/ScriptReference/MaterialGlobalIlluminationFlags.BakedEmissive.html MaterialGlobalIlluminationFlags.BakedEmissive]。标准着色器会自动设置此值。&lt;br /&gt;
&lt;br /&gt;
=== 不透明度 ===&lt;br /&gt;
[[File:Upload 2019-1-25 0-4-30.png|thumb|材质参数被转换为 Cutout（默认）]]&lt;br /&gt;
[[File:Alphacombos dither.jpg|thumb|通过“Dither Transparency”选项添加半透明值]]&lt;br /&gt;
[[File:Alphacombos filter.jpg|thumb|Light Filter 组件用于红色平面，生成彩色阴影]]&lt;br /&gt;
&lt;br /&gt;
默认情况下，Bakery 始终从 {{codeVar|_MainTex}}、{{codeVar|_BaseColorMap}} 或 {{codeVar|_BaseMap}} 的 alpha 值获取全分辨率的不透明度，并将其视为 Cutout（1 位透明）。&lt;br /&gt;
&lt;br /&gt;
当启用 '''Dither Transparency''' 选项时，半透明值会自动转换为可变蓝噪声，然后被滤波/模糊，产生部分透明效果（以前可以通过自定义手动抖动贴图实现，但从 v1.97 起自动完成）。&lt;br /&gt;
&lt;br /&gt;
为了使不透明度生效，着色器的 [https://docs.unity3d.com/Manual/SL-SubShaderTags.html RenderType 标签] 必须为以下值之一：&lt;br /&gt;
&lt;br /&gt;
* {{codeVar|Transparent}}&lt;br /&gt;
* {{codeVar|TransparentCutout}}&lt;br /&gt;
* {{codeVar|TreeLeaf}}&lt;br /&gt;
&lt;br /&gt;
如果存在名为 {{codeVar|_Cutoff}} 的属性，它将影响 Cutout（因此 Standard 着色器的 Cutoff 滑块会自动生效）。&lt;br /&gt;
&lt;br /&gt;
在没有 Dither Transparency 的情况下，如果材质 RenderType 为 {{codeVar|Transparent}} 或 {{codeVar|TreeLeaf}}，则 {{codeVar|_Color}} 的 alpha 值会额外修改 Cutoff：&lt;br /&gt;
''finalCutoff = 1 - (1 - cutoff) * alpha''&lt;br /&gt;
&lt;br /&gt;
对于彩色透明效果，请使用 [[Manual#Bakery_Light_Filter|Light Filter]] 组件。&lt;br /&gt;
&lt;br /&gt;
有关漫反射半透明效果，请参考 [[#Backface GI|Backface GI]] 和 [[subsurface scattering]]。&lt;br /&gt;
&lt;br /&gt;
==== Alpha Meta Pass ====&lt;br /&gt;
从 v1.9 起，Bakery 还支持指定基于自定义着色器的透明度，但这需要使用兼容的着色器。要使用 ''Alpha Meta Pass''，需要执行以下步骤：&lt;br /&gt;
&lt;br /&gt;
* 在着色器中添加一个名为 '''BAKERY_META_ALPHA_ENABLE''' 的属性。例如：&lt;br /&gt;
  {{code|&amp;lt;nowiki&amp;gt;[HideInInspector] BAKERY_META_ALPHA_ENABLE (&amp;quot;Enable Bakery alpha meta pass&amp;quot;, Float) = 1.0&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
* 确保 RenderType 标签设置为上文提到的某个值。&lt;br /&gt;
* 声明一个名为 '''META_BAKERY''' 的 Pass。&lt;br /&gt;
* 在该 Pass 中检查 '''unity_MetaFragmentControl.w''' 是否非零，如果是，则返回计算出的透明度值。&lt;br /&gt;
&lt;br /&gt;
示例可参考包内的 ''Baked_Alpha_meta.shader''。&lt;br /&gt;
&lt;br /&gt;
注意：当前 Alpha Meta Pass 需要将 Light Probe Mode 设置为 L1 或 L2。&lt;br /&gt;
&lt;br /&gt;
=== Normal mapping ===&lt;br /&gt;
自定义表面法线可以与 [[#Baked Normal Maps|烘焙法线贴图]] 模式一起使用。不幸的是，Unity 的 Meta Pass 默认不输出法线信息，因此默认情况下，法线取自名为 {{codeVar|_BumpMap}} 的贴图，并通过 {{codeVar|_MainTex_ST}} 进行额外变换。&lt;br /&gt;
&lt;br /&gt;
然而，可以制作完全自定义的着色器，带有高级法线映射功能（例如混合多层法线），并使其兼容烘焙。要实现这一点，需要执行以下步骤：&lt;br /&gt;
&lt;br /&gt;
1. 在着色器中定义一个 Meta Pass，具体方法请参考 [https://docs.unity3d.com/Manual/MetaPass.html#ExampleMetaPassUnity 文档]。&lt;br /&gt;
&lt;br /&gt;
2. 将该 Pass 命名为 {{codeVar|&amp;quot;META_BAKERY&amp;quot;}}，而不仅仅是 {{codeVar|&amp;quot;META&amp;quot;}}。&lt;br /&gt;
&lt;br /&gt;
3. 包含文件 {{codeVar|&amp;quot;BakeryMetaPass.cginc&amp;quot;}}。&lt;br /&gt;
&lt;br /&gt;
4. 添加 {{codeVar|#pragma vertex vert_bakerymt}}。&lt;br /&gt;
&lt;br /&gt;
5. 如果 {{codeVar|unity_MetaFragmentControl.z}} 变量不为 0，着色器应返回世界空间法线。返回的法线应使用 {{codeVar|BakeryEncodeNormal}} 函数编码。&lt;br /&gt;
&lt;br /&gt;
在 Assets/Bakery/examples/shaders 中包含了两个实现了扩展 Meta Pass 的示例着色器。&lt;br /&gt;
&lt;br /&gt;
你也可以复制并修改 BakeryMetaPass.cginc 以满足你的需求，例如从顶点着色器传递额外数据。&lt;br /&gt;
&lt;br /&gt;
=== 正/背面 ===&lt;br /&gt;
无论着色器使用何种剔除模式，Bakery 都将所有背面视为不透明，这意味着任何直接光线都不会穿过背面，就像它不会穿过正面一样。&lt;br /&gt;
然而，如果使用 [[使用手册#Backface_GI|Backface GI]]，背面可以部分发出正面接收到的光照。&lt;br /&gt;
&lt;br /&gt;
= 扩展 Lightmap Parameters 资源 =&lt;br /&gt;
[[File:Lp.jpg|thumb|扩展 Lightmap Parameters]]&lt;br /&gt;
类似于 Bakery 的 [[#Bakery_Lightmap_Group_Selector|Lightmap Group]]，Unity 也有 [https://docs.unity3d.com/Manual/class-LightmapParameters.html Lightmap Parameters]，可以作为资源创建并分配给 Mesh Renderer。它们的逻辑有相似之处也有不同之处：&lt;br /&gt;
&lt;br /&gt;
* Lightmap Group 的主要用途是将多个对象组合到同一个图集。此外，它还允许覆盖该图集的烘焙设置。&lt;br /&gt;
* Lightmap Parameters 主要用于覆盖对象的烘焙设置，但通过使用“Baked Tag”选项，它们也可以影响打包：具有不同 Baked Tag 的对象将永远不会共享同一个图集。&lt;br /&gt;
&lt;br /&gt;
由于有些用户更习惯 Lightmap Parameters 的工作流程，Bakery 现在支持并扩展了它们：&lt;br /&gt;
&lt;br /&gt;
* Bakery 会遵循 Baked Tag 设置。&lt;br /&gt;
* Lightmap Parameters UI 中将显示额外的 Bakery 特定选项。有关其含义，请参考 [[#Bakery_Lightmap_Group_Selector|Lightmap Group]] 部分。&lt;br /&gt;
&lt;br /&gt;
= 项目设置 =&lt;br /&gt;
一些全局设置可以在 Project Settings -&amp;gt; Bakery GPU Lightmapper 中调整（此选项仅在 Unity 2018.3 或更新版本可见；旧版本请编辑 BakeryProjectSettings.asset）：&lt;br /&gt;
&lt;br /&gt;
* Mipmap lightmaps：启用光照贴图的 mipmap。随着图集变小，可能会导致 UV 图块之间的泄漏；另一方面，它可以减少远处高分辨率光照贴图的锯齿。总体上，建议对非常远的物体使用单独烘焙的 LOD 以及较低分辨率的光照贴图。&lt;br /&gt;
* Color file format：常规 HDR 颜色光照贴图的文件格式。可选值：&lt;br /&gt;
**HDR：Radiance HDR 格式（默认）。可用多种图像编辑器打开。&lt;br /&gt;
**Asset：Unity 原生格式。可自定义 mipmap 数量。&lt;br /&gt;
* Mask/Direction file format：额外 LDR 地图的格式，如阴影遮罩或方向数据。可选值：&lt;br /&gt;
**TGA：8 位 Targa（默认）。&lt;br /&gt;
**PNG：8 位 PNG。通常比 TGA 占用更少磁盘空间。&lt;br /&gt;
**Asset：Unity 原生格式。可自定义 mipmap 数量。&lt;br /&gt;
* Compress lightmaps：定义光照贴图资源的压缩行为。压缩光照贴图占用更少的显存，但可能会出现一些视觉伪影（例如色带或色斑），具体取决于压缩类型（移动端压缩问题请参见[[Troubleshooting#I_have_an_Android_project.2C_and_lightmaps_don.27t_look_good|此处]]）。可选值：&lt;br /&gt;
*** Compress but allow overriding asset: 新的光照贴图将在启用压缩的情况下创建。创建后，可以在 Inspector 中更改它们的压缩设置。修改后的值将在重新烘焙后保留（默认）。&lt;br /&gt;
*** Force compress: 始终压缩所有光照贴图。&lt;br /&gt;
*** Force no compress: 始终生成未压缩的光照贴图。&lt;br /&gt;
* High quality direction: 为方向贴图启用“高”质量压缩。实际格式取决于平台。例如在 PC 上，它会从 DXT1 改为 BC7，这提供了更高的质量，但 VRAM 使用量会翻倍。&lt;br /&gt;
* Texel padding (default atlas packer): 定义在使用默认 atlas 打包器时，在光照贴图 atlas 中对象 UV 布局之间添加多少空白 texel。&lt;br /&gt;
* Texel padding (xatlas packer): 同上，但在使用 xatlas 时。&lt;br /&gt;
* Alpha Meta Pass resolution multiplier: 乘以 [[Manual#Alpha_Meta_Pass|Alpha Meta Pass]] 的分辨率，使在低分辨率光照贴图烘焙时仍能实现精确的基于 Shader 的切割效果。&lt;br /&gt;
* Volume render mode: 为所有 [[Manual#Bakery_Volume|Volumes]] 使用哪种 [[Manual#Render_mode|渲染模式]]？Auto 使用当前活动的渲染模式（默认）。&lt;br /&gt;
* Delete previous lightmaps before bake: 在烘焙新光照贴图之前，实际删除该场景中所有之前渲染的光照贴图文件。&lt;br /&gt;
* Log level: 定义烘焙过程中在控制台输出的信息量。可能的值：&lt;br /&gt;
** 0: 不输出任何内容。&lt;br /&gt;
** 1: 仅输出进度信息。&lt;br /&gt;
** 2: 仅输出警告。&lt;br /&gt;
** 3: 输出全部信息。&lt;br /&gt;
* Alternative scale in lightmap: 使渲染器属性 'Scale in Lightmap' 的行为更类似于 Unity 内置的行为。&lt;br /&gt;
* Align to texture compression blocks with xatlas: 使 xatlas 将 chart 对齐到 4x4 块边界，从而获得更适合压缩的结果。&lt;br /&gt;
* Generate smooth positions: 是否应调整采样位置以防止低多边形几何体在平滑法线下产生错误阴影？在使用法线差异极大的几何体时，可在极少数情况下禁用。技术说明见 [https://ndotl.wordpress.com/2018/08/29/baking-artifact-free-lightmaps/#shadowterm 这篇文章]。&lt;br /&gt;
* Smooth positions per-triangle: 是否应按三角形决定平滑/平面位置？在使用法线差异极大的几何体时，可在极少数情况下禁用。&lt;br /&gt;
* Use 'Receive GI' values: 在渲染器上考虑 “Receive Global Illumination” 值。最初 Bakery 会忽略它。&lt;br /&gt;
* Remove ringing in Legacy light probes: 在 Legacy 模式下启用更柔和的光探针卷积，以防止高对比度区域出现伪影。&lt;br /&gt;
* Always render reflection probes: 在每次 Render/Render Light Probes 后自动渲染反射探针。&lt;br /&gt;
* Ringing removal for L2 light probes: 对 [[Manual#Light_probe_mode|L2 光探针]] 应用去振铃处理。值越高，探针光照越平滑；这种平滑可以减少 [[https://docs.unity3d.com/6000.2/Documentation/Manual/light-probes-troubleshooting.html](https://docs.unity3d.com/6000.2/Documentation/Manual/light-probes-troubleshooting.html) 振铃] 伪影（如果存在）。&lt;br /&gt;
* Put menu under Tools: 将 Bakery 菜单放入 Tools 菜单下。&lt;br /&gt;
&lt;br /&gt;
如果任何格式设置为 Asset 且启用 mipmapping，会显示额外选项：&lt;br /&gt;
&lt;br /&gt;
* Maximum mipmap count: 定义 mipmap 的最大数量。例如，设置为 2，则 8K 光照贴图仅有两个额外 mipmap：4K 和 2K。更低分辨率将被省略，从而在 mipmapping 过程中限制泄漏伪影。&lt;br /&gt;
&lt;br /&gt;
= Skinned mesh renderer support =&lt;/div&gt;</summary>
		<author><name>Mr F</name></author>
		
	</entry>
	<entry>
		<id>https://geom.io/bakery/wiki/index.php?title=%E4%BD%BF%E7%94%A8%E6%89%8B%E5%86%8C&amp;diff=1823</id>
		<title>使用手册</title>
		<link rel="alternate" type="text/html" href="https://geom.io/bakery/wiki/index.php?title=%E4%BD%BF%E7%94%A8%E6%89%8B%E5%86%8C&amp;diff=1823"/>
		<updated>2025-11-05T13:45:37Z</updated>

		<summary type="html">&lt;p&gt;Mr F: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== 系统要求 ==&lt;br /&gt;
&lt;br /&gt;
使用 Bakery 需要：&lt;br /&gt;
&lt;br /&gt;
Windows（7 或更高版本）电脑。&lt;br /&gt;
&lt;br /&gt;
Nvidia 显卡。最低支持型号为 Kepler（GeForce 650 或更新型号，Quadro 显卡请查看规格）。&lt;br /&gt;
&lt;br /&gt;
64 位 Unity 编辑器。Bakery 已在 5.6 到 6 及更高版本上测试过，同时也在 Tuanjie 1.6.7 上通过测试。&lt;br /&gt;
&lt;br /&gt;
{{note|系统要求仅适用于开发者的电脑，而非目标平台。使用 Bakery 烘焙的光照贴图可以在任何地方使用。}}&lt;br /&gt;
&lt;br /&gt;
== 前提条件 ==&lt;br /&gt;
* 确保你的项目中没有任何脚本编译错误，否则也会导致 Bakery 的脚本无法编译。&lt;br /&gt;
* 确保你的显卡驱动是最新版本，如有需要请[https://www.nvidia.com/Download/index.aspx?lang=en-US 更新]。&lt;br /&gt;
&lt;br /&gt;
'''请使用 Game-Ready（标准）驱动程序，而不是 “Studio” 驱动。'''&lt;br /&gt;
&lt;br /&gt;
== 安装 ==&lt;br /&gt;
&lt;br /&gt;
1. 通过 [https://assetstore.unity.com/packages/tools/level-design/bakery-gpu-lightmapper-122218 Asset Store] 将 Bakery 导入到你的项目中。&lt;br /&gt;
&lt;br /&gt;
2. Unity 会显示要导入的文件列表。如果这是你第一次使用 Bakery，建议直接 点击 Import（导入）。有经验的用户可以取消选中 examples 文件夹，以进行更轻量的安装。&lt;br /&gt;
&lt;br /&gt;
文件将被导入到 `Assets/Bakery` 和 `Assets/Editor/x64/Bakery` 文件夹中。&lt;br /&gt;
这些文件夹之后可以移动。&lt;br /&gt;
&lt;br /&gt;
3. Unity 随后会导入 Bakery 并编译脚本。此时可能会弹出如下窗口：&lt;br /&gt;
&lt;br /&gt;
[[File:Goahead.png]]&lt;br /&gt;
&lt;br /&gt;
此时你应点击 “Go Ahead”（继续）。&lt;br /&gt;
&lt;br /&gt;
现在你应该能在编辑器中看到新增的 Bakery 菜单：&lt;br /&gt;
&lt;br /&gt;
[[File:bmenu.jpg]]&lt;br /&gt;
&lt;br /&gt;
== 快速开始 ==&lt;br /&gt;
&lt;br /&gt;
1. 添加一些模型或基础体，并将其标记为静态（Static）。&lt;br /&gt;
&lt;br /&gt;
'''用于光照贴图的网格必须具有不重叠的 UV2。如果存在 UV2，则会使用 UV2（否则使用 UV1）。如果你的模型没有为光照贴图进行展开，请在资源中勾选 Generate Lightmap UVs（生成光照贴图 UV）。'''&lt;br /&gt;
Unity 的基础体已经具有正确的 UV2。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Staticmarked.jpg|320px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. 选择方向光（Unity 为你创建的那个），并添加 '''Bakery Direct Light''' 组件。&lt;br /&gt;
   {{note|Bakery 和 Unity 使用独立的光源组件。}}&lt;br /&gt;
&lt;br /&gt;
3. Bakery Direct Light 有许多可调选项，但你可以轻松将其与 Unity 光源匹配。点击 '''Match lightmapped to real-time'''。现在 Bakery 光源的颜色应与 Unity 默认的方向光相同，呈黄色调。&lt;br /&gt;
&lt;br /&gt;
[[File:Matching.jpg|640px]]&lt;br /&gt;
&lt;br /&gt;
{{note|Direct Light 组件可能会提示项目未使用线性光强度。问题在于，Unity 默认会对光源颜色应用伽马校正 [https://twitter.com/guycalledfrank/status/1001108508614553600 不正确]。&lt;br /&gt;
可以通过[https://docs.unity3d.com/ScriptReference/Rendering.GraphicsSettings-lightsUseLinearIntensity.html 脚本]启用正确模式。&lt;br /&gt;
这就是 “Fix” 按钮的作用。如果你已经在非线性光强模式下设置了许多光源，并且不想再次更改它们，可以跳过修复。即使你按了 “Fix”，也可以随时撤销此更改。&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. 要获得带阴影的环境光，请创建 Skylight（Bakery-&amp;gt;Create-&amp;gt;Skylight）。&lt;br /&gt;
&lt;br /&gt;
[[File:Menusky.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. 选择 Skylight，为它设置一些偏蓝的颜色，然后点击 '''Match scene skybox to this light'''。   这将使场景的 skybox 与光照完全匹配。&lt;br /&gt;
   {{note|将 Unity 的 skybox 与 Bakery Skylight 匹配是可选的，但对正确性很有用，可以确保可见环境和引擎内的反射探针与烘焙光照一致。目前此选项仅适用于 Standard 渲染管线。}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Skycomp.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. 点击 Bakery-&amp;gt;Render Lightmap。默认情况下，Full Lighting 模式是激活的。它会烘焙所有光源的直接和间接光照贡献。如果你想将实时阴影与烘焙全局光照（GI）结合使用，请将模式更改为 '''Indirect'''。&lt;br /&gt;
&lt;br /&gt;
[[File:Bakerywindow.jpg]]&lt;br /&gt;
&lt;br /&gt;
{{note| Bakery 可能会提示你正在使用旧的 [https://docs.unity3d.com/Manual/LinearLighting.html gamma mode]。如果你在意光照质量，强烈建议使用线性模式。如果你的项目已经在错误的伽马模式下设置好了，并且不想更改，或者是发布到不支持线性模式的移动设备上，也可以忽略此提示。}}&lt;br /&gt;
&lt;br /&gt;
7. 点击 '''Render'''。&lt;br /&gt;
&lt;br /&gt;
8. 完成！现在你应该已经得到烘焙的全局光照（GI）：&lt;br /&gt;
&lt;br /&gt;
[[File:Bakedgi.jpg]]&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 ==&lt;br /&gt;
&lt;br /&gt;
所有渲染设置都可以通过 Bakery-&amp;gt;Render Lightmap 访问。设置会为每个场景单独保存。Bakery 窗口顶部的选项允许你在 Simple（简单）、Advanced（高级）和 Experimental（实验）设置之间切换，每个后续模式都会显示更多可调选项。对于大多数场景，Simple 模式已经足够，是入门的好方法。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render mode ===  &lt;br /&gt;
定义要烘焙的光照贴图类型。  &lt;br /&gt;
&lt;br /&gt;
===== Full Lighting =====&lt;br /&gt;
烘焙所有 Bakery 光源的完整直接光和间接光。&lt;br /&gt;
{{note|在 2017.3 之前的 Unity 版本中，如果同一对象上同时有 Unity 和 Bakery 组件，你需要手动禁用 Unity 组件以避免亮度加倍。在较新版本中，实时效果会自动对烘焙光源禁用，就像内置光照烘焙器一样。}}&lt;br /&gt;
&lt;br /&gt;
===== Indirect =====&lt;br /&gt;
[[File:Image26.png|thumb|Unity 支持的不同渲染模式对比]]&lt;br /&gt;
基础混合模式。它会查看每个光源上的 Baked Contribution 选择器：如果设置为 ''Direct And Indirect''，则光源会像在 Full Lighting 模式下一样被烘焙。如果设置为 ''Indirect Only''，则只会烘焙该光源的间接光照（GI）。在后一种情况下，你应保持对象上的 Unity 光源和 Bakery 光源同时存在，一个提供实时直接光照，另一个提供预计算的全局光照（GI）。&lt;br /&gt;
&lt;br /&gt;
[[File:Indirectonly.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== Shadowmask =====&lt;br /&gt;
[[File:Image21.png|thumb|左：完全烘焙的光照。中：动态光源 + 烘焙 GI。右：胶囊形阴影、凹凸贴图和高光为动态光照，但立方体阴影和 GI 为烘焙光照。]]&lt;br /&gt;
[[File:Image6.png|thumb|当相机足够远离场景，或者动态阴影被禁用时，场景将呈现如下效果]]&lt;br /&gt;
更高级的混合模式。它通过生成两种类型的光照贴图来工作——一种包含烘焙颜色（如 Indirect 模式），另一种包含静态物体的阴影。它有几个优点：&lt;br /&gt;
* 实时阴影只需渲染少量动态对象，而不是整个场景。&lt;br /&gt;
* 实时阴影与烘焙阴影可以正确融合。&lt;br /&gt;
* 实时光源可以渲染凹凸贴图、高光和其他表面效果，同时仍会被高质量烘焙阴影遮挡。&lt;br /&gt;
[https://docs.unity3d.com/Manual/LightMode-Mixed-Shadowmask.html 更多详情]&lt;br /&gt;
&lt;br /&gt;
要启用此行为，你必须在同一对象上同时存在 Unity 光源和 Bakery 光源，并将 Baked Contribution 设置为 ''Shadowmask and Indirect''。未标记的光源将按 Indirect 模式进行烘焙。&lt;br /&gt;
&lt;br /&gt;
[[File:Smask22.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== Distance Shadowmask =====&lt;br /&gt;
此复选框仅在你选择 Shadowmask 时可见，并且只是切换项目 [https://docs.unity3d.com/Manual/LightMode-Mixed-ShadowmaskMode.html Quality Settings] 中同名的设置。&lt;br /&gt;
[https://docs.unity3d.com/Manual/LightMode-Mixed-DistanceShadowmask.html 更多详情]&lt;br /&gt;
{{note|由于缺少对应的脚本 API，该复选框在 Unity 5.6.x 上不可见。你可以在 Window-&amp;gt;Lighting-&amp;gt;Mixed Lighting-&amp;gt;Lighting Mode 中切换该设置。}}&lt;br /&gt;
{{note|在 Unity 版本 &amp;lt; 2017.3 中，由于 API 限制，渲染 Shadowmask 光照贴图会清除光照探针。烘焙后需要重新渲染光照探针。在较新版本中不应发生此问题。}}&lt;br /&gt;
&lt;br /&gt;
===== Subtractive =====&lt;br /&gt;
&lt;br /&gt;
启用 [https://docs.unity3d.com/Manual/LightMode-Mixed-Subtractive.html Subtractive] 光照模式。&lt;br /&gt;
&lt;br /&gt;
此选项对光照贴图本身没有任何特殊作用，实际上它的工作方式与 Full Lighting 相同。&lt;br /&gt;
&lt;br /&gt;
唯一的区别是，它还会将实时 Unity 光源设置为与 Subtractive 模式兼容（因为无法通过 UI 完成此操作）。&lt;br /&gt;
&lt;br /&gt;
你还需要在 [https://docs.unity3d.com/Manual/GlobalIllumination.html#MixedLighting Unity Lighting] 窗口中额外设置全局减法参数（例如全局阴影颜色）。&lt;br /&gt;
&lt;br /&gt;
===== Ambient Occlusion Only =====&lt;br /&gt;
仅烘焙环境光遮蔽（AO）。如果你很清楚自己在做什么，这可能会有用。请确保设置 [[#Ambient_occlusion|AO 选项]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Directional mode ===&lt;br /&gt;
[[File:Image3.png|thumb|不同方向模式的对比]]&lt;br /&gt;
定义了方向信息的烘焙方式。标准光照贴图每个像素只存储单一颜色，而方向光照贴图为着色器提供了关于该像素周围半球内光照变化的提示。这些数据用于在完全烘焙的区域中结合法线贴图。如果将其应用到内置的 [[#Bakery_shaders|Bakery]] 着色器中，还可以产生**近似高光反射**效果。&lt;br /&gt;
&lt;br /&gt;
===== None =====&lt;br /&gt;
不包含方向数据，每个像素仅有单一颜色。&lt;br /&gt;
&lt;br /&gt;
===== Baked Normal Maps =====&lt;br /&gt;
依然没有方向数据，但在渲染光照贴图时会考虑法线贴图。此方式在运行时没有额外开销。由于光照贴图的分辨率通常低于法线贴图，结果可能显得模糊。其他问题包括：由于缺乏 mipmapping，远处可能出现锯齿，以及降噪步骤可能导致细节被涂抹。要了解如何在此模式下使用具有程序化法线的自定义着色器，请参阅 [[#Normal_mapping|Normal Mapping]] 章节。&lt;br /&gt;
&lt;br /&gt;
===== Dominant Direction =====&lt;br /&gt;
此模式类似于 Unity 中 Enlighten 和 Progressive 烘焙器的实现。它与大多数着色器兼容，仅生成一张额外的贴图，运行时开销极小。缺点是凹凸贴图的效果较弱，略显灰暗，与实时光照下的同一物体相比可能差异较大。&lt;br /&gt;
&lt;br /&gt;
===== RNM =====&lt;br /&gt;
基于最初为《Half-Life 2》开发的 [https://steamcdn-a.akamaihd.net/apps/valve/2004/GDC2004_Half-Life2_Shading.pdf Radiosity Normal Mapping] 技术（相关演示文稿），后来被许多游戏采用（如《Mirror's Edge》）。此模式总共生成三张 HDR 贴图，是内存占用最高的模式之一，但运行时开销仍相对较低。该模式比 Dominant Direction 更精确，能更好地再现表面反差，并能正确处理来自不同角度、具有不同颜色的光照对法线贴图的影响。&lt;br /&gt;
&lt;br /&gt;
===== SH =====&lt;br /&gt;
基于论文《[https://media.contentapi.ea.com/content/dam/eacom/frostbite/files/gdc2018-precomputedgiobalilluminationinfrostbite.pdf Precomputed Global Illumination in Frostbite]》。这是最高质量的模式，能提供更好的表面对比度，并准确表现来自不同方向、不同颜色的光照。总共生成四张贴图，其中仅一张为 HDR，因此比 RNM 占用更少内存。运行时开销略高于 RNM。&lt;br /&gt;
&lt;br /&gt;
===== MonoSH =====&lt;br /&gt;
[[File:FY8Ru8hWIAAdYYH.jpg|thumb|Dominant Direction、完整 SH 与 MonoSH 的尺寸/质量对比]]&lt;br /&gt;
与 SH 类似，但使用单色的 L1 方向系数。表面对比度同样良好，虽然无法准确表现来自不同方向的不同颜色光照，但对多数场景来说已经足够。仅生成一张额外贴图，因此显存占用与带宽需求与 Dominant Direction 相近；事实上更低，因为 Dominant Direction 使用 RGBA 贴图，而 MonoSH 只需 RGB。该贴图通过内置的方向光照贴图系统传递，但''在标准着色器下显示不正确''。请务必使用兼容的着色器。&lt;br /&gt;
&lt;br /&gt;
===== 限制 =====&lt;br /&gt;
&lt;br /&gt;
* RNM 和 SH/MonoSH 只能与 [[#Bakery_shaders|Bakery shader]] 一起使用，或者需要对你的着色器进行调整。&lt;br /&gt;
* 在 RNM 和 SH 模式下，不会生成标准的颜色光照贴图。你需要确保场景中所有材质都使用 Bakery Shader，或者使用 [[#Bakery_Lightmap_Group_Selector|Lightmap Groups]] 将 RNM/SH 对象与其他对象分开。&lt;br /&gt;
* RNM 和 SH 贴图是通过 [https://docs.unity3d.com/ScriptReference/MaterialPropertyBlock.html MaterialPropertyBlock] 应用于对象的，因此在 Unity 的 Lighting 窗口中可能无法完全显示。&lt;br /&gt;
* Dominant Direction、RNM 和 SH/MonoSH 模式可能需要为全局光照（GI）和光照网格使用更多采样，以获得相近的质量。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Texels per unit ===&lt;br /&gt;
[[File:Texelscomp.jpg|thumb|1 vs 10 texels per unit]]&lt;br /&gt;
每个世界单位的光照贴图像素（Texels）近似数量。它会影响生成光照贴图的数量和分辨率。&lt;br /&gt;
&lt;br /&gt;
入门示例值：&lt;br /&gt;
&lt;br /&gt;
* 大型户外区域（城市）：1 - 5&lt;br /&gt;
* 中型户外区域（几条小巷）：10 - 20&lt;br /&gt;
* 高质量室内场景：100&lt;br /&gt;
&lt;br /&gt;
假设场景比例大约为 1 单位 = 1 米。在 Unity 中使用这种比例通常是推荐的，以便更好地导航和进行物理模拟。如果你的比例不同，请相应地调整 Texels。&lt;br /&gt;
&lt;br /&gt;
请注意，Texels Per Unit 是基础分辨率，但每个对象还可以通过 Mesh Renderer 上的 &amp;quot;Scale in Lightmap&amp;quot; 选项以及 Bakery 窗口中的 &amp;quot;Scale per map type&amp;quot; 进行额外调整。&lt;br /&gt;
&lt;br /&gt;
{{note| 将 &amp;quot;Scale in Lightmap&amp;quot; 设置为 0 的对象不会被烘焙，但仍会投射阴影并影响全局光照（GI）。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Max resolution ===&lt;br /&gt;
光照贴图的最大尺寸限制。如果对象无法容纳在单张光照贴图中（根据当前的 Texels Per Unit 值），将会分配额外的光照贴图。同样的四个正方形对象可以使用四张 512x512 的贴图，也可以使用一张 1024x1024 的贴图。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bounces ===&lt;br /&gt;
[[File:Image36.png|thumb|注意更多的反弹会为封闭空间带来更多光照。]]&lt;br /&gt;
定义光线在表面上反弹的次数。通常，对于户外场景（例如城市），较低的反弹次数就足够了，而对于封闭场景（室内、洞穴），则需要较高的反弹次数。&lt;br /&gt;
&lt;br /&gt;
虽然滑块最多限制为 5 次反弹，但可以在数字输入框中输入任意反弹次数。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Samples ===&lt;br /&gt;
[[File:Image7.png|thumb|左：Samples = 4，右：Samples = 16。为了演示，去噪功能已关闭。]]&lt;br /&gt;
影响全局光照（GI）的质量。典型值为 16 到 32。&lt;br /&gt;
&lt;br /&gt;
{{note| 可以输入超出滑块最大值的任意数字，但请注意，该数字表示最终光线数量的平方根，例如 32 表示 1024 条光线，64 表示 4096 条光线，依此类推。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GPU Priority ===&lt;br /&gt;
在 GPU 处理光照贴图时，操作系统和其他软件的响应可能会变慢。此选项允许你在烘焙速度和系统响应之间进行平衡。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render ===&lt;br /&gt;
为所有打开的场景烘焙光照贴图。&lt;br /&gt;
如果 [[使用手册#Light_probe_mode|Light Probe Mode]] 设置为 L1 或 L2，也会烘焙 [https://docs.unity3d.com/Manual/LightProbes.html 光照探针]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Render Light Probes ===&lt;br /&gt;
为所有打开的场景烘焙 [https://docs.unity3d.com/Manual/LightProbes.html 光照探针]。&lt;br /&gt;
&lt;br /&gt;
请注意，要在 Shadowmask 模式下对动态对象获得正确的混合光阴影，你还需要启用 [[使用手册#Occlusion_probes|occlusion probes]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Render Reflection Probes ===&lt;br /&gt;
为所有打开的场景烘焙反射探针。此按钮仅为方便起见，会调用引擎内置的反射探针更新功能。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update Skybox Probe ===&lt;br /&gt;
为当前的 skybox 烘焙全局漫反射和反射探针。与 “Render Reflection Probes” 一样，它仅调用引擎内置函数。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Occlusion probes ===&lt;br /&gt;
在渲染光照探针时，允许 Unity 使用当前选择的内置光照烘焙器烘焙遮挡探针（occlusion probes）。遮挡探针是存储在普通光照探针中的附加数据，可以防止动态对象在阴影区域被错误照亮。目前在 Unity 中无法使用自定义遮挡探针，必须调用内置光照烘焙器来完成此操作。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Warnings ===&lt;br /&gt;
这些选项会在按下任意 Render 按钮后对场景进行验证，并显示警告对话框，询问是否继续或停止烘焙过程。&lt;br /&gt;
&lt;br /&gt;
* Suppress all popups（屏蔽所有弹窗）：按下 Render 后不显示任何对话框。&lt;br /&gt;
* UV validation（UV 验证）：检查所有模型是否具有完全正确的光照贴图 UV，特别是 UV 是否位于 0-1 范围内且不重叠。&lt;br /&gt;
* Overwrite check（覆盖检查）：显示哪些光照贴图文件将被覆盖。&lt;br /&gt;
* Memory check（内存检查）：显示大致所需的视频内存量。&lt;br /&gt;
* Sample count check（采样数检查）：检查是否有光源、GI 或 AO 的采样数不合理，可能导致 GPU 超出可用资源。&lt;br /&gt;
* Lightmapped prefab validation（光照贴图预制体验证）：验证光照贴图预制体，并在某些预制体将被覆盖时发出通知。&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 (Advanced) ==&lt;br /&gt;
=== Light probe mode ===&lt;br /&gt;
更改光照探针的烘焙方式。&lt;br /&gt;
&lt;br /&gt;
* Legacy（传统模式）：使用 Render Light Probes 按钮生成探针。点光源和方向光在光照烘焙器中计算，而区域光/天空光/间接光则通过在每个探针位置渲染立方体贴图收集。结果以 [https://docs.unity3d.com/ScriptReference/Rendering.SphericalHarmonicsL2.html L2] 球谐（spherical harmonics）形式存储。缺点是立方体贴图渲染速度慢，并且在游戏中使用的着色器未物理正确表示光照表面，或者项目为移动平台设置时，光照贴图和探针可能不匹配（Unity 可能会裁剪高强度值）。&lt;br /&gt;
&lt;br /&gt;
* L1：在点击 Render 时，光照探针会与光照贴图一起渲染。此选项提供更高的烘焙性能，并保证探针光照与光照贴图匹配。结果以 L1 球谐形式存储（仍可被普通着色器使用）。使用 [[#Bakery_shaders|Bakery shader]] 的 Non-Linear Light Probe SH 选项可以进一步提升结果。&lt;br /&gt;
&lt;br /&gt;
* L2：更高质量（完整 L2 球谐）。与 L1 一样，会自动与光照贴图一起渲染。与 L1 相比，性能影响可忽略不计。应在所有着色器下显示正常。探针对比度/方向性/振铃去除可通过 Project Settings -&amp;gt; Bakery -&amp;gt; “Ringing removal for L2 light probes” 调整。&lt;br /&gt;
&lt;br /&gt;
'''在 Unity 2019.3 中似乎存在一个 bug，如果启用 Occlusion Probes 选项，Legacy 光照探针的颜色无法正确保存。使用 Occlusion Probes 时，默认且推荐使用 L2 模式。'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Asset UV Processing ===&lt;br /&gt;
配置资产的 UV 间距（padding）调整。可选值：&lt;br /&gt;
&lt;br /&gt;
* Don't change（不更改）：不修改资产。&lt;br /&gt;
* Adjust UV padding（调整 UV 间距）：会查找具有自动生成 UV 的模型（资产上启用 “Generate Lightmap UVs”），并进一步调整它们，使每个网格的 UV 岛之间具有适当间距。导入器设置中的全模型 Pack Margin 会被忽略。系统会根据每个网格的面积和光照贴图分辨率计算出最优值。&lt;br /&gt;
* Adjust UV padding for new meshes only（仅调整新网格的 UV 间距）：与上面相同，但会跳过之前至少调整过一次的模型。&lt;br /&gt;
* Remove UV adjustments（移除 UV 调整）：撤销所有之前的 UV 调整，使自动展开的模型恢复到 Unity 原始展开的样子。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser ===&lt;br /&gt;
设置所需的去噪器。可选值：&lt;br /&gt;
&lt;br /&gt;
* Optix 5：使用 OptiX 5.1 AI 去噪器（之前称为 “Legacy denoiser”）。在 GPU 上运行。支持从 [https://en.wikipedia.org/wiki/Kepler_(microarchitecture) Kepler]（通常是 GeForce 6xx）到 [https://en.wikipedia.org/wiki/Turing_(microarchitecture) Turing]（通常是 GeForce 20xx）的所有显卡。不支持 [https://en.wikipedia.org/wiki/Ampere_(microarchitecture) Ampere]（30xx）。OptiX 5.1 使用嵌入的静态训练数据集，因此不受驱动实现影响。&lt;br /&gt;
&lt;br /&gt;
* Optix 6：使用 OptiX 6.0 AI 去噪器（之前为默认选项）。在 GPU 上运行。在 Kepler（6xx）显卡上似乎无法使用，但在更新的显卡上均可运行，包括 Ampere（30xx）。自 6.0 起，OptiX 去噪器的训练数据集存储在驱动中。在 v442.50 之前，其行为类似于 OptiX 5.1；但之后 NVIDIA [https://forums.developer.nvidia.com/t/optix7-denoiser-different-results-with-different-version-of-drivers/117989/2 更改了数据集]，结果可能有所不同。更新后的数据集有时可能产生网格状图案和更亮的边缘（仍可通过 “Denoise: fix bright edges” 修复），但运行速度更快。&lt;br /&gt;
&lt;br /&gt;
* Optix 7：使用 OptiX 7.2 AI 去噪器。行为类似 OptiX 6.0，但在 Ampere（30xx）上可能支持更好。&lt;br /&gt;
&lt;br /&gt;
* OpenImageDenoise：使用 Intel Open Image Denoise 库。在 CPU 上运行（任何支持 SSE 4.1 的 CPU）。可能略慢于 OptiX，但质量可比。&lt;br /&gt;
&lt;br /&gt;
* OpenImageDenoise2：使用 Intel Open Image Denoise 2，CUDA 模式。在 GPU 上运行，性能与 OptiX 6/7 相当，质量与 CPU 版本相同。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Adjust sample positions ===&lt;br /&gt;
寻找最佳采样位置以防止光照泄漏。算法详情可参考 [https://ndotl.wordpress.com/2018/08/29/baking-artifact-free-lightmaps/#leaks 此处]。在某些情况下（通常是大型且多边形极少、法线平滑的几何体），可能会产生不正确的结果，此时可以将其禁用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Unload scenes before render ===&lt;br /&gt;
在烘焙前卸载 Unity 场景以释放显存。复杂场景仅在编辑器中显示就可能占用数 GB 的显存。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Denoise ===&lt;br /&gt;
[[File:Image31.png|thumb|左：未开启 “Denoise”，右：开启 “Denoise”。]]&lt;br /&gt;
如果启用，将应用去噪算法。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Fix Seams ===&lt;br /&gt;
[[File:Image22.png|thumb|左：缝隙（“Fix Seams” 关闭），右：缝隙已修复（“Fix Seams” 开启）。]]&lt;br /&gt;
如果启用，将尝试融合由 UV 不连续造成的缝隙。对平滑几何体很有用，包括 Unity 默认的球体。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Split by scene ===&lt;br /&gt;
如果同时加载多个场景，并且启用此选项，每个场景将拥有自己的一套光照贴图，而不会与其他场景共享。这对于在运行时流式加载场景时限制纹理占用量非常有用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hole filling ===&lt;br /&gt;
[[File:Holefilling.jpg|thumb|“Hole filling” 关闭与开启的对比。]]&lt;br /&gt;
如果 Atlas Packer 设置为 xatlas，将尝试填充每个孔洞，从而生成更高效的贴图集。对于几何体非常复杂的场景，可能会增加场景导出时间，但通常推荐开启。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Min resolution ===&lt;br /&gt;
光照贴图的最小尺寸限制。可用于在生成大量小而完全填充的光照贴图与少量未完全填充的光照贴图之间进行平衡。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Scale per map type ===&lt;br /&gt;
允许你对颜色贴图、Shadowmask 和方向贴图设置不同的分辨率缩放。例如，常见情况是间接光颜色分辨率较低，但 Shadowmask 分辨率较高。请注意，缩放在光照贴图渲染完成后才应用，因此不会节省烘焙时间。如果启用了 “Adjust UV padding”，间距将基于最低分辨率的贴图，以防止像素泄漏。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Checker preview ===&lt;br /&gt;
[[File:Image12.png|thumb|Checker Preview 功能演示。]]&lt;br /&gt;
如果勾选了 “Show checker” 选项，场景视图将在可见对象上渲染棋盘格图案，以展示光照贴图像素大小。这对于在烘焙前确保 Texels Per Unit 和其他影响分辨率的设置使用合理数值非常有用。&lt;br /&gt;
&lt;br /&gt;
启用 Checker Preview 将强制 Bakery 执行贴图集打包。可能需要一些时间，但通常不会超过几秒钟。在修改场景内容后，按下 “Refresh checker” 可重新打包场景以查看更改。&lt;br /&gt;
&lt;br /&gt;
Checker Preview 还使用随机颜色显示场景将如何被分割到不同的光照贴图中。&lt;br /&gt;
&lt;br /&gt;
{{note| 当前 Checker Preview 无法显示地形的正确像素大小。}}&lt;br /&gt;
&lt;br /&gt;
==== Atlas preview ====&lt;br /&gt;
[[File:FN-TmhRXwAE9i2I.png|thumb|Atlas Preview 功能演示]]&lt;br /&gt;
当 Checker Preview 开启时，会显示 Atlas Preview 按钮。点击它将打开一个新窗口，显示未来光照贴图的 UV 布局。点击 &amp;quot;&amp;lt;&amp;quot; 和 &amp;quot;&amp;gt;&amp;quot; 按钮可浏览各个光照贴图。&lt;br /&gt;
这对于在烘焙前检查打包质量和光照贴图数量非常有用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Emissive boost ===&lt;br /&gt;
将任何表面自发光（emission）乘以此数值。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Indirect boost ===&lt;br /&gt;
将所有反弹光照乘以此数值。作用与光源组件上的 Indirect Intensity 相同，但为全局设置。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Backface GI ===&lt;br /&gt;
[[File:Image30.jpg|thumb|Backface GI]]&lt;br /&gt;
[[File:Image35.png|thumb|左：“Backface GI” = 0，右：“Backface GI” = 1。注意阴影区域接收到更多的绿色光照。]]&lt;br /&gt;
决定光线通过前面表面到达背面并被全局光照（GI）反弹的程度。这对于薄的半透明表面（如树叶）尤其有用。取值范围为 0-1。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Ambient occlusion ===&lt;br /&gt;
[[File:Image15.png|thumb|左：AO intensity = 0，右：AO intensity = 1。]]&lt;br /&gt;
一种简单的非物理环境光遮蔽（Ambient Occlusion，AO），可在最终场景光照上叠加以增强美观效果。&lt;br /&gt;
&lt;br /&gt;
* Intensity（强度）：控制 AO 效果的可见度。值为 0 时禁用该效果。&lt;br /&gt;
* Radius（半径）：决定 AO 效果使用的光线距离。较小的值产生局部遮蔽（角落、褶皱），较大的值则更类似 Skylight，从远处物体产生阴影。&lt;br /&gt;
* Samples（采样数）：影响环境光遮蔽的质量。典型值为 4 到 32。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dither transparency ===&lt;br /&gt;
通过自动抖动不透明度贴图来启用半透明阴影。[[使用手册#Opacity|了解 Bakery 如何处理不透明度贴图]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== RTX Mode ===&lt;br /&gt;
启用 RTX 硬件加速。仅 RTX 显卡可受益于此选项。最低支持的驱动版本为 418。&lt;br /&gt;
&lt;br /&gt;
驱动可以在大多数非 RTX Nvidia 显卡上模拟 RTX 模式，但通常会更慢。&lt;br /&gt;
&lt;br /&gt;
在 Ampere（3xxx）或更新的显卡上，RTX 模式 ''必须'' 启用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Export terrain trees ===&lt;br /&gt;
如果启用，绘制在地形上的树木将影响光照。树木本身不会被烘焙。请注意，在烘焙过程中，每棵树都使用最高可能的 LOD 等级。对于多公里范围且模型高度复杂的森林场景，不建议使用此选项。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Terrain optimization ===&lt;br /&gt;
如果启用（默认），地形将使用独立的光线追踪技术以利用其高程图几何结构。否则，它们将像其他普通网格一样处理。地形优化可以显著减少高分辨率地形所需的内存占用。在某些情况下，它还能加快地形烘焙速度，但在其他情况下（尤其是简单低分辨率地形）可能需要禁用该选项。&lt;br /&gt;
&lt;br /&gt;
{{note| 地形优化当前不兼容绘制的地形洞。需禁用此选项才能使其正常工作。}}&lt;br /&gt;
{{note| 地形优化仅支持非 RTX 模式。}}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Light Mesh batch limit ===&lt;br /&gt;
如果该值大于 0，会将多个 Light Mesh 合并为一个，前提是它们具有相同设置并影响相同的 Lightmap Groups，同时将它们的总采样数限制为该值（例如，如果限制为 64，则可以合并 2 个采样数为 32 的灯光，或 4 个采样数为 16 的灯光，等等）。在拥有大量 Light Mesh 的场景中，这可以提升性能。但设置过高时需小心，因为 GPU 在一次处理过多采样时可能触发操作系统驱动超时。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Compress volumes ===&lt;br /&gt;
如果启用，将对体积 3D 贴图应用纹理压缩，并将 Bakery 着色器切换到相应的采样模式。不推荐对分辨率非常低的体积使用此选项。体积大小可能会被调整为 4 的倍数。&lt;br /&gt;
&lt;br /&gt;
注意事项：&lt;br /&gt;
&lt;br /&gt;
* 目前仅支持压缩为 BC6H/BC7 纹理格式（桌面/主机平台）。&lt;br /&gt;
* 体积压缩仅支持 Unity 2020.1 或更高版本。&lt;br /&gt;
* 目前仅标准渲染管线的 Bakery 着色器支持使用压缩体积贴图。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Samples multiplier ===&lt;br /&gt;
将所有阴影和 GI 采样数乘以指定因子。可用于在草稿质量和最终质量之间快速切换。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Tile size ===&lt;br /&gt;
与 [[#GPU Priority|GPU Priority]] 相同，但这里设置的是贴图块（tile）大小。Bakery 会将光照贴图拆分为更小的块，并一次更新一个块。块越小，GPU 工作被中断的次数越多，系统响应性可能更好。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Temp path ===&lt;br /&gt;
临时文件夹。在渲染过程中，Bakery 可能需要几个 GB 的可用空间。将此文件夹放在 SSD 上相比 HDD 可略微加快渲染速度。目前，该文件夹不会自动清理。你可以随时手动删除其内容（渲染时除外），或通过 Bakery -&amp;gt; Utilities -&amp;gt; Clear cache 清理。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Output path ===&lt;br /&gt;
光照贴图文件夹。所有光照贴图，以及 lightprobe 和顶点颜色（vertex color）资源都将保存在此处。该路径相对于你的 Assets 文件夹。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Use scene named output path ===&lt;br /&gt;
如果启用此选项，输出路径将自动设置为与当前活动场景同名的文件夹（Assets/CurrentSceneName/）。这与 Unity 内置光照贴图烘焙器的行为类似。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render Selected Groups ===&lt;br /&gt;
仅烘焙包含所选对象的 Lightmap Groups。&lt;br /&gt;
不仅仅是所选对象会被重新绘制，它们所属的所有 Lightmap Groups 都会被处理。其他光照贴图不会被更新。如果对象不属于某个手动分配的组，则使用相同光照贴图的场景部分将被重新烘焙。&lt;br /&gt;
&lt;br /&gt;
目前，使用 [[Partial_scene_baking|Sectors]] 进行场景部分烘焙更为方便。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Beep on finish ===&lt;br /&gt;
如果启用，Bakery 在烘焙完成时会播放提示音。&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 (Experimental) ==&lt;br /&gt;
=== Unwrapper ===&lt;br /&gt;
如果启用 [[#Asset_UV_Processing|Adjust UV Padding]]，则定义将使用的展开器（unwrapper）。&lt;br /&gt;
&lt;br /&gt;
* Default：使用 Unity 标准展开器。Bakery 会为每个具有不同间距参数的网格调用 [https://docs.unity3d.com/ScriptReference/Unwrapping.GenerateSecondaryUVSet.html Unwrapping.GenerateSecondaryUVSet]。&lt;br /&gt;
* xatlas：使用 [https://github.com/jpcy jpcy] 的 [https://github.com/jpcy/xatlas xatlas]，这是 [https://github.com/castano Ignacio Castaño] 的 [https://github.com/Thekla/thekla_atlas thekla_atlas] 的修改版。thekla_atlas 曾用于游戏《The Witness》（[http://the-witness.net/news/2010/03/graphics-tech-texture-parameterization/ 参见博客文章]）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Atlas Packer ===&lt;br /&gt;
选择在将不同对象的 UV 布局打包到大型光照贴图集时使用的算法。&lt;br /&gt;
* Default：Bakery 在 v1.7 之前使用的原始算法。&lt;br /&gt;
* xatlas：使用 xatlas。&lt;br /&gt;
&lt;br /&gt;
某些功能仅支持特定的贴图集打包器：&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Default&lt;br /&gt;
! xatlas&lt;br /&gt;
|-&lt;br /&gt;
| [[使用手册#Bakery_Lightmap_Group_Selector|Override resolution]]&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
|-&lt;br /&gt;
| 高效 LOD 打包&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
|-&lt;br /&gt;
| [[使用手册#Hole_filling|Hole filling]]&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
请注意，贴图集打包器（Atlas Packer）也可以为每个 Lightmap Group 单独选择。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Export geometry and maps ===&lt;br /&gt;
如果启用，Bakery 会在渲染前将场景导出为其专用格式。如果你确定场景的几何体和贴图以及光照贴图分辨率设置没有改变（例如，你只是调整 GI 或光源设置），可以禁用此选项以加快下一次渲染速度。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update unmodified lights ===&lt;br /&gt;
如果启用，Bakery 会重新计算自上次渲染以来未改变的光源。如果你只是调整某个光源，不想等待其他光源重新渲染，可以禁用此选项。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update modified lights and GI ===&lt;br /&gt;
如果启用，Bakery 会重新计算自上次渲染以来发生变化的 GI 和光源。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== UV padding: increase only ===&lt;br /&gt;
仅在启用 [[#Asset_UV_Processing|Adjust UV padding]] 时可见。默认情况下，模型资源的最佳 UV 间距仅基于当前加载的场景进行计算。如果同一模型有多个实例使用不同的光照贴图分辨率，最小的分辨率将决定间距，以确保 UV 图块之间的间距足够大，防止相互重叠。然而，在两个不同的独立场景中烘焙同一模型时，为新场景优化可能会破坏之前场景中的 UV。勾选此选项可以防止这种情况发生，即永远不减小间距值，从而始终为曾经烘焙过的最低分辨率实例进行优化。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoise: fix bright edges ===&lt;br /&gt;
[[File:Image19.png|thumb|左：去噪后可见明亮边缘；右：已修复。]]&lt;br /&gt;
仅在 [[#Denoise|Denoise]] 启用时可见。有时用于去噪的神经网络可能会在阴影周围产生明亮边缘，就像应用了锐化效果一样。如果启用此选项，Bakery 会尝试将其滤除。启用后，去噪阶段可能会略微变慢。&lt;br /&gt;
&lt;br /&gt;
此功能也可用于滤除“火花”（fireflies），即光照贴图中偶尔出现的亮点。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Post-packing ===&lt;br /&gt;
有时在渲染场景时，Bakery 会将光照贴图拆分为多个子光照贴图，例如在烘焙不同 LOD 或地形时。&lt;br /&gt;
Post-packing 会尝试通过将这些子光照贴图合并到同一纹理中来最小化最终贴图集数量。&lt;br /&gt;
建议保持此选项启用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Combine with Enlighten real-time GI ===&lt;br /&gt;
如果启用，则在按下 Render 按钮时，Bakery 会首先尝试使用 Enlighten 烘焙以计算实时 GI。之后，将进行常规的 Bakery 光照贴图烘焙过程。烘焙 GI 和实时 GI 将协同工作。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bake on remote server ===&lt;br /&gt;
启用网络烘焙（[[Network baking|Network baking]]）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Presets ===&lt;br /&gt;
当前在 Experimental 模式下的 Render/Update 按钮下显示。&lt;br /&gt;
&lt;br /&gt;
* 点击 '''New''' 将所有当前设置保存到预设文件中。&lt;br /&gt;
* 默认情况下，当一个预设处于激活状态时，所有设置都会被灰显，以防止覆盖预设。&lt;br /&gt;
* 点击 '''Modify preset''' 可更改设置并覆盖预设。&lt;br /&gt;
* 可以通过预设字段切换预设。将其设置为 None 可禁用预设使用。&lt;br /&gt;
&lt;br /&gt;
== 组件 ==&lt;br /&gt;
=== Bakery Lightmap Group Selector ===&lt;br /&gt;
指定对象及其所有子对象使用的 '''Lightmap Group'''。&lt;br /&gt;
Lightmap Group 是 Bakery 用来表示共享同一光照贴图的对象集合的术语。每个组都有属性，告诉 Bakery 如何打包对象、哪些光源影响它们，以及结果是烘焙到纹理还是顶点。&lt;br /&gt;
&lt;br /&gt;
默认情况下，所有静态对象会自动打包到多个光照贴图组（贴图集）中，因此通常无需手动管理。手动定义组仅用于特殊用途，例如：&lt;br /&gt;
&lt;br /&gt;
* 指定某些对象使用 [[Vertex Lightmaps|每顶点光照贴图]] 而非纹理。&lt;br /&gt;
* 使用建模软件中的原始未缩放 UV 烘焙光照贴图。&lt;br /&gt;
* 将关卡的特定区域分组以使用单张光照贴图，从而便于资源流式加载或通过脚本在运行时切换不同的烘焙光照。&lt;br /&gt;
* 使用 Render Selected Groups 按钮仅更新已分组的对象。&lt;br /&gt;
&lt;br /&gt;
要手动定义组，可以创建 '''Lightmap Group Assets'''，方法包括使用 Assets-&amp;gt;Create 菜单，或在组件中使用 Create New 按钮。使用 Create New 按钮时，将根据以下表单创建新的资源：&lt;br /&gt;
&lt;br /&gt;
* Name：要创建的 Lightmap Group 资源的名称。&lt;br /&gt;
* Packing Mode：此选择器定义 Lightmap Group 的打包模式，共有 3 种模式：&lt;br /&gt;
** Original UV：对象及其子对象将使用未修改的 UV 进行烘焙，不执行打包。适用于多个网格共享同一已打包 UV 布局的模型。&lt;br /&gt;
** Pack Atlas：对象及其子对象将打包到专用纹理贴图集中。在 v1.3 之前，每个可打包的子对象都需要有此组件，但现在不再需要。每个子对象将作为单独矩形打包，除非 Bakery 自动检测到子对象有非重叠的子对象，在这种情况下，多个对象可以使用同一个矩形。&lt;br /&gt;
** Vertex：对象及其子对象将使用顶点色烘焙光照而非纹理。注意，需要使用自定义着色器才能生效，例如 [[#Bakery_shaders|Bakery Shader]]。文档中也提供了一个简单的着色器（“Bakery/Simple Vertex Lightmapped”）用于演示和参考。[[Vertex Lightmaps|了解更多关于顶点光照贴图的信息]]。&lt;br /&gt;
* Directional mode：允许你覆盖该组的 [[#Directional mode|directional mode]]。选项与全局相同，Auto 将使用全局设置。&lt;br /&gt;
* Resolution：所需的光照贴图分辨率。&lt;br /&gt;
* Auto-resolution：使用 [[使用手册#Texels_per_unit|Texels Per Unit]] 来确定最接近的二次幂分辨率。&lt;br /&gt;
* Atlas packer：为该组选择 [[使用手册#Atlas_Packer|贴图集打包]] 算法。&lt;br /&gt;
* Bitmask：用于排除光源影响光照贴图的开关列表。每个 Bakery 光源也有一个位掩码设置。光源只会影响与其共享至少一个开关的 Lightmap Group。默认设置意味着所有光源影响所有光照贴图。&lt;br /&gt;
&lt;br /&gt;
[[File:Ts.jpg|thumb|Transparent selfshadow关闭 vs 开启：注意一些单面但背向的多边形如何被正确照亮。]]&lt;br /&gt;
&lt;br /&gt;
如果你有一个被分配了“Pack Atlas”模式的 Lightmap Group，组件上将会出现额外设置：&lt;br /&gt;
&lt;br /&gt;
* Override resolution：覆盖该对象及其子对象在光照贴图中占用的分辨率。&lt;br /&gt;
* Resolution：手动定义的分辨率。例如，如果你有一个分辨率为 512 的光照贴图，并且分配给 4 个对象，同时覆盖分辨率设置为 256，Bakery 将生成一个 512x512 的光照贴图，每个对象正好占据 256x256 的区域。&lt;br /&gt;
&lt;br /&gt;
如果你选择一个 Lightmap Group 资产，将会显示额外的实验性设置：&lt;br /&gt;
* [[Subsurface scattering|Subsurface scattering: (点击阅读更多)]]&lt;br /&gt;
* Normal offset：允许你将光线从表面偏移。这很少有用，主要用于实验目的。&lt;br /&gt;
* Transparent selfshadow：从表面后方发射光线，使其不会在自身投射阴影。对于半透明叶片可能有用。&lt;br /&gt;
* Vertex sampling density，(仅当 Packing Mode 设置为 Vertex 时可用）：默认情况下，每个顶点只计算一个值；如果采样密度 &amp;gt; 0，则会在三角形上分散采样并求平均，从而生成超采样、更平滑的结果。&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Lightmapped Prefab ===&lt;br /&gt;
此组件允许预制件存储光照贴图元数据。这样处理后的预制件可以在任意场景中实例化，无论是在编辑器中还是运行时。&lt;br /&gt;
该组件应直接添加到预制件的根对象上。不支持嵌套预制件。由于预制件在烘焙后会被覆盖（类似于按下“Apply”按钮的效果），因此要求预制件没有任何未应用的更改（子对象不应移动，材质和脚本参数应保持不变等）。如果检测到此类更改，组件界面会显示错误，烘焙后不会保存任何元数据。如果启用了 [[#Warnings|Lightmapped prefab validation]] 警告，所有预制件错误也会在烘焙前以对话框形式显示。&lt;br /&gt;
&lt;br /&gt;
光照贴图预制件支持所有 Bakery 功能，例如 LOD、地形、方向光贴图、RNM、SH、顶点模式和 Shadowmask。要使 Shadowmask 生效，光源也必须是同一预制件的一部分。&lt;br /&gt;
&lt;br /&gt;
{{note| 注意，由于 API 限制，预制件 Shadowmask 仅在 Unity 2017.4 或更高版本中可用。}}&lt;br /&gt;
&lt;br /&gt;
烘焙后，一个名为 “BakeryPrefabLightmapData” 的对象会被添加到预制件中。该对象包含一个脚本，存储应用光照贴图所需的所有数据。&lt;br /&gt;
&lt;br /&gt;
此外，光照贴图预制件允许保存当前渲染设置，并使用两个按钮将其加载回任意已打开的场景：&lt;br /&gt;
&lt;br /&gt;
* Save current render settings to prefab：在该预制件上存储当前渲染设置的副本。&lt;br /&gt;
* Load render settings from prefab：将当前渲染设置设置为预制件中存储的设置。&lt;br /&gt;
  [[File:Upload 2019-9-17 10-32-34.png|thumb|应用预制件]]&lt;br /&gt;
&lt;br /&gt;
烘焙光照贴图预制件时，建议检查：&lt;br /&gt;
&lt;br /&gt;
* 预制件已“应用”。在旧版 Unity 中，点击 Inspector 右上角的 “Apply” 按钮。在新版 Unity 中，点击 “Overrides” 列表，然后选择 “Apply All”。&lt;br /&gt;
* 预制件组件 UI 不显示任何错误。&lt;br /&gt;
* [推荐] 在主窗口启用 “Lightmapped prefab validation” 复选框。点击 Render 时不会显示任何关于预制件的警告对话框。&lt;br /&gt;
&lt;br /&gt;
{{note| 光照贴图以其烘焙所在的场景或所使用的 Lightmap Group 命名（如果有）。在同一场景中烘焙不同预制件时，请确保使用不同命名的 [[使用手册#Bakery_Lightmap_Group_Selector|Lightmap Group]] 或更改 [[使用手册#Output_path|输出路径]]。}}&lt;br /&gt;
&lt;br /&gt;
{{note| 当使用相同模型逐个烘焙多个预制件时，建议将 [[使用手册#Asset_UV_Processing|Asset UV Processing]] 设置为“Don't Change”，以防止修改共享模型的 UV。}}&lt;br /&gt;
&lt;br /&gt;
{{note| Bakery 的预制件工作流程是在 Unity 提供“预制件双击进入视图”功能之前实现的。因此，在隔离预制件视图中光照贴图可能无法正确应用，组件可能显示 “This GameObject is not a prefab” 信息。但在普通场景中使用时应能正常工作。}}&lt;br /&gt;
&lt;br /&gt;
{{note| 当解包已烘焙的预制件并取消与现有光照贴图的关联时，请确保删除保存预制件范围光照贴图/渲染器连接的 BakeryPrefabLightmapData 对象。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Direct Light ===&lt;br /&gt;
[[File:Directlight.jpg|thumb|纯直射光 + GI]]&lt;br /&gt;
[[File:Image4.png|thumb|左：“Shadow Spread” = 0.01，右：0.05。注意阴影从锐利逐渐变模糊的效果。]]&lt;br /&gt;
无限远方向光（例如太阳）。&lt;br /&gt;
&lt;br /&gt;
* Color：光的颜色。&lt;br /&gt;
* Intensity：线性色彩乘数。&lt;br /&gt;
* Shadow Spread：光源尺寸，或者简单说，阴影的模糊度。0 = 阴影最锐利，1 = 阴影最模糊。从技术上讲，它在单条光线与更宽光锥之间插值。&lt;br /&gt;
* Shadow Samples：影响阴影质量。Shadow Spread 值越小，所需样本越少即可得到干净图像。太阳阴影的典型值为 1 到 16。设置为 0 时，该光源的阴影将消失。&lt;br /&gt;
* Bitmask：用于排除此光源对特定 Lightmap Groups 影响的开关列表。&lt;br /&gt;
* Baked contribution：确定应烘焙哪类光照数据。仅在 Indirect 或 Shadowmask 模式可见。可选值：&lt;br /&gt;
** Direct and Indirect：直射光与间接光都完全烘焙。&lt;br /&gt;
** Indirect only：实时光提供直射贡献，仅烘焙间接光。&lt;br /&gt;
** Shadowmask and indirect：实时光提供直射贡献，静态几何体的阴影烘焙到单独贴图，动态与静态阴影混合。间接光正常烘焙。&lt;br /&gt;
** Direct, Indirect, Shadowmask（仅自定义光照）：与直射和间接相同，但 Shadowmask 也生成，可与自定义着色器一起使用。&lt;br /&gt;
* Denoise shadowmask：确定是否对该光源的 Shadowmask 应用去噪。通常不需要，因为阴影噪点不明显，但对非常宽且模糊的阴影（大 Shadow Spread）可能有用。&lt;br /&gt;
* Indirect intensity：非物理 GI 乘数。自然光照应为 1，可根据场景风格调整。&lt;br /&gt;
* Anti-alias：对阴影执行超采样。&lt;br /&gt;
* Texture projection：在光照上投射乘法平铺纹理，可用于模拟远处云影。&lt;br /&gt;
当设置了纹理投影时，可以使用“Tiling”和“Offset”字段调整其缩放和偏移。或者，点击 &amp;quot;Tweak projection in Scene View&amp;quot; 并使用额外的 Gizmo 可视化移动和缩放投影。点击“Render reference frame”可保存光源视角的 PNG，这对于在场景上绘制云影很有用。&lt;br /&gt;
&lt;br /&gt;
如果同一对象同时启用了 Unity 和 Bakery 光源且参数不匹配，会出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match lightmapped to real-time：将 Unity 光源的通用设置复制到 Bakery 光源。&lt;br /&gt;
* Match real-time to lightmapped：将 Bakery 光源的通用设置复制到 Unity 光源。&lt;br /&gt;
&lt;br /&gt;
{{note| 从物理角度看，Bakery 的方向光强度（Intensity）等于照度（Lux）除以 π。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Sky Light ===&lt;br /&gt;
[[File:Skylight.jpg|thumb|纯天空光与 GI]]&lt;br /&gt;
无限远的带阴影环境光（天空）。&lt;br /&gt;
&lt;br /&gt;
* Color: 颜色。&lt;br /&gt;
* Intensity: 线性色彩倍增。&lt;br /&gt;
* Sky texture: 可选的立方体贴图资源，例如 HDRI 全景图，用于从不同方向影响光照颜色。&lt;br /&gt;
  {{note| 旋转天空光的 GameObject 会相应旋转立方体贴图的光照。}}&lt;br /&gt;
* Samples: 影响阴影质量。典型值为 8 到 32。&lt;br /&gt;
* Hemispherical: 如果启用，光照仅来自上方（上半球）。否则来自所有方向。&lt;br /&gt;
* Bitmask: 用于排除此光源影响特定 Lightmap Groups 的开关列表。&lt;br /&gt;
* Baked contribution: 决定应烘焙哪种光照数据。仅在 Indirect/Shadowmask 模式下可见。可能值：&lt;br /&gt;
** Direct and Indirect: 直接和间接光照都将完全烘焙。这是默认且推荐的天空光行为，因为在 Unity 中没有实时版本可以模拟它们。&lt;br /&gt;
** Indirect only: 假定实时光源提供直接贡献；仅烘焙间接光照。&lt;br /&gt;
&lt;br /&gt;
如果天空光的设置与当前场景的天空盒不匹配，将出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match this light to scene skybox: 将活动天空盒材质的通用设置复制到 Bakery 天空光。当前仅支持使用 “Skybox/Cubemap” 或 “Skybox/Bakery skybox” 着色器的天空盒。&lt;br /&gt;
* Match scene skybox to this light: 将 Bakery 天空光的通用设置复制到场景天空盒。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bakery Light Mesh ===&lt;br /&gt;
[[File:Image29.png|thumb|Left: Samples Near = 0, Samples Far = 4096.&amp;lt;br&amp;gt;&lt;br /&gt;
Middle: Samples Near = 0, Samples Far = 128.&amp;lt;br&amp;gt;&lt;br /&gt;
Right: Samples Near = 16, Samples Far = 128.&amp;lt;br&amp;gt;&lt;br /&gt;
请注意，光照效果看起来相似，但使用的合并采样数量更少。]]&lt;br /&gt;
任何形状的自发光网格。应与 Mesh Renderer 组件或设置为 Area 模式的 Light 组件一起使用。&lt;br /&gt;
&lt;br /&gt;
* Color：颜色&lt;br /&gt;
* Intensity：线性颜色倍增器&lt;br /&gt;
* Cutoff：最大光照距离。Bakery 会在接近该限制时额外衰减正确的平方反比衰减。当 Cutoff 值刚好对应物理衰减变得非常暗的位置时效果最佳。Cutoff 可提升烘焙性能，也可以设置为非常高（不可达）的值以保证完全正确性。&lt;br /&gt;
* Self Shadow：决定光源网格自身是否投射阴影。此选项同时启用更精确的光照算法。&lt;br /&gt;
* Samples Near：影响靠近网格的光照质量。典型值为 16 到 64，仅当 Self Shadow 开启时可用。&lt;br /&gt;
* Samples Far：影响远离网格的光照质量。典型值为 4 到 4096。&lt;br /&gt;
&lt;br /&gt;
Bakery 基于光源表面距离混合两种不同的区域光算法。靠近光源时，算法类似 GI，而远处光源被近似为虚拟点光云。&lt;br /&gt;
&lt;br /&gt;
{{note| &amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;光源网格自身不会接收光照，也不会被烘焙到光照贴图中。&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;一个拥有大量多边形的光源网格比烘焙多个简单的光源网格要快&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;如果结果总是脏/噪点较多，可以尝试将 Samples Near 设置为 0，这样只使用 VPL 算法。对于不需要精度的简单光源（如建筑物的窗户光），这也非常有用。&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;}}  &lt;br /&gt;
[[File:Dd99d-QU0AEKFBK.jpg|thumb|弯曲的光源网格]]  &lt;br /&gt;
* Bitmask：用于排除此光源影响特定 Lightmap Groups 的开关列表。  &lt;br /&gt;
* Baked contribution：决定烘焙哪种类型的光照数据。仅在 Indirect 或 Shadowmask 模式下可见。可能的值：  &lt;br /&gt;
** Direct and Indirect：完全烘焙直接和间接光贡献。这是默认且推荐的光源网格行为，因为 Unity 中没有实时版本可以模拟它们。  &lt;br /&gt;
** Indirect only：实时光源提供直接光贡献，仅烘焙间接光。  &lt;br /&gt;
** Shadowmask and Indirect：实时光源提供直接光贡献，但静态几何体的阴影会烘焙到单独的贴图。动态和静态阴影将混合在一起。间接光照将照常烘焙。目前仅 HDRP（和自定义渲染器）支持混合区域光。  &lt;br /&gt;
** Direct, Indirect, Shadowmask (custom lighting only)：与 Direct and Indirect 相同，但同时生成 Shadowmask 并分配用于自定义着色器。  &lt;br /&gt;
* Indirect intensity：非物理 GI 倍增器。自然光照应设为 1，但可修改以实现更风格化的场景。  &lt;br /&gt;
* Shadowmask with falloff：将完整光衰减烘焙进 Shadowmask（仅对自定义着色器有用）。  &lt;br /&gt;
&lt;br /&gt;
如果网格材质和光源设置不匹配，将出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match light to material：将网格材质或区域光的通用设置复制到 Bakery 光源。&lt;br /&gt;
* Match material to light：将 Bakery 光源的通用设置复制到网格材质或区域光。&lt;br /&gt;
&lt;br /&gt;
==== Light Mesh 与自发光材质的区别 ====&lt;br /&gt;
自发光材质：&lt;br /&gt;
&lt;br /&gt;
* 在 GI 计算中传播光线，因此是“免费的”，无论有多少网格是自发光的。&lt;br /&gt;
* 小而明亮的光可能会产生不准确或有噪点的结果，这取决于 GI 的采样数量。&lt;br /&gt;
* 由于 Bakery 中 GI 的工作方式，它必须占用光照贴图空间，因此可能会浪费空间。同时，这意味着自发光对象需要有效的 UV，并且必须启用“投射阴影”。&lt;br /&gt;
&lt;br /&gt;
Light Mesh：&lt;br /&gt;
&lt;br /&gt;
* 光照会为每个光源单独计算，因此比自发光材质慢。&lt;br /&gt;
* 设计用于为小而明亮的光提供干净的光照效果，即使距离很远也能保持效果。&lt;br /&gt;
* 不占用光照贴图空间。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Point Light ===&lt;br /&gt;
[[File:Image11.png|thumb|左：“Shadow Spread” = 0.5，右：“Shadow Spread” = 1。]]&lt;br /&gt;
点光源，没有面积。尽管在物理上不可能，但在游戏中很有用，并且是匹配 Unity 点光源和聚光灯的唯一方式。&lt;br /&gt;
{{note| 聚光灯只是带有额外投影遮罩的点光源。}}&lt;br /&gt;
&lt;br /&gt;
* Color: 颜色&lt;br /&gt;
* Intensity: 线性色彩倍增&lt;br /&gt;
* Shadow spread: 阴影模糊度。虽然点光源没有面积，但通常希望它仍能产生模糊阴影。为此，阴影被模拟为从球形区域光源投射。此参数定义了虚拟球体的半径，直接影响阴影模糊度。&lt;br /&gt;
* Physical falloff: 如果启用，将使用正确的平方反比衰减，并在边界附近额外衰减。否则将尝试模拟 Unity 的衰减。&lt;br /&gt;
* Falloff min size: 详见 [[Point Light Attenuation]] 部分。&lt;br /&gt;
* Range: 如果物理衰减被禁用，则等于 Unity 的光源范围；如果启用，只会在边缘轻微衰减物理衰减。&lt;br /&gt;
* Samples: 影响阴影质量。典型值为 1 到 512。设置为 0 将使该光源的阴影消失。&lt;br /&gt;
  [[File:Image10.png|thumb|从左到右：Omni，Cookie（默认聚光灯纹理），Cubemap，IES。]]&lt;br /&gt;
* Projection mask: 遮罩/Cookie 类型。选项：&lt;br /&gt;
** Omni: 无遮罩，相当于 Unity 的点光源。&lt;br /&gt;
** Cookie: 纹理投影遮罩。附加选项：&lt;br /&gt;
*** Cookie texture: 2D 纹理资源。Bakery 包含原始 Unity 聚光灯纹理（名为 ftUnitySpotTexture），可用于模拟。&lt;br /&gt;
*** Angle: 纹理投影角度（类似 Unity 聚光灯）。&lt;br /&gt;
*** Correct distortion: 修正宽角下直线可见的 cookie 失真。&lt;br /&gt;
** Cubemap: 立方体贴图投影遮罩。附加选项：&lt;br /&gt;
*** Projected cubemap: 立方体贴图资源。&lt;br /&gt;
** IES: 光照由 IES 文件数据调制。附加选项：&lt;br /&gt;
*** IES file: .ies 扩展名文件。&lt;br /&gt;
* Bitmask: 用于排除该光源影响特定 Lightmap Groups 的开关列表。&lt;br /&gt;
* Baked contribution: 决定应烘焙哪种类型的光照数据。仅在 Indirect 或 Shadowmask 模式下可见。可能值：&lt;br /&gt;
** Direct and Indirect: 直接光和间接光完全烘焙。&lt;br /&gt;
** Indirect only: 实时光提供直接光，仅烘焙间接光。&lt;br /&gt;
** Shadowmask and Indirect: 实时光提供直接光，但静态几何体阴影烘焙到单独贴图中，动态和静态阴影混合，间接光正常烘焙。&lt;br /&gt;
** Direct, Indirect, Shadowmask (custom lighting only): 与 Direct and Indirect 相同，同时生成 Shadowmask 用于自定义着色器。&lt;br /&gt;
* Indirect intensity: 该光的非物理 GI 倍增。自然光应为 1，可根据风格化场景修改。&lt;br /&gt;
* Shadowmask with falloff: 将完整光衰减（除距离外）烘焙到 Shadowmask（仅自定义着色器有用）。&lt;br /&gt;
* Legacy sampling: 使用 Bakery 原始更偏置的阴影采样策略。产生无噪点阴影，但宽半影可能出现条纹。禁用后使用无偏但更有噪点的技术。&lt;br /&gt;
&lt;br /&gt;
如果同一对象同时启用了 Unity 和 Bakery 光源，且设置不匹配，则会出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match lightmapped to real-time: 将 Unity 光的常用设置复制到 Bakery 光。&lt;br /&gt;
* Match real-time to lightmapped: 将 Bakery 光的常用设置复制到 Unity 光。&lt;br /&gt;
&lt;br /&gt;
{{note| 从物理角度来看，Bakery 点光源的“Intensity”为 Candela 除以 Pi。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Volume ===&lt;br /&gt;
[[File:Voldemo notlonely.gif|由 BakeryVolume 照亮的动态门（动态 GIF，由 NOTLonely 制作）]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
体积（Volumes）生成存储每个体素光探针的 3D 纹理（L1 球面调和和阴影贴图），使其成为常规 Unity 光探针的可行替代方案。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Unity Light Probes&lt;br /&gt;
! Unity LPPV&lt;br /&gt;
! Bakery Volumes&lt;br /&gt;
|-&lt;br /&gt;
| 手动放置每个光探针&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 否&lt;br /&gt;
|-&lt;br /&gt;
| 在一个物体上插值多个光探针&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 运行时可移动&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 可以放入预制件&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 完整脚本 API&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| “Ringing” 伪影&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 可能出现&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 可能出现&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 已修正&lt;br /&gt;
|-&lt;br /&gt;
| 去噪&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 运行时开销&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | CPU：低开销；GPU：低开销&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | CPU：中等开销；GPU：中等开销&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#e4ead3;&amp;quot; | CPU：无开销；GPU：中等开销&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bakery Volume 是一个与一组 3D 纹理（3 个 SH 纹理和一个可选的 shadowmask）关联的边界盒，使其非常易于使用和编程。Volumes 可以在运行时轻松地交换、移动、加载或卸载，也可以与预制件关联。它们不需要任何 Light Probe Groups 或手动探针布置；整个 Volume 都由均匀的探针体素网格填充。光/影泄漏会自动像处理光照贴图一样修复（尽管对于较大的体素尺寸，薄的双面墙可能会出现问题，但可以通过在不同侧使用不同 Volume 避免）。由于体素网格的均匀特性，也可以对其应用类似光照贴图的降噪，这是常规光探针无法做到的。此外，Bakery 着色器使用 [https://drive.google.com/file/d/1MK6Clw93q8ljijRjb4gQOzzaIjn1uF9Y/view Geomerics] 采样技巧，完全消除了高对比度 HDR 光照下 SH 有时会产生的 “ringing” 伪影。&lt;br /&gt;
&lt;br /&gt;
因此，Volumes 可以为动态物体生成干净、精细、高质量的烘焙光照（即来自静态物体并影响动态物体的光照，而不是相反）。&lt;br /&gt;
&lt;br /&gt;
Volume 方法的唯一缺点是每像素着色开销较高。其开销类似于 LPPV（随着屏幕上受体素影响的像素数量而缩放），但与 LPPV 不同的是，一旦烘焙完成，Volumes 本身不会再更新。多个 Volume 的混合可以通过稍微重叠它们来避免。&lt;br /&gt;
&lt;br /&gt;
====设置 Volume 变换====&lt;br /&gt;
[[File:Bvolgizmo.jpg|thumb|Volume 控制柄]]&lt;br /&gt;
当 BakeryVolume 被添加到一个 GameObject 时，场景视图中会出现一个边界盒控制柄。拖动小方块即可缩放它。&lt;br /&gt;
&lt;br /&gt;
还有其他方法可以更改 Volume 的大小和位置：&lt;br /&gt;
&lt;br /&gt;
* 将任何可渲染的 GameObject 拖入 “Wrap to object” 字段。Volume 会包裹该对象（及其子对象），以将它们完全包含在内。&lt;br /&gt;
* 如果同一个对象上添加了 Box Collider，则会出现 “Set from box collider” 和 “Set to box collider” 按钮。可以用它们快速在 Volume 和 Collider 之间复制数值。&lt;br /&gt;
&lt;br /&gt;
====分辨率====&lt;br /&gt;
当启用 “Adaptive resolution” 时，体素数量由 “Voxels per unit” 控制。禁用它可以手动输入分辨率。对于大多数 1 单位 = 1 米 的游戏来说，一个合理的 “Voxels per unit” 值是 2，但在某些情况下（例如动态门）使用较小但更高分辨率的 Volume 会更有利。&lt;br /&gt;
&lt;br /&gt;
====其他设置====&lt;br /&gt;
&lt;br /&gt;
* Enable baking: 是否需要（重新）计算 Volume？禁用可防止覆盖已有数据。&lt;br /&gt;
* Denoise: 在烘焙 Volume 后应用去噪。推荐用于高分辨率 Volume。避免用于覆盖许多光源的低分辨率 Volume，因为去噪器难以区分实际内容和噪声。&lt;br /&gt;
* Global: 自动将此 Volume 分配给所有兼容 Volume 的 Shader，除非它们有覆盖设置。内部会调用 Shader.SetGlobalTexture()/SetGlobalVector()。&lt;br /&gt;
====使用方法====&lt;br /&gt;
Volumes 可以分配给使用 Volume 感知 Shader 的对象。Bakery 自带实现该功能的 “Bakery Standard” Shader，以及 HDRP 和 URP 的 Shader 图。请查看 example_volumes 场景，了解应用 Volume 的各种方式。&lt;br /&gt;
&lt;br /&gt;
====提示====&lt;br /&gt;
&lt;br /&gt;
* 确保查看示例。&lt;br /&gt;
* 如果两个 Volume 相连，让它们略微重叠。重叠大小应等于最大动态对象的尺寸。这样在运行时简单切换 Volume 就能正常工作。&lt;br /&gt;
* 仅在动态对象实际可达的区域放置 Volume。例如，使用玩家高度限制 Volume 的高度。&lt;br /&gt;
&lt;br /&gt;
====旋转 Volumes====&lt;br /&gt;
如果启用 “Rotate around Y” 选项，Volumes 可以绕 Y 轴旋转。旋转开销非常低，只使用 2 个额外的浮点数据（预计算的角度 sin/cos）。&lt;br /&gt;
&lt;br /&gt;
还可以在运行时旋转 Volumes（Experimental -&amp;gt; “Support rotation after bake” 以及 Bakery Shader 中的类似选项），这种情况下 Volume 必须在初始旋转为零时进行烘焙。&lt;br /&gt;
&lt;br /&gt;
在 URP 中，这种动态旋转可以与 `BakeryURPVolumeGraphRotatable.shadergraph` 一起使用。&lt;br /&gt;
&lt;br /&gt;
对于全局 Volume，动态旋转会在组件被（重新）启用或调用 `volume.SetGlobalParams()` 时更新。使用局部旋转 Volume 时，需要手动在材质或 MaterialPropertyBlock 上设置旋转：&lt;br /&gt;
{{code|&amp;lt;nowiki&amp;gt;SetMatrix(&amp;quot;_VolumeMatrix&amp;quot;, volume.GetMatrix())&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
====技术信息====&lt;br /&gt;
Volumes 可以自动工作（查看示例场景），也可以通过脚本控制其使用方式。&lt;br /&gt;
&lt;br /&gt;
可以通过组件的以下公共属性获取 Volume 数据：&lt;br /&gt;
&lt;br /&gt;
* `bakedTexture0`：存储 L0 RGB 系数和 L1 Z 红色通道在 alpha 中。&lt;br /&gt;
* `bakedTexture1`：存储 L1 X RGB 系数和 L1 Z 绿色通道在 alpha 中。&lt;br /&gt;
* `bakedTexture2`：存储 L1 Y RGB 系数和 L1 Z 蓝色通道在 alpha 中。&lt;br /&gt;
* `bakedMask`：存储体积阴影遮罩。&lt;br /&gt;
* `bounds`：Volume 的包围盒。&lt;br /&gt;
&lt;br /&gt;
所有 `bakedTexture*` 使用 RGBAHalf（每体素 8 字节）格式，mask 使用 ARGB32（每体素 4 字节）。阴影遮罩也可以使用单通道 R8 格式（每体素 1 字节）。&lt;br /&gt;
&lt;br /&gt;
因此 Volume 的字节大小 = width * height * depth * 3 * 8 + （仅当使用阴影遮罩时）width * height * depth * 4（或使用 R8 mask 时为 width * height * depth）。&lt;br /&gt;
&lt;br /&gt;
[[使用手册#Compress_volumes|可以对 Volume 启用纹理压缩]]，使其体积显著减小。&lt;br /&gt;
&lt;br /&gt;
采样 Volume 需要特殊 Shader，这些 Shader 已包含在 Bakery 中。要在自定义 Shader 中添加 Volumes，请查看 HDRP/URP 包中包含的 `BakeryVolume_float()` 函数（位于 `BakeryDecodeLightmap.hlsl`）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Light Filter ===&lt;br /&gt;
[[File:Output optimized.gif|彩色玻璃，如在 &amp;quot;Bakery Real-Time Preview&amp;quot; 中所见。Bakery lightmapper 烘焙出的结果相同。]]&lt;br /&gt;
&lt;br /&gt;
将渲染器标记为光过滤器（Light Filter）。过滤器会用其颜色着色所有直接和间接光线，类似于现实中的光学滤镜，从而实现彩色透明效果（例如彩色玻璃）。唯一的参数是用于着色的纹理。&lt;br /&gt;
&lt;br /&gt;
* 光过滤器对象仍然会像其他对象一样接收光照贴图。&lt;br /&gt;
* 过滤器不会散射或模糊光线（如需此效果，请尝试 [[Subsurface_scattering|Subsurface Scattering]] 或 [[使用手册#Backface_GI|Backface GI]]）。&lt;br /&gt;
* 过滤器可以产生带颜色的阴影。如果灯光使用 [[使用手册#Shadowmask|Shadowmask]] 模式，则结果只会保存 R 通道（因为 Unity 仅支持单通道遮罩）。对于完全烘焙的阴影，则没有限制。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Sector ===&lt;br /&gt;
参见 '''[[Partial_scene_baking|Partial scene baking]]'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Always Render ===&lt;br /&gt;
如果添加到一个物体上，Bakery 在烘焙时将始终考虑该物体，即使它的 Renderer 被禁用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
=== Bakery Pack As Single Square ===&lt;br /&gt;
如果添加到一个物体上，Bakery 会将该物体及其子物体的 UV 视为单个组合方块，在自动图集打包或 Lightmap Group 的 Pack Atlas 模式下，它们之间永远不会被移动。整个子层级将作为一个整体打包。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
=== Bakery Shared LOD UV ===&lt;br /&gt;
如果添加到一个 LODGroup 上，将标记所有同名 LOD 共享同一个光照贴图。默认情况下，每个 LOD 网格会获得独立的光照贴图，占用图集空间；但如果已知同一个物体的 LOD 拥有相似的 UV2（或者在没有 UV2 且 UV1 不重叠的情况下），它们可以映射到图集的同一部分，从而节省内存。&lt;br /&gt;
这种技术也称为 [https://github.com/laurenth-personal/LODLightmapScripts/ Lightmap Stealing]。&lt;br /&gt;
&lt;br /&gt;
= 材质兼容性 =&lt;br /&gt;
&lt;br /&gt;
=== 漫反射和发光 ===&lt;br /&gt;
Bakery 利用 [https://docs.unity3d.com/Manual/MetaPass.html Meta Pass] 系统支持大多数 Unity 材质。所有内置、Surface、URP 和 HDRP 着色器都已经定义了正确的 Meta Pass。&lt;br /&gt;
&lt;br /&gt;
如果你使用的是 Unlit 着色器，需要按照 Unity 文档手动添加 Meta Pass。&lt;br /&gt;
&lt;br /&gt;
如果未定义该 Pass，Bakery 将假定 {{codeVar|_MainTex}}、{{codeVar|_BaseColorMap}} 或 {{codeVar|_Color}}（如果未设置纹理）为材质的漫反射（Albedo），并将 {{codeVar|_EmissionMap}} 和 {{codeVar|_EmissionColor}} 作为发光颜色。&lt;br /&gt;
&lt;br /&gt;
为了使发光生效，[https://docs.unity3d.com/ScriptReference/Material-globalIlluminationFlags.html Material.globalIlluminationFlags] 必须设置为 [https://docs.unity3d.com/ScriptReference/MaterialGlobalIlluminationFlags.BakedEmissive.html MaterialGlobalIlluminationFlags.BakedEmissive]。标准着色器会自动设置此值。&lt;br /&gt;
&lt;br /&gt;
=== 不透明度 ===&lt;br /&gt;
[[File:Upload 2019-1-25 0-4-30.png|thumb|材质参数被转换为 Cutout（默认）]]&lt;br /&gt;
[[File:Alphacombos dither.jpg|thumb|通过“Dither Transparency”选项添加半透明值]]&lt;br /&gt;
[[File:Alphacombos filter.jpg|thumb|Light Filter 组件用于红色平面，生成彩色阴影]]&lt;br /&gt;
&lt;br /&gt;
默认情况下，Bakery 始终从 {{codeVar|_MainTex}}、{{codeVar|_BaseColorMap}} 或 {{codeVar|_BaseMap}} 的 alpha 值获取全分辨率的不透明度，并将其视为 Cutout（1 位透明）。&lt;br /&gt;
&lt;br /&gt;
当启用 '''Dither Transparency''' 选项时，半透明值会自动转换为可变蓝噪声，然后被滤波/模糊，产生部分透明效果（以前可以通过自定义手动抖动贴图实现，但从 v1.97 起自动完成）。&lt;br /&gt;
&lt;br /&gt;
为了使不透明度生效，着色器的 [https://docs.unity3d.com/Manual/SL-SubShaderTags.html RenderType 标签] 必须为以下值之一：&lt;br /&gt;
&lt;br /&gt;
* {{codeVar|Transparent}}&lt;br /&gt;
* {{codeVar|TransparentCutout}}&lt;br /&gt;
* {{codeVar|TreeLeaf}}&lt;br /&gt;
&lt;br /&gt;
如果存在名为 {{codeVar|_Cutoff}} 的属性，它将影响 Cutout（因此 Standard 着色器的 Cutoff 滑块会自动生效）。&lt;br /&gt;
&lt;br /&gt;
在没有 Dither Transparency 的情况下，如果材质 RenderType 为 {{codeVar|Transparent}} 或 {{codeVar|TreeLeaf}}，则 {{codeVar|_Color}} 的 alpha 值会额外修改 Cutoff：&lt;br /&gt;
''finalCutoff = 1 - (1 - cutoff) * alpha''&lt;br /&gt;
&lt;br /&gt;
对于彩色透明效果，请使用 [[Manual#Bakery_Light_Filter|Light Filter]] 组件。&lt;br /&gt;
&lt;br /&gt;
有关漫反射半透明效果，请参考 [[#Backface GI|Backface GI]] 和 [[subsurface scattering]]。&lt;br /&gt;
&lt;br /&gt;
==== Alpha Meta Pass ====&lt;br /&gt;
从 v1.9 起，Bakery 还支持指定基于自定义着色器的透明度，但这需要使用兼容的着色器。要使用 ''Alpha Meta Pass''，需要执行以下步骤：&lt;br /&gt;
&lt;br /&gt;
* 在着色器中添加一个名为 '''BAKERY_META_ALPHA_ENABLE''' 的属性。例如：&lt;br /&gt;
  {{code|&amp;lt;nowiki&amp;gt;[HideInInspector] BAKERY_META_ALPHA_ENABLE (&amp;quot;Enable Bakery alpha meta pass&amp;quot;, Float) = 1.0&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
* 确保 RenderType 标签设置为上文提到的某个值。&lt;br /&gt;
* 声明一个名为 '''META_BAKERY''' 的 Pass。&lt;br /&gt;
* 在该 Pass 中检查 '''unity_MetaFragmentControl.w''' 是否非零，如果是，则返回计算出的透明度值。&lt;br /&gt;
&lt;br /&gt;
示例可参考包内的 ''Baked_Alpha_meta.shader''。&lt;br /&gt;
&lt;br /&gt;
注意：当前 Alpha Meta Pass 需要将 Light Probe Mode 设置为 L1 或 L2。&lt;br /&gt;
&lt;br /&gt;
=== Normal mapping ===&lt;br /&gt;
自定义表面法线可以与 [[#Baked Normal Maps|烘焙法线贴图]] 模式一起使用。不幸的是，Unity 的 Meta Pass 默认不输出法线信息，因此默认情况下，法线取自名为 {{codeVar|_BumpMap}} 的贴图，并通过 {{codeVar|_MainTex_ST}} 进行额外变换。&lt;br /&gt;
&lt;br /&gt;
然而，可以制作完全自定义的着色器，带有高级法线映射功能（例如混合多层法线），并使其兼容烘焙。要实现这一点，需要执行以下步骤：&lt;br /&gt;
&lt;br /&gt;
1. 在着色器中定义一个 Meta Pass，具体方法请参考 [https://docs.unity3d.com/Manual/MetaPass.html#ExampleMetaPassUnity 文档]。&lt;br /&gt;
&lt;br /&gt;
2. 将该 Pass 命名为 {{codeVar|&amp;quot;META_BAKERY&amp;quot;}}，而不仅仅是 {{codeVar|&amp;quot;META&amp;quot;}}。&lt;br /&gt;
&lt;br /&gt;
3. 包含文件 {{codeVar|&amp;quot;BakeryMetaPass.cginc&amp;quot;}}。&lt;br /&gt;
&lt;br /&gt;
4. 添加 {{codeVar|#pragma vertex vert_bakerymt}}。&lt;br /&gt;
&lt;br /&gt;
5. 如果 {{codeVar|unity_MetaFragmentControl.z}} 变量不为 0，着色器应返回世界空间法线。返回的法线应使用 {{codeVar|BakeryEncodeNormal}} 函数编码。&lt;br /&gt;
&lt;br /&gt;
在 Assets/Bakery/examples/shaders 中包含了两个实现了扩展 Meta Pass 的示例着色器。&lt;br /&gt;
&lt;br /&gt;
你也可以复制并修改 BakeryMetaPass.cginc 以满足你的需求，例如从顶点着色器传递额外数据。&lt;br /&gt;
&lt;br /&gt;
=== 正/背面 ===&lt;br /&gt;
无论着色器使用何种剔除模式，Bakery 都将所有背面视为不透明，这意味着任何直接光线都不会穿过背面，就像它不会穿过正面一样。&lt;br /&gt;
然而，如果使用 [[使用手册#Backface_GI|Backface GI]]，背面可以部分发出正面接收到的光照。&lt;br /&gt;
&lt;br /&gt;
= 扩展 Lightmap Parameters 资源 =&lt;br /&gt;
[[File:Lp.jpg|thumb|扩展 Lightmap Parameters]]&lt;br /&gt;
类似于 Bakery 的 [[#Bakery_Lightmap_Group_Selector|Lightmap Group]]，Unity 也有 [https://docs.unity3d.com/Manual/class-LightmapParameters.html Lightmap Parameters]，可以作为资源创建并分配给 Mesh Renderer。它们的逻辑有相似之处也有不同之处：&lt;br /&gt;
&lt;br /&gt;
* Lightmap Group 的主要用途是将多个对象组合到同一个图集。此外，它还允许覆盖该图集的烘焙设置。&lt;br /&gt;
* Lightmap Parameters 主要用于覆盖对象的烘焙设置，但通过使用“Baked Tag”选项，它们也可以影响打包：具有不同 Baked Tag 的对象将永远不会共享同一个图集。&lt;br /&gt;
&lt;br /&gt;
由于有些用户更习惯 Lightmap Parameters 的工作流程，Bakery 现在支持并扩展了它们：&lt;br /&gt;
&lt;br /&gt;
* Bakery 会遵循 Baked Tag 设置。&lt;br /&gt;
* Lightmap Parameters UI 中将显示额外的 Bakery 特定选项。有关其含义，请参考 [[#Bakery_Lightmap_Group_Selector|Lightmap Group]] 部分。&lt;/div&gt;</summary>
		<author><name>Mr F</name></author>
		
	</entry>
	<entry>
		<id>https://geom.io/bakery/wiki/index.php?title=%E4%BD%BF%E7%94%A8%E6%89%8B%E5%86%8C&amp;diff=1822</id>
		<title>使用手册</title>
		<link rel="alternate" type="text/html" href="https://geom.io/bakery/wiki/index.php?title=%E4%BD%BF%E7%94%A8%E6%89%8B%E5%86%8C&amp;diff=1822"/>
		<updated>2025-11-05T13:38:50Z</updated>

		<summary type="html">&lt;p&gt;Mr F: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== 系统要求 ==&lt;br /&gt;
&lt;br /&gt;
使用 Bakery 需要：&lt;br /&gt;
&lt;br /&gt;
Windows（7 或更高版本）电脑。&lt;br /&gt;
&lt;br /&gt;
Nvidia 显卡。最低支持型号为 Kepler（GeForce 650 或更新型号，Quadro 显卡请查看规格）。&lt;br /&gt;
&lt;br /&gt;
64 位 Unity 编辑器。Bakery 已在 5.6 到 6 及更高版本上测试过，同时也在 Tuanjie 1.6.7 上通过测试。&lt;br /&gt;
&lt;br /&gt;
{{note|系统要求仅适用于开发者的电脑，而非目标平台。使用 Bakery 烘焙的光照贴图可以在任何地方使用。}}&lt;br /&gt;
&lt;br /&gt;
== 前提条件 ==&lt;br /&gt;
* 确保你的项目中没有任何脚本编译错误，否则也会导致 Bakery 的脚本无法编译。&lt;br /&gt;
* 确保你的显卡驱动是最新版本，如有需要请[https://www.nvidia.com/Download/index.aspx?lang=en-US 更新]。&lt;br /&gt;
&lt;br /&gt;
'''请使用 Game-Ready（标准）驱动程序，而不是 “Studio” 驱动。'''&lt;br /&gt;
&lt;br /&gt;
== 安装 ==&lt;br /&gt;
&lt;br /&gt;
1. 通过 [https://assetstore.unity.com/packages/tools/level-design/bakery-gpu-lightmapper-122218 Asset Store] 将 Bakery 导入到你的项目中。&lt;br /&gt;
&lt;br /&gt;
2. Unity 会显示要导入的文件列表。如果这是你第一次使用 Bakery，建议直接 点击 Import（导入）。有经验的用户可以取消选中 examples 文件夹，以进行更轻量的安装。&lt;br /&gt;
&lt;br /&gt;
文件将被导入到 `Assets/Bakery` 和 `Assets/Editor/x64/Bakery` 文件夹中。&lt;br /&gt;
这些文件夹之后可以移动。&lt;br /&gt;
&lt;br /&gt;
3. Unity 随后会导入 Bakery 并编译脚本。此时可能会弹出如下窗口：&lt;br /&gt;
&lt;br /&gt;
[[File:Goahead.png]]&lt;br /&gt;
&lt;br /&gt;
此时你应点击 “Go Ahead”（继续）。&lt;br /&gt;
&lt;br /&gt;
现在你应该能在编辑器中看到新增的 Bakery 菜单：&lt;br /&gt;
&lt;br /&gt;
[[File:bmenu.jpg]]&lt;br /&gt;
&lt;br /&gt;
== 快速开始 ==&lt;br /&gt;
&lt;br /&gt;
1. 添加一些模型或基础体，并将其标记为静态（Static）。&lt;br /&gt;
&lt;br /&gt;
'''用于光照贴图的网格必须具有不重叠的 UV2。如果存在 UV2，则会使用 UV2（否则使用 UV1）。如果你的模型没有为光照贴图进行展开，请在资源中勾选 Generate Lightmap UVs（生成光照贴图 UV）。'''&lt;br /&gt;
Unity 的基础体已经具有正确的 UV2。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Staticmarked.jpg|320px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. 选择方向光（Unity 为你创建的那个），并添加 '''Bakery Direct Light''' 组件。&lt;br /&gt;
   {{note|Bakery 和 Unity 使用独立的光源组件。}}&lt;br /&gt;
&lt;br /&gt;
3. Bakery Direct Light 有许多可调选项，但你可以轻松将其与 Unity 光源匹配。点击 '''Match lightmapped to real-time'''。现在 Bakery 光源的颜色应与 Unity 默认的方向光相同，呈黄色调。&lt;br /&gt;
&lt;br /&gt;
[[File:Matching.jpg|640px]]&lt;br /&gt;
&lt;br /&gt;
{{note|Direct Light 组件可能会提示项目未使用线性光强度。问题在于，Unity 默认会对光源颜色应用伽马校正 [https://twitter.com/guycalledfrank/status/1001108508614553600 不正确]。&lt;br /&gt;
可以通过[https://docs.unity3d.com/ScriptReference/Rendering.GraphicsSettings-lightsUseLinearIntensity.html 脚本]启用正确模式。&lt;br /&gt;
这就是 “Fix” 按钮的作用。如果你已经在非线性光强模式下设置了许多光源，并且不想再次更改它们，可以跳过修复。即使你按了 “Fix”，也可以随时撤销此更改。&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. 要获得带阴影的环境光，请创建 Skylight（Bakery-&amp;gt;Create-&amp;gt;Skylight）。&lt;br /&gt;
&lt;br /&gt;
[[File:Menusky.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. 选择 Skylight，为它设置一些偏蓝的颜色，然后点击 '''Match scene skybox to this light'''。   这将使场景的 skybox 与光照完全匹配。&lt;br /&gt;
   {{note|将 Unity 的 skybox 与 Bakery Skylight 匹配是可选的，但对正确性很有用，可以确保可见环境和引擎内的反射探针与烘焙光照一致。目前此选项仅适用于 Standard 渲染管线。}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Skycomp.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. 点击 Bakery-&amp;gt;Render Lightmap。默认情况下，Full Lighting 模式是激活的。它会烘焙所有光源的直接和间接光照贡献。如果你想将实时阴影与烘焙全局光照（GI）结合使用，请将模式更改为 '''Indirect'''。&lt;br /&gt;
&lt;br /&gt;
[[File:Bakerywindow.jpg]]&lt;br /&gt;
&lt;br /&gt;
{{note| Bakery 可能会提示你正在使用旧的 [https://docs.unity3d.com/Manual/LinearLighting.html gamma mode]。如果你在意光照质量，强烈建议使用线性模式。如果你的项目已经在错误的伽马模式下设置好了，并且不想更改，或者是发布到不支持线性模式的移动设备上，也可以忽略此提示。}}&lt;br /&gt;
&lt;br /&gt;
7. 点击 '''Render'''。&lt;br /&gt;
&lt;br /&gt;
8. 完成！现在你应该已经得到烘焙的全局光照（GI）：&lt;br /&gt;
&lt;br /&gt;
[[File:Bakedgi.jpg]]&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 ==&lt;br /&gt;
&lt;br /&gt;
所有渲染设置都可以通过 Bakery-&amp;gt;Render Lightmap 访问。设置会为每个场景单独保存。Bakery 窗口顶部的选项允许你在 Simple（简单）、Advanced（高级）和 Experimental（实验）设置之间切换，每个后续模式都会显示更多可调选项。对于大多数场景，Simple 模式已经足够，是入门的好方法。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render mode ===  &lt;br /&gt;
定义要烘焙的光照贴图类型。  &lt;br /&gt;
&lt;br /&gt;
===== Full Lighting =====&lt;br /&gt;
烘焙所有 Bakery 光源的完整直接光和间接光。&lt;br /&gt;
{{note|在 2017.3 之前的 Unity 版本中，如果同一对象上同时有 Unity 和 Bakery 组件，你需要手动禁用 Unity 组件以避免亮度加倍。在较新版本中，实时效果会自动对烘焙光源禁用，就像内置光照烘焙器一样。}}&lt;br /&gt;
&lt;br /&gt;
===== Indirect =====&lt;br /&gt;
[[File:Image26.png|thumb|Unity 支持的不同渲染模式对比]]&lt;br /&gt;
基础混合模式。它会查看每个光源上的 Baked Contribution 选择器：如果设置为 ''Direct And Indirect''，则光源会像在 Full Lighting 模式下一样被烘焙。如果设置为 ''Indirect Only''，则只会烘焙该光源的间接光照（GI）。在后一种情况下，你应保持对象上的 Unity 光源和 Bakery 光源同时存在，一个提供实时直接光照，另一个提供预计算的全局光照（GI）。&lt;br /&gt;
&lt;br /&gt;
[[File:Indirectonly.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== Shadowmask =====&lt;br /&gt;
[[File:Image21.png|thumb|左：完全烘焙的光照。中：动态光源 + 烘焙 GI。右：胶囊形阴影、凹凸贴图和高光为动态光照，但立方体阴影和 GI 为烘焙光照。]]&lt;br /&gt;
[[File:Image6.png|thumb|当相机足够远离场景，或者动态阴影被禁用时，场景将呈现如下效果]]&lt;br /&gt;
更高级的混合模式。它通过生成两种类型的光照贴图来工作——一种包含烘焙颜色（如 Indirect 模式），另一种包含静态物体的阴影。它有几个优点：&lt;br /&gt;
* 实时阴影只需渲染少量动态对象，而不是整个场景。&lt;br /&gt;
* 实时阴影与烘焙阴影可以正确融合。&lt;br /&gt;
* 实时光源可以渲染凹凸贴图、高光和其他表面效果，同时仍会被高质量烘焙阴影遮挡。&lt;br /&gt;
[https://docs.unity3d.com/Manual/LightMode-Mixed-Shadowmask.html 更多详情]&lt;br /&gt;
&lt;br /&gt;
要启用此行为，你必须在同一对象上同时存在 Unity 光源和 Bakery 光源，并将 Baked Contribution 设置为 ''Shadowmask and Indirect''。未标记的光源将按 Indirect 模式进行烘焙。&lt;br /&gt;
&lt;br /&gt;
[[File:Smask22.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== Distance Shadowmask =====&lt;br /&gt;
此复选框仅在你选择 Shadowmask 时可见，并且只是切换项目 [https://docs.unity3d.com/Manual/LightMode-Mixed-ShadowmaskMode.html Quality Settings] 中同名的设置。&lt;br /&gt;
[https://docs.unity3d.com/Manual/LightMode-Mixed-DistanceShadowmask.html 更多详情]&lt;br /&gt;
{{note|由于缺少对应的脚本 API，该复选框在 Unity 5.6.x 上不可见。你可以在 Window-&amp;gt;Lighting-&amp;gt;Mixed Lighting-&amp;gt;Lighting Mode 中切换该设置。}}&lt;br /&gt;
{{note|在 Unity 版本 &amp;lt; 2017.3 中，由于 API 限制，渲染 Shadowmask 光照贴图会清除光照探针。烘焙后需要重新渲染光照探针。在较新版本中不应发生此问题。}}&lt;br /&gt;
&lt;br /&gt;
===== Subtractive =====&lt;br /&gt;
&lt;br /&gt;
启用 [https://docs.unity3d.com/Manual/LightMode-Mixed-Subtractive.html Subtractive] 光照模式。&lt;br /&gt;
&lt;br /&gt;
此选项对光照贴图本身没有任何特殊作用，实际上它的工作方式与 Full Lighting 相同。&lt;br /&gt;
&lt;br /&gt;
唯一的区别是，它还会将实时 Unity 光源设置为与 Subtractive 模式兼容（因为无法通过 UI 完成此操作）。&lt;br /&gt;
&lt;br /&gt;
你还需要在 [https://docs.unity3d.com/Manual/GlobalIllumination.html#MixedLighting Unity Lighting] 窗口中额外设置全局减法参数（例如全局阴影颜色）。&lt;br /&gt;
&lt;br /&gt;
===== Ambient Occlusion Only =====&lt;br /&gt;
仅烘焙环境光遮蔽（AO）。如果你很清楚自己在做什么，这可能会有用。请确保设置 [[#Ambient_occlusion|AO 选项]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Directional mode ===&lt;br /&gt;
[[File:Image3.png|thumb|不同方向模式的对比]]&lt;br /&gt;
定义了方向信息的烘焙方式。标准光照贴图每个像素只存储单一颜色，而方向光照贴图为着色器提供了关于该像素周围半球内光照变化的提示。这些数据用于在完全烘焙的区域中结合法线贴图。如果将其应用到内置的 [[#Bakery_shaders|Bakery]] 着色器中，还可以产生**近似高光反射**效果。&lt;br /&gt;
&lt;br /&gt;
===== None =====&lt;br /&gt;
不包含方向数据，每个像素仅有单一颜色。&lt;br /&gt;
&lt;br /&gt;
===== Baked Normal Maps =====&lt;br /&gt;
依然没有方向数据，但在渲染光照贴图时会考虑法线贴图。此方式在运行时没有额外开销。由于光照贴图的分辨率通常低于法线贴图，结果可能显得模糊。其他问题包括：由于缺乏 mipmapping，远处可能出现锯齿，以及降噪步骤可能导致细节被涂抹。要了解如何在此模式下使用具有程序化法线的自定义着色器，请参阅 [[#Normal_mapping|Normal Mapping]] 章节。&lt;br /&gt;
&lt;br /&gt;
===== Dominant Direction =====&lt;br /&gt;
此模式类似于 Unity 中 Enlighten 和 Progressive 烘焙器的实现。它与大多数着色器兼容，仅生成一张额外的贴图，运行时开销极小。缺点是凹凸贴图的效果较弱，略显灰暗，与实时光照下的同一物体相比可能差异较大。&lt;br /&gt;
&lt;br /&gt;
===== RNM =====&lt;br /&gt;
基于最初为《Half-Life 2》开发的 [https://steamcdn-a.akamaihd.net/apps/valve/2004/GDC2004_Half-Life2_Shading.pdf Radiosity Normal Mapping] 技术（相关演示文稿），后来被许多游戏采用（如《Mirror's Edge》）。此模式总共生成三张 HDR 贴图，是内存占用最高的模式之一，但运行时开销仍相对较低。该模式比 Dominant Direction 更精确，能更好地再现表面反差，并能正确处理来自不同角度、具有不同颜色的光照对法线贴图的影响。&lt;br /&gt;
&lt;br /&gt;
===== SH =====&lt;br /&gt;
基于论文《[https://media.contentapi.ea.com/content/dam/eacom/frostbite/files/gdc2018-precomputedgiobalilluminationinfrostbite.pdf Precomputed Global Illumination in Frostbite]》。这是最高质量的模式，能提供更好的表面对比度，并准确表现来自不同方向、不同颜色的光照。总共生成四张贴图，其中仅一张为 HDR，因此比 RNM 占用更少内存。运行时开销略高于 RNM。&lt;br /&gt;
&lt;br /&gt;
===== MonoSH =====&lt;br /&gt;
[[File:FY8Ru8hWIAAdYYH.jpg|thumb|Dominant Direction、完整 SH 与 MonoSH 的尺寸/质量对比]]&lt;br /&gt;
与 SH 类似，但使用单色的 L1 方向系数。表面对比度同样良好，虽然无法准确表现来自不同方向的不同颜色光照，但对多数场景来说已经足够。仅生成一张额外贴图，因此显存占用与带宽需求与 Dominant Direction 相近；事实上更低，因为 Dominant Direction 使用 RGBA 贴图，而 MonoSH 只需 RGB。该贴图通过内置的方向光照贴图系统传递，但''在标准着色器下显示不正确''。请务必使用兼容的着色器。&lt;br /&gt;
&lt;br /&gt;
===== 限制 =====&lt;br /&gt;
&lt;br /&gt;
* RNM 和 SH/MonoSH 只能与 [[#Bakery_shaders|Bakery shader]] 一起使用，或者需要对你的着色器进行调整。&lt;br /&gt;
* 在 RNM 和 SH 模式下，不会生成标准的颜色光照贴图。你需要确保场景中所有材质都使用 Bakery Shader，或者使用 [[#Bakery_Lightmap_Group_Selector|Lightmap Groups]] 将 RNM/SH 对象与其他对象分开。&lt;br /&gt;
* RNM 和 SH 贴图是通过 [https://docs.unity3d.com/ScriptReference/MaterialPropertyBlock.html MaterialPropertyBlock] 应用于对象的，因此在 Unity 的 Lighting 窗口中可能无法完全显示。&lt;br /&gt;
* Dominant Direction、RNM 和 SH/MonoSH 模式可能需要为全局光照（GI）和光照网格使用更多采样，以获得相近的质量。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Texels per unit ===&lt;br /&gt;
[[File:Texelscomp.jpg|thumb|1 vs 10 texels per unit]]&lt;br /&gt;
每个世界单位的光照贴图像素（Texels）近似数量。它会影响生成光照贴图的数量和分辨率。&lt;br /&gt;
&lt;br /&gt;
入门示例值：&lt;br /&gt;
&lt;br /&gt;
* 大型户外区域（城市）：1 - 5&lt;br /&gt;
* 中型户外区域（几条小巷）：10 - 20&lt;br /&gt;
* 高质量室内场景：100&lt;br /&gt;
&lt;br /&gt;
假设场景比例大约为 1 单位 = 1 米。在 Unity 中使用这种比例通常是推荐的，以便更好地导航和进行物理模拟。如果你的比例不同，请相应地调整 Texels。&lt;br /&gt;
&lt;br /&gt;
请注意，Texels Per Unit 是基础分辨率，但每个对象还可以通过 Mesh Renderer 上的 &amp;quot;Scale in Lightmap&amp;quot; 选项以及 Bakery 窗口中的 &amp;quot;Scale per map type&amp;quot; 进行额外调整。&lt;br /&gt;
&lt;br /&gt;
{{note| 将 &amp;quot;Scale in Lightmap&amp;quot; 设置为 0 的对象不会被烘焙，但仍会投射阴影并影响全局光照（GI）。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Max resolution ===&lt;br /&gt;
光照贴图的最大尺寸限制。如果对象无法容纳在单张光照贴图中（根据当前的 Texels Per Unit 值），将会分配额外的光照贴图。同样的四个正方形对象可以使用四张 512x512 的贴图，也可以使用一张 1024x1024 的贴图。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bounces ===&lt;br /&gt;
[[File:Image36.png|thumb|注意更多的反弹会为封闭空间带来更多光照。]]&lt;br /&gt;
定义光线在表面上反弹的次数。通常，对于户外场景（例如城市），较低的反弹次数就足够了，而对于封闭场景（室内、洞穴），则需要较高的反弹次数。&lt;br /&gt;
&lt;br /&gt;
虽然滑块最多限制为 5 次反弹，但可以在数字输入框中输入任意反弹次数。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Samples ===&lt;br /&gt;
[[File:Image7.png|thumb|左：Samples = 4，右：Samples = 16。为了演示，去噪功能已关闭。]]&lt;br /&gt;
影响全局光照（GI）的质量。典型值为 16 到 32。&lt;br /&gt;
&lt;br /&gt;
{{note| 可以输入超出滑块最大值的任意数字，但请注意，该数字表示最终光线数量的平方根，例如 32 表示 1024 条光线，64 表示 4096 条光线，依此类推。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GPU Priority ===&lt;br /&gt;
在 GPU 处理光照贴图时，操作系统和其他软件的响应可能会变慢。此选项允许你在烘焙速度和系统响应之间进行平衡。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render ===&lt;br /&gt;
为所有打开的场景烘焙光照贴图。&lt;br /&gt;
如果 [[使用手册#Light_probe_mode|Light Probe Mode]] 设置为 L1 或 L2，也会烘焙 [https://docs.unity3d.com/Manual/LightProbes.html 光照探针]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Render Light Probes ===&lt;br /&gt;
为所有打开的场景烘焙 [https://docs.unity3d.com/Manual/LightProbes.html 光照探针]。&lt;br /&gt;
&lt;br /&gt;
请注意，要在 Shadowmask 模式下对动态对象获得正确的混合光阴影，你还需要启用 [[使用手册#Occlusion_probes|occlusion probes]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Render Reflection Probes ===&lt;br /&gt;
为所有打开的场景烘焙反射探针。此按钮仅为方便起见，会调用引擎内置的反射探针更新功能。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update Skybox Probe ===&lt;br /&gt;
为当前的 skybox 烘焙全局漫反射和反射探针。与 “Render Reflection Probes” 一样，它仅调用引擎内置函数。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Occlusion probes ===&lt;br /&gt;
在渲染光照探针时，允许 Unity 使用当前选择的内置光照烘焙器烘焙遮挡探针（occlusion probes）。遮挡探针是存储在普通光照探针中的附加数据，可以防止动态对象在阴影区域被错误照亮。目前在 Unity 中无法使用自定义遮挡探针，必须调用内置光照烘焙器来完成此操作。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Warnings ===&lt;br /&gt;
这些选项会在按下任意 Render 按钮后对场景进行验证，并显示警告对话框，询问是否继续或停止烘焙过程。&lt;br /&gt;
&lt;br /&gt;
* Suppress all popups（屏蔽所有弹窗）：按下 Render 后不显示任何对话框。&lt;br /&gt;
* UV validation（UV 验证）：检查所有模型是否具有完全正确的光照贴图 UV，特别是 UV 是否位于 0-1 范围内且不重叠。&lt;br /&gt;
* Overwrite check（覆盖检查）：显示哪些光照贴图文件将被覆盖。&lt;br /&gt;
* Memory check（内存检查）：显示大致所需的视频内存量。&lt;br /&gt;
* Sample count check（采样数检查）：检查是否有光源、GI 或 AO 的采样数不合理，可能导致 GPU 超出可用资源。&lt;br /&gt;
* Lightmapped prefab validation（光照贴图预制体验证）：验证光照贴图预制体，并在某些预制体将被覆盖时发出通知。&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 (Advanced) ==&lt;br /&gt;
=== Light probe mode ===&lt;br /&gt;
更改光照探针的烘焙方式。&lt;br /&gt;
&lt;br /&gt;
* Legacy（传统模式）：使用 Render Light Probes 按钮生成探针。点光源和方向光在光照烘焙器中计算，而区域光/天空光/间接光则通过在每个探针位置渲染立方体贴图收集。结果以 [https://docs.unity3d.com/ScriptReference/Rendering.SphericalHarmonicsL2.html L2] 球谐（spherical harmonics）形式存储。缺点是立方体贴图渲染速度慢，并且在游戏中使用的着色器未物理正确表示光照表面，或者项目为移动平台设置时，光照贴图和探针可能不匹配（Unity 可能会裁剪高强度值）。&lt;br /&gt;
&lt;br /&gt;
* L1：在点击 Render 时，光照探针会与光照贴图一起渲染。此选项提供更高的烘焙性能，并保证探针光照与光照贴图匹配。结果以 L1 球谐形式存储（仍可被普通着色器使用）。使用 [[#Bakery_shaders|Bakery shader]] 的 Non-Linear Light Probe SH 选项可以进一步提升结果。&lt;br /&gt;
&lt;br /&gt;
* L2：更高质量（完整 L2 球谐）。与 L1 一样，会自动与光照贴图一起渲染。与 L1 相比，性能影响可忽略不计。应在所有着色器下显示正常。探针对比度/方向性/振铃去除可通过 Project Settings -&amp;gt; Bakery -&amp;gt; “Ringing removal for L2 light probes” 调整。&lt;br /&gt;
&lt;br /&gt;
'''在 Unity 2019.3 中似乎存在一个 bug，如果启用 Occlusion Probes 选项，Legacy 光照探针的颜色无法正确保存。使用 Occlusion Probes 时，默认且推荐使用 L2 模式。'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Asset UV Processing ===&lt;br /&gt;
配置资产的 UV 间距（padding）调整。可选值：&lt;br /&gt;
&lt;br /&gt;
* Don't change（不更改）：不修改资产。&lt;br /&gt;
* Adjust UV padding（调整 UV 间距）：会查找具有自动生成 UV 的模型（资产上启用 “Generate Lightmap UVs”），并进一步调整它们，使每个网格的 UV 岛之间具有适当间距。导入器设置中的全模型 Pack Margin 会被忽略。系统会根据每个网格的面积和光照贴图分辨率计算出最优值。&lt;br /&gt;
* Adjust UV padding for new meshes only（仅调整新网格的 UV 间距）：与上面相同，但会跳过之前至少调整过一次的模型。&lt;br /&gt;
* Remove UV adjustments（移除 UV 调整）：撤销所有之前的 UV 调整，使自动展开的模型恢复到 Unity 原始展开的样子。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser ===&lt;br /&gt;
设置所需的去噪器。可选值：&lt;br /&gt;
&lt;br /&gt;
* Optix 5：使用 OptiX 5.1 AI 去噪器（之前称为 “Legacy denoiser”）。在 GPU 上运行。支持从 [https://en.wikipedia.org/wiki/Kepler_(microarchitecture) Kepler]（通常是 GeForce 6xx）到 [https://en.wikipedia.org/wiki/Turing_(microarchitecture) Turing]（通常是 GeForce 20xx）的所有显卡。不支持 [https://en.wikipedia.org/wiki/Ampere_(microarchitecture) Ampere]（30xx）。OptiX 5.1 使用嵌入的静态训练数据集，因此不受驱动实现影响。&lt;br /&gt;
&lt;br /&gt;
* Optix 6：使用 OptiX 6.0 AI 去噪器（之前为默认选项）。在 GPU 上运行。在 Kepler（6xx）显卡上似乎无法使用，但在更新的显卡上均可运行，包括 Ampere（30xx）。自 6.0 起，OptiX 去噪器的训练数据集存储在驱动中。在 v442.50 之前，其行为类似于 OptiX 5.1；但之后 NVIDIA [https://forums.developer.nvidia.com/t/optix7-denoiser-different-results-with-different-version-of-drivers/117989/2 更改了数据集]，结果可能有所不同。更新后的数据集有时可能产生网格状图案和更亮的边缘（仍可通过 “Denoise: fix bright edges” 修复），但运行速度更快。&lt;br /&gt;
&lt;br /&gt;
* Optix 7：使用 OptiX 7.2 AI 去噪器。行为类似 OptiX 6.0，但在 Ampere（30xx）上可能支持更好。&lt;br /&gt;
&lt;br /&gt;
* OpenImageDenoise：使用 Intel Open Image Denoise 库。在 CPU 上运行（任何支持 SSE 4.1 的 CPU）。可能略慢于 OptiX，但质量可比。&lt;br /&gt;
&lt;br /&gt;
* OpenImageDenoise2：使用 Intel Open Image Denoise 2，CUDA 模式。在 GPU 上运行，性能与 OptiX 6/7 相当，质量与 CPU 版本相同。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Adjust sample positions ===&lt;br /&gt;
寻找最佳采样位置以防止光照泄漏。算法详情可参考 [https://ndotl.wordpress.com/2018/08/29/baking-artifact-free-lightmaps/#leaks 此处]。在某些情况下（通常是大型且多边形极少、法线平滑的几何体），可能会产生不正确的结果，此时可以将其禁用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Unload scenes before render ===&lt;br /&gt;
在烘焙前卸载 Unity 场景以释放显存。复杂场景仅在编辑器中显示就可能占用数 GB 的显存。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Denoise ===&lt;br /&gt;
[[File:Image31.png|thumb|左：未开启 “Denoise”，右：开启 “Denoise”。]]&lt;br /&gt;
如果启用，将应用去噪算法。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Fix Seams ===&lt;br /&gt;
[[File:Image22.png|thumb|左：缝隙（“Fix Seams” 关闭），右：缝隙已修复（“Fix Seams” 开启）。]]&lt;br /&gt;
如果启用，将尝试融合由 UV 不连续造成的缝隙。对平滑几何体很有用，包括 Unity 默认的球体。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Split by scene ===&lt;br /&gt;
如果同时加载多个场景，并且启用此选项，每个场景将拥有自己的一套光照贴图，而不会与其他场景共享。这对于在运行时流式加载场景时限制纹理占用量非常有用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hole filling ===&lt;br /&gt;
[[File:Holefilling.jpg|thumb|“Hole filling” 关闭与开启的对比。]]&lt;br /&gt;
如果 Atlas Packer 设置为 xatlas，将尝试填充每个孔洞，从而生成更高效的贴图集。对于几何体非常复杂的场景，可能会增加场景导出时间，但通常推荐开启。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Min resolution ===&lt;br /&gt;
光照贴图的最小尺寸限制。可用于在生成大量小而完全填充的光照贴图与少量未完全填充的光照贴图之间进行平衡。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Scale per map type ===&lt;br /&gt;
允许你对颜色贴图、Shadowmask 和方向贴图设置不同的分辨率缩放。例如，常见情况是间接光颜色分辨率较低，但 Shadowmask 分辨率较高。请注意，缩放在光照贴图渲染完成后才应用，因此不会节省烘焙时间。如果启用了 “Adjust UV padding”，间距将基于最低分辨率的贴图，以防止像素泄漏。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Checker preview ===&lt;br /&gt;
[[File:Image12.png|thumb|Checker Preview 功能演示。]]&lt;br /&gt;
如果勾选了 “Show checker” 选项，场景视图将在可见对象上渲染棋盘格图案，以展示光照贴图像素大小。这对于在烘焙前确保 Texels Per Unit 和其他影响分辨率的设置使用合理数值非常有用。&lt;br /&gt;
&lt;br /&gt;
启用 Checker Preview 将强制 Bakery 执行贴图集打包。可能需要一些时间，但通常不会超过几秒钟。在修改场景内容后，按下 “Refresh checker” 可重新打包场景以查看更改。&lt;br /&gt;
&lt;br /&gt;
Checker Preview 还使用随机颜色显示场景将如何被分割到不同的光照贴图中。&lt;br /&gt;
&lt;br /&gt;
{{note| 当前 Checker Preview 无法显示地形的正确像素大小。}}&lt;br /&gt;
&lt;br /&gt;
==== Atlas preview ====&lt;br /&gt;
[[File:FN-TmhRXwAE9i2I.png|thumb|Atlas Preview 功能演示]]&lt;br /&gt;
当 Checker Preview 开启时，会显示 Atlas Preview 按钮。点击它将打开一个新窗口，显示未来光照贴图的 UV 布局。点击 &amp;quot;&amp;lt;&amp;quot; 和 &amp;quot;&amp;gt;&amp;quot; 按钮可浏览各个光照贴图。&lt;br /&gt;
这对于在烘焙前检查打包质量和光照贴图数量非常有用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Emissive boost ===&lt;br /&gt;
将任何表面自发光（emission）乘以此数值。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Indirect boost ===&lt;br /&gt;
将所有反弹光照乘以此数值。作用与光源组件上的 Indirect Intensity 相同，但为全局设置。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Backface GI ===&lt;br /&gt;
[[File:Image30.jpg|thumb|Backface GI]]&lt;br /&gt;
[[File:Image35.png|thumb|左：“Backface GI” = 0，右：“Backface GI” = 1。注意阴影区域接收到更多的绿色光照。]]&lt;br /&gt;
决定光线通过前面表面到达背面并被全局光照（GI）反弹的程度。这对于薄的半透明表面（如树叶）尤其有用。取值范围为 0-1。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Ambient occlusion ===&lt;br /&gt;
[[File:Image15.png|thumb|左：AO intensity = 0，右：AO intensity = 1。]]&lt;br /&gt;
一种简单的非物理环境光遮蔽（Ambient Occlusion，AO），可在最终场景光照上叠加以增强美观效果。&lt;br /&gt;
&lt;br /&gt;
* Intensity（强度）：控制 AO 效果的可见度。值为 0 时禁用该效果。&lt;br /&gt;
* Radius（半径）：决定 AO 效果使用的光线距离。较小的值产生局部遮蔽（角落、褶皱），较大的值则更类似 Skylight，从远处物体产生阴影。&lt;br /&gt;
* Samples（采样数）：影响环境光遮蔽的质量。典型值为 4 到 32。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dither transparency ===&lt;br /&gt;
通过自动抖动不透明度贴图来启用半透明阴影。[[使用手册#Opacity|了解 Bakery 如何处理不透明度贴图]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== RTX Mode ===&lt;br /&gt;
启用 RTX 硬件加速。仅 RTX 显卡可受益于此选项。最低支持的驱动版本为 418。&lt;br /&gt;
&lt;br /&gt;
驱动可以在大多数非 RTX Nvidia 显卡上模拟 RTX 模式，但通常会更慢。&lt;br /&gt;
&lt;br /&gt;
在 Ampere（3xxx）或更新的显卡上，RTX 模式 ''必须'' 启用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Export terrain trees ===&lt;br /&gt;
如果启用，绘制在地形上的树木将影响光照。树木本身不会被烘焙。请注意，在烘焙过程中，每棵树都使用最高可能的 LOD 等级。对于多公里范围且模型高度复杂的森林场景，不建议使用此选项。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Terrain optimization ===&lt;br /&gt;
如果启用（默认），地形将使用独立的光线追踪技术以利用其高程图几何结构。否则，它们将像其他普通网格一样处理。地形优化可以显著减少高分辨率地形所需的内存占用。在某些情况下，它还能加快地形烘焙速度，但在其他情况下（尤其是简单低分辨率地形）可能需要禁用该选项。&lt;br /&gt;
&lt;br /&gt;
{{note| 地形优化当前不兼容绘制的地形洞。需禁用此选项才能使其正常工作。}}&lt;br /&gt;
{{note| 地形优化仅支持非 RTX 模式。}}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Light Mesh batch limit ===&lt;br /&gt;
如果该值大于 0，会将多个 Light Mesh 合并为一个，前提是它们具有相同设置并影响相同的 Lightmap Groups，同时将它们的总采样数限制为该值（例如，如果限制为 64，则可以合并 2 个采样数为 32 的灯光，或 4 个采样数为 16 的灯光，等等）。在拥有大量 Light Mesh 的场景中，这可以提升性能。但设置过高时需小心，因为 GPU 在一次处理过多采样时可能触发操作系统驱动超时。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Compress volumes ===&lt;br /&gt;
如果启用，将对体积 3D 贴图应用纹理压缩，并将 Bakery 着色器切换到相应的采样模式。不推荐对分辨率非常低的体积使用此选项。体积大小可能会被调整为 4 的倍数。&lt;br /&gt;
&lt;br /&gt;
注意事项：&lt;br /&gt;
&lt;br /&gt;
* 目前仅支持压缩为 BC6H/BC7 纹理格式（桌面/主机平台）。&lt;br /&gt;
* 体积压缩仅支持 Unity 2020.1 或更高版本。&lt;br /&gt;
* 目前仅标准渲染管线的 Bakery 着色器支持使用压缩体积贴图。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Samples multiplier ===&lt;br /&gt;
将所有阴影和 GI 采样数乘以指定因子。可用于在草稿质量和最终质量之间快速切换。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Tile size ===&lt;br /&gt;
与 [[#GPU Priority|GPU Priority]] 相同，但这里设置的是贴图块（tile）大小。Bakery 会将光照贴图拆分为更小的块，并一次更新一个块。块越小，GPU 工作被中断的次数越多，系统响应性可能更好。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Temp path ===&lt;br /&gt;
临时文件夹。在渲染过程中，Bakery 可能需要几个 GB 的可用空间。将此文件夹放在 SSD 上相比 HDD 可略微加快渲染速度。目前，该文件夹不会自动清理。你可以随时手动删除其内容（渲染时除外），或通过 Bakery -&amp;gt; Utilities -&amp;gt; Clear cache 清理。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Output path ===&lt;br /&gt;
光照贴图文件夹。所有光照贴图，以及 lightprobe 和顶点颜色（vertex color）资源都将保存在此处。该路径相对于你的 Assets 文件夹。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Use scene named output path ===&lt;br /&gt;
如果启用此选项，输出路径将自动设置为与当前活动场景同名的文件夹（Assets/CurrentSceneName/）。这与 Unity 内置光照贴图烘焙器的行为类似。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render Selected Groups ===&lt;br /&gt;
仅烘焙包含所选对象的 Lightmap Groups。&lt;br /&gt;
不仅仅是所选对象会被重新绘制，它们所属的所有 Lightmap Groups 都会被处理。其他光照贴图不会被更新。如果对象不属于某个手动分配的组，则使用相同光照贴图的场景部分将被重新烘焙。&lt;br /&gt;
&lt;br /&gt;
目前，使用 [[Partial_scene_baking|Sectors]] 进行场景部分烘焙更为方便。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Beep on finish ===&lt;br /&gt;
如果启用，Bakery 在烘焙完成时会播放提示音。&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 (Experimental) ==&lt;br /&gt;
=== Unwrapper ===&lt;br /&gt;
如果启用 [[#Asset_UV_Processing|Adjust UV Padding]]，则定义将使用的展开器（unwrapper）。&lt;br /&gt;
&lt;br /&gt;
* Default：使用 Unity 标准展开器。Bakery 会为每个具有不同间距参数的网格调用 [https://docs.unity3d.com/ScriptReference/Unwrapping.GenerateSecondaryUVSet.html Unwrapping.GenerateSecondaryUVSet]。&lt;br /&gt;
* xatlas：使用 [https://github.com/jpcy jpcy] 的 [https://github.com/jpcy/xatlas xatlas]，这是 [https://github.com/castano Ignacio Castaño] 的 [https://github.com/Thekla/thekla_atlas thekla_atlas] 的修改版。thekla_atlas 曾用于游戏《The Witness》（[http://the-witness.net/news/2010/03/graphics-tech-texture-parameterization/ 参见博客文章]）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Atlas Packer ===&lt;br /&gt;
选择在将不同对象的 UV 布局打包到大型光照贴图集时使用的算法。&lt;br /&gt;
* Default：Bakery 在 v1.7 之前使用的原始算法。&lt;br /&gt;
* xatlas：使用 xatlas。&lt;br /&gt;
&lt;br /&gt;
某些功能仅支持特定的贴图集打包器：&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Default&lt;br /&gt;
! xatlas&lt;br /&gt;
|-&lt;br /&gt;
| [[使用手册#Bakery_Lightmap_Group_Selector|Override resolution]]&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
|-&lt;br /&gt;
| 高效 LOD 打包&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
|-&lt;br /&gt;
| [[使用手册#Hole_filling|Hole filling]]&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
请注意，贴图集打包器（Atlas Packer）也可以为每个 Lightmap Group 单独选择。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Export geometry and maps ===&lt;br /&gt;
如果启用，Bakery 会在渲染前将场景导出为其专用格式。如果你确定场景的几何体和贴图以及光照贴图分辨率设置没有改变（例如，你只是调整 GI 或光源设置），可以禁用此选项以加快下一次渲染速度。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update unmodified lights ===&lt;br /&gt;
如果启用，Bakery 会重新计算自上次渲染以来未改变的光源。如果你只是调整某个光源，不想等待其他光源重新渲染，可以禁用此选项。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update modified lights and GI ===&lt;br /&gt;
如果启用，Bakery 会重新计算自上次渲染以来发生变化的 GI 和光源。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== UV padding: increase only ===&lt;br /&gt;
仅在启用 [[#Asset_UV_Processing|Adjust UV padding]] 时可见。默认情况下，模型资源的最佳 UV 间距仅基于当前加载的场景进行计算。如果同一模型有多个实例使用不同的光照贴图分辨率，最小的分辨率将决定间距，以确保 UV 图块之间的间距足够大，防止相互重叠。然而，在两个不同的独立场景中烘焙同一模型时，为新场景优化可能会破坏之前场景中的 UV。勾选此选项可以防止这种情况发生，即永远不减小间距值，从而始终为曾经烘焙过的最低分辨率实例进行优化。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoise: fix bright edges ===&lt;br /&gt;
[[File:Image19.png|thumb|左：去噪后可见明亮边缘；右：已修复。]]&lt;br /&gt;
仅在 [[#Denoise|Denoise]] 启用时可见。有时用于去噪的神经网络可能会在阴影周围产生明亮边缘，就像应用了锐化效果一样。如果启用此选项，Bakery 会尝试将其滤除。启用后，去噪阶段可能会略微变慢。&lt;br /&gt;
&lt;br /&gt;
此功能也可用于滤除“火花”（fireflies），即光照贴图中偶尔出现的亮点。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Post-packing ===&lt;br /&gt;
有时在渲染场景时，Bakery 会将光照贴图拆分为多个子光照贴图，例如在烘焙不同 LOD 或地形时。&lt;br /&gt;
Post-packing 会尝试通过将这些子光照贴图合并到同一纹理中来最小化最终贴图集数量。&lt;br /&gt;
建议保持此选项启用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Combine with Enlighten real-time GI ===&lt;br /&gt;
如果启用，则在按下 Render 按钮时，Bakery 会首先尝试使用 Enlighten 烘焙以计算实时 GI。之后，将进行常规的 Bakery 光照贴图烘焙过程。烘焙 GI 和实时 GI 将协同工作。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bake on remote server ===&lt;br /&gt;
启用网络烘焙（[[Network baking|Network baking]]）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Presets ===&lt;br /&gt;
当前在 Experimental 模式下的 Render/Update 按钮下显示。&lt;br /&gt;
&lt;br /&gt;
* 点击 '''New''' 将所有当前设置保存到预设文件中。&lt;br /&gt;
* 默认情况下，当一个预设处于激活状态时，所有设置都会被灰显，以防止覆盖预设。&lt;br /&gt;
* 点击 '''Modify preset''' 可更改设置并覆盖预设。&lt;br /&gt;
* 可以通过预设字段切换预设。将其设置为 None 可禁用预设使用。&lt;br /&gt;
&lt;br /&gt;
== 组件 ==&lt;br /&gt;
=== Bakery Lightmap Group Selector ===&lt;br /&gt;
指定对象及其所有子对象使用的 '''Lightmap Group'''。&lt;br /&gt;
Lightmap Group 是 Bakery 用来表示共享同一光照贴图的对象集合的术语。每个组都有属性，告诉 Bakery 如何打包对象、哪些光源影响它们，以及结果是烘焙到纹理还是顶点。&lt;br /&gt;
&lt;br /&gt;
默认情况下，所有静态对象会自动打包到多个光照贴图组（贴图集）中，因此通常无需手动管理。手动定义组仅用于特殊用途，例如：&lt;br /&gt;
&lt;br /&gt;
* 指定某些对象使用 [[Vertex Lightmaps|每顶点光照贴图]] 而非纹理。&lt;br /&gt;
* 使用建模软件中的原始未缩放 UV 烘焙光照贴图。&lt;br /&gt;
* 将关卡的特定区域分组以使用单张光照贴图，从而便于资源流式加载或通过脚本在运行时切换不同的烘焙光照。&lt;br /&gt;
* 使用 Render Selected Groups 按钮仅更新已分组的对象。&lt;br /&gt;
&lt;br /&gt;
要手动定义组，可以创建 '''Lightmap Group Assets'''，方法包括使用 Assets-&amp;gt;Create 菜单，或在组件中使用 Create New 按钮。使用 Create New 按钮时，将根据以下表单创建新的资源：&lt;br /&gt;
&lt;br /&gt;
* Name：要创建的 Lightmap Group 资源的名称。&lt;br /&gt;
* Packing Mode：此选择器定义 Lightmap Group 的打包模式，共有 3 种模式：&lt;br /&gt;
** Original UV：对象及其子对象将使用未修改的 UV 进行烘焙，不执行打包。适用于多个网格共享同一已打包 UV 布局的模型。&lt;br /&gt;
** Pack Atlas：对象及其子对象将打包到专用纹理贴图集中。在 v1.3 之前，每个可打包的子对象都需要有此组件，但现在不再需要。每个子对象将作为单独矩形打包，除非 Bakery 自动检测到子对象有非重叠的子对象，在这种情况下，多个对象可以使用同一个矩形。&lt;br /&gt;
** Vertex：对象及其子对象将使用顶点色烘焙光照而非纹理。注意，需要使用自定义着色器才能生效，例如 [[#Bakery_shaders|Bakery Shader]]。文档中也提供了一个简单的着色器（“Bakery/Simple Vertex Lightmapped”）用于演示和参考。[[Vertex Lightmaps|了解更多关于顶点光照贴图的信息]]。&lt;br /&gt;
* Directional mode：允许你覆盖该组的 [[#Directional mode|directional mode]]。选项与全局相同，Auto 将使用全局设置。&lt;br /&gt;
* Resolution：所需的光照贴图分辨率。&lt;br /&gt;
* Auto-resolution：使用 [[使用手册#Texels_per_unit|Texels Per Unit]] 来确定最接近的二次幂分辨率。&lt;br /&gt;
* Atlas packer：为该组选择 [[使用手册#Atlas_Packer|贴图集打包]] 算法。&lt;br /&gt;
* Bitmask：用于排除光源影响光照贴图的开关列表。每个 Bakery 光源也有一个位掩码设置。光源只会影响与其共享至少一个开关的 Lightmap Group。默认设置意味着所有光源影响所有光照贴图。&lt;br /&gt;
&lt;br /&gt;
[[File:Ts.jpg|thumb|Transparent selfshadow关闭 vs 开启：注意一些单面但背向的多边形如何被正确照亮。]]&lt;br /&gt;
&lt;br /&gt;
如果你有一个被分配了“Pack Atlas”模式的 Lightmap Group，组件上将会出现额外设置：&lt;br /&gt;
&lt;br /&gt;
* Override resolution：覆盖该对象及其子对象在光照贴图中占用的分辨率。&lt;br /&gt;
* Resolution：手动定义的分辨率。例如，如果你有一个分辨率为 512 的光照贴图，并且分配给 4 个对象，同时覆盖分辨率设置为 256，Bakery 将生成一个 512x512 的光照贴图，每个对象正好占据 256x256 的区域。&lt;br /&gt;
&lt;br /&gt;
如果你选择一个 Lightmap Group 资产，将会显示额外的实验性设置：&lt;br /&gt;
* [[Subsurface scattering|Subsurface scattering: (点击阅读更多)]]&lt;br /&gt;
* Normal offset：允许你将光线从表面偏移。这很少有用，主要用于实验目的。&lt;br /&gt;
* Transparent selfshadow：从表面后方发射光线，使其不会在自身投射阴影。对于半透明叶片可能有用。&lt;br /&gt;
* Vertex sampling density，(仅当 Packing Mode 设置为 Vertex 时可用）：默认情况下，每个顶点只计算一个值；如果采样密度 &amp;gt; 0，则会在三角形上分散采样并求平均，从而生成超采样、更平滑的结果。&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Lightmapped Prefab ===&lt;br /&gt;
此组件允许预制件存储光照贴图元数据。这样处理后的预制件可以在任意场景中实例化，无论是在编辑器中还是运行时。&lt;br /&gt;
该组件应直接添加到预制件的根对象上。不支持嵌套预制件。由于预制件在烘焙后会被覆盖（类似于按下“Apply”按钮的效果），因此要求预制件没有任何未应用的更改（子对象不应移动，材质和脚本参数应保持不变等）。如果检测到此类更改，组件界面会显示错误，烘焙后不会保存任何元数据。如果启用了 [[#Warnings|Lightmapped prefab validation]] 警告，所有预制件错误也会在烘焙前以对话框形式显示。&lt;br /&gt;
&lt;br /&gt;
光照贴图预制件支持所有 Bakery 功能，例如 LOD、地形、方向光贴图、RNM、SH、顶点模式和 Shadowmask。要使 Shadowmask 生效，光源也必须是同一预制件的一部分。&lt;br /&gt;
&lt;br /&gt;
{{note| 注意，由于 API 限制，预制件 Shadowmask 仅在 Unity 2017.4 或更高版本中可用。}}&lt;br /&gt;
&lt;br /&gt;
烘焙后，一个名为 “BakeryPrefabLightmapData” 的对象会被添加到预制件中。该对象包含一个脚本，存储应用光照贴图所需的所有数据。&lt;br /&gt;
&lt;br /&gt;
此外，光照贴图预制件允许保存当前渲染设置，并使用两个按钮将其加载回任意已打开的场景：&lt;br /&gt;
&lt;br /&gt;
* Save current render settings to prefab：在该预制件上存储当前渲染设置的副本。&lt;br /&gt;
* Load render settings from prefab：将当前渲染设置设置为预制件中存储的设置。&lt;br /&gt;
  [[File:Upload 2019-9-17 10-32-34.png|thumb|应用预制件]]&lt;br /&gt;
&lt;br /&gt;
烘焙光照贴图预制件时，建议检查：&lt;br /&gt;
&lt;br /&gt;
* 预制件已“应用”。在旧版 Unity 中，点击 Inspector 右上角的 “Apply” 按钮。在新版 Unity 中，点击 “Overrides” 列表，然后选择 “Apply All”。&lt;br /&gt;
* 预制件组件 UI 不显示任何错误。&lt;br /&gt;
* [推荐] 在主窗口启用 “Lightmapped prefab validation” 复选框。点击 Render 时不会显示任何关于预制件的警告对话框。&lt;br /&gt;
&lt;br /&gt;
{{note| 光照贴图以其烘焙所在的场景或所使用的 Lightmap Group 命名（如果有）。在同一场景中烘焙不同预制件时，请确保使用不同命名的 [[使用手册#Bakery_Lightmap_Group_Selector|Lightmap Group]] 或更改 [[使用手册#Output_path|输出路径]]。}}&lt;br /&gt;
&lt;br /&gt;
{{note| 当使用相同模型逐个烘焙多个预制件时，建议将 [[使用手册#Asset_UV_Processing|Asset UV Processing]] 设置为“Don't Change”，以防止修改共享模型的 UV。}}&lt;br /&gt;
&lt;br /&gt;
{{note| Bakery 的预制件工作流程是在 Unity 提供“预制件双击进入视图”功能之前实现的。因此，在隔离预制件视图中光照贴图可能无法正确应用，组件可能显示 “This GameObject is not a prefab” 信息。但在普通场景中使用时应能正常工作。}}&lt;br /&gt;
&lt;br /&gt;
{{note| 当解包已烘焙的预制件并取消与现有光照贴图的关联时，请确保删除保存预制件范围光照贴图/渲染器连接的 BakeryPrefabLightmapData 对象。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Direct Light ===&lt;br /&gt;
[[File:Directlight.jpg|thumb|纯直射光 + GI]]&lt;br /&gt;
[[File:Image4.png|thumb|左：“Shadow Spread” = 0.01，右：0.05。注意阴影从锐利逐渐变模糊的效果。]]&lt;br /&gt;
无限远方向光（例如太阳）。&lt;br /&gt;
&lt;br /&gt;
* Color：光的颜色。&lt;br /&gt;
* Intensity：线性色彩乘数。&lt;br /&gt;
* Shadow Spread：光源尺寸，或者简单说，阴影的模糊度。0 = 阴影最锐利，1 = 阴影最模糊。从技术上讲，它在单条光线与更宽光锥之间插值。&lt;br /&gt;
* Shadow Samples：影响阴影质量。Shadow Spread 值越小，所需样本越少即可得到干净图像。太阳阴影的典型值为 1 到 16。设置为 0 时，该光源的阴影将消失。&lt;br /&gt;
* Bitmask：用于排除此光源对特定 Lightmap Groups 影响的开关列表。&lt;br /&gt;
* Baked contribution：确定应烘焙哪类光照数据。仅在 Indirect 或 Shadowmask 模式可见。可选值：&lt;br /&gt;
** Direct and Indirect：直射光与间接光都完全烘焙。&lt;br /&gt;
** Indirect only：实时光提供直射贡献，仅烘焙间接光。&lt;br /&gt;
** Shadowmask and indirect：实时光提供直射贡献，静态几何体的阴影烘焙到单独贴图，动态与静态阴影混合。间接光正常烘焙。&lt;br /&gt;
** Direct, Indirect, Shadowmask（仅自定义光照）：与直射和间接相同，但 Shadowmask 也生成，可与自定义着色器一起使用。&lt;br /&gt;
* Denoise shadowmask：确定是否对该光源的 Shadowmask 应用去噪。通常不需要，因为阴影噪点不明显，但对非常宽且模糊的阴影（大 Shadow Spread）可能有用。&lt;br /&gt;
* Indirect intensity：非物理 GI 乘数。自然光照应为 1，可根据场景风格调整。&lt;br /&gt;
* Anti-alias：对阴影执行超采样。&lt;br /&gt;
* Texture projection：在光照上投射乘法平铺纹理，可用于模拟远处云影。&lt;br /&gt;
当设置了纹理投影时，可以使用“Tiling”和“Offset”字段调整其缩放和偏移。或者，点击 &amp;quot;Tweak projection in Scene View&amp;quot; 并使用额外的 Gizmo 可视化移动和缩放投影。点击“Render reference frame”可保存光源视角的 PNG，这对于在场景上绘制云影很有用。&lt;br /&gt;
&lt;br /&gt;
如果同一对象同时启用了 Unity 和 Bakery 光源且参数不匹配，会出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match lightmapped to real-time：将 Unity 光源的通用设置复制到 Bakery 光源。&lt;br /&gt;
* Match real-time to lightmapped：将 Bakery 光源的通用设置复制到 Unity 光源。&lt;br /&gt;
&lt;br /&gt;
{{note| 从物理角度看，Bakery 的方向光强度（Intensity）等于照度（Lux）除以 π。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Sky Light ===&lt;br /&gt;
[[File:Skylight.jpg|thumb|纯天空光与 GI]]&lt;br /&gt;
无限远的带阴影环境光（天空）。&lt;br /&gt;
&lt;br /&gt;
* Color: 颜色。&lt;br /&gt;
* Intensity: 线性色彩倍增。&lt;br /&gt;
* Sky texture: 可选的立方体贴图资源，例如 HDRI 全景图，用于从不同方向影响光照颜色。&lt;br /&gt;
  {{note| 旋转天空光的 GameObject 会相应旋转立方体贴图的光照。}}&lt;br /&gt;
* Samples: 影响阴影质量。典型值为 8 到 32。&lt;br /&gt;
* Hemispherical: 如果启用，光照仅来自上方（上半球）。否则来自所有方向。&lt;br /&gt;
* Bitmask: 用于排除此光源影响特定 Lightmap Groups 的开关列表。&lt;br /&gt;
* Baked contribution: 决定应烘焙哪种光照数据。仅在 Indirect/Shadowmask 模式下可见。可能值：&lt;br /&gt;
** Direct and Indirect: 直接和间接光照都将完全烘焙。这是默认且推荐的天空光行为，因为在 Unity 中没有实时版本可以模拟它们。&lt;br /&gt;
** Indirect only: 假定实时光源提供直接贡献；仅烘焙间接光照。&lt;br /&gt;
&lt;br /&gt;
如果天空光的设置与当前场景的天空盒不匹配，将出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match this light to scene skybox: 将活动天空盒材质的通用设置复制到 Bakery 天空光。当前仅支持使用 “Skybox/Cubemap” 或 “Skybox/Bakery skybox” 着色器的天空盒。&lt;br /&gt;
* Match scene skybox to this light: 将 Bakery 天空光的通用设置复制到场景天空盒。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bakery Light Mesh ===&lt;br /&gt;
[[File:Image29.png|thumb|Left: Samples Near = 0, Samples Far = 4096.&amp;lt;br&amp;gt;&lt;br /&gt;
Middle: Samples Near = 0, Samples Far = 128.&amp;lt;br&amp;gt;&lt;br /&gt;
Right: Samples Near = 16, Samples Far = 128.&amp;lt;br&amp;gt;&lt;br /&gt;
请注意，光照效果看起来相似，但使用的合并采样数量更少。]]&lt;br /&gt;
任何形状的自发光网格。应与 Mesh Renderer 组件或设置为 Area 模式的 Light 组件一起使用。&lt;br /&gt;
&lt;br /&gt;
* Color：颜色&lt;br /&gt;
* Intensity：线性颜色倍增器&lt;br /&gt;
* Cutoff：最大光照距离。Bakery 会在接近该限制时额外衰减正确的平方反比衰减。当 Cutoff 值刚好对应物理衰减变得非常暗的位置时效果最佳。Cutoff 可提升烘焙性能，也可以设置为非常高（不可达）的值以保证完全正确性。&lt;br /&gt;
* Self Shadow：决定光源网格自身是否投射阴影。此选项同时启用更精确的光照算法。&lt;br /&gt;
* Samples Near：影响靠近网格的光照质量。典型值为 16 到 64，仅当 Self Shadow 开启时可用。&lt;br /&gt;
* Samples Far：影响远离网格的光照质量。典型值为 4 到 4096。&lt;br /&gt;
&lt;br /&gt;
Bakery 基于光源表面距离混合两种不同的区域光算法。靠近光源时，算法类似 GI，而远处光源被近似为虚拟点光云。&lt;br /&gt;
&lt;br /&gt;
{{note| &amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;光源网格自身不会接收光照，也不会被烘焙到光照贴图中。&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;一个拥有大量多边形的光源网格比烘焙多个简单的光源网格要快&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;如果结果总是脏/噪点较多，可以尝试将 Samples Near 设置为 0，这样只使用 VPL 算法。对于不需要精度的简单光源（如建筑物的窗户光），这也非常有用。&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;}}  &lt;br /&gt;
[[File:Dd99d-QU0AEKFBK.jpg|thumb|弯曲的光源网格]]  &lt;br /&gt;
* Bitmask：用于排除此光源影响特定 Lightmap Groups 的开关列表。  &lt;br /&gt;
* Baked contribution：决定烘焙哪种类型的光照数据。仅在 Indirect 或 Shadowmask 模式下可见。可能的值：  &lt;br /&gt;
** Direct and Indirect：完全烘焙直接和间接光贡献。这是默认且推荐的光源网格行为，因为 Unity 中没有实时版本可以模拟它们。  &lt;br /&gt;
** Indirect only：实时光源提供直接光贡献，仅烘焙间接光。  &lt;br /&gt;
** Shadowmask and Indirect：实时光源提供直接光贡献，但静态几何体的阴影会烘焙到单独的贴图。动态和静态阴影将混合在一起。间接光照将照常烘焙。目前仅 HDRP（和自定义渲染器）支持混合区域光。  &lt;br /&gt;
** Direct, Indirect, Shadowmask (custom lighting only)：与 Direct and Indirect 相同，但同时生成 Shadowmask 并分配用于自定义着色器。  &lt;br /&gt;
* Indirect intensity：非物理 GI 倍增器。自然光照应设为 1，但可修改以实现更风格化的场景。  &lt;br /&gt;
* Shadowmask with falloff：将完整光衰减烘焙进 Shadowmask（仅对自定义着色器有用）。  &lt;br /&gt;
&lt;br /&gt;
如果网格材质和光源设置不匹配，将出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match light to material：将网格材质或区域光的通用设置复制到 Bakery 光源。&lt;br /&gt;
* Match material to light：将 Bakery 光源的通用设置复制到网格材质或区域光。&lt;br /&gt;
&lt;br /&gt;
==== Light Mesh 与自发光材质的区别 ====&lt;br /&gt;
自发光材质：&lt;br /&gt;
&lt;br /&gt;
* 在 GI 计算中传播光线，因此是“免费的”，无论有多少网格是自发光的。&lt;br /&gt;
* 小而明亮的光可能会产生不准确或有噪点的结果，这取决于 GI 的采样数量。&lt;br /&gt;
* 由于 Bakery 中 GI 的工作方式，它必须占用光照贴图空间，因此可能会浪费空间。同时，这意味着自发光对象需要有效的 UV，并且必须启用“投射阴影”。&lt;br /&gt;
&lt;br /&gt;
Light Mesh：&lt;br /&gt;
&lt;br /&gt;
* 光照会为每个光源单独计算，因此比自发光材质慢。&lt;br /&gt;
* 设计用于为小而明亮的光提供干净的光照效果，即使距离很远也能保持效果。&lt;br /&gt;
* 不占用光照贴图空间。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Point Light ===&lt;br /&gt;
[[File:Image11.png|thumb|左：“Shadow Spread” = 0.5，右：“Shadow Spread” = 1。]]&lt;br /&gt;
点光源，没有面积。尽管在物理上不可能，但在游戏中很有用，并且是匹配 Unity 点光源和聚光灯的唯一方式。&lt;br /&gt;
{{note| 聚光灯只是带有额外投影遮罩的点光源。}}&lt;br /&gt;
&lt;br /&gt;
* Color: 颜色&lt;br /&gt;
* Intensity: 线性色彩倍增&lt;br /&gt;
* Shadow spread: 阴影模糊度。虽然点光源没有面积，但通常希望它仍能产生模糊阴影。为此，阴影被模拟为从球形区域光源投射。此参数定义了虚拟球体的半径，直接影响阴影模糊度。&lt;br /&gt;
* Physical falloff: 如果启用，将使用正确的平方反比衰减，并在边界附近额外衰减。否则将尝试模拟 Unity 的衰减。&lt;br /&gt;
* Falloff min size: 详见 [[Point Light Attenuation]] 部分。&lt;br /&gt;
* Range: 如果物理衰减被禁用，则等于 Unity 的光源范围；如果启用，只会在边缘轻微衰减物理衰减。&lt;br /&gt;
* Samples: 影响阴影质量。典型值为 1 到 512。设置为 0 将使该光源的阴影消失。&lt;br /&gt;
  [[File:Image10.png|thumb|从左到右：Omni，Cookie（默认聚光灯纹理），Cubemap，IES。]]&lt;br /&gt;
* Projection mask: 遮罩/Cookie 类型。选项：&lt;br /&gt;
** Omni: 无遮罩，相当于 Unity 的点光源。&lt;br /&gt;
** Cookie: 纹理投影遮罩。附加选项：&lt;br /&gt;
*** Cookie texture: 2D 纹理资源。Bakery 包含原始 Unity 聚光灯纹理（名为 ftUnitySpotTexture），可用于模拟。&lt;br /&gt;
*** Angle: 纹理投影角度（类似 Unity 聚光灯）。&lt;br /&gt;
*** Correct distortion: 修正宽角下直线可见的 cookie 失真。&lt;br /&gt;
** Cubemap: 立方体贴图投影遮罩。附加选项：&lt;br /&gt;
*** Projected cubemap: 立方体贴图资源。&lt;br /&gt;
** IES: 光照由 IES 文件数据调制。附加选项：&lt;br /&gt;
*** IES file: .ies 扩展名文件。&lt;br /&gt;
* Bitmask: 用于排除该光源影响特定 Lightmap Groups 的开关列表。&lt;br /&gt;
* Baked contribution: 决定应烘焙哪种类型的光照数据。仅在 Indirect 或 Shadowmask 模式下可见。可能值：&lt;br /&gt;
** Direct and Indirect: 直接光和间接光完全烘焙。&lt;br /&gt;
** Indirect only: 实时光提供直接光，仅烘焙间接光。&lt;br /&gt;
** Shadowmask and Indirect: 实时光提供直接光，但静态几何体阴影烘焙到单独贴图中，动态和静态阴影混合，间接光正常烘焙。&lt;br /&gt;
** Direct, Indirect, Shadowmask (custom lighting only): 与 Direct and Indirect 相同，同时生成 Shadowmask 用于自定义着色器。&lt;br /&gt;
* Indirect intensity: 该光的非物理 GI 倍增。自然光应为 1，可根据风格化场景修改。&lt;br /&gt;
* Shadowmask with falloff: 将完整光衰减（除距离外）烘焙到 Shadowmask（仅自定义着色器有用）。&lt;br /&gt;
* Legacy sampling: 使用 Bakery 原始更偏置的阴影采样策略。产生无噪点阴影，但宽半影可能出现条纹。禁用后使用无偏但更有噪点的技术。&lt;br /&gt;
&lt;br /&gt;
如果同一对象同时启用了 Unity 和 Bakery 光源，且设置不匹配，则会出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match lightmapped to real-time: 将 Unity 光的常用设置复制到 Bakery 光。&lt;br /&gt;
* Match real-time to lightmapped: 将 Bakery 光的常用设置复制到 Unity 光。&lt;br /&gt;
&lt;br /&gt;
{{note| 从物理角度来看，Bakery 点光源的“Intensity”为 Candela 除以 Pi。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Volume ===&lt;br /&gt;
[[File:Voldemo notlonely.gif|由 BakeryVolume 照亮的动态门（动态 GIF，由 NOTLonely 制作）]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
体积（Volumes）生成存储每个体素光探针的 3D 纹理（L1 球面调和和阴影贴图），使其成为常规 Unity 光探针的可行替代方案。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Unity Light Probes&lt;br /&gt;
! Unity LPPV&lt;br /&gt;
! Bakery Volumes&lt;br /&gt;
|-&lt;br /&gt;
| 手动放置每个光探针&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 否&lt;br /&gt;
|-&lt;br /&gt;
| 在一个物体上插值多个光探针&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 运行时可移动&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 可以放入预制件&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 完整脚本 API&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| “Ringing” 伪影&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 可能出现&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 可能出现&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 已修正&lt;br /&gt;
|-&lt;br /&gt;
| 去噪&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 运行时开销&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | CPU：低开销；GPU：低开销&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | CPU：中等开销；GPU：中等开销&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#e4ead3;&amp;quot; | CPU：无开销；GPU：中等开销&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bakery Volume 是一个与一组 3D 纹理（3 个 SH 纹理和一个可选的 shadowmask）关联的边界盒，使其非常易于使用和编程。Volumes 可以在运行时轻松地交换、移动、加载或卸载，也可以与预制件关联。它们不需要任何 Light Probe Groups 或手动探针布置；整个 Volume 都由均匀的探针体素网格填充。光/影泄漏会自动像处理光照贴图一样修复（尽管对于较大的体素尺寸，薄的双面墙可能会出现问题，但可以通过在不同侧使用不同 Volume 避免）。由于体素网格的均匀特性，也可以对其应用类似光照贴图的降噪，这是常规光探针无法做到的。此外，Bakery 着色器使用 [https://drive.google.com/file/d/1MK6Clw93q8ljijRjb4gQOzzaIjn1uF9Y/view Geomerics] 采样技巧，完全消除了高对比度 HDR 光照下 SH 有时会产生的 “ringing” 伪影。&lt;br /&gt;
&lt;br /&gt;
因此，Volumes 可以为动态物体生成干净、精细、高质量的烘焙光照（即来自静态物体并影响动态物体的光照，而不是相反）。&lt;br /&gt;
&lt;br /&gt;
Volume 方法的唯一缺点是每像素着色开销较高。其开销类似于 LPPV（随着屏幕上受体素影响的像素数量而缩放），但与 LPPV 不同的是，一旦烘焙完成，Volumes 本身不会再更新。多个 Volume 的混合可以通过稍微重叠它们来避免。&lt;br /&gt;
&lt;br /&gt;
====设置 Volume 变换====&lt;br /&gt;
[[File:Bvolgizmo.jpg|thumb|Volume 控制柄]]&lt;br /&gt;
当 BakeryVolume 被添加到一个 GameObject 时，场景视图中会出现一个边界盒控制柄。拖动小方块即可缩放它。&lt;br /&gt;
&lt;br /&gt;
还有其他方法可以更改 Volume 的大小和位置：&lt;br /&gt;
&lt;br /&gt;
* 将任何可渲染的 GameObject 拖入 “Wrap to object” 字段。Volume 会包裹该对象（及其子对象），以将它们完全包含在内。&lt;br /&gt;
* 如果同一个对象上添加了 Box Collider，则会出现 “Set from box collider” 和 “Set to box collider” 按钮。可以用它们快速在 Volume 和 Collider 之间复制数值。&lt;br /&gt;
&lt;br /&gt;
====分辨率====&lt;br /&gt;
当启用 “Adaptive resolution” 时，体素数量由 “Voxels per unit” 控制。禁用它可以手动输入分辨率。对于大多数 1 单位 = 1 米 的游戏来说，一个合理的 “Voxels per unit” 值是 2，但在某些情况下（例如动态门）使用较小但更高分辨率的 Volume 会更有利。&lt;br /&gt;
&lt;br /&gt;
====其他设置====&lt;br /&gt;
&lt;br /&gt;
* Enable baking: 是否需要（重新）计算 Volume？禁用可防止覆盖已有数据。&lt;br /&gt;
* Denoise: 在烘焙 Volume 后应用去噪。推荐用于高分辨率 Volume。避免用于覆盖许多光源的低分辨率 Volume，因为去噪器难以区分实际内容和噪声。&lt;br /&gt;
* Global: 自动将此 Volume 分配给所有兼容 Volume 的 Shader，除非它们有覆盖设置。内部会调用 Shader.SetGlobalTexture()/SetGlobalVector()。&lt;br /&gt;
====使用方法====&lt;br /&gt;
Volumes 可以分配给使用 Volume 感知 Shader 的对象。Bakery 自带实现该功能的 “Bakery Standard” Shader，以及 HDRP 和 URP 的 Shader 图。请查看 example_volumes 场景，了解应用 Volume 的各种方式。&lt;br /&gt;
&lt;br /&gt;
====提示====&lt;br /&gt;
&lt;br /&gt;
* 确保查看示例。&lt;br /&gt;
* 如果两个 Volume 相连，让它们略微重叠。重叠大小应等于最大动态对象的尺寸。这样在运行时简单切换 Volume 就能正常工作。&lt;br /&gt;
* 仅在动态对象实际可达的区域放置 Volume。例如，使用玩家高度限制 Volume 的高度。&lt;br /&gt;
&lt;br /&gt;
====旋转 Volumes====&lt;br /&gt;
如果启用 “Rotate around Y” 选项，Volumes 可以绕 Y 轴旋转。旋转开销非常低，只使用 2 个额外的浮点数据（预计算的角度 sin/cos）。&lt;br /&gt;
&lt;br /&gt;
还可以在运行时旋转 Volumes（Experimental -&amp;gt; “Support rotation after bake” 以及 Bakery Shader 中的类似选项），这种情况下 Volume 必须在初始旋转为零时进行烘焙。&lt;br /&gt;
&lt;br /&gt;
在 URP 中，这种动态旋转可以与 `BakeryURPVolumeGraphRotatable.shadergraph` 一起使用。&lt;br /&gt;
&lt;br /&gt;
对于全局 Volume，动态旋转会在组件被（重新）启用或调用 `volume.SetGlobalParams()` 时更新。使用局部旋转 Volume 时，需要手动在材质或 MaterialPropertyBlock 上设置旋转：&lt;br /&gt;
{{code|&amp;lt;nowiki&amp;gt;SetMatrix(&amp;quot;_VolumeMatrix&amp;quot;, volume.GetMatrix())&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
====技术信息====&lt;br /&gt;
Volumes 可以自动工作（查看示例场景），也可以通过脚本控制其使用方式。&lt;br /&gt;
&lt;br /&gt;
可以通过组件的以下公共属性获取 Volume 数据：&lt;br /&gt;
&lt;br /&gt;
* `bakedTexture0`：存储 L0 RGB 系数和 L1 Z 红色通道在 alpha 中。&lt;br /&gt;
* `bakedTexture1`：存储 L1 X RGB 系数和 L1 Z 绿色通道在 alpha 中。&lt;br /&gt;
* `bakedTexture2`：存储 L1 Y RGB 系数和 L1 Z 蓝色通道在 alpha 中。&lt;br /&gt;
* `bakedMask`：存储体积阴影遮罩。&lt;br /&gt;
* `bounds`：Volume 的包围盒。&lt;br /&gt;
&lt;br /&gt;
所有 `bakedTexture*` 使用 RGBAHalf（每体素 8 字节）格式，mask 使用 ARGB32（每体素 4 字节）。阴影遮罩也可以使用单通道 R8 格式（每体素 1 字节）。&lt;br /&gt;
&lt;br /&gt;
因此 Volume 的字节大小 = width * height * depth * 3 * 8 + （仅当使用阴影遮罩时）width * height * depth * 4（或使用 R8 mask 时为 width * height * depth）。&lt;br /&gt;
&lt;br /&gt;
[[使用手册#Compress_volumes|可以对 Volume 启用纹理压缩]]，使其体积显著减小。&lt;br /&gt;
&lt;br /&gt;
采样 Volume 需要特殊 Shader，这些 Shader 已包含在 Bakery 中。要在自定义 Shader 中添加 Volumes，请查看 HDRP/URP 包中包含的 `BakeryVolume_float()` 函数（位于 `BakeryDecodeLightmap.hlsl`）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Light Filter ===&lt;br /&gt;
[[File:Output optimized.gif|彩色玻璃，如在 &amp;quot;Bakery Real-Time Preview&amp;quot; 中所见。Bakery lightmapper 烘焙出的结果相同。]]&lt;br /&gt;
&lt;br /&gt;
将渲染器标记为光过滤器（Light Filter）。过滤器会用其颜色着色所有直接和间接光线，类似于现实中的光学滤镜，从而实现彩色透明效果（例如彩色玻璃）。唯一的参数是用于着色的纹理。&lt;br /&gt;
&lt;br /&gt;
* 光过滤器对象仍然会像其他对象一样接收光照贴图。&lt;br /&gt;
* 过滤器不会散射或模糊光线（如需此效果，请尝试 [[Subsurface_scattering|Subsurface Scattering]] 或 [[使用手册#Backface_GI|Backface GI]]）。&lt;br /&gt;
* 过滤器可以产生带颜色的阴影。如果灯光使用 [[使用手册#Shadowmask|Shadowmask]] 模式，则结果只会保存 R 通道（因为 Unity 仅支持单通道遮罩）。对于完全烘焙的阴影，则没有限制。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Sector ===&lt;br /&gt;
参见 '''[[Partial_scene_baking|Partial scene baking]]'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Always Render ===&lt;br /&gt;
如果添加到一个物体上，Bakery 在烘焙时将始终考虑该物体，即使它的 Renderer 被禁用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
=== Bakery Pack As Single Square ===&lt;br /&gt;
如果添加到一个物体上，Bakery 会将该物体及其子物体的 UV 视为单个组合方块，在自动图集打包或 Lightmap Group 的 Pack Atlas 模式下，它们之间永远不会被移动。整个子层级将作为一个整体打包。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
=== Bakery Shared LOD UV ===&lt;br /&gt;
如果添加到一个 LODGroup 上，将标记所有同名 LOD 共享同一个光照贴图。默认情况下，每个 LOD 网格会获得独立的光照贴图，占用图集空间；但如果已知同一个物体的 LOD 拥有相似的 UV2（或者在没有 UV2 且 UV1 不重叠的情况下），它们可以映射到图集的同一部分，从而节省内存。&lt;br /&gt;
这种技术也称为 [https://github.com/laurenth-personal/LODLightmapScripts/ Lightmap Stealing]。&lt;br /&gt;
&lt;br /&gt;
= 材质兼容性 =&lt;br /&gt;
&lt;br /&gt;
=== 漫反射和发光 ===&lt;br /&gt;
Bakery 利用 [https://docs.unity3d.com/Manual/MetaPass.html Meta Pass] 系统支持大多数 Unity 材质。所有内置、Surface、URP 和 HDRP 着色器都已经定义了正确的 Meta Pass。&lt;br /&gt;
&lt;br /&gt;
如果你使用的是 Unlit 着色器，需要按照 Unity 文档手动添加 Meta Pass。&lt;br /&gt;
&lt;br /&gt;
如果未定义该 Pass，Bakery 将假定 {{codeVar|_MainTex}}、{{codeVar|_BaseColorMap}} 或 {{codeVar|_Color}}（如果未设置纹理）为材质的漫反射（Albedo），并将 {{codeVar|_EmissionMap}} 和 {{codeVar|_EmissionColor}} 作为发光颜色。&lt;br /&gt;
&lt;br /&gt;
为了使发光生效，[https://docs.unity3d.com/ScriptReference/Material-globalIlluminationFlags.html Material.globalIlluminationFlags] 必须设置为 [https://docs.unity3d.com/ScriptReference/MaterialGlobalIlluminationFlags.BakedEmissive.html MaterialGlobalIlluminationFlags.BakedEmissive]。标准着色器会自动设置此值。&lt;br /&gt;
&lt;br /&gt;
=== 不透明度 ===&lt;br /&gt;
[[File:Upload 2019-1-25 0-4-30.png|thumb|材质参数被转换为 Cutout（默认）]]&lt;br /&gt;
[[File:Alphacombos dither.jpg|thumb|通过“Dither Transparency”选项添加半透明值]]&lt;br /&gt;
[[File:Alphacombos filter.jpg|thumb|Light Filter 组件用于红色平面，生成彩色阴影]]&lt;br /&gt;
&lt;br /&gt;
默认情况下，Bakery 始终从 {{codeVar|_MainTex}}、{{codeVar|_BaseColorMap}} 或 {{codeVar|_BaseMap}} 的 alpha 值获取全分辨率的不透明度，并将其视为 Cutout（1 位透明）。&lt;br /&gt;
&lt;br /&gt;
当启用 '''Dither Transparency''' 选项时，半透明值会自动转换为可变蓝噪声，然后被滤波/模糊，产生部分透明效果（以前可以通过自定义手动抖动贴图实现，但从 v1.97 起自动完成）。&lt;br /&gt;
&lt;br /&gt;
为了使不透明度生效，着色器的 [https://docs.unity3d.com/Manual/SL-SubShaderTags.html RenderType 标签] 必须为以下值之一：&lt;br /&gt;
&lt;br /&gt;
* {{codeVar|Transparent}}&lt;br /&gt;
* {{codeVar|TransparentCutout}}&lt;br /&gt;
* {{codeVar|TreeLeaf}}&lt;br /&gt;
&lt;br /&gt;
如果存在名为 {{codeVar|_Cutoff}} 的属性，它将影响 Cutout（因此 Standard 着色器的 Cutoff 滑块会自动生效）。&lt;br /&gt;
&lt;br /&gt;
在没有 Dither Transparency 的情况下，如果材质 RenderType 为 {{codeVar|Transparent}} 或 {{codeVar|TreeLeaf}}，则 {{codeVar|_Color}} 的 alpha 值会额外修改 Cutoff：&lt;br /&gt;
''finalCutoff = 1 - (1 - cutoff) * alpha''&lt;br /&gt;
&lt;br /&gt;
对于彩色透明效果，请使用 [[Manual#Bakery_Light_Filter|Light Filter]] 组件。&lt;br /&gt;
&lt;br /&gt;
有关漫反射半透明效果，请参考 [[#Backface GI|Backface GI]] 和 [[subsurface scattering]]。&lt;br /&gt;
&lt;br /&gt;
==== Alpha Meta Pass ====&lt;br /&gt;
从 v1.9 起，Bakery 还支持指定基于自定义着色器的透明度，但这需要使用兼容的着色器。要使用 ''Alpha Meta Pass''，需要执行以下步骤：&lt;br /&gt;
&lt;br /&gt;
* 在着色器中添加一个名为 '''BAKERY_META_ALPHA_ENABLE''' 的属性。例如：&lt;br /&gt;
  {{code|&amp;lt;nowiki&amp;gt;[HideInInspector] BAKERY_META_ALPHA_ENABLE (&amp;quot;Enable Bakery alpha meta pass&amp;quot;, Float) = 1.0&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
* 确保 RenderType 标签设置为上文提到的某个值。&lt;br /&gt;
* 声明一个名为 '''META_BAKERY''' 的 Pass。&lt;br /&gt;
* 在该 Pass 中检查 '''unity_MetaFragmentControl.w''' 是否非零，如果是，则返回计算出的透明度值。&lt;br /&gt;
&lt;br /&gt;
示例可参考包内的 ''Baked_Alpha_meta.shader''。&lt;br /&gt;
&lt;br /&gt;
注意：当前 Alpha Meta Pass 需要将 Light Probe Mode 设置为 L1 或 L2。&lt;br /&gt;
&lt;br /&gt;
=== Normal mapping ===&lt;br /&gt;
自定义表面法线可以与 [[#Baked Normal Maps|烘焙法线贴图]] 模式一起使用。不幸的是，Unity 的 Meta Pass 默认不输出法线信息，因此默认情况下，法线取自名为 {{codeVar|_BumpMap}} 的贴图，并通过 {{codeVar|_MainTex_ST}} 进行额外变换。&lt;br /&gt;
&lt;br /&gt;
然而，可以制作完全自定义的着色器，带有高级法线映射功能（例如混合多层法线），并使其兼容烘焙。要实现这一点，需要执行以下步骤：&lt;br /&gt;
&lt;br /&gt;
1. 在着色器中定义一个 Meta Pass，具体方法请参考 [https://docs.unity3d.com/Manual/MetaPass.html#ExampleMetaPassUnity 文档]。&lt;br /&gt;
&lt;br /&gt;
2. 将该 Pass 命名为 {{codeVar|&amp;quot;META_BAKERY&amp;quot;}}，而不仅仅是 {{codeVar|&amp;quot;META&amp;quot;}}。&lt;br /&gt;
&lt;br /&gt;
3. 包含文件 {{codeVar|&amp;quot;BakeryMetaPass.cginc&amp;quot;}}。&lt;br /&gt;
&lt;br /&gt;
4. 添加 {{codeVar|#pragma vertex vert_bakerymt}}。&lt;br /&gt;
&lt;br /&gt;
5. 如果 {{codeVar|unity_MetaFragmentControl.z}} 变量不为 0，着色器应返回世界空间法线。返回的法线应使用 {{codeVar|BakeryEncodeNormal}} 函数编码。&lt;br /&gt;
&lt;br /&gt;
在 Assets/Bakery/examples/shaders 中包含了两个实现了扩展 Meta Pass 的示例着色器。&lt;br /&gt;
&lt;br /&gt;
你也可以复制并修改 BakeryMetaPass.cginc 以满足你的需求，例如从顶点着色器传递额外数据。&lt;/div&gt;</summary>
		<author><name>Mr F</name></author>
		
	</entry>
	<entry>
		<id>https://geom.io/bakery/wiki/index.php?title=%E4%BD%BF%E7%94%A8%E6%89%8B%E5%86%8C&amp;diff=1821</id>
		<title>使用手册</title>
		<link rel="alternate" type="text/html" href="https://geom.io/bakery/wiki/index.php?title=%E4%BD%BF%E7%94%A8%E6%89%8B%E5%86%8C&amp;diff=1821"/>
		<updated>2025-11-05T13:25:20Z</updated>

		<summary type="html">&lt;p&gt;Mr F: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== 系统要求 ==&lt;br /&gt;
&lt;br /&gt;
使用 Bakery 需要：&lt;br /&gt;
&lt;br /&gt;
Windows（7 或更高版本）电脑。&lt;br /&gt;
&lt;br /&gt;
Nvidia 显卡。最低支持型号为 Kepler（GeForce 650 或更新型号，Quadro 显卡请查看规格）。&lt;br /&gt;
&lt;br /&gt;
64 位 Unity 编辑器。Bakery 已在 5.6 到 6 及更高版本上测试过，同时也在 Tuanjie 1.6.7 上通过测试。&lt;br /&gt;
&lt;br /&gt;
{{note|系统要求仅适用于开发者的电脑，而非目标平台。使用 Bakery 烘焙的光照贴图可以在任何地方使用。}}&lt;br /&gt;
&lt;br /&gt;
== 前提条件 ==&lt;br /&gt;
* 确保你的项目中没有任何脚本编译错误，否则也会导致 Bakery 的脚本无法编译。&lt;br /&gt;
* 确保你的显卡驱动是最新版本，如有需要请[https://www.nvidia.com/Download/index.aspx?lang=en-US 更新]。&lt;br /&gt;
&lt;br /&gt;
'''请使用 Game-Ready（标准）驱动程序，而不是 “Studio” 驱动。'''&lt;br /&gt;
&lt;br /&gt;
== 安装 ==&lt;br /&gt;
&lt;br /&gt;
1. 通过 [https://assetstore.unity.com/packages/tools/level-design/bakery-gpu-lightmapper-122218 Asset Store] 将 Bakery 导入到你的项目中。&lt;br /&gt;
&lt;br /&gt;
2. Unity 会显示要导入的文件列表。如果这是你第一次使用 Bakery，建议直接 点击 Import（导入）。有经验的用户可以取消选中 examples 文件夹，以进行更轻量的安装。&lt;br /&gt;
&lt;br /&gt;
文件将被导入到 `Assets/Bakery` 和 `Assets/Editor/x64/Bakery` 文件夹中。&lt;br /&gt;
这些文件夹之后可以移动。&lt;br /&gt;
&lt;br /&gt;
3. Unity 随后会导入 Bakery 并编译脚本。此时可能会弹出如下窗口：&lt;br /&gt;
&lt;br /&gt;
[[File:Goahead.png]]&lt;br /&gt;
&lt;br /&gt;
此时你应点击 “Go Ahead”（继续）。&lt;br /&gt;
&lt;br /&gt;
现在你应该能在编辑器中看到新增的 Bakery 菜单：&lt;br /&gt;
&lt;br /&gt;
[[File:bmenu.jpg]]&lt;br /&gt;
&lt;br /&gt;
== 快速开始 ==&lt;br /&gt;
&lt;br /&gt;
1. 添加一些模型或基础体，并将其标记为静态（Static）。&lt;br /&gt;
&lt;br /&gt;
'''用于光照贴图的网格必须具有不重叠的 UV2。如果存在 UV2，则会使用 UV2（否则使用 UV1）。如果你的模型没有为光照贴图进行展开，请在资源中勾选 Generate Lightmap UVs（生成光照贴图 UV）。'''&lt;br /&gt;
Unity 的基础体已经具有正确的 UV2。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Staticmarked.jpg|320px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. 选择方向光（Unity 为你创建的那个），并添加 '''Bakery Direct Light''' 组件。&lt;br /&gt;
   {{note|Bakery 和 Unity 使用独立的光源组件。}}&lt;br /&gt;
&lt;br /&gt;
3. Bakery Direct Light 有许多可调选项，但你可以轻松将其与 Unity 光源匹配。点击 '''Match lightmapped to real-time'''。现在 Bakery 光源的颜色应与 Unity 默认的方向光相同，呈黄色调。&lt;br /&gt;
&lt;br /&gt;
[[File:Matching.jpg|640px]]&lt;br /&gt;
&lt;br /&gt;
{{note|Direct Light 组件可能会提示项目未使用线性光强度。问题在于，Unity 默认会对光源颜色应用伽马校正 [https://twitter.com/guycalledfrank/status/1001108508614553600 不正确]。&lt;br /&gt;
可以通过[https://docs.unity3d.com/ScriptReference/Rendering.GraphicsSettings-lightsUseLinearIntensity.html 脚本]启用正确模式。&lt;br /&gt;
这就是 “Fix” 按钮的作用。如果你已经在非线性光强模式下设置了许多光源，并且不想再次更改它们，可以跳过修复。即使你按了 “Fix”，也可以随时撤销此更改。&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. 要获得带阴影的环境光，请创建 Skylight（Bakery-&amp;gt;Create-&amp;gt;Skylight）。&lt;br /&gt;
&lt;br /&gt;
[[File:Menusky.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. 选择 Skylight，为它设置一些偏蓝的颜色，然后点击 '''Match scene skybox to this light'''。   这将使场景的 skybox 与光照完全匹配。&lt;br /&gt;
   {{note|将 Unity 的 skybox 与 Bakery Skylight 匹配是可选的，但对正确性很有用，可以确保可见环境和引擎内的反射探针与烘焙光照一致。目前此选项仅适用于 Standard 渲染管线。}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Skycomp.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. 点击 Bakery-&amp;gt;Render Lightmap。默认情况下，Full Lighting 模式是激活的。它会烘焙所有光源的直接和间接光照贡献。如果你想将实时阴影与烘焙全局光照（GI）结合使用，请将模式更改为 '''Indirect'''。&lt;br /&gt;
&lt;br /&gt;
[[File:Bakerywindow.jpg]]&lt;br /&gt;
&lt;br /&gt;
{{note| Bakery 可能会提示你正在使用旧的 [https://docs.unity3d.com/Manual/LinearLighting.html gamma mode]。如果你在意光照质量，强烈建议使用线性模式。如果你的项目已经在错误的伽马模式下设置好了，并且不想更改，或者是发布到不支持线性模式的移动设备上，也可以忽略此提示。}}&lt;br /&gt;
&lt;br /&gt;
7. 点击 '''Render'''。&lt;br /&gt;
&lt;br /&gt;
8. 完成！现在你应该已经得到烘焙的全局光照（GI）：&lt;br /&gt;
&lt;br /&gt;
[[File:Bakedgi.jpg]]&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 ==&lt;br /&gt;
&lt;br /&gt;
所有渲染设置都可以通过 Bakery-&amp;gt;Render Lightmap 访问。设置会为每个场景单独保存。Bakery 窗口顶部的选项允许你在 Simple（简单）、Advanced（高级）和 Experimental（实验）设置之间切换，每个后续模式都会显示更多可调选项。对于大多数场景，Simple 模式已经足够，是入门的好方法。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render mode ===  &lt;br /&gt;
定义要烘焙的光照贴图类型。  &lt;br /&gt;
&lt;br /&gt;
===== Full Lighting =====&lt;br /&gt;
烘焙所有 Bakery 光源的完整直接光和间接光。&lt;br /&gt;
{{note|在 2017.3 之前的 Unity 版本中，如果同一对象上同时有 Unity 和 Bakery 组件，你需要手动禁用 Unity 组件以避免亮度加倍。在较新版本中，实时效果会自动对烘焙光源禁用，就像内置光照烘焙器一样。}}&lt;br /&gt;
&lt;br /&gt;
===== Indirect =====&lt;br /&gt;
[[File:Image26.png|thumb|Unity 支持的不同渲染模式对比]]&lt;br /&gt;
基础混合模式。它会查看每个光源上的 Baked Contribution 选择器：如果设置为 ''Direct And Indirect''，则光源会像在 Full Lighting 模式下一样被烘焙。如果设置为 ''Indirect Only''，则只会烘焙该光源的间接光照（GI）。在后一种情况下，你应保持对象上的 Unity 光源和 Bakery 光源同时存在，一个提供实时直接光照，另一个提供预计算的全局光照（GI）。&lt;br /&gt;
&lt;br /&gt;
[[File:Indirectonly.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== Shadowmask =====&lt;br /&gt;
[[File:Image21.png|thumb|左：完全烘焙的光照。中：动态光源 + 烘焙 GI。右：胶囊形阴影、凹凸贴图和高光为动态光照，但立方体阴影和 GI 为烘焙光照。]]&lt;br /&gt;
[[File:Image6.png|thumb|当相机足够远离场景，或者动态阴影被禁用时，场景将呈现如下效果]]&lt;br /&gt;
更高级的混合模式。它通过生成两种类型的光照贴图来工作——一种包含烘焙颜色（如 Indirect 模式），另一种包含静态物体的阴影。它有几个优点：&lt;br /&gt;
* 实时阴影只需渲染少量动态对象，而不是整个场景。&lt;br /&gt;
* 实时阴影与烘焙阴影可以正确融合。&lt;br /&gt;
* 实时光源可以渲染凹凸贴图、高光和其他表面效果，同时仍会被高质量烘焙阴影遮挡。&lt;br /&gt;
[https://docs.unity3d.com/Manual/LightMode-Mixed-Shadowmask.html 更多详情]&lt;br /&gt;
&lt;br /&gt;
要启用此行为，你必须在同一对象上同时存在 Unity 光源和 Bakery 光源，并将 Baked Contribution 设置为 ''Shadowmask and Indirect''。未标记的光源将按 Indirect 模式进行烘焙。&lt;br /&gt;
&lt;br /&gt;
[[File:Smask22.jpg]]&lt;br /&gt;
&lt;br /&gt;
===== Distance Shadowmask =====&lt;br /&gt;
此复选框仅在你选择 Shadowmask 时可见，并且只是切换项目 [https://docs.unity3d.com/Manual/LightMode-Mixed-ShadowmaskMode.html Quality Settings] 中同名的设置。&lt;br /&gt;
[https://docs.unity3d.com/Manual/LightMode-Mixed-DistanceShadowmask.html 更多详情]&lt;br /&gt;
{{note|由于缺少对应的脚本 API，该复选框在 Unity 5.6.x 上不可见。你可以在 Window-&amp;gt;Lighting-&amp;gt;Mixed Lighting-&amp;gt;Lighting Mode 中切换该设置。}}&lt;br /&gt;
{{note|在 Unity 版本 &amp;lt; 2017.3 中，由于 API 限制，渲染 Shadowmask 光照贴图会清除光照探针。烘焙后需要重新渲染光照探针。在较新版本中不应发生此问题。}}&lt;br /&gt;
&lt;br /&gt;
===== Subtractive =====&lt;br /&gt;
&lt;br /&gt;
启用 [https://docs.unity3d.com/Manual/LightMode-Mixed-Subtractive.html Subtractive] 光照模式。&lt;br /&gt;
&lt;br /&gt;
此选项对光照贴图本身没有任何特殊作用，实际上它的工作方式与 Full Lighting 相同。&lt;br /&gt;
&lt;br /&gt;
唯一的区别是，它还会将实时 Unity 光源设置为与 Subtractive 模式兼容（因为无法通过 UI 完成此操作）。&lt;br /&gt;
&lt;br /&gt;
你还需要在 [https://docs.unity3d.com/Manual/GlobalIllumination.html#MixedLighting Unity Lighting] 窗口中额外设置全局减法参数（例如全局阴影颜色）。&lt;br /&gt;
&lt;br /&gt;
===== Ambient Occlusion Only =====&lt;br /&gt;
仅烘焙环境光遮蔽（AO）。如果你很清楚自己在做什么，这可能会有用。请确保设置 [[#Ambient_occlusion|AO 选项]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Directional mode ===&lt;br /&gt;
[[File:Image3.png|thumb|不同方向模式的对比]]&lt;br /&gt;
定义了方向信息的烘焙方式。标准光照贴图每个像素只存储单一颜色，而方向光照贴图为着色器提供了关于该像素周围半球内光照变化的提示。这些数据用于在完全烘焙的区域中结合法线贴图。如果将其应用到内置的 [[#Bakery_shaders|Bakery]] 着色器中，还可以产生**近似高光反射**效果。&lt;br /&gt;
&lt;br /&gt;
===== None =====&lt;br /&gt;
不包含方向数据，每个像素仅有单一颜色。&lt;br /&gt;
&lt;br /&gt;
===== Baked Normal Maps =====&lt;br /&gt;
依然没有方向数据，但在渲染光照贴图时会考虑法线贴图。此方式在运行时没有额外开销。由于光照贴图的分辨率通常低于法线贴图，结果可能显得模糊。其他问题包括：由于缺乏 mipmapping，远处可能出现锯齿，以及降噪步骤可能导致细节被涂抹。要了解如何在此模式下使用具有程序化法线的自定义着色器，请参阅 [[#Normal_mapping|Normal Mapping]] 章节。&lt;br /&gt;
&lt;br /&gt;
===== Dominant Direction =====&lt;br /&gt;
此模式类似于 Unity 中 Enlighten 和 Progressive 烘焙器的实现。它与大多数着色器兼容，仅生成一张额外的贴图，运行时开销极小。缺点是凹凸贴图的效果较弱，略显灰暗，与实时光照下的同一物体相比可能差异较大。&lt;br /&gt;
&lt;br /&gt;
===== RNM =====&lt;br /&gt;
基于最初为《Half-Life 2》开发的 [https://steamcdn-a.akamaihd.net/apps/valve/2004/GDC2004_Half-Life2_Shading.pdf Radiosity Normal Mapping] 技术（相关演示文稿），后来被许多游戏采用（如《Mirror's Edge》）。此模式总共生成三张 HDR 贴图，是内存占用最高的模式之一，但运行时开销仍相对较低。该模式比 Dominant Direction 更精确，能更好地再现表面反差，并能正确处理来自不同角度、具有不同颜色的光照对法线贴图的影响。&lt;br /&gt;
&lt;br /&gt;
===== SH =====&lt;br /&gt;
基于论文《[https://media.contentapi.ea.com/content/dam/eacom/frostbite/files/gdc2018-precomputedgiobalilluminationinfrostbite.pdf Precomputed Global Illumination in Frostbite]》。这是最高质量的模式，能提供更好的表面对比度，并准确表现来自不同方向、不同颜色的光照。总共生成四张贴图，其中仅一张为 HDR，因此比 RNM 占用更少内存。运行时开销略高于 RNM。&lt;br /&gt;
&lt;br /&gt;
===== MonoSH =====&lt;br /&gt;
[[File:FY8Ru8hWIAAdYYH.jpg|thumb|Dominant Direction、完整 SH 与 MonoSH 的尺寸/质量对比]]&lt;br /&gt;
与 SH 类似，但使用单色的 L1 方向系数。表面对比度同样良好，虽然无法准确表现来自不同方向的不同颜色光照，但对多数场景来说已经足够。仅生成一张额外贴图，因此显存占用与带宽需求与 Dominant Direction 相近；事实上更低，因为 Dominant Direction 使用 RGBA 贴图，而 MonoSH 只需 RGB。该贴图通过内置的方向光照贴图系统传递，但''在标准着色器下显示不正确''。请务必使用兼容的着色器。&lt;br /&gt;
&lt;br /&gt;
===== 限制 =====&lt;br /&gt;
&lt;br /&gt;
* RNM 和 SH/MonoSH 只能与 [[#Bakery_shaders|Bakery shader]] 一起使用，或者需要对你的着色器进行调整。&lt;br /&gt;
* 在 RNM 和 SH 模式下，不会生成标准的颜色光照贴图。你需要确保场景中所有材质都使用 Bakery Shader，或者使用 [[#Bakery_Lightmap_Group_Selector|Lightmap Groups]] 将 RNM/SH 对象与其他对象分开。&lt;br /&gt;
* RNM 和 SH 贴图是通过 [https://docs.unity3d.com/ScriptReference/MaterialPropertyBlock.html MaterialPropertyBlock] 应用于对象的，因此在 Unity 的 Lighting 窗口中可能无法完全显示。&lt;br /&gt;
* Dominant Direction、RNM 和 SH/MonoSH 模式可能需要为全局光照（GI）和光照网格使用更多采样，以获得相近的质量。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Texels per unit ===&lt;br /&gt;
[[File:Texelscomp.jpg|thumb|1 vs 10 texels per unit]]&lt;br /&gt;
每个世界单位的光照贴图像素（Texels）近似数量。它会影响生成光照贴图的数量和分辨率。&lt;br /&gt;
&lt;br /&gt;
入门示例值：&lt;br /&gt;
&lt;br /&gt;
* 大型户外区域（城市）：1 - 5&lt;br /&gt;
* 中型户外区域（几条小巷）：10 - 20&lt;br /&gt;
* 高质量室内场景：100&lt;br /&gt;
&lt;br /&gt;
假设场景比例大约为 1 单位 = 1 米。在 Unity 中使用这种比例通常是推荐的，以便更好地导航和进行物理模拟。如果你的比例不同，请相应地调整 Texels。&lt;br /&gt;
&lt;br /&gt;
请注意，Texels Per Unit 是基础分辨率，但每个对象还可以通过 Mesh Renderer 上的 &amp;quot;Scale in Lightmap&amp;quot; 选项以及 Bakery 窗口中的 &amp;quot;Scale per map type&amp;quot; 进行额外调整。&lt;br /&gt;
&lt;br /&gt;
{{note| 将 &amp;quot;Scale in Lightmap&amp;quot; 设置为 0 的对象不会被烘焙，但仍会投射阴影并影响全局光照（GI）。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Max resolution ===&lt;br /&gt;
光照贴图的最大尺寸限制。如果对象无法容纳在单张光照贴图中（根据当前的 Texels Per Unit 值），将会分配额外的光照贴图。同样的四个正方形对象可以使用四张 512x512 的贴图，也可以使用一张 1024x1024 的贴图。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bounces ===&lt;br /&gt;
[[File:Image36.png|thumb|注意更多的反弹会为封闭空间带来更多光照。]]&lt;br /&gt;
定义光线在表面上反弹的次数。通常，对于户外场景（例如城市），较低的反弹次数就足够了，而对于封闭场景（室内、洞穴），则需要较高的反弹次数。&lt;br /&gt;
&lt;br /&gt;
虽然滑块最多限制为 5 次反弹，但可以在数字输入框中输入任意反弹次数。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Samples ===&lt;br /&gt;
[[File:Image7.png|thumb|左：Samples = 4，右：Samples = 16。为了演示，去噪功能已关闭。]]&lt;br /&gt;
影响全局光照（GI）的质量。典型值为 16 到 32。&lt;br /&gt;
&lt;br /&gt;
{{note| 可以输入超出滑块最大值的任意数字，但请注意，该数字表示最终光线数量的平方根，例如 32 表示 1024 条光线，64 表示 4096 条光线，依此类推。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GPU Priority ===&lt;br /&gt;
在 GPU 处理光照贴图时，操作系统和其他软件的响应可能会变慢。此选项允许你在烘焙速度和系统响应之间进行平衡。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render ===&lt;br /&gt;
为所有打开的场景烘焙光照贴图。&lt;br /&gt;
如果 [[使用手册#Light_probe_mode|Light Probe Mode]] 设置为 L1 或 L2，也会烘焙 [https://docs.unity3d.com/Manual/LightProbes.html 光照探针]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Render Light Probes ===&lt;br /&gt;
为所有打开的场景烘焙 [https://docs.unity3d.com/Manual/LightProbes.html 光照探针]。&lt;br /&gt;
&lt;br /&gt;
请注意，要在 Shadowmask 模式下对动态对象获得正确的混合光阴影，你还需要启用 [[使用手册#Occlusion_probes|occlusion probes]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Render Reflection Probes ===&lt;br /&gt;
为所有打开的场景烘焙反射探针。此按钮仅为方便起见，会调用引擎内置的反射探针更新功能。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update Skybox Probe ===&lt;br /&gt;
为当前的 skybox 烘焙全局漫反射和反射探针。与 “Render Reflection Probes” 一样，它仅调用引擎内置函数。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Occlusion probes ===&lt;br /&gt;
在渲染光照探针时，允许 Unity 使用当前选择的内置光照烘焙器烘焙遮挡探针（occlusion probes）。遮挡探针是存储在普通光照探针中的附加数据，可以防止动态对象在阴影区域被错误照亮。目前在 Unity 中无法使用自定义遮挡探针，必须调用内置光照烘焙器来完成此操作。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Warnings ===&lt;br /&gt;
这些选项会在按下任意 Render 按钮后对场景进行验证，并显示警告对话框，询问是否继续或停止烘焙过程。&lt;br /&gt;
&lt;br /&gt;
* Suppress all popups（屏蔽所有弹窗）：按下 Render 后不显示任何对话框。&lt;br /&gt;
* UV validation（UV 验证）：检查所有模型是否具有完全正确的光照贴图 UV，特别是 UV 是否位于 0-1 范围内且不重叠。&lt;br /&gt;
* Overwrite check（覆盖检查）：显示哪些光照贴图文件将被覆盖。&lt;br /&gt;
* Memory check（内存检查）：显示大致所需的视频内存量。&lt;br /&gt;
* Sample count check（采样数检查）：检查是否有光源、GI 或 AO 的采样数不合理，可能导致 GPU 超出可用资源。&lt;br /&gt;
* Lightmapped prefab validation（光照贴图预制体验证）：验证光照贴图预制体，并在某些预制体将被覆盖时发出通知。&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 (Advanced) ==&lt;br /&gt;
=== Light probe mode ===&lt;br /&gt;
更改光照探针的烘焙方式。&lt;br /&gt;
&lt;br /&gt;
* Legacy（传统模式）：使用 Render Light Probes 按钮生成探针。点光源和方向光在光照烘焙器中计算，而区域光/天空光/间接光则通过在每个探针位置渲染立方体贴图收集。结果以 [https://docs.unity3d.com/ScriptReference/Rendering.SphericalHarmonicsL2.html L2] 球谐（spherical harmonics）形式存储。缺点是立方体贴图渲染速度慢，并且在游戏中使用的着色器未物理正确表示光照表面，或者项目为移动平台设置时，光照贴图和探针可能不匹配（Unity 可能会裁剪高强度值）。&lt;br /&gt;
&lt;br /&gt;
* L1：在点击 Render 时，光照探针会与光照贴图一起渲染。此选项提供更高的烘焙性能，并保证探针光照与光照贴图匹配。结果以 L1 球谐形式存储（仍可被普通着色器使用）。使用 [[#Bakery_shaders|Bakery shader]] 的 Non-Linear Light Probe SH 选项可以进一步提升结果。&lt;br /&gt;
&lt;br /&gt;
* L2：更高质量（完整 L2 球谐）。与 L1 一样，会自动与光照贴图一起渲染。与 L1 相比，性能影响可忽略不计。应在所有着色器下显示正常。探针对比度/方向性/振铃去除可通过 Project Settings -&amp;gt; Bakery -&amp;gt; “Ringing removal for L2 light probes” 调整。&lt;br /&gt;
&lt;br /&gt;
'''在 Unity 2019.3 中似乎存在一个 bug，如果启用 Occlusion Probes 选项，Legacy 光照探针的颜色无法正确保存。使用 Occlusion Probes 时，默认且推荐使用 L2 模式。'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Asset UV Processing ===&lt;br /&gt;
配置资产的 UV 间距（padding）调整。可选值：&lt;br /&gt;
&lt;br /&gt;
* Don't change（不更改）：不修改资产。&lt;br /&gt;
* Adjust UV padding（调整 UV 间距）：会查找具有自动生成 UV 的模型（资产上启用 “Generate Lightmap UVs”），并进一步调整它们，使每个网格的 UV 岛之间具有适当间距。导入器设置中的全模型 Pack Margin 会被忽略。系统会根据每个网格的面积和光照贴图分辨率计算出最优值。&lt;br /&gt;
* Adjust UV padding for new meshes only（仅调整新网格的 UV 间距）：与上面相同，但会跳过之前至少调整过一次的模型。&lt;br /&gt;
* Remove UV adjustments（移除 UV 调整）：撤销所有之前的 UV 调整，使自动展开的模型恢复到 Unity 原始展开的样子。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoiser ===&lt;br /&gt;
设置所需的去噪器。可选值：&lt;br /&gt;
&lt;br /&gt;
* Optix 5：使用 OptiX 5.1 AI 去噪器（之前称为 “Legacy denoiser”）。在 GPU 上运行。支持从 [https://en.wikipedia.org/wiki/Kepler_(microarchitecture) Kepler]（通常是 GeForce 6xx）到 [https://en.wikipedia.org/wiki/Turing_(microarchitecture) Turing]（通常是 GeForce 20xx）的所有显卡。不支持 [https://en.wikipedia.org/wiki/Ampere_(microarchitecture) Ampere]（30xx）。OptiX 5.1 使用嵌入的静态训练数据集，因此不受驱动实现影响。&lt;br /&gt;
&lt;br /&gt;
* Optix 6：使用 OptiX 6.0 AI 去噪器（之前为默认选项）。在 GPU 上运行。在 Kepler（6xx）显卡上似乎无法使用，但在更新的显卡上均可运行，包括 Ampere（30xx）。自 6.0 起，OptiX 去噪器的训练数据集存储在驱动中。在 v442.50 之前，其行为类似于 OptiX 5.1；但之后 NVIDIA [https://forums.developer.nvidia.com/t/optix7-denoiser-different-results-with-different-version-of-drivers/117989/2 更改了数据集]，结果可能有所不同。更新后的数据集有时可能产生网格状图案和更亮的边缘（仍可通过 “Denoise: fix bright edges” 修复），但运行速度更快。&lt;br /&gt;
&lt;br /&gt;
* Optix 7：使用 OptiX 7.2 AI 去噪器。行为类似 OptiX 6.0，但在 Ampere（30xx）上可能支持更好。&lt;br /&gt;
&lt;br /&gt;
* OpenImageDenoise：使用 Intel Open Image Denoise 库。在 CPU 上运行（任何支持 SSE 4.1 的 CPU）。可能略慢于 OptiX，但质量可比。&lt;br /&gt;
&lt;br /&gt;
* OpenImageDenoise2：使用 Intel Open Image Denoise 2，CUDA 模式。在 GPU 上运行，性能与 OptiX 6/7 相当，质量与 CPU 版本相同。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Adjust sample positions ===&lt;br /&gt;
寻找最佳采样位置以防止光照泄漏。算法详情可参考 [https://ndotl.wordpress.com/2018/08/29/baking-artifact-free-lightmaps/#leaks 此处]。在某些情况下（通常是大型且多边形极少、法线平滑的几何体），可能会产生不正确的结果，此时可以将其禁用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Unload scenes before render ===&lt;br /&gt;
在烘焙前卸载 Unity 场景以释放显存。复杂场景仅在编辑器中显示就可能占用数 GB 的显存。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Denoise ===&lt;br /&gt;
[[File:Image31.png|thumb|左：未开启 “Denoise”，右：开启 “Denoise”。]]&lt;br /&gt;
如果启用，将应用去噪算法。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Fix Seams ===&lt;br /&gt;
[[File:Image22.png|thumb|左：缝隙（“Fix Seams” 关闭），右：缝隙已修复（“Fix Seams” 开启）。]]&lt;br /&gt;
如果启用，将尝试融合由 UV 不连续造成的缝隙。对平滑几何体很有用，包括 Unity 默认的球体。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Split by scene ===&lt;br /&gt;
如果同时加载多个场景，并且启用此选项，每个场景将拥有自己的一套光照贴图，而不会与其他场景共享。这对于在运行时流式加载场景时限制纹理占用量非常有用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hole filling ===&lt;br /&gt;
[[File:Holefilling.jpg|thumb|“Hole filling” 关闭与开启的对比。]]&lt;br /&gt;
如果 Atlas Packer 设置为 xatlas，将尝试填充每个孔洞，从而生成更高效的贴图集。对于几何体非常复杂的场景，可能会增加场景导出时间，但通常推荐开启。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Min resolution ===&lt;br /&gt;
光照贴图的最小尺寸限制。可用于在生成大量小而完全填充的光照贴图与少量未完全填充的光照贴图之间进行平衡。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Scale per map type ===&lt;br /&gt;
允许你对颜色贴图、Shadowmask 和方向贴图设置不同的分辨率缩放。例如，常见情况是间接光颜色分辨率较低，但 Shadowmask 分辨率较高。请注意，缩放在光照贴图渲染完成后才应用，因此不会节省烘焙时间。如果启用了 “Adjust UV padding”，间距将基于最低分辨率的贴图，以防止像素泄漏。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Checker preview ===&lt;br /&gt;
[[File:Image12.png|thumb|Checker Preview 功能演示。]]&lt;br /&gt;
如果勾选了 “Show checker” 选项，场景视图将在可见对象上渲染棋盘格图案，以展示光照贴图像素大小。这对于在烘焙前确保 Texels Per Unit 和其他影响分辨率的设置使用合理数值非常有用。&lt;br /&gt;
&lt;br /&gt;
启用 Checker Preview 将强制 Bakery 执行贴图集打包。可能需要一些时间，但通常不会超过几秒钟。在修改场景内容后，按下 “Refresh checker” 可重新打包场景以查看更改。&lt;br /&gt;
&lt;br /&gt;
Checker Preview 还使用随机颜色显示场景将如何被分割到不同的光照贴图中。&lt;br /&gt;
&lt;br /&gt;
{{note| 当前 Checker Preview 无法显示地形的正确像素大小。}}&lt;br /&gt;
&lt;br /&gt;
==== Atlas preview ====&lt;br /&gt;
[[File:FN-TmhRXwAE9i2I.png|thumb|Atlas Preview 功能演示]]&lt;br /&gt;
当 Checker Preview 开启时，会显示 Atlas Preview 按钮。点击它将打开一个新窗口，显示未来光照贴图的 UV 布局。点击 &amp;quot;&amp;lt;&amp;quot; 和 &amp;quot;&amp;gt;&amp;quot; 按钮可浏览各个光照贴图。&lt;br /&gt;
这对于在烘焙前检查打包质量和光照贴图数量非常有用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Emissive boost ===&lt;br /&gt;
将任何表面自发光（emission）乘以此数值。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Indirect boost ===&lt;br /&gt;
将所有反弹光照乘以此数值。作用与光源组件上的 Indirect Intensity 相同，但为全局设置。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Backface GI ===&lt;br /&gt;
[[File:Image30.jpg|thumb|Backface GI]]&lt;br /&gt;
[[File:Image35.png|thumb|左：“Backface GI” = 0，右：“Backface GI” = 1。注意阴影区域接收到更多的绿色光照。]]&lt;br /&gt;
决定光线通过前面表面到达背面并被全局光照（GI）反弹的程度。这对于薄的半透明表面（如树叶）尤其有用。取值范围为 0-1。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Ambient occlusion ===&lt;br /&gt;
[[File:Image15.png|thumb|左：AO intensity = 0，右：AO intensity = 1。]]&lt;br /&gt;
一种简单的非物理环境光遮蔽（Ambient Occlusion，AO），可在最终场景光照上叠加以增强美观效果。&lt;br /&gt;
&lt;br /&gt;
* Intensity（强度）：控制 AO 效果的可见度。值为 0 时禁用该效果。&lt;br /&gt;
* Radius（半径）：决定 AO 效果使用的光线距离。较小的值产生局部遮蔽（角落、褶皱），较大的值则更类似 Skylight，从远处物体产生阴影。&lt;br /&gt;
* Samples（采样数）：影响环境光遮蔽的质量。典型值为 4 到 32。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dither transparency ===&lt;br /&gt;
通过自动抖动不透明度贴图来启用半透明阴影。[[使用手册#Opacity|了解 Bakery 如何处理不透明度贴图]]。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== RTX Mode ===&lt;br /&gt;
启用 RTX 硬件加速。仅 RTX 显卡可受益于此选项。最低支持的驱动版本为 418。&lt;br /&gt;
&lt;br /&gt;
驱动可以在大多数非 RTX Nvidia 显卡上模拟 RTX 模式，但通常会更慢。&lt;br /&gt;
&lt;br /&gt;
在 Ampere（3xxx）或更新的显卡上，RTX 模式 ''必须'' 启用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Export terrain trees ===&lt;br /&gt;
如果启用，绘制在地形上的树木将影响光照。树木本身不会被烘焙。请注意，在烘焙过程中，每棵树都使用最高可能的 LOD 等级。对于多公里范围且模型高度复杂的森林场景，不建议使用此选项。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Terrain optimization ===&lt;br /&gt;
如果启用（默认），地形将使用独立的光线追踪技术以利用其高程图几何结构。否则，它们将像其他普通网格一样处理。地形优化可以显著减少高分辨率地形所需的内存占用。在某些情况下，它还能加快地形烘焙速度，但在其他情况下（尤其是简单低分辨率地形）可能需要禁用该选项。&lt;br /&gt;
&lt;br /&gt;
{{note| 地形优化当前不兼容绘制的地形洞。需禁用此选项才能使其正常工作。}}&lt;br /&gt;
{{note| 地形优化仅支持非 RTX 模式。}}&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Light Mesh batch limit ===&lt;br /&gt;
如果该值大于 0，会将多个 Light Mesh 合并为一个，前提是它们具有相同设置并影响相同的 Lightmap Groups，同时将它们的总采样数限制为该值（例如，如果限制为 64，则可以合并 2 个采样数为 32 的灯光，或 4 个采样数为 16 的灯光，等等）。在拥有大量 Light Mesh 的场景中，这可以提升性能。但设置过高时需小心，因为 GPU 在一次处理过多采样时可能触发操作系统驱动超时。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Compress volumes ===&lt;br /&gt;
如果启用，将对体积 3D 贴图应用纹理压缩，并将 Bakery 着色器切换到相应的采样模式。不推荐对分辨率非常低的体积使用此选项。体积大小可能会被调整为 4 的倍数。&lt;br /&gt;
&lt;br /&gt;
注意事项：&lt;br /&gt;
&lt;br /&gt;
* 目前仅支持压缩为 BC6H/BC7 纹理格式（桌面/主机平台）。&lt;br /&gt;
* 体积压缩仅支持 Unity 2020.1 或更高版本。&lt;br /&gt;
* 目前仅标准渲染管线的 Bakery 着色器支持使用压缩体积贴图。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Samples multiplier ===&lt;br /&gt;
将所有阴影和 GI 采样数乘以指定因子。可用于在草稿质量和最终质量之间快速切换。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Tile size ===&lt;br /&gt;
与 [[#GPU Priority|GPU Priority]] 相同，但这里设置的是贴图块（tile）大小。Bakery 会将光照贴图拆分为更小的块，并一次更新一个块。块越小，GPU 工作被中断的次数越多，系统响应性可能更好。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Temp path ===&lt;br /&gt;
临时文件夹。在渲染过程中，Bakery 可能需要几个 GB 的可用空间。将此文件夹放在 SSD 上相比 HDD 可略微加快渲染速度。目前，该文件夹不会自动清理。你可以随时手动删除其内容（渲染时除外），或通过 Bakery -&amp;gt; Utilities -&amp;gt; Clear cache 清理。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Output path ===&lt;br /&gt;
光照贴图文件夹。所有光照贴图，以及 lightprobe 和顶点颜色（vertex color）资源都将保存在此处。该路径相对于你的 Assets 文件夹。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Use scene named output path ===&lt;br /&gt;
如果启用此选项，输出路径将自动设置为与当前活动场景同名的文件夹（Assets/CurrentSceneName/）。这与 Unity 内置光照贴图烘焙器的行为类似。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Render Selected Groups ===&lt;br /&gt;
仅烘焙包含所选对象的 Lightmap Groups。&lt;br /&gt;
不仅仅是所选对象会被重新绘制，它们所属的所有 Lightmap Groups 都会被处理。其他光照贴图不会被更新。如果对象不属于某个手动分配的组，则使用相同光照贴图的场景部分将被重新烘焙。&lt;br /&gt;
&lt;br /&gt;
目前，使用 [[Partial_scene_baking|Sectors]] 进行场景部分烘焙更为方便。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Beep on finish ===&lt;br /&gt;
如果启用，Bakery 在烘焙完成时会播放提示音。&lt;br /&gt;
&lt;br /&gt;
== 渲染设置 (Experimental) ==&lt;br /&gt;
=== Unwrapper ===&lt;br /&gt;
如果启用 [[#Asset_UV_Processing|Adjust UV Padding]]，则定义将使用的展开器（unwrapper）。&lt;br /&gt;
&lt;br /&gt;
* Default：使用 Unity 标准展开器。Bakery 会为每个具有不同间距参数的网格调用 [https://docs.unity3d.com/ScriptReference/Unwrapping.GenerateSecondaryUVSet.html Unwrapping.GenerateSecondaryUVSet]。&lt;br /&gt;
* xatlas：使用 [https://github.com/jpcy jpcy] 的 [https://github.com/jpcy/xatlas xatlas]，这是 [https://github.com/castano Ignacio Castaño] 的 [https://github.com/Thekla/thekla_atlas thekla_atlas] 的修改版。thekla_atlas 曾用于游戏《The Witness》（[http://the-witness.net/news/2010/03/graphics-tech-texture-parameterization/ 参见博客文章]）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Atlas Packer ===&lt;br /&gt;
选择在将不同对象的 UV 布局打包到大型光照贴图集时使用的算法。&lt;br /&gt;
* Default：Bakery 在 v1.7 之前使用的原始算法。&lt;br /&gt;
* xatlas：使用 xatlas。&lt;br /&gt;
&lt;br /&gt;
某些功能仅支持特定的贴图集打包器：&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Default&lt;br /&gt;
! xatlas&lt;br /&gt;
|-&lt;br /&gt;
| [[使用手册#Bakery_Lightmap_Group_Selector|Override resolution]]&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
|-&lt;br /&gt;
| 高效 LOD 打包&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
|-&lt;br /&gt;
| [[使用手册#Hole_filling|Hole filling]]&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 不支持&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 支持&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
请注意，贴图集打包器（Atlas Packer）也可以为每个 Lightmap Group 单独选择。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Export geometry and maps ===&lt;br /&gt;
如果启用，Bakery 会在渲染前将场景导出为其专用格式。如果你确定场景的几何体和贴图以及光照贴图分辨率设置没有改变（例如，你只是调整 GI 或光源设置），可以禁用此选项以加快下一次渲染速度。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update unmodified lights ===&lt;br /&gt;
如果启用，Bakery 会重新计算自上次渲染以来未改变的光源。如果你只是调整某个光源，不想等待其他光源重新渲染，可以禁用此选项。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Update modified lights and GI ===&lt;br /&gt;
如果启用，Bakery 会重新计算自上次渲染以来发生变化的 GI 和光源。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== UV padding: increase only ===&lt;br /&gt;
仅在启用 [[#Asset_UV_Processing|Adjust UV padding]] 时可见。默认情况下，模型资源的最佳 UV 间距仅基于当前加载的场景进行计算。如果同一模型有多个实例使用不同的光照贴图分辨率，最小的分辨率将决定间距，以确保 UV 图块之间的间距足够大，防止相互重叠。然而，在两个不同的独立场景中烘焙同一模型时，为新场景优化可能会破坏之前场景中的 UV。勾选此选项可以防止这种情况发生，即永远不减小间距值，从而始终为曾经烘焙过的最低分辨率实例进行优化。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Denoise: fix bright edges ===&lt;br /&gt;
[[File:Image19.png|thumb|左：去噪后可见明亮边缘；右：已修复。]]&lt;br /&gt;
仅在 [[#Denoise|Denoise]] 启用时可见。有时用于去噪的神经网络可能会在阴影周围产生明亮边缘，就像应用了锐化效果一样。如果启用此选项，Bakery 会尝试将其滤除。启用后，去噪阶段可能会略微变慢。&lt;br /&gt;
&lt;br /&gt;
此功能也可用于滤除“火花”（fireflies），即光照贴图中偶尔出现的亮点。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Post-packing ===&lt;br /&gt;
有时在渲染场景时，Bakery 会将光照贴图拆分为多个子光照贴图，例如在烘焙不同 LOD 或地形时。&lt;br /&gt;
Post-packing 会尝试通过将这些子光照贴图合并到同一纹理中来最小化最终贴图集数量。&lt;br /&gt;
建议保持此选项启用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Combine with Enlighten real-time GI ===&lt;br /&gt;
如果启用，则在按下 Render 按钮时，Bakery 会首先尝试使用 Enlighten 烘焙以计算实时 GI。之后，将进行常规的 Bakery 光照贴图烘焙过程。烘焙 GI 和实时 GI 将协同工作。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bake on remote server ===&lt;br /&gt;
启用网络烘焙（[[Network baking|Network baking]]）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Presets ===&lt;br /&gt;
当前在 Experimental 模式下的 Render/Update 按钮下显示。&lt;br /&gt;
&lt;br /&gt;
* 点击 '''New''' 将所有当前设置保存到预设文件中。&lt;br /&gt;
* 默认情况下，当一个预设处于激活状态时，所有设置都会被灰显，以防止覆盖预设。&lt;br /&gt;
* 点击 '''Modify preset''' 可更改设置并覆盖预设。&lt;br /&gt;
* 可以通过预设字段切换预设。将其设置为 None 可禁用预设使用。&lt;br /&gt;
&lt;br /&gt;
== 组件 ==&lt;br /&gt;
=== Bakery Lightmap Group Selector ===&lt;br /&gt;
指定对象及其所有子对象使用的 '''Lightmap Group'''。&lt;br /&gt;
Lightmap Group 是 Bakery 用来表示共享同一光照贴图的对象集合的术语。每个组都有属性，告诉 Bakery 如何打包对象、哪些光源影响它们，以及结果是烘焙到纹理还是顶点。&lt;br /&gt;
&lt;br /&gt;
默认情况下，所有静态对象会自动打包到多个光照贴图组（贴图集）中，因此通常无需手动管理。手动定义组仅用于特殊用途，例如：&lt;br /&gt;
&lt;br /&gt;
* 指定某些对象使用 [[Vertex Lightmaps|每顶点光照贴图]] 而非纹理。&lt;br /&gt;
* 使用建模软件中的原始未缩放 UV 烘焙光照贴图。&lt;br /&gt;
* 将关卡的特定区域分组以使用单张光照贴图，从而便于资源流式加载或通过脚本在运行时切换不同的烘焙光照。&lt;br /&gt;
* 使用 Render Selected Groups 按钮仅更新已分组的对象。&lt;br /&gt;
&lt;br /&gt;
要手动定义组，可以创建 '''Lightmap Group Assets'''，方法包括使用 Assets-&amp;gt;Create 菜单，或在组件中使用 Create New 按钮。使用 Create New 按钮时，将根据以下表单创建新的资源：&lt;br /&gt;
&lt;br /&gt;
* Name：要创建的 Lightmap Group 资源的名称。&lt;br /&gt;
* Packing Mode：此选择器定义 Lightmap Group 的打包模式，共有 3 种模式：&lt;br /&gt;
** Original UV：对象及其子对象将使用未修改的 UV 进行烘焙，不执行打包。适用于多个网格共享同一已打包 UV 布局的模型。&lt;br /&gt;
** Pack Atlas：对象及其子对象将打包到专用纹理贴图集中。在 v1.3 之前，每个可打包的子对象都需要有此组件，但现在不再需要。每个子对象将作为单独矩形打包，除非 Bakery 自动检测到子对象有非重叠的子对象，在这种情况下，多个对象可以使用同一个矩形。&lt;br /&gt;
** Vertex：对象及其子对象将使用顶点色烘焙光照而非纹理。注意，需要使用自定义着色器才能生效，例如 [[#Bakery_shaders|Bakery Shader]]。文档中也提供了一个简单的着色器（“Bakery/Simple Vertex Lightmapped”）用于演示和参考。[[Vertex Lightmaps|了解更多关于顶点光照贴图的信息]]。&lt;br /&gt;
* Directional mode：允许你覆盖该组的 [[#Directional mode|directional mode]]。选项与全局相同，Auto 将使用全局设置。&lt;br /&gt;
* Resolution：所需的光照贴图分辨率。&lt;br /&gt;
* Auto-resolution：使用 [[使用手册#Texels_per_unit|Texels Per Unit]] 来确定最接近的二次幂分辨率。&lt;br /&gt;
* Atlas packer：为该组选择 [[使用手册#Atlas_Packer|贴图集打包]] 算法。&lt;br /&gt;
* Bitmask：用于排除光源影响光照贴图的开关列表。每个 Bakery 光源也有一个位掩码设置。光源只会影响与其共享至少一个开关的 Lightmap Group。默认设置意味着所有光源影响所有光照贴图。&lt;br /&gt;
&lt;br /&gt;
[[File:Ts.jpg|thumb|Transparent selfshadow关闭 vs 开启：注意一些单面但背向的多边形如何被正确照亮。]]&lt;br /&gt;
&lt;br /&gt;
如果你有一个被分配了“Pack Atlas”模式的 Lightmap Group，组件上将会出现额外设置：&lt;br /&gt;
&lt;br /&gt;
* Override resolution：覆盖该对象及其子对象在光照贴图中占用的分辨率。&lt;br /&gt;
* Resolution：手动定义的分辨率。例如，如果你有一个分辨率为 512 的光照贴图，并且分配给 4 个对象，同时覆盖分辨率设置为 256，Bakery 将生成一个 512x512 的光照贴图，每个对象正好占据 256x256 的区域。&lt;br /&gt;
&lt;br /&gt;
如果你选择一个 Lightmap Group 资产，将会显示额外的实验性设置：&lt;br /&gt;
* [[Subsurface scattering|Subsurface scattering: (点击阅读更多)]]&lt;br /&gt;
* Normal offset：允许你将光线从表面偏移。这很少有用，主要用于实验目的。&lt;br /&gt;
* Transparent selfshadow：从表面后方发射光线，使其不会在自身投射阴影。对于半透明叶片可能有用。&lt;br /&gt;
* Vertex sampling density，(仅当 Packing Mode 设置为 Vertex 时可用）：默认情况下，每个顶点只计算一个值；如果采样密度 &amp;gt; 0，则会在三角形上分散采样并求平均，从而生成超采样、更平滑的结果。&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Lightmapped Prefab ===&lt;br /&gt;
此组件允许预制件存储光照贴图元数据。这样处理后的预制件可以在任意场景中实例化，无论是在编辑器中还是运行时。&lt;br /&gt;
该组件应直接添加到预制件的根对象上。不支持嵌套预制件。由于预制件在烘焙后会被覆盖（类似于按下“Apply”按钮的效果），因此要求预制件没有任何未应用的更改（子对象不应移动，材质和脚本参数应保持不变等）。如果检测到此类更改，组件界面会显示错误，烘焙后不会保存任何元数据。如果启用了 [[#Warnings|Lightmapped prefab validation]] 警告，所有预制件错误也会在烘焙前以对话框形式显示。&lt;br /&gt;
&lt;br /&gt;
光照贴图预制件支持所有 Bakery 功能，例如 LOD、地形、方向光贴图、RNM、SH、顶点模式和 Shadowmask。要使 Shadowmask 生效，光源也必须是同一预制件的一部分。&lt;br /&gt;
&lt;br /&gt;
{{note| 注意，由于 API 限制，预制件 Shadowmask 仅在 Unity 2017.4 或更高版本中可用。}}&lt;br /&gt;
&lt;br /&gt;
烘焙后，一个名为 “BakeryPrefabLightmapData” 的对象会被添加到预制件中。该对象包含一个脚本，存储应用光照贴图所需的所有数据。&lt;br /&gt;
&lt;br /&gt;
此外，光照贴图预制件允许保存当前渲染设置，并使用两个按钮将其加载回任意已打开的场景：&lt;br /&gt;
&lt;br /&gt;
* Save current render settings to prefab：在该预制件上存储当前渲染设置的副本。&lt;br /&gt;
* Load render settings from prefab：将当前渲染设置设置为预制件中存储的设置。&lt;br /&gt;
  [[File:Upload 2019-9-17 10-32-34.png|thumb|应用预制件]]&lt;br /&gt;
&lt;br /&gt;
烘焙光照贴图预制件时，建议检查：&lt;br /&gt;
&lt;br /&gt;
* 预制件已“应用”。在旧版 Unity 中，点击 Inspector 右上角的 “Apply” 按钮。在新版 Unity 中，点击 “Overrides” 列表，然后选择 “Apply All”。&lt;br /&gt;
* 预制件组件 UI 不显示任何错误。&lt;br /&gt;
* [推荐] 在主窗口启用 “Lightmapped prefab validation” 复选框。点击 Render 时不会显示任何关于预制件的警告对话框。&lt;br /&gt;
&lt;br /&gt;
{{note| 光照贴图以其烘焙所在的场景或所使用的 Lightmap Group 命名（如果有）。在同一场景中烘焙不同预制件时，请确保使用不同命名的 [[使用手册#Bakery_Lightmap_Group_Selector|Lightmap Group]] 或更改 [[使用手册#Output_path|输出路径]]。}}&lt;br /&gt;
&lt;br /&gt;
{{note| 当使用相同模型逐个烘焙多个预制件时，建议将 [[使用手册#Asset_UV_Processing|Asset UV Processing]] 设置为“Don't Change”，以防止修改共享模型的 UV。}}&lt;br /&gt;
&lt;br /&gt;
{{note| Bakery 的预制件工作流程是在 Unity 提供“预制件双击进入视图”功能之前实现的。因此，在隔离预制件视图中光照贴图可能无法正确应用，组件可能显示 “This GameObject is not a prefab” 信息。但在普通场景中使用时应能正常工作。}}&lt;br /&gt;
&lt;br /&gt;
{{note| 当解包已烘焙的预制件并取消与现有光照贴图的关联时，请确保删除保存预制件范围光照贴图/渲染器连接的 BakeryPrefabLightmapData 对象。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Direct Light ===&lt;br /&gt;
[[File:Directlight.jpg|thumb|纯直射光 + GI]]&lt;br /&gt;
[[File:Image4.png|thumb|左：“Shadow Spread” = 0.01，右：0.05。注意阴影从锐利逐渐变模糊的效果。]]&lt;br /&gt;
无限远方向光（例如太阳）。&lt;br /&gt;
&lt;br /&gt;
* Color：光的颜色。&lt;br /&gt;
* Intensity：线性色彩乘数。&lt;br /&gt;
* Shadow Spread：光源尺寸，或者简单说，阴影的模糊度。0 = 阴影最锐利，1 = 阴影最模糊。从技术上讲，它在单条光线与更宽光锥之间插值。&lt;br /&gt;
* Shadow Samples：影响阴影质量。Shadow Spread 值越小，所需样本越少即可得到干净图像。太阳阴影的典型值为 1 到 16。设置为 0 时，该光源的阴影将消失。&lt;br /&gt;
* Bitmask：用于排除此光源对特定 Lightmap Groups 影响的开关列表。&lt;br /&gt;
* Baked contribution：确定应烘焙哪类光照数据。仅在 Indirect 或 Shadowmask 模式可见。可选值：&lt;br /&gt;
** Direct and Indirect：直射光与间接光都完全烘焙。&lt;br /&gt;
** Indirect only：实时光提供直射贡献，仅烘焙间接光。&lt;br /&gt;
** Shadowmask and indirect：实时光提供直射贡献，静态几何体的阴影烘焙到单独贴图，动态与静态阴影混合。间接光正常烘焙。&lt;br /&gt;
** Direct, Indirect, Shadowmask（仅自定义光照）：与直射和间接相同，但 Shadowmask 也生成，可与自定义着色器一起使用。&lt;br /&gt;
* Denoise shadowmask：确定是否对该光源的 Shadowmask 应用去噪。通常不需要，因为阴影噪点不明显，但对非常宽且模糊的阴影（大 Shadow Spread）可能有用。&lt;br /&gt;
* Indirect intensity：非物理 GI 乘数。自然光照应为 1，可根据场景风格调整。&lt;br /&gt;
* Anti-alias：对阴影执行超采样。&lt;br /&gt;
* Texture projection：在光照上投射乘法平铺纹理，可用于模拟远处云影。&lt;br /&gt;
当设置了纹理投影时，可以使用“Tiling”和“Offset”字段调整其缩放和偏移。或者，点击 &amp;quot;Tweak projection in Scene View&amp;quot; 并使用额外的 Gizmo 可视化移动和缩放投影。点击“Render reference frame”可保存光源视角的 PNG，这对于在场景上绘制云影很有用。&lt;br /&gt;
&lt;br /&gt;
如果同一对象同时启用了 Unity 和 Bakery 光源且参数不匹配，会出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match lightmapped to real-time：将 Unity 光源的通用设置复制到 Bakery 光源。&lt;br /&gt;
* Match real-time to lightmapped：将 Bakery 光源的通用设置复制到 Unity 光源。&lt;br /&gt;
&lt;br /&gt;
{{note| 从物理角度看，Bakery 的方向光强度（Intensity）等于照度（Lux）除以 π。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Sky Light ===&lt;br /&gt;
[[File:Skylight.jpg|thumb|纯天空光与 GI]]&lt;br /&gt;
无限远的带阴影环境光（天空）。&lt;br /&gt;
&lt;br /&gt;
* Color: 颜色。&lt;br /&gt;
* Intensity: 线性色彩倍增。&lt;br /&gt;
* Sky texture: 可选的立方体贴图资源，例如 HDRI 全景图，用于从不同方向影响光照颜色。&lt;br /&gt;
  {{note| 旋转天空光的 GameObject 会相应旋转立方体贴图的光照。}}&lt;br /&gt;
* Samples: 影响阴影质量。典型值为 8 到 32。&lt;br /&gt;
* Hemispherical: 如果启用，光照仅来自上方（上半球）。否则来自所有方向。&lt;br /&gt;
* Bitmask: 用于排除此光源影响特定 Lightmap Groups 的开关列表。&lt;br /&gt;
* Baked contribution: 决定应烘焙哪种光照数据。仅在 Indirect/Shadowmask 模式下可见。可能值：&lt;br /&gt;
** Direct and Indirect: 直接和间接光照都将完全烘焙。这是默认且推荐的天空光行为，因为在 Unity 中没有实时版本可以模拟它们。&lt;br /&gt;
** Indirect only: 假定实时光源提供直接贡献；仅烘焙间接光照。&lt;br /&gt;
&lt;br /&gt;
如果天空光的设置与当前场景的天空盒不匹配，将出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match this light to scene skybox: 将活动天空盒材质的通用设置复制到 Bakery 天空光。当前仅支持使用 “Skybox/Cubemap” 或 “Skybox/Bakery skybox” 着色器的天空盒。&lt;br /&gt;
* Match scene skybox to this light: 将 Bakery 天空光的通用设置复制到场景天空盒。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
=== Bakery Light Mesh ===&lt;br /&gt;
[[File:Image29.png|thumb|Left: Samples Near = 0, Samples Far = 4096.&amp;lt;br&amp;gt;&lt;br /&gt;
Middle: Samples Near = 0, Samples Far = 128.&amp;lt;br&amp;gt;&lt;br /&gt;
Right: Samples Near = 16, Samples Far = 128.&amp;lt;br&amp;gt;&lt;br /&gt;
请注意，光照效果看起来相似，但使用的合并采样数量更少。]]&lt;br /&gt;
任何形状的自发光网格。应与 Mesh Renderer 组件或设置为 Area 模式的 Light 组件一起使用。&lt;br /&gt;
&lt;br /&gt;
* Color：颜色&lt;br /&gt;
* Intensity：线性颜色倍增器&lt;br /&gt;
* Cutoff：最大光照距离。Bakery 会在接近该限制时额外衰减正确的平方反比衰减。当 Cutoff 值刚好对应物理衰减变得非常暗的位置时效果最佳。Cutoff 可提升烘焙性能，也可以设置为非常高（不可达）的值以保证完全正确性。&lt;br /&gt;
* Self Shadow：决定光源网格自身是否投射阴影。此选项同时启用更精确的光照算法。&lt;br /&gt;
* Samples Near：影响靠近网格的光照质量。典型值为 16 到 64，仅当 Self Shadow 开启时可用。&lt;br /&gt;
* Samples Far：影响远离网格的光照质量。典型值为 4 到 4096。&lt;br /&gt;
&lt;br /&gt;
Bakery 基于光源表面距离混合两种不同的区域光算法。靠近光源时，算法类似 GI，而远处光源被近似为虚拟点光云。&lt;br /&gt;
&lt;br /&gt;
{{note| &amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;光源网格自身不会接收光照，也不会被烘焙到光照贴图中。&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;一个拥有大量多边形的光源网格比烘焙多个简单的光源网格要快&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;如果结果总是脏/噪点较多，可以尝试将 Samples Near 设置为 0，这样只使用 VPL 算法。对于不需要精度的简单光源（如建筑物的窗户光），这也非常有用。&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;}}  &lt;br /&gt;
[[File:Dd99d-QU0AEKFBK.jpg|thumb|弯曲的光源网格]]  &lt;br /&gt;
* Bitmask：用于排除此光源影响特定 Lightmap Groups 的开关列表。  &lt;br /&gt;
* Baked contribution：决定烘焙哪种类型的光照数据。仅在 Indirect 或 Shadowmask 模式下可见。可能的值：  &lt;br /&gt;
** Direct and Indirect：完全烘焙直接和间接光贡献。这是默认且推荐的光源网格行为，因为 Unity 中没有实时版本可以模拟它们。  &lt;br /&gt;
** Indirect only：实时光源提供直接光贡献，仅烘焙间接光。  &lt;br /&gt;
** Shadowmask and Indirect：实时光源提供直接光贡献，但静态几何体的阴影会烘焙到单独的贴图。动态和静态阴影将混合在一起。间接光照将照常烘焙。目前仅 HDRP（和自定义渲染器）支持混合区域光。  &lt;br /&gt;
** Direct, Indirect, Shadowmask (custom lighting only)：与 Direct and Indirect 相同，但同时生成 Shadowmask 并分配用于自定义着色器。  &lt;br /&gt;
* Indirect intensity：非物理 GI 倍增器。自然光照应设为 1，但可修改以实现更风格化的场景。  &lt;br /&gt;
* Shadowmask with falloff：将完整光衰减烘焙进 Shadowmask（仅对自定义着色器有用）。  &lt;br /&gt;
&lt;br /&gt;
如果网格材质和光源设置不匹配，将出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match light to material：将网格材质或区域光的通用设置复制到 Bakery 光源。&lt;br /&gt;
* Match material to light：将 Bakery 光源的通用设置复制到网格材质或区域光。&lt;br /&gt;
&lt;br /&gt;
==== Light Mesh 与自发光材质的区别 ====&lt;br /&gt;
自发光材质：&lt;br /&gt;
&lt;br /&gt;
* 在 GI 计算中传播光线，因此是“免费的”，无论有多少网格是自发光的。&lt;br /&gt;
* 小而明亮的光可能会产生不准确或有噪点的结果，这取决于 GI 的采样数量。&lt;br /&gt;
* 由于 Bakery 中 GI 的工作方式，它必须占用光照贴图空间，因此可能会浪费空间。同时，这意味着自发光对象需要有效的 UV，并且必须启用“投射阴影”。&lt;br /&gt;
&lt;br /&gt;
Light Mesh：&lt;br /&gt;
&lt;br /&gt;
* 光照会为每个光源单独计算，因此比自发光材质慢。&lt;br /&gt;
* 设计用于为小而明亮的光提供干净的光照效果，即使距离很远也能保持效果。&lt;br /&gt;
* 不占用光照贴图空间。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Point Light ===&lt;br /&gt;
[[File:Image11.png|thumb|左：“Shadow Spread” = 0.5，右：“Shadow Spread” = 1。]]&lt;br /&gt;
点光源，没有面积。尽管在物理上不可能，但在游戏中很有用，并且是匹配 Unity 点光源和聚光灯的唯一方式。&lt;br /&gt;
{{note| 聚光灯只是带有额外投影遮罩的点光源。}}&lt;br /&gt;
&lt;br /&gt;
* Color: 颜色&lt;br /&gt;
* Intensity: 线性色彩倍增&lt;br /&gt;
* Shadow spread: 阴影模糊度。虽然点光源没有面积，但通常希望它仍能产生模糊阴影。为此，阴影被模拟为从球形区域光源投射。此参数定义了虚拟球体的半径，直接影响阴影模糊度。&lt;br /&gt;
* Physical falloff: 如果启用，将使用正确的平方反比衰减，并在边界附近额外衰减。否则将尝试模拟 Unity 的衰减。&lt;br /&gt;
* Falloff min size: 详见 [[Point Light Attenuation]] 部分。&lt;br /&gt;
* Range: 如果物理衰减被禁用，则等于 Unity 的光源范围；如果启用，只会在边缘轻微衰减物理衰减。&lt;br /&gt;
* Samples: 影响阴影质量。典型值为 1 到 512。设置为 0 将使该光源的阴影消失。&lt;br /&gt;
  [[File:Image10.png|thumb|从左到右：Omni，Cookie（默认聚光灯纹理），Cubemap，IES。]]&lt;br /&gt;
* Projection mask: 遮罩/Cookie 类型。选项：&lt;br /&gt;
** Omni: 无遮罩，相当于 Unity 的点光源。&lt;br /&gt;
** Cookie: 纹理投影遮罩。附加选项：&lt;br /&gt;
*** Cookie texture: 2D 纹理资源。Bakery 包含原始 Unity 聚光灯纹理（名为 ftUnitySpotTexture），可用于模拟。&lt;br /&gt;
*** Angle: 纹理投影角度（类似 Unity 聚光灯）。&lt;br /&gt;
*** Correct distortion: 修正宽角下直线可见的 cookie 失真。&lt;br /&gt;
** Cubemap: 立方体贴图投影遮罩。附加选项：&lt;br /&gt;
*** Projected cubemap: 立方体贴图资源。&lt;br /&gt;
** IES: 光照由 IES 文件数据调制。附加选项：&lt;br /&gt;
*** IES file: .ies 扩展名文件。&lt;br /&gt;
* Bitmask: 用于排除该光源影响特定 Lightmap Groups 的开关列表。&lt;br /&gt;
* Baked contribution: 决定应烘焙哪种类型的光照数据。仅在 Indirect 或 Shadowmask 模式下可见。可能值：&lt;br /&gt;
** Direct and Indirect: 直接光和间接光完全烘焙。&lt;br /&gt;
** Indirect only: 实时光提供直接光，仅烘焙间接光。&lt;br /&gt;
** Shadowmask and Indirect: 实时光提供直接光，但静态几何体阴影烘焙到单独贴图中，动态和静态阴影混合，间接光正常烘焙。&lt;br /&gt;
** Direct, Indirect, Shadowmask (custom lighting only): 与 Direct and Indirect 相同，同时生成 Shadowmask 用于自定义着色器。&lt;br /&gt;
* Indirect intensity: 该光的非物理 GI 倍增。自然光应为 1，可根据风格化场景修改。&lt;br /&gt;
* Shadowmask with falloff: 将完整光衰减（除距离外）烘焙到 Shadowmask（仅自定义着色器有用）。&lt;br /&gt;
* Legacy sampling: 使用 Bakery 原始更偏置的阴影采样策略。产生无噪点阴影，但宽半影可能出现条纹。禁用后使用无偏但更有噪点的技术。&lt;br /&gt;
&lt;br /&gt;
如果同一对象同时启用了 Unity 和 Bakery 光源，且设置不匹配，则会出现两个按钮：&lt;br /&gt;
&lt;br /&gt;
* Match lightmapped to real-time: 将 Unity 光的常用设置复制到 Bakery 光。&lt;br /&gt;
* Match real-time to lightmapped: 将 Bakery 光的常用设置复制到 Unity 光。&lt;br /&gt;
&lt;br /&gt;
{{note| 从物理角度来看，Bakery 点光源的“Intensity”为 Candela 除以 Pi。}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Volume ===&lt;br /&gt;
[[File:Voldemo notlonely.gif|由 BakeryVolume 照亮的动态门（动态 GIF，由 NOTLonely 制作）]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
体积（Volumes）生成存储每个体素光探针的 3D 纹理（L1 球面调和和阴影贴图），使其成为常规 Unity 光探针的可行替代方案。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Unity Light Probes&lt;br /&gt;
! Unity LPPV&lt;br /&gt;
! Bakery Volumes&lt;br /&gt;
|-&lt;br /&gt;
| 手动放置每个光探针&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 否&lt;br /&gt;
|-&lt;br /&gt;
| 在一个物体上插值多个光探针&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 运行时可移动&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 可以放入预制件&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 完整脚本 API&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| “Ringing” 伪影&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 可能出现&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 可能出现&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 已修正&lt;br /&gt;
|-&lt;br /&gt;
| 去噪&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | 否&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | 是&lt;br /&gt;
|-&lt;br /&gt;
| 运行时开销&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#d9ead3;&amp;quot; | CPU：低开销；GPU：低开销&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot; | CPU：中等开销；GPU：中等开销&lt;br /&gt;
| style=&amp;quot;text-align: center; background-color:#e4ead3;&amp;quot; | CPU：无开销；GPU：中等开销&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Bakery Volume 是一个与一组 3D 纹理（3 个 SH 纹理和一个可选的 shadowmask）关联的边界盒，使其非常易于使用和编程。Volumes 可以在运行时轻松地交换、移动、加载或卸载，也可以与预制件关联。它们不需要任何 Light Probe Groups 或手动探针布置；整个 Volume 都由均匀的探针体素网格填充。光/影泄漏会自动像处理光照贴图一样修复（尽管对于较大的体素尺寸，薄的双面墙可能会出现问题，但可以通过在不同侧使用不同 Volume 避免）。由于体素网格的均匀特性，也可以对其应用类似光照贴图的降噪，这是常规光探针无法做到的。此外，Bakery 着色器使用 [https://drive.google.com/file/d/1MK6Clw93q8ljijRjb4gQOzzaIjn1uF9Y/view Geomerics] 采样技巧，完全消除了高对比度 HDR 光照下 SH 有时会产生的 “ringing” 伪影。&lt;br /&gt;
&lt;br /&gt;
因此，Volumes 可以为动态物体生成干净、精细、高质量的烘焙光照（即来自静态物体并影响动态物体的光照，而不是相反）。&lt;br /&gt;
&lt;br /&gt;
Volume 方法的唯一缺点是每像素着色开销较高。其开销类似于 LPPV（随着屏幕上受体素影响的像素数量而缩放），但与 LPPV 不同的是，一旦烘焙完成，Volumes 本身不会再更新。多个 Volume 的混合可以通过稍微重叠它们来避免。&lt;br /&gt;
&lt;br /&gt;
====设置 Volume 变换====&lt;br /&gt;
[[File:Bvolgizmo.jpg|thumb|Volume 控制柄]]&lt;br /&gt;
当 BakeryVolume 被添加到一个 GameObject 时，场景视图中会出现一个边界盒控制柄。拖动小方块即可缩放它。&lt;br /&gt;
&lt;br /&gt;
还有其他方法可以更改 Volume 的大小和位置：&lt;br /&gt;
&lt;br /&gt;
* 将任何可渲染的 GameObject 拖入 “Wrap to object” 字段。Volume 会包裹该对象（及其子对象），以将它们完全包含在内。&lt;br /&gt;
* 如果同一个对象上添加了 Box Collider，则会出现 “Set from box collider” 和 “Set to box collider” 按钮。可以用它们快速在 Volume 和 Collider 之间复制数值。&lt;br /&gt;
&lt;br /&gt;
====分辨率====&lt;br /&gt;
当启用 “Adaptive resolution” 时，体素数量由 “Voxels per unit” 控制。禁用它可以手动输入分辨率。对于大多数 1 单位 = 1 米 的游戏来说，一个合理的 “Voxels per unit” 值是 2，但在某些情况下（例如动态门）使用较小但更高分辨率的 Volume 会更有利。&lt;br /&gt;
&lt;br /&gt;
====其他设置====&lt;br /&gt;
&lt;br /&gt;
* Enable baking: 是否需要（重新）计算 Volume？禁用可防止覆盖已有数据。&lt;br /&gt;
* Denoise: 在烘焙 Volume 后应用去噪。推荐用于高分辨率 Volume。避免用于覆盖许多光源的低分辨率 Volume，因为去噪器难以区分实际内容和噪声。&lt;br /&gt;
* Global: 自动将此 Volume 分配给所有兼容 Volume 的 Shader，除非它们有覆盖设置。内部会调用 Shader.SetGlobalTexture()/SetGlobalVector()。&lt;br /&gt;
====使用方法====&lt;br /&gt;
Volumes 可以分配给使用 Volume 感知 Shader 的对象。Bakery 自带实现该功能的 “Bakery Standard” Shader，以及 HDRP 和 URP 的 Shader 图。请查看 example_volumes 场景，了解应用 Volume 的各种方式。&lt;br /&gt;
&lt;br /&gt;
====提示====&lt;br /&gt;
&lt;br /&gt;
* 确保查看示例。&lt;br /&gt;
* 如果两个 Volume 相连，让它们略微重叠。重叠大小应等于最大动态对象的尺寸。这样在运行时简单切换 Volume 就能正常工作。&lt;br /&gt;
* 仅在动态对象实际可达的区域放置 Volume。例如，使用玩家高度限制 Volume 的高度。&lt;br /&gt;
&lt;br /&gt;
====旋转 Volumes====&lt;br /&gt;
如果启用 “Rotate around Y” 选项，Volumes 可以绕 Y 轴旋转。旋转开销非常低，只使用 2 个额外的浮点数据（预计算的角度 sin/cos）。&lt;br /&gt;
&lt;br /&gt;
还可以在运行时旋转 Volumes（Experimental -&amp;gt; “Support rotation after bake” 以及 Bakery Shader 中的类似选项），这种情况下 Volume 必须在初始旋转为零时进行烘焙。&lt;br /&gt;
&lt;br /&gt;
在 URP 中，这种动态旋转可以与 `BakeryURPVolumeGraphRotatable.shadergraph` 一起使用。&lt;br /&gt;
&lt;br /&gt;
对于全局 Volume，动态旋转会在组件被（重新）启用或调用 `volume.SetGlobalParams()` 时更新。使用局部旋转 Volume 时，需要手动在材质或 MaterialPropertyBlock 上设置旋转：&lt;br /&gt;
{{code|&amp;lt;nowiki&amp;gt;SetMatrix(&amp;quot;_VolumeMatrix&amp;quot;, volume.GetMatrix())&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
====技术信息====&lt;br /&gt;
Volumes 可以自动工作（查看示例场景），也可以通过脚本控制其使用方式。&lt;br /&gt;
&lt;br /&gt;
可以通过组件的以下公共属性获取 Volume 数据：&lt;br /&gt;
&lt;br /&gt;
* `bakedTexture0`：存储 L0 RGB 系数和 L1 Z 红色通道在 alpha 中。&lt;br /&gt;
* `bakedTexture1`：存储 L1 X RGB 系数和 L1 Z 绿色通道在 alpha 中。&lt;br /&gt;
* `bakedTexture2`：存储 L1 Y RGB 系数和 L1 Z 蓝色通道在 alpha 中。&lt;br /&gt;
* `bakedMask`：存储体积阴影遮罩。&lt;br /&gt;
* `bounds`：Volume 的包围盒。&lt;br /&gt;
&lt;br /&gt;
所有 `bakedTexture*` 使用 RGBAHalf（每体素 8 字节）格式，mask 使用 ARGB32（每体素 4 字节）。阴影遮罩也可以使用单通道 R8 格式（每体素 1 字节）。&lt;br /&gt;
&lt;br /&gt;
因此 Volume 的字节大小 = width * height * depth * 3 * 8 + （仅当使用阴影遮罩时）width * height * depth * 4（或使用 R8 mask 时为 width * height * depth）。&lt;br /&gt;
&lt;br /&gt;
[[使用手册#Compress_volumes|可以对 Volume 启用纹理压缩]]，使其体积显著减小。&lt;br /&gt;
&lt;br /&gt;
采样 Volume 需要特殊 Shader，这些 Shader 已包含在 Bakery 中。要在自定义 Shader 中添加 Volumes，请查看 HDRP/URP 包中包含的 `BakeryVolume_float()` 函数（位于 `BakeryDecodeLightmap.hlsl`）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Light Filter ===&lt;br /&gt;
[[File:Output optimized.gif|彩色玻璃，如在 &amp;quot;Bakery Real-Time Preview&amp;quot; 中所见。Bakery lightmapper 烘焙出的结果相同。]]&lt;br /&gt;
&lt;br /&gt;
将渲染器标记为光过滤器（Light Filter）。过滤器会用其颜色着色所有直接和间接光线，类似于现实中的光学滤镜，从而实现彩色透明效果（例如彩色玻璃）。唯一的参数是用于着色的纹理。&lt;br /&gt;
&lt;br /&gt;
* 光过滤器对象仍然会像其他对象一样接收光照贴图。&lt;br /&gt;
* 过滤器不会散射或模糊光线（如需此效果，请尝试 [[Subsurface_scattering|Subsurface Scattering]] 或 [[使用手册#Backface_GI|Backface GI]]）。&lt;br /&gt;
* 过滤器可以产生带颜色的阴影。如果灯光使用 [[使用手册#Shadowmask|Shadowmask]] 模式，则结果只会保存 R 通道（因为 Unity 仅支持单通道遮罩）。对于完全烘焙的阴影，则没有限制。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Sector ===&lt;br /&gt;
参见 '''[[Partial_scene_baking|Partial scene baking]]'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bakery Always Render ===&lt;br /&gt;
如果添加到一个物体上，Bakery 在烘焙时将始终考虑该物体，即使它的 Renderer 被禁用。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
=== Bakery Pack As Single Square ===&lt;br /&gt;
如果添加到一个物体上，Bakery 会将该物体及其子物体的 UV 视为单个组合方块，在自动图集打包或 Lightmap Group 的 Pack Atlas 模式下，它们之间永远不会被移动。整个子层级将作为一个整体打包。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
=== Bakery Shared LOD UV ===&lt;br /&gt;
如果添加到一个 LODGroup 上，将标记所有同名 LOD 共享同一个光照贴图。默认情况下，每个 LOD 网格会获得独立的光照贴图，占用图集空间；但如果已知同一个物体的 LOD 拥有相似的 UV2（或者在没有 UV2 且 UV1 不重叠的情况下），它们可以映射到图集的同一部分，从而节省内存。&lt;br /&gt;
这种技术也称为 [https://github.com/laurenth-personal/LODLightmapScripts/ Lightmap Stealing]。&lt;/div&gt;</summary>
		<author><name>Mr F</name></author>
		
	</entry>
</feed>