User Tools

Site Tools


hpl3:engine:static_objects

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
hpl3:engine:static_objects [2012/04/25 07:51]
thomas
hpl3:engine:static_objects [2012/06/14 11:28] (current)
thomas [General]
Line 3: Line 3:
  
 ==== General ==== ==== General ====
-Static objects are placed in the editor in the static objects edit mode. Static objects are usually the performance wise the best objects since they are combined when the level is loaded. What happens is that the engine will look for nearby objects that share the same material and settings (shadows, collider, occluder, etc) and combine these into a single mesh. This heavily reduces the number of draw calls the renderer has to do and thereby speeds up the rendering. Because of this, it is important that static objects that are often nearby one another (walls of certain type, pipes, etc) all share the same material. So it is often good to have a really big texture that is shared among many objects, up to as large as 4096x4096.\\ +Static objects are placed in the editor in the static objects edit mode. Static objects are usually the performance wise the best objects since they are combined when the level is loaded. What happens is that the engine will look for nearby objects that share the same material and settings (shadows, collider, occluder, etc) and combine these into a single mesh. This heavily reduces the number of draw calls the renderer has to do and thereby speeds up the rendering. ​
-It is important to not get carried away with this thinking though. First of all large textures may take longer to render and thus it can slow down if it does not reduce the number of draw calls enough. Also important to not have things that are almost always separate (say floor for a corridor and ceiling used in an office) on the same texture, because that will only bring up the memory requirements as part of the texture might not be used on certain levels.+
  
 +==== Texturing ====
 +Because object using the same texture (.mat file really) it is important to have this in mind during texturing. Static objects that are often nearby one another (walls of certain type, pipes, etc) should all share the same material. So it is often good to have a really big texture that is shared among many objects, up to as large as 4096x4096.
 +
 +It is important to not get carried away with this thinking though. First of all large textures may take longer to render and thus it can slow down if it does not reduce the number of draw calls enough. Also important to not have things that are almost always separate (say floor for a corridor and ceiling used in an office) on the same texture, because that will only bring up the memory requirements as part of the texture might not be used on certain levels.\\
 +
 +Another aspect to this is that you can only set a single physics material per mat file. When generating physics colliders from mesh in the model file, the physics material set in the .mat is used. Because of this, it is important not to have too many different surface materials in the same texture. For instance instead of having steel beams and wooden wall in the same texture, make these two separate. However, do not take this thinking too far. This only applies to large surfaces. For instance, if you have many small metal pieces on a large wooden surface, there is no need to split this into several texture. ​  
 ==== Collision ==== ==== Collision ====
  
Line 35: Line 40:
  
 ==== Entity File ==== ==== Entity File ====
 +
 +For more info om entities see [[hpl3:​engine:​entities|here]].
 +
 Static objects support having a .ent file, but this is not needed. The engine will check if there is an entity file with the same name as the model (eg, if "​wall.dae"​ has "​wall.ent"​) and if so load it. The only thing loaded from this file are: Static objects support having a .ent file, but this is not needed. The engine will check if there is an entity file with the same name as the model (eg, if "​wall.dae"​ has "​wall.ent"​) and if so load it. The only thing loaded from this file are:
  
hpl3/engine/static_objects.1335340314.txt.gz · Last modified: 2012/04/25 07:51 by thomas