Skip to main content

Overview

The VRStageLighting_DMX_Static class is the primary component for DMX-controlled lighting fixtures in VRSL. It handles DMX channel assignment, fixture properties, movement controls, and rendering for stage lights that can be controlled via industry-standard DMX protocols. This script supports both modern industry-standard DMX channel assignment and legacy sector-based addressing. It can control movers, spot lights, and other fixture types with full support for pan/tilt, color, intensity, gobos, and strobes. Namespace: VRSL
Inherits from: UdonSharpBehaviour (in VRChat) or MonoBehaviour (in Unity)

DMX Settings

bool
default:"true"
Enables DMX mode for this fixture. When enabled, the fixture responds to DMX input from the grid node.
int
default:"0"
Optional ID number for organizational purposes. Useful for matching IDs in DMX software and for Udon scripting references.
int
default:"1"
The industry standard DMX Channel this fixture begins on. Most standard VRSL fixtures use 13 channels.
int
default:"1"
The industry standard Artnet Universe. Use this to choose which universe to read the DMX Channel from.
bool
default:"false"
Enables 9-Universe mode for this fixture. The grid will be split up by RGB channels with each section and color representing a universe. Only available on the Vertical and Horizontal Grid nodes.
bool
default:"false"
Enables the legacy ‘Sector’ based method of assigning DMX Channels. Keep this unchecked to use industry standard DMX Channels.
bool
default:"false"
Enables single channel DMX mode for this fixture. This is for single channeled fixtures instead of the standard 13-channeled ones. Currently, the ‘Flasher’ fixture is the only single-channeled fixture.
int
default:"0"
Chooses the DMX Address to start this fixture at when using legacy sector mode. A Sector in this context is every 13 Channels. I.E Sector 0 is channels 1-13, Sector 1 is channels 14-26, etc.
int
default:"0"
Chooses which of the 13 Channels of the current sector to sample from when single channel mode is enabled.
bool
default:"false"
Enables legacy gobo range compatibility.

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.
bool
default:"false"
Choose between setting the Final Intensity for all meshes, or individual meshes.
float
default:"1.0"
Sets the maximum brightness value of Global Intensity for volumetric meshes only. Good for personalized settings of the max brightness of the shader by other users via UI.
float
default:"1.0"
Sets the maximum brightness value of Global Intensity for projection meshes only.
float
default:"1.0"
Sets the maximum brightness value of Global Intensity for fixture meshes only.
Color
default:"White * 2.0"
The main color of the light. Leave it at default white for DMX mode. Supports HDR colors.

Movement Settings

bool
default:"false"
Invert the pan values (Left/Right Movement) for movers.
bool
default:"false"
Invert the tilt values (Up/Down Movement) for movers.
bool
default:"false"
Enable this if the mover is hanging upside down.

Fixture Settings

bool
default:"true"
Enable projection spinning (Udon Override Only).
bool
default:"true"
Enable strobe effects (via DMX Only).
float
default:"90.0"
Tilt (Up/Down) offset/movement. Directly controls tilt when in Udon Mode; is an offset when in DMX mode.
float
default:"0.0"
Pan (Left/Right) offset/movement. Directly controls pan when in Udon Mode; is an offset when in DMX mode.
int
default:"1"
Use this to change what projection is selected. This is overridden in DMX mode.

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.
float
default:"2.5"
Controls the radius of a mover/spot light.
float
default:"8.5"
Controls the length of the cone of a mover/spot light.
float
default:"1.0"
Controls the mesh length of the cone of a mover/spot light.
float
default:"180.0"
Maximum pan angle range in degrees.
float
default:"-180.0"
Maximum tilt angle range in degrees.

Public Methods

_UpdateInstancedProperties()

Updates all material property blocks with current fixture settings. Call this method after changing any public properties to apply changes to the fixture.

_UpdateInstancedPropertiesSansDMX()

Updates material property blocks without DMX functionality enabled. Used for non-DMX controlled fixtures.

_DMXChannelToString()

Returns a string representation of the current DMX channel and universe.
Returns: String in format “DMX Channel: X Universe: Y”

_GetUniverse()

Gets the calculated DMX universe for this fixture.
Returns: Integer representing the DMX universe

_GetDMXChannel()

Gets the calculated DMX channel for this fixture.
Returns: Integer representing the DMX channel

Properties (for Udon Scripting)

All public fields have corresponding properties for safe access from Udon scripts:
  • LightColorTint - Get/Set the light color
  • ConeWidth - Get/Set the cone width
  • ConeLength - Get/Set the cone length
  • MaxConeLength - Get/Set the maximum cone length
  • GlobalIntensity - Get/Set the global intensity
  • FinalIntensity - Get/Set the final intensity
  • FinalIntensityComponentMode - Get/Set component mode
  • FinalIntensityVolumetric - Get/Set volumetric intensity
  • FinalIntensityProjection - Get/Set projection intensity
  • FinalIntensityFixture - Get/Set fixture intensity
  • SelectGOBO - Get/Set the selected gobo
  • NineUniverseMode - Get/Set nine universe mode
  • InvertPan - Get/Set pan inversion
  • InvertTilt - Get/Set tilt inversion
  • IsDMX - Get/Set DMX enabled state
  • ProjectionSpin - Get/Set projection spin
  • Pan - Get/Set pan offset
  • Tilt - Get/Set tilt offset

Usage Example