You can help CodeWalrus stay online by donating here. | New CodeWalrus | Old (dark mode) | Old (light) | Discord server

FBO Particle System

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

0
b/PC, Mac & Vintage Computers publicado por u/Snektron January 22, 2015, 10:31:58 PM
Ever since i started programming, i've been interested in particle systems.
The mouseattractor ones. I've made several of them, the
first one on my laptop could'nt even handle a thousand without killing the
computer (that are the drawbacks of Java i guess :/).

Also, this summer became interested in GLSL (Shading) and started learning that.
Then after a while i read somewhere that GPU's could be used
for more than only drawing images on screen (well, i knew that before, but i never
really knew how such a thing would be accomplished). And yeah, that includes particle systems.
So i started reading up on them, and i actually managed to make one myself :D.

Spoiler






(some screenshots ^)
I can run easily 2 million particles.
It's not quite done yet though, as i've learnt several optimization tricks (yeah, it's was a forgotten project for a few months).
So i'll be working on this project for a few days (i didn't want to attach the project just yet, as
you'd need to recompile it to change the texture size etc). Let me know
what you think and if you have any ideas i should include :)
Inicia sesión o crea una cuenta para dejar un comentario
u/Dream of Omnimaga January 22, 2015, 11:46:25 PM
Oooh those looks nice :D, I wonder how fast it is on, let's say, a 2010 Intel Core i7 computer? Also some of those could be used for wallpapers I think. I can't wait to see it in action :)
u/Snektron January 23, 2015, 12:09:59 AM
Its not going to matter on what cpu it runs (it could theoretically run on a z80... Youd only need pci on z80)
Because its fully ran on the gpu :). Much more power.
And GPU's are made for handeling the same routine (pos / vel updates) for large amounts of data, making it ideally for
Particle systems :P

What really will be interesting of someone has a monster gpu, because it probably can run a few million particles with ease.
Last Edit: January 23, 2015, 12:11:53 AM by Cumred_Snektron
u/Dream of Omnimaga January 23, 2015, 01:40:30 AM
Aah ok, but would it require a GPU from this year or would it run fine on a 3-5 years old one?
u/Snektron January 23, 2015, 06:36:19 AM
Well it uses like GLSL 150,
Aka OpenGL 1.5 (or 130 i cant remember)
Anyway, most pc's should run it fine :).
You could probably run it on an integrated
GPU, though you'd need to reduce the texture
size :p

EDIT: I just remembered that i might have used some
methods in the Java part from OpenGL 3, but most
GPU's come shipped standard with this. I'll need
to implement some kind of check for this.
Last Edit: January 23, 2015, 06:42:29 AM by Cumred_Snektron
u/novenary January 23, 2015, 07:22:38 AM
I have an AMD 7970. I should try to run it. Cause it looks pretty epic. :D
u/unknownloner January 23, 2015, 12:52:56 PM
Yeah if you're using FBOs it'll require GL 3.0 or GL_EXT_Framebuffer_Object
u/Snektron January 23, 2015, 02:19:10 PM
I believe im using a crossover between 3.0 and ext, since
some constants i needed for ext were only in 3.0.
u/unknownloner January 23, 2015, 04:40:23 PM
Spoiler, if you're using LWJGL the EXT calls are literally exactly the same as the 3.0 calls (they both call the same C code).
u/Snektron January 23, 2015, 04:46:30 PM
That's why it works, but as i said, GL30 doesnt have all EXT constants and
vice versa. (and yeah, i do use LWJGL).
u/Dream of Omnimaga January 24, 2015, 12:26:01 AM
Quote from: Streetwalrus on January 23, 2015, 07:22:38 AM
I should try to run it. Cause it looks pretty epic. :D

Good luck running it, because there is no download available :P. I hope one comes out soon, though. :)
u/Snektron January 24, 2015, 11:37:26 AM
Update 1:
I've replaced the position & velocity texture generation,
since Java's BufferedImage could only work with 8 bit color components.
255 different positions is not that much :P. Now it can do 65535 positions (16 bit).
u/Dream of Omnimaga January 24, 2015, 03:11:39 PM
Cool to hear :D
u/Snektron January 24, 2015, 11:24:47 PM
So i've started working on the console. At first i was gonna make it within a JFrame
(Java's window class) but with that it has a 50% FPS drop and freezes every once
in a while :(. I've also realized i'll need a seperate thread for the engine, so the console
doesn't get blocked. Also the display is now resizable :).
u/Dream of Omnimaga January 25, 2015, 05:08:22 PM
Could the slowdown be due to java itself? :P

Also good to see new updates. :)
Start a Discussion

b/PC, Mac & Vintage Computers

Computer programming discussion and project showcase

132
Topics
Explore Board
Website statistics


MyCalcs | Ticalc.org | Cemetech | Omnimaga | TI-Basic Developer | MaxCoderz | TI-Story | Casiocalc.org | Casiopeia | The Museum of HP Calculators | HPCalc.org | CnCalc.org | Music 2000 Community | TI Education | Casio Education | HP Calcs | NumWorks | SwissMicros | Sharp Calculators
Powered by EzPortal