Overview
DreamShaderLang is a text language for Unreal Engine materials, compiled by the DreamShader plugin into ordinary material assets.
DreamShaderLang is a text language for Unreal Engine materials. You write .dsm, .dsf and
.dsh files; the DreamShader plugin parses them inside the editor and builds standard Unreal
assets — UMaterial, UMaterialFunction, UMaterialFunctionMaterialLayer and
UMaterialFunctionMaterialLayerBlend.
The source file is the authoring surface. The asset is build output, and can always be thrown away and regenerated.
| Plugin version | 1.5.0 |
| Engines | Unreal Engine 5.3 – 5.8, Win64 verified |
| Modules | DreamShader (Runtime), DreamShaderCompiler (Runtime), DreamShaderEditor (Editor) |
| Source extensions | .dsm · .dsf · .dsh |
| Project settings | Project Settings ▸ DreamPlugin ▸ Dream Shader |
| License | MIT |
Three kinds of source file
| Extension | Name | Holds | Generates |
|---|---|---|---|
.dsm | Dream Shader Material | at most one Shader, plus any function, layer, namespace or virtual-function block | the material, and every function asset declared beside it |
.dsf | Dream Shader Function | ShaderFunction, ShaderLayer, ShaderLayerBlend and helper blocks — no Shader | the function assets it declares |
.dsh | Dream Shader Header | Function, GraphFunction, Namespace, VirtualFunction, imports | nothing directly; it is consumed through import |
import directives are inlined into one text before parsing, so a translation unit is the
whole import closure, not the single file. That is why "one Shader per file" really means
one Shader per closure. See Source Files.
What a block generates
| Block | Unreal asset |
|---|---|
Shader | UDreamShaderMaterialInstance over a hidden UMaterial base (ThinCustom, the default), or a plain UMaterial (Graph backend) |
ShaderFunction | UMaterialFunction |
ShaderLayer | UMaterialFunctionMaterialLayer |
ShaderLayerBlend | UMaterialFunctionMaterialLayerBlend |
VirtualFunction | nothing — it declares an existing UMaterialFunction so Graph can call it |
Function / GraphFunction | Custom node code, plus one generated .ush helper include |
A minimal material
Shader(Name="DreamMaterials/M_Minimal")
{
Properties = {
vec3 Tint = vec3(1.0, 0.2, 0.2);
}
Settings = {
Domain = "UI";
ShadingModel = "Unlit";
}
Outputs = {
vec3 Color;
Base.EmissiveColor = Color;
}
Graph = {
Color = Tint;
}
}Saving that file under DShader/ builds /Game/DreamMaterials/M_Minimal.
With the default ThinCustom backend the generated material lives in memory only and does not
appear in the Content Browser. That is deliberate, and there are three ways to reach it — see
Your First Material.
What DreamShader does, and what it does not
It generates material assets in the Unreal editor. That is the whole scope. Specifically:
Graphis a node-graph builder, not a shader compiler. It has four arithmetic operators,if/else, and nothing else. No loops, no ternary, no%, no bitwise or comparison operators outside anifcondition, no matrices, no arrays or indexing, no compound assignment. Several of those truncate silently rather than erroring — read What Graph Is Not before you write your first non-trivial graph. Genuinely imperative code belongs in aFunction, whose body is real HLSL.- Generation is editor-only. There is no runtime path that builds a material from DreamShaderLang, and none of the tooling exists in a packaged game.
- A generated asset is output, not a document. Regeneration tears the graph down and rebuilds it, destroying hand edits; parameter overrides set directly on a generated instance are cleared on every rebuild. See Regeneration.
Substrate.*requires since UE 5.4 and a plugin binary built against 5.4 or newer — the gate is compile-time.- Some spellings are already deprecated. These are the
Instancebackend value and theMaterialLayer/MaterialLayerBlendblock spellings.
Where to go next
Getting Started
Install the plugin, generate a first material, and learn the daily save-and-compile loop.
Language
Source files, lexical rules, top-level blocks, sections, types, functions, imports, layout.
The Graph Language
Statements, expressions, conversions, if / else, calls — and what Graph is not.
Builtins
The UE.* catalogue, the generic UE.Expression escape hatch, math builtins, Substrate.*.
Parameters
Property types, parameter nodes, metadata and groups, asset references.
Settings
Material settings and enum values, the backend, and all thirteen project settings.
Generation
The pipeline, asset paths, in-memory materials, output bindings, regeneration.
Tooling
Editor tools, the decompiler, VSCode and Rider, the headless commandlet, packages.
Diagnostics
Every error and warning, with cause and fix, plus the current limitations.
Examples
Common patterns and complete, copy-pasteable sources.
HLSL / GLSL Background
Background reading for the shading languages DreamShaderLang borrows from.
Changelog
Plugin, VSCode extension and website release notes.