Creating Fog and Using Particles in Unity3D and the URP

While Unity’s Universal Render Pipeline doesn’t offer the same volumetric fog as the High Definition Pipeline, you can still get some really nice looking fog using the particle system.

I am going to use a fog prefab from GameDevHQ’s asset library called Filebase. This asset uses Unity’s particle system alongside some smokey art assets to help upgrade the feel of this game environment.

To get started, I bring Filebase into my assets folder and then open it up inside Unity. Here I scroll through a variety of pre-made particles to import into my game scene. Once I find the Fog, I can download and install it. It is as easy as it sounds!

Now in the Assets folder, There is a GameDevHQ folder containing Filebase. Down in VFX>Particles>Environment, the prefab for the Fog can be found with it’s associated Material and Texture.

Simply drag and drop the fog prefab from the Assets folder into the Hierarchy.

The fog prefab can be moved into a desired position using the move tool.

You might see a moving red outline while the fog particle system animates. This can be disabled by selecting the drop-down arrow on the Gizmos, and then un-ticking the Selection Outline.

Now the fog animation can be viewed without the selection outline!

It is subtle and slow moving with my current settings, but here is a view from farther away. A little fog adds a lot of atmosphere!

This fog prefab is using a legacy shader, and I am using Unity 2020. I can select the Smoke material in the Assets folder, and then change the Shader to Universal Render Pipeline>Particles>Unlit.

If your fog suddenly becomes this pixelated disaster, fear not!

When updating the shader from the legacy version to the URP version, the Smoke Texture assignment was lost along the way. This is the image that will make the particles look like smoke!

Select the Smoke Material, and then drag the Smoke texture from the texture folder into the Base Map on the material to assign it.

The last thing to do before the smoke will appear again properly, is to change the Surface Type to Transparent.

There are a seemingly overwhelming amount of option when it comes to the particle system. I think the best way to get familiar with the particle system is really just to play with the controls and see how it reacts. For my purposes here, I will be increasing the values of the Start Speed slightly, as well as bumping up the Start Size a few notches to get more fog rolling!

Each of these options has a drop-down of it’s own with even more options to tweak. The rabbit hole goes deep when it comes to fine tuning a particle system for a specific look.

As for this article, I am happy with the simple slow fog movement as it adds some nice creepy atmosphere to the scene.

Please join me in my next article where I add reflections into the game scene. Thanks for reading!

--

--

--

I am an artist and musician, that is currently diving headfirst into game development with C# and Unity3D.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Softinio’s Notes on Software Engineering — Issue #3

The Quickest Way to Install Conda Environment as Jupyter Kernel

How to use Azure self-hosted Agent

Gradually improving our code quality with Test::Perl::Critic::Progressive

Game Dev Digest Issue #86 — Awesome Effects

{UPDATE} Hen Racing Simulator - Race Free Range Chickens Hack Free Resources Generator

Creating New Enemy Types: The Porcupine Blowfish Part 2 — Movement using a Sine Wave

Apache Spark Scala: round() doesn't always round()

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Jared Amlin

Jared Amlin

I am an artist and musician, that is currently diving headfirst into game development with C# and Unity3D.

More from Medium

Using Reflection Probes in Unity3D and the URP

Adding Emissions to Custom Textures

Importing Character Models and Animations from Mixamo into Unity

More Productive Editor Layout in Unity