| Manage Labels 

Asset Performance Guidelines

Table of Contents

Asset Performance Guidelines

Use this document as a general set of performance guidelines for creating assets for use in the CryENGINE. By following the tips included below, artists will better understand how to create assets, with the performance in mind.

Importance of Asset Optimization

Typically, objects that are always on screen go through a lot of iterations and need to have a higher visual quality than the other assets. This also means that these objects need to be as performance friendly as possible. You will need to review all the characters and weapons with this in mind.

In addition, AI and particle effects play an important role. These things tend to turn heavy areas into areas with severe performance problems. Thus, it is important to identify these areas first and make all their related art assets as performance friendly as possible.

Scene Complexity

If you want to hit a specific frame rate, the total amount of vertices and texture space on screen at the same time needs to be consistent for every level. Given the budget that a developer chooses, there needs to be a difference in scene complexity between heavily occluded indoor environments that could use portals, and more unoccluded outdoor environments. The smaller the visibility, the more detail you can put in the level.

Some techniques to make sure you reach the performance goals from the level design side are:

  • Close off rooms with doors.
  • Use transition zones.
  • Use fog effects for unoccluded environments.
  • Use Visblocking/occluders with large objects.
  • Specifically place heavy objects in areas where the visibility spectrum is small.
  • Delete terrain where it is not visible to the player.
  • Smooth terrain to decrease vertex density.
  • Adjust the view distance ratio for objects.
  • Have a maximum of 2000 drawcalls, and for most projects, even less.
  • Use as few textures on the terrain as possible.
  • Avoid overlapping several materials.
  • Don't overlay several, very large transparent or additive layers.
  • Keep in touch with artists regarding LOD distance ratios of assets.

Taking these into account and adjusting some of these numbers, we can arrive at a breakdown even it is quite broad it will give a general idea (Keep in mind that the DPs were deliberately kept below 2000 to allow a bit of breathing room for gameplay action firing effects and additional polishing):

      TRIANGLES   DP
  Terrain   50000   80
  Particles   2000   100
  Roads   30000   120
  Decals   20000   80
  Veg   40000   200
  Brushes   600000   1000
  Entities   300000   320
  FP Character   75000   40
  TOTAL   1042000   1940

CPU Performance

There are ways to improve CPU performance by using fewer draw calls. Do this by using fewer materials, attachments, sprites (instead of LODs), lights (more objects combined on one texture), decals, and shadow casting lights. Also, assume that there is no instancing on consoles, avoid point lights with shadows, and use a smaller light radius.

Some additional guidelines for improving the CPU performance are:

  • Use fewer complicated materials (cheaper setup cost).
  • Use fewer triangles in the cbuffer (saves draw calls, conflicts with less draw calls).
  • Limit the area covered in the cbuffer.
  • Use fewer bones for animated characters.
  • Don't use character motion blur (skinning requires more bones).
  • Use texture streaming sparingly (decompression).
  • Use less alpha blended objects in atmospheric effects (CPU fog approximation).
  • Use fewer triangles in the physics proxy (hit detection).
  • Use breakability sparingly.

GPU Performance

The following recommendations help improve GPU performance, regardless of the screen resolution:

  • Use fewer rendered vertices (a vertex is a unique point with position and texture coordinates).
  • Use a less complex vertex format (mostly a PS3 issue as more complex formats are required for vegetation animation and bone skinning).
  • Use fewer shadow casting lights.
  • Use decals sparingly.

The following recommendations help improve the GPU performance, dependent on the screen resolution.

  • Render objects that cover less pixels on the screen.
  • Use cheaper pixel shaders (less lights, less shader features like reflection, simpler shader); the most simple Illum should be used.
  • Use fewer textures for the scene and for each material.
  • Use cheap texture formats (should be compressed like DXT1, DXT5, 3Dc/DXT5).
  • Use more magnified textures (better for texture cache).
  • Alphablend is slower than alphatest, which in turn is much slower than normal opaque rendering.
  • Deferred lights are cheaper than normal lights; the light radius should be small on the screen.
  • If you need a lot of lights in some local areas (box volume), which can lead to heavy overlapping, accept some approximation in the lighting computation (no shadows, 3D grid might become visible for small lights, no alpha blended materials). Using IrradianceVolumes can be very useful.
  • Have fewer post-processing effects enabled at the same time (example: if radial blurring is enabled, try to not use any more post effects). Another strategy would be to decrease the amount of time a post effect is visible on screen.
  • Use no or little anti-aliasing (MSAA / FSAA).
  • Use fewer atmospheric effects.
  • Use less terrain material blending.

Memory Usage

To improve memory usage, follow these guidelines:

  • Use fewer textures.
  • Use a lower texture resolution.
  • Use more texture compression (DXT1 is best, DXT5 and 3Dc are good).
  • Use fewer vertices.
  • Use a less complex physics proxy.
  • Use fewer animations.
  • Use fewer meshes (fewer LODs).
  • Use fewer materials and particle emitter types.
  • Use fewer roads.
  • Use decals sparingly.
  • Use fewer shadow-casting light sources.

Texture Streaming

To improve texture streaming, follow these guidelines:

  • All streamable textures should be square in size (equal in width and height: 1 x 1, 256 x 256) for better management of the texture pools.
  • Use as few different texture formats as possible for better management of the texture pools.
  • Use as few unique textures per area as possible, to reduce the I/O bandwidth.
  • Stick rigidly to the scheduled texels per square meter (distant streaming is based on it), and use _r_texelspermetter 1_ to check it.
  • Try not to exceed the 512 x 512 texture size (split all the large textures into smaller ones).
  • Try to avoid using textures smaller than 128 x 128 (it causes memory fragmentation). Combine them into a single texture for the same area.
  • If you still have to use large texture atlases (it is not recommended), ensure that you don't share the objects from different parts of the level (like vegetation atlases for different action bubbles).

General Performance Guidelines

This section includes general tips for improving the performance.

  • Less materials can be used by using textures smartly.
  • Attachments can be tweaked to disappear when small on the screen.
  • Eyes can be closed at distance to avoid the need for eyeball rendering.
  • Destructible objects can be slower.
  • Unwrapping of objects should be made with as few vertices (big pieces in UV).
  • Decals should be placed with care.
  • Texture resolution should be consistent (faces should get different ratio).
  • Vis blocker helps to reduce the object count.
  • Portals are more efficient than cbuffer for static scenes.
  • Blocky geometry helps to get more for the same vertex count.
  • Reuse geometry/textures to save memory.
  • Avoid scenes with many unique details (war zone, messy apartment)
  • Material layers that require multi-pass rendering, which is slower than normal rendering, should be used sparingly.
  • Either apply Reset Xform or reset transformations manually (rotation/scaling) prior to export - these values are picked up by the engine and can generate issues such as the physics not matching with render geometry.
  • Pivot should be within the bounding box of the object to avoid unexpected rendering results.
  • Follow all errors that appear in the level error window or console of the editor.

Level design setup / Splitting large meshes

This section deals with the performance-oriented asset and level design setup of very large meshes, such as buildings.

Large objects, like buildings, should be split up in a way that enables them to be rendered efficiently in standard gameplay situations. This means that the lower part of a skyscraper, an area the player interacts with and which usually lies in your viewing angle when looking straight ahead, should be in a different CGF than the upper part of the building, which the player only sees when looking straight up. Big, complex parts of a building that are out of sight in the normal way you play a level, such as a building that can only be seen from one side when approached through a street, should always be detached and not be part of the main mesh.
This also helps effective LODing, since the engine decides the LOD level of an object based on it's distance to the camera and size of its bounding box. Very large meshes are switching LODs much later smaller ones. The effectiveness of occlusion culling is also greatly enhanced by this.
For this reason, it's sometimes beneficial to split off certain parts of a building and adjust the lod ratio. Initially, the game might have to process more drawcalls if you do this, but this is compensated by the more effective culling and LODing that becomes possible with such an approach.

Some practical tips on working in such a way are:

  • Aligning the pivot of the detached part to the main part of the mesh, to ensure that they can be placed in the level with precision, and avoiding gaps between the two parts. Alternatively, the pivots can be different, but aligned into the grid inside 3dsmax, so they can be placed along the grid inside the editor for the same effect. Note that there are certain float rounding errors and imprecision issues in the engine which are hard to avoid, especially if the area in the level is offset far from the level's origin (0,0,0). If there are visible gaps due to this, work around this by splitting the building along a structure that hides the gap, such as a trim going around the facade.
  • Even though it creates some extra unnecessary vertices, the slice modifier in 3dsmax is useful for such setups, as it is non-destructive and allows later changes to where you split the meshes (especially relevant with LODs - slice modifiers can be instanced).
  • Note that each part of the split mesh needs to have it's correct collision meshes assigned. By assigning all collision meshes to one brush only, the player collision will still work if both parts are placed next to each other, but discrete collision geometry is still needed for each brush due to decal placement and refined collisions with grenades and other physical objects.
  • Try to use different submaterials for the separate parts, and using as few different ones as possible per piece, so that the drawcalls don't necessarily double when splitting up an object. If possible, plan far ahead on how large objects are placed in the level and seen by the player, in order to build them as effective as possible.

Drawcalls

Every object with a different material has to be drawn in a separate drawcall. Each drawcall adds some overhead / slowdown to the engine. At any given point of view in the level, there should never be more than 2000 drawcalls (see below)

Several examples for reducing the number of draw calls:

  • Use fewer different materials (in other words, more of the same materials).
  • Where it makes sense, merge some textures together (for example if you have 2 different 512x256 textures used in the same object, it would be better to merge them into a single 512x512 texture).
  • Square textures are more stream friendly.
  • Use as little different materials per object as possible - each material in an object creates at least 2 draw calls, with a shadows being enabled 3 draw calls are needed.

What else adds drawcalls?

The following list details how the number of drawcalls used is calculated:

  • Each material (at least 2 drawcalls)
    • ZPass, Opaque pass (general pass)
  • Sub-materials also lead to drawcalls
  • Lights and shadows
  • Material properties
  • Specific conditions
  • Post processes
  • Hud, text rendering, and the like

Material Properties

The following are the material properties that add to the drawcall count:

  • Glow
  • Detail mapping
  • Detail decals
  • Scattering
  • Decals
    •  Using normal maps adds an extra drawcall on ZPass
  • Terrain
    • Base pass + detail layers = at least 2 drawcalls
    • The more the number of layers, the more the drawcalls (and overdraw)

Specific Conditions

The following are the specific conditions that add to the drawcall count:

  • The real-time reflections used (for example, ocean)
  • The model being below the ocean
  • The entity using the silhouette view
  • Object motion blur being enabled
  • Dynamic Frozen/Wet (Material layers) being used

Number of Vertices

Having less vertices will improve performance and reduce memory consumption. On some hardware like PS3 and older graphics cards, the cost of vertex processing is quite expensive.

  • UV borders increase the vertex count in the engine - use as little UV borders as possible.
  • Vertex normals need to be split where polys with different smoothing groups(hard edges) meet - keep the number of smoothing groups and hard edges low.

Physics Proxy

A good physics proxy is very important for reducing CPU calculation time for physics. Without a physics proxy, performance would be too slow.

  • Use a simple physics proxy instead of the render geometry for physics calculation, in order to reduce CPU calculation time for physics.
  • the render geometry should only be used for physics calculation for 3d breakable objects like tree trunks.
  • If possible use primitives as physics proxies.
  • Make use of the possibility of rough physics proxies for player collisions and render geometry checks for bullet collision checks.
  • Use 1 smoothing group (only soft edges) per physics proxy
  • Set the proper physics type in the material editor of the 3D package

Occlusion Proxy

On big objects that might block the player's view, use occlusion proxies. Use single sided occlusion proxies - polygons will be treated as doublesided. Keep the occluder as simple as possible - use the lowest number of triangles possible.
NOTE - This is only relevant for cryengine 2, occlusion culling works automatically in cryengine 3 (at least on consoles) and doesn't require specific asset setups. Still, refer to the section "splitting up large objects" for advice on making occlusion culling more effective.

Level of Detail Objects (LODs)

Always make LODs for each asset. Each LOD must reduce polygon count at least by 50%. For each LOD, do not only reduce the polygon count, but try reducing the number of materials as well. Good LODs are key to getting good performance (less vertices to process, less materials / drawcalls etc. will improve performance a lot).

Good LODs are key for getting good performance (less vertices to process, less materials / draw calls etc. will improve performance a lot). If you create good LODs, you could get away with better looking assets and better performance.

  • Always create LODs for art assets, even in the testing phase. make use of instancing and poly reduction modifiers in 3ds Max.
  • Each LOD step must reduce the polygon count at least by 50%.
  • Reduce materials in LODs - this saves on draw calls - just add additional material ids in the mtl and use them only in the LODs.

Material Setup

  • Use the fewest number of materials as possible.
  • Combine textures to reduce materials and texture fetches.
  • Keep all textures in CryTIF format.
  • Use 128/128/128 as a default diffuse color (adjustments in either direction can then be made more easily).
  • Use simple grey (128/128/128) or quickly colored textures in final size for early tests - to get an idea about memory consumption.
  • Make sure all textures are checked into Perforce.

Vegetation

In outdoor games, vegetation is usually the most expensive part of the level due to the fact that natural levels are populated with many trees. Each tree should not have more than 1 or 2 drawcalls.

  • Reduce the materials for vegetation objects as much as possible to reduce number of draw calls.
  • Use only the optimized vegetation shader on vegetation objects
  • Spend a lot of time to reduce the number of polygons - these objects are drawn multiple times on screen.
  • Combine textures in one and reduce the number of materials or at least texture fetches.
  • Add polygons on the leaves to match the texture - this reduces overdraw (use the triangles you saved on the trunk)

Particles

Make particle effects as effective as possible, as they create a huge amount of overdraw and thus have a big effect on performance. Also, place standing particle effects as early as possible in order to get a feeling for the performance impact.

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

    << Back To CryDev