Particles

BlitzMax Forums/MiniB3D Module/Particles

BLaBZ(Posted 2010) [#1]
I have hundreds of square meshes with animated textures acting as particles, is there a better to create a particle effects that may be faster?


ima747(Posted 2010) [#2]
Try searching this forum for [a /_search.php?bbs=&forum=119&terms=particle+system&method=simple&case=no&results=topic&user=&submit=Search]particle systems[/a]. There are plenty of options. I have never toyed with animated textures so they may throw a monkey wrench into some of the available options, but unique meshes with their own textures is (imo) the least effecient way to do it, so I'm sure you can get some improvements.

At the very least using copyentity to conserve the meshes could save some resources and rendering time... recycling objects is always a good way to speed things up if you're not already doing that. I would assume a non animated texture, but if possible using things like coloring the particles if possible would be faster...


Kryzon(Posted 2010) [#3]
- Use a single-surface system to indirectly avoid the expensive glBindTexture() calls when rendering.
- Use a vertex-shader to rotate the quads instead of doing that on the CPU.

You can place each particle's vertices at the same position, each with a specific UV for each corner. On the vertex-shader, read those UVs and based on them you know which particle belongs to which quad corner - so you can position and make them face the camera accordingly.