Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/AcChosen/VR-Stage-Lighting/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Static light shaders provide fixed-position stage lighting effects including projection mapping and realistic lens flares. These lights don’t include pan/tilt mechanics but offer the same projection and color control as moving lights.

Shader Paths

DMX Control

  • VRSL/Standard Static/Projection
  • VRSL/Standard Static/Lens Flare
  • VRSL/AudioLink/Standard Static/Projection
  • VRSL/AudioLink/Standard Static/Lens Flare

Projection Shader Properties

DMX Configuration

_DMXChannel
int
default:"0"
DMX fixture number/sector. Each static light uses 13 channels in standard mode or 5 channels in 5CH mode.
_NineUniverseMode
bool
default:"false"
Enable extended universe mode for up to 9 DMX universes.
_EnableDMX
bool
default:"false"
Enable DMX control via render texture.
_ChannelMode
enum
default:"0"
Channel mode:
  • 0: 13CH - Full control (13 channels)
  • 1: 5CH - Simplified control (5 channels: intensity + RGB)
_EnableCompatibilityMode
bool
default:"false"
Enable legacy DMX grid reading compatibility.
_EnableVerticalMode
bool
default:"false"
Switch to vertical DMX grid layout.

Intensity and Color

_FinalIntensity
float
default:"1"
Final intensity multiplier for the light output.
_GlobalIntensity
float
default:"1"
Global intensity shared across all fixtures.
_GlobalIntensityBlend
float
default:"1"
Blend between local and global intensity.
_UniversalIntensity
float
default:"1"
Universal scene intensity multiplier.
_Emission
color
default:"(1,1,1,1)"
Light color tint (HDR). Multiplied with DMX RGB values.
_FixtureMaxIntensity
float
default:"1"
Maximum light intensity output.
_RedMultiplier
float
default:"1"
Red channel multiplier for color correction.
_GreenMultiplier
float
default:"1"
Green channel multiplier.
_BlueMultiplier
float
default:"1"
Blue channel multiplier.

Projection Settings

_ProjectionMainTex
texture
default:"white"
GOBO texture for projection pattern.
_ProjectionMaxIntensity
float
default:"1"
Maximum projection intensity. Higher values create brighter projections.
_XOffset
float
default:"0"
Horizontal offset for projection in world space.
_YOffset
float
default:"0"
Vertical offset for projection in world space.
_ProjectionRange
float
default:"0"
Drawing range for projection. Scales the projection mesh.
_ProjectionRangeOrigin
vector
default:"(0, -0.07535, 0.12387, 0)"
Origin point for projection range scaling.
_ProjectionDistanceFallOff
float
default:"1"
Attenuation constant for distance-based falloff.
_Fade
float
default:"1"
Light range/falloff distance.
_FeatherOffset
float
default:"1"
Attenuation quadratic factor. Controls falloff curve.
_ProjectionUVMod
float
default:"0"
UV scale modifier for projection. Adjusts GOBO size.
_ModX
float
default:"1"
Projection UV X axis stretch.
_ModY
float
default:"1"
Projection UV Y axis stretch.
_ProjectionRotation
float
default:"0"
Static rotation angle for the projection in degrees.
_EnableSpin
bool
default:"false"
Enable automatic projection rotation animation.
_SpinSpeed
float
default:"0"
Speed of automatic projection rotation.
_UseWorldNorm
bool
default:"false"
Use world normals instead of view normals for projection.
_ConeWidth
float
default:"0"
Beam spread/specular strength.

Rendering Options

_RenderMode
enum
default:"1"
Transparency rendering mode:
  • 1: Transparent
  • 2: AlphaToCoverage
_BlendSrc
enum
default:"2"
Source blend mode.
_BlendDst
enum
default:"1"
Destination blend mode.
_BlendOp
enum
default:"0"
Blend operation.
_ZWrite
bool
default:"false"
Enable depth buffer writing.
_AlphaToCoverage
bool
default:"false"
Enable alpha to coverage for MSAA.
_ClippingThreshold
float
default:"0.5"
Alpha clipping threshold.
_AlphaProjectionIntensity
float
default:"0.5"
Alpha channel intensity for projection.
_MultiSampleDepth
bool
default:"true"
Enable multi-sample depth texture reading.

Advanced Options

_UseRawGrid
bool
default:"false"
Use raw unsmoothed DMX grid for instant response.
_EnableStrobe
bool
default:"false"
Enable strobe effect support.
_StrobeFreq
float
default:"1"
Strobe frequency in Hz.

Lens Flare Shader Properties

The Lens Flare shader creates realistic lens flare effects with depth-based occlusion.

Core Properties

_MainTex
texture
default:"white"
Lens flare texture. Typically a circular gradient or starburst pattern.
_FixtureMaxIntensity
float
default:"1"
Maximum light intensity for the lens flare.
_FixutreIntensityMultiplier
float
default:"1"
Intensity multiplier for bloom scaling. Higher values create more intense bloom effects.
_FadeAmt
float
default:"1"
Fade strength from center to edge.
_ColorSat
float
default:"1"
Color saturation strength. Lower values desaturate toward edges.

Scale and Distance

_ScaleFactor
float
default:"1"
Overall scale factor for the lens flare.
_ReferenceDistance
float
default:"2"
Reference distance for scaling calculations.
_UVScale
float
default:"1"
UV scale for the flare texture.

Depth Occlusion

_UseDepthLight
bool
default:"true"
Enable depth-based occlusion testing. Flare fades when objects are in front.
_LightSourceViewSpaceRadius
float
default:"0.05"
Radius for depth occlusion sampling in view space.
_DepthOcclusionTestZBias
float
default:"-0.001"
Z-bias for depth comparison. Adjust to prevent self-occlusion.

Distance Fade

_StartFadeinDistanceWorldUnit
float
default:"0.05"
Distance where flare starts to fade in (world units).
_EndFadeinDistanceWorldUnit
float
default:"0.5"
Distance where flare is fully visible (world units).

Visual Polish

_RemoveTextureArtifact
float
default:"0"
Removes texture artifacts by subtracting a small value.
_CurveMod
float
default:"5"
Light intensity curve modifier. Adjusts brightness response curve.
_UsePreMultiplyAlpha
bool
default:"false"
Enable premultiplied alpha blending. Requires texture with correct alpha.

Flicker Animation (Optional)

_ShouldDoFlicker
bool
default:"true"
Enable flickering animation for the lens flare.
_FlickerAnimSpeed
float
default:"5"
Speed of the flicker animation.
_FlickResultIntensityLowestPoint
float
default:"0.5"
Minimum intensity during flicker. 1.0 = no flicker.

Channel Modes

The lens flare supports multiple DMX channel modes:
_ChannelMode
enum
default:"2"
  • 0: 1CH - Intensity only
  • 1: 4CH - Intensity + RGB
  • 2: 5CH - Intensity + RGB + Strobe
  • 3: 13CH - Full control

Usage Examples

Static Projection Light

  1. Create a projection mesh (cone or pyramid)
  2. Assign VRSL/Standard Static/Projection shader
  3. Set DMX channel with _DMXChannel
  4. Assign GOBO texture to _ProjectionMainTex
  5. Adjust _ProjectionRange to fit the scene
  6. Set _ProjectionMaxIntensity for desired brightness

Lens Flare Setup

  1. Create a quad facing the camera
  2. Assign VRSL/Standard Static/Lens Flare shader
  3. Assign lens flare texture to _MainTex
  4. Set _DMXChannel to match the fixture
  5. Adjust _ScaleFactor for appropriate size
  6. Enable _UseDepthLight for realistic occlusion

Performance Tips

For Projection:
  • Use lower _ProjectionRange to reduce overdraw
  • Disable _MultiSampleDepth on mobile platforms
  • Use simpler GOBO textures (lower resolution)
For Lens Flares:
  • The depth occlusion test (COUNT = 8) performs 289 depth samples per flare
  • Disable _UseDepthLight for better performance if occlusion isn’t needed
  • Reduce _FixutreIntensityMultiplier to decrease bloom overhead
  • Use _AlphaToCoverage mode for cleaner edges on MSAA

Technical Details

Depth Occlusion Algorithm

The lens flare uses a grid-based depth sampling approach:
#define COUNT 8  // Creates a 17x17 grid (COUNT*2+1)²

for(int x = -COUNT; x <= COUNT; x++)
{
    for(int y = -COUNT; y <= COUNT ; y++)
    {
        // Sample depth texture at grid point
        // Compare with flare depth
        // Accumulate visibility
    }
}
This provides smooth occlusion transitions as objects pass in front of the light.

Mirror Correction

Both shaders include mirror depth correction for VRChat mirrors using frustum correction calculations.

See Also