Skip to main content

Overview

The VRStageLighting_AudioLink_Laser class provides AudioLink integration specifically for laser cone effects in VRSL. It creates animated laser beam patterns that react to audio, with extensive control over beam count, thickness, rotation, and scrolling effects. This script is designed for creating dynamic laser show effects that synchronize with music. Namespace: VRSL
Inherits from: UdonSharpBehaviour (in VRChat) or MonoBehaviour (in Unity)
Enable or disable Audio Link Reaction for this fixture.
AudioLinkBandState
default:"Bass"
The frequency band of the spectrum to react to. Options: Bass, Low_Mids, High_Mids, Treble
int
default:"0"
The level of delay to add to the reaction.
float
default:"1.0"
Multiplier for the sensitivity of the reaction.
bool
default:"false"
Enable Color Chord tinting of the light emission.

General Settings

float
default:"1.0"
Sets the overall intensity of the shader. Good for animating or scripting effects related to intensity. Its max value is controlled by Final Intensity.
float
default:"1.0"
Sets the maximum brightness value of Global Intensity. Good for personalized settings of the max brightness of the shader by other users via UI.
Color
default:"White * 2.0"
The main color of the light.

Color Sampling

bool
default:"false"
Check this box if you wish to sample a separate texture for the color. The color will be influenced by the intensity of the original emission color. The texture is set in the shader itself.
bool
default:"false"
Check this box if you wish to use traditional color sampling instead of white to black conversion.
Vector2
default:"(0.5, 0.5)"
The UV coordinates to sample the color from on the texture.
bool
default:"false"
Check this box if you wish to enable AudioLink Theme colors.
int
default:"1"
Theme Color to Sample from.

Laser Cone Settings

float
default:"2.5"
Controls the radius of the laser cone.
float
default:"8.5"
Controls the length of the laser cone.
float
default:"0.0"
Controls how flat or round the cone is. 0 = circular, higher values = flatter.

Laser Rotation Settings

float
default:"0.0"
X rotation offset for cone in degrees.
float
default:"0.0"
Y rotation offset for cone in degrees.
float
default:"0.0"
Z rotation offset for cone in degrees.

Laser Beam Settings

int
default:"14"
Number of laser beams in the cone. Higher values create denser laser patterns.
float
default:"0.125"
Controls how thick/thin the lasers are. Lower values create thinner, more precise beams.
float
default:"0.0"
Controls the speed of laser scroll animation. Negative values scroll left, positive values scroll right, 0 means no scroll.

Mesh Settings

MeshRenderer[]
required
The meshes used to make up the light. You need at least 1 mesh in this group for the script to work properly. Supports up to 5 mesh renderers.

Public Methods

_UpdateInstancedProperties()

Updates all material property blocks with current fixture settings including all laser parameters.
Updates material property blocks without AudioLink functionality enabled.

_SetProps()

Initializes the MaterialPropertyBlock for this fixture.

Properties (for Udon Scripting)

All public fields have corresponding properties for safe access from Udon scripts:
  • EnableAudioLink - Get/Set AudioLink enabled state
  • ColorChord - Get/Set color chord enabled
  • Band - Get/Set the frequency band
  • Delay - Get/Set the reaction delay
  • BandMultiplier - Get/Set the band multiplier
  • LightColorTint - Get/Set the light color
  • ConeWidth - Get/Set the cone width
  • ConeLength - Get/Set the cone length
  • GlobalIntensity - Get/Set the global intensity
  • FinalIntensity - Get/Set the final intensity
  • ConeFlatness - Get/Set the cone flatness
  • ConeXRotation - Get/Set X rotation
  • ConeYRotation - Get/Set Y rotation
  • ConeZRotation - Get/Set Z rotation
  • LaserCount - Get/Set the number of lasers
  • LaserThickness - Get/Set laser thickness
  • LaserScroll - Get/Set laser scroll speed
  • ColorTextureSampling - Get/Set texture sampling enabled
  • TraditionalColorTextureSampling - Get/Set traditional sampling mode
  • TextureSamplingCoordinates - Get/Set texture sampling coordinates
  • ThemeColorSampling - Get/Set theme color sampling enabled
  • ThemeColorTarget - Get/Set theme color target

Usage Example

Creating Dynamic Laser Shows

For more dynamic effects, you can animate properties over time:

Performance Considerations

  • Higher laserCount values increase draw calls and performance cost
  • Very thin lasers (laserThickness < 0.01) may have aliasing issues
  • Combining high laser counts with fast scrolling can be performance intensive