|
Text-first Unreal Engine material authoring with DreamShaderLang.
DreamShader compiles 中文文档 · Documentation · Getting started · Language reference · Examples · AI skills · Changelog QQ group: 466585194 |
|
Tip
Keep every source file — .dss, .dsi, .dsp, .dsh, .dsm, .dsf — in version control, and with
Custom Pass the snapshots in DShader/.dreampass/ too. The generated
Unreal assets can always be rebuilt from source; whether to version them as well is a choice with two
workable answers, and Source control has both.
Note
Since 2.0 one compiler builds both syntaxes: the 1.x language shown below keeps
working unchanged, and beside it there is an HLSL-shaped one — .dss
sources, .dsi material instances, a decompiler that writes them,
and dsc migrate, which rewrites a 1.x file and proves the rewrite builds
the same graph before it writes anything.
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;
}
}Save the file and DreamShader builds /Game/DreamMaterials/M_Minimal. Name is the asset path
relative to Root, which defaults to Game; Root="Plugin.MyPlugin" generates into a content
plugin instead.
By default materials are generated in memory — no .uasset is written and nothing appears in
the Content Browser, because the source file is what you edit. Cooking materialises them
automatically, and you can materialise one by hand from the Material Content Browser.
-
Copy the plugin into your project, enable DreamShader in Edit ▸ Plugins, and restart the editor. The engine plugins
WebSocketNetworkingandSQLiteCoreare enabled automatically. -
Create the source directory in the project root and add a
.dsmfile:MyProject/ ├─ DShader/ │ ├─ Materials/ *.dsm material implementations │ ├─ Functions/ *.dsf reusable material function assets │ ├─ Shared/ *.dsh headers: Function, GraphFunction, Namespace, VirtualFunction │ └─ Packages/ installed shared libraries └─ Plugins/ └─ DreamShader/ -
Save it. With Auto Compile On Save on — the default — the source is parsed after a short debounce and the asset is built.
Settings live under Project Settings ▸ DreamPlugin ▸ Dream Shader; every key and its default is on Project settings. The full walkthrough is Getting started.
| Block | Produces | Reference |
|---|---|---|
Shader |
a UMaterial |
Shader |
ShaderFunction |
a UMaterialFunction |
ShaderFunction |
ShaderLayer |
a native UMaterialFunctionMaterialLayer |
ShaderLayer |
ShaderLayerBlend |
a native UMaterialFunctionMaterialLayerBlend |
ShaderLayer |
VirtualFunction |
nothing — declares an existing asset so Graph can call it |
VirtualFunction |
Function |
one HLSL Custom node, via a generated .ush helper |
Function |
GraphFunction |
a Custom node that may pull UE.* nodes into its inputs |
GraphFunction |
Namespace |
nothing — groups helpers as Ns::Name |
Namespace |
The three source kinds are not interchangeable: .dsm holds at most one Shader, .dsf holds
function assets and may not declare a Shader, and .dsh is a header consumed through import.
See Source files.
Graph = { … } is where the node graph is written — declarations, arithmetic, swizzles, UE.*
material nodes, math builtins, function calls and if / else. Typed Properties cover scalars,
vectors, textures, switches, MPC values and reflected node settings. MaterialAttributes and
Substrate (UE 5.4+) are first-class values that can be passed through graph code, function
signatures and output bindings.
The full reference lives in Docs/, and is published at
https://shader.toolchain.64hz.cn/docs in Chinese and English.
| Language reference | source files, lexical rules, top-level blocks, sections, types, import |
| Graph language | statements, expressions, conversions, swizzles, if / else, calls — and what Graph is not |
| Builtins | the UE.* catalogue, math builtins, Substrate.*, the UE.Expression escape hatch |
| Parameters | the 21 parameter-node tokens, compact types, metadata keys, SamplerType |
| Settings | material settings and their enum values, function settings, project settings |
| Generation | asset paths, Ephemeral materials, caching, graph layout |
| Editor tools | browser, preview, decompiler, workspace, packages, bridge, commandlet |
| Diagnostics | every message the compiler can emit, by pipeline stage |
| Examples | complete sources you can copy as they are |
| C++ API | the public headers, for extending the plugin |
| Material Content Browser | Tools ▸ DreamShader. Your sources and the project's materials in one tab: per-file compile status, every diagnostic with a jump to the line, hand-edit detection with Revert / Adopt / Detach, imports and dependents, the inheritance chain, a live orbiting preview, instance creation, and templates for new files. Follows the watcher, so it is never stale |
| Decompiler | right-click a Material, Material Function or material instance ▸ DreamShader ▸ Export .dss / Export .dsi (or dsc decompile, which also takes a Custom Pass pipeline). The 2.0 text is parsed again before it is written, and what it cannot state is named at the top of the file; Export Legacy .dsm / .dsf writes 1.x text |
| Packages | reusable .dsh libraries under DShader/Packages/@scope/name/, imported as import "@typedreammoon/dream-noise/Library/Noise.dsh"; |
| Workspace | the generated DShader/DreamShader.code-workspace, opened in VSCode from the editor toolbar |
| Commandlet | -run=DreamShader compile | decompile — headless generation for CI |
| Editor | Repository | Features |
|---|---|---|
| VSCode | TypeDreamMoon/dreamshader-language-support | highlighting, snippets, completion, go to definition, find references, hover, signature help, local and bridge diagnostics, material preview, package commands, templates |
| Rider | tsdaer/dreamshader-language-support | .dsm / .dsf / .dsh file types, grammar and PSI parsing, highlighting, completion, navigation, diagnostics, bridge integration, semantic tokens, inlay hints, package tools |
DreamShaderLang is a text format, so a coding agent can author it — but only if it can check its
own work. .skill/ ships the harness that closes that loop: a headless driver
plus six skills, in the Claude Code skill format.
| Skill | Argument | Does |
|---|---|---|
dream-shader-create |
<description> |
writes a new material, function, instance or Custom Pass pipeline from plain language, then checks and compiles it |
dream-shader-verify |
<file> | -All |
check (writes nothing), compile, check -Shaders; exit 0 / 1 with every diagnostic |
dream-shader-diagnose |
<message> |
routes a DSHnnnn code to its page, explains it, fixes it |
dream-shader-decompile |
<asset> |
exports a material, function, layer, instance or pipeline back to .dss / .dsi / .dsp |
dream-shader-optimize |
<file> |
makes a decompiled or migrated source read hand-written, and proves the graph unchanged |
dream-shader-migrate |
<file> | -All |
rewrites 1.x sources as .dss with dsc migrate, proving each rewrite first |
dsc.ps1 wraps the commandlet: it resolves the engine from the
.uproject's EngineAssociation, finds the project by walking up, prints the DreamShader messages —
each multi-line report whole — and, because a headless compile writes real .uasset files where the
editor keeps them in memory, reports every asset the run created or rewrote, so -CleanNew can delete
exactly the ones it created.
pwsh -File Plugins/DreamShader/.skill/dsc.ps1 check DShader/UI/M_Panel.dss
pwsh -File Plugins/DreamShader/.skill/dsc.ps1 compile DShader/UI/M_Panel.dss -Force -CleanNewPublish the skills into .claude/skills/ once, and an agent working anywhere in the project loads
them by name:
pwsh -File Plugins/DreamShader/.skill/sync-skills.ps1Note
Only the auto-loading is Claude Code specific. The driver is a plain PowerShell script and each
SKILL.md is plain Markdown, so any agent — or any human — can read the instructions and run the
same commands. .skill/reference/ condenses what an author actually
needs — dss.md for materials and instances, dsp.md
for Custom Pass pipelines, legacy.md for 1.x sources — with the traps
and the code each one is reported as.
Unreal Engine 5.3 – 5.8 on Win64, each verified with a single-plugin RunUAT BuildPlugin build.
Active development targets 5.8.
Validating the plugin without building a project target
& "<EngineDir>\Engine\Build\BatchFiles\RunUAT.bat" BuildPlugin `
-Plugin="<ProjectDir>\Plugins\DreamShader\DreamShader.uplugin" `
-Package="<OutputDir>\DreamShader" `
-TargetPlatforms=Win64 `
-RocketOn Windows, UE 5.3 and 5.4 may require the MSVC 14.38 toolchain — newer compilers can fail
while compiling older engine headers, before plugin code is reached.
Note
The decompiler is a migration helper, not a round-trip guarantee. It handles many common materials
and some large Lyra cases, and leaves a // Warning: comment for everything it could not
reproduce. The known round-trip gaps are worth
reading before deleting an original asset.
| Version | 2.1.1 |
| Language | DreamShaderLang |
| Unreal Engine | 5.3 – 5.8 |
| Modules | DreamShaderLang, DreamShader, DreamShaderPass (Runtime), DreamShaderCompiler, DreamShaderEditor (Editor) |
| Author | TypeDreamMoon |
| GitHub | https://github.com/TypeDreamMoon |
| Docs | https://shader.toolchain.64hz.cn/ |
| Web | https://dev.64hz.cn |
| License | MIT |
| Copyright | Copyright (c) 2026 TypeDreamMoon. All rights reserved. |
Releasing is documented on Release; building the plugin from source on Contributing.
On Unreal Engine 5.8, a .dsp pipeline adds render passes of your own without
touching the engine: a mask of selected objects, a blur, a screen-space effect, a compute shader writing a data
texture. Its passes run at the injection points they choose — before the base pass, after the opaque lighting,
before or inside the post-process chain — as Post Process materials, project HLSL, or selected meshes drawn
again; their buffers can be read by any material. See Custom Pass runtime and the
examples.
- More complete VSCode semantic diagnostics.
- Deeper Material Layer Stack and Layer Instance workflow support.
- Deeper Moon Engine integration — reference: https://zhuanlan.zhihu.com/p/21979494450
DreamShader is released under the MIT license. For bug reports and feature requests, open an issue.

