User Tools

Site Tools


hpl3:engine:optimizations

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
hpl3:engine:optimizations [2011/08/30 06:08]
jens [Objects]
hpl3:engine:optimizations [2012/10/08 13:46]
thomas [Transparency]
Line 8: Line 8:
  
 **Alpha in all trans materials**\\ **Alpha in all trans materials**\\
-As mentioned above, a costly aspect is of translucency is that it both read and writes. This can be reduced quite bit by skipping pixels that are not needed. Normally particles and similar and round in shape and are on a square textures. This makes the corners of of the image have pixels that are never drawn. This can be fixed to some extent by having an alpha channel and set alpha to zero in these areas. The important part is that this works even more additive, mul and mulx2 blend modes! So where ever your material is invisible (add=(0,​0,​0),​ mul=(1,​1,​1),​ mulx2=(0.5, 0.5, 0.5)) have alpha value of zero and for the rest of the pixels 1 (gradient is not needed). This reduce the perfomance ​it by a particle system by almost 50%!!+As mentioned above, a costly aspect is of translucency is that it both read and writes. This can be reduced quite bit by skipping pixels that are not needed. Normally particles and similar and round in shape and are on a square textures. This makes the corners of of the image have pixels that are never drawn. This can be fixed to some extent by having an alpha channel and set alpha to zero in these areas. The important part is that this works even more additive, mul and mulx2 blend modes! So where ever your material is invisible (add=(0,​0,​0),​ mul=(1,​1,​1),​ mulx2=(0.5, 0.5, 0.5)) have alpha value of zero and for the rest of the pixels 1 (gradient is not needed). This reduce the perfomance ​hit by a particle system by almost 50%!!
  
 **Premultiplied alpha**\\ **Premultiplied alpha**\\
Line 35: Line 35:
  
 **Turn off shadow casting when not needed.**\\ **Turn off shadow casting when not needed.**\\
-Many obects ​like floor, ceiling and some walls, never cast shadows on anything. Small objects cast small, hard to see shadows that are unneeded. Think about this when working on the map and turn off shadows when it does not  (or only very slightly) affect the final visual outcome! This can help increase performance quite a bit!+Many objects ​like floor, ceiling and some walls, never cast shadows on anything. Small objects cast small, hard to see shadows that are unneeded. Objects along the wall, like beams, often cast shadows that can be turned off. Static objects located in a shadow from another static objects should have their shadows off as they are invisible. Think about this when working on the map and turn off shadows when it does not  (or only very slightly) affect the final visual outcome! This can help increase performance quite a bit!
 ===== Lights ===== ===== Lights =====
  
Line 55: Line 55:
 **Turn off or simplify collisions of static objects**\\ **Turn off or simplify collisions of static objects**\\
 As mentioned above in "Keep static object polycount down or use entities"​ static objects do not instance their data but keep it unique for each object. This is also true for collision data. First thing to do, is to make sure to that no unnecessary object, like grass, pebbles, etc, has collision on. Turn it off far all small stuff or for geometry that the player can never reach (like distant tower or what not). \\ As mentioned above in "Keep static object polycount down or use entities"​ static objects do not instance their data but keep it unique for each object. This is also true for collision data. First thing to do, is to make sure to that no unnecessary object, like grass, pebbles, etc, has collision on. Turn it off far all small stuff or for geometry that the player can never reach (like distant tower or what not). \\
-Next thing to do is to add mesh shapes (these are shapes that are added through special naming in the model file) for high polygon objects. This include things like pillars, high detail walls and more. Do not sure it on everything, but consider it for everything above 500 triangles or so. For some objects, like a rubble of rocks, it is better not have have it because it can be too complex to add collision shapes. For most objects it is well worth the job though. It makes the game take up less ram and also make collision testing faster (unless a lot of geometry shapes are used that is, so do not go wild)+Next thing to do is to add mesh shapes (these are shapes that are added through special naming in the model file) for high polygon objects. This include things like pillars, high detail walls and more. Do not use it on everything, but consider it for everything above 500 triangles or so. For some objects, like a rubble of rocks, it is better not have have it because it can be too complex to add collision shapes. For most objects it is well worth the job though. It makes the game take up less ram and also make collision testing faster (unless a lot of geometry shapes are used that is, so do not go wild)
  
  
hpl3/engine/optimizations.txt ยท Last modified: 2015/09/17 10:59 by ian.thomas