UT3: Vertex shadows vs. Lightmap shadows


Fig01.jpg

This tutorial will cover the difference between 'vertex lighting' and 'lightmap lighting'.

By default, UT3 sets every asset (with the exception of BSP geometry built inside UT3) to use vertex lighting. For the most part this works great, but in some cases you may want more control over how your shadows fall onto other objects.

First off, we need to know where to set the resolution of the light map, and which UV channel it will use.

If you double click your geometry inside the package you imported it into, you will see this window. This controls what materials channels get certain materials, UV's of the geometry, collision display and construction and lightmap resolution and which UV channel it uses.

Highlighted in red are the important sections to keep an eye on.

If you are curious what assets inside UT3 are set up to accept lightmaps, most of the time you will have 2 UV channels, especially if the geometry is very complicated. On the upper left corner is the display to show the UV channel, and on the right beside 'Light Map Coordinate Index' is the number showing which UV set the lightmap is baked to. Please note that UT3 counts the first UV channel as 0, so if you created a second UV channel for lightmaps, you need to set this option to 1.

If you click on your geometry in the scene and press F4, the 'properties' menu will pop up.

You can make each individual mesh react with the world in a different way. Dynamic lighting, vertex lighting, light maps, etc.

Under 'StaticMeshActor - StaticMeshComponent' is an option, which by default is checked on titled 'vOverridden Light Map Resolution'

Un-checking this option will activate light map baking, with the resolution talked about earlier.

Top to bottom, left to right.

Fig04.jpg

1. Geometry UV layout

2. Default vertex lighting

3. Lightmap with resolution of 256

4. Lightmap with resolution of 128

5. Lightmap with resolution of 64

6. Lightmap with resolution of 32

Since the lightmap is baked out to a texture, it is ideal to have the standard game resolution texture sizes.

16X16
32X32
64X64
128X128
256X256
512X512

And so on.

Please note, the larger the texture you create for the asset, the larger the lightmap texture, the more memory it uses up and the longer it takes to load the game. Optimization is the key.

 

 

 

 

 

I hope this little tutorial has helped you out. i thank you for your time.