Home Unreal Engine

UDK Newb Questions: Lightmaps & Geometry!

Hey everyone!

I'd like to start by saying I do have a generous amount of experience when it comes to modeling / texturing in Maya. However, my UDK knowledge was basically none two weeks ago. I'd ultimately like to be able to display my work in UDK for future portfolio updates.

I have a few questions i haven't really been able to get solid grips on. They seem so stupid, but hopefully this will help my learning process, and potentially others that are learning as well.

TL;DR : My questions are as follows:

1) Does static mesh geometry NEED normal maps to display lightmaps correctly in UDK?

1b) Would it be pointless to use lightmaps if you don't intend on creating normal maps? Lets say you were just wanting to do low poly, hand painted scene?

2) Can I get away with some 90 degree angles? I know things IRL don't have such sharp angles, but we cannot just bevel every edge we come across, right? This doesn't seem like a good practice when trying to minimize poly counts?

3) Does a static mesh need contiguous geometry for lightmaps? Does the geometry need to be closed, or can it be open (for ex: bottom of a box can be deleted if its never going to be seen).

I'm sure i'll have more questions regarding these issues.. but i'll start there, as this post already seems lengthy. I hope one day, I too will be able to contribute to this site, as its provided so much inspiration!

Thanks for all help & replies in advance. I appreciate your time.

Replies

  • SanderDL
    Options
    Offline / Send Message
    SanderDL polycounter lvl 7
    1. No you don't NEED normal maps. Lightmaps are just seperate textures that have light and shadow information in them.

    1b. It wouldn't be pointless. Depending on the style you are going for you can still bake lightmaps. As you are still going to want shadows and lighting in your game. And lightmapping is a lot cheaper than realtime shadows/lighting.

    2. Sure you can get away with 90 degree angles. But you can also get away with lots of chamfers. You just have to keep the polycount in mind and consider how close you get to see the model. Then decide if it is worth it to add more detail.

    3. It is fine to delete hidden faces. Do keep in mind that faces that you've deleted can't bounce lighting or cast shadows. Which can sometimes give some artifacts. But overall you shouldn't worry about it too much.
  • theDEAD
    Options
    Offline / Send Message
    Thanks for the reply, SanderDL!

    My next major question / concern is regarding the UV's for Lightmapping. I've read the many notable tutorials and guides found on the internet: UDN, Hourences,Chris Albeluhn's, Stephen Jameson's & finally the WOLD vids on youtube.

    After reading these several times, i feel like i have a solid grasp on the idea behind Lightmapping and how it works. However, I'm slightly foggy on the UV's and what can and cannot be welded.

    Sometimes I see people welding things together that have sharp angles. Then other times i see examples on UDN where they have this non-contiguous looking bridge with several pieces. Some of these pieces which have 90 degree angles seem to have the UVs welded, then other pieces are broken down face by face.

    Is there a best method of welding UV's when it comes to low poly geometry with lots of hard edges and no normal maps?
  • r4ptur3
    Options
    Offline / Send Message
    r4ptur3 polycounter lvl 10
    generally I weld as much as possible for my lightmap UVs, but splitting shells on 90 degree angles will yield sharper and crisper lighting data. The easiest way to see the difference is to UV a cube. Sew as many sides as you can. Throw it in the UDK and take a look at the lighting data -- compare how the sewn edges look in comparison to the unsewn edges. You should be able to see the difference pretty easily.
  • theDEAD
    Options
    Offline / Send Message
    Hey R4ptur3,

    In general would you say for every 90 degree-ish, or sharp-like edges its best to split the UV's to create its own shell?

    I'm aware of the wasted Lightmap UV space that is created by having more UV shells/islands. And that higher resolutions in the Lightmap may be required to compensate for the additional islands. But, it would seem like some designs with lots of hard edges at these sharp angles would require this method, correct?

    Another stupid question (sorry): Is it best to put UV shells that would render black, or extremely dark in closer proximity to each other in the UVs? Or does that not matter, as long as there is sufficient padding between shells? (To avoid bleeding)

    Thanks again for the replies guys. It helps a lot.
  • theDEAD
    Options
    Offline / Send Message
    Hey guys -

    So I was trying out this Lightmapping thing with some stairs I made. I'm trying to better understand how Lightmapping in UDK works beyond just a simple cube. So these stairs are farily low poly, lots of hard edges (as I have been previously asking about) and as you can tell, i'm getting some pretty ugly results.

    The current UVs are set to the correct channel. The current lightmap build was set to 128x128. No overlapping UVs, No inverted UV's in Maya, Normals facing the correct direction. History deleted, transformations frozen, and exported via FBX 2013, with Smoothing Groups, Smooth Mesh, & Triangulate options checked. Oh~ I'm using Maya 2013, and the Latest build of UDK as well.

    I'm hoping some of you guys can explain to me whats going wrong here. Is it my UV's, the way I've modeled the Mesh? UDK Settings? Combination of them all? Haha.. I have no clue.

    Lightmap_errors_zps5c1027ea.jpg
  • SanderDL
    Options
    Offline / Send Message
    SanderDL polycounter lvl 7
    This doesn't look too bad actually. I have the feeling the whole 90 degree angle thing is confusing you. What you should try is to have as litlle UV islands as possible. Which will mean you have less seams, so less chance of artifacts and edge bleeding.

    For example, all the steps could be all stitched together to form one UV island.

    Also, are you using a dominant directional light or an omni to bake this? Directional is certainly the best choice in this case.
  • theDEAD
    Options
    Offline / Send Message
    Hey SanderDL!

    I will immediately take that advice and redo the UV's stitching together all the steps, then repost the results. Btw, this is not a contiguous mesh - The middle steps are a single object, as well as the side parts. I just combined them into one mesh, and imported.

    Do I need to close this mesh (Backside as well as bottom) or can i leave it open? Because currently its closed, except for the left and right side of the middle steps.

    Also, when you said stitch together the steps, do I have to worry about that underside poly that's likely going to render dark- bleeding into the other poly's if stiched? On UDN's page on Lightmapping and UV's they talk about detatching faces that render black from shells to avoid bleeding...

    To answer your question about lighting. I haven't changed a single thing - I'm such a newb with this stuff that I am just using the default settings with the Mid Day lighting setup that came with UDK. Is there anything I should change or should know about while doing these bake tests? Now that i think about it, the only thing i did change was turning off the ambient occ so I could see things a bit better.

    Best Regards~

    Lightmap_errors_02_zps73831b75.jpg
  • r4ptur3
    Options
    Offline / Send Message
    r4ptur3 polycounter lvl 10
    woah, that's a 128x128 lightmap? It looks a little lowres for some reason (but not bad).

    I'd save splitting lightmap shells for things that are machined. Straightening your UV shells was the way to go, for sure. Another thing to consider -- make sure your UV shells fall between pixels. If the shell edge falls on a pixel that is shaded black, but the lightmap data is supposed to be white you will get lightmap seam.

    In my experience lightmap data can look pretty ugly by itself but as soon as you apply a material the object will look just fine. Materials with a diffuse texture really help to cover up the weird data.
  • theDEAD
    Options
    Offline / Send Message
    R4pture3- Thanks for checkin back on my thread... I need all the help I can get :)

    What are you refering to when you say to save UV shells for things that are machined? More organic shaped objects?

    I've tried to align these UV shells along the grid. I have my UV grid setup to match a 128x128 pixel lightmap. ( 1/128 ). But that leads me to another question, which I've seen asked before but didn't really get a clear answer on it. Some UVs may be able to be straightened and aligned to the grid so they don't fall in between pixels, but not all shapes and objects will be able to do this, right? Especially organic objects? What happens then? You just deal with the bleeding?

    I threw a basic wood texture on the stairs, and you're right, it does slighly cover up the uglyness. Although only at close range? It seems that when i back away further from the stairs, the lightmap becomes darker, and more noticeable again. In the past I heard people talking about "mip-mapping"... which I generally have an idea what it is... But, is there a fix to this issue i'm having?

    When it comes down to it, I'd really like to be able to fix the problems of the lightmap at the source, rather than relying on textures to mask the issues. Is this just my OCD wanting something to be perfect, that ultimately will never be? HAHA!

    Peace~
  • r4ptur3
    Options
    Offline / Send Message
    r4ptur3 polycounter lvl 10
    No problem :)

    Lightmaps are one of those things that seem simple, but they go all crazy when you put them into practice.

    It is easy to straighten man made object's UVs, but yes ... more organic shapes will fall on pixels and get muddy. There's just no avoiding it. You can crank the lightmap resolution to mask the problem but it will always be there.

    The more man-made the object is, the more I am inclined to split shells. This is not always the case tho. I would sew as much as I could on an i-beam, for instance. I'm probably making this way more complicated than it needs to be lol. It most cases, sewing all the edges you can find and making sure your UVs do not overlap is the way to go.

    Double click your asset in the content browser and check to make sure your lightmap resolution is higher than the default. Setting the UV grid in Maya and Max is good (it will ensure the right edge padding) but you always have to make sure it is right in the UDK. Higher values will yield higher resolutions.
  • SanderDL
    Options
    Offline / Send Message
    SanderDL polycounter lvl 7
    The only promblem I still see (forgot to mention it earlier) is that some uv islands are super close to the uv 0.1 space border. To avoid seams, you should also leave some padding there.

    If that doesn't fix it, I'm a bit out of ideas lol.
  • sprunghunt
    Options
    Offline / Send Message
    sprunghunt polycounter
    SanderDL wrote: »
    The only promblem I still see (forgot to mention it earlier) is that some uv islands are super close to the uv 0.1 space border. To avoid seams, you should also leave some padding there.

    If that doesn't fix it, I'm a bit out of ideas lol.

    padding around the edge of the UV space is a waste - UDK automatically adds padding.

    http://udn.epicgames.com/Three/LightMapUnwrapping.html

    uvs_padding.jpg
  • sprunghunt
    Options
    Offline / Send Message
    sprunghunt polycounter
    To the OP - try toggling the post process on and off - the black marks might just be ssAO.

    Otherwise try setting the lightmap to something ridiculous - like 1024 and seeing what shapes happen when you rebuild lighting. It might give you clues that show where the black marks are coming from.
  • SanderDL
    Options
    Offline / Send Message
    SanderDL polycounter lvl 7
    Oh you are right. I forgot about that. I still would recommend to offset it of the edges just a little bit though. This to make sure your uv island are not crossing over the line and still causing light map seams that way.
  • theDEAD
    Options
    Offline / Send Message
    Hey guys!


    I just wanted to give you guys a little update here. I've been hard at work tryin to figure out this whole Lightmap thing, and in the process attempting to get more familiar with UDK in general.

    So I decided to just create a new map, with a dominant directional light, instead of just using the default Mid Day setting I was using before. I previously left all the defaults alone while baking the Lightmaps.

    This time I added more geometry to my mesh, fiddled with the light settings and world settings, and painted up a quick texture to throw on it. It appears to be a better than before, but wanted to get your guys opinion on it.

    Does the Lightmap appear to be working? I still notice some small ugly areas when looking up close, but generally speaking, i'm a lot more happy with these lightmap results than I was previously. There's no spec or normal maps applied, just a simple diffuse at the moment. I also turned off the real-time ambient occlusion world setting just for a little more clarity.

    I really appreciate all the input you guys have provided me thus far. Seriously, thank you.

    And finally... the updated image. :)

    Lightmap_Update_zps74fed802.jpg
  • r4ptur3
    Options
    Offline / Send Message
    r4ptur3 polycounter lvl 10
    from that distance, looks real nice to me :) Nice work!
  • theDEAD
    Options
    Offline / Send Message
    Hey r4ptur3!

    Sorry I didn't get to reply sooner. I appreciate the feedback with the new lightmap! It does look a lot better than before. I think i finally have an understanding on these things. :poly142:

    I do have one last question on it though. Currently, its still using a 128 x 128 map. Is this a reasonable size, or do you think I should be shooting for something lower?
  • r4ptur3
    Options
    Offline / Send Message
    r4ptur3 polycounter lvl 10
    Push it lower until you are unhappy with the results :) 128 x 128 is a little high for a staircase unless there is a nice shadow cut running over the object ... but then again if you are just going to a beauty shot it is probably ok. Nice work!
  • theDEAD
    Options
    Offline / Send Message
    Hey guys,

    I have another newbie question regarding lightmapping. If a really small prop uses an 8 x 8 or 16 x 16 lightmap, how much spacing between shells is needed for those?

    Is the general rule 128 x and above 2 pixels; and anything lower than 128 x would be 4 pixels?

    If i were to give a small prop a 16 x 16, should I give more than 4 pixels spacing between shells?

    Thanks! :D
  • ZacD
    Options
    Online / Send Message
    ZacD ngon master
    if you are working with a 16x16 light map, you probably want to turn on grid snapping, and display a 16x16 grid, try just 2 pixels of padding because much more would take up a majority of the texture.
Sign In or Register to comment.