Overview
DreamShaderLang is a text language for Unreal Engine materials, compiled by the DreamShader plugin into ordinary material assets; on UE 5.8, .dsp sources add render passes of your own.
For tutorials and task-oriented reading, start at the documentation overview.
DreamShader compiles DreamShaderLang source files — .dsm, .dsf, .dsh and, on the 2.0 line,
.dss — into standard Unreal Engine material assets: UMaterial, UMaterialFunction,
UMaterialFunctionMaterialLayer, and UMaterialFunctionMaterialLayerBlend — and, on Unreal Engine 5.8,
.dsp Custom Pass pipelines into UDreamPassPipeline assets that add render passes of
your own. Source files are the authoring surface; the assets are build output and can always be
regenerated.
| |
|---|
| Version | 2.2.0 |
| Engines | Unreal Engine 5.3 – 5.8 (Win64 verified); Custom Pass needs 5.8 |
| Modules | DreamShaderLang (Runtime), DreamShader (Runtime), DreamShaderPass (Runtime), DreamShaderCompiler (Editor), DreamShaderEditor (Editor) |
| Source extensions | .dsm material · .dsf function · .dsh header · .dss 2.0 compilation unit · .dsi material instance · .dsp Custom Pass pipeline |
| Project settings | Project Settings ▸ DreamPlugin ▸ Dream Shader |
| License | MIT |
New here? Start with Getting started, then Examples.
[!NOTE]
Two syntaxes, one compiler. The 1.x syntax documented below (.dsm / .dsf / .dsh) is the
one that ships. The 2.0 syntax — .dss, HLSL with declarations instead of section blocks —
compiles through the new binder/IR/emitter pipeline on the 2.0 line and has its own page:
DreamShaderLang 2.0.
The declaration grammar: source files, blocks, and sections.
| |
|---|
| Source files | .dsm / .dsf / .dsh and what each may contain |
| Lexical elements | Comments, identifiers, case sensitivity, literals, suffixes |
| Keyword index | Every reserved word and alias, with links |
import | Including headers, functions, and packages |
| Preprocessor | #if and the define table — conditional compilation |
| Types | Type tokens, GLSL aliases, per-context validity |
Top-level blocks
Sections
The statement and expression language inside Graph = { ... }, which materialises material nodes.
| |
|---|
| Statements | Every statement form |
| Declarations | Variables, initialisers, scope |
| Expressions and operators | Precedence, operand rules, integer division |
| Literals | Numeric, boolean, suffixes |
| Constructors | float3(...), vec4(...), integer constructors |
| Swizzles | Channel masks, reorder, repeat |
| Conversions | Widening, narrowing, component-count rules |
if / else | Conditions, truthiness, branch selection |
MaterialAttributes | Struct-like member writes |
| Calls | Calling functions and parameter pins |
| Name resolution | Lookup order and shadowing |
| Node reuse | Common-subexpression deduplication |
| Unsupported constructs | Loops, return, %, indexing — and what happens instead |
Render passes of your own on Unreal Engine 5.8, without changing the engine: masks and custom buffers,
screen-space effects, compute shaders writing data textures.
| |
|---|
Pipelines — .dsp | Buffers, passes, injection points, bindings, mesh selection, what the compiler checks |
| Runtime | What makes a pipeline apply, when passes run, built-in and exported buffers, views, debugging, limits |
| HLSL passes | The fixed parameters, slots, snapshots and the pre-check |
| Material nodes | UE.DreamPassOutput for mesh passes, UE.DreamPassBuffer to read an exported buffer |
| Examples | Highlight outline, UI frosted glass, X-ray, wind field |
DreamShaderPass | The module's C++ and Blueprint API |
| |
|---|
| Editor integration | Menus, toolbar, context menus |
| Material Content Browser | Browse, filter, instance, materialize |
| Preview | Thumbnail and streaming preview |
| Decompiler | Export existing materials, instances and Custom Pass pipelines to source |
| VirtualFunction tools | Declare and sync existing functions |
| Workspace and editor extensions | VSCode workspace, VSCode and Rider plugins |
| Packages | DShader/Packages shared libraries |
| Commandlet | Headless compile and decompile |
| Editor bridge | Request files, WebSocket protocol, artifacts |
| AI agents | Agent guide, skills, MCP server, the authoring loop |