Page 1 of 2

Particle System (my)

Posted: Thu Apr 22, 2010 3:27 am
by short
Hey guys, I just finished the (groundwork?) major parts of my in-progress particle system. I finally stole some time away from school :)

I just wish I had more time to devote to this, so any updates will be really slow..

Anyways here's a basic preview, next up is much needed code revision (refactoring), but taking this one slow and having fun learning opengl

Here's a quick video:
explanation: there is four basic commands, left click displays a particle, right click changes the next particles color, middle click toggles any subsequent particles repeat value (whether or not the next particle you create will repeat itself) and the far right button on my mouse (button 4 or 5) iterates through all the particles and turns off their repeat value.

It's kinda simple, but I guess its better to get started on a project now rather than never :)

<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/yUi_BtnmMbM&hl ... ram><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/yUi_BtnmMbM&hl=en&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>[/youtube]

edit: It's kinda dark for some reason, I watched it on hd(720) and it was ok. I apologize about the annoying square in the upper left hand corner, free unregistered screen recorder. Also the screen recorder hella slows down my computer, it runs much faster then shown by the recorder.

Re: Particle System (my)

Posted: Thu Apr 22, 2010 4:47 am
by MrDeathNote
Nice! Can't wait to see it when it's finished :)

Re: Particle System (my)

Posted: Thu Apr 22, 2010 4:49 am
by pritam
Nice, I love particles.

Re: Particle System (my)

Posted: Thu Apr 22, 2010 10:54 am
by GroundUpEngine
Sweet! Particles rock :)

Re: Particle System (my)

Posted: Thu Apr 22, 2010 11:01 am
by dandymcgee
Nice raindrop effect!

Re: Particle System (my)

Posted: Mon May 24, 2010 7:56 pm
by short
Haha just realized something, it is OK to put other non-ogl code inside glBegin() .... glEnd() blocks of code. Realizing this, instead of calling begin/end for every particle, but calling it once per frame I went from lagging having about 1000 particles on the screen to having over 100,000 particles on the screen with absolutely NO lag

haha I feel like I realized something important today

edit: (80 * 10000) is 80,000 not 100,000
Image
Image
Image

Re: Particle System (my)

Posted: Mon May 24, 2010 8:15 pm
by mv2112
short wrote:Haha just realized something, it is OK to put other non-ogl code inside glBegin() .... glEnd() blocks of code. Realizing this, instead of calling begin/end for every particle, but calling it once per frame I went from lagging having about 1000 particles on the screen to having over 100,000 particles on the screen with absolutely NO lag

haha I feel like I realized something important today

edit: (80 * 10000) is 80,000 not 100,000
Image
Image
I'm making the same thing, only mine lags with more than about 5000 particles. How are you getting rid of the lag, besides the glBegin() and glEnd() called once per frame thing, im doing that already.

Re: Particle System (my)

Posted: Mon May 24, 2010 8:29 pm
by short
Well, my mac is kinda new. It has 4gigs of ram, not sure the processor atm. BUT the next thing I am doing is going to pre-calculate sin and cos tables, probably about 10,000 entries in each and load those in static arrays. That will reduce any lag from adding more particles, but not for drawing already calculated particles (sin and cos are called once per particle when loaded into memory, not after).

I couldn't tell you anything else without seeing your code TBH.

edit: do you have to quote my entire post in your reply? lol haha

double edit: I added in the cosn and sinn tables and it didn't have any effect on the performance. The slowdown is coming from elsewhere, so I'll look elsewhere to speed up the code.

Re: Particle System (my)

Posted: Tue May 25, 2010 1:15 am
by Live-Dimension
Yes, it's a very awesome particle engine, and the fact that your getting decent FPS from it is ace.

I do have to ask though - can you do more then dots yet still keep such a framerate?

Re: Particle System (my)

Posted: Tue May 25, 2010 6:06 pm
by short
What else do you mean besides dots?

Re: Particle System (my)

Posted: Tue May 25, 2010 6:46 pm
by mv2112
short wrote:What else do you mean besides dots?
Like make the particles squares or circles or something like that?

Re: Particle System (my)

Posted: Tue May 25, 2010 6:49 pm
by Live-Dimension
Images and crap, like smoke effects, flame, leaves in the wind, etc.

I mean obviously there will be an impact, just would it be a large impact compared to just using dots?

Re: Particle System (my)

Posted: Tue May 25, 2010 7:07 pm
by eatcomics
While there would be a, probably significant, impact, he will still be getting up in the 10,000's I would imagine... but IDK I may be wrong and they may not be too much more strain, or they may be a lot more strain...

Re: Particle System (my)

Posted: Tue May 25, 2010 9:45 pm
by dandymcgee
eatcomics wrote:While there would be a, probably significant, impact, he will still be getting up in the 10,000's I would imagine... but IDK I may be wrong and they may not be too much more strain, or they may be a lot more strain...
All depends on how he implements it.

Re: Particle System (my)

Posted: Tue May 25, 2010 9:53 pm
by eatcomics
I was actually going to update and say that, but I thought... meh they'll figure it out... But yeah, you totally could make it lag like crap, or you could make it good and efficient, it all depends on how you load textures, display them, how you update them, and all that good stuff

I was more or less just talking if he loaded an image, applied it to a rect (this is SDL right, I can't remember) and started drawing them