Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

A Request for Lighting/Lightmaps

Discussion in 'Global Illumination' started by SomeGuy22, Aug 3, 2015.

  1. SomeGuy22

    SomeGuy22

    Joined:
    Jun 3, 2011
    Posts:
    722
    As I'm sure the devs know, Enlighten has been a pain in many people's sides. Lighting errors, blotchy shadows, upgrade problems, clipping issues, and (the worst for me) slow bake times. Example:


    This post on the same forum describes these problems. And I'm sure many of us Unity Users are aware that the slow bake times are in part a result of the new Global Illumination features. And we know some of the lighting errors can be fixed with longer bake times or a complete re-working of UVs.

    However, for a developer like me, I'd love the return of Beast functionality. I know this may not be possible, but the problems with Enlighten could be ignored if there was an option for a simpler type of bake. The problem I find myself in right now is this:


    The realtime shadow fades out due to the shadow settings in the Quality Preferences:


    I'm aware this value can be raised, but obviously that comes with slower performance. It appears that mixing baked lighting with realtime is no longer available. Notice how in the first image the houses (marked static) don't cast shadows on to the terrain (not marked static). But items not marked static (the basket) has realtime shadows. In that image, the Directional Light is set to "Mixed".* Not sure if that's how it's intended to work... But Beast was able to do this:


    That screenshot was taken from this page. I'm not sure if there's something I'm missing, but transitioning from realtime shadows to baked doesn't appear to be possible.
    *Side note: setting the light to "realtime" for some reason makes no light visible except for the baked objects, might be because I have Realtime GI disabled, but that shouldn't break shadows, which should be separate from GI

    So to sum it all up, I'd find it very useful to have a "simple bake" option. I don't need high quality GI or extreme filtering or blur effects or even AO... I just need the same shadows that I see in the realtime shadow shown in the second image to extend across the whole map. I know it still involves lightmapping generation and atlasing and shadow projection, but surely it won't take nearly as long to bake, seeing as a good portion of the map can have the above shadows in realtime. Essentially if I could just take that low quality realtime shadow data and just apply that as a baked texture across the whole map (like a lower quality Beast) that would solve my problem. (And I'm aware it's no easy task but it's better to ask and be denied then be stuck with Enlighten forever :p )

    Thanks in advance! And thank you to Unity Devs I've seen for working their butts off trying to fix all the Enlighten bugs :)
     
  2. Deleted User

    Deleted User

    Guest

    Your UV Maps don't look right, I'd start there first. Did you also generate lightmap UV on import?
     
  3. SomeGuy22

    SomeGuy22

    Joined:
    Jun 3, 2011
    Posts:
    722
    UV1 maps have to be correct, as you can see the texture is fine. I didn't generate lightmap UVs, so I could try that. But it seems strange that I'd have to do that for every object now... I don't remember having to work on a per-object basis for Beast, other than just checking the "static" button.

    But that's not really my request. While that could fix the errors in Enlighten I'm asking for a simpler bake in total... One without GI or AO etc. Just the same quality as realtime lights but stretched across. Once again, I don't see anything that allows me to blend between realtime and lightmaps in Unity5--seems like only Beast could do that.
     
  4. Deleted User

    Deleted User

    Guest

    Well it should be able to, have you set your directional to mixed? I'm sorry, but to me the UV's look mighty messed up.

    So to make sure it isn't your UV's causing the issue, I'd generate them..
     
  5. SomeGuy22

    SomeGuy22

    Joined:
    Jun 3, 2011
    Posts:
    722
    As stated in starting post, you can look at the first picture and see the issue. The light is set to mixed, yet the baked object stays baked even at that close range. The unbaked object has realtime lighting like normal. And the baked object doesn't cast realtime shadows on the unbaked terrain.

    In Beast there was a scene option when the lightmap window was open that said "shadow distance" which controlled distance for the mix between realtime and baked. *Here is a screenshot from Unity 4:


    No such parameters appear to exist now.
     
  6. Deleted User

    Deleted User

    Guest

  7. SomeGuy22

    SomeGuy22

    Joined:
    Jun 3, 2011
    Posts:
    722
    So we can no longer mix lightmapped and realtime shadows, as I predicted.... Well it seems like that's kind of a waste of CPU cycles. I don't need realtime to extend that far even if it is more efficient... What about users that want to lower realtime shadow distance from Quality settings? They'll be left with the same fade-out problem shown above--unless it blends into a lightmap, where no shadow calculation needs to be done. If shadows are more efficient, then I would presume they could be even more efficient and look better blended with lightmaps.
     
  8. SomeGuy22

    SomeGuy22

    Joined:
    Jun 3, 2011
    Posts:
    722
    It's to the point now where no dual lightmap support is driving me insane :(

    Take for example this scene:


    This is an indoor scene (with a roof). I thought maybe I could trick Unity into having both Baked and Realtime Light by having 2 Directional lights (one baked, one realtime). But the static objects (as stated countless times above) aren't affected by Realtime lights once baked.

    The realtime only result looks like this:



    This is correct (the roof blocks the light and there are no shadows inside, because everything is realtime--the light is not ignoring the object because it is not baked)

    Now as stated above, realtime calculations have been "improved" (though I'm not sure how much of a difference it actually is). But what hasn't been improved is the fact that I can still only run a couple of pixel-texel lights* at a time (without going insane on the user settings). *Unity falls back to vertex lights which look atrocious on low-poly meshes. I was hoping to bake my lights for interior, but as stated above, it means the character will no longer cast shadows on the object (and vise versa), and there is no mix between realtime and baked lighting.

    So it seems currently the only solution is to do all-realtime, without many pixel lights. I would've liked to have solved it with a dual-lightmap solution, but unfortunately no such feature is still available. I'm hoping a dev will find this and suggest a solution. A simpler bake, or even dual lightmapping with Enlighten, would save me (and a lot of other developers) quite a bit of trouble. Or at the very least, I'd like an explanation as to why exactly dual lightmaps are no longer an option.

    Side note: I heard Enlighten 3 is expected to be implemented, however looking quickly through the changes, nothing lists realtime and baked being mixed. Performance over large surfaces are supposed to improve, which is good. But really this seems like a more vital feature. I'm really wondering what users are doing right now--if going for all Realtime is really worth the frame drops that could've been saved with dual lightmapping :/