Raymarching Fog Environment

Render Engine: Unreal Engine 5

Production Time: 6 Weeks

Concept Reference: “Heavy Air” by Vladimiar Motsar

Link to ArtStation: Raymarching Fog

Link to Presentation: Volumetric Fog Techniques in UE5

Accomplishments and Techniques:

  • Created a custom raymarching fog shader using HLSL and visual scripting

  • Developed a tool that allows the user to paint volumetric materials by hand

  • Modeled landscape mesh in Blender before texturing with Subtsance Painter

  • Created detailed grass foiliage in Blender with an accompanying “windy” shader

Project Overview:

This is a game-ready UE5 environment I created based on the 2D concept "Heavy Air" by Vladimir Motsar. I wanted to tackle an environment art project with a heavy focus on shaders and lighting, and this proved to be the perfect opportunity. I created the piece over the course of 6 weeks as part of an Environment Art class at the University of Utah. Everything in the scene was created by myself, with the exception of the large stone models and their accompanying textures, which were freely licensed Quixel Megascan assets before being manipulated to suit my needs. Additionally, the custom fog shader utilizes a textxure sheet that was freely distributed by Enrique Ventura. Tools used include UE5, Blender, and Substance Painter.

Raymarching Fog:

The central focus of this piece is my custom-created raymarching fog shader that receives directional light and calculates its movement through a defined volume in order to determine density, hue, and light absorption at a determined number of points throughout the volume. The result is a remarkably thick, fluffy, and “physical” cloud of fog that appears far more substantial than the standard volumetric fog solutions within Unreal.

I was able to create this fog material with an Unreal shader graph that uses several custom nodes to define bounding boxes and display sprites at various levels of opacity. The custom node logic was written using HLSL, featured in the below images. The first snippet displays the shader graph, while the second snippet displays a script which uses the depth of the scene to determine what direction each sprite should be aligned to, and how thick they should be. The third snippet uses this plane alignment to calculate rays which march from the scene camera to the target volume in order to render the fog.

Volume Painting Tool:

My initial rendition of the fog shader had a notable weakness, in that it could only create a single shape from box volumes. I wanted to be able to unique create fog shapes, as seen in the final render. I was able to accomplish this by creating a custom tool which allows the user to freely “paint” fog within a defined bounding box. This painted area is rendered to a render target , which continually overrides the fog material. In addition, the user can “erase” fog, and even clear the entire material for a fresh start. This approach enabled me to create organic fog shapes to my exact liking. The below image displays two fog clouds. The right cloud uses the standard box volume, while the left was created with the painting tool.

The below images display snippets of both the custom paintbrush tool, as well as the painted fog material, which builds off the previously shown fog shader graph. The paintbrush tool works by establishing a radius several units in front of the current editor camera, and allowing the user to hold down the left mouse button to “mark” that position as being painted. This is visualized using a debug sphere that is drawn in the brush position each frame. The fog shader and paintbrush tool were created with the help of Enrique Ventura and Ryan Brucks, whose tutorials can be found here:
https://www.youtube.com/watch?v=eDYyBc3cRmw
https://shaderbits.com/blog/ue4-volumetric-fog-techniques

Unreal Fog Presentation:

To go along with my environment, I put together a slideshow presentation that explores UE5’s various fog solutions. Modern engines have grown so feature-heavy that it can be easy to use the same tools for years without understanding their many settings, and this project opened my eyes about the depth of customization available even for something as seemingly simple as volumetric fog. The slideshow is embedded below, and explains the purpose of each editable value when creating different typse of fog, along with examples images that I created in a blank UE5 scene.

Swaying Grass Shader:

Each blade of grass featured in the environment was pulled from a pool of models that I created in Blender, as featured below. I started by creating flat planar meshes before giving each blade a loop cut down the middle and pulling it forward on the Z axis for an appearance of depth. I then vertex painted the blades with a vertical gradient that awarded a value of 1 to the tips and a value of 0 to the roots. I also quickly baked out an ambient occlusion and nomral map for each blade to be used later in the shading process. Finally, I duplicated and arranged the blades in a handful of grass clumps that could be exported to Unreal as combined meshes.

Wrapping Up:

My favorite aspect of technical art is developing functional solutions to interesting problems, which this project provided plenty of! I chose Vladimir’s concept because I knew it would provide both a steep challenge as well and an excellent opportunity for expanding my professional skillset as both an artist and engineer. I am happy to be walking away from the project with a far deeper understanding of UE5’s shader graph, visual scripting, and fog systems.
"Heavy Air" can be viewed here.

Once the models were in Unreal, I began work on a swaying grass shader to mimic the look of foliage blowing in the wind. This shader utilizes the painted vertex weights to shake each blade of grass most powerfully at the tip while keeping the root in place. I was able to accomplish this effect with the help of the “SimpleGrassWind” node, which takes intensity, weight, speed, and world position offset as arguments and produces a wind-like shimmering offset as a result. I also added a simple albedo gradient function that blends between a top and bottom color using a lerp node.

Next
Next

Lizard Character Creator Rig