Search Unity

Question Baked lightning and realtime lights

Discussion in 'Global Illumination' started by noahx, Jul 31, 2021.

  1. noahx

    noahx

    Joined:
    Nov 22, 2010
    Posts:
    77
    Hi guys,
    As usual, I'm trying to learn more about lightning in Unity but, I'm still struggling with the basics.
    First of all, is it possible to have baked lightning on objects and also get affected by a real time light? If so, how can I set that up?

    Currently in my scene, it's a dungeon, darkish one just with a few small torches on the walls that give just a small amount of light and some shadows, and that's the baked lightning, but the player is walking on those dungeons with another torch in his hand, providing way more light suitable for the player to really see what's going on. But I can't make that to work. The light from the player is ignored and it is set to "realtime" and it is only affecting the player and not the surroundings (the baked lightning objects).

    How can I achieve that? Does that have something to do with shaders? I'm using Mobile Vertex Lit.

    Thanks.
     
  2. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,791
    Yes. Have some lights set up as mixed (where direct light is realtime, indirect is baked), or just realtime (where direct light is realtime and indirect doesn't exist).
    Are those torch lights set as baked?
    Don't use that shader. Why are you using that shader? Are you making a mobile game? Even then that shader is way too old.
     
  3. noahx

    noahx

    Joined:
    Nov 22, 2010
    Posts:
    77
    Hi,
    Thanks for your answers. I haven't explored using mixed lights but I'll give it a shot.

    About the torch lights, yes, those are set as baked.

    And about the Mobile Vertex Lit shader, I'm using it, because I was reading somewhere around that it is the cheapest shader in terms of performance (and that standard shaders were very expensive for mobile) and I'm aiming for mobile. Not sure if it matters, but I'm using Unity 2020 Built-in renderer.

    Thanks :)
     
  4. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,791
    Don't use the Standard Shader, sure, but you could be using the legacy diffuse or something.