Asset Generation
Generation flow from .dsm / .dsf / .dsh to UMaterial / UMaterialFunction assets.
DreamShader turns source files into Unreal assets through parsing, import resolution, semantic analysis, graph generation, and asset saving.
Generation Flow
- Scan source files under
SourceDirectory. - Parse
.dsm,.dsf, and.dsh. - Resolve imports and packages.
- Build declarations and helper symbols.
- Generate Unreal material nodes from
Graph. - Apply settings, outputs, layout, and metadata.
- Save or refresh generated assets.
- Report diagnostics back to the editor bridge.
.dsm and .dsh
.dsm usually generates material assets. .dsh does not generate an asset directly;
it provides shared imports and helpers. When .dsh changes, dependent .dsm / .dsf
files are recompiled.
Asset Paths
Shader(Name="DreamMaterials/M_Minimal")Generates:
/Game/DreamMaterials/M_Minimal.M_MinimalUse Root="Plugin.MyPlugin" to generate under a content plugin root.
Node Generation
Graph statements become Unreal material expression nodes:
| Graph code | Generated concept |
|---|---|
float t = UE.Time(); | Time node. |
Color = Tint * Strength; | Multiply and output wiring. |
UE.Expression(...) | Generic reflected MaterialExpression. |
Function call | Custom-node helper or generated HLSL call. |
ShaderFunction / VirtualFunction call | Material Function Call node. |
VirtualFunction References
VirtualFunction declarations reference existing Unreal material functions. The generator
creates calls to those functions but does not create or overwrite the assets.
Function Generation
Normal Function helpers may generate helper include code or Custom-node snippets,
depending on helper type and generator behavior. GraphFunction can create auxiliary
graph nodes for UE.* calls used inside the helper body.
Source Hash Cache
The plugin tracks source hashes and dependency relationships. If relevant source content has not changed, regeneration can be reduced or skipped.
Material Reset
Generated assets are regenerated from source-defined values. Put settings, parameters, outputs, and layout that must survive regeneration into the source files.
Decompile Export
The plugin can export existing Material and Material Function assets as initial
.dsm / .dsf sources. Common nodes are converted to Graph syntax; unsupported nodes
fall back to generic UE.Expression(...) entries.