UDN
Search public documentation:
LightmassTools
日本語訳
中国翻译
한국어
Interested in the Unreal Engine?
Visit the Unreal Technology site.
Looking for jobs and company info?
Check out the Epic games site.
Questions about support via UDN?
Contact the UDN Staff
中国翻译
한국어
Interested in the Unreal Engine?
Visit the Unreal Technology site.
Looking for jobs and company info?
Check out the Epic games site.
Questions about support via UDN?
Contact the UDN Staff
UE3 Home > Lighting & Shadows > Lightmass Tools
UE3 Home > Level Designer > Lightmass Tools
UE3 Home > Lighting Artist > Lightmass Tools
UE3 Home > Level Designer > Lightmass Tools
UE3 Home > Lighting Artist > Lightmass Tools
Lightmass Tools
Document Changelog: Created by Daniel Wright.
Overview
Tools
StaticMesh Lighting Info
This dialog allows for the user to make quick comparisons of vertex vs. texture mapping on their static meshes. It also provides a simple way to quickly switch large numbers of meshes between the two. Select 'StaticMesh Lighting Info' from the UnrealEd 'View' > 'Lighting Info' menu to open the dialog.
Buttons
- Close - Closes the dialog.
- Rescan all levels - Rescans all levels in the map for static meshes and inserts into the list.
- Rescan selected levels - Rescans the levels selected in the Level Manager tab for static meshes.
- Rescan current level - Rescans only the current levels for static meshes.
- Go To - Jumps to the selected meshes in the level.
- Sync Browser - Syncs the content browser to the selected meshes source StaticMesh.
- Swap - Swaps the mapping method of the selected entries.
- Swap Ex... - Swaps the mapping method of the selected entries, prompting the user for a resolution to override with for texture mapping.
- Set to Vertex - Sets the selected entries to use Vertex mapping.
- Set to Texture - Sets the selected entries to use Texture mapping.
- Set to Texture Ex... - Sets the selected entries to use Texture mapping, prompting the user for a resolution to override with.
Columns
- Level - the level the static mesh actor is in.
- Actor - the name of the static mesh actor.
- Static Mesh - the source static mesh for the actor.
- Current Type - the current mapping type used for the entry (vertex or texture).
- Has Lightmap UVs - indicates if the mesh has lightmap UVs or not.
- Resolution - the resolution used to calculate the texture light/shadow map memory used.
- Texture LightMap (Bytes) - the amount of memory the mesh would use if it is/were using texture mapped lightmaps.
- Vertex LightMap (Bytes) - the amount of memory the mesh would use if it is/were using vertex mapped lightmaps.
- Num LightMap Lights - the number of lights contributing to the generation of lightmaps on the mesh.
- Texture ShadowMap (Bytes) - the amount of memory the mesh would use if it is/were using texture mapped shadowmaps.
- Vertex ShadowMap (Bytes) - the amount of memory the mesh would use if it is/were using vertex mapped shadowmaps.
- Num ShadowMap Lights - the number of lights contributing to the generation of shadowmaps on the mesh.
Lighting Build Info
The LightingBuildInfo dialog presents information about the last completed lighting build to assist in tracking down 'problem assets'. It displays the following information:Lighting Timings
In the following screen capture of Swarm after a lighting build, you can see that there were some mappings that took longer than others.
StaticMesh example
The following example shows the Lighting Build Info dialog after building lighting on LightmassDayBright.




Lightmapped Surface Collections
When building lighting, the engine will merge different BSP pieces together for generating lightmaps in order to reduce lightmap seams on coplanar surfaces. To reflect this in the Lighting Build Info dialog, a temporary object is created that represents the collection of brushes that contributed to that mapping. This object is a LightmappedSurfaceCollection. Double-clicking (or pressing the 'Go To' button) one of these entries results in the following selection in the editor viewport:

Unmapped Texels and Memory Cost
The Lighting Build Info dialog contains two additional columns that also contain useful memory for tracking down inefficient lightmaps.The 'Unmapped Memory Cost (kB)' column shows the amount of memory wasted by unmapped texels for the object.
The '% Unmapped Texels' column shows the percentage of texels for the object lightmap that are unmapped. As an example, after building lighting on VCTF-Sandstorm, open the 'Lighting Build Info' dialog and click on the 'Unmapped Memory Cost (kB)' column to sort by memory cost values from highest to lowest. The following is results:



Troubleshooting
Lightmap error colors
When Lightmass encounters a content error in Preview or Medium quality builds, it overrides the lightmap's color with an error color. In High or Production quality builds, Lightmass will skip the error coloring and calculate the lighting as if there was no error, which may have unexpected results. Non-unique lightmap UV's - affected texels will be orange. This means more than one triangle overlaps with the texel's center, so the texel can't be lit correctly, because it is setup to be in two places at once. The solution is to either fix the artist created lightmap UV's or generate new UV's in the static mesh editor, and set LightMapCoordinateIndex appropriately. On the left, the orange color that is assigned to texels with non-unique lightmap UV's. In the middle, a different mesh with non-unique UVs showing how all 6 cube faces are overlapping in UV space. On the right, a similar mesh with correct unique UV's, no triangles overlap in UV space.



Generating Unique Lightmap UV's
Below is an example of non-unique lightmap UV's and unique lightmap UV's as shown in the static mesh editor. Non-unique lightmap UV's will not display correct lighting with old UE3 static lighting or Lightmass. This can be easily fixed by generating unique lightmap UV's in the static mesh editor. To do this, select Generate Unique UV's under the the Mesh menu. In the options window that pops up, select a UV channel that is not being used (usually the last number in the dropdown). Hit the OK button to generate the UV's. Now you must set the mesh to use those UV's by setting the LightMapCoordinateIndex to the number for the UV channel that was just generated. The UV's can be viewed using the Show UV Overlay window mode. Also make sure that you set a LightMapResolution for the static mesh. This can be set in the static mesh editor, or on a per object basis in the individual primitive component properties. Non-unique lightmap UVs on the Left, generated unique lightmap UVs on the right. Notice that no two triangles overlap in the right UVs, which means they are unique.Material Expression Caveats in Lightmass Material Generation
Material attributes are exported to Lightmass, but only one version of the material will be exported regardless of what meshes it is applied to. This means mesh-specific material expressions like VertexColor and Transform will not have correct values. View or time dependent expressions like CameraVector, DestColor and GameTime also cannot be captured correctly. These material expressions will compile to constant values due to the fact that they will not generate meaningful/correct values when Lightmass exports the material attributes. Use the bVisualizeMaterialDiffuse WorldInfo option to override lightmaps with just the material diffuse for debugging. Note that lightmaps in the lighting only viewmode are scaled by LightingOnlyBrightness from BaseEngine.ini. Set this to (1,1,1) (requires editor restart) to get exported material diffuse color stored in lightmaps to match up with the real material diffuse. Also make sure all relevant DiffuseBoosts (per-Primitive and per-Level) are set to 1.0. Then you can switch between them in the editor by switching between the Unlit view mode (which only shows Emissive + Diffuse) and Lighting Only. The left screenshot shows the Unlit mode, and the right shows Lighting Only when built with bVisualizeMaterialDiffuse checked.

Expression | Compiles to... |
---|---|
SceneDepth | 0.0f |
DestColor | (0.0f,0.0f,0.0f) |
DestDepth | 0.0f |
DepthBiasedAlpha | SourceAlpha |
SceneTexture | (0.0f,0.0f,0.0f) |
WorldPosition | (0.0f,0.0f,0.0f) |
CameraWorldPosition | (0.0f,0.0f,0.0f) |
CameraVector | (0.0f,0.0f,1.0f) |
LightVector | (1.0f,0.0f,0.0f) |
ReflectionVector | (0.0f,0.0f,-1.0f) |
Transform | The input vector untouched |
TransformPosition | The input vector untouched |
VertexColor | (1.0f,1.0f,1.0f,1.0f) |
VertexColor w/ bUsedWithSpeedTree | (1.0f,1.0f,1.0f,0.0f) |
RealTime | 0.0f |
GameTime | 0.0f |
FlipBookOffset | (0.0f, 0.0f) |
LensFlareIntesity | 1.0f |
LensFlareOcclusion | 1.0f |
LensFlareRadialDistance | 0.0f |
LensFlareRayDistance | 0.0f |
LensFlareSourceDistance | 0.0f |