UDK: Lightmap Resolution for Static Meshes and BSP

来源:互联网 发布:中国科协网络平台 编辑:程序博客网 时间:2024/06/06 00:04
FULL TEXT TUTORIAL AND NOTES:

Lightmap resolution for static meshes and bsp defines the quality and how sharp or blurry your cast shadows are across objects. Optimizing for lightmap resolution will help you keep the texture memory down and make your shadows look good on your meshes. There are two different lightmap resolutions you may need to deal with. One is with static meshes (custom models), two is bsp lightmap resolution.

The following tutorial we will cover the following:

  • How to define lightmap resolution on your static meshes and bsp
  • Lightmap resolution comparison
  • How to define lightmap resolution across all static meshes globally
  • How to define lightmap resolution per static mesh
  • BSP 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

LIGHTMAP RESOLUTION

Lightmap resolution should be set in powers of 2s, just as for texture resolution. Meaning: 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024px etc.

Lightmap resolutions should be kept at a smaller pixel size then texture resolutions.

Keep lightmap resolution values down in the range of 8-128. Higher resolution will look better but will use more texture memory. Setting a point of reference for your map such as the default 32 is a good start. You can always reduce these values when you are optimizing your meshes.

 

"Ideally, most of the lightmap resolution should be allocated around the high visual impact areas and in places where there are high frequency shadows."

Source (Epic's UDN Lightmass #Lightmap resolution)

LIGHTMAP RESOLUTION IN STATIC MESH EDITOR

Open up Content Browser and double click on a static mesh. Static Mesh Editor will pop up. You can set Light Map Resolution for all of instances of this particular mesh across the environment.

OVERRIDE LIGHTMAP RESOLUTION PER STATIC MESH

You can override lightmap resolution per mesh. This helps to increase detail shadows for meshes up close to the player or optimize lightmap resolution for far away meshes.

To override lightmap resolution, double click on the static mesh in the map and checkOverride Light Map Res. Then set a value that you want in Overridden Light Map Res.

LIGHTMAP RESOLUTION COMPARISON

Here are various screenshot lightmap resolution comparison:

With material applied:

HOW TO GET CONSISTENT SHADOWS ACROSS MULTIPLE OBJECTS

Many objects will cast shadows across multiple meshes. If those meshes where shadows are being cast on do not match in lightmap resolution you will see inconsistent shadows.

Inconsistent shadows from different lightmap resolution:

Here I turned on texel density to show different lightmap resolution across multiple meshes and results it creates.

LIGHTMAP TEXEL DENSITY

Use viewport option to check lightmap texel density. Click on Lighting Only with Texel Density or LightMap Density viewport view to check consistency of your environment lighting and shadow.

If you have an object casting shadow on multiple other objects, difference in lightmap density will cause shadow distortion between these objects. Viewing Lightmap Texel Density will help you to solve this issue. To do this by changing the resolution of the lightmaps to match across two objects.

Variety of lightmap texel density across multiple planes:

To avoid this issue, match all static mesh lightmap resolution to the same value.

BSP RESOLUTION

Just like static meshes, BSP has lightmap resolution inputs as well. You may need to tweak bsp lightmap resolution to make sure shadow consistency matches across meshes and bsp.

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

You want to change Lightmap Resolution input. There is a slight difference between BSP lightmap resolution and static mesh lightmap resolution values.

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

Result in-game with BSP Lightmap Resolution set at 4:

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

0 0
原创粉丝点击