UT3: Specular highlights and geometry normals issue (fix)


This tutorial will cover how to get around the issue when the normals of geometry seems to change on the surface of rotated geometry. This happens with imported mesh as well as BSP. If you rotate the BSP geometry, you will get the same result.

Assets placed into the level for the most part seem to work just fine, but there is an issue in UT3 where flat geometry such as roads, side walks, ground planes; When rotated, these assets cause weird seams when dealing with the spec and light color as shown above. The image on the left consists of 3 flat planes with all the coordinates set to UV channel 1. The image on the right consists of only one piece of geometry with the uv's set to channel 2, and channel 1 has the uv's set out flat for light mapping.

Firs lets look at the model I created. A simple plane used to create a road.

In the image above, the blue and green planes were rotated to connect with the red one. This could be used for a road or city street, but these assets are separate objects and cause weird specular highlights as you see in the image on the bottom right. The original model only has one UV layout on channel 1. This is one method on fixing this issue.

This model is laid out the same as the original in UT3, but each street is merged creating one singular piece. The UV channel 1 will be used for the lightmap, and channel 2 is used for the texture placement.

With these changes, any texture which uses a constant for the color or spec will be using the UV channel 1 automatically. As long as there are no seams or rotations in this UV, the spec should show up correctly. If you are using a texture to drive the diffuse, spec or normal map, you can use either UV1 or UV2, however if this were a street, UV channel 2 would be better, making sure that each street has the same base details they need. Also, if you have a detail texture, you can use the UV1, allowing for more variation over a greater distance compared to using UV2 which would create every straight stretch to appear the exact same.

With these changes, this is the result you get.

 

As you can see, the seams are no longer there. The lower right image is just a black diffuse and white spec, this uses UV1, but since there are no seams in the UV, it works correctly. The upper right image is fully textured spec and diffuse using UV2.

When you model terrain, try to hide seams as best you can. Rotating the texture for the most pert works just fine, but be careful when rotating the mesh. If done incorrectly, you will get strange results.

 


 

 

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