Home Technical Talk

Lightmaps in Unreal

PaK
polycounter lvl 18
Offline / Send Message
PaK polycounter lvl 18
alright guys...I come again for your wizzzzdom.

I heard a rumor that lightmaps just 'happen' in unreal without much input from the artist. In my opinion 'said' lightmaps look pretty darn good in Unreal. So i have a few questions for those of you who use this tech.
  • What, if any, parameters does a contebnt creator have control over?
  • How are objects created in max or Maya and then brought into Unreal (like a chair, or something) lightmapped? Automagically? Any user definable parameters that are spacific to these objects?
  • Is there a way to figure out the memory footprint of these lightmap textures?
Thx in advance :)

-R

Replies

  • Vailias
    Offline / Send Message
    Vailias polycounter lvl 18
    I remember hearing that the light mapping/real time shadowing were calculated onto a secondary uv set, which should represent the whole of the object without mirroring.
    The shadow map textures are kept pretty small for memory concerns, but I don't know the specifics of their sizings.
  • gamedev
    Offline / Send Message
    gamedev polycounter lvl 12
    Light maps require a second unique UV set with your model. This can be done in your 3d app of choice by simply ensuring that no UV's are overlapping (flatten mapping in 3ds Max for example). Its important there are no overlapping chunks and that they are spaced adequately.

    A second choice wold be to generate your light map UV's in Unreal. This can be done in the static mesh viewer by going to 'Mesh > Generate Unique UV's...". Note that Unreal labels your UV channels starting with 0. So if you import a mesh with 1 UV channel (say for your diffuse texture) then you'll want to generate unique UV's for UV channel 1 ("UV Channel to save results to =1).

    Once your light map is complete, in the static mesh browser on the right hand side property window, set the lightmap uv channel to 1 and then set an apporpriate resolution. You'll find smaller objects don't need much (32-64) but floors and walls with dense shadow detail will require larger light map resolutions.

    Both methods have pros and cons. Creating your own light map in a 3d app gives you more control and allows you to give more shadow detail to certain faces (by scaling your UV chunk larger). Generating your light map UV's in Unreal however is fast and it does a decent job - even stitching together larger faces to prevent some shadow seams.

    Once you've got your mesh placed in the level and have a light map on it you'll need to check a flag off. On the static mesh's properties (press F4), under 'StaticMeshActor > StaticMeshComponent > bOverrideLightmapResolution. Unchecking this flag tells Unreal to use the lightmap resolution you've set on the object in the static mesh browser.

    In terms of cost - there is a break even point for a small light map and the cost of storing vertex light information in the model. Just use larger light maps wisely and you'll be fine.

    Hope that helps!
  • vahl
    Offline / Send Message
    vahl polycounter lvl 18
  • PaK
    Offline / Send Message
    PaK polycounter lvl 18
    You guys have been tremendously helpful. Special thanks to you Tyler for your exhaustive explanation.
  • gamedev
    Offline / Send Message
    gamedev polycounter lvl 12
Sign In or Register to comment.