Today I noticed that porting the 2D emitter in 3D is an enormous task.
That's because I need to rewrite the 2D rendering, I need to rotate sprites so that they face the camera and so on, really an annoying work and even if i manage to do that, there are still problems with transparency and the ability to cast shadows.
So I decided to just do a 3D emitter, which cannot spawn as many particles as the 2D one, but there are tons of pros, because I'm going to implement it in a very customizable way.
The idea behind this emitter is:
1) Particles ARE game_objects. So they can have all the components they like, something not supported by unity and (if i remember correctly) the standard classes of unreal engine.
2) The behaviour of a single particle is dictated by a lambda function
3) The particles are spawned by the emitter with another lambda function
The incredible power of doing it this way, is that each particle can have all the components of a game object. This include shadow mapping, specular and diffuse lighting, light emission, and eventually physics in the future. Oh, and since the Emitter is a component, a single particle could emit particles as well.
The behaviours are dictated by lambdas, so that the game programmer can just assing two different functions instead of changing the whole class.
Right now I built the skeleton of everything, except the emitter lambda, which is a little harder.
In the picture are spawned ~10.000 little cubes, with textures, mapping and shadows enabled, and the fps are ~30, which is pretty nice for such a complex emitter.

Nessun commento:
Posta un commento