[Beta] Ultimate GPU Particle System

3423561--323149--Sun.gif
I’ve been working on a GPU Particle System that does NOT require compute shader and can run on Android, iOS, PC, Mac and WebGL. So far, I have a bunch of features implemented and ready to go. Other features are more tricky to implement and /or need fixing. Here’s what I got so far:

Emitters:
Emitters are very close to Unity’s Shuriken Particle System and offers lots of variety: Point, Edge, Circle, Hemi sphere, Sphere, Box & Mesh.

Particles:
The type of the particle can also be defined simply by choosing from a drop down list, just like any other particle System. Additionally, you can choose to display particles as points. This is particularly usefull, when working with millions of particles, because billboards might just be too big. Particle types: Point, Triangle, Billboard, Horizontal billboard, Vertical Billboard, Stretched Billboard, Tail stretched billboard & Mesh.

Attractors and forces:
A couple of froces and attractors have been implemented: Directional Force, Circular Force, Drag & Turbulence

Turbulence:
No particle system is complete without turbulence, that’s why I implemented Vector Fields (from FGA files) and classic Perlin turbulence noise. Vector fields are only supported on devices that support 3D textures, though.

What it is good for:
This particle system is very good at displaying large amounts of particles. In order to function properly, it should be loaded with the level, and must be properly pooled. Instantiating and Destroying will ruin your performance. Environment effects like snow or rain are perfect cases for this system. Also magic and sparks effects can be spiced up with this system. I would suggest to reuse the same particle system every frame like so: Emit → Move to new position → Emit → Move to new position → Emit → etc. On mobile devices, the fill rate is the biggest concern. That means, that particles should have a small size to reduce overdraw.

3423561--323158--Magic.gif

How it works:
This GPU particle System uses a technology, used already many years ago. You can find lots of papers about this on the internet. On Initialization, this system generates a mesh of particles, and some buffers for position, velocity and meta data. Those buffers are simple RenderTextures. On every update, the velocity buffer is rendered into the position buffer with a shader, using Graphics.Blit(). The same happens to all other buffers with different shaders. Finaly, when rendering the Particles, the shader reads the position information from the position buffer and updates its position. Since all heavy calculations are done simultaniously on the GPU, it is possible to calculate millions of particles and also render the particles many times per second. Shader keywords enable and disable features based on target platform and required features.

I successfully tested this system with 6.000.000 particles at 30 FPS on a GTX 970 in the Editor. On a shield tablet, I got to around 200.000 particles.

3423561--323152--Portal.gif
Check out the realtime effects here (HDR) and here (Mobile)

Asset Store Release
Initially, I was contemplating to put the Particle System on Git or the Asset Store for free. But knowing myself, I would probably just drop it as soon as it’s out. To give me a bit of an incentive, I’ve come to the conclusion, to sell it on the Asset Store, since there are still so many more features, that I’d like to add in the future. Im going to start with a Beta phase in which Im going to give a good discount: 60% = 20.00 USD.

3423561--323155--Nest.gif

The GIFs are captured from the HDR Demo so make sure to check it out yourself! (for link see above)

I cant wait to hear your feedback.

Cheers!

Max

13 Likes

I would be interested in this for its device range especially if it were an open github project allowing for forks and such along the lines of GitHub - keijiro/KvantStream: A simple GPU particle system for Unity (which precludes mobile). Particle systems are often difficult to meet all unique needs without plugins/changes in code/etc (a general purpose non-modular system would be bloated at best). I tend to make local modifications to integrate and customize systems and Unity Packages are more difficult to merge updates into than git. That said, I’d also be interested if you decided to go down the Asset Store route and I would spend money on it if it came with source code at the very least as a learning tool since I really appreciate a good example and it looks like you’ve done an impressive amount of groundwork that would take a lot of time and learning to be able to replicate.

2 Likes

Looks cool!

Seeing this reminds me a bit of TC Particles, which - I think - is also a GPU-based particle system.
There is also a simple one called “KvantStream” from the famous Unity Japan developer Keijiro,
available on GitHub. I don’t know, if both can run on mobile or WebGL.

What are the drawbacks of your system (if there are any)?

1 Like

I’ve done some research and of course I’ve stumbled over Kvant. What I want to do though, is to create a multi purpose tool. As Oizys pointed out, the system will be pretty big, but I dont think there are any drawbacks that one would consider a deal breaker. Just difficult tasks like managing permutations of shaders (because of many keywords) on all platforms and keeping the system up to date. The bigest problem here is to manage my time in a way that I can add features, while also doing support, creating marketing materials and documenting all functions etc etc… TC particles would be a great tool if it would only work on all platforms. On DX10 PC’s it’s probably as good as Unreals Particle Engine. Speaking of Unreal, does anyone know how many particles it supports on mobile? Never had the chance to test it out.

1 Like

This looks pretty neat. If you need someone to help test it out for you I have a low, medium, and high end pc. (i3 gtx860 8gb ram, i5 gtx1050 8gb, and i7 gtx 1080, 32gb ram). I would not mind seeing what it can do. I am a big fan of particle effects, I buy nearly all the big packs from krypto, mirza, and them.

Thanks for the offer. I’ll try to polish the editor a little bit more and make sure it actually works on all devices. ;D

1 Like

Platform support for unity compute shaders is better than it was, I can run TC particles on my mac these days and on iOS too though I havent actually tried that yet. But yes, there are still a few platforms lacking compute shader support.

What I find most limiting about TC particles is the shader/rendering options for the particles. Especially compared to Unitys own particle system where more is possible regarding particle shaders than used to be.

I havent played with UE4 GPU particles all that much because I am usually interested in millions of particles and I got the idea their system, even in GPU mode, isnt quite designed to work optimally with that many particles.

My general interest in systems such as yours, TC particles and Kvant stuff, involves using a 3D fluid sim (navier-stokes type stuff, not fluid as in liquid) to drive the particle velocity. With other systems this has been a fairly simple hack where I change the particle systems code to accept a 3D render texture rather than a normal 3D texture, and then use the 3D velocity rendertexture from the fluid sim.

1 Like

Regarding particle shading, TC is fine for glowing particles similar to the ones in your example artwork, but is there any prospect of your system being able to do things like have particles that are lit by lights in the scene? I will understand if this is not practical at all for various technical reasons, but since this is an area where I lack understanding I thought I may as well ask!

If you go down the route of releasing for free, I favour the github approach, especially as the unity package manager looks quite promising and they do plan to allow custom repositories to be used with it in future (eg see this post #5 )

Hey elbows,

I’ve tested my system with a couple of shaders variants. One was the standard shader, that I modified in order to be make it compatible. It needs a kind of complicated vertex shader, but the fragment shader is completely up to you. The default GPU Particle fragment shader only displays color and textures, but I also tested flow maps, motion vectors, realtime shadows and many different blend modes. As far as fluid simulations go, you can simulate and export a simulation as a FGA file (in Maya or 3Ds max etc.) and import it into the GPU Particle System. It works pretty well and is fast, too. In contrast to TC Particles, I would be looking at a much lower price point in order to make it accessible by indie’s as well.

1 Like

Thanks for the reply, good news about the shaders!

And sorry for the confusion, my words about fluid sim was not really a request or question, it was just me saying how I have plugged simulations into other particle systems in the past, and that I will probably do it again with your asset! Unlike the static FGA method you mention, my stuff is not really fast because the sim is using lots of the GPU, but the results can be far more interesting and I really look forward to doing it with your system one day!

For example here is an old and very basic demo of me doing the fluid sim thing using TC particles. If you need a mac beta tester or want to see your system used in this way soon, please feel free to consider giving me early access to your asset :smile: :wink: Sorry for being cheeky there and I wont complain if there is no early access to be had :smile:

5 Likes

Looks amazing! I get where you’re coming from :slight_smile: I’m a vfx artist who is always looking to get cool new effects done. Even if that means, that I have to make my own particle system. Now that I put so much work into it, I might as well go the extra mile and turn it into a proper particle system. That’s why Im always happy when I get feedback. Thanks.

3 Likes

I think its great you are considering an open source approach to your system. Too bad Unity does not have a particle system like this already. But its developers like you that make Unity greater. Good luck on your final release.

1 Like

Looks like the landscape in this area for Unity is changing:

So there we go, Unity are working on their own solution. I suppose this is likely to influence your plans, since unity having their own modern system on this front changes the game?

Although to be fair, from the tiny amount of info I’ve heard about Unitys own system, they are targeting the HD pipeline, so there is still a place for systems that arent targeting that scriptable render pipeline.

I got my info from the short video attached to this tweet:

1 Like

I talked to a Unity field engineer about 1 year ago. He said they already have something in the pipeline. The just wondering when it comes and if it creates top quality results. The thing with Shuriken is, that it does a lot of things now out of the box, but the editor is painfully slow and the results are not as good as they could be. I also still have to script a lot to make effects possible.

3 Likes

Are you planning on making this public soon?

1 Like

+10 on ^ this

I don’t like that all the cool stuff is going to the hd render pipeline, so if you can make this work on mordern mobile devices and apple tv 4k that would be so cool.

and my preferred reslease is to host on git,

A good example is Aura

https://github.com/raphael-ernaelsten/Aura

released on git and opensource

Ah yes, the ol’ suble, yet not so subtle “Hey, I don’t want to pay, make it free”. The oldest trick in the book. You do realize it takes a lot of time and effort to make something like that, then to not only have to make it, divide it for the different pipelines?

1 Like