Unity particles and Blender's point density

Is it possible to render particles in Unity real-time simulating Blender’s point density feature?
It’s connected with Cycles volume shaders.

https://www.blender.org/manual//render/cycles/nodes/types/textures/point_density.html

Btw, how come forum does not have particles subsection?

EDIT> Please, reallocate this thread in

Because particles are too specific to merit the inclusion of their own forum, so they’re part of the graphics forum instead, which is where this thread would probably be better suited.

I’d imagine this would only be possible (or I should say a reasonable performant) on the GPU.

There might be something on the asset store but most likely will only work with direct x and decent graphic cards.

1 Like

If you are ready to pay something in the asset store, here is a list of particle systems that use the GPU for simulation (thus might be able to do what you want):

These were the first three I found - there might be more.

All besides the first one are expensive (85-90$), but they do way more than just simulating the particles on the GPU… and the first one (10$) seems to be kinda new, thus maybe not as well tested by users in the field.

Of course most of these are DX11 only, but then you most probably do not want to overload a mobile GPU with having to calculate your particles… and DX11 has been around for 5+ years now on Windows PC.

Is it possible to achieve that without the addons?
How do you set GPU particles and various rotations and fields?
Blender has this parameter Brownian motion which adds to variety to particles movement.

Probably. Tear apart blender effect, see how it works, attempt to replicate. Looking at the picture, it can be too expensive to be practical in realtime.

Since IIRC unity has no built-in GPU particle support, you’ll have to write your own particle system.
Basically, compute shader for particle movement + vertex/fragment shader for rendering.

You could use any function similar to perlin noise (using particle life time as parameter to pass into noise function) to add random motion to particles. That can be computationally expensive, though.

I did tear it up in Blender. I can post it to show it but I need some time because Blender only renders on CPU the way I set it.

Could you tell me how to set perlin noise or post some guide to it?
Is it possible to render the particle animations in Unity and use as animated billboard textures?

You’ll either need either custom particle system or find some sort of hook that can adjust particle velocity at runtime.

Perlin noise is a noise function that produces continuous smooth gradient for any coordinates. At the very least it is 2d. The more dimensions in the noise function the more expensive it gets. (cost doubles with each extra dimension)
So… since the particle is in 3d space, you’ll 3 noise values to get random smoothly changing velocity vector.

So, for each velocity coordinate you need to store Vector2 coordinate from which particle reads current noise value, and rate of change of said coordinate.

Something like this (pseudocode not a valid C# code)

struct NoiseSampler{
     Vector2 noiseCoord = new Vector2(randomFloat(), randomFloat());
     Vector2 noiseCoordVelocity = new Vector2(Random.Range(-1.0, 1.0), Random.Range(-1.0, 1.0)).normalized;
     float getValue(){
          return Perlin2d.read(noiseCoord);
     }
     void update(float deltaTime){
          noiseCoord += noiseCoordVelocity * deltaTime;
     }
}

...
struct ParticleData{
     NoiseSampler xSampler, ySampler, zSampler;
     ....
     Vector3 getRandomVelocity(){
           return new Vector3(xSampler.getValue(), ySampler.getValue(), zSampler.getValue());
     }
     void update(float deltaTime){
          xSampler.update(deltaTime);
          ySampler.update(deltaTime);
          zSampler.update(deltaTime);


          this.currentVelocity = scriptedVelocity + getRandomVelocity();
     }
     ....
}

You got the idea, I hope? This way, you should get smooth “brownian” motion on particles.

Unity Api has Perlin Noise function:
https://docs.unity3d.com/ScriptReference/Mathf.PerlinNoise.html
Though I suspect it is an optimized version, not a “real” perlin noise.

And you should be able to script particle system beahvior using Get/Setparticles.
https://docs.unity3d.com/ScriptReference/ParticleSystem.GetParticles.html