{"id":1304,"date":"2015-03-05T13:35:35","date_gmt":"2015-03-05T12:35:35","guid":{"rendered":"http:\/\/www.edy.es\/dev\/?page_id=1304"},"modified":"2024-02-12T16:16:39","modified_gmt":"2024-02-12T15:16:39","slug":"unity-5-lighting-cookbook","status":"publish","type":"page","link":"https:\/\/www.edy.es\/dev\/docs\/unity-5-lighting-cookbook\/","title":{"rendered":"Unity 5 Lighting Cookbook"},"content":{"rendered":"<p>Quick notes on how to deal with Unity 5 lighting.<\/p>\n<p>The source project for the screenshots in this article is hosted at <a href=\"https:\/\/github.com\/EdyJ\/unity-5-lighting-cookbook\">GitHub<\/a>.<\/p>\n<h1>Standard realtime lighting<\/h1>\n<p>Standard realtime lighting includes ambient light, environment reflection and realtime lights and shadows. It\u00a0doesn&#8217;t require any GI or precomputed stuff whatsoever. Both options Precomputed Realtime GI and Baked GI are disabled in Lighting &gt; Scene.<\/p>\n<p style=\"padding-left: 90px;\"><a href=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Standard-Lighting-Settings1.png\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-1429 size-medium alignnone\" src=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Standard-Lighting-Settings1-131x300.png\" alt=\"\" width=\"131\" height=\"300\" srcset=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Standard-Lighting-Settings1-131x300.png 131w, https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Standard-Lighting-Settings1.png 302w\" sizes=\"auto, (max-width: 131px) 100vw, 131px\" \/><\/a>\u00a0\u00a0<a href=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Standard-Lighting.png\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-1311 alignnone\" src=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Standard-Lighting.png\" alt=\"Unity-5-Lighting-Cookbook-Standard-Lighting\" width=\"540\" height=\"300\" srcset=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Standard-Lighting.png 900w, https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Standard-Lighting-300x167.png 300w\" sizes=\"auto, (max-width: 540px) 100vw, 540px\" \/><\/a><\/p>\n<h4><strong>1) Ambient Light<\/strong><\/h4>\n<p>Equally affects\u00a0all objects.<\/p>\n<p style=\"padding-left: 90px;\"><a href=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Ambient-Light.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1425\" src=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Ambient-Light-300x258.png\" alt=\"Unity-5-Lighting-Cookbook-Ambient-Light\" width=\"200\" height=\"172\" srcset=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Ambient-Light-300x258.png 300w, https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Ambient-Light.png 304w\" sizes=\"auto, (max-width: 200px) 100vw, 200px\" \/><\/a><\/p>\n<p style=\"padding-left: 90px;\"><em>Ambient Source (Skybox, Gradient, Color) and Intensity<\/em><\/p>\n<h4><strong>2) Environment Reflection<\/strong><\/h4>\n<p>Reflected path that changes with the angle of the camera. Applied independently of Ambient. Affects\u00a0the <em>Fresnel<\/em> effect as well.<\/p>\n<p>If Reflection Probes are used they become the Reflection Source and Intensity for the objects under their influence, so the global reflection settings don&#8217;t have effect on these objects. Reflection Bounces define how much times the reflection can bounce among several probes (i.e. a probe capturing the objects under the influence of another probe).<\/p>\n<p style=\"padding-left: 90px;\"><a href=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Environment-Reflection.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1426\" src=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Environment-Reflection-300x258.png\" alt=\"Unity-5-Lighting-Cookbook-Environment-Reflection\" width=\"200\" height=\"172\" srcset=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Environment-Reflection-300x258.png 300w, https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Environment-Reflection.png 304w\" sizes=\"auto, (max-width: 200px) 100vw, 200px\" \/><\/a>\u00a0\u00a0<a href=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Reflection-Probes.png\"><img loading=\"lazy\" decoding=\"async\" class=\" alignnone wp-image-1443\" src=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Reflection-Probes.png\" alt=\"Unity-5-Lighting-Cookbook-Reflection-Probes\" width=\"200\" height=\"130\" \/><\/a><\/p>\n<p style=\"padding-left: 90px;\"><em>Left:\u00a0Reflection Source (Skybox, Cubemap), Resolution and Reflection Intensity.<br \/>\n<\/em><em>Right: A Reflection Probe affects this object, so the global Environment Reflection Source\u00a0doesn&#8217;t\u00a0affect this mesh.<\/em><\/p>\n<h4><strong>3) Standard Lights<\/strong><\/h4>\n<p>All standard realtime lights in the scene apply direct lighting and shadows on the\u00a0objects.<\/p>\n<p>The first Directional Light in the scene is considered as <em>Sun<\/em> by default. The default Skybox gets its\u00a0intensity and color adjusted\u00a0depending on the Sun&#8217;s\u00a0horizontal inclination. Alternatively, a specific directional light can be selected as <em>Sun<\/em> for affecting the default Skybox:<\/p>\n<p style=\"padding-left: 90px;\"><a href=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Standard-Light1.png\"><img loading=\"lazy\" decoding=\"async\" class=\" alignnone wp-image-1433 size-medium\" src=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Standard-Light1-217x300.png\" alt=\"\" width=\"217\" height=\"300\" srcset=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Standard-Light1-217x300.png 217w, https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Standard-Light1.png 305w\" sizes=\"auto, (max-width: 217px) 100vw, 217px\" \/><\/a>\u00a0\u00a0<a href=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Skybox-Sun.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1428\" src=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Skybox-Sun-300x258.png\" alt=\"Unity-5-Lighting-Cookbook-Skybox-Sun\" width=\"200\" height=\"172\" srcset=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Skybox-Sun-300x258.png 300w, https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Skybox-Sun.png 304w\" sizes=\"auto, (max-width: 200px) 100vw, 200px\" \/><\/a><\/p>\n<h1>Precomputed realtime lighting<\/h1>\n<p>Precomputed realtime lighting throws in\u00a0light bounces, color bleeding, and emissive materials in real time. Everything can change dynamically (light color and intensity, material color, material emission, etc) an the lighting gets updated in the scene accordingly in real time.<\/p>\n<p>Lighting &gt; Scene &gt; <strong>Precomputed Realtime GI<\/strong> enabled, Baked GI disabled.<\/p>\n<p style=\"padding-left: 90px;\"><a href=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Precomputed-Realtime-GI-Settings1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1431 size-medium\" src=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Precomputed-Realtime-GI-Settings1-131x300.png\" alt=\"\" width=\"131\" height=\"300\" srcset=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Precomputed-Realtime-GI-Settings1-131x300.png 131w, https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Precomputed-Realtime-GI-Settings1.png 302w\" sizes=\"auto, (max-width: 131px) 100vw, 131px\" \/><\/a> <a href=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Precomputed-Realtime-GI.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1309\" src=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Precomputed-Realtime-GI.png\" alt=\"Unity-5-Lighting-Cookbook-Precomputed-Realtime-GI\" width=\"540\" height=\"300\" srcset=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Precomputed-Realtime-GI.png 900w, https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Precomputed-Realtime-GI-300x167.png 300w\" sizes=\"auto, (max-width: 540px) 100vw, 540px\" \/><\/a><\/p>\n<h4><strong>4) Light Bounces<\/strong><\/h4>\n<p>Each light is configured to bounce off of objects and affect others.<\/p>\n<p style=\"padding-left: 90px;\"><a href=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Light-Bounces.png\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-1434 alignnone\" src=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Light-Bounces-217x300.png\" alt=\"Unity-5-Lighting-Cookbook-Light-Bounces\" width=\"200\" height=\"276\" srcset=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Light-Bounces-217x300.png 217w, https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Light-Bounces.png 305w\" sizes=\"auto, (max-width: 200px) 100vw, 200px\" \/><\/a><\/p>\n<h4><strong>5) Emissive Materials<\/strong><\/h4>\n<p>Objects flagged\u00a0as Static containing\u00a0an emissive material emit light according to their geometry.<\/p>\n<p style=\"padding-left: 90px;\"><a href=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Emissive-Object.png\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-1436 alignnone\" src=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Emissive-Object-260x300.png\" alt=\"Unity-5-Lighting-Cookbook-Emissive-Object\" width=\"200\" height=\"231\" srcset=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Emissive-Object-260x300.png 260w, https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Emissive-Object.png 276w\" sizes=\"auto, (max-width: 200px) 100vw, 200px\" \/><\/a>\u00a0\u00a0<a href=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Emissive-Material.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1435\" src=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Emissive-Material-203x300.png\" alt=\"Unity-5-Lighting-Cookbook-Emissive-Material\" width=\"200\" height=\"296\" srcset=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Emissive-Material-203x300.png 203w, https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Emissive-Material.png 304w\" sizes=\"auto, (max-width: 200px) 100vw, 200px\" \/><\/a><\/p>\n<p>Precomputed realtime lighting is calculated on\u00a0the scene objects flagged\u00a0as <strong>Static<\/strong>. A precompute phase\u00a0is triggered whenever the Transform of any\u00a0object marked as Static is modified, or when the Static flag itself changes.<\/p>\n<p>The parameter Lighting &gt; Scene &gt; Precomputed Realtime GI &gt; <strong>Realtime Resolution<\/strong> directly affects the time it will take to precompute the data. It&#8217;s ok to use values as low as 0.01 &#8211; 0.5 for allow quickly prototyping\u00a0while working in the\u00a0Editor.<\/p>\n<p><a href=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Precomputed-Resolution.png\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-1437 aligncenter\" src=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Precomputed-Resolution.png\" alt=\"Unity-5-Lighting-Cookbook-Precomputed-Resolution\" width=\"260\" height=\"55\" srcset=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Precomputed-Resolution.png 303w, https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Precomputed-Resolution-300x63.png 300w\" sizes=\"auto, (max-width: 260px) 100vw, 260px\" \/><\/a><\/p>\n<p><strong>CPU Usage<\/strong> affects the reactions of the dynamic light changes in runtime. It doesn&#8217;t affect the CPU used for baking the precomputed data in the editor.<\/p>\n<p>Light bouncing and material emission affect static objects only.\u00a0<strong>Light probes<\/strong> must\u00a0be used for the precomputed effects\u00a0to be applied\u00a0on\u00a0dynamic objects as well.<\/p>\n<h4>Ambient Light in precomputed realtime lighting<\/h4>\n<p>Ambient Light\u00a0affects the parts of the static geometry that can be reached &#8220;from the exterior&#8221; by the light. Backfaces also count here. For instance, at\u00a0interior scenes where the static geometry defines a closed hull, the ambient light won&#8217;t have effect at all in the static meshes. Any &#8220;gaps&#8221; or parts that are reachable\u00a0from the exterior of the static geometry will be affected by the\u00a0Ambient Light accordingly.<\/p>\n<h1>Baked lightmaps<\/h1>\n<p>Ambient Light, Standard Lights (baked or mixed), Light Bounces and Emissive Materias are baked into lightmap textures. Only Environment Reflection can change in runtime.<\/p>\n<p>Lighting &gt; Scene &gt; <strong>Baked GI<\/strong> enabled, Precomputed Realtime GI disabled.<\/p>\n<p style=\"padding-left: 90px;\"><a href=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Baked-GI-Settings1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1430 size-medium\" src=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Baked-GI-Settings1-131x300.png\" alt=\"\" width=\"131\" height=\"300\" srcset=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Baked-GI-Settings1-131x300.png 131w, https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Baked-GI-Settings1.png 302w\" sizes=\"auto, (max-width: 131px) 100vw, 131px\" \/><\/a> <a href=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Baked-GI.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1307\" src=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Baked-GI.png\" alt=\"Unity-5-Lighting-Cookbook-Baked-GI\" width=\"540\" height=\"300\" srcset=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Baked-GI.png 900w, https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Baked-GI-300x167.png 300w\" sizes=\"auto, (max-width: 540px) 100vw, 540px\" \/><\/a><\/p>\n<p>Standard Lights should be configured as Baked or Mixed for allowing to seamlessly switching among\u00a0Bake only and Realtime only GI modes.<\/p>\n<p>The parameter Lighting &gt; Scene &gt; Baked\u00a0GI &gt; <strong>Baked\u00a0Resolution<\/strong> directly affects the time it will take the lightmap to be generated. It&#8217;s ok to use values as low as 1-4 for quickly prototyping while working in the Editor.<\/p>\n<p><a href=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Baked-Resolution.png\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-1438 aligncenter\" src=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Baked-Resolution.png\" alt=\"Unity-5-Lighting-Cookbook-Baked-Resolution\" width=\"250\" height=\"126\" srcset=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Baked-Resolution.png 303w, https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Baked-Resolution-300x151.png 300w\" sizes=\"auto, (max-width: 250px) 100vw, 250px\" \/><\/a><\/p>\n<p>Modifying any parameter involved in lighting (Ambient Light, Standard Lights, Light Bounces, Emissive Materias) or modifying any Static object will trigger a new lightmap calculation phase.<\/p>\n<h1>General GI\u00a0settings<\/h1>\n<p><a href=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-General-GI.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-1316\" src=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-General-GI.png\" alt=\"Unity-5-Lighting-Cookbook-General-GI\" width=\"250\" height=\"195\" srcset=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-General-GI.png 350w, https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-General-GI-300x234.png 300w\" sizes=\"auto, (max-width: 250px) 100vw, 250px\" \/><\/a><\/p>\n<p>The <strong>Indirect Light<\/strong>\u00a0is the lighting effect of Ambient Light, Light Bounces and Emissive Materials (effect on\u00a0nearby\u00a0objects, not the emissive objects themselves), but not Environment Reflection.\u00a0Scene Window &gt; <strong>Irradiance<\/strong>\u00a0shows the Indirect Light in the scene:<\/p>\n<p><a href=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Irradiance-Indirect-Light.png\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-1439 aligncenter\" src=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Irradiance-Indirect-Light-300x185.png\" alt=\"Unity-5-Lighting-Cookbook-Irradiance-Indirect-Light\" width=\"376\" height=\"232\" srcset=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Irradiance-Indirect-Light-300x185.png 300w, https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Irradiance-Indirect-Light.png 863w\" sizes=\"auto, (max-width: 376px) 100vw, 376px\" \/><\/a><\/p>\n<p>These settings affect the\u00a0Indirect Light\u00a0in both realtime and baked modes:<\/p>\n<ul>\n<li><strong>Indirect intensity:<\/strong> Scales\u00a0the indirect lighting (ambient + bounces + emissive)<\/li>\n<li><strong>Bounce\u00a0Boost:<\/strong> How strong the light bounces from one surface to the next. The bounced light is multiplied by the albedo of the surface intensified by this setting.<\/li>\n<\/ul>\n<p>These\u00a0settings affect the <strong>Baked GI<\/strong> mode only:<\/p>\n<ul>\n<li><strong>Directional mode:<\/strong> whether to store directional and specular information in the lightmaps in Baked GI mode.<\/li>\n<li><strong>Atlas size:<\/strong> size of the lightmaps in Baked GI mode.<\/li>\n<\/ul>\n<h1>Combining different lighting methods<\/h1>\n<p>The tutorial <a href=\"http:\/\/unity3d.com\/learn\/tutorials\/modules\/beginner\/graphics\/lighting-and-rendering\">Unity 5 &#8211; Lighting and Rendering<\/a> is a must-read for understanding the insights of\u00a0the Global Illumination (GI) in Unity 5. The quotes here are extracted from this tutorial.<\/p>\n<h4>Precomputed realtime lighting +\u00a0Baked\u00a0lightmaps<\/h4>\n<p>It&#8217;s not a good idea, even given that both are enabled by default:<\/p>\n<blockquote><p><em>Although it is possible to simultaneously use Baked GI lighting and Precomputed Realtime GI, be wary that the performance cost associated with rendering both systems simultaneously is the sum of the cost of each of them. Not only do we have to store both sets of lightmaps in video memory, but we also pay the processing cost of decoding both in shaders.<\/em><\/p>\n[&#8230;] <em>The decision on which approach to take will have to be evaluated based on the nature of your particular project and desired target platform. Remember that when targeting a range of different hardware, that often it is the least performant which will determine which approach is needed.<\/em><\/p><\/blockquote>\n<h4>Standard realtime lighthting +\u00a0Baked\u00a0lightmaps<\/h4>\n<p>This is a convenient\u00a0method\u00a0for\u00a0static and dynamic objects under the same constant lighting\u00a0conditions:<\/p>\n<blockquote><p><em>Selecting the \u2018Mixed\u2019 baking mode <\/em>[in the Light component]<em>, GameObjects marked as static will still include this light in their Baked GI lightmaps. However, unlike lights marked as \u2018Baked\u2019, Mixed lights will still contribute realtime, direct light to non-static GameObjects within your scene. This can be useful in cases where you are using lightmaps in your static environment, but you still want a character to use these same lights to cast realtime shadows onto lightmapped geometry.<\/em><\/p><\/blockquote>\n<h1>Generating lightmap files<\/h1>\n<p>By default lightmap files are generated and stored internally each time a lightmap calculation phase is triggered (i.e. by moving static elements).<\/p>\n<p>Lightmaps can be calculated manually by disabling the <strong>Auto<\/strong> checkbox in the Lighting window, then clicking the <strong>Build<\/strong> button.\u00a0The generated files are stored in a folder with the same name as the scene they belong to. Baked data includes lightmaps\u00a0and reflection probes.<\/p>\n<p>The\u00a0parameters <strong>Directional Mode<\/strong> and <strong>Atlas Size<\/strong> at the <strong>General GI<\/strong> section affect the type and number of the\u00a0lightmap files.<\/p>\n<p><a href=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Generating-Lightmap-Files.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-1488\" src=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Generating-Lightmap-Files-242x300.png\" alt=\"Unity-5-Lighting-Cookbook-Generating-Lightmap-Files\" width=\"282\" height=\"350\" srcset=\"https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Generating-Lightmap-Files-242x300.png 242w, https:\/\/www.edy.es\/dev\/wp-content\/uploads\/2015\/03\/Unity-5-Lighting-Cookbook-Generating-Lightmap-Files.png 598w\" sizes=\"auto, (max-width: 282px) 100vw, 282px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Quick notes on how to deal with Unity 5 lighting. The source project for the screenshots in this article is hosted at GitHub. Standard realtime lighting Standard realtime lighting includes ambient light, environment reflection and realtime lights and shadows. It\u00a0doesn&#8217;t require any GI or precomputed stuff whatsoever. Both options Precomputed Realtime GI and Baked GI [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1307,"parent":228,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"page-c.php","meta":{"footnotes":""},"class_list":["post-1304","page","type-page","status-publish","has-post-thumbnail","hentry"],"jetpack_shortlink":"https:\/\/wp.me\/P1PjRF-l2","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.edy.es\/dev\/wp-json\/wp\/v2\/pages\/1304","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.edy.es\/dev\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.edy.es\/dev\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.edy.es\/dev\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.edy.es\/dev\/wp-json\/wp\/v2\/comments?post=1304"}],"version-history":[{"count":24,"href":"https:\/\/www.edy.es\/dev\/wp-json\/wp\/v2\/pages\/1304\/revisions"}],"predecessor-version":[{"id":1604,"href":"https:\/\/www.edy.es\/dev\/wp-json\/wp\/v2\/pages\/1304\/revisions\/1604"}],"up":[{"embeddable":true,"href":"https:\/\/www.edy.es\/dev\/wp-json\/wp\/v2\/pages\/228"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.edy.es\/dev\/wp-json\/wp\/v2\/media\/1307"}],"wp:attachment":[{"href":"https:\/\/www.edy.es\/dev\/wp-json\/wp\/v2\/media?parent=1304"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}