Announcement

Collapse
No announcement yet.

[Lighting] Dark artefacts on parts of static mesh when baking lights.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [Lighting] Dark artefacts on parts of static mesh when baking lights.

    Hi everyone,

    I'm relatively new to Unreal Engine (and super new to lighting as well!) and I'm having some issues with lightmap and light baking.
    I've modelled and textured an asset and brought it in the engine. So I believe I have a good UV layout for the lightmap.

    Here's the model (with UV map as well):
    Click image for larger version

Name:	Computer.jpg
Views:	125
Size:	103.3 KB
ID:	1688998

    And here's the (infamous!) shadow glitch, that is super visible on the keyboard part:
    Click image for larger version

Name:	Computer_LightGlitch.jpg
Views:	89
Size:	33.5 KB
ID:	1688999

    My lightmap density is at 128, the mesh is static, and nothing on the UV map is overlapping, I don't know what's going on. I've watched videos on Youtube about lightmap and all, but I still can't figure out what's going on here...I'm sorry if it has already been talked about a million times before, I don't know what to search for to find any solution.

    If you need more information or screenshot to help, please let me know, I'll send them as soon as I can.

    Thanks in advance for the help guys, have a nice day!

    JumanCreative

    #2
    You need way more padding between UV islands at that lightmap resolution. Right now the UVs are so tightly packed that lightmass will paint the same texels for different positions of the surface, that's where the artifacts come from. It checks if spot A on the mesh is in the shade or not. If yes then it paints that texel of the lightmap as black and it solves the position of the texel by using the UV map. Then it checks spot B on the mesh and its not in shade and it paints that spot as white. But since the UVs are so closely packed the UV coordinate resolves into the same texel coordinate as with spot A and you get overlap.

    Try overlaying a 128x128 checker texture on your UV map, that way you can see how much space a single lightmap texel will take in the UV map.

    Comment


      #3
      Originally posted by jonimake View Post
      You need way more padding between UV islands at that lightmap resolution. Right now the UVs are so tightly packed that lightmass will paint the same texels for different positions of the surface, that's where the artifacts come from. It checks if spot A on the mesh is in the shade or not. If yes then it paints that texel of the lightmap as black and it solves the position of the texel by using the UV map. Then it checks spot B on the mesh and its not in shade and it paints that spot as white. But since the UVs are so closely packed the UV coordinate resolves into the same texel coordinate as with spot A and you get overlap.

      Try overlaying a 128x128 checker texture on your UV map, that way you can see how much space a single lightmap texel will take in the UV map.
      Fully agree, I also think that you can also split those closed stripes you have.

      Comment


        #4
        Oh, I'm starting to understand, thank you, guys!
        It brings some more questions to me though (you'll probably see how much of a newbie I am haha):
        1. Can I increase the padding directly with the lightmap generation built inside of Unreal? Or do I need to get back in Blender to re-edit my UV map/lightmap?
        2. If I increase the padding, I assume the risk is that I'll end up with a lower quality lightmap. Is there a process of laying out the UV that can allow me to have minimum padding so I can get the most of my lightmap, even at a 128px resolution?
        3. Originally posted by Bathil View Post
          Fully agree, I also think that you can also split those closed stripes you have.
          What do you mean by closed stripes? What does it cause?
        4. Lightmap seems to add a lot of work to the overall process of making assets. Do you have a workflow that allows you to speed things up, eventually?

        Thank you again for the clarifications, I'll work on it and correct the issue!

        Comment


          #5
          About #4:

          You can skip lightmapping entirely and use dynamic lighting.
          Lightmaps are cheap to render, dynamic lights are not, but lightmaps eat a lot of extra memory.
          | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

          Comment


            #6
            Soooo if I'm correct about this, I can work with dynamic lighting all day to build my levels, and then I can make an optimization pass to have better performance and loading times for instance?
            Thank you sir

            Comment

            Working...
            X