DreamShaderTypes.h
DreamShaderTypes.h
DreamShaderTypes.h
DreamShader » C++ API » DreamShaderTypes.h
The 1.x source data model. Through 1.9.x, FTextShaderParser::Parse filled these structs and the
generator built assets from them. Since 2.0 nothing parses into them: a 1.x source is read by the
legacy front end into the language module's AST (see the retired parser page). The
header stays because the compiler's asset layer still speaks it — BuildDefinitionForIRProduct fills
an FTextShaderDefinition (name, root, settings) from an IR product to resolve where an asset goes
and how its material is configured — and because the VirtualFunction tools and dump-graph in the
editor module still use a few of its structs and enums.
Defined in header DreamShaderTypes.h.
| Module | DreamShader (Runtime) |
| Include | #include "DreamShaderTypes.h" |
| Namespace | UE::DreamShader |
| Contents | 13 structs, 5 enums, 1 inline function, 1 free function, 2 member functions |
| Reflection | none — no USTRUCT, no UENUM, no UPROPERTY |
| Pulls in | CoreMinimal.h only |
[!NOTE] None of the structs carries
DREAMSHADER_API. They are header-only aggregates with implicit special member functions, so no exported symbol is needed to construct, copy or destroy them across a module boundary. Only three things in this header are exported:FTextShaderDefinition::TryGetSetting,FTextShaderDefinition::GetSettingandNormalizeSettingKey.
Declaration index
namespace UE::DreamShader
{
enum class ETextShaderPropertyType : uint8;
enum class ETextShaderTextureType : uint8;
enum class ETextShaderPropertySource : uint8;
enum class ETextShaderMaterialFunctionKind : uint8;
struct FTextShaderMetadata;
struct FTextShaderPropertyDefinition;
struct FTextShaderOutputBinding; // nests enum class ETargetKind : uint8
struct FTextShaderVariableDeclaration;
struct FTextShaderGraphRegion;
struct FTextShaderLayoutNode;
struct FTextShaderLayoutComment;
struct FTextShaderLayout;
struct FTextShaderFunctionParameter;
struct FTextShaderFunctionDefinition;
struct FTextShaderMaterialFunctionDefinition;
struct FTextShaderVirtualFunctionDefinition;
struct FTextShaderDefinition;
inline const TCHAR* LexToString(ETextShaderMaterialFunctionKind Kind);
DREAMSHADER_API FString NormalizeSettingKey(const FString& InKey);
}Enumerations
ETextShaderPropertyType
enum class ETextShaderPropertyType : uint8
{
Scalar,
Vector,
Texture2D,
};| Enumerator | Value | Meaning |
|---|---|---|
Scalar | 0 | Scalar-valued property — the float / int / bool families |
Vector | 1 | Vector-valued property — the float2 / float3 / float4 family |
Texture2D | 2 | Texture-valued property of any dimension; the dimension is carried separately in ETextShaderTextureType |
The Texture2D enumerator name is a historical spelling. A TextureCube or VolumeTexture property
also has Type == Texture2D.
ETextShaderTextureType
enum class ETextShaderTextureType : uint8
{
Texture2D,
TextureCube,
Texture2DArray,
VolumeTexture,
};| Enumerator | Value |
|---|---|
Texture2D | 0 |
TextureCube | 1 |
Texture2DArray | 2 |
VolumeTexture | 3 |
ETextShaderPropertySource
enum class ETextShaderPropertySource : uint8
{
Parameter,
UEBuiltin,
};| Enumerator | Value | Meaning |
|---|---|---|
Parameter | 0 | The property becomes a material parameter node |
UEBuiltin | 1 | The property is a UE.* builtin call bound to a name |
FTextShaderOutputBinding::ETargetKind
enum class ETargetKind : uint8
{
MaterialProperty,
ExpressionInput,
};| Enumerator | Value | Meaning |
|---|---|---|
MaterialProperty | 0 | The binding target is a material property, e.g. Base.BaseColor |
ExpressionInput | 1 | The binding target is an input pin on a named expression, e.g. Expression(Class="…").Pin[0] |
ETextShaderMaterialFunctionKind
enum class ETextShaderMaterialFunctionKind : uint8
{
ShaderFunction,
MaterialLayer,
MaterialLayerBlend,
};
inline const TCHAR* LexToString(const ETextShaderMaterialFunctionKind Kind);| Enumerator | Value | LexToString result | Generates |
|---|---|---|---|
ShaderFunction | 0 | "ShaderFunction" | UMaterialFunction |
MaterialLayer | 1 | "ShaderLayer" | UMaterialFunctionMaterialLayer |
MaterialLayerBlend | 2 | "ShaderLayerBlend" | UMaterialFunctionMaterialLayerBlend |
[!NOTE] The enumerator names still use the pre-1.3.0
MaterialLayer*spelling, butLexToStringprints the currentShaderLayer*spelling. Generated messages therefore sayShaderLayer, neverMaterialLayer, even for a source file that used the deprecated keyword. Thedefault:label shares theShaderFunctioncase, so an out-of-range value also prints"ShaderFunction".
Structures
[!NOTE] The Meaning columns below say what the 1.x parser stored in each member and how the 1.x generator read it. Since 2.0.0 no parse fills these structs; the few users left are named in the introduction and under Notes. The parse-time checks, warnings and source mapping mentioned here belonged to the retired parser: a 1.x source is now diagnosed by the legacy front end, with
DSHnnnncodes that carry the line and column of the construct.
FTextShaderMetadata
Declaration metadata attached to a property or a function parameter.
struct FTextShaderMetadata
{
FString Group;
bool bHasSortPriority = false;
int32 SortPriority = 32;
FString Description;
TMap<FString, FString> ReflectedProperties;
};| Member | Type | Default | Meaning |
|---|---|---|---|
Group | FString | "" | Parameter group. Inherited from an enclosing Properties Group("…") scope when the declaration does not set it explicitly. |
bHasSortPriority | bool | false | Whether SortPriority is meaningful. Set to true by an explicit SortPriority / Sort key, and also by the auto-numbering applied to declarations inside a Group("…") scope. A top-level (ungrouped) declaration that omits the key keeps false. |
SortPriority | int32 | 32 | Sort order within the group. |
Description | FString | "" | Tooltip / description text. |
ReflectedProperties | TMap<FString, FString> | empty | Arbitrary reflected UPROPERTY name → literal-text pairs from the [ … ] block. Keys are normalized with NormalizeSettingKey, i.e. trimmed and lower-cased. |
Keys the 1.x parser consumed itself, rather than putting them in ReflectedProperties: Group /
Category, Description, SortPriority / Sort, and the SliderMin / SliderMax pair produced
by Slider(min, max). See Metadata block.
FTextShaderPropertyDefinition
One entry of a Properties section.
struct FTextShaderPropertyDefinition
{
FString Name;
ETextShaderPropertySource Source = ETextShaderPropertySource::Parameter;
FString ParameterNodeType;
FString UEBuiltinFunctionName;
TMap<FString, FString> UEBuiltinArguments;
ETextShaderPropertyType Type = ETextShaderPropertyType::Scalar;
ETextShaderTextureType TextureType = ETextShaderTextureType::Texture2D;
bool bHasExplicitTextureType = false;
int32 ComponentCount = 1;
bool bConst = false;
bool bHasDefaultValue = false;
double ScalarDefaultValue = 0.0;
FLinearColor VectorDefaultValue = FLinearColor::White;
FString TextureDefaultObjectPath;
FTextShaderMetadata Metadata;
};| Member | Type | Default | Meaning |
|---|---|---|---|
Name | FString | "" | Property / parameter name as written. |
Source | ETextShaderPropertySource | Parameter | Parameter node vs. UE.* builtin. |
ParameterNodeType | FString | "" | The explicit Unreal expression-class token when the declaration names one, e.g. ScalarParameter, TextureSampleParameter2D. Empty for a compact type token. |
UEBuiltinFunctionName | FString | "" | Builtin name when Source == UEBuiltin. |
UEBuiltinArguments | TMap<FString, FString> | empty | Named arguments for that builtin, as raw text. |
Type | ETextShaderPropertyType | Scalar | Scalar / vector / texture family. |
TextureType | ETextShaderTextureType | Texture2D | Texture dimension. Meaningful only alongside bHasExplicitTextureType. |
bHasExplicitTextureType | bool | false | true only when the declared token names the dimension — Texture2D, TextureCube, Texture2DArray, VolumeTexture, or a TextureSampleParameter* variant. |
ComponentCount | int32 | 1 | 1–4 for scalar and vector properties. |
bConst | bool | false | Declared const — a constant node, not a parameter. |
bHasDefaultValue | bool | false | Whether the declaration carried = <value>. |
ScalarDefaultValue | double | 0.0 | Default for a scalar property. |
VectorDefaultValue | FLinearColor | FLinearColor::White | Default for a vector property. |
TextureDefaultObjectPath | FString | "" | Resolved object path from Path(...). |
Metadata | FTextShaderMetadata | default-constructed | The [ … ] block. |
Tokens such as TextureObjectParameter map to a single Unreal node class that can hold any texture
dimension. For those, bHasExplicitTextureType stayed false, TextureType stayed at its
Texture2D default, and the 1.x generator inferred the real dimension from the assigned default
asset rather than rejecting it. Since 2.0.0 the 1.x check of the class written in a texture default
against its property is made on the source before binding:
DSH1043 for a class that is not a texture,
DSH1044 for a texture class of another dimension.
FTextShaderOutputBinding
One <target> = <variable>; statement inside an Outputs section.
struct FTextShaderOutputBinding
{
enum class ETargetKind : uint8 { MaterialProperty, ExpressionInput };
ETargetKind TargetKind = ETargetKind::MaterialProperty;
FString MaterialProperty;
FString ExpressionClass;
TMap<FString, FString> ExpressionArguments;
int32 ExpressionPinIndex = INDEX_NONE;
FString TargetText;
FString SourceText;
};| Member | Type | Default | Meaning |
|---|---|---|---|
TargetKind | ETargetKind | MaterialProperty | Which of the two target forms was written. |
MaterialProperty | FString | "" | The material property name, e.g. Base.BaseColor. Used when TargetKind == MaterialProperty. |
ExpressionClass | FString | "" | Target expression class when TargetKind == ExpressionInput. |
ExpressionArguments | TMap<FString, FString> | empty | Constructor arguments for that expression, as raw text. |
ExpressionPinIndex | int32 | INDEX_NONE | Target input-pin index. 1.x rejected a negative or unparseable one at parse time. |
TargetText | FString | "" | Raw left-hand-side source text, which 1.x reproduced verbatim in diagnostics. |
SourceText | FString | "" | Raw right-hand-side source text — the expression the 1.x generator evaluated. |
FTextShaderVariableDeclaration
An output-variable declaration in an Outputs section.
struct FTextShaderVariableDeclaration
{
FString Type;
FString Name;
bool bHasDefaultValue = false;
FString DefaultValueText;
};| Member | Type | Default | Meaning |
|---|---|---|---|
Type | FString | "" | Type token, already run through the GLSL-alias normalization — vec3 arrives as float3. |
Name | FString | "" | Variable name. |
bHasDefaultValue | bool | false | Whether the declaration carried an initializer. A Shader with at least one initialized output declaration may omit its Graph block. |
DefaultValueText | FString | "" | The initializer expression, as raw text. |
FTextShaderGraphRegion
A #Region / #EndRegion span inside a Graph block.
struct FTextShaderGraphRegion
{
FString Name;
int32 StartLine = 1;
int32 EndLine = MAX_int32;
};| Member | Type | Default | Meaning |
|---|---|---|---|
Name | FString | "" | Region label; becomes the comment-box title. |
StartLine | int32 | 1 | 1-based, inclusive. |
EndLine | int32 | MAX_int32 | 1-based. An unterminated region therefore extends to the end of the graph. |
FTextShaderLayoutNode
One Node(Var=…, X=…, Y=…) directive.
struct FTextShaderLayoutNode
{
FString Var;
int32 X = 0;
int32 Y = 0;
};| Member | Type | Default | Meaning |
|---|---|---|---|
Var | FString | "" | The graph variable whose node is pinned. |
X | int32 | 0 | Editor X coordinate. |
Y | int32 | 0 | Editor Y coordinate. |
FTextShaderLayoutComment
One Comment(Name=…, X=…, Y=…, W=…, H=…) directive.
struct FTextShaderLayoutComment
{
FString Name;
int32 X = 0;
int32 Y = 0;
int32 W = 420;
int32 H = 240;
FLinearColor Color = FLinearColor(0.10f, 0.16f, 0.22f, 0.35f);
};| Member | Type | Default | Meaning |
|---|---|---|---|
Name | FString | "" | Comment-box text. |
X | int32 | 0 | Editor X coordinate. |
Y | int32 | 0 | Editor Y coordinate. |
W | int32 | 420 | Box width. |
H | int32 | 240 | Box height. |
Color | FLinearColor | (0.10, 0.16, 0.22, 0.35) | Box tint. |
FTextShaderLayout
The whole Layout section.
struct FTextShaderLayout
{
TArray<FTextShaderLayoutNode> Nodes;
TArray<FTextShaderLayoutComment> Comments;
};| Member | Type | Meaning |
|---|---|---|
Nodes | TArray<FTextShaderLayoutNode> | Pinned node positions, in declaration order. |
Comments | TArray<FTextShaderLayoutComment> | Comment boxes, in declaration order. |
A layout with neither nodes nor comments is treated as "no layout" and automatic placement runs instead. See Graph layout.
FTextShaderFunctionParameter
One entry of an Inputs, Outputs or Results section.
struct FTextShaderFunctionParameter
{
FString Type;
FString Name;
bool bOptional = false;
bool bHasDefaultValue = false;
FString DefaultValueText;
FTextShaderMetadata Metadata;
};| Member | Type | Default | Meaning |
|---|---|---|---|
Type | FString | "" | Type token, GLSL aliases already rewritten. |
Name | FString | "" | Parameter name. For a return-type-lowered Function, the synthetic result parameter is named __return. |
bOptional | bool | false | Declared opt. |
bHasDefaultValue | bool | false | Whether a preview/default value was given. |
DefaultValueText | FString | "" | That value, as raw text. |
Metadata | FTextShaderMetadata | default-constructed | The [ … ] block. |
FTextShaderFunctionDefinition
A Function or GraphFunction block — an HLSL helper, not an asset.
struct FTextShaderFunctionDefinition
{
FString Name;
bool bSelfContained = false;
TArray<FTextShaderFunctionParameter> Inputs;
TArray<FTextShaderFunctionParameter> Results;
FString HLSL;
TArray<FString> IncludePaths;
};| Member | Type | Default | Meaning |
|---|---|---|---|
Name | FString | "" | Function name. Qualified as Namespace::Function when declared inside a Namespace block. |
bSelfContained | bool | false | Set by the SelfContained or Inline modifier keyword. |
Inputs | TArray<FTextShaderFunctionParameter> | empty | in parameters — including the ones whose qualifier was implicit. |
Results | TArray<FTextShaderFunctionParameter> | empty | out parameters, plus the synthetic __return parameter when the declaration carried a return type. |
HLSL | FString | "" | The normalized body text. |
IncludePaths | TArray<FString> | empty | The #include lines at the very top of the body, stripped from HLSL: hoisted to the top of the generated .ush for a plain Function, onto the Custom node's include list for an embedded body. Virtual shader paths, quotes removed. |
FTextShaderMaterialFunctionDefinition
A ShaderFunction, ShaderLayer or ShaderLayerBlend block — each generates one asset.
struct FTextShaderMaterialFunctionDefinition
{
FString Name;
FString Root;
ETextShaderMaterialFunctionKind Kind = ETextShaderMaterialFunctionKind::ShaderFunction;
TArray<FTextShaderPropertyDefinition> Properties;
TArray<FTextShaderFunctionParameter> Inputs;
TArray<FTextShaderFunctionParameter> Outputs;
TMap<FString, FString> Settings;
FString Code;
int32 CodeStartIndex = INDEX_NONE;
TArray<FTextShaderGraphRegion> GraphRegions;
FTextShaderLayout Layout;
FString HLSL;
};| Member | Type | Default | Meaning |
|---|---|---|---|
Name | FString | "" | Asset path from the Name= attribute. |
Root | FString | "" | Package root from the Root= attribute. |
Kind | ETextShaderMaterialFunctionKind | ShaderFunction | Which of the three keywords was used. |
Properties | TArray<FTextShaderPropertyDefinition> | empty | Function-local property nodes. |
Inputs | TArray<FTextShaderFunctionParameter> | empty | The Inputs section. |
Outputs | TArray<FTextShaderFunctionParameter> | empty | The Outputs section. |
Settings | TMap<FString, FString> | empty | The Settings section. Keys are lower-cased by NormalizeSettingKey. |
Code | FString | "" | The Graph block body. |
CodeStartIndex | int32 | INDEX_NONE | Character offset of that body in the prepared source, from which 1.x worked out the line of a graph diagnostic. Nothing reads it since 2.0.0. |
GraphRegions | TArray<FTextShaderGraphRegion> | empty | #Region spans. |
Layout | FTextShaderLayout | default-constructed | The Layout section. |
HLSL | FString | "" | Never populated by the 1.x parser. |
FTextShaderVirtualFunctionDefinition
A VirtualFunction block — a declaration of an existing UMaterialFunction; generates nothing.
struct FTextShaderVirtualFunctionDefinition
{
FString Name;
FString Asset;
TArray<FTextShaderFunctionParameter> Inputs;
TArray<FTextShaderFunctionParameter> Outputs;
TMap<FString, FString> Options;
};| Member | Type | Default | Meaning |
|---|---|---|---|
Name | FString | "" | The name callable from Graph. Required; without one the legacy front end reports DSH6311. |
Asset | FString | "" | Resolved object path of the target UMaterialFunction. Required, from the Asset= attribute or Options.Asset; without one, DSH6312. |
Inputs | TArray<FTextShaderFunctionParameter> | empty | Declared inputs. Properties is accepted as a synonym for this section. |
Outputs | TArray<FTextShaderFunctionParameter> | empty | Declared outputs. Must be non-empty; otherwise DSH6313. |
Options | TMap<FString, FString> | empty | The Options section. Keys are lower-cased by NormalizeSettingKey. |
FTextShaderDefinition
The root of the parse result: one whole translation unit.
struct FTextShaderDefinition
{
FString Name;
FString Root;
TArray<FTextShaderPropertyDefinition> Properties;
TMap<FString, FString> Settings;
TArray<FTextShaderVariableDeclaration> OutputDeclarations;
TArray<FTextShaderOutputBinding> Outputs;
FString Code;
int32 CodeStartIndex = INDEX_NONE;
TArray<FTextShaderGraphRegion> GraphRegions;
FTextShaderLayout Layout;
FString HLSL;
TArray<FTextShaderFunctionDefinition> Functions;
TArray<FTextShaderFunctionDefinition> GraphFunctions;
TArray<FTextShaderMaterialFunctionDefinition> MaterialFunctions;
TArray<FTextShaderVirtualFunctionDefinition> VirtualFunctions;
TArray<FString> Warnings;
DREAMSHADER_API bool TryGetSetting(const TCHAR* Key, FString& OutValue) const;
DREAMSHADER_API FString GetSetting(const TCHAR* Key, const TCHAR* DefaultValue = TEXT("")) const;
};| Member | Type | Default | Meaning |
|---|---|---|---|
Name | FString | "" | The top-level Shader(Name="…"). Empty means the unit declares no material — the usual test for "is there a Shader here". |
Root | FString | "" | Shader(Root="…"). |
Properties | TArray<FTextShaderPropertyDefinition> | empty | The Shader's Properties section. |
Settings | TMap<FString, FString> | empty | The Shader's Settings section. Keys are lower-cased. |
OutputDeclarations | TArray<FTextShaderVariableDeclaration> | empty | Output-variable declarations. |
Outputs | TArray<FTextShaderOutputBinding> | empty | Output bindings. In 1.x an empty array produced a parse warning and a generation error; since 2.0.0 a Shader with no Outputs section is warning DSH2256. |
Code | FString | "" | The Graph block body. |
CodeStartIndex | int32 | INDEX_NONE | Character offset of that body in the prepared source, from which 1.x worked out the line of a graph diagnostic. Nothing reads it since 2.0.0. |
GraphRegions | TArray<FTextShaderGraphRegion> | empty | #Region spans. |
Layout | FTextShaderLayout | default-constructed | The Layout section. |
HLSL | FString | "" | Never populated by the 1.x parser. |
Functions | TArray<FTextShaderFunctionDefinition> | empty | Function blocks. |
GraphFunctions | TArray<FTextShaderFunctionDefinition> | empty | GraphFunction blocks. |
MaterialFunctions | TArray<FTextShaderMaterialFunctionDefinition> | empty | ShaderFunction / ShaderLayer / ShaderLayerBlend blocks, in declaration order. |
VirtualFunctions | TArray<FTextShaderVirtualFunctionDefinition> | empty | VirtualFunction blocks. |
Warnings | TArray<FString> | empty | Non-fatal diagnostics the 1.x parse collected; they never made Parse return false. Never filled since 2.0.0. |
TryGetSetting
bool TryGetSetting(const TCHAR* Key, FString& OutValue) const;Parameter Key | Setting key in any casing, with or without surrounding whitespace |
Parameter OutValue | Receives the stored value on a hit; left untouched on a miss |
| Returns | true if Settings contains NormalizeSettingKey(Key) |
| Constness | const, pure, any thread |
GetSetting
FString GetSetting(const TCHAR* Key, const TCHAR* DefaultValue = TEXT("")) const;Parameter Key | As above |
Parameter DefaultValue | Returned on a miss. Defaults to the empty string |
| Returns | The stored value, or DefaultValue |
| Constness | const, pure, any thread |
Because both the stored keys and the query pass through NormalizeSettingKey, lookup is
case-insensitive and whitespace-trimmed. It is not insensitive to interior spaces,
underscores or hyphens: Two Sided and TwoSided remain distinct keys.
NormalizeSettingKey
DREAMSHADER_API FString NormalizeSettingKey(const FString& InKey);Trims leading and trailing whitespace, then lower-cases. That is the whole operation.
| Input | Result |
|---|---|
" ShadingModel " | "shadingmodel" |
"TWOSIDED" | "twosided" |
"Two Sided" | "two sided" |
"Two_Sided" | "two_sided" |
[!WARNING]
NormalizeSettingKeyandUDreamShaderSettings::NormalizeMappingKeyare not interchangeable. The latter additionally strips every space,_and-, and applies to setting values (enum aliases), not keys. Using the wrong one turnsTwo Sided Foliageinto a lookup miss. The four normalizing helpers are compared side by side inDreamShaderModule.h.
Every TMap<FString, FString> in this header that holds settings or options —
FTextShaderDefinition::Settings, FTextShaderMaterialFunctionDefinition::Settings,
FTextShaderVirtualFunctionDefinition::Options and FTextShaderMetadata::ReflectedProperties — has
its keys normalized this way before storage. Read those maps directly only through a normalized key.
Notes
- Most members are vestigial in 2.0. The compiler fills
Name,RootandSettingsof anFTextShaderDefinition(and the kind, name, root and settings of anFTextShaderMaterialFunctionDefinition) and nothing else: properties, outputs, graph code and layout travel as IR. Do not expect a definition obtained from the compiler to describe the source. Outside a definition, theClassicgraph layout fills anFTextShaderLayoutfrom the IR's layout hints, and the VirtualFunction tools fillFTextShaderVirtualFunctionDefinition/FTextShaderFunctionParameterfrom a declaration they parse with the legacy front end. - The structs have no reflection, no
Serialize, and nooperator==. They are not network-replicated, not saveable, and not comparable without writing a comparison yourself. - The 1.x parser normalized type tokens before anything landed in a
Typefield:vec3becamefloat3,mat4becamefloat4x4, and so on. Since 2.0.0 a GLSL spelling in 1.x text is read as its HLSL type withDSH5277. See Types. - Container order was source order, and 1.x generated
MaterialFunctionsfront to back. Since 2.0.0 the assets of one file are built in call order — a function another one calls is built first — and functions that call each other in a cycle areDSH8299. - Every struct is copyable and movable with the compiler-generated operations. Copies are deep —
the members are
FString,TArrayandTMapvalues, not pointers.
Example
Reading a definition:
#include "DreamShaderTypes.h"
using namespace UE::DreamShader;
void Describe(const FTextShaderDefinition& Definition)
{
if (!Definition.Name.IsEmpty())
{
// Case-insensitive; "backend", "Backend" and " BACKEND " all hit.
const FString Backend = Definition.GetSetting(TEXT("Backend"), TEXT("<project default>"));
UE_LOG(LogDreamShader, Display, TEXT("Shader '%s' (Root='%s', Backend=%s): %d propert(ies), %d binding(s)"),
*Definition.Name,
*Definition.Root,
*Backend,
Definition.Properties.Num(),
Definition.Outputs.Num());
}
for (const FTextShaderMaterialFunctionDefinition& Function : Definition.MaterialFunctions)
{
UE_LOG(LogDreamShader, Display, TEXT(" %s '%s'"), LexToString(Function.Kind), *Function.Name);
}
for (const FString& Warning : Definition.Warnings)
{
UE_LOG(LogDreamShader, Warning, TEXT(" %s"), *Warning);
}
}For the source in Generation, as the 1.x parser filled the definition, this printed:
LogDreamShader: Shader 'Materials/M_Emissive' (Root='', Backend=<project default>): 1 propert(ies), 1 binding(s)
LogDreamShader: ShaderFunction 'Functions/F_Tint'A definition the 2.0 compiler builds carries only Name, Root and Settings — and Settings
never holds Backend, which the binder takes out onto the IR product — so it prints
Backend=<project default>, both counts are 0 and nothing else is listed.
See also
DreamShaderParser.h— retired in 2.0; what reads a 1.x source nowDreamShaderModule.h—SanitizeIdentifierand the normalizer comparisonDreamShaderSettings.h—NormalizeMappingKeyand the enum-alias catalogues- Properties — the grammar behind
FTextShaderPropertyDefinition - Inputs / Outputs / Results — the grammar behind
FTextShaderFunctionParameter - Output bindings — the grammar behind
FTextShaderOutputBinding - Layout —
Node,Commentand#Region - Metadata block — what lands in
FTextShaderMetadata - Types — the token normalization applied before a
Typefield is filled - Settings — key normalization from the language side