Overview
Built as a standalone Windows application, the Shader Playground provides a visual interface for working with Xbox 360 shaders. It integrates with the XNA Game Studio D3D compiler andxe-gpu-shader-compiler to provide comprehensive shader analysis.
Features
Real-Time Shader Translation
The Shader Playground provides multiple views of your shader code:- Input Panel (Left) - Enter shader microcode source
- Disassembly Panel (Center) - View optimized D3D compiler output
- Translation Panel (Right) - See translated shader in target format
Automatic Validation
The tool automatically validates shader translation accuracy:- XNA Game Studio D3D compiler translates microcode to binary
- D3D compiler disassembles the binary to show optimized form
xe-gpu-shader-compilerdisassembles the same microcode- The disassembly is passed through D3D compiler
- If the outputs don’t match, the panel turns red, indicating broken disassembly
Format Support
The Shader Playground supports translation to multiple output formats, allowing you to verify shader translation for different graphics backends.Setup
Prerequisites
The Shader Playground requires XNA Game Studio 3.1 to be installed (not just the redistributable).Download XNA Game Studio 3.1
Download from Microsoft’s website.
Extract and install
The installer may not be compatible with modern Visual Studio versions. Open
XNAGS31_setup.exe with 7-Zip and run the included redists.msi directly.Building
The Shader Playground is built separately from the main Xenia project:Usage
Basic Workflow
Verify translation
The right panel displays the translated shader. If the validation fails, the panel will turn red.
Integration with xe-gpu-shader-compiler
For the Shader Playground to provide full functionality:- Build
xe-gpu-shader-compilerfrom the main Xenia project - Ensure the executable is in your PATH or the same directory as Shader Playground
- The tool will automatically invoke the compiler for disassembly validation
Working with Dumped Shaders
You can use the Shader Playground with shaders extracted from games:Validation Indicators
Green/Normal Panel
When the translation panel appears normal (no red highlight), the shader translation is working correctly. The output from Xenia’s disassembler matches the D3D compiler’s reference output.Red Panel Warning
When the panel turns red, there is a mismatch between:- The D3D compiler’s original output
- The D3D compiler’s output when processing Xenia’s disassembly
xe-gpu-shader-compiler is producing incorrect disassembly, which may lead to rendering bugs.
Use Cases
Shader Development
- Test shader translation changes in real-time
- Validate that disassembly matches expected output
- Experiment with microcode without running the full emulator
Debugging Rendering Issues
- Load problematic shaders from trace captures
- Identify where shader translation diverges from D3D reference
- Iterate on fixes with immediate visual feedback
Learning Xbox 360 Shader Format
- See how microcode maps to assembly
- Understand shader optimization
- Compare input and output representations
Related Tools
- Shader Compiler - Command-line shader translation tool
- Trace Viewer - Capture frames to extract shaders for analysis
Technical Details
Architecture
The Shader Playground integrates multiple components:- XNA Game Studio D3D Compiler - Microsoft’s reference compiler for validation
- xe-gpu-shader-compiler - Xenia’s shader translation tool
- Windows Forms GUI - Interactive editor interface
Supported Shader Types
- Vertex Shaders (
.vs) - Transform and lighting operations - Fragment/Pixel Shaders (
.fs) - Per-pixel color calculations
Platform Limitations
- Windows only - Requires XNA Game Studio 3.1
- 32-bit x86 - Not compatible with 64-bit or ARM builds
- Legacy .NET Framework - Uses older .NET version due to XNA dependency
Troubleshooting
”XNA Framework not found”
Ensure XNA Game Studio 3.1 is installed correctly. Check thatMicrosoft.Xna.Framework.dll exists at:
“Platform target mismatch”
Verify that the project is set to build for x86, not Any CPU or x64.Shader compiler not found
Make surexe-gpu-shader-compiler.exe is built and accessible. Place it in the same directory as the Shader Playground executable or add it to your system PATH.