How to build Lightmaps in Unity 2020.1 | Tutorial

Sdílet
Vložit
  • čas přidán 29. 08. 2024

Komentáře • 112

  • @paulhoover5511
    @paulhoover5511 Před 2 lety +8

    Thank you for this! This video is SO much better than several similar tutorials on baked lighting. The information is comprehensive and relevant to what one needs to know to successfully set up a scene. It's presented clearly and concisely without long, drawn out and superfluous chatter.

  • @tzmedia5345
    @tzmedia5345 Před 3 lety +14

    This was very helpful. I wasn't getting the output I was expecting on a recent bake and this tutorial showed me what I'd missed. Thank you!

  • @michaelshollaj6428
    @michaelshollaj6428 Před 3 lety +35

    Thanks for everything, Unity best engine ever !!!

  • @biocronic2986
    @biocronic2986 Před 4 měsíci

    First real good tutorial I saw these days. Thank you very much.

  • @Oxmond
    @Oxmond Před 3 lety +3

    The Progressive Light Mapper is awesome! 😻😻😻

  • @Frologics
    @Frologics Před 3 lety +14

    WARNING: Baking a huge scene may cause PC to explode

  • @MsRedNebulaPlays
    @MsRedNebulaPlays Před 2 lety

    Incredibly useful, thank you! I'm working on an asset pack for the Unity store and wanted to make sure I had my UVs set up properly to work with baked lighting, and this covered everything I need to know very nicely.

  • @DavidVille
    @DavidVille Před 3 lety +27

    At 1:18 "... which dynamic lights cannot do without leveraging other technologies such as Unity's Real-Time GI System"
    Want to elaborate about that? because enlighten was deprecated right? so what is that Real-Time GI System?

    • @HitsuSan
      @HitsuSan Před 3 lety +5

      That's the same question that got into my mind...

    • @deontayfarris6777
      @deontayfarris6777 Před 3 lety +2

      wow your right, it's to be phased out by 2021.

    • @CollapseDev
      @CollapseDev Před 3 lety +4

      Unity HDRP has Ray Traced GI for Dx12 Systems. Sadly Dx12 is Windows 10 only if I'm not mistaken.

  • @astyy
    @astyy Před 3 lety +11

    We need prefab lightmaps! This is a feature that needs official support.

    • @gundalfx
      @gundalfx Před 3 lety +1

      Can you please elaborate a bit further what you mean with "prefab" in context of lightmaps? Like having pre-baked GI to sections of a group of 3D Models?

    • @Psycho8Everything
      @Psycho8Everything Před 3 lety +1

      @@gundalfx Pretty much, lightmaps local to prefabs. Other engines have the capability and although there is a workaround for Unity, there is still no official support. The engine devs have chimed in saying it's a future feature though.

    • @NOTLonely92
      @NOTLonely92 Před 3 lety +2

      @@Psycho8Everything this is supported by Bakery lightmapper for Unity.

  • @AlexStrook
    @AlexStrook Před 3 lety +5

    that was such a clear explanation, great job !

  • @walaoRIKi
    @walaoRIKi Před 3 lety +1

    good to see this tutorial, definitely helpful for mobile developer. Also note that the metallic and specular effect will not work on baked object

  • @nichegames9590
    @nichegames9590 Před 3 lety +48

    Light in unity feels difficult to me. I should probably watch more tutorials.

    • @hexerei02021
      @hexerei02021 Před 3 lety +1

      @Tyrone Lotta bot

    • @muzboz
      @muzboz Před 3 lety +1

      I try to avoid baking at all costs.
      It just seems to hard to get good results, and takes ages.

    • @Shadowsphere1
      @Shadowsphere1 Před 2 lety +2

      @@muzboz I wouldn't say to avoid baking at all costs... just to avoid baking if you don't need to. Eventually, there will come a time where you'll most likely need to resort to baking to save some processing when your scenes become too complex. Like if you only have a few point lights or small stuff like that, there's no reason to.
      It takes ages, sure, but it's not like that's unique to Unity. Baking anything takes awhile depending on hardware.

    • @spectregames3248
      @spectregames3248 Před 2 lety

      hey i remeber you from my video yeah i hate unity lighting because baked lights are useless when thereis a moving object in the enviroment and mixed and realtime always glitch

    • @LucretziaOfficial
      @LucretziaOfficial Před 2 lety +1

      @@spectregames3248 that's why you use lightprobes.

  • @__dane__
    @__dane__ Před 3 lety +2

    Thanks for the clarity on this

  • @muhammadumair6306
    @muhammadumair6306 Před 3 lety +19

    Everything is old as before. Nothing new or improved in lightmapping, except for that margin calculation. Bakery GPU lightmapper is still way better than Unity's lightmapper with smaller lightmap size and better quality. Unity should buy bakery lightmapper and make it part of Package manager.

    • @TedThomasTT
      @TedThomasTT Před 3 lety +3

      I think Bakery only works on Nvidia gpus, so I don't think Unity would buy it.

    • @muhammadumair6306
      @muhammadumair6306 Před 3 lety +1

      @@TedThomasTT they can definitely add support for other GPUs because Unity's own GPU Lightmapper sucks too.

    • @fatBoxSoftware
      @fatBoxSoftware Před 3 lety +2

      Yep cannot use Bakery on any of my AMD workstations. Developer said he didn't have plans to support AMD GPUs and it wouldn't be worth the development effort.

    • @muhammadumair6306
      @muhammadumair6306 Před 3 lety +1

      @@fatBoxSoftware oh c'mon dude look at bakery gpu lightmapper details and quality. To get a good detailed lightmap with unity's lightmapper, you'll get around 20MB to 50MB of size but with bakery, much better quality and details under just 10MB. I am talking about mobile game. Atleast unity should try fix their lightmap packing algorithm which waste huge amount of space in a single texture and continues to bake into separate map without even properly filling the previous one. Yeah that's the only negative point of bakery that it only supports Nvidia GPUs and not AMD which is weird because if they add support for AMD then I think bakery can completely replace unity's lightmapper.

    • @NOTLonely92
      @NOTLonely92 Před 3 lety +2

      ​@@muhammadumair6306 yeah, Bakery is a killer. I use it in my own project, and I'm so happy with it. As a pretty cool bonus - you can bake lightmaps in a Spherical Harmonics directional mode and then use the SH in your shaders, so the fully static lighing will look like an AAA project's lighting, because you have highlighs and normal maps working.

  • @DavidVille
    @DavidVille Před 3 lety +8

    What are those icons with 4 Unity logos at 2:35 ? some sort of multiscene ?

  • @Gredran
    @Gredran Před 3 lety +9

    “Oh boy it’s time to bake some lights hehehe FUUU!”
    Jk it isn’t so bad, especially with videos like this :)

  • @DanielDaAbadSukarno
    @DanielDaAbadSukarno Před 3 lety +1

    Light of unity 😍

  • @caden3ds
    @caden3ds Před 2 měsíci

    I have all of my lightmap settings higher than the ones in this video yet mine still look worse

  • @bojanjeremic1411
    @bojanjeremic1411 Před 3 lety +5

    Waiting for Dani

  • @RexSmithII
    @RexSmithII Před 2 měsíci

    Is it possible to bake objects separately in large scenes? Maybe by deactivating everything but the ones you want baked , then can you save that map and move on the next building etc…

  • @ayychuchi
    @ayychuchi Před 9 měsíci

    life saving video

  • @sciencetablet2634
    @sciencetablet2634 Před 3 lety +2

    I was having problems with squaree artifacts, did the generate lightmap UVs option and everything appears smooth now.

  • @Furhappens
    @Furhappens Před 3 lety +4

    aaaaand unity decided to skip over the only part I really needed to understand and the most annoying part of baking imo... (overlaying uv's)

  • @lalle5000
    @lalle5000 Před 3 lety +1

    Amazing video!

  • @guillaumedeschamps4566
    @guillaumedeschamps4566 Před 2 lety +1

    Thank you very much for this incredible complete and clear video about such an important subject !
    I am working on a projet where the scene is procedurally created (blocks of a corridor are created as you go along) . So i wonder if there is a specific workflow, when you can't see the final scene in the 3D view ?
    Thanks again !

  • @hernandonj
    @hernandonj Před 2 lety

    Very helpful and clear. Thank you

  • @fatBoxSoftware
    @fatBoxSoftware Před 3 lety +3

    With Enlighten deprecated what is this realtime GI solution that was referenced?

    • @CollapseDev
      @CollapseDev Před 3 lety +2

      Ray Traced GI for DX12 HDRP systems.

  • @tatoforever
    @tatoforever Před 3 lety +1

    GPU Lightmapper doesnt work for me and CPU Lightmapper is so slow that I don't use it.

  • @ultimatebluegrassplaylistc3087

    Great tutorial, thanks!

  • @milesjcarter
    @milesjcarter Před 3 lety +1

    1:32 Terrains aren't a good target for the progressive lightmapper? So what should be using for terrains? I haven't seen this mentioned anywhere in the lightmapping documentation

    • @00ArrowMax00
      @00ArrowMax00 Před 3 lety

      Since you would rarely have anything other then a sun light illuminate your terrain, real time illumination with hard dynamic shadows is really all you need.
      There is no to little bounce light to account for, which is the main target of baked illumination.

  • @Shamysoza92
    @Shamysoza92 Před 3 lety +1

    Is the wireframe glitch gone when selecting objects in Baked Lightmap mode?

  • @joepeaden1661
    @joepeaden1661 Před 2 lety

    Solid tutorial.

  • @CoolSmek
    @CoolSmek Před 3 lety +2

    I really liked the real-time dynamic global illumination light maps feature from unity 5. Will HDRP ever get a real-time dynamic global illumination solution, or will it stay deprecated?

    • @LuukDomhof
      @LuukDomhof Před 3 lety +3

      The developers have confirmed they're looking at alternatives for the new render pipelines. Also note that the reason it is deprecated is because of licensing changes/issues by the company that created said technology.
      It will likely take a while for Unity to roll their own system, but they've mentioned that they're looking to create a system that is suitable in all project types and not just certain genres.
      As an example they mentioned that they would like to implement a way to bake these maps during runtime to enable truly dynamic worlds to also use this feature. However due to all the different ways of computing and baking said maps having their own advantages and disadvantages it'll take time to find the right way to create such a system that is compatible with all different genres.

    • @CoolSmek
      @CoolSmek Před 3 lety +1

      @@LuukDomhof Interesting, thanks for the info. I was beginning to wonder if the only solution for modern systems was going to be real-time raytracing for dynamic global illumination.

    • @LuukDomhof
      @LuukDomhof Před 3 lety +1

      @@CoolSmek I don't think it will be, as there are quite a few methods other people have used as well.
      Even though it is annoying to wait, creating a solid system that works on all genres of games is probably Unity's best bet.

  • @_CloudyBunny
    @_CloudyBunny Před 3 lety +3

    1:32 So what can I do with the terrain? Any advices? Thanks in advance~~

    • @scottcourtney8878
      @scottcourtney8878 Před 3 lety +9

      It may be counter-productive to bake terrain. Outdoor scenes often have large areas lit only by the Directional Light (that is, the simulation of sunlight or moonlight), and as such, will render quickly without baking. For interior scenes, any surface may be (and often will be) illuminated by more than one light source. Depending on whether you are using forward or reverse rendering mode, the computation of multiple direct and indirect light sources onto a surface is computationally intensive, hence the desire for baked lighting.
      If your project rotates and dims the Directional Light to simulate day/night cycles (or even if it just swaps fixed parameters for one "day" and one "night" lighting mode), this again would negate most of the benefit of baking because if the light source isn't static, it will not be baked into the maps.
      Combining these factors with the sheer size of a terrain chunk, and this explains why the video assumes you probably won't need (or want) to bake terrain light maps. All else aside, the terrain would have to either consume a huge amount of space in the lightmap textures, or it would need to be baked at a really low resolution with huge texel size.
      This doesn't mean you can't bake light maps for objects such as building exteriors or large rocks that will be placed on the terrain, if you have invariant sunlight in your project. If the terrain is not marked static (which, again, it probably should not be), then shadows from these objects on the terrain itself will not be baked, but self-shadows or shadows from adjacent static objects, as well as any baked-mode lighting from the objects (such as a street lamp) could still be baked.
      Returning to your question more directly, your best friend for improving terrain rendering performance is likely to be managing the scope of what is to be rendered in each frame, using:
      * Camera frustum culling (intrinsic to the camera itself, but somewhat controllable by your setting for far clipping plane)
      * Occlusion culling of terrain chunks and objects that are on the terrain (divide large terrains into chunks, and set them occlusion static but lightmap dynamic -- they can be static for occlusion without being static for lighting)
      * For very large terrain areas, investigate world-streaming techniques either by creating your own or by using third-party tools
      * Appropriate LODs of medium- and high-poly objects, especially foliage
      * If appropriate, tools and techniques such as 3D imposters
      Occlusion culling is likely to be an iterative process, as there are tradeoffs between the complexity and memory usage of the culling data versus the rendering cycles saved by culling. If the culling is too coarse, very few things will cull because the camera will often have visibility for most of the eligible objects. If it is too granular, the culling will be highly effective but might take a disproportionate amount of computation to traverse the culling graph in order to save a relatively small rendering effort. The only way you can know for sure what's best in your scene is iterative testing (though experience will guide your intuition toward reasonable starting parameters).
      Also pay attention to post processing effects, draw calls (and by extension, material atlases and other draw call reducing techniques), texture memory consumption, render quality settings, and all the other things that can influence rendering performance aside from dynamic lighting.
      Hopefully this is enough to get you started down the right road. :)

    • @_CloudyBunny
      @_CloudyBunny Před 3 lety

      @@scottcourtney8878 Oh my god! Thank you very much for this dedicated advice! It helps me a lot! You're really a good guy! Much appreciated! (❁´◡`❁)

  • @HaroldScottIII
    @HaroldScottIII Před 3 lety +2

    Can you have multiple lightmaps to go from different lit settings such as lit room to dark or dim

  • @nobody_there_
    @nobody_there_ Před 9 měsíci

    Ambient Occlusion, not working under URP... tried everything... And Baking lights takes ages...

  • @_felix128old2
    @_felix128old2 Před 3 lety +1

    why dos my game keep crashing though. every time I try to bake my scene, it will crash and say no fix available and to report a bug but I don't know what is happening. I am using 2019.3 btw.

  • @sanghoonlim6505
    @sanghoonlim6505 Před 2 lety

    Failed to find a suitable OpenCL device for the GPU Lightmapper, falling back to CPU lightmapper. Please install the latest graphics driver.

  • @maxostlund9334
    @maxostlund9334 Před 2 lety

    Is it possible to import a .fbx-file with multiple 3D-objects, where only a few have a second UV-channel for lightmapping and then generate UV-data for only the rest of the objects, that do not have a second UV-channel?

  • @charlesfocant5891
    @charlesfocant5891 Před 2 lety

    Hello. When I bake lights that are set to "Baked", they appear turned off in the final rendering... Can someone tell me why?

  • @tworulegames2697
    @tworulegames2697 Před rokem

    After baked lightning, are we should change the cast shadows off for these meshes?

  • @makimake417
    @makimake417 Před 3 lety +1

    Hey guys is there a way to export lightmaps in full resolution as a file ?
    BR

  • @asilhan9750
    @asilhan9750 Před 2 lety

    hello guys, i have problem with light baking. When i try bake light my normal maps are gone. I lose all normal map effects

  • @zorgi7678
    @zorgi7678 Před 3 lety +2

    The tutorial is intended for familiarization, training and understanding of the material. This means that any person who is not even very familiar with the English language should understand what the presenter is saying. Here, a person chatters, hurries somewhere and does not really understand what he is talking about. Disgusting performance stuff.

  • @ninenin1706
    @ninenin1706 Před rokem

    very helpful

  • @DirectorSangHoonLim
    @DirectorSangHoonLim Před 2 lety

    If pack margin doesn't work, what is problem?

  • @boreal3255
    @boreal3255 Před 3 lety +1

    please use a lower clipping plane on the scene view it looks hideous.

  • @skaruts
    @skaruts Před 2 lety

    Is there any way to change the lightmap resolution on a per face basis? (This is something that was supported by the Source engine, so that's why I'm asking.)

    • @drakefruit
      @drakefruit Před rokem

      lightmap scale in the inspector for the mesh, cant do it per face though

  • @ElNitro7
    @ElNitro7 Před 2 lety

    This definitely helped narrow a ton of things down, however I am still stuck on Preparing Bake.... with 5+ hours listed. Any idea how this could happen? I am using GPU 3080, Lightmap Resolution at 2 with Padding 2. I kept the scene simple this time since I am setting up for the final map, and I have had issues with lighting in the past so I wanted to test everything out prior to bringing in my prefabs. Still no luck as it seems. I am running Unity 2020.3.25f1 as project version. Thank you!

    • @ElNitro7
      @ElNitro7 Před 2 lety

      So I let my project sit over night, and Unity is still stuck on Preparing Bake. Not sure why this is. Could anyone help me in figuring out why?

    • @user-ul5wq3kv4p
      @user-ul5wq3kv4p Před rokem +1

      @@ElNitro7 not sure if you found a solution. But did you check under Lightmapping setting > Lightmapper ? and check to see if its set to GPU.
      If its set to CPU , unity won't use your 3080.

  • @while.coyote
    @while.coyote Před 3 lety +1

    do more of these!

  • @Jimaniki
    @Jimaniki Před 3 lety

    Thanks

  • @Hoxydav
    @Hoxydav Před 3 lety +1

    I need the exact same video but for outdoors scene like a city :p any advive anyone ?

  • @AurelienFelinMusic
    @AurelienFelinMusic Před 3 lety

    OpenCL Error. Falling back to CPU lightmapper. Error callback from context: CL_MEM_OBJECT_ALLOCATION_FAILURE
    THANKS YOU ♥

    • @fatBoxSoftware
      @fatBoxSoftware Před 3 lety

      Generally means you've run out of available GPU memory.

  • @xGredx
    @xGredx Před 2 lety

    Tutorial is usefull, but baking is killing specular shiny completely :/

  • @landonlikesjazz3420
    @landonlikesjazz3420 Před 3 lety +1

    Will 8gb of ram and a Rysen 5 4500u and 256gb SSD be enough to make 2d games in Unity?

    • @user-iq1rw2nr8w
      @user-iq1rw2nr8w Před 3 lety

      yes

    • @landonlikesjazz3420
      @landonlikesjazz3420 Před 3 lety

      Well I mean just generally how well will it run a medium long game i guess.

    • @bojanjeremic1411
      @bojanjeremic1411 Před 3 lety +1

      My suggestion:Make a game that isnt a big game,but that it is having good idea,make it simple,upload,get money,buy better pc

    • @levi2408
      @levi2408 Před 3 lety +1

      Obviously it depends, but 2D games tend to be easier on the hardware. Your specs should be just fine for reasonable development purposes

  • @Drmelv0131
    @Drmelv0131 Před 2 lety

    Will lighting and blooms affect performance for games on mobile platforms?

  • @milankester7920
    @milankester7920 Před 3 lety

    auto generate loads forever it doesnt end

  • @gower1973
    @gower1973 Před 3 lety +4

    Prefer Unreals way of doing it, you can see when you have the right Lightmap resolution for an object because it turns green in the viewport, showing texel density with checkerboard means nothing to me.

  • @x.4132
    @x.4132 Před 2 lety

    Did everything he said and the result looks horrible... everythin is like "fragmented" and some objects with the same settigns than others are completely black. total bs

  • @sarahb1360
    @sarahb1360 Před 2 lety

    missing my ti line sir.

  • @lucutes2936
    @lucutes2936 Před rokem

    update it

  • @1lsgaming27
    @1lsgaming27 Před 3 lety

    I'm still using 5.6 and 2027.3

  • @wellingtonmoreira9902
    @wellingtonmoreira9902 Před 2 lety

    5 48

  • @jeronimocollares320
    @jeronimocollares320 Před 2 lety +1

    I found the solution to all of Unity's (and Unity has many) problems regarding lighting:
    Step 1 - uninstall Unity completely;
    Step 2 - Install Unreal Engine 5.
    Solved.

  • @waltermossis2694
    @waltermossis2694 Před 3 lety

    please subtitile thanks!