Home Unreal Engine

Strange Lighting Bugs Even With LightMaps?

Hey guys, I'm working on a mini environment to demonstrate some technical stuff (thus the low quality) and I'm getting a lighting bug that looks a lot like a normal "no light map" bug would look where the seams of my modular wall piece look really obvious. Here's a shot:

N3mOi2p.jpg

The wall piece (and the filler wall piece above the door) both have lightmaps set up but I'm getting the error, regardless. Any ideas?

Thanks :)

Bean.

Replies

  • Hourences
    Options
    Offline / Send Message
    Hourences polycounter lvl 18
    The seams you get when having "no lightmaps" aren't actually due to a bug. Without lightmap it will fall back on vertex lighting, but due to Unreals special approach to subdivided vertex lighting, seams appear between modular meshes (which because, great joy, epic by default has hidden the property that is meant to fix that you can't easily get rid of anymore)

    Either way, lightmap wise the low resolution of your lightmaps are helping much to begin with. I would increase the lightmap resolution, and look into lightmap gridding. Lightmaps like other textures are pixel based. Pixels are squares. Thus an image is actually a grid of pixels. Aligning the UV edges of your lightmaps to a grid of 64 or 128 results in significantly reduced lightmap seams. It may not fix it entirely, but it will improve significantly.

    lightmapuvgrid.jpg
  • Sinking
    Options
    Offline / Send Message
    I have had this similar problem, except I already found out about the lightmap snapped to a grid. My problem was that even though the same (modular) meshes snapped to each other won't show a seam, but modular mesh (A) + modular mesh (B) snapped together will still show a seam. I found the only way to prevent this was to snap my mesh (B) lightmap UV shell(s) exactly to the lightmap (A) UV shell(s). Only if they have the same size and orientation will there be no visible seams.

    I have cursed the lightmap system in UDK so often, because it forces me to think about my lightmap more than about the actual model. The first dozen times I imported some mesh I always lived in fear of seams, etc. I tended to stretch the shells as large as I could on the UV map, because I wanted to get as much resolution as possible.
    However, what worked the best for me is to keep everything at a relative scale to the mesh that it is going to snap to. So in your case with the part above the door, I'd make sure it's rotated the same way like the other wall piece(s), but only (about) a sixth their size on the lightmap UV. It's quite logical actually, because if you were to stretch that uv shell across the entire UV space, you would get a higher lightmap resolution on this part in relation to the other parts, even if they all are e.g. a 128 resolution in UDK; it would simply have more UV space than the rest and therefor different shadows.

    And yeah, Hourences sells tutorials and makes award winning games, so he certainly knows more than I do. I just know how frustrating the lightmap issue was to me and wanted to add my experience with it.
  • Beanwright
    Options
    Offline / Send Message
    Thanks guys, I'll take a look into gridded light maps and try and mess about with the resolution and positioning of the parts. :)
  • passerby
    Options
    Offline / Send Message
    passerby polycounter lvl 12
    when working with lightmaps, you need to have all islands with a good amount of padding on them, and without texture borders being.

    every shell should have 2 pixels of padding along all it;s border edges, and also borders should not cross through the middle of pixels in the lightmap.
    If im using a largest lightmap like above 128pixels i will even go as far as 4px padding.

    So what you should do is this, set your grid spacing to a low power of 2 number, like 2 or 4, and make sure all of your shell borders are on the grid, where possible, and that there is at-least 2 grid spaces between all shells. 2 Grid spaces between would equal 4 px padding, 2 px for each shell. so would want 4 grid spaces for 8px between shells to give them each 4px padding if working in a larger lightmap size.

    Also the default light map size in udk, is way to small for anything but small props, so find some good values for it, for your props, vs environment pieces.

    yes sounds like a complicated mess, but it works, also lighting still can bleed over connected edges in the UV map, so if you want a edge in a mesh, to light like it is a hard edge, spilt it in the lightmap UV's, and give it padding.
Sign In or Register to comment.