Difference between revisions of "HPL3/SOMA/Level Design/Outdoor Level Performance"
(Created page with "= Level Design - Outdoor Level Performance = === Introduction === This tutorial will show some steps on how to optimize an outdoor level to get better performance. === T...") |
m (formating) |
||
Line 11: | Line 11: | ||
− | Measuring performance can be hard. The main target is 60 FPS on a high end computer running at 1080p and 30 FPS on a low end computer running at 720p with low quality settings. | + | Measuring performance can be hard. The main target is 60 FPS on a high end computer running at 1080p and 30 FPS on a low end computer running at 720p with low quality settings. There are other things that are much easier to measure. |
− | + | <u>Here is a list of goals for different parameters (in 1080p):</u> | |
− | + | *''' Total Memory Usage: ~700 mb (max 1024 mb) | |
− | + | *''' Vertex Memory Usage: ~128 mb (max 256 mb) | |
− | + | *''' Draw Calls: ~300 (max 400) | |
− | ''' Total Memory Usage: ~700 mb (max 1024 mb) | + | *''' Rendered Triangles: 1.0-1.5 million (max 2 million) |
− | ''' Vertex Memory Usage: ~128 mb (max 256 mb) | + | *''' Queries: ~30 (max 60) |
− | ''' Draw Calls: ~300 (max 400) | ||
− | ''' Rendered Triangles: 1.0-1.5 million (max 2 million) | ||
− | ''' Queries: ~30 (max 60) | ||
Line 30: | Line 27: | ||
− | Rendering terrain is much faster than rendering multiple meshes. To get good performance it is important to use the terrain to make up most of the silhouette of the level and just use meshes for important landmarks and details. | + | Rendering terrain is much faster than rendering multiple meshes. To get good performance it is important to use the terrain to make up most of the silhouette of the level and just use meshes for important landmarks and details. To be able to use terrain for all of the silhouette it is possible to set a Cliff Texture. With Cliff Textures it is possible to use terrain as walls instead of having to use meshes. The cliff texture is automatically projected to the steep cliffs of the terrain. |
− | + | [[File:cliff_walls.png|1200px]] | |
− | |||
− | |||
− | [[File:cliff_walls.png]] | ||
<u>Terrain optimization checklist:</u> | <u>Terrain optimization checklist:</u> | ||
− | + | *''' Unit Size should be 1 or higher | |
− | + | *''' Geometry Patch Size should be the same size as Texture Patch Size | |
− | ''' Unit Size should be 1 or higher | + | *''' Undergrowth Fade End should be 40 or lower |
− | ''' Geometry Patch Size should be the same size as Texture Patch Size | + | *''' Don't use too many different undergrowth materials (1x draw calls per material type) |
− | ''' Undergrowth Fade End should be 40 or lower | + | *''' Use Cliff Texture for walls |
− | ''' Don't use too many different undergrowth materials (1x draw calls per material type) | ||
− | ''' Use Cliff Texture for walls | ||
Line 53: | Line 45: | ||
Fog is great for adding atmosphere and scale to a level. But it can also be used to increase performance of the level. | Fog is great for adding atmosphere and scale to a level. But it can also be used to increase performance of the level. | ||
− | |||
− | |||
Performance can be increased in two ways by using fog. The first is by using a fog color with alpha set to 255. Setting alpha to the max value means that objects further away than the Fog End will get fully fogged and get the color set to the fog color. Since the object gets fully fogged we can now render it without texturing which greatly increases speed. | Performance can be increased in two ways by using fog. The first is by using a fog color with alpha set to 255. Setting alpha to the max value means that objects further away than the Fog End will get fully fogged and get the color set to the fog color. Since the object gets fully fogged we can now render it without texturing which greatly increases speed. | ||
− | |||
− | |||
When the alpha is set to 255 it is also possible to activate Fog Culling in the settings. This will cause any object further away than Fog End to get culled and not rendered at all. This setting should only be used when there is no need for silhouettes. | When the alpha is set to 255 it is also possible to activate Fog Culling in the settings. This will cause any object further away than Fog End to get culled and not rendered at all. This setting should only be used when there is no need for silhouettes. | ||
Line 65: | Line 53: | ||
[[:hpl3:engine:rendering|Distance culling]] is a technique for removing objects that are far away from the player. It works by calculating how big an object will be on the screen and then removes it if it is smaller than the selected value. It is also possible to set a minimum range, any object closer than this will never get culled. | [[:hpl3:engine:rendering|Distance culling]] is a technique for removing objects that are far away from the player. It works by calculating how big an object will be on the screen and then removes it if it is smaller than the selected value. It is also possible to set a minimum range, any object closer than this will never get culled. | ||
− | |||
− | |||
Distance culling works on all types of objects. Objects that get culled will fade in/out and not pop directly. A good value for the Screen Size parameter is 5-10%. | Distance culling works on all types of objects. Objects that get culled will fade in/out and not pop directly. A good value for the Screen Size parameter is 5-10%. | ||
− | [[File:screen_screenshot_005.jpg]] | + | [[File:screen_screenshot_005.jpg|1200px]] |
Line 86: | Line 72: | ||
Directional light with sky and ground color should make up the base of the outdoor lighting. | Directional light with sky and ground color should make up the base of the outdoor lighting. | ||
− | |||
− | |||
Most outdoor levels also require the use of directional light shadows. This is a very expensive operation. To lower the impact of shadow rendering you will have to uncheck the "Cast shadows" checkbox for some types of objects. | Most outdoor levels also require the use of directional light shadows. This is a very expensive operation. To lower the impact of shadow rendering you will have to uncheck the "Cast shadows" checkbox for some types of objects. | ||
− | + | <u>Here is a list of object that should not cast shadows:</u> | |
− | Here is a list of object that should not cast shadows: | + | *''' Small objects |
− | + | *''' Objects that are almost hidden in undergrowth | |
− | + | *''' Objects that are only used as a silhouette | |
− | ''' Small objects | + | *''' Objects that will always be far away |
− | ''' Objects that are almost hidden in undergrowth | + | *''' Big objects that the player can never reach |
− | ''' Objects that are only used as a silhouette | ||
− | ''' Objects that will always be far away | ||
− | ''' Big objects that the player can never reach | ||
Latest revision as of 14:38, 21 February 2024
Contents
Level Design - Outdoor Level Performance
Introduction
This tutorial will show some steps on how to optimize an outdoor level to get better performance.
Target
Measuring performance can be hard. The main target is 60 FPS on a high end computer running at 1080p and 30 FPS on a low end computer running at 720p with low quality settings. There are other things that are much easier to measure.
Here is a list of goals for different parameters (in 1080p):
- Total Memory Usage: ~700 mb (max 1024 mb)
- Vertex Memory Usage: ~128 mb (max 256 mb)
- Draw Calls: ~300 (max 400)
- Rendered Triangles: 1.0-1.5 million (max 2 million)
- Queries: ~30 (max 60)
Terrain
The terrain is the main part of an outdoor level. It should make out most of the geometry of the level.
Rendering terrain is much faster than rendering multiple meshes. To get good performance it is important to use the terrain to make up most of the silhouette of the level and just use meshes for important landmarks and details. To be able to use terrain for all of the silhouette it is possible to set a Cliff Texture. With Cliff Textures it is possible to use terrain as walls instead of having to use meshes. The cliff texture is automatically projected to the steep cliffs of the terrain.
Terrain optimization checklist:
- Unit Size should be 1 or higher
- Geometry Patch Size should be the same size as Texture Patch Size
- Undergrowth Fade End should be 40 or lower
- Don't use too many different undergrowth materials (1x draw calls per material type)
- Use Cliff Texture for walls
Fog
Fog is great for adding atmosphere and scale to a level. But it can also be used to increase performance of the level. Performance can be increased in two ways by using fog. The first is by using a fog color with alpha set to 255. Setting alpha to the max value means that objects further away than the Fog End will get fully fogged and get the color set to the fog color. Since the object gets fully fogged we can now render it without texturing which greatly increases speed. When the alpha is set to 255 it is also possible to activate Fog Culling in the settings. This will cause any object further away than Fog End to get culled and not rendered at all. This setting should only be used when there is no need for silhouettes.
Distance Culling
Distance culling is a technique for removing objects that are far away from the player. It works by calculating how big an object will be on the screen and then removes it if it is smaller than the selected value. It is also possible to set a minimum range, any object closer than this will never get culled. Distance culling works on all types of objects. Objects that get culled will fade in/out and not pop directly. A good value for the Screen Size parameter is 5-10%.
Each entity and static mesh has a setting called "Distance Culling". Having this toggled will mean that objects can get culled by distance culling. Most objects should have this toggled. The only objects that should disable distance culling are gameplay objects, landmarks and other important objects like lamps.
Distance Culling is the most important setting for getting good performance on outdoor levels.
Directional Light and Shadows
Directional light with sky and ground color should make up the base of the outdoor lighting. Most outdoor levels also require the use of directional light shadows. This is a very expensive operation. To lower the impact of shadow rendering you will have to uncheck the "Cast shadows" checkbox for some types of objects.
Here is a list of object that should not cast shadows:
- Small objects
- Objects that are almost hidden in undergrowth
- Objects that are only used as a silhouette
- Objects that will always be far away
- Big objects that the player can never reach
The objects selected in this picture are located above the player and can not be reached because of invisible walls. Shadow casting can be disabled for them without affecting the quality of the scene.