Overview
VRSL’s modular architecture allows you to create custom light fixtures using the existing shader and script framework. This guide covers creating fixtures from scratch or modifying existing ones.Custom fixtures use the same VRSL shaders and scripts as built-in fixtures, ensuring consistent performance and compatibility.
Fixture Architecture
A VRSL fixture consists of:- Fixture Body: Physical housing mesh
- Volumetric Mesh: Light beam/cone mesh
- Projection Mesh: Gobos/patterns (optional)
- VRSL Script: DMX or AudioLink control component
- Materials: Using VRSL shaders
Fixture Types
Static Fixtures:- PAR cans, wash lights, blinders
- No movement capability
- Simpler setup
- Spotlights, wash movers
- Pan/tilt movement
- Requires head/base separation
- Disco balls, lasers, light bars
- Unique behaviors
- Custom shader features
Prerequisites
Knowledge Requirements
- Basic Unity editor skills
- Understanding of Unity materials and shaders
- 3D modeling (if creating custom models)
- Basic understanding of DMX channels (for DMX fixtures)
Tools
- Unity 2019.4 or newer
- VRSL package installed
- 3D modeling software (Blender, Maya, etc.) - optional
- Texture editing software (Photoshop, Substance) - optional
Creating a Static Fixture
Let’s create a simple static PAR light from scratch:- DMX:
VRSL-StaticLight-VolumetricMesh - AudioLink:
VRSL-AudioLink-StaticLight-VolumetricMesh
- Render Queue: 3002 (Transparent)
- Blend Mode: Transparent
MyCustomPAR-DMX
├── Body
└── Volumetric (MeshRenderer)
└── Material: Using VRSL-StaticLight-VolumetricMesh
- DMX:
VRSL-StaticLight-ProjectionMesh - AudioLink:
VRSL-AudioLink-StaticLight-ProjectionMesh
- DMX:
VRStageLighting_DMX_Static - AudioLink:
VRStageLighting_AudioLink_Static
- Drag meshes into Obj Renderers array:
- [0] Body
- [1] Volumetric
- [2] Projection (if using)
- Global Intensity: 1.0
- Light Color Tint: White
- Cone Width: 1.5
- Cone Length: 5.0
Creating a Moving Head Fixture
Moving heads require additional structure for pan/tilt:MyCustomMover-DMX
├── Base (Static)
├── Yoke (Rotates on Y - Pan)
│ └── Head (Rotates on X - Tilt)
│ ├── Body
│ ├── Volumetric
│ └── Projection
└── Target (Empty Transform for constraints)
VRStageLighting_DMX_Static component:
- Max/Min Pan: Set rotation limits (e.g., -180 to 180)
- Max/Min Tilt: Set rotation limits (e.g., -90 to 90)
- Invert Pan/Tilt: Adjust if rotation direction is wrong
- Is Upside Down: Check if fixture is ceiling-mounted
Custom Volumetric Meshes
Creating Volumetric Mesh
Options for volumetric meshes: 1. Use Existing VRSL Meshes:- Located in VRSL package
- Pre-optimized for performance
- Various cone shapes available
- Use ProBuilder to create cone
- Adjust vertices for desired shape
- UV unwrap appropriately
Volumetric Mesh Requirements
Topology:- Origin at emission point (tip of cone)
- Forward direction matches light direction
- Reasonable polygon count (50-200 tris)
- Clean geometry (no overlapping faces)
- Cylindrical unwrap from tip to base
- U: Around circumference (0-1)
- V: From tip to base (0-1)
- Used by shader for gradient effects
- Create High (200 tris), Med (100 tris), Low (50 tris)
- Swap via VRSL Control Panel
- Significant performance improvement
Custom Gobo Textures
Creating Gobo Atlas
VRSL uses texture atlases for gobo patterns: Atlas Layout:- Resolution: 2048x2048 (or 1024x1024 for optimization)
- Format: PNG with alpha channel
- Each gobo: 512x512 pixels
- Layout: 4x2 grid (8 gobos)
- Background: Transparent (alpha = 0)
- Pattern: White (for tinting) or colored
Creating Individual Gobos
In Photoshop/GIMP:- Create 512x512 document
- Transparent background
- Draw/import your pattern in white
- Use alpha channel for shape:
- Black = Blocked (opaque)
- White = Light passes (transparent)
- Gray = Partial transparency
- Save as PNG
- Keep designs high-contrast
- Avoid very fine details (will blur at distance)
- Test how it looks with different colors
- Consider rotation when designing
Assembling the Atlas
- Create 2048x2048 document
- Arrange 8 gobos in 4x2 grid
- Ensure exact spacing (no gaps or overlaps)
- Each gobo occupies 512x512 square
- Export as PNG with alpha
- Import to Unity
Assigning to Material
- Create/select projection material
- Find “Gobo Texture” property
- Assign your atlas texture
- Material will automatically index into correct gobo
- Use “Projection Selection” (1-8) to choose gobo
Fixture Definitions (VRSL 2.6.0+)
Fixture Definition files describe your fixture’s DMX profile:Creating Fixture Definition
- Right-click in Project: Create > VRSL > Fixture Definition
- Name it “MyCustomFixture-Definition”
- Configure properties:
- Fixture Name: Display name
- Manufacturer: Your name or studio
- Channel Count: Total DMX channels used
- Channel number
- Function (Intensity, Red, Green, Blue, Pan, Tilt, etc.)
- Value range (0-255)
- Description
Applying Definition to Fixture
- Select your fixture GameObject
- In DMX Static component, find “Fixture Definition”
- Assign your Fixture Definition asset
- Used for patch export and documentation
Exporting Patch Data
- VRSL Control Panel > Utilities
- “Export DMX Patch Data”
- Choose format:
- JSON: Machine-readable
- MVR: My Virtual Rig (industry standard)
- PDF: Human-readable patch list
- Includes all fixtures with definitions
- Import into lighting software
Fixture Definitions are optional but highly recommended for documentation and collaboration.
Advanced Customization
Custom Shader Properties
Add custom properties while maintaining VRSL compatibility:- Duplicate VRSL shader
- Add your properties:
- Integrate with VRSL’s existing calculations
- Test thoroughly with DMX/AudioLink
Custom Scripts
Extend VRSL scripts with custom behavior: Option 1: Inherit from VRSL ScriptMulti-Instance Fixtures
Create fixtures with multiple light sources: Light Bar Example:Laser Fixtures
Lasers use a different shader:- Use
VRSL-BasicLaser-DMXorVRSL-AudioLink-BasicLasershader - Apply to line mesh or textured quad
- Configure in VRStageLighting_AudioLink_Laser component:
- Laser Count: Number of beams
- Cone Width/Length: Beam properties
- Laser Thickness: Individual beam width
- Cone X/Y/Z Rotation: Beam pattern rotation
- Laser Scroll: Animated movement
Testing Custom Fixtures
- Global Intensity
- Light Color Tint
- Cone Width/Length
- Projection Selection (if applicable)
- Intensity responds (Channel 1)
- Color responds (Channels 2-4)
- Movement responds if moving head
- Strobe responds
- Gobo selection works
Creating Prefabs
Making Your Fixture Reusable
- “MyFixture-DMX-Horizontal”
- “MyFixture-AudioLink”
Distribution
Packaging for Others
If sharing custom fixtures:-
Organize Assets:
- Create folder: “Assets/MyFixtures/”
- Include:
- Prefabs
- Models (FBX/mesh files)
- Materials
- Textures
- Fixture Definitions
-
Document:
- Create README.txt
- Include:
- Installation instructions
- DMX channel layout
- Usage notes
- Version compatibility
-
Export UnityPackage:
- Right-click folder
- Export Package
- Include dependencies
- Test import in fresh project
-
Share:
- Upload to Gumroad, GitHub, etc.
- Include preview images
- Specify VRSL version compatibility
- Provide support contact
Licensing Considerations
- VRSL shaders are MIT licensed (permissive)
- Your models/textures can use any license
- Credit VRSL if redistributing with shaders
- Consider open-source for community benefit
Common Issues
Fixture Doesn’t Respond
Check:- VRSL script component is attached
- Obj Renderers array includes all meshes
- Materials use VRSL shaders
- DMX channel is assigned (for DMX fixtures)
- Control Panel is in scene
Materials Look Wrong
Verify:- Using correct VRSL shader (DMX vs AudioLink)
- Render queue is correct (3002 for volumetric)
- Blend mode is set properly
- Material properties match expectations
- No conflicting materials or shaders
Movement Not Working
For Moving Heads:- Check Yoke and Head hierarchy
- Verify forward direction is correct
- Check pan/tilt limits are set
- Ensure DMX channels are assigned correctly
- Test with known working DMX data
Performance Issues
Optimize:- Use lower-poly volumetric mesh
- Reduce projection texture resolution
- Ensure GPU instancing is working
- Check for duplicate materials
- Use appropriate render queues
Best Practices
Workflow:- Model in your 3D software
- Import to Unity early and test often
- Use VRSL’s existing shaders when possible
- Create prefab variants for different modes
- Test performance with many instances
- Get feedback from community
- Test with latest VRSL version
- Document version requirements
- Don’t modify core VRSL shaders if possible
- Use Material Property Blocks for per-instance properties
- Maintain GPU instancing compatibility
Next Steps
- Learn DMX Setup to control your fixtures
- Integrate AudioLink for audio reactivity
- Optimize with Performance Guide
- Set up Video Streaming for live control
Resources
- VRSL Discord - Share and get feedback on custom fixtures
- VRSL GitHub - Example fixtures
- Unity Shader Documentation
- Blender Documentation - For 3D modeling