Home Technical Talk

Lighting Issues in the UDK

Ok so Im getting some really strange results with my lighting in the UDK, Its getting very muddy whenever I build the level, I wasn't havent this problem earlier, but I haven't changed anything(that I know of) to cause this result.

Within Max I have the texture UVW on channel 1 with the lightmass channel set to 2. hers it in the content window.
lighting_1_by_AlbinoGoldfish.jpg

I have the channels set properly within the editor to my knowledge and the UV's are laid out perfectly(I used flatten mapping for the lightmass UV)

heres in game

lighting_2_by_AlbinoGoldfish.jpg

Anyone wanna take a stab at this? Cuz im friggin' stumped, ive tried all i know how to try and followed plenty of tutorials to see where I may have screwed up my workflow. But for the life of me I can't seem to figure out whats causing this, if anyone wants anymore info let me know.

Replies

  • Ark
    Offline / Send Message
    Ark polycounter lvl 11
    I'm not really that experienced with UE3 but have you checked for any duplicate faces/verts in the mesh?

    Also just to check, uv chanel 1 in max is 0 in UDK, so chanel 2 in max and 1 in UDK, etc. Make sure you have the right lightmap index selected and a big enough resolution to capture it.
  • Minos
    Offline / Send Message
    Minos polycounter lvl 16
    Do you have dynamic lights in the scene?
  • Shogun3d
    Offline / Send Message
    Shogun3d polycounter lvl 12
    Almost looks like something funky with SSAO, do you have it enabled?
  • gamedev
    Offline / Send Message
    gamedev polycounter lvl 12
    and the UV's are laid out perfectly(I used flatten mapping for the lightmass UV)
    Sorry to be blunt - it's monday ;) - the UV's created with flatten mapping are garbage. Take your lightmap uv set and stitch as mean pieces together as you can. The less islands / chunks / sections etc the better. And unlike your texture uv set, the same rules about scaling, stretching etc do not apply to lightmaps. So once you have a few nice big pieces stitched together scale and stretch them to fill out your 0-1 uv space. Lastly, ensure each island has a decent amount of spacing between each other, however they won't need any spacing around the edges of the 0-1 uv space as lightmass will do that for you.

    For something this size with a great lightmap, you could use a 32x32 lightmap res and get great results with lightmass. I can't see what your light setup looks like, but just for testing, put the piece in a black room and setup a light and shadow caster that will cast shadows onto this mesh. Keep fixing the lightmap uv's till you have a nice shadow res.

    -Tyler
  • albino_goldfish
    Minotaur0 wrote: »
    Do you have dynamic lights in the scene?


    Heres are the light Parameters

    lighting_3_by_AlbinoGoldfish.jpg
    kaburan wrote: »
    Almost looks like something funky with SSAO, do you have it enabled?

    Not that I am aware of, i havent turned it on, don't even know how to at this point (im new to lighitn in Unreal if you cant tell)
    gamedev wrote: »
    Sorry to be blunt - it's monday ;) - the UV's created with flatten mapping are garbage. Take your lightmap uv set and stitch as mean pieces together as you can. The less islands / chunks / sections etc the better. And unlike your texture uv set, the same rules about scaling, stretching etc do not apply to lightmaps. So once you have a few nice big pieces stitched together scale and stretch them to fill out your 0-1 uv space. Lastly, ensure each island has a decent amount of spacing between each other, however they won't need any spacing around the edges of the 0-1 uv space as lightmass will do that for you.

    For something this size with a great lightmap, you could use a 32x32 lightmap res and get great results with lightmass. I can't see what your light setup looks like, but just for testing, put the piece in a black room and setup a light and shadow caster that will cast shadows onto this mesh. Keep fixing the lightmap uv's till you have a nice shadow res.

    -Tyler


    lighting_4_by_AlbinoGoldfish.jpg

    lighting_5_by_AlbinoGoldfish.jpg

    heh, don't worry about it, if I worried about people being blunt I wouldnt be posting this stuff (I should thank you actually) but im still running into the same problem even with this UV set up.

    I apologize for taking so long to respond to you guys, been a long day. I really appreciate the help so far!!
  • Joshua Stubbles
    Offline / Send Message
    Joshua Stubbles polycounter lvl 19
    gamedev wrote: »
    The less islands / chunks / sections etc the better

    Not always. If you have everything stitched together, you're going to get a lot of bleeding over corners and such. You want there to be breaks on places you want hard edges, say, the 4 sides of a building. You wouldn't want to stitch those sides together, since the lightmap will just blur across the corner and look like a mess.

    So I take it you've tried setting a larger map size? What level of lighting are you using? Preview? Medium? Production? Each one changes the resolution of the lightmap calculated.
  • albino_goldfish
    gamedev wrote: »
    ... you could use a 32x32 lightmap res and get great results with lightmass..
    -Tyler


    fixed_by_AlbinoGoldfish.jpg

    ok, forgot to change the lightmass res when I changed the UV's here it is afterwards, looks much better, still not perfect, but now I know im heading in the right direction!! Thanks so much!
  • gamedev
    Offline / Send Message
    gamedev polycounter lvl 12
    Not always. If you have everything stitched together, you're going to get a lot of bleeding over corners and such. You want there to be breaks on places you want hard edges, say, the 4 sides of a building. You wouldn't want to stitch those sides together, since the lightmap will just blur across the corner and look like a mess.

    ^ ^ What Josh says is very true. If you can make nice breaks where this stuff will occur AND reduce the number of islands (which lead to seams) then you'll be much better off.

    The lightmap is looking much better. You could still select all your UV's and scale them up in Y and fill out your 0-1 and get more lightmap res. Again, stretching won't affect the lightmap.

    All I'm seeing now though is just some very general lighting - ie no dramatic shadows or light so it's hard to tell whats going on. Are you baking w/ the production preset? And sorry, I didn't realize how large the asset was - you could get away w/ a 128 lightmap if needed (ie you have lots of nice, detailed shadows on it).

    Lastly, don't always fret about small lightmap issues - in the end a good majority of them will not be noticeable once texture is applied. The key is to make sure you don't have any obvious bleeding, and that your shadow and light detail are soft or crisp depending on the lighting.

    -Tyler
  • Peris
    Offline / Send Message
    Peris polycounter lvl 17
    you should never be making lightmaps uv's by hand, that's just doing stupid robotwork for a hardly noticeable difference.
  • Michael Knubben
    Peris: opinions are divided on that, I can tell you. I'm not sure where I stand on the issue, except that I do hate the shit out of unwrapping lightmaps, so when given the option I will choose 'fuck doing it by hand'.
  • Joshua Stubbles
    Offline / Send Message
    Joshua Stubbles polycounter lvl 19
    I always start with an exploded/auto-unwrap UV. Then I'll stitch together the larger islands where it makes sense. But I don't spend too much time on it. Without any optimizations at all, it adds a lot of excess data to the mesh.
  • albino_goldfish
    Thanks for the tips everyone, the UV real estate is being shared with another item in the scene at the moment. I guess the issue is up in the air...maybe a sticky thread about lightmapping is in order? anyhoo I really appreciate everyone's input and its has helped me grasp what needs to be done to get this sort of thing to work properly
    gamedev wrote: »

    All I'm seeing now though is just some very general lighting - ie no dramatic shadows or light so it's hard to tell whats going on. Are you baking w/ the production preset? And sorry, I didn't realize how large the asset was - you could get away w/ a 128 lightmap if needed (ie you have lots of nice, detailed shadows on it).

    Lastly, don't always fret about small lightmap issues - in the end a good majority of them will not be noticeable once texture is applied. The key is to make sure you don't have any obvious bleeding, and that your shadow and light detail are soft or crisp depending on the lighting.

    -Tyler

    I've got one large light in there right now, to just kind of mimic what overall shadows I want cast by what will eventually be a sun in a skybox. I'll start a thread soon enough to detail what exactly im doing, and throw the link on here in case anyone is interested. I am only baking preview to medium right now, as high or production crashes at 98.72%, I'm still messing with my importance volume for that.

    Thanks again everyone!
  • gamedev
    Offline / Send Message
    gamedev polycounter lvl 12
    you should never be making lightmaps uv's by hand, that's just doing stupid robotwork for a hardly noticeable difference.
    Indeed, but as we're talking UDK, the auto UV generator (which is MS DirectX not Epic) can produce quite shit results. Maybe there is a better in-house tool you've used?

    As for spending time on it - take your diffuse uv set, copy it to your lightmap uv set and start there. Should not take more than a few mins.
Sign In or Register to comment.