Tuesday, October 15, 2013

The Dreaded Dark Landscape Issue

The Dreaded Dark Landscape Issue

October 15th, 2013

A few weeks ago I discovered that if I use the UDK foliage mode to add meshes to my landscape they turn black when I build lighting. This was when I discovered something called "UV Lightmaps". Not knowing about lightmaps until now was a huge mistake.

A UV Lightmap is a separate UV layer that tells UDK how to calculate lighting for a mesh. What you do is take each surface that shares lighting and separate it in the UV mapping from the other surfaces.

Currently none of my meshes have UV lightmaps. Unfortunately this includes models from Forester.

In this blog entry I will cover what is necessary to create a UV lightmap for a landscape element. I believe Forester is working to resolve the issue but in the meantime I am going to do it by hand for a few of the trees/grass I have.

1. Create your tree/grass in forester and import it into UDK applying the material to the mesh

2. We need to switch over to DirectX9 to create the lightmap otherwise it will error out:

3. Open the tree/grass mesh

4.  Select Mesh : "Generate Unique UVs..." from the menu

5. In the lower right corner you will have a dialog to generate the UV. Make sure you check "Pack UVs only". Click "Apply"

6. If you show the UV channels and go the second one you will have the new lightmap UV.

That's it. Now just do this for each tree/grass from Forester and you are good to go.

When you are all done switch back over to DirectX 11. Otherwise the foliage you add to your landscape will "flicker" or appear/disappear.

No comments:

Post a Comment