A text material language for Unreal Engine

DreamShaderLang

Write Unreal materials as text: a 2.0 .dss is HLSL with /// annotations and #pragma lines, and 1.x .dsm / .dsf files keep working. The DreamShader plugin compiles them inside the editor into standard UMaterial, UMaterialFunction, material layer and material instance assets. The source is the authoring surface; the asset is build output, and can always be thrown away and regenerated.

  • DreamShader2.2.0
  • VSCode2.2.0
  • UE5.3 – 5.8
  • LicenseMIT
The DreamShader character: a girl with long black hair leaning on a black pillar marked DreamShader, a checkered sphere floating above her palm

DreamShader · Text to UE Materials

Scroll

What it looks like

One .dss file is one material

A whole material from the manual: #pragma sets the material's settings, uniform declares its parameters, /// annotations group and describe them, plain HLSL functions hold the helper logic, and the exported function is the material itself. Saved, it compiles into a standard material graph.

M_TeleportGlow.dssDreamShaderLang 2.0
// M_TeleportGlow.dss#pragma material(ShadingModel = Unlit, BlendMode = Additive)/// @group Glow|Look   @desc Multiplied on top of the particle colouruniform float4 Tint = float4(1, 1, 1, 1);/// @group Glow|Look   @desc Overall emissive gainuniform float Intensity = 0.7;float GlowMask(float2 UV){    float2 P = UV * 2.0 - 1.0;    return pow(saturate(1.0 - dot(P, P)), 2.4);}export void M_TeleportGlow(inout material m){    float2 UV = UE.TexCoord(Index = 0);    m.EmissiveColor = Tint.rgb * GlowMask(UV) * Intensity;}

compiles into the material M_TeleportGlow — Unlit, Additive, with Tint and Intensity parameters

dsc compile M_TeleportGlow.dss

Workflow

From source file to material asset

The source says what you want; the plugin turns it into assets and keeps the two in step. Saving compiles, and generation is idempotent.

  1. Author

    Write materials and material functions in .dss (2.0) or .dsm / .dsf (1.x), #include shared headers, and pull in other people's libraries as packages; the VS Code extension handles completion, hover and diagnostics.

  2. Compile

    Saving compiles: parse, bind, lower to an intermediate representation, then build material expressions. Every diagnostic carries a DSHnnnn code and points at the line you actually wrote.

  3. Asset

    The generator writes UMaterial, UMaterialFunction, material layers and blends, material instances (.dsi), and on UE 5.8 Custom Pass pipelines (.dsp).

  4. Rebuild

    Every asset records what it was built from: a changed source, plugin version or setting rebuilds it, and an asset edited by hand is recognized — revert it to its source, or adopt the edit into the source.