Skip to main content

Overview

Volumetric shaders create visible light beams and cones by rendering transparent meshes with sophisticated noise and gradient effects. These shaders are the most computationally intensive part of the VR Stage Lighting system and include multiple quality modes for performance optimization.

Shader Paths

DMX Control

  • VRSL/Standard Mover/Volumetric
  • VRSL/Wash Mover/Volumetric
  • VRSL/AudioLink/Standard Mover/Volumetric
  • VRSL/AudioLink/Wash Mover/Volumetric

Core Volumetric Properties

Quality Modes

_HQMode
bool
default:"false"
Enable high quality volumetric mode (experimental). Uses _NoiseTexHigh instead of _NoiseTex for better visual quality.
_PotatoMode
bool
default:"false"
Performance mode that disables noise sampling and extra texture reads. Significant performance boost at the cost of visual quality.
_UseDepthLight
bool
default:"true"
Requires depth light to function. When disabled, volumetric will render without depth fade.

Textures

_LightMainTex
texture
default:"white"
Main light texture for the volumetric cone. Typically a radial gradient.
_NoiseTex
texture
default:"white"
Standard quality noise texture for volumetric distortion.
_NoiseTexHigh
texture
default:"white"
High quality noise texture used when _HQMode is enabled.

Noise Configuration

_MAGIC_NOISE_ON_HIGH
bool
default:"true"
Enable high quality magic noise effect.
_MAGIC_NOISE_ON_MED
bool
default:"true"
Enable medium quality magic noise effect.
_2D_NOISE_ON
bool
default:"true"
Enable 2D noise texture sampling.
_NoisePower
float
default:"1"
Base noise strength/intensity.
_NoiseSeed
float
default:"0"
Random seed value for noise variation.

Magic Noise Settings

Magic noise creates dynamic, animated 3D noise patterns. Three quality presets are available:

High Quality Mode

_Noise2Stretch
float
default:"1"
Outside magic noise scale (high quality).
_Noise2StretchInside
float
default:"1"
Inside magic noise scale (high quality).
_Noise2X
float
default:"1"
Magic noise X axis scroll speed (high quality).
_Noise2Y
float
default:"1"
Magic noise Y axis scroll speed (high quality).
_Noise2Z
float
default:"1"
Magic noise Z axis scroll speed (high quality).
_Noise2Power
float
default:"1"
Magic noise strength (high quality).

Default Mode

_Noise2StretchDefault
float
default:"1"
Outside magic noise scale (default quality).
_Noise2StretchInsideDefault
float
default:"1"
Inside magic noise scale (default quality).
_Noise2XDefault
float
default:"1"
Magic noise X scroll (default quality).
_Noise2YDefault
float
default:"1"
Magic noise Y scroll (default quality).
_Noise2ZDefault
float
default:"1"
Magic noise Z scroll (default quality).
_Noise2PowerDefault
float
default:"1"
Magic noise strength (default quality).

Potato Mode

_Noise2StretchPotato
float
default:"1"
Outside magic noise scale (potato quality - typically unused).
_Noise2StretchInsidePotato
float
default:"1"
Inside magic noise scale (potato quality - typically unused).
_Noise2XPotato
float
default:"1"
Magic noise X scroll (potato quality).
_Noise2YPotato
float
default:"1"
Magic noise Y scroll (potato quality).
_Noise2ZPotato
float
default:"1"
Magic noise Z scroll (potato quality).
_Noise2PowerPotato
float
default:"1"
Magic noise strength (potato quality).

Intensity and Fade

_FixtureMaxIntensity
float
default:"1"
Maximum cone intensity. Higher values create brighter, more visible volumetric beams.
_FadeStrength
float
default:"1"
Edge fade strength. Controls how sharply the cone edges fade out.
_InnerFadeStrength
float
default:"0"
Inner fade strength. Creates a hollow cone effect when increased.
_InnerIntensityCurve
float
default:"1"
Curve for inner intensity falloff.
_DistFade
float
default:"0.1"
Distance-based fade. Cone fades at distance.
_FadeAmt
float
default:"0.1"
Depth blending amount. Controls soft particle intersection with geometry.

Blinding Effect

_BlindingStrength
float
default:"1"
Strength of the blinding/bloom effect when looking into the light.
_BlindingAngleMod
float
default:"1"
Angle modifier for blinding effect. Adjusts viewing angle sensitivity.

Gradient Controls

_GradientMod
float
default:"2.25"
Gradient modifier for solid beams (no GOBO).
_GradientModGOBO
float
default:"2.25"
Gradient modifier when GOBO is active.

GOBO Beam Splitting

Creates stripe effects in the volumetric cone for different GOBO patterns:
_GoboBeamSplitEnable
bool
default:"false"
Enable beam splitting for GOBOs 2-8.
_StripeSplit
float
default:"0"
Stripe split frequency for GOBO 2.
_StripeSplitStrength
float
default:"0"
Stripe split intensity for GOBO 2.
_StripeSplit2
float
default:"0"
Stripe split frequency for GOBO 3.
_StripeSplitStrength2
float
default:"0"
Stripe split intensity for GOBO 3.
_StripeSplit3
float
default:"0"
Stripe split frequency for GOBO 4.
_StripeSplitStrength3
float
default:"0"
Stripe split intensity for GOBO 4.
_StripeSplit4
float
default:"0"
Stripe split frequency for GOBO 5.
_StripeSplitStrength4
float
default:"0"
Stripe split intensity for GOBO 5.
_StripeSplit5
float
default:"0"
Stripe split frequency for GOBO 6.
_StripeSplitStrength5
float
default:"0"
Stripe split intensity for GOBO 6.
_StripeSplit6
float
default:"0"
Stripe split frequency for GOBO 7.
_StripeSplitStrength6
float
default:"0"
Stripe split intensity for GOBO 7.
_StripeSplit7
float
default:"0"
Stripe split frequency for GOBO 8.
_StripeSplitStrength7
float
default:"0"
Stripe split intensity for GOBO 8.

Animation

_PulseSpeed
float
default:"0"
Speed of intensity pulse animation.

Rendering Properties

_RenderMode
enum
default:"1"
Volumetric rendering mode:
  • 0: HQTransparent - Best quality, most expensive
  • 1: Transparent - Standard transparency
  • 2: AlphaToCoverage - MSAA-based transparency
_BlendDst
enum
default:"1"
Destination blend mode. Typically set to One for additive blending.
_BlendOp
enum
default:"0"
Blend operation.
_ZWrite
bool
default:"false"
Depth buffer writing. Always false for volumetrics.
_AlphaToCoverage
bool
default:"false"
Enable alpha to coverage mode.

Performance Optimization

Quality Levels

High Quality - Best visuals, lowest performance:
_HQMode = true
_PotatoMode = false
_MAGIC_NOISE_ON_HIGH = true
_MAGIC_NOISE_ON_MED = true
_2D_NOISE_ON = true
Standard Quality - Balanced:
_HQMode = false
_PotatoMode = false
_MAGIC_NOISE_ON_HIGH = false
_MAGIC_NOISE_ON_MED = true
_2D_NOISE_ON = true
Performance Mode - Best performance:
_HQMode = false
_PotatoMode = true
_MAGIC_NOISE_ON_HIGH = false
_MAGIC_NOISE_ON_MED = false
_2D_NOISE_ON = false

Shader Variants

The volumetric shader compiles multiple variants:
  • _MAGIC_NOISE_ON_HIGH - High quality noise
  • _MAGIC_NOISE_ON_MED - Medium quality noise
  • _USE_DEPTH_LIGHT - Depth-based effects
  • _POTATO_MODE_ON - Performance mode
  • _HQ_MODE - High quality mode
  • _2D_NOISE_ON - 2D noise sampling
  • _ALPHATEST_ON - Alpha testing
Total possible combinations: 128 variants

Optimization Tips

  1. Reduce Cone Length: Shorter cones have less overdraw
    • Use _ConeLength and _MaxConeLength conservatively
  2. Simplify Noise: Disable unused noise features
    • Turn off _MAGIC_NOISE_ON_HIGH if not needed
    • Use _PotatoMode on low-end hardware
  3. Limit Fixture Count: Volumetrics are expensive
    • Consider using fewer fixtures with higher intensity
    • Disable volumetrics for background/ambient lights
  4. Adjust Fade Settings: Reduce visibility distance
    • Lower _DistFade for shorter render distance
    • Increase _FadeStrength for sharper edges (less translucency layers)
  5. Use Lower Resolution: If using render textures
    • Render volumetrics to lower resolution RT
    • Upscale for final composite

Technical Details

Vertex Shader Calculations

The vertex shader pre-calculates:
  • Blinding effect based on view angle
  • Camera angle and fade
  • Stripe/split information
  • Cone width
  • World direction for depth correction
  • Intensity, strobe, GOBO selection, and spin speed
  • RGB color values

Fragment Shader Operations

The fragment shader performs:
  • Multi-layer noise sampling (2D + 3D magic noise)
  • Depth texture reading for soft particles
  • UV-based gradient calculations
  • GOBO stripe splitting
  • Edge fade calculations
  • Color blending and saturation
  • Mirror depth correction

Performance Characteristics

Vertex Shader: Lightweight
  • Simple position transforms
  • Minimal branching
  • Instanced property access
Fragment Shader: Heavy
  • Up to 3 texture samples per pixel (in HQ mode):
    • _LightMainTex
    • _NoiseTex or _NoiseTexHigh
    • _CameraDepthTexture
  • Complex noise calculations
  • Distance-based fade calculations
  • High overdraw on large cones

Depth Fade Implementation

Soft particle intersection uses depth comparison:
float sceneZ = LinearEyeDepth(SAMPLE_DEPTH_TEXTURE_PROJ(
    _CameraDepthTexture, UNITY_PROJ_COORD(i.screenPos)));
float partZ = i.screenPos.z;
float fade = saturate((sceneZ - partZ) / _FadeAmt);
This creates smooth transitions where volumetric cones intersect geometry.
_RenderTextureMultiplier
float
default:"1"
Multiplier for render texture intensity when using AudioLink.
_UseTraditionalSampling
bool
default:"false"
Use traditional texture sampling instead of AudioLink-specific sampling.
_IntersectionMod
float
default:"1"
Intersection modification for AudioLink mode.

See Also

Build docs developers (and LLMs) love