User Tools

Site Tools


hpl3:engine:optimizations

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
hpl3:engine:optimizations [2011/08/30 07:23]
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**\\
hpl3/engine/optimizations.txt ยท Last modified: 2015/09/17 10:59 by ian.thomas