Today I continued to improve the particle system.
First I made a math library, which is something I was willing to do for a lot of time. That's because the cpp one (STL) is pretty limited, and I also wanted a few functions that work with vectors or colors.
I made it as a class and gave it multiple Lerp and RandomRange functions, which are useful in lots of situations, and also in particle systems.
After that I tried to use the emitter to generate a completly different effect: atmospheric dust.
To do so I needed to program the emitter to emit all the particles at the beginning, and in a wide range of different locations. They are also randomly rotated and deformed, to look less like cubes.
The single particle now moves randomly around very slowly.
The performance is quite ok, not great because I used cubes, and every one of them is a whole gameobject (which also cast shadows), while something like dust should be done in a more optimized way.
However I decided to trade performance for customizability in this particle engine, so that is fine.
In the picture you can see the little particles (which actually looks nicer thanks to the bad compression) and there is also a particle very close to the camera which shows how the model is rotated/deformed.

Nessun commento:
Posta un commento