Adding Volumetric Lights with Fog
Objective: A brief look at what volumetric lighting is, and how to add lights with volumetric fog in Unity HDRP.
What is Volumetric Lighting
Volumetric Lighting may sound complicated, but it’s a lot simpler than you might think. If we break down the concept, the first thing we get is volume, which refers to the amount of space an object can take in a given area. As for metric, we can think of it as the measurement of said volume. Now, you don’t have to worry about measuring anything, this is simply to give you a ground basis on why we call it Volumetric Lightweight.
Volumetric lighting, in its simplest form, is an illusion produced when a lighting technique indicates a certain perspective or impact that heightens the perception of volume in a specific area — that is to say, the perception that light is actually interacting with the environment making it feel alive. An example would be dust particles being made visible by a light source.
This is our go-to method to make lighting feel like it truly inhabits a 3D space rather than feeling like an object that’s just placed there without any environmental feedback. This technique is especially strong when used in conjunction with steam or wispy and uniform particles like fog or mist.
How To add Volumetric light with Fog Use gifs
Volumetric lighting is a feature in the High Definition Render Pipeline (HDRP), which renders volumetric fog. This system also includes a lighting system that enables all Scene elements to interact with the fog and make it volumetric.
The following example will demonstrate how I created volumetric light with fog for a street light.
Note: Remember you should be in an HDRP project template to do this.
- Let’s start by adding a Point Light. As of now, only Point Lights and Spotlights can benefit from the volumetric fog. Here, I added the Point Light as a child of a Street Light object because I mean to make it part of its light source.
2. Create a Global Volume.
then add a fog override to it.
Make sure all the following boxes are checked.
3. Adjust the multiplier on your Point Light’s Volumetric parameter until you’re content with the visual. As you can see, the fog is already visibly affecting our light source.
6. This effect can be even more visible with a Spotlight, I decided to duplicate my Point Light and change its type to Spotlight. Now, this completes my light sources for the Street Light object — the point light is essentially the lightbulb and the Spotlight is the beam casting down.
I was initially demonstrating the volumetric light at the control room level I have been working on, but with the use of Filebase I put together this little foggy scene. I adjusted the outer angle of the Spotlights to give it a softer fade.
Thank you for your time! If you found this information valuable give me a follow! :) I document my learning journey into Unity Development and Software Engineering in the form of tutorials!