|
Unreal Tournament III Tips
This information is provided by DGUnreal. Please do not copy this and post it
elsewhere.
Terrain
I have a number of Terrain tutorials in the UDN3 Licensee area for Licensees with access.
The general public can use the links on the main UT-III Tips page.
Triangle Count
Large outdoor style maps with large terrain should be careful to balance the number of
rendered triangles with the visual design. If you are pushing more than 50k to 100k
triangles (see "stat engine"), you may have to re-examine the terrain density
(Display.DrawScale3D.X/.Y) and number of patches (Terrain.NumPatchesX/Y).
Common Display.DrawScale3D.X/.Y values for large outdoor maps are 128, 160, 192, 224, 256,
320, 384 and 512. For small terrain areas on CTF or DM maps, it is possible to use
Display.DrawScale3D.X/.Y values as low as 64. Rarely will there ever be a need to
use values smaller than 64.
Note that the terrain system has rendering preparation overhead, so doubling the number of
rendered triangles does not mean the framerate will drop in half.
Morph Options
Preferably design terrains so that you do not have to use the Morph options.
Terrain.bMorphingEnabled and bMorphingGradientsEnabled have a rendering penalty plus
they cause visual terrain popping at the location where the LOD tesselation occurs.
A properly designed terrain does not need the Morph options on. If you are not using
Tesselation (Terrain.MinTesselationLevel and MaxTesselationLevel = 1), make sure the Morph
options are off, and simply ignore the Morph Build warnings.
Materials
The Terrain texture layer system combines all current Materials into one large
uber-material. This means that Terrain has a limit on the number of discrete layers and
Material complexity. All combined Terrain Materials support only 16 TextureSamplers.
There is always 3 Samplers reserved for the lightmaps, and one or more Samplers used
as bit-plane sources for the Layer Alphamaps (packed as one layer per ARGB plane in a
32-bit texture). This means that all combined Materials used in the layers are
usually limited to 10 to 12 TextureSample material expressions. So if you are seeing
the "rainbow" error texture displayed on the Terrain, go back and count the
number of TextureSamples in all of the Materials used on all of the Terrain layers and try
to reduce something.
Material Specular
The Terrain in the current UT3 build does not support Specular for performance reasons.
So it is a waste of resources to add specular TextureSamples in any of the Terrain
materials.
Fallback Materials
Use Fallback Materials so that if the engine cannot compile the uber-material on a
specific hardware setup, such as older Shader Model 2 video cards, it will fall back to a
lower shader setup.
Lightmap Settings
Using the Lighting.bIsOverridingLightResolution and setting a large
StaticLightingResolution value will cause very long map build times and create very large
Lightmap textures.
The Terrain Lightmap texture is based on the Terrain Components. A Terrain Component
is a small block of the Terrain which defaults to a 16x16 Patch area, as defined by the
Terrain.MaxComponentSize property. So on more dense Terrains such as
Display.DrawScale3D.X/.Y values of 64, each Component covers less map area and therefore
the Lightmap pixel/texel size is smaller which results in higher quality and is more
defined and sharper. FYI: don't mess with the Terrain.MaxComponentSize property.
For higher density Terrains (smaller patch squares) where the Display.DrawScale3D.X/.Y is
around 64 (ie. anything less than 128), there is usually no need to override the default
Lightmap settings for the reasons just mentioned above.
For lower density Terrains (larger patch squares) where the Display.DrawScale3D.X/.Y is
128 or higher, Lightmap overrides of 2, 4 or 8 may be used.
For large Terrains such as NumPatches of 256 or more, using Lightmap overrides will create
a large Lightmap texture set and increase build times, so the override value must be
chosen with care.
It is not recommended to set the StaticLightingResolution higher than a value of 4 or 8.
Values higher than this, such as 16, 32, or more, can cause very long Build times
of 10 to 30 minutes or more. This also increases the Lightmap texture use to very
high memory requirements and results in a large map file size.
The current amount of Terrain lightmap memory can be seen by looking at the Generic
Browser's Primitive Stats tab, locate the Terrain entry and check the Lightmap (kbytes)
column. If this value is a large number, then the Lightmap StaticLightingResolution
override should be reduced.
As an example, a Terrain with NumPatches of 255x255 and a Lightmap
StaticLightingResolution override of 4 will have a Lightmap size of 2861 kbytes (2.8MB).
This is the largest that would be recommended for this size of terrain. A
simple doubling of the Lightmap StaticLightingResolution override value to 8 causes a
large Lightmap size of 10MB. Doubling this value again to 16 causes a massive
Lightmap size of 42MB.
|
|