Join us on Discord!
You can help CodeWalrus stay online by donating here.

FBO Particle System

Started by Snektron, January 22, 2015, 10:31:58 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Snektron

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]




[/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 :)
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


Dream of Omnimaga

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 :)
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Snektron

#2
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.
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


Dream of Omnimaga

Aah ok, but would it require a GPU from this year or would it run fine on a 3-5 years old one?
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Snektron

#4
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.
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


novenary

I have an AMD 7970. I should try to run it. Cause it looks pretty epic. :D

unknownloner

Yeah if you're using FBOs it'll require GL 3.0 or GL_EXT_Framebuffer_Object

  
/)

Snektron

I believe im using a crossover between 3.0 and ext, since
some constants i needed for ext were only in 3.0.
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


unknownloner

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).

  
/)

Snektron

That's why it works, but as i said, GL30 doesnt have all EXT constants and
vice versa. (and yeah, i do use LWJGL).
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


Dream of Omnimaga

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. :)
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Snektron

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).
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


Dream of Omnimaga

  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Snektron

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 :).
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


Dream of Omnimaga

Could the slowdown be due to java itself? :P

Also good to see new updates. :)
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Powered by EzPortal