SDSL: Stop Duplicating Shader Logic

You only write what's different. Everything else comes from base shaders.

SDSL (Stride Shading Language) adds object-oriented features to HLSL. Inherit from multiple base shaders, like C# interfaces with default implementations. The Stride engine has hundreds of production-tested shaders you can extend with a few lines of code.

shader TexturedQuad : ShaderBase, PositionStream4, Transformation, Texturing
{
    Texture2D DiffuseTexture;

    override stage void VSMain()
    {
        streams.ShadingPosition = mul(streams.Position, WorldViewProjection);
    }

    override stage void PSMain()
    {
        streams.ColorTarget = DiffuseTexture.Sample(Sampler, streams.TexCoord);
    }
};

Position from PositionStream4, matrices from Transformation, UVs from Texturing.


Topics

  • The shader permutation problem and how SDSL solves it
  • Streams, inheritance, composition
  • TextureFX, DrawFX, ComputeFX, ShaderFX (vvvv)
  • Multi-shader systems, particles, pipelines
  • vvvv gamma and Stride workflows

Get Started


Origins

SDSL implements ideas from this paper:

Spark: Modular, Composable Shaders for Graphics Hardware Tim Foley & Pat Hanrahan, SIGGRAPH 2011

SDSL builds on the original Spark research.

Developers

Virgile Bello (xen2) leads Stride development. Previously: Silicon Studio Tokyo (Lead Architect), NVIDIA (OpenGL team), Woven by Toyota (vehicle simulator).

Alexandre Mutel (xoofx) created SharpDX and designed Unity's Burst compiler. Microsoft MVP. Co-created Xenko at Silicon Studio Tokyo.

Built at Silicon Studio in Tokyo (2011-2016), now part of Stride (MIT license, .NET Foundation).

New SDSL Compiler

stride3d/SDSL is a new compiler for the same language:

  • Pure C#, targets SPIR-V directly
  • Faster compilation
  • Active development

In Production

Stride

Stride is a production game engine using SDSL for all shaders. Games, simulations, and interactive applications ship with SDSL shaders.

vvvv

vvvv gamma uses Stride's rendering and SDSL through deep integration, adding its own base shaders (VS_PS_Base, FilterBase) and the TextureFX/DrawFX/ComputeFX/ShaderFX node system. vvvv has powered large-scale media installations since 2002: the Guggenheim Bilbao, immersive exhibitions, multi-machine live events. Used by designers, researchers, and graphics programmers who need rapid prototyping with production-quality output.

VL.Fuse

VL.Fuse overlays a powerful library with dozens of advanced rendering techniques (SDF, 3D fluid simulation, compute utilities) and an even more fine-grained shader node graph.

VL.Fuse visual shader graph

The hybrid workflow lets you mix SDSL text shaders, visual shader graphs, visual programming nodes, and C# code in the same project, all hot-reloading as you work.


Resources