setstats
View Cart

UDK: Lightmap Common Problems and Solutions

Category: UDK
June 07, 2012

Very common errors you may encounter during lightmap process are light/shadow bleeds and seams. Knowing what causes them and how to fix these issues will make your models light and shadow better.

In the following tutorial I'll answer the following questions:

  • "My custom models seem to be vertex lit and not lightmapped?"
  • "How do I create a second UV channel to be used for a lightmap?"
  • "My models have light bleeding, everything is patchy with light and dark and it doesn't receive correct lights and shadows?"
  • "I can't seem to get rid of lighting seams in my static meshes, especially in my modular static meshes."
  • "StaticMesh has invalid LightMapCoordinateIndex"
  • "My cast shadows don't match across two objects/models"
  • "Error: Object Has Wrapping UVs"
  • "How do I get sharp and accurate shadows on BSP geometry?"

UDK Lightmapping Series:

UDK: Lightmap Basics and 18 Important Principles for Creating and Using Lightmaps
UDK: Lightmap UV Layout Techniques and How to Create a Second UV Channel in Maya
UDK: How to Fix Lightmap Light/Shadow Bleeding and Seams
UDK: Lightmap Resolution for Static Meshes and BSP
UDK: Lightmap Common Problems and Solutions

"My custom models seem to be vertex lit and not lightmapped?"

By default imported models are lightmapped in UDK. What your model may be lacking is a second UV channel. You need to create a second channel that will is used for lightmaps. These UVs must be unique laid out, specifically for the use of the lightmap.

Check to see how many UV Channels you have in Static Mesh Editor.

You need to have 2.

If it says 1, create a second UV channel in a 3d application or Generate Unique UVs in UDK. It is better to manually unwrap it in a 3d application for best results.

If it says 2 in UV Channels, that means you have to fix your UVs. They are either overlapping or there isn't enough padding between shells.

  • See this tutorial on how to create a second UV channel for a lightmap.

"How do I create a second UV channel to be used for a lightmap?"

You can Generate Unique UVs in UDK. This will give you a second UV channel for your lightmap. But this doesn't produce the best results.

In Maya:

Make sure you are under Polygons:

Go to Create UVs and choose either to Create New UV Set or Copy Current UV Set:

To check that you have 2 UV channels, open up UV Texture Editor window and under UV Sets you will see 2 UV channels. First one will be for your texturing UVs. Second one will be for lightmap UVs.

"My models have light bleeding, everything is patchy with light and dark and it doesn't receive correct lights and shadows?"

Very common errors to bad model shading is inconsistent lighting and shadows as well as very noticeable bleeding of dark and light.

Your UVs are not laid out properly. They either lack any padding between each UV chart/shell or you have overlapping UVs.

Unwrap and fix overlapping UVs. Lightmaps cannot have any overlapping UVs.

Allow 4px padding for low-resolution lightmaps (8 or 16). 2px padding for 32 and up.

  • For a complete tutorial on how to fix bleeds and seams, go here.

"I can't seem to get rid of lighting seams in my static meshes, especially in my modular static meshes."

This is caused by certain outer shell UV edges fall in-between pixel space in the layout. Causing the light/shadow to bleed. Make sure that the problem edges fall onto the grid line of UV layout. Lightmass cannot calculate in-between pixel space of your lightmap.

Sometimes increasing the lightmap resolution will fix this issue, but you don't want to add additional texture memory space. Fix it in your 3d application by aligning affected edges onto the UV grid space.

  • For a complete tutorial on how to fix modular bleeds and seams go here.

"StaticMesh has invalid LightMapCoordinateIndex"

This simply means that your Static Mesh does not have a second UV channel for lightmap.

Solution is to create a second lightmap channel that is uniquely unwrapped with padding between each shell and no overlapping UVs. Then re-import.

Quick fix is to Generate Unique UVs in UDK, but this technique will never give you quality lightmaps. You should manually unwrap them in the second UV channel.

"My cast shadows don't match across two objects/models"

This is caused by different lightmap texel density between two objects.

Different lightmap resolution causing the quality of your shadows and distortion. Match the lightmap resolution for both or all objects where the shadows are being cast onto.

"Error: Object Has Wrapping UVs"

This means that your lightmap UV layout currently has UVs that are outside of 0 to 1 space. Make sure that you layout your UVs and export with your UVs within 0,1 space.

"How do I get sharp and accurate shadows on BSP geometry?"

BSP geometry has its own seperate lightmap property. It is controlled through surface properties of the brush.

Double click on the BSP surface to open Surface Properties. You can also select BSP surface and press F4.

BSP lightmap resolution requires lower value to look better, and higher value will look worse. Which is opposite of static mesh lightmap resolution.

UDK Lightmapping Series:

UDK: Lightmap Basics and 18 Important Principles for Creating and Using Lightmaps
UDK: Lightmap UV Layout Techniques and How to Create a Second UV Channel in Maya
UDK: How to Fix Lightmap Light/Shadow Bleeding and Seams
UDK: Lightmap Resolution for Static Meshes and BSP
UDK: Lightmap Common Problems and Solutions

UDK© Bundle: UDK The Foundation & UDK Guide to Landscape Creation

© 2008-2017. All articles on World of Level Design™ are copyrighted.
Not to be reproduced without prior written consent.