Home Unreal Engine

Mysterious shadow errors with baked shadow maps

polycounter lvl 8
Offline / Send Message
Fisher007 polycounter lvl 8
Hi,

I have been struggling with this issue for more than two weeks. After trying everything that came to my mind there are still no results and I have run out of ideas.

Dynamic lights
Iicu7eX.png

Baked:
Mascd1X.jpg

fLpGhvu.png

RhqZ3Ka.png

K5JaXjr.png

The difference between the first three extracted parts are only in the UV and the resolution. From left the first one is auto UVd in the editor, the second one is reUVd in Max, the third one has the original UV. You can see that the 2nd and 3rd has identical normals, tangents and binormals.

Some help would be really appreciated. :poly127:

Thanks,
Fisher

Replies

  • sprunghunt
    Options
    Offline / Send Message
    sprunghunt polycounter
    this is a standard problem with shadow maps. What is happening is that the pixels around the edge of your UV islands are bleeding into the lit part of your object. This is caused by the trilinear filtering on the lightmap image.

    Here's some UDK documentation explaining how to deal with this problem.
    http://udn.epicgames.com/Three/LightMapUnwrapping.html

    In my experience you can't get rid of the problem but you can minimise it by not building your object as separate shells and not splitting your lightmap UVs. this is basically what the article suggests. The easiest way to avoid this would be to simply increase your lightmap resolution to something extremely large like 1024x1024.
  • JedTheKrampus
    Options
    Offline / Send Message
    JedTheKrampus polycounter lvl 8
    If I were you I'd sew what's been split, and split what's been sewn in those problem areas. Just keep trying different things in those areas until you've minimized the problem spots. I personally find that for really extreme angles like what you've got, splits work better.
  • MeshMagnet
    Options
    Offline / Send Message
    MeshMagnet polycounter lvl 9
    I'm having problems with lightmaps too...
    I found this tutorial on Reddit, he explains how there's this 1 pixel padding default thing going on....
    Here he explains what's happening:

    http://www.reddit.com/r/UE4Devs/comments/246whl/the_most_important_thing_about_lightmaps/

    Let us know if this fixes your lightmapping whoes.
  • Fisher007
    Options
    Offline / Send Message
    Fisher007 polycounter lvl 8
    I tried all kind of resolution, low and high as well. (1k, 2k) Also tried an auto packed UVs with large edge padding. No change, so I doubt that it would be bleeding.

    I used a stationery directional light, changing it to static helps. It baked perfect shadows. But I don't think that using static lights is acceptable in a modern game other than mobile (as it won't cast dynamic shadows, eg. for the player) Also I thought (and according to the docs) stationary gives better quality. But the results above are absolutely awful and unacceptable. I still think that those are buggy. :(
Sign In or Register to comment.