Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Several Issues With Mixed Lighting

Discussion in 'Global Illumination' started by FleshKnot, Apr 17, 2018.

  1. FleshKnot

    FleshKnot

    Joined:
    May 4, 2014
    Posts:
    67
    Currently I am attempting to bake a scene with mixed lighting for test purposes. The scene contains props and buildings which are light map static and a dynamic skinned mesh (first person arms) with a regular dynamic mesh parented (sword).

    The first issue I am experiencing is that when baking mixed lighting, the real time portion of the light seems to pass through the light map static objects and randomly illuminate the interior of the scene. Which leads to the second problem, the dynamic objects attached to my first person controller are being illuminated by the realtime light inside the interior of the scene as if they were outside being 100% illuminated making them extremely out of place visually.

    My end goal is to have the interiors illuminated as if they were 100% baked lighting while having the dynamic objects illuminated by light probes. Even with the only directional light in bake mode the dynamic objects are not illuminated properly by light probes in the interior.

    The first picture is mixed lighting inside an interior that is inaccurately illuminated. The second picture is the same interior with 100% baked lighting which is fine except for the fact that the arms and sword are not lit properly with the interior of the scene. The third picture demonstrates how the blade of the sword has the same illumination outside in direct light as it does in the interior.
     

    Attached Files:

  2. uy3d

    uy3d

    Unity Technologies

    Joined:
    Aug 16, 2016
    Posts:
    187
    Have you made sure that the geometry of the ceiling is closed? One easy way to check that is to move the camera up and look at the ceiling from above. If it disappears, you'll have to flag the mesh as a double sided shadow caster.
     
  3. AlejMC

    AlejMC

    Joined:
    Oct 15, 2013
    Posts:
    149
    I'm having the same issue, sorry for the necropost revival but it's been years
    I put some point lights on mixed mode, they are supposed to be baked for static objects and cast dynamic lighting on dynamic objects... however only two things happen:
    - If set to Baked, it will bake the shadows on static objects as expected, it won't light the dynamic objects (it is effectively off for dynamic objects)
    - If set to Mixed, it will bake direct lighting, without shadows and it will be fully dynamic for dynamic objects
    - What's desired: bake direct, indirect and all via lightmaps (shadows included), illuminate dynamic objects with the same light but in realitme mode for those objects (and maybe cast dynamic shadows between dynamic objects if possible).

    What would be the way to achieve the third scenario? Maybe putting some lightprobes around the dynamic light? Or duplicate the light, one for baked and one for dynamic?

    All of this in URP, 2019.3.0f6 but has been the case since the introduction of baked indirect and mixed.

    PS: BakeIndirect is nice and all but the shadows are always dynamic, it would be nice to have an in-between.
     
  4. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,910
    I think Subtractive mode will do this, but only works for Directional Lights last time I looked.

    Dynamic objects will have realtime shadows that blend with baked shadows. Baked cannot cast shadows, so you maybe need light probes too.
     
  5. AlejMC

    AlejMC

    Joined:
    Oct 15, 2013
    Posts:
    149
    Indeed, directional lights work.
    For point lights I don't really mind not having the dynamic shadows, but would totally benefit from close lights doing 'analytical' lighting, specular and all that on dynamic objects.
    I didn't try with light probes, that will probably simulate it close enough... light probes for direct lighting and reflection-probes for specular