Basics of Lightmapping in Unity. How baking light in Unity?

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hi I'm Ruslan and welcome to basics of light mapping in unity in this video we will explore key components of creating high quality lighting for your Unity games this video is brought to you by Mixel Studio Mixel is a great solution for boosting your game development when you're creating a game on Unity or Unreal Engine and you need quality asset that means industry standards and provides flexibility and modularity we'll get you covered thousands of 3D models more than two hundreds of quality assets for your games and simulations there is something for absolutely everyone and anyone here and if you're in doubt you can check the acid before buying it at mixel.h.io to instantly gain access to professional level game assets check out links in the description when lightning sinks in unity we have the option of setting our lights to real time baked or mixed lights can be set to one of the three options on a per light basis so essentially we can have a scene where some of our lightning data will be baked some will be read in real time and some will be used both baked and real-time data real-time lightning is lightning that isn't calculated until run time this is something to keep in mind especially when creating games for lower end devices because the inclusion of the real-time lights comes at the performance cost brake lights are lights that are pre-calculated with the lightning data stores in the texture inside your game the lighting texture is an overlaid with the textures and materials of the assets found in your scene since much of the data is already calculated and doesn't have to be computed during runtime so for lower end platforms exclusively using bake lights will be more performance friendly mixed lighting is lightning that relies on the combination of both real-time and baitlining in unity we have four main light types with each having various settings and attributes first we have directional light emit even and consistent lightning across the entire scene usually these lights are used to simulate sunlight or are far distant light source next Point lights there are location specific and emit light in all direction from the center equally frequently used for simulating flashes and light bulbs spotlights the spotlights emits light on an area over a range and angle this type of light is normally used for flashlights or searchlights and finally the area lights area light are defined by its shape similar to a spotlight area lights emit light in a forward Direction with a uniform linear follow based on its range value light parameters range determines how far the light emitted from the center of the object color adjust the color our lights appears as well as the color of the light rays it casts mod allows you to specify light mode intensity is the value that sets the brightness of the light in direct multiplier controls the amount of ambient light being cast into our scene shadow type specify whether we want our light to cast hard soft or no Shadows render mode specifies the rendering priority of the selected light coloring mask allows us to selectively exclude groups of objects from being affected by the Light that's Unity for main light types but what if you want to have an object or piece of geometry lit up by emissive properties let's take a look at the lamps here in order to emission to work this box has to be ticked emission will overtake Albedo if you pump a bit high enough we can choose whatever color we want this light to be emissive material has a global illumination parameter and can be set to real time or baked in order to bake lighting we need to make sure that we set up our objects correctly so by setting objects to static that's telling the unity that these objects are never going to move and so we can calculate all the indirect Lighting on them and the Shadows properly and back those into a light map sometimes the reason why objects may not looking good after light baking is because it needs to tick generate light map UV option located in the model input settings the lighting panel can be found by going under window rendering lighting in order to access these parameters we need to create new light settings now I can access these parameters alignment mode with big indirect mixed lights behave like real-time lights with the additional benefit of baking indirect lighting into light Maps game objects added by mixed lights cast real-time Shadows similar to big indirect Shadow mask lightning mode combines real-time direct lighting but baked in direct light however Shadow mask lightning more differs from both indirect lighting mode in the way that it renders shadow shadow mask lightning mode allows Unity to combine bake and real-time Shadows at runtime and to render shadows in the far distance Shadow mask lightning mode provides the highest Fidelity Shadows but has the highest performance cost and memory requirements it is suitable for rendering realistic scenes where distant game objects are visible such as open worlds on high-end or mid-range Hardware in subtractive lightning mode all mixed lies in your scene provide big direct and indirect lighting you need a base shadow cast by Static game objects into the light maps in addition to the baked Shadows one directional light known as the main directional light provides real-time Shadows for dynamic game objects subtractive lighting mode is useful on a low end Hardware where performance is a concern and where you need only one real-time Shadow casting light light mapper there are three options CPU GPU and enlightenment GPU is faster than it used to preview light map CPU is much slower and precise it's used for baking the final light map of UC Enlightenment is used for backwards compatibility it is not recommended to use Enlightenment in new projects so we won't be covering that Progressive updates prioritize scene view when baking light map [Music] multiple important samples this generally leads to a faster convergence when generating light Maps but can lead to noisier results in certain low frequency environments direct samples increasing this value can improve the quality of light Maps but increases the baking time indirect samples this setting controls the number of samples light mapper uses for indirect lighting calculations for outdoor scenes 100 samples should be enough for indoor scenes with emissive geometry increase the value until you see the result you want higher values also increase the time it takes to bait them environment samples the environment samples property determines the total number of environment rays that unitifies toward the Skybox to gather light directly higher values might yield smoother results but at the cost of increased bake times foreign sample multiplier controls how many samples are used for light probes as a multiplier of the sample values above higher values improve the quality of the light props but they will take longer to bake minimum and maximum bounces as the name implies are used to set minimum and maximum number of bounces that you want to include in indirect lightning calculations each bounce increases the resources needed to bait your scene has three options none select this to use no filter or denoising for the light bar Auto selectors to use a platform dependent preset for post-processing the light button Advanced is used to manually configure options for each type of light map Target light map resolution use this the specified number of textures per unit to use for light Maps increasing this value improves light map quality light map padding use this to specify the separation between separate shapes in the baked light map light Map size the size in pixels of the full light map texture which incorporates separate regions for the individual game object textures compressed light Maps a compressed light map requires Less storage space but the compression process can introduce unwanted visual effects into the texture ambient occlusion tick this checkbox to open a group of settings which allow you to control the relative brightness of surfaces in ambient occlusion higher values indicate a greater contrast between the occluded and fully lit areas this only applies to the indirect lighting calculated by the GI system maximum distance a larger value produces longer rays and contributes more Shadows to the light map while a smaller value produces shorter rays that contribute Shadows only when objects are very close to each other indirect contribution used to scale the brightness of indirect light as seen in the final light map direct contribution it is used to scale the brightness of the red light mount directional mode in directional mode Unity generates a second light map to store the dominant direction of the incoming light this allows diffuse normal marked materials to work with the GI directional mode requires about twice as much storage space for the additional light map data non-directional mode disables unity's ability to generate a second light map to store the dominant direction of the incoming light Albedo boost used to control the amount of light Unity bounces between surfaces increasing this draws that Albedo wallet towards White for indirect light computation indirect intensity control the brightness of indirect light stored in real-time and baked light Maps light map parameters for testing purposes it's recommend to use a low or medium presets for the final bake use higher resolution parameter light probes act as a group of points with each sampling the lights from different positions in your scene then cast that lighting information on Dynamic objects in your scene light props come at a low performance cost and should be used despite which platform your game is targeted for reflection probes reflection props will sample the area around and create a cube map and apply that to any reflective materials within its volume Unity can use Skybox material to generate ambient Lighting in your scene if your Skybox includes a sound moon or other lighting set up a directional light that points in the same direction as the light this makes it appear as through the light in your Skybox creates shadows in your scene we hope this video helps you get started building light maps for your scene and helps you create fast and beautiful lightning in your game [Music] mix of Studio provides more than two hundreds of unity assets so you can find almost everything something that will suit your project but if you need something specific an original prop music or character or maybe something else feel free to email us thanks again and I'll see you next time [Music]
Info
Channel: Mixall studio
Views: 29,176
Rating: undefined out of 5
Keywords: Lightmapping in Unity, Unity tutorial, Unity, asset store, 3D assets, light in Unity, Unity lighting, Unity light, How baking light in Unity, How to build Lightmaps in Unity, Unity light probes, unity optimization, Unity URP, unity hdrp, unity prefabs, unity post processing, Basics of Lightmapping in Unity, Basics of Lightmapping, baking light unity, unity reflection probes, reflection probes, unity reflection probes urp, unity reflection probes hdrp, URP, HDRP, Unity 3D
Id: XzJe4W96Mgc
Channel Id: undefined
Length: 13min 14sec (794 seconds)
Published: Mon Nov 07 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.