DreamShaderLang
Language Core

Sections

Semantics of sections inside Shader, ShaderFunction, and VirtualFunction declarations.

Sections describe the inside of an asset declaration. Not every declaration supports every section.

Properties

Properties declares material parameters and graph input nodes for Shader assets.

Properties = {
    vec3 Tint = vec3(1.0, 0.2, 0.2);
    float Strength = 1.0;
}

Explicit Unreal parameter nodes are also supported:

Properties = {
    VectorParameter Tint = float4(1, 0, 0, 1) [
        Group="Color";
        SortPriority=10;
    ];
}

Inputs

Inputs declares inputs for ShaderFunction, ShaderLayer, ShaderLayerBlend, and VirtualFunction.

Inputs = {
    vec3 Color;
    float Strength = 1.0;
}

Outputs

Outputs declares output variables and output bindings.

Outputs = {
    vec3 Color;
    Base.EmissiveColor = Color;
}

For material functions, bind the return output with return when needed:

Outputs = {
    vec3 Result;
    return = Result;
}

Settings

Settings maps to Unreal material settings:

Settings = {
    Domain = "UI";
    ShadingModel = "Unlit";
    BlendMode = "Translucent";
}

The available values depend on Unreal material settings and plugin support. See Material Settings.

Options

Options is for compiler or generator options that are not Unreal material settings. Use it only for behavior that should affect generation rather than the material asset's runtime settings.

Graph

Graph contains statements that generate Unreal material nodes:

Graph = {
    float t = UE.Time();
    Color = Tint * Strength;
}

It supports declarations, assignments, arithmetic expressions, function calls, UE.* node calls, and simple if / else.

Layout

Layout contains graph layout metadata:

Layout = {
    Node("Tint", X=0, Y=0);
    Comment("Color", X=-120, Y=-80, W=520, H=260);
}

Use it to keep generated graphs readable and to preserve decompiled layout hints.

Section Support Matrix

DeclarationPropertiesInputsOutputsSettingsGraphLayout
Shaderyesnoyesyesyesyes
ShaderFunctionnoyesyeslimitedyesyes
ShaderLayernoyesyesyesyesyes
ShaderLayerBlendnoyesyesyesyesyes
VirtualFunctionnoyesyesnonono

On this page