User Tools

Site Tools


hpl3:tutorials:level_design_-_indoor_level_performance

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
hpl3:tutorials:level_design_-_indoor_level_performance [2013/02/11 11:04]
nebej [Room Positioning]
hpl3:tutorials:level_design_-_indoor_level_performance [2013/02/11 15:09] (current)
nebej [Water]
Line 33: Line 33:
  
  
-===== Occluders ​=====+=== Occluders ===
  
  
Line 56: Line 56:
 IsOccluder setting can be found under the Apperance tab for dynamic entities. IsOccluder setting can be found under the Apperance tab for dynamic entities.
  
-===== Room Positioning ​=====+ 
 +{{:​hpl3:​tutorials:​entity_occluder.jpg?​nolink&​198x450}} 
 + 
 + 
 +=== Room Positioning ===
  
  
 Another way of making sure that the occlusion culling is effective is to try to separate rooms and corridors as much as possible. Another way of making sure that the occlusion culling is effective is to try to separate rooms and corridors as much as possible.
 +
 +
 +The following images only show 2D setups, but they work on all axis and should be applied to 3D!
  
  
Line 68: Line 75:
  
  
-{{:​hpl3:​tutorials:​tutorial_indoor_zigzag.jpg?​1086x254}}+{{:​hpl3:​tutorials:​tutorial_indoor_zigzag.jpg?​nolink&1086x254}}
  
  
 In this image the two rooms are connected with a corridor without doors. If the player stands in one room he would be able to see the other room. The best solution here would be to add doors or other occluders. If that is not possible you can change the look of the corridor so that the player does not have direct vision between the rooms. Using a diagonal corridor would work as good as a zigzag one. In this image the two rooms are connected with a corridor without doors. If the player stands in one room he would be able to see the other room. The best solution here would be to add doors or other occluders. If that is not possible you can change the look of the corridor so that the player does not have direct vision between the rooms. Using a diagonal corridor would work as good as a zigzag one.
 +
 +
 +{{:​hpl3:​tutorials:​tutorial_indoor_move_2.jpg?​nolink&​386x287}}
 +
 +
 +If the performance is really bad and the culling fails then you should try to fully separate rooms in at least two axis. The dotted blue line show that the two rooms are not intersecting in the x- and y-axis. This kind of separation really helps the space partitioning algorithm.
 +
 +
 +=== Leaks ===
 +
 +
 +It is important to fix any small gaps and leaks in the geometry between two rooms.
 +
 +
 +{{:​hpl3:​tutorials:​tutorial_indoor_pixel_holes.jpg?​nolink&​294x372}}
 +
 +
 +Here you can see some geometry leaks from one of the doors. These leaks can cause the occlusion culling to fail and should be fixed.
 +
  
 ==== Shadows ==== ==== Shadows ====
  
  
-Directional ​light with sky and ground color should make up the base of the outdoor lighting.+Spot light shadows are the second most expensive part of a indoor level. There are a few ways to reduce the cost of shadow casting. 
 + 
 + 
 +If your light is not used for anything gameplay related then you should disable "​Shadow affects dynamic"​. This greatly increases the speed of the shadow casting because the shadows only have to be generated one time. If the shadow affect dynamic entities it has to be generated again each frame. 
 + 
 + 
 +Optimize the radius ​and FOV of the light. The larger the radius the more objects has to be rendered to the shadow map. You should ​also try to keep the bounding volume of a light from leaking into multiple rooms. You can also connect a LightMask to the light to make sure that it does not leak outside of the room. 
 + 
 + 
 +If you have multiple shadow casting lights in the same room you can set the shadow fade range (not in yet) to a low value. This will make the shadows fade in/out when the camera gets further away than the value. 
 + 
 + 
 +Reducing the number ​of shadow casting lights and replacing them with one bigger light is also a great way to increase performance 
 + 
 + 
 +Use a gobo texture instead of shadow casting if possible. 
 + 
 + 
 +If a room requires ​the use of the flashlight then it needs to be turned on when calculating performance. 
 + 
 + 
 +You can increase the speed of shadow rendering by removing shadow casting on some object. You only have to do this on objects that are near a shadow casting light. Here is a list of object that should never cast shadows: 
 + 
 + 
 +    * Floors that have nothing beneath them 
 +    * Outer walls that have nothing on the other side 
 +    * Small objects near walls and floors 
 +    * Objects that are guaranteed to be in the shadow of all lights
  
  
-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.+==== Water ====
  
  
-Here is a list of object ​that should not cast shadows:+Most of our levels feature water, this can be quite expensive. Water that uses reflections require the game to render twice, this can really slow down the level. The main thing to fix areas that have water reflection is to reduce the number of objects in it.
  
  
-    * Small objects +If a level requires both detail and water then you can either disable reflections or set the ReflectionFadeEnd to a low value. ReflectionFadeEnd is a value in the water material ​that sets the maximum distance ​that the water can reflect.
-    * 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.+{{:​water_material.jpg?​nolink&​}}
  
hpl3/tutorials/level_design_-_indoor_level_performance.1360580696.txt.gz · Last modified: 2013/02/11 11:04 by nebej