Particle System (my)
Moderator: PC Supremacists
- short
- ES Beta Backer
- Posts: 548
- Joined: Thu Apr 30, 2009 2:22 am
- Current Project: c++, c
- Favorite Gaming Platforms: SNES, PS2, SNES, SNES, PC NES
- Programming Language of Choice: c, c++
- Location: Oregon, US
Particle System (my)
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.
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.
My github repository contains the project I am currently working on,
link: https://github.com/bjadamson
link: https://github.com/bjadamson
- MrDeathNote
- ES Beta Backer
- Posts: 594
- Joined: Sun Oct 11, 2009 9:57 am
- Current Project: cocos2d-x project
- Favorite Gaming Platforms: SNES, Sega Megadrive, XBox 360
- Programming Language of Choice: C/++
- Location: Belfast, Ireland
- Contact:
Re: Particle System (my)
Nice! Can't wait to see it when it's finished
http://www.youtube.com/user/MrDeathNote1988
"C makes it easy to shoot yourself in the foot. C++ makes it
harder, but when you do, it blows away your whole leg." - Bjarne Stroustrup
"C makes it easy to shoot yourself in the foot. C++ makes it
harder, but when you do, it blows away your whole leg." - Bjarne Stroustrup
-
- Chaos Rift Demigod
- Posts: 991
- Joined: Thu Nov 13, 2008 3:16 pm
- Current Project: Elysian Shadows
- Favorite Gaming Platforms: Amiga, PSOne, NDS
- Programming Language of Choice: C++
- Location: Sweden
Re: Particle System (my)
Nice, I love particles.
- GroundUpEngine
- Chaos Rift Devotee
- Posts: 835
- Joined: Sun Nov 08, 2009 2:01 pm
- Current Project: mixture
- Favorite Gaming Platforms: PC
- Programming Language of Choice: C++
- Location: UK
- dandymcgee
- ES Beta Backer
- Posts: 4709
- Joined: Tue Apr 29, 2008 3:24 pm
- Current Project: https://github.com/dbechrd/RicoTech
- Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
- Programming Language of Choice: C
- Location: San Francisco
- Contact:
Re: Particle System (my)
Nice raindrop effect!
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches!
- short
- ES Beta Backer
- Posts: 548
- Joined: Thu Apr 30, 2009 2:22 am
- Current Project: c++, c
- Favorite Gaming Platforms: SNES, PS2, SNES, SNES, PC NES
- Programming Language of Choice: c, c++
- Location: Oregon, US
Re: Particle System (my)
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
haha I feel like I realized something important today
edit: (80 * 10000) is 80,000 not 100,000
Last edited by short on Mon May 24, 2010 8:48 pm, edited 1 time in total.
My github repository contains the project I am currently working on,
link: https://github.com/bjadamson
link: https://github.com/bjadamson
- mv2112
- Chaos Rift Junior
- Posts: 240
- Joined: Sat Feb 20, 2010 4:15 am
- Current Project: Java Tower Defence Game
- Favorite Gaming Platforms: N64/Xbox 360/PC/GameCube
- Programming Language of Choice: C/++, Java
- Location: /usr/home/mv2112
- Contact:
Re: Particle System (my)
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.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
- short
- ES Beta Backer
- Posts: 548
- Joined: Thu Apr 30, 2009 2:22 am
- Current Project: c++, c
- Favorite Gaming Platforms: SNES, PS2, SNES, SNES, PC NES
- Programming Language of Choice: c, c++
- Location: Oregon, US
Re: Particle System (my)
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.
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.
Last edited by short on Tue May 25, 2010 10:03 pm, edited 1 time in total.
My github repository contains the project I am currently working on,
link: https://github.com/bjadamson
link: https://github.com/bjadamson
-
- Chaos Rift Junior
- Posts: 345
- Joined: Tue Jan 12, 2010 7:23 pm
- Favorite Gaming Platforms: PC - Windows 7
- Programming Language of Choice: c++;haxe
- Contact:
Re: Particle System (my)
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?
I do have to ask though - can you do more then dots yet still keep such a framerate?
- short
- ES Beta Backer
- Posts: 548
- Joined: Thu Apr 30, 2009 2:22 am
- Current Project: c++, c
- Favorite Gaming Platforms: SNES, PS2, SNES, SNES, PC NES
- Programming Language of Choice: c, c++
- Location: Oregon, US
Re: Particle System (my)
What else do you mean besides dots?
My github repository contains the project I am currently working on,
link: https://github.com/bjadamson
link: https://github.com/bjadamson
- mv2112
- Chaos Rift Junior
- Posts: 240
- Joined: Sat Feb 20, 2010 4:15 am
- Current Project: Java Tower Defence Game
- Favorite Gaming Platforms: N64/Xbox 360/PC/GameCube
- Programming Language of Choice: C/++, Java
- Location: /usr/home/mv2112
- Contact:
Re: Particle System (my)
Like make the particles squares or circles or something like that?short wrote:What else do you mean besides dots?
-
- Chaos Rift Junior
- Posts: 345
- Joined: Tue Jan 12, 2010 7:23 pm
- Favorite Gaming Platforms: PC - Windows 7
- Programming Language of Choice: c++;haxe
- Contact:
Re: Particle System (my)
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?
I mean obviously there will be an impact, just would it be a large impact compared to just using dots?
Re: Particle System (my)
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...
- dandymcgee
- ES Beta Backer
- Posts: 4709
- Joined: Tue Apr 29, 2008 3:24 pm
- Current Project: https://github.com/dbechrd/RicoTech
- Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
- Programming Language of Choice: C
- Location: San Francisco
- Contact:
Re: Particle System (my)
All depends on how he implements it.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...
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches!
Re: Particle System (my)
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
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