Overview
TheVRStageLighting_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: VRSLInherits from:
UdonSharpBehaviour (in VRChat) or MonoBehaviour (in Unity)
Audio Link Settings
Enable or disable Audio Link Reaction for this fixture.
The frequency band of the spectrum to react to. Options:
Bass, Low_Mids, High_Mids, TrebleThe level of delay to add to the reaction.
Multiplier for the sensitivity of the reaction.
Enable Color Chord tinting of the light emission.
General Settings
Sets the overall intensity of the shader. Good for animating or scripting effects related to intensity. Its max value is controlled by Final Intensity.
Sets the maximum brightness value of Global Intensity. Good for personalized settings of the max brightness of the shader by other users via UI.
The main color of the light.
Color Sampling
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.
Check this box if you wish to use traditional color sampling instead of white to black conversion.
The UV coordinates to sample the color from on the texture.
Check this box if you wish to enable AudioLink Theme colors.
Theme Color to Sample from.
Laser Cone Settings
Controls the radius of the laser cone.
Controls the length of the laser cone.
Controls how flat or round the cone is. 0 = circular, higher values = flatter.
Laser Rotation Settings
X rotation offset for cone in degrees.
Y rotation offset for cone in degrees.
Z rotation offset for cone in degrees.
Laser Beam Settings
Number of laser beams in the cone. Higher values create denser laser patterns.
Controls how thick/thin the lasers are. Lower values create thinner, more precise beams.
Controls the speed of laser scroll animation. Negative values scroll left, positive values scroll right, 0 means no scroll.
Mesh Settings
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._UpdateInstancedPropertiesSansAudioLink()
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 stateColorChord- Get/Set color chord enabledBand- Get/Set the frequency bandDelay- Get/Set the reaction delayBandMultiplier- Get/Set the band multiplierLightColorTint- Get/Set the light colorConeWidth- Get/Set the cone widthConeLength- Get/Set the cone lengthGlobalIntensity- Get/Set the global intensityFinalIntensity- Get/Set the final intensityConeFlatness- Get/Set the cone flatnessConeXRotation- Get/Set X rotationConeYRotation- Get/Set Y rotationConeZRotation- Get/Set Z rotationLaserCount- Get/Set the number of lasersLaserThickness- Get/Set laser thicknessLaserScroll- Get/Set laser scroll speedColorTextureSampling- Get/Set texture sampling enabledTraditionalColorTextureSampling- Get/Set traditional sampling modeTextureSamplingCoordinates- Get/Set texture sampling coordinatesThemeColorSampling- Get/Set theme color sampling enabledThemeColorTarget- Get/Set theme color target
Usage Example
Creating Dynamic Laser Shows
For more dynamic effects, you can animate properties over time:Performance Considerations
- Higher
laserCountvalues 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
Related Components
- VRStageLighting_AudioLink_Static - AudioLink-controlled standard fixtures
- VRStageLighting_DMX_Static - DMX-controlled fixtures
- VRSL_LocalUIControlPanel - Local UI control panel for VRSL