Overview
The VRSL serializer provides compatibility with VRSL (VR Stage Lighting) fixtures in VRChat. It supports multiple output configurations, gamma correction, and RGB grid mode for efficient multi-universe encoding.Class: VRSL
Namespace: GlobalImplements:
IDMXSerializer
Properties
Enables gamma correction for color output. When enabled, colors are converted to linear space before encoding.
VRSL outputs in a converted color space instead of native linear. Disable this if your video pipeline already handles gamma correction.
Enables RGB Grid Mode where every 3 universes are encoded into separate RGB color channels, allowing for more efficient use of texture space.When enabled:
- Universe 0 → Red channel
- Universe 1 → Green channel
- Universe 2 → Blue channel
- Pattern repeats for universes 3-5, 6-8, etc.
Determines the layout orientation of DMX data blocks in the output texture.Available configurations:
HorizontalTop: Blocks arranged horizontally starting from topHorizontalBottom: Blocks arranged horizontally starting from bottomVerticalLeft: Blocks arranged vertically on the left sideVerticalRight: Blocks arranged vertically on the right side
Configuration Constants
Size in pixels of each DMX channel block (16×16 pixels)
Number of channel blocks per column in the layout
Methods
SerializeChannel
Encodes a DMX channel value into a 16×16 pixel block in the output texture.The pixel array to write the encoded data to
The DMX channel value (0-255) to encode
The DMX channel number (determines position in texture)
Width of the output texture in pixels
Height of the output texture in pixels
- Calculates block position based on channel number and output configuration
- Applies gamma correction if enabled
- In RGB Grid Mode, distributes universes across color channels
- Writes a 16×16 block of pixels with the encoded value
DeserializeChannel
Decodes a DMX channel value from an input video texture.The input texture to read from
Output parameter that receives the decoded channel value
The DMX channel number to decode
Width of the input texture
Height of the input texture
- Reads the center pixel of the channel’s block
- Applies inverse gamma correction if enabled
- In RGB Grid Mode, extracts value from appropriate color channel
Configuration Example
Universe Layout
VRSL uses a universe-based layout where:- Each universe contains 512 channels
- Channels are arranged in blocks of 16×16 pixels
- 13 blocks fit vertically in a standard column
- Universe spacing includes a 16-pixel gap between universes
Horizontal Layout
Vertical Layout
RGB Grid Mode Details
When RGB Grid Mode is enabled:-
Channel Distribution
- Channels 0-511 (Universe 0) → Red channel
- Channels 512-1023 (Universe 1) → Green channel
- Channels 1024-1535 (Universe 2) → Blue channel
-
Texture Efficiency
- 3 universes encoded in the space of 1
- Triples the effective channel density
- Requires color-aware decoding
-
Repeating Pattern
- Pattern repeats for subsequent universe sets
- Universe 3 wraps to Red channel at a new position
Output Configuration Guide
HorizontalTop
HorizontalTop
Data blocks flow horizontally from left to right, starting at the top of the texture. Best for wide aspect ratios.
HorizontalBottom
HorizontalBottom
Data blocks flow horizontally from left to right, starting at the bottom of the texture. Useful when other content occupies the top portion.
VerticalLeft
VerticalLeft
Data blocks flow vertically from top to bottom, starting on the left side. Optimized for tall aspect ratios.
VerticalRight
VerticalRight
Data blocks flow vertically from top to bottom, starting on the right side. Keeps data away from typical UI elements on the left.
Performance Considerations
- Block Size: 16×16 pixels provides good visibility and error tolerance
- Gamma Correction: Minimal performance impact, recommended for accuracy
- RGB Grid Mode: No performance penalty, 3× texture efficiency gain
- Layout: No performance difference between configurations
Compatibility
This serializer is fully compatible with:- VRSL fixtures in VRChat
- Standard DMX512 protocol (512 channels per universe)
- Industry-standard DMX lighting consoles