# How do Noise work in the Particle System?

Hi guys, im trying to get my head around the partcile system noise.

i have this image;

so, X = 5 means how far the particle will move from 0?
The preview, i understand that the texture is divided by 3, one for X, Y and Z.

So if i have X, with black and white, what im suppose to see?
The black means add +1 to the x? so it will move right, when it becomes white moves back to -1 so it goes left.
that is from the top point of the texture until down? left to right? Or it never scan the texture at all and only read an specifc point x, to check if is white or black?

BUT, if i have a 2d noise i do have movement with no scrolling, so they are scaning the texture.

basicaly why this shape give me this animation?

Is there any tutorial? because any thing i do i got random results.

Fran

Bump

The parameters are fed into an implementation of Curl Noise, which uses multiple samples from a Perlin Noise field.

To use your example, a Strength of 5 produces Perlin Noise in the [-5,+5] range.
Curl noise then combines 2 samples for each axis, giving you a final range of [-10,+10].

This final value is the maximum potential units per second that any given particle may move.

The texture is used to give you an indication of how particles will be affected by the noise. Imagine particles travelling across the noise (You are using Low Quality, where we only generate 1 axis of noise, and re-use it all directions, for fast by less â€śinterestingâ€ť noise.) As the particles travel across the noise, a grey area means no effect, black means strong negative, and white means strong positive.

We have a manual page here: Unity - Manual: Noise module If you think it is lacking specific information, let us know and we can improve it. We donâ€™t have any first party tutorials on it yet.

I would advise trying to think more about how each parameter affects the shape of the noise:

• Strength is the amount of movement
• Frequency describes how often the particles will change direction
• Damping ties Strength + Frequency together, so you can maintain the same overall noise shape at different sizes
• (etc) Iâ€™m mainly just repeating the manual page here, so Iâ€™ll stop
2 Likes

For study purpose i end up creating my own noise and moving the particles using code writing by me. Curl noise is kinda difficult. my main idea was to move a particle using a texture shape, so if the texture have a circle, the particle move in circles, end up that is name stream particles? i found some houdini tutorials that work in ue.

anyways, thank you again for that noob quesiton.

Ah yes, I think you are describing Vector Fields. Itâ€™s a great technique! Good luck

Hi Richard and Karl,

I have another question about the noise module. Iâ€™m writing an application that requires particle simulation to be deterministic and allow for simulating to a given time (even in the past). However, when using the noise module, Iâ€™m unable to get deterministic results. Hereâ€™s a quick video of what I mean:

Iâ€™ve also noticed if the shape module is turned on (e.g., using Sphere emission), similar random behavior on reverse simulation happens.

Neither the noise module or shape modules cause issues if the particle emits in local space - the shape and noise modules only seem to cause a problem in world space. Iâ€™m wondering if the noise and shape modules have any code in them that uses world space positions as part of some randomness functions that could cause this. If so, could you suggest any workarounds?

Thank you!
John

For reference, this is how Iâ€™m seeking the particles:

Class variables

• velocityAnimation is a .anim file that stores a bunch of positions that I am using to move the world space particle systems
• lastFrameIndex is an optimization that keeps track of the last simulated particle frame to avoid always resimulating from 0 (resimulation from 0 only happens when scrubbing backwards in time)
``````private void ParticleSeek(int frame)
{
if (frame != lastFrameIndex)
{
int frameOffset = frame;

if (frame < lastFrameIndex)
{
particleSys.Clear();
particleSys.Simulate(0, true, true);
lastFrameIndex = 0;
}
else
{
frameOffset -= lastFrameIndex;
}

float delta = 0.0333f;

for (int i = 0; i < frameOffset; i++)
{
if (particleSys.main.simulationSpace == ParticleSystemSimulationSpace.World && velocityAnimation != null)
{
velocityAnimation.SampleAnimation(particleSys, frame * delta);
}

particleSys.Simulate(delta, true, false, true);
}

lastFrameIndex = frame;
}
}
``````

EDIT: I just saw 2017.1 has a feature that enables emit over distance for local simulations. Iâ€™m going to give that a try to see if it fixes my issue.

EDIT 2: that didnâ€™t work either

Hey,

You have Auto Random Seed enabled.
This means a new random seed is generated every time the system is restarted. Uncheck it

Also, to rewind, use the Restart param in Simulate and enter the absolute playback time as the time param. Doing this means you donâ€™t need the call to Clear.

When simulating forwards, set Restart to false, and just use the time you want to jump forwards by, as the time value.

1 Like

Not clearing the system totally worked! Thank you so much for the quick response. I realized I had forgot to turn off the AutoRandomSeed in script right after I posted that video, so thank you for finding the real problem despite my mistake

Hereâ€™s the working version:

Any idea why Clear made a difference though? When Clearing, it seems like the shape module gets new randomness values even if AutoRandomSeed is false.

1 Like

I would guess that restarting the system via Simulate is the most important bit. Iâ€™m not 100% sure though

Hi, I donâ€™t know if this is the right place for this question but well â€¦when i try to modify the strength of noise via script, it says Noise is not a variable â€¦ do you know a snippet for that ? this is what i do :
ParticleSystem.NoiseModule Noise = My_particles_System.GetComponent().noise;
Noise.strength.constant = 10;

thanks a lot !

1 Like

Hi Richard and Karl,

Sorry to bother you with another question, but the app we are building (Hands on with Windows 10's Story Remix, the new tool to make your photos pop | PCWorld) has been leading me to various dark corners of the particle system API

The current issue Iâ€™m running into is for selection. I want a more accurate way to select particle systems via raycasting against the mesh created by the particle system. To do this, Iâ€™d like access to all the meshes generated by the particle system (from mesh particles, billboard particles, stretched billboard particles, etc.) and then (while the user has paused the video) generate a combined mesh filter that includes all these meshes, then create a mesh collider out of that to perform the raycasting against. Perf isnâ€™t a huge problem, since Iâ€™ll only be doing this collider generation while the particle system is paused.

Do you know of a way that I can access the particle system rendererâ€™s meshes? I basically want to access what I can see in the Scene viewport when I have â€śShaded Wireframeâ€ť turned on, but I canâ€™t find an API to do that:

Iâ€™ve written a prototype where I iterate through ParticleSystem.GetParticles and create billboarded meshes for each particle by hand. However, taking all the different rotations/scales/positions/nested particles/trails/etc. that the Particle System module creates into account sounds very difficult. Hereâ€™s what I have so far:

Is there an easier way via some API to access these meshes?

Thank you very much,
John

Hey,

There is nothing currently available to do whatâ€™s youâ€™re asking for.

@richardkettlewell

Thanks for the response! glad to know Iâ€™m not wasting time writing this script as a short term solution Itâ€™s really awesome being able to talk directly to the particle system devs

Just curious - where is the vert data stored? is it part of ParticleSystemRenderer but just not accessible?

It is generated dynamically on each frame so it only ever exists temporarily (kinda like if you draw something with the GL script API).

To expose it, we could create a script function that runs the code to generate the vert data, but pipe it into a mesh, rather than drawing it, perhaps.

@richardkettlewell

Hi Richard,

It definitely wasnâ€™t easy, but I got something working for collision - it works for most cases. The idea is to duplicate the system as a mesh, particle by particle, and apply all the position/rotation/scaling/material/texture edits that particle system would. It currently supports

• Any simulation mode
• Any scaling mode
• Nested particles
• Texture sheet animations
• Any particle scaling
• Any rotation
• Pivots
• Mesh particles
• 2 sided billboard particles

The RawImage in the upper left shows the color value from the raycast (doesnâ€™t currently include ParticleSystem color modifications from StartColor or Color over Lifetime) and the hits are logged to the Console. You can add an alpha cutoff to avoid raycasting against transparent parts of particles. Raycasting is only performed if the particle system is paused (via the buttons in the custom inspector for my script).

Itâ€™s missing functionality for collision with the Trails module since iâ€™m not sure how to get the billboarded vert data from the TrailRenderer either. 3D scaling also seems to break my pivot logic.

It works well enough though!

Thanks for the help,
John

1 Like