Search Unity

Sharp lightmap ?

Discussion in 'General Graphics' started by Erind, Dec 7, 2015.

  1. Erind

    Erind

    Joined:
    Jul 23, 2014
    Posts:
    56
    is that possible to make lightmapps like this in unity?
    Screenshot_2.png
    with a lightmap res like this :
    Screenshot_3.png
    in ue4 im using stationary lighting.
     
  2. Erind

    Erind

    Joined:
    Jul 23, 2014
    Posts:
    56
    can i do something like this with a shader and if so how
    Screenshot_4.png Screenshot_5.png
     
  3. Erind

    Erind

    Joined:
    Jul 23, 2014
    Posts:
    56
    is there anyone from the unity team that can answer my question?
     
  4. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,339
    No, not without writing your own lightmapper (it's way more work than you think).

    UE3 (and presumably UE4) had special handling of the main sunlight shadows. What got baked into the light map color channels was essentially just the ambient lighting (and additional static lights) without any lighting from the main directional light. The shadow cast by the main directional light is stored as a distance field, kind of a blurred version of the shadow, that then uses something akin to alpha test to add in the sunlight color on top of the stored lightmap.

    The closest to this in Unity, though not quite the same (and certainly not as fast), would be using the precompiled bounced lighting and a real time hard shadow.

    edit: UE3 https://udn.epicgames.com/Three/DistanceFieldShadows.html

    UE4 might actually be doing something like my Unity example.
     
  5. Erind

    Erind

    Joined:
    Jul 23, 2014
    Posts:
    56
    I already use that type of config .thanks.
     
  6. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,723
    No you don't. That's a baked shadow.
     
  7. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,723
  8. Erind

    Erind

    Joined:
    Jul 23, 2014
    Posts:
    56
    yes i know that is a baked lightmap but i posted the baked map to show how can it work. thanks anyway.
    By the way amazing game best graphic on mobile i have ever seen.
     
    Last edited: Dec 8, 2015
  9. Erind

    Erind

    Joined:
    Jul 23, 2014
    Posts:
    56
    any idea why when i use baked gi and reatime shadow the shadows are really dark ?
    is this the way it work or is it only me ?
     
  10. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,723
    (thanks :) )

    Do you have an image? I'm not sure what it is exactly you are seeing and there could be a number of causes.
     
  11. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
  12. Erind

    Erind

    Joined:
    Jul 23, 2014
    Posts:
    56
    baked gi

    realtime gi
     
  13. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,723
    Hmm are you using Directional or Directional Specular GI?

    Can you try switching to non directional and see if that helps?
     
  14. Erind

    Erind

    Joined:
    Jul 23, 2014
    Posts:
    56
    no i searched a bit and the mixed light doesnt work it will be fixed on 5.4
     
  15. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,723
    Mixed doesn't.

    Baked and realtime does. What you're seeing is something else.
     
  16. Erind

    Erind

    Joined:
    Jul 23, 2014
    Posts:
    56
    but i use baked gi and realtime shadows this is mixed i think.
    and i have tried all the 3 lightmap type dir,spec,no dir.
     
  17. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,723
    No, mixed is setting the light to mixed (there is an option called mixed)
     
  18. Erind

    Erind

    Joined:
    Jul 23, 2014
    Posts:
    56
    but yes i have set it on mixed other ways it doesnt cast shadows
     
  19. AkiraWong89

    AkiraWong89

    Joined:
    Oct 30, 2015
    Posts:
    662
    If you want to lighten the "shadow", adjust the ambient color.