how to start a particle subsystem


I just want to know if it is a good approach for a particle engine to use vertex arrays in combination with vertex and fragment shader or should I only use vertex arrays ? I cannot decide what I should use. I know an approach step by step adding complexity would be the best way but i don’t want to end up in a dead end and start all over again. I had some demos with point sprites but those seem to lack the the degree of freedom I’m looking for. :confused:


This is indeed an extremely common problem in coding. It is also extremely hard to give a straight answer too. I will say from personal experience, though, that the best favor you can do for yourself is to be clear on what you are trying to do when coding. Write some specifications for yourself! So, be precise about what you want to do, have a clear idea of the end result. If you can squeeze in some generality, all the better. But it should probably not be your main focus. If you want generality that badly, you could perhaps see if there are any libs already out there. Sure, you might have to learn how to use them, but the time you might save could be enourmous. That’s my view on the topic.

Thanx thinks,
but I do not want to use some 3rd party stuff.

I have a spec/classes etc., I have what I want to do, I did some small demos using point sprites, but now I need the best approach in opengl. Is it a good approach to do all the calculation in the GPU rather than CPU? Are there any fallbacks I’m currently not aware of? (I don’t mind that this won’t run on older hardware). I don’t want to endup struggling with the shaders when it would have been much better and faster to do it differently.

cheers Joachim

Going for an optimal solution straight away has several problems. First of all, “optimal” is a vague definition. Secondly, no matter how much you optimize there are always going to be things left to do. So make it work first, and then repeteadly eliminate bottle-necks.

No, it is not good to shift all the computations to the GPU. What will the CPU be doing in the mean-time? A healthy balance is probably best here, use all the raw power of your machine, instead of just one piece of hardware.

Make it work, then find out which parts of your code take the longest to execute, and then you can find out specific solutions to those problems. Global optimization is extremely difficult and humans generally don’t do well at it.

Good luck!