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

enableDMXChannels
bool
default:"true"
Enables DMX mode for this fixture. When enabled, the fixture responds to DMX input from the grid node.
fixtureID
int
default:"0"
Optional ID number for organizational purposes. Useful for matching IDs in DMX software and for Udon scripting references.
dmxChannel
int
default:"1"
The industry standard DMX Channel this fixture begins on. Most standard VRSL fixtures use 13 channels.
dmxUniverse
int
default:"1"
The industry standard Artnet Universe. Use this to choose which universe to read the DMX Channel from.
nineUniverseMode
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.
useLegacySectorMode
bool
default:"false"
Enables the legacy ‘Sector’ based method of assigning DMX Channels. Keep this unchecked to use industry standard DMX Channels.
singleChannelMode
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.
sector
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.
Channel
int
default:"0"
Chooses which of the 13 Channels of the current sector to sample from when single channel mode is enabled.
legacyGoboRange
bool
default:"false"
Enables legacy gobo range compatibility.

General Settings

globalIntensity
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.
finalIntensity
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.
finalIntensityComponentMode
bool
default:"false"
Choose between setting the Final Intensity for all meshes, or individual meshes.
finalIntensityVolumetric
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.
finalIntensityProjection
float
default:"1.0"
Sets the maximum brightness value of Global Intensity for projection meshes only.
finalIntensityFixture
float
default:"1.0"
Sets the maximum brightness value of Global Intensity for fixture meshes only.
lightColorTint
Color
default:"White * 2.0"
The main color of the light. Leave it at default white for DMX mode. Supports HDR colors.

Movement Settings

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

Fixture Settings

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

Mesh Settings

objRenderers
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.
coneWidth
float
default:"2.5"
Controls the radius of a mover/spot light.
coneLength
float
default:"8.5"
Controls the length of the cone of a mover/spot light.
maxConeLength
float
default:"1.0"
Controls the mesh length of the cone of a mover/spot light.
maxMinPan
float
default:"180.0"
Maximum pan angle range in degrees.
maxMinTilt
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.
public void _UpdateInstancedProperties()

_UpdateInstancedPropertiesSansDMX()

Updates material property blocks without DMX functionality enabled. Used for non-DMX controlled fixtures.
public void _UpdateInstancedPropertiesSansDMX()

_DMXChannelToString()

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

_GetUniverse()

Gets the calculated DMX universe for this fixture.
public int _GetUniverse()
Returns: Integer representing the DMX universe

_GetDMXChannel()

Gets the calculated DMX channel for this fixture.
public int _GetDMXChannel()
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

// Example: Setting up a DMX fixture on channel 14, universe 1
VRStageLighting_DMX_Static fixture = GetComponent<VRStageLighting_DMX_Static>();

// Configure DMX settings
fixture.enableDMXChannels = true;
fixture.dmxChannel = 14;
fixture.dmxUniverse = 1;

// Adjust intensity
fixture.globalIntensity = 0.8f;
fixture.finalIntensity = 1.0f;

// Apply changes
fixture._UpdateInstancedProperties();

Build docs developers (and LLMs) love