Fog Sheet and Light Beams

Choose your OS:

FogSheetLightBeams.png

The Fog Sheet and Light Ray Blueprints serve as an example of using Blueprints to create atmospheric effects for use in level design. Arranging translucent Static Meshes such as planes of fog and beams of light when decorating a level tends to be time-consuming, and so the purpose of these blueprints is to make the process easier while giving the user more control over the appearance of these meshes.

Relatively simple in setup, these assets still provide a wide range of customizability, including color, brightness, and size. Artists also have control over the panning speed of the fog texture, and the range at which the fog will fade out, which prevents players from noticing the sheet effect.

Fog Sheet

FogSheet.png FogSheetDetails.png

The Fog Sheet Blueprint, shown above, consists of a Static Mesh plane with a cloudy fog Material applied to it. If you open the network in the Blueprint Editor, you will see that most of the setup is done in the Construction Script.

Each of the three aspects of the Blueprint (i.e. the Components List, the Construction Script, and the Event Graph) are responsible for a different part of the overall effect. The following table breaks down the jobs for each aspect and how they work together to create the final result.

Blueprint Setup

Blueprint Aspect

Purpose

Components List

The only Component created within the Components List is a single Billboard Component, which provides only a selectable icon. This is used for placement in the level.

Construction Script

The Construction Script performs the following tasks:

  • Create the sheet geometry using a Static Mesh.

  • Read the placement of the Size variable and use it to scale the Static Mesh appropriately.

  • Create a Material Instance Dynamic (MID) for the sheet geometry and apply it.

  • Gather settings data for the Material from the exposed Details panel properties, apply them to the Material.

Event Graph

This Blueprint has no Event Graph, meaning that once its properties are set, it remains the same throughout gameplay.

Of particular importance in this effect is the creation of the Material Instance Dynamic (MID for short) in the Construction Script. A MID is parameterized Material that is set up in such a way that it can be edited during gameplay.

MIDNodeNetwork.png

Editable Variables

The exposed (Editable) variables give designers control over the following properties of the Material:

BPVariables_FogSheet.png MaterialProperties_FogSheet.png

Property

Purpose

Materials

Color

The color of the fog effect.

Brightness

Brightness applied to the fog color.

Opacity

How well the fog can be seen through.

Depth Fade Distance

Controls the distance away from intersecting geometry that the effect will fade. This prevents harsh cuts along walls and other surfaces.

Noise Projection Distance

Provides a depth offset for fog noise.

Noise Size

This is similar to tiling - the higher the value, the fewer tiles of the noise texture.

Panning Speed

How quickly the noise texture pans across the fog surface.

Fade Distance

The distance between the player and the effect at which the fog fades as the player approaches. This prevents the player from noticing the sheet geometry.

BP Fog Sheet

Size

This controls the size of the sheet mesh used to display the fog sheet.

The Size variable is particularly interesting in that it has had its 3D Widget enabled. The 3D Widget is a feature available only to vector variables, and creates a visible object in the Viewport that can be manipulated to change the 3D vector value.

3DWidget.png

Since a 3D Widget is simply a mechanism for controlling a Blueprint variable, the widget is only visible when it is associated Blueprint is selected. The widget can then be selected and moved using the standard Move tool. This provides a designer with a quick way of changing a vector value.

In this case, the 3D Widget is employed to allow for quick resizing of the fog sheet geometry plane. The upper right corner of the mesh meets the location of the 3D Widget, and the sheet as a whole scales from the center, where the Blueprint's sprite icon is located.

Light Beam

LightRayBp.png

The Light Beam Blueprint is very similar in nature to the Fog Sheet, except that it is set up so that it can follow the rotation of a given light source and uses a slightly different Material setup. It also has no Event Graph, as all of its calculation takes place in the Construction Script.

Blueprint Setup

The Components List, Construction Script, and Event graph for this Blueprint perform the following tasks:

Blueprint Aspect

Purpose

Components List

The only Component created within the Components List is a single Billboard Component, which provides only a selectable icon. This is used for placement in the level.

Construction Script

The Construction Script performs the following tasks:

  • Create the sheet geometry using a Static Mesh.

  • Read the Length and Width variables and use them to scale the Static Mesh appropriately.

  • Create a Material Instance Dynamic (MID) for the sheet geometry and apply it.

  • Determine whether to follow the rotation of a light source, and if so, rotate the geometry accordingly.

  • Determine which shape (parallel for Directional Lights or conical for Spot Lights) to use for the profile, and swap out the material mask texture appropriately.

  • Gather settings data for the Material from the exposed Details panel properties, apply them to the Material.

Event Graph

This Blueprint has no Event Graph, meaning that once its properties are set, it remains the same throughout gameplay.

Editable Variables

Since this Blueprint is primarily a level design tool, most of its functionality takes place within the Construction Script. Below are the exposed variables that drive the behavior within the Construction Script:

LightRay_Variables.png LightRay_Properties.png

Property

Purpose

Light Beam

Light

This gets populated with the light source that you want the light beams to follow.

Width

Controls the width of the light beam sheet.

Length

Controls the length of the light beam sheet.

Color

Controls the color of the light beam.

Brightness

A brightness factor that is applied to the light beam color.

Fade Distance

The distance between the player and the effect at which the light beam fades as the player approaches. This prevents the player from noticing the sheet geometry.

Animated

Whether the light beam material is animated; this provides the shimmering effect within the beam.

Spot Light

If unchecked (false), the sheet uses a parallel shape for a Directional Light. If checked (true), it uses a cone shape for a Spot Light.

Use Light For Rotation

Whether the light follows the rotation of the Light Actor specified in the Light property, or if it can be rotated independently.