UDN
Search public documentation:

ViewModes
日本語訳
中国翻译
한국어

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 > Unreal Editor and Tools > Unreal Editor User Guide > View Modes

View Modes


Overview


View modes are mutually exclusive rendering styles. A viewport can only have a single active view mode. In the editor, the view mode is selected using the associated buttons in the viewport's toolbar. In the game, the view mode can be changed using the viewmode console command.

viewshowflags.jpg

Supported Platforms


Unlit and Shader Complexity are not supported on consoles, the rest of the viewmodes work on all platforms.

Note: By default, viewmodes other than the default lit are disabled on consoles to save memory!* To use them, set bAllowDebugViewmodesOnConsoles=True in BaseEngine.ini and add EngineDebugMaterials to the StartupPackages list for the relevant platform.

Modes


Wireframe

This mode shows the wireframe of all meshes.

Command: viewmode wireframe

wireframe.jpg

Brush Wireframe

This mode shows the wireframe of actors and CSG brushes. The BSP wireframe is hidden. This mode only works in the editor.

brushwireframe.jpg

Unlit

This mode shows the diffuse channel of the material used by each mesh.

Command: viewmode unlit

unlit.jpg

Lit

This mode displays the material used by each mesh affected by lighting. It is the default mode in the game.

Command: viewmode lit

lit.jpg

Detail Lighting

This mode displays meshes with a neutral material affected by lighting with normals.

Command: viewmode detaillighting

detaillighting.jpg

Lighting Only

This mode displays meshes with a neutral material affected by lighting.

Command: viewmode lightingonly

lightingonly.jpg

Light Complexity

This mode displays meshes with a solid color based on the number of lights affecting the mesh.

Command: viewmode lightcomplexity

The mesh coloration in viewmode lightcomplexity indicates the number of lights affecting a mesh that are not skylights or lightmaps, according to the following scheme (defined in YourGameEngine.ini):

#Lights: Mesh Color
0: (R=0,G=0,B=0,A=1)
1: (R=0,G=255,B=0,A=1)
2: (R=63,G=191,B=0,A=1)
3: (R=127,G=127,B=0,A=1)
4: (R=191,G=63,B=0,A=1)
5: (R=255,G=0,B=0,A=1)

Note that light complexity is something that is important to view in game, as most dynamic lights are spawned during game play (e.g. muzzle flashes, explosions, etc).

lightingcomplexity.jpg

Texture Density

This viewmode is used for two things:

  • To check that you're spending the high-res textures on surfaces that matters the most (e.g. close to the camera and not high up on roof tops).
  • To check if you have a high-res texture placed next to a low-res texture (sharp contrast in texture resolution), which can look bad.

The viewmode displays meshes with a color that represents the texture density, or the number of texels per world space unit. High density will be red, medium density green and low density blue. This can help you reduce sharp contrast between high-resolution polygons and low-resolution polygons, and also help you make sure you are spending the texture resolution where it matters the most.

The threshold parameters for low, medium and high density are defined in BaseEngine.ini and you can override these three values for each game.

The parameters are MinTextureDensity (default 0.0), IdealTextureDensity (default 13.0) and MaxTextureDensity (default 55.0).

Command: viewmode texturedensity

texturedensity.jpg

Shader Complexity

The Shader Complexity viewmode lets you visualize how many pixel shader instructions were executed on each pixel. The total complexity is calculated as the number of instructions used to render emissive plus instructions for each lighting pass, translucency, distortion and fog volumes. Note that height fog, post process and a few other effects are not counted. The cumulative instruction count is then mapped to bright green for the cheapest pixels to dark green, then dark red, then bright red for an instruction count of 300. The September 09 (not yet released) QA build will have an extended range where pink means an instruction count of 600, and white translates to 900 shader instructions. Masked materials will also be represented more accurately as of that QA build.

Only instruction count is used to calculate shader complexity, which may not always be accurate. For example, a shader with 16 instructions, all texture lookups, will be much slower on all platforms than a shader with 16 math instructions. Also shaders which contain loops that are not unrolled will not be represented accurately by the instruction count, this is mainly an issue for vertex shaders. Overall the instruction count is a good metric in the vast majority of cases.

A couple of things to notice when using shader complexity:

  • Be sure to look at shader complexity for your level both in the editor and in game (or PIE). This lets you narrow down whether the level is too expensive or gameplay elements, such as dynamically spawned effect lights, are the cause of poor performance.
  • Anything with static lighting should be green, because only the emissive and lightmap terms are used for rendering these objects, so they are very cheap. If static objects are unexpectedly red, make sure you have your lighting built.
  • Terrain will often be red, even with lighting built, because the combined terrain material is so expensive. It is important that you make each layer's material as simple as possible, since terrain often covers a lot of pixels.
  • Particle systems will usually be red (or worse) because of the massive amount of overdraw.

This viewmode is currently only available on PC running on shader model 3 cards, and is incompatible with simple lightmaps.

Command: viewmode shadercomplexity

shadercomplexity.jpg

Lightmap Density

This mode displays the lightmap density of objects that are texture mapped, color coding them by their relation to an ideal/max density setting and displaying a grid that maps to the actual lightmap texels.

When in color-mode:

  • BLUE represents less than ideal texel density
  • GREEN represents ideal texel density
  • RED represents max or greate texel density

A grayscale mode is also available where BLACK represents the minimum density (or less) and WHITE represents the maximum (or greater) density.

Min, Ideal, and Max density settings are set in the *Engine.ini file under the [Engine.Engine] section, and currently default to:

  • MinLightMapDensity=0.0
  • IdealLightMapDensity=1.0
  • MaxLightMapDensity=3.0

When viewing this mode, a dialog is available to adjust the Ideal and Max settings, as well as settings to scale the resulting Color/Grayscale results. Grayscale mode is also enabled/disabled via this dialog. The 'Density Rendering Options' dialog will open when this view mode is selected. It can also be opened via the 'View->Lighting Info->Lightmap Density Rendering Options' choice in the main editor menu.

Command: viewmode lightmapdensity

LMDensityView.jpg

Lit Lightmap Density

This mode is the same as 'Lighting Only', but texture mapped objects will also display a grid that maps to the lightmap texels.

Command: viewmode litlightmapdensity

LitLMDensityView.jpg

Editor-only modes


Property Coloration

This mode permits the visualization of actors with specific property value. Mark a property by shift-clicking on the property in the property window. Then, enable the Property Coloration show flag in an editor viewport, and all objects of that type with the same property value will be highlighted in red. Objects with the same property value can also be selected via the right-click menu.

Currently, the property comparison is exact. A light with brightness 1.0, for example, will not be considered to have the same value as a light with brightness 1.001.

Occlusion Preview

This mode enables the visualization of engine frustum culling and occlusion. Activate it by selecting View Culling/Occlusion in the Viewport Options dropdown menu in the viewport toolbar of a perspective level viewport.

original.jpg

With the Occlusion Preview mode enabled, the other viewports are considered occlusion children and will render only what is being rendered in the occlusion parent view.

This viewmode is useful to de-clutter wireframe views, as well as for previewing occlusion (ie: determining what exactly is being drawn by the engine for a particular view).

Below is a before/after image of one of the ortho viewports, where occlusion viewmode is disabled on the left and enabled on the right. The pink view frame shows where in the world the viewpoint of the occlusion parent is.

ortho.jpg

Below is another before/after image, this time of a child viewport that was set to a perspective view and moved to a different location.

perspective.jpg

Show flags


For a list of the various Show Flags in the editor, see the Show Flags page.