Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on Dec 8, 2022, between 7 am & 7 pm EST, in the DOTS Dev Blitz Day 2022 - Q&A forum, Discord, and Unity3D Subreddit to learn more about DOTS directly from the Unity Developers.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Question Baking Direct lighting?

Discussion in 'High Definition Render Pipeline' started by mrd777, Sep 21, 2022.

  1. mrd777

    mrd777

    Joined:
    May 4, 2017
    Posts:
    48
    Hi there,

    From what I can tell, baking is only meant for indirect lighting, weather on HDRP or any other render pipeline?

    Does HDRP bake direct lighting? Or is this not a thing because direct lights are very cheap to render already?


    Thank you!
    Dave
     
  2. HIBIKI_entertainment

    HIBIKI_entertainment

    Joined:
    Dec 4, 2018
    Posts:
    417

    Cheap depends on whether or not shadows are cast from the DL, and updates in realtime or not, that's where the expense is usually.

    For your main question though, all lighting can be baked if you want.
    All light sources, reflection sources, objects, shadows (2021+), can have mixes of direct or indirect lighting baked, which direction you choose for that largely depends on your projects scope and target hardware / resource limits/

    For Direct Lighting, to switch it to baked
    head to its inspector and change its mode
    upload_2022-9-21_10-45-5.png

    You can find out more about light mode here
     
    tmonestudio likes this.
  3. mrd777

    mrd777

    Joined:
    May 4, 2017
    Posts:
    48
    How does one bake direct lighting? The lighting tab for the scene only gives check boxes to bake indirect light.
     
  4. HIBIKI_entertainment

    HIBIKI_entertainment

    Joined:
    Dec 4, 2018
    Posts:
    417
    Once your light source is set to baked, the lighting contribution of a light direct and indirect lighting is calculated into light maps.

    if you bake a scene with a directional light set to baked and then after - move the light, you should see this.
     
  5. mrd777

    mrd777

    Joined:
    May 4, 2017
    Posts:
    48
    Yes, but the baking does nothing at all, unless I check on "Baked Global Illumination".

    The thing is, my game doesn't utilize GI due to its stylized lighting.

    So when I hit bake without checking on "Baked Global Illumination", nothing gets generated.

    So it basically wont bake direct lighting unless I bake GI, is what the case seems to be.

    Either my understanding is wrong about baking, or Unity just has a confusing lighting window?