Particles …

We had been operating on the assumption that many particles would slow down the frame rate, so just to make sure, I created a particle system to replicate the fog and tried it out.  I was able to create 60 000 particle fog with no real detriment to the frame rate.

Base frame rate for the scene .. range between 73 and 93 fps.

Base frame rate for the scene .. range between 73 and 93 fps.

Particle system running 60 000 particles with frame rate ranging between 80 and 93 fps.

Particle system running 60 000 particles with frame rate ranging between 80 and 93 fps.

I was hoping that there would be more editable factors from script, in the Shuriken Particle System in Unity, but that was not the case.  There is very little that can be edited from a script.  I was hoping that I would be able to control the size of the emitter by changing the radius of the circle.  This would allow for the slow decreasing of the fog in toward the player’s position.

While scrolling through the “Shape” option, I came across using a mesh for the emitter.  I created a circular mesh that was deformed, but when applied, I still couldn’t make any changes to the mesh as it was now embedded into the particle system.

What I did then was to attach the component for the Particle System and replicate the settings.  This gave me the opportunity to slowly rotate the particle effects so that it wasn’t a constant visual image and to also decrease the local scaling of the emitter so that it closed in on the players.

Particles emitting from a mesh and slowly revolving and scaling in towards the player

Particles emitting from a mesh and slowly revolving and scaling in towards the player

This is my first time using the Shuriken system however I have used the Legacy Particles in previous projects.  I set the duration of the clip for 30 seconds so that it wouldn’t appear so regular and having regular patterns seen by the players.  It is also set to looping because once it is on, it is going to stay on.  For the purposes of setting the particle system up, I also used pre-warm, but I am seriously considering using that setting when applying it in our game because it looks like crap when is starts off.

 

The start speed is set very low at 0,02 because it is a slow moving fog.  The start lifetime is set at 10 and this gives the height of the effect.  I have also set a large particle size because I want it to be seen from a distance and I wanted to block out as much of the background as I could.

To try and make the fog rolling, I set the initial rotation and it is rotating all the way through the particles life.\

There is a slight negative gravity so that the particles slowly rise into the air and they inherit 50% of the rotating velocity from the mesh.

I have also set the size of the particles to quickly fall to zero near the end of their life.  I believe that this also helps to give the impression of the fog rolling and seeming to rise up and roll over into the background.

This is by no means finished as far as the final fog will go but it is certainly enough for proof of concept and will suffice until the polish stage of the project.

The other thing I am considering is I am currently using a vertical ring shaped mesh and I would like to change it to a thin horizontal ring shaped mesh.  This will give me greater control to manipulate the mesh through script and try to follow the contours of the terrain when it has been modeled.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s