Skip to content

Component Icon Volumetric Light Beam Component

The VolumetricLightBeam component is the main component of the plugin. It can be attached to any GameObject.

Inspector Beam


Basic

Color

Use the combobox to specify if you want to apply a Flat/Plain or a Gradient color.

Flat

Use the color picker to set a plain color (takes account of the alpha value).

If attached to a Spotlight, toggle the From Spot Light button button next to this property to get the same value than the Color Light's property.

Tip about HDR

You can specify an HDR color value. If your camera allows HDR, it's possible that the light beams look more transparent. In this case, increase the Current Brightness in the HDR color picker to make them look more opaque.

Gradient

Apply a gradient along the light beam. The color and alpha variations will be applied.
Color Gradient

Gradient accuracy

When applying gradients with a lot of color changes, you might need to increase the mesh's Segments tesselation in order to have a better rendering accuracy, or you can also set the Shader Accuracy to High.

Blending Mode

Change how the light beam colors will be mixed with the scene. More info about Blending Mode here.

  • Additive: highly recommended blending mode. Gives the best results when using bright colors.
  • Soft Additive: softer additive (bright colors will appear dimmed).
  • Traditional Transparency: use this only if you want to have beams with dark/black colors.
Additive Soft Additive Traditional Transparency
Additive Soft Additive Traditional Transparency

Intensity

Global beam intensity. If you want to control values for inside and outside independently, use the advanced mode.

If attached to a Spotlight, toggle the From Spot Light button button next to this property to get the same value than the Intensity Light's property.

Advanced

When enabled, controls the inside and outside intensity values independently.

Intensity (outside)

Advanced Mode only: controls the Beam outside intensity (when looking at the beam from behind).

Intensity (inside)

Advanced Mode only: controls the Beam inside intensity (when looking at the beam from the inside directly at the source).

Spot Angle

Define the angle (in degrees) at the base of the beam's cone.

Angle 25 Angle 45 Angle 90
25 degrees 45 degrees 90 degrees

If attached to a Spotlight, toggle the From Spot Light button button next to this property to get the same value than the Spot Angle Light's property.

Side Thickness

Thickness of the beam when looking at it from the side.

  • 1.0 = the beam is fully visible with hard edges.
  • Lower values produce softer transition at beam edges.
Thickness 0.0 Thickness 0.75 Thickness 1.0
0.0 0.75 1.0

Tip

If you set the lowest possible value and want to make the beam even thinner, just lower the Spot Angle and/or the Truncated Radius properties.

Glare (frontal)

Boost intensity factor when looking at the beam from the inside directly at the source.

Glare Frontal Glare Frontal
0.0 1.0

Glare (from behind)

Boost intensity factor when looking at the beam from behind.

Glare Behind Glare Behind
0.0 1.0

Shader Accuracy

  • Fast: a lot of computation are done on the vertex shader to maximize performance.
  • High: most of the computation are done on the pixel shader to maximize graphical quality at some performance cost.

We recommend to keep the default Fast Shader Accuracy to ensure best performance, except when using the Gradient Color or the Tilt Factor features.

Track Changes During Playtime

If true, the light beam will keep track of the changes of its own properties and the spotlight attached to it (if any) during playtime. This would allow you to modify the light beam in realtime from Script, Animator and/or Timeline.

Track Changes During Playtime
With trackChangesDuringPlaytime = true

Enabling this feature is at very minor performance cost. So keep it disabled if you don't plan to modify this light beam during playtime.

Limitation

Once enabled, you can change at runtime every properties of the VolumetricLightBeam component expect Cap Geom and Sides: they would require to regenerate the beam mesh, which would be too performance intensive.


Attenuation

Equation

Attenuation equation used to compute fading between Fade Start Distance and Range Distance.

  • Linear: Simple linear attenuation.
  • Quadratic: Quadratic attenuation. Since this is the way light behaves in real life, this usually gives more realistic results than the linear attenuation.
  • Blend: Custom blending mix between linear and quadratic attenuation (can be customize using a slider).
Attenuation Linear Attenuation Blend 0.5 Attenuation Quadratic
Linear Blend (factor 0.5) Quadratic

Range Distance

Maximum distance (in units) of the light beam. After this distance, the beam is entirely faded out.

If attached to a Spotlight, toggle the From Spot Light button button next to this property to get the same value than the Range Light's property.

You can control this value from script using the fallOffEnd property.

Fade Start Distance

Distance from the light source (in units) the beam intensity will start to fall off.

Fade Start Fade Start Fade Start
0% 25% 50%

You can control this value from script using the fallOffStart property.

Tilt Factor

Tilt the color and attenuation gradient compared to the global beam's direction.

Tilt Off Tilt On
Tilt Off Tilt Y = 0.75 (with High Shader Accuracy)

This feature should be used with High Shader Accuracy mode.


3D Noise

3D Noise is a feature to simulate animated volumetric fog / mist / smoke effects. It makes the volumetric lights look less "perfect" and so much more realistic.
To achieve that, a tiled 3D noise texture is internally loaded and used by the beam shader.

3D Noise off 3D Noise on
3D Noise OFF 3D Noise ON

Platform specific

3D Noise feature requires shader capabilities equal or higher than Shader Model 3.5 / OpenGL ES 3.0. Any mobile devices released after 2012 should support it.

If you want to test the 3D Noise compatibility from the Unity's editor, or if the effect is not visible in the scene view, please change the editor's graphics emulation for a more capable one via 'Edit/Graphics Emulation' menu and press Play to force the light beams to be recomputed.
Graphics Emulation

Enabled

Enable or disable the 3D Noise effect and select the mode. The mode you select will change how the noise will look when the beam is moved in realtime.

  • Disabled: 3D Noise effect is disabled.
  • Enabled World Space: when moving your beam, the noise will look "grounded" in the world.
  • Enabled Local Space: when moving your beam, the noise will look "tied" to the beam.

Intensity

Higher intensity means the noise contribution is stronger and more visible.

Noise Intensity Noise Intensity Noise Intensity
0.0 (disabled) 0.5 1.0

Scale

3D Noise texture scaling. Higher scale makes the noise more visible, but potentially less realistic because the texture tiling could become more apparent.

Noise Scale Noise Scale Noise Scale
0.4 0.8 1.4

If the toggle Use Global is checked, it will use the global Scale property set in configuration file.

Velocity

Vector3 property defining the direction (the direction of the vector) and speed (the magnitude of the vector) of the noise scrolling, simulating the fog/smoke movement.

Noise Velocity Noise Velocity
(0.05 ; 0.2 ; 0.05) (0.05 ; 0.05 ; -0.3)

If the toggle Use Global is checked, it will use the global Velocity property set in the configuration file.


Soft Intersections Blending Distances

Camera

Because the volumetric beams are rendered using cone geometry, it is possible for the camera to intersect with the geometry, which could produce unwanted artifacts. This property is designed to fix this issue. It specifies the distance between the beam geometry and the camera's near clip plane where the beam will start to fade, making a smoother transition.

  • 0.0: hard intersection with the camera's near clip plane.
  • Higher values produce soft intersection when the camera is near the cone geometry.
Blending Camera Blending Camera
0.0 0.25

Opaque Geometry

Distance from the world geometry the beam will fade with.

  • 0.0 (feature disabled): hard intersection but faster (doesn't require to update the depth texture).
  • Higher values produce soft intersection when the beam intersects world's geometry, but require to update the camera's depth texture.
Blending Opaque Geometry Blending Opaque Geometry
0.0 (feature disabled) 1.0 (feature enabled)

To support this feature, the rendering camera must use DepthTextureMode.Depth.
By default, the plugin will enforce this property to all cameras attempting to render a beam. If you want to disable this behavior for some reason, you can comment the following line in BeamGeometry.cs : #define FORCE_CURRENT_CAMERA_DEPTH_TEXTURE_MODE.

Depth banding artifacts

The quality of this feature is highly depended on the depth buffer precision. On platforms with low precision Z buffer such as mobile, you could experience visual glitches when enabling this feature. In this case, have a look at our Troubleshooting page.

Limitation

This feature is currently not supported and will be automatically disabled when rendering through:


Cone Geometry

Truncated Radius

Radius (in units) at the beam's source (the top of the cone).

  • 0.0 will generate perfect cone geometry (with a sharp apex).
  • Higher values will generate truncated cones.
Truncated Radius Truncated Radius
0.0 0.25

Increasing the Truncated Radius property will not increase the Spot Angle. This means that the cone's maximum radius is not dependent on the Truncated Radius property.

Cap Geom

Show the cap of the cone or not (only visible from the inside).

Cap Geom Cap Geom
Off On

Even if the Truncated Radius is 0.0, the Cap Geom property is still important to consider, since the Truncated Radius can be changed in realtime.

Mesh Type

  • Shared: Use the global shared mesh (recommended setting, since it will save a lot on memory). Will use the geometry properties set on configuration file.
  • Custom: Use a custom mesh instead. Will use the geometry properties set on the beam.

Custom Sides

(This property is only available when Mesh Type is Custom)
Number of Sides of the cone (tessellation). Higher values make the beam looks more "round".
The higher the value, the more memory and performance is required.
A recommended value for a decent quality while keeping the poly count low is 18.

Sides Sides
8 sides 32 sides

Custom Segments

(This property is only available when Mesh Type is Custom)
Number of Segments of the cone. Higher values give better looking results but more memory and performance would be required.
We recommend at least 3 segments, specially regarding Attenuation and Gradient, otherwise the approximation could become inaccurate.
The longer the beam, the more segments we recommend to set in order to keep good quality along the distance.
A recommended value for a decent quality while keeping the poly count low is 4.

Segments Segments
3 segments 8 segments

Having a high segment count could help smoothing the attenuation gradient over the distance and prevent possible color banding.

Segments Segments
low segments count (some color banding) high segments count (smooth gradient)

Skewing Factor

(This property is only available when Mesh Type is Custom)
Distort the beam's shape horizontally (X axis) and vertically (Y axis) while keeping its circular slice and gradient unchanged.

Skewing Off Skewing X
Skewing disabled Skewing factor X = 0.25

Fade Out

This feature is designed to fade out beams according to the distance to the camera. The further the beam will be located from the camera, the dimmer it will appear. When fully faded out, the beam is culled off and not rendered anymore to save on performance.
This computation is done at runtime only (not working in the Editor scene view) according to one camera only. This camera is retrieved using the tag specified in the Configuration.

Fade Out feature

Enabled

Enable the Fade Out feature.

Begin Distance

Fade out starting distance.
Beyond this distance, the beam intensity will start to be dimmed.

End Distance

Fade out ending distance.
Beyond this distance, the beam will be culled off to save on performance.


2D

The following properties are used to tweak and combine the order when beams are rendered with 2D objects (such as 2D sprites).

Dimensions

  • 3D: the beam is generated along the Z axis.
  • 2D: the beam is generated along the X axis, so you won't have to rotate it to see it in 2D.

We recommend to set this property at 2D when displaying a beam in a 2D scene:

  • You won't have to apply an extra rotation transformation to make the beam visible
  • The TriggerZone will generate a 2D Polygon Collider then

Sorting Layer

The layer used to define this beam's overlay priority during rendering with 2D Sprites.
This works the same way than the Sorting Layer property of the Sprite Renderer class.

Order in Layer

The overlay priority within its layer. Lower numbers are rendered first and subsequent numbers overlay those below.
This works the same way than the Order in Layer property of the Sprite Renderer class.