What are Serializers?
Serializers are the core plugins that convert DMX channel values (bytes) into pixel data in a video texture. They define the pixel mapping format - the spatial arrangement of how lighting channels are encoded into an image.Serialization
Converts DMX bytes → Video pixels
Deserialization
Converts Video pixels → DMX bytes
Bidirectional
Can both encode and decode data
Configurable
Each serializer has custom settings
The IDMXSerializer Interface
All serializers implement theIDMXSerializer interface, which defines the contract for converting between DMX and video:
IDMXSerializer.cs:7-41
Lifecycle Methods
InitFrame
Called once per frame before any channels are processed. Use to reset counters or prepare state.
SerializeChannel / DeserializeChannel
Called for each DMX channel. Write/read pixels in the texture at the appropriate location.
Available Serializers
HNode includes several built-in serializers for different use cases:VRSL (VR Stage Lighting)
Format: Grid-based, 16×16 pixel blocks per channelBlock Size
16×16 pixels per channel
Blocks Per Column
13 channels vertically
Channels Per Universe
512 (DMX standard)
Orientation
4 layout options
- Gamma Correction: Optional sRGB ↔ Linear conversion
- RGB Grid Mode: Encodes 3 universes as R/G/B channels on one grid
- Layout Options: HorizontalTop, HorizontalBottom, VerticalLeft, VerticalRight
- Alpha Encoding: Uses alpha channel to encode transparency
SerializerVRSL.cs:26-61
VRSL is the most widely supported format in VRChat for stage lighting systems. It’s designed by Rollthered and used by many VR performance venues.
Binary
Format: Bit-expansion encoding, 4×4 pixel blocks per bitBlock Size
4×4 pixels per bit
Blocks Per Column
52 bits vertically
Bit Expansion
8 bits per channel = 8 blocks
Density
Very space-efficient
SerializerBinary.cs:16-38
Ternary
Format: Base-3 encoding, 6 ternary digits per channelBlock Size
4×4 pixels per digit
Blocks Per Column
48 digits vertically
Base-3 Encoding
6 ternary digits per byte
Intensity Levels
0, 127, 255 per digit
SerializerTernary.cs:89-104
BinaryStageFlight
Format: Optimized binary format for StageFlight systems Similar to Binary but with layout optimizations for StageFlight’s specific use cases in VR stage environments.ColorBinary
Format: Binary encoding using RGB channels Encodes binary data into the R, G, and B channels separately, effectively tripling the data density at the cost of color-accurate rendering.FuralitySomna
Format: Custom format for Furality Somna events Optimized layout for the Furality Somna virtual convention’s lighting infrastructure.Spiral
Format: Spiral pattern pixel mapping Arranges channels in a spiral pattern from center outward, useful for certain radial fixture arrangements.Choosing a Serializer
Use this guide to pick the right serializer:Use VRSL when...
Use VRSL when...
- Working with VRChat or other VR platforms
- Need wide compatibility with existing systems
- Want human-readable channel layout
- Using gamma-corrected rendering pipelines
- Working with existing VRSL fixtures
Use Binary when...
Use Binary when...
- Need maximum channel density
- Have limited texture resolution
- Working with 10+ universes
- Texture bandwidth is a concern
- Color accuracy isn’t required
Use Ternary when...
Use Ternary when...
- Need better error tolerance than binary
- Want visual distinction between states
- Working with noisy video transmission
- Experimenting with alternative encodings
Use specialized formats when...
Use specialized formats when...
- Working with specific event/venue systems
- Need compatibility with existing infrastructure
- Have custom fixture layouts
- Venue requires specific format
Block Rendering System
Serializers use HNode’s block rendering utilities to draw channel data:MakeColorBlock
Fills a square area with a solid color:TextureWriter.cs:187-198
MixColorBlock
Writes to a specific color channel (RGB):TextureWriter.cs:200-231
Serializer Configuration
Serializers are configured in the show configuration:You can use different serializers for input (deserializer) and output (serializer) when in transcode mode. This enables format conversion between systems.
Alpha Channel Encoding
HNode uses a clever alpha channel encoding to represent zero values:- Visual identification of active channels
- Compositing multiple DMX streams
- Overlay effects in video processing
Creating Custom Serializers
To create a custom serializer:Implement SerializeChannel
Use
TextureWriter.MakeColorBlock to write pixels at the calculated position.Implement DeserializeChannel
Read pixels using
TextureReader.GetColor and convert back to byte values.Performance Considerations
- Block Size: Smaller blocks = more channels per texture, but slower rendering
- Color Operations: Gamma correction adds computational cost
- Bounds Checking: Always validate coordinates before writing pixels
- Frame Buffer Size: Pre-allocate
Color32[]arrays to avoid GC
TextureWriter.cs:61-67
Serializer performance directly impacts overall frame rate. Profile your custom serializers using Unity’s Profiler tool.