Search Unity

Static object with lightmap scale 0 casting realtime shadow?

Discussion in 'Global Illumination' started by vvaris, Jun 2, 2015.

  1. vvaris

    vvaris

    Joined:
    May 23, 2013
    Posts:
    26
    Static objects with lightmap scale 0 casting realtime shadows in my scene? It also creates baked shadow to lightmap. Is this intended behaviour?
     
  2. Zomby138

    Zomby138

    Joined:
    Nov 3, 2009
    Posts:
    659
  3. Jde

    Jde

    Joined:
    Oct 2, 2011
    Posts:
    139
    Why is this the case? I would like my shadows to either be baked or realtime, not both.
     
  4. thefranke

    thefranke

    Unity Technologies

    Joined:
    Jun 20, 2015
    Posts:
    153
    Hey everyone,

    Lightmap Scale 0 implies that the object with this scale is not lightmapped, which at first sounds redundant because that's what the Lightmap Static setting is for. However, this is a trick to make an object still have an influence on other static objects (i.e., cast shadows that will be baked on geometry around it), while itself not consuming texels in the lightmap. This is great if you have objects that are for instance very thin (a lamp pole on some street corner): You can reduce baking time by removing the object with scale 0 from the lightmap (won't look much different with or without anyhow), but it will still cast its shadow onto the street (which may be quite significant).

    We are going to introduce an easier and much more enhanced version of this behavior in 2019.2, watch out for the blogpost once its being released!

    Cheers
     
  5. Jde

    Jde

    Joined:
    Oct 2, 2011
    Posts:
    139
    Thanks thefranke. However I'm already aware of the functionality, I just think that the way an object set to Lightmap Scale 0 casts both baked and realtime shadows is wrong. If I've baked in the shadows of a lamp post, I don't want it to then cast realtime shadows too - the shadows double up.

    Could you confirm that's the intended functionailty? It seems so wrong to me that maybe it's a bug?
     
  6. thefranke

    thefranke

    Unity Technologies

    Joined:
    Jun 20, 2015
    Posts:
    153
    Oh, sorry about that, must have overread the double shadowing issue. This is of course a bug, please file a report.