UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
MaterialExpressionSubstrate.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
8#include "SubstrateDefinitions.h"
9#include "MaterialExpressionSubstrate.generated.h"
10
14
15UENUM()
17{
18 MSS_None = SSS_TYPE_NONE UMETA(DisplayName="None"),
19 MSS_Wrap = SSS_TYPE_WRAP UMETA(DisplayName="Wrap", ToolTip="Approximation using wrap-lighting. "),
20 MSS_TwoSidedWrap = SSS_TYPE_TWO_SIDED_WRAP UMETA(DisplayName="Two-Sided Wrap", ToolTip="Approximation using wrap-lighting and handling thin surface (e.g.: foliage)"),
21 MSS_Diffusion = SSS_TYPE_DIFFUSION UMETA(DisplayName="Diffusion", ToolTip="Diffusion based sub-surface scattering"),
23 MSS_SimpleVolume = SSS_TYPE_SIMPLEVOLUME UMETA(DisplayName="Simple Volume", ToolTip="Approximation of optically thin slab (e.g.: glass) where light is visible through the material"),
25};
26
28
30// Functions
31
32#if WITH_EDITOR
33
35
37
38#endif
39
49extern int32 CompileSubstrateBlendFunction(FMaterialCompiler* Compiler, const int32 A, const int32 B, const int32 Alpha);
50
51
52
54// BSDF nodes
55
56// UMaterialExpressionSubstrateBSDF can only be used for Substrate nodes ouputing SubstrateData that would need a preview,
57UCLASS(MinimalAPI, collapsecategories, hidecategories = Object, Abstract, DisplayName = "Substrate Expression")
59{
61
62#if WITH_EDITOR
63 virtual int32 CompilePreview(class FMaterialCompiler* Compiler, int32 OutputIndex) override;
64#endif
65
66 float DielectricSpecularToF0(float SpecularIn)
67 {
68 return 0.08f * SpecularIn;
69 };
70};
71
72
73UCLASS(MinimalAPI, collapsecategories, hidecategories = Object, DisplayName = "Substrate Shading Models")
75{
77
78
81 UPROPERTY()
83
87 UPROPERTY()
89
93 UPROPERTY()
95
99 UPROPERTY()
101
105 UPROPERTY()
107
111 UPROPERTY()
112 FExpressionInput EmissiveColor;
113
117 UPROPERTY()
119
123 UPROPERTY()
125
129 UPROPERTY()
130 FExpressionInput SubSurfaceColor;
131
135 UPROPERTY()
137
141 UPROPERTY()
142 FExpressionInput ClearCoatRoughness;
143
147 UPROPERTY()
149
153 UPROPERTY()
154 FExpressionInput TransmittanceColor;
155
159 UPROPERTY()
160 FExpressionInput WaterScatteringCoefficients;
161
165 UPROPERTY()
166 FExpressionInput WaterAbsorptionCoefficients;
167
171 UPROPERTY()
172 FExpressionInput WaterPhaseG;
173
177 UPROPERTY()
178 FExpressionInput ColorScaleBehindWater;
179
183 UPROPERTY()
184 FExpressionInput ClearCoatNormal;
185
189 UPROPERTY()
190 FExpressionInput CustomTangent;
191
195 UPROPERTY()
197
201 UPROPERTY()
202 FExpressionInput ThinTranslucentSurfaceCoverage;
203
204 // Always show at the bottom of the pin list
205 UPROPERTY(EditAnywhere, Category = ShadingModel, meta = (ShowAsInputPin = "Primary", DisplayName = "Single Shading Model"))
207
209 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Material, meta = (DisplayName = "Subsurface Profile"))
211
212 //~ Begin UMaterialExpression Interface
213#if WITH_EDITOR
214 virtual FExpressionInput* GetInput(int32 InputIndex) override;
215 virtual int32 Compile(class FMaterialCompiler* Compiler, int32 OutputIndex) override;
216 virtual void GetCaption(TArray<FString>& OutCaptions) const override;
217 virtual EMaterialValueType GetOutputValueType(int32 OutputIndex) override;
218 virtual EMaterialValueType GetInputValueType(int32 InputIndex) override;
219 virtual bool IsResultSubstrateMaterial(int32 OutputIndex) override;
222 virtual FName GetInputName(int32 InputIndex) const override;
223 virtual void GetConnectorToolTip(int32 InputIndex, int32 OutputIndex, TArray<FString>& OutToolTip) override;
224 virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
225
226 bool HasSSS() const;
227 bool HasAnisotropy() const;
228
230 class FMaterialCompiler* Compiler, struct FGuid ThisExpressionGuid, class UMaterialExpression* Parent, int32 OutputIndex,
231 const FExpressionInput& EmissiveColor,
233 const FExpressionInput& ClearCoatNormal,
234 const FExpressionInput& CustomTangent,
236
237 static int32 CompileCommon(class FMaterialCompiler* Compiler,
241 FExpressionInput& TransmittanceColor, FExpressionInput& ThinTranslucentSurfaceCoverage,
242 FExpressionInput& WaterScatteringCoefficients, FExpressionInput& WaterAbsorptionCoefficients, FExpressionInput& WaterPhaseG, FExpressionInput& ColorScaleBehindWater,
245 FExpressionInput& ClearCoatNormal, FExpressionInput& CustomTangent,
247 const class UMaterialEditorOnlyData* EditorOnlyData = nullptr /*Used to provide default values from the root node pins*/);
248#endif
249 //~ End UMaterialExpression Interface
250};
251
252UCLASS(MinimalAPI, collapsecategories, hidecategories = Object, DisplayName = "Substrate Slab")
254{
256
257
260 UPROPERTY()
261 FExpressionInput DiffuseAlbedo;
262
266 UPROPERTY()
268
272 UPROPERTY()
274
278 UPROPERTY()
280
284 UPROPERTY()
286
290 UPROPERTY()
292
296 UPROPERTY()
298
304 UPROPERTY()
305 FExpressionInput SSSMFP;
306
310 UPROPERTY()
311 FExpressionInput SSSMFPScale;
312
316 UPROPERTY()
317 FExpressionInput SSSPhaseAnisotropy;
318
322 UPROPERTY()
323 FExpressionInput EmissiveColor;
324
328 UPROPERTY()
329 FExpressionInput SecondRoughness;
330
334 UPROPERTY()
335 FExpressionInput SecondRoughnessWeight;
336
340 UPROPERTY()
341 FExpressionInput FuzzRoughness;
342
346 UPROPERTY()
347 FExpressionInput FuzzAmount;
348
352 UPROPERTY()
353 FExpressionInput FuzzColor;
354
358 UPROPERTY()
359 FExpressionInput GlintValue;
360
364 UPROPERTY()
365 FExpressionInput GlintUV;
366
368 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Material, meta = (DisplayName = "Subsurface Profile"))
370
372 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Material, meta = (DisplayName = "Specular Profile"))
374
375 UE_DEPRECATED(5.6, "Please, use SubSurfaceType to enable/disable SSS-diffusion")
376 UPROPERTY()
377 uint32 bUseSSSDiffusion : 1;
378
383 UPROPERTY(EditAnywhere, Category = Material, meta = (DisplayName = "Sub-Surface Type"))
385
386 //~ Begin UMaterialExpression Interface
387#if WITH_EDITOR
388 virtual int32 Compile(class FMaterialCompiler* Compiler, int32 OutputIndex) override;
389 virtual void GetCaption(TArray<FString>& OutCaptions) const override;
390 virtual EMaterialValueType GetOutputValueType(int32 OutputIndex) override;
391 virtual EMaterialValueType GetInputValueType(int32 InputIndex) override;
392 virtual bool IsResultSubstrateMaterial(int32 OutputIndex) override;
395 virtual FName GetInputName(int32 InputIndex) const override;
396 virtual void GetConnectorToolTip(int32 InputIndex, int32 OutputIndex, TArray<FString>& OutToolTip) override;
397 virtual void GetExpressionToolTip(TArray<FString>& OutToolTip) override;
398 virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
399
400 bool HasEdgeColor() const;
401 bool HasFuzz() const;
402 bool HasFuzzRoughness() const;
403 bool HasSecondRoughness() const;
404 bool HasSSS() const;
405 bool HasSSSProfile() const;
406 bool HasMFPPluggedIn() const;
407 bool HasAnisotropy() const;
408 bool HasGlint() const;
409 bool HasSpecularProfile() const;
410
412#endif
413 //~ End UMaterialExpression Interface
414};
415
416UCLASS(MinimalAPI, collapsecategories, hidecategories = Object, DisplayName = "Substrate Simple Clear Coat")
418{
420
421
424 UPROPERTY()
425 FExpressionInput DiffuseAlbedo;
426
430 UPROPERTY()
432
436 UPROPERTY()
438
442 UPROPERTY()
443 FExpressionInput ClearCoatCoverage;
444
448 UPROPERTY()
449 FExpressionInput ClearCoatRoughness;
450
454 UPROPERTY()
456
460 UPROPERTY()
461 FExpressionInput EmissiveColor;
462
466 UPROPERTY()
467 FExpressionInput BottomNormal;
468
469 //~ Begin UMaterialExpression Interface
470#if WITH_EDITOR
471 virtual int32 Compile(class FMaterialCompiler* Compiler, int32 OutputIndex) override;
472 virtual void GetCaption(TArray<FString>& OutCaptions) const override;
473 virtual EMaterialValueType GetOutputValueType(int32 OutputIndex) override;
474 virtual EMaterialValueType GetInputValueType(int32 InputIndex) override;
475 virtual bool IsResultSubstrateMaterial(int32 OutputIndex) override;
478 virtual FName GetInputName(int32 InputIndex) const override;
479 virtual void GetExpressionToolTip(TArray<FString>& OutToolTip) override;
480#endif
481 //~ End UMaterialExpression Interface
482};
483
484UCLASS(MinimalAPI, collapsecategories, hidecategories = Object, DisplayName = "Substrate Volumetric-Fog-Cloud BSDF")
486{
488
489
492 UPROPERTY()
494
498 UPROPERTY()
499 FExpressionInput Extinction;
500
504 UPROPERTY()
505 FExpressionInput EmissiveColor;
506
510 UPROPERTY()
512
514 UPROPERTY(EditAnywhere, Category = Shading, meta = (DisplayName = "Unlit (EmissiveOnly)"))
516
517 //~ Begin UMaterialExpression Interface
518#if WITH_EDITOR
519 virtual int32 Compile(class FMaterialCompiler* Compiler, int32 OutputIndex) override;
520 virtual void GetCaption(TArray<FString>& OutCaptions) const override;
521 virtual EMaterialValueType GetOutputValueType(int32 OutputIndex) override;
522 virtual EMaterialValueType GetInputValueType(int32 InputIndex) override;
523 virtual bool IsResultSubstrateMaterial(int32 OutputIndex) override;
526
528 class FMaterialCompiler* Compiler, struct FGuid ThisExpressionGuid, class UMaterialExpression* Parent, int32 OutputIndex,
529 const FExpressionInput& EmissiveColor,
531
532 static int32 CompileCommon(class FMaterialCompiler* Compiler,
534 bool bEmissiveOnly,
535 const class UMaterialEditorOnlyData* EditorOnlyData = nullptr /*Used to provide default values from the root node pins*/);
536#endif
537 //~ End UMaterialExpression Interface
538};
539
540UCLASS(MinimalAPI, collapsecategories, hidecategories = Object, DisplayName = "Substrate Unlit BSDF")
542{
544
545
548 UPROPERTY()
549 FExpressionInput EmissiveColor;
550
554 UPROPERTY()
555 FExpressionInput TransmittanceColor;
556
560 UPROPERTY()
562
563 //~ Begin UMaterialExpression Interface
564#if WITH_EDITOR
565 virtual int32 Compile(class FMaterialCompiler* Compiler, int32 OutputIndex) override;
566 virtual void GetCaption(TArray<FString>& OutCaptions) const override;
567 virtual EMaterialValueType GetOutputValueType(int32 OutputIndex) override;
568 virtual EMaterialValueType GetInputValueType(int32 InputIndex) override;
569 virtual bool IsResultSubstrateMaterial(int32 OutputIndex) override;
572#endif
573 //~ End UMaterialExpression Interface
574};
575
576UCLASS(MinimalAPI, collapsecategories, hidecategories = Object, DisplayName = "Substrate Hair BSDF")
578{
580
581
584 UPROPERTY()
586
590 UPROPERTY()
592
596 UPROPERTY()
598
602 UPROPERTY()
604
608 UPROPERTY()
609 FExpressionInput Backlit;
610
614 UPROPERTY()
616
620 UPROPERTY()
621 FExpressionInput EmissiveColor;
622
623 //~ Begin UMaterialExpression Interface
624#if WITH_EDITOR
625 virtual int32 Compile(class FMaterialCompiler* Compiler, int32 OutputIndex) override;
626 virtual void GetCaption(TArray<FString>& OutCaptions) const override;
627 virtual EMaterialValueType GetOutputValueType(int32 OutputIndex) override;
628 virtual EMaterialValueType GetInputValueType(int32 InputIndex) override;
629 virtual bool IsResultSubstrateMaterial(int32 OutputIndex) override;
632#endif
633 //~ End UMaterialExpression Interface
634};
635
636UCLASS(MinimalAPI, collapsecategories, hidecategories = Object, DisplayName = "Substrate Eye BSDF")
638{
640
641
644 UPROPERTY()
645 FExpressionInput DiffuseColor;
646
650 UPROPERTY()
652
656 UPROPERTY()
657 FExpressionInput CorneaNormal;
658
662 UPROPERTY()
663 FExpressionInput IrisNormal;
664
668 UPROPERTY()
669 FExpressionInput IrisPlaneNormal;
670
674 UPROPERTY()
675 FExpressionInput IrisMask;
676
680 UPROPERTY()
681 FExpressionInput IrisDistance;
682
686 UPROPERTY()
687 FExpressionInput EmissiveColor;
688
690 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Material, meta = (DisplayName = "Subsurface Profile"))
692
693 //~ Begin UMaterialExpression Interface
694#if WITH_EDITOR
695 virtual int32 Compile(class FMaterialCompiler* Compiler, int32 OutputIndex) override;
696 virtual void GetCaption(TArray<FString>& OutCaptions) const override;
697 virtual EMaterialValueType GetOutputValueType(int32 OutputIndex) override;
698 virtual EMaterialValueType GetInputValueType(int32 InputIndex) override;
699 virtual bool IsResultSubstrateMaterial(int32 OutputIndex) override;
702#endif
703 //~ End UMaterialExpression Interface
704};
705
706UCLASS(MinimalAPI, collapsecategories, hidecategories = Object, DisplayName = "Substrate Single Layer Water BSDF")
708{
710
711
714 UPROPERTY()
716
720 UPROPERTY()
722
726 UPROPERTY()
728
732 UPROPERTY()
734
738 UPROPERTY()
740
744 UPROPERTY()
745 FExpressionInput EmissiveColor;
746
750 UPROPERTY()
751 FExpressionInput TopMaterialOpacity;
752
756 UPROPERTY()
757 FExpressionInput WaterAlbedo;
758
762 UPROPERTY()
763 FExpressionInput WaterExtinction;
764
768 UPROPERTY()
769 FExpressionInput WaterPhaseG;
770
774 UPROPERTY()
775 FExpressionInput ColorScaleBehindWater;
776
777 //~ Begin UMaterialExpression Interface
778#if WITH_EDITOR
779 virtual int32 Compile(class FMaterialCompiler* Compiler, int32 OutputIndex) override;
780 virtual void GetCaption(TArray<FString>& OutCaptions) const override;
781 virtual EMaterialValueType GetOutputValueType(int32 OutputIndex) override;
782 virtual EMaterialValueType GetInputValueType(int32 InputIndex) override;
783 virtual bool IsResultSubstrateMaterial(int32 OutputIndex) override;
786#endif
787 //~ End UMaterialExpression Interface
788};
789
790UCLASS(MinimalAPI, collapsecategories, hidecategories = Object, DisplayName = "Substrate Light Function")
792{
794
795
798 UPROPERTY()
800
801 //~ Begin UMaterialExpression Interface
802#if WITH_EDITOR
803 virtual int32 Compile(class FMaterialCompiler* Compiler, int32 OutputIndex) override;
804 virtual void GetCaption(TArray<FString>& OutCaptions) const override;
805 virtual EMaterialValueType GetOutputValueType(int32 OutputIndex) override;
806 virtual EMaterialValueType GetInputValueType(int32 InputIndex) override;
807 virtual bool IsResultSubstrateMaterial(int32 OutputIndex) override;
810
812 class FMaterialCompiler* Compiler, struct FGuid ThisExpressionGuid, class UMaterialExpression* Parent, int32 OutputIndex);
813
814 static int32 CompileCommon(class FMaterialCompiler* Compiler,
816 const UMaterialEditorOnlyData* EditorOnlyData = nullptr);
817
818#endif
819 //~ End UMaterialExpression Interface
820};
821
822UCLASS(MinimalAPI, collapsecategories, hidecategories = Object, DisplayName = "Substrate Post Process")
824{
826
827
830 UPROPERTY()
832
836 UPROPERTY()
838
839 //~ Begin UMaterialExpression Interface
840#if WITH_EDITOR
841 virtual int32 Compile(class FMaterialCompiler* Compiler, int32 OutputIndex) override;
842 virtual void GetCaption(TArray<FString>& OutCaptions) const override;
843 virtual EMaterialValueType GetOutputValueType(int32 OutputIndex) override;
844 virtual EMaterialValueType GetInputValueType(int32 InputIndex) override;
845 virtual bool IsResultSubstrateMaterial(int32 OutputIndex) override;
848
850 class FMaterialCompiler* Compiler, struct FGuid ThisExpressionGuid, class UMaterialExpression* Parent, int32 OutputIndex);
851
852 static int32 CompileCommon(class FMaterialCompiler* Compiler,
854 const UMaterialEditorOnlyData* EditorOnlyData = nullptr);
855#endif
856 //~ End UMaterialExpression Interface
857};
858
859UCLASS(MinimalAPI, collapsecategories, hidecategories = Object, DisplayName = "Substrate UI")
861{
863
864
867 UPROPERTY()
869
873 UPROPERTY()
875
876 //~ Begin UMaterialExpression Interface
877#if WITH_EDITOR
878 virtual int32 Compile(class FMaterialCompiler* Compiler, int32 OutputIndex) override;
879 virtual void GetCaption(TArray<FString>& OutCaptions) const override;
880 virtual EMaterialValueType GetOutputValueType(int32 OutputIndex) override;
881 virtual EMaterialValueType GetInputValueType(int32 InputIndex) override;
882 virtual bool IsResultSubstrateMaterial(int32 OutputIndex) override;
885
887 class FMaterialCompiler* Compiler, struct FGuid ThisExpressionGuid, class UMaterialExpression* Parent, int32 OutputIndex);
888
889 static int32 CompileCommon(class FMaterialCompiler* Compiler,
891 const UMaterialEditorOnlyData* EditorOnlyData = nullptr);
892#endif
893 //~ End UMaterialExpression Interface
894};
895
896UCLASS(MinimalAPI, collapsecategories, hidecategories = Object, DisplayName = "Substrate Convert To Decal")
898{
900
901
904 UPROPERTY()
906
910 UPROPERTY()
912
913 //~ Begin UMaterialExpression Interface
914#if WITH_EDITOR
915 virtual int32 Compile(class FMaterialCompiler* Compiler, int32 OutputIndex) override;
916 virtual void GetCaption(TArray<FString>& OutCaptions) const override;
917 virtual EMaterialValueType GetOutputValueType(int32 OutputIndex) override;
918 virtual EMaterialValueType GetInputValueType(int32 InputIndex) override;
919 virtual bool IsResultSubstrateMaterial(int32 OutputIndex) override;
922#endif
923 //~ End UMaterialExpression Interface
924};
925
928{
930
931 UPROPERTY()
933
937 UPROPERTY()
938 FExpressionInput WaterScatteringCoefficients;
939
943 UPROPERTY()
944 FExpressionInput WaterAbsorptionCoefficients;
945
949 UPROPERTY()
950 FExpressionInput WaterPhaseG;
951
955 UPROPERTY()
956 FExpressionInput ColorScaleBehindWater;
957
959 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Material, meta = (DisplayName = "Subsurface Profile"))
961
962 UPROPERTY(EditAnywhere, Category = ShadingModel, meta = (ShowAsInputPin = "Primary", DisplayName = "Single Shading Model"))
964
965 //~ Begin UMaterialExpression Interface
966#if WITH_EDITOR
967 virtual FExpressionInput* GetInput(int32 InputIndex) override;
968 virtual int32 Compile(class FMaterialCompiler* Compiler, int32 OutputIndex) override;
971 virtual void GetCaption(TArray<FString>& OutCaptions) const override;
972 virtual EMaterialValueType GetOutputValueType(int32 OutputIndex) override;
973 virtual EMaterialValueType GetInputValueType(int32 InputIndex) override;
974 virtual FName GetInputName(int32 InputIndex) const override;
975 virtual bool IsResultSubstrateMaterial(int32 OutputIndex) override;
976 virtual bool IsResultMaterialAttributes(int32 OutputIndex) override;
979 virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
980 virtual void GetConnectorToolTip(int32 InputIndex, int32 OutputIndex, TArray<FString>& OutToolTip) override;
981 virtual bool IsInputConnectionRequired(int32 InputIndex) const override {return true;}
982
983 bool HasSSS() const;
984
986 class FMaterialCompiler* Compiler, struct FGuid ThisExpressionGuid, class UMaterialExpression* Parent, int32 OutputIndex,
988
989 static int32 CompileCommon(class FMaterialCompiler* Compiler, int32 OutputIndex,
991 FExpressionInput& WaterScatteringCoefficients, FExpressionInput& WaterAbsorptionCoefficients, FExpressionInput& WaterPhaseG, FExpressionInput& ColorScaleBehindWater,
993 FExpressionInput& ClearCoatNormal, FExpressionInput& CustomTangent);
994
995#endif // WITH_EDITOR
996 //~ End UMaterialExpression Interface
997};
998
999
1000
1002// Operator nodes
1003
1004UCLASS(MinimalAPI, collapsecategories, hidecategories = Object, DisplayName = "Substrate Horizontal Blend")
1006{
1008
1009
1012 UPROPERTY()
1014
1018 UPROPERTY()
1020
1024 UPROPERTY()
1026
1030 UPROPERTY(EditAnywhere, Category = Mode)
1031 uint32 bUseParameterBlending : 1;
1032
1033 //~ Begin UMaterialExpression Interface
1034#if WITH_EDITOR
1035 virtual int32 Compile(class FMaterialCompiler* Compiler, int32 OutputIndex) override;
1036 virtual void GetCaption(TArray<FString>& OutCaptions) const override;
1037 virtual EMaterialValueType GetOutputValueType(int32 OutputIndex) override;
1038 virtual EMaterialValueType GetInputValueType(int32 InputIndex) override;
1039 virtual bool IsResultSubstrateMaterial(int32 OutputIndex) override;
1041 virtual FSubstrateOperator* SubstrateGenerateMaterialTopologyTree(class FMaterialCompiler* Compiler, class UMaterialExpression* Parent, int32 OutputIndex) override;
1042#endif
1043 //~ End UMaterialExpression Interface
1044};
1045
1046UCLASS(MinimalAPI, collapsecategories, hidecategories = Object, DisplayName = "Substrate Vertical Layer")
1048{
1050
1051
1054 UPROPERTY()
1056
1060 UPROPERTY()
1062
1067 UPROPERTY()
1068 FExpressionInput Thickness;
1069
1073 UPROPERTY(EditAnywhere, Category = Mode)
1074 uint32 bUseParameterBlending : 1;
1075
1076 //~ Begin UMaterialExpression Interface
1077#if WITH_EDITOR
1078 virtual int32 Compile(class FMaterialCompiler* Compiler, int32 OutputIndex) override;
1079 virtual void GetCaption(TArray<FString>& OutCaptions) const override;
1080 virtual EMaterialValueType GetOutputValueType(int32 OutputIndex) override;
1081 virtual EMaterialValueType GetInputValueType(int32 InputIndex) override;
1082 virtual bool IsResultSubstrateMaterial(int32 OutputIndex) override;
1085 virtual FName GetInputName(int32 InputIndex) const override;
1086#endif
1087 //~ End UMaterialExpression Interface
1088};
1089
1090UCLASS(MinimalAPI, collapsecategories, hidecategories = Object, DisplayName = "Substrate Add")
1092{
1094
1095
1098 UPROPERTY()
1100
1104 UPROPERTY()
1106
1110 UPROPERTY(EditAnywhere, Category = Mode)
1111 uint32 bUseParameterBlending : 1;
1112
1113 //~ Begin UMaterialExpression Interface
1114#if WITH_EDITOR
1115 virtual int32 Compile(class FMaterialCompiler* Compiler, int32 OutputIndex) override;
1116 virtual void GetCaption(TArray<FString>& OutCaptions) const override;
1117 virtual EMaterialValueType GetOutputValueType(int32 OutputIndex) override;
1118 virtual EMaterialValueType GetInputValueType(int32 InputIndex) override;
1119 virtual bool IsResultSubstrateMaterial(int32 OutputIndex) override;
1121 virtual FSubstrateOperator* SubstrateGenerateMaterialTopologyTree(class FMaterialCompiler* Compiler, class UMaterialExpression* Parent, int32 OutputIndex) override;
1122#endif
1123 //~ End UMaterialExpression Interface
1124};
1125
1126UCLASS(MinimalAPI, collapsecategories, hidecategories = Object, DisplayName = "Substrate Coverage Weight")
1128{
1130
1131
1134 UPROPERTY()
1136
1140 UPROPERTY()
1142
1143 //~ Begin UMaterialExpression Interface
1144#if WITH_EDITOR
1145 virtual int32 Compile(class FMaterialCompiler* Compiler, int32 OutputIndex) override;
1146 virtual void GetCaption(TArray<FString>& OutCaptions) const override;
1147 virtual EMaterialValueType GetOutputValueType(int32 OutputIndex) override;
1148 virtual EMaterialValueType GetInputValueType(int32 InputIndex) override;
1149 virtual bool IsResultSubstrateMaterial(int32 OutputIndex) override;
1151 virtual FSubstrateOperator* SubstrateGenerateMaterialTopologyTree(class FMaterialCompiler* Compiler, class UMaterialExpression* Parent, int32 OutputIndex) override;
1152#endif
1153 //~ End UMaterialExpression Interface
1154};
1155
1156UCLASS(MinimalAPI, collapsecategories, hidecategories = Object, DisplayName = "Substrate Select")
1158{
1160
1161
1164 UPROPERTY()
1166
1170 UPROPERTY()
1172
1176 UPROPERTY()
1177 FExpressionInput SelectValue;
1178
1182 UPROPERTY(EditAnywhere, Category = Mode, meta = (UIMin = 0.0, UIMax = 1.0, ClampMin = 0.0, ClampMax = 1.0))
1183 float Threshold;
1184
1189 const bool bUseParameterBlending = true;
1190
1191 //~ Begin UMaterialExpression Interface
1192#if WITH_EDITOR
1193 virtual int32 Compile(class FMaterialCompiler* Compiler, int32 OutputIndex) override;
1194 virtual void GetCaption(TArray<FString>& OutCaptions) const override;
1195 virtual EMaterialValueType GetOutputValueType(int32 OutputIndex) override;
1196 virtual EMaterialValueType GetInputValueType(int32 InputIndex) override;
1197 virtual bool IsResultSubstrateMaterial(int32 OutputIndex) override;
1199 virtual FSubstrateOperator* SubstrateGenerateMaterialTopologyTree(class FMaterialCompiler* Compiler, class UMaterialExpression* Parent, int32 OutputIndex) override;
1200#endif
1201 //~ End UMaterialExpression Interface
1202};
1203
1204
1205
1207// Utilities
1208
1209UCLASS(MinimalAPI, collapsecategories, hidecategories = Object, Abstract, DisplayName = "Substrate Utility Base Class")
1214
1215UCLASS(MinimalAPI, collapsecategories, hidecategories = Object, DisplayName = "Substrate Transmittance-To-MeanFreePath")
1217{
1219
1220
1223 UPROPERTY()
1224 FExpressionInput TransmittanceColor;
1225
1230 UPROPERTY()
1231 FExpressionInput Thickness;
1232
1233 //~ Begin UMaterialExpression Interface
1234#if WITH_EDITOR
1235 virtual int32 Compile(class FMaterialCompiler* Compiler, int32 OutputIndex) override;
1236 virtual void GetCaption(TArray<FString>& OutCaptions) const override;
1237 virtual EMaterialValueType GetOutputValueType(int32 OutputIndex) override;
1238 virtual EMaterialValueType GetInputValueType(int32 InputIndex) override;
1239 virtual void GetConnectorToolTip(int32 InputIndex, int32 OutputIndex, TArray<FString>& OutToolTip) override;
1240 virtual void GetExpressionToolTip(TArray<FString>& OutToolTip) override;
1241#endif
1242 //~ End UMaterialExpression Interface
1243};
1244
1245UCLASS(MinimalAPI, collapsecategories, hidecategories = Object, DisplayName = "Substrate Metalness-To-DiffuseColorF0")
1247{
1249
1250
1253 UPROPERTY()
1255
1259 UPROPERTY()
1261
1265 UPROPERTY()
1267
1268 //~ Begin UMaterialExpression Interface
1269#if WITH_EDITOR
1270 virtual int32 Compile(class FMaterialCompiler* Compiler, int32 OutputIndex) override;
1271 virtual void GetCaption(TArray<FString>& OutCaptions) const override;
1272 virtual EMaterialValueType GetOutputValueType(int32 OutputIndex) override;
1273 virtual EMaterialValueType GetInputValueType(int32 InputIndex) override;
1274 virtual void GetConnectorToolTip(int32 InputIndex, int32 OutputIndex, TArray<FString>& OutToolTip) override;
1275 virtual void GetExpressionToolTip(TArray<FString>& OutToolTip) override;
1276#endif
1277 //~ End UMaterialExpression Interface
1278};
1279
1280UCLASS(MinimalAPI, collapsecategories, hidecategories = Object, DisplayName = "Substrate Haziness-To-Secondary-Roughness")
1282{
1284
1285
1288 UPROPERTY()
1289 FExpressionInput BaseRoughness;
1290
1294 UPROPERTY()
1295 FExpressionInput Haziness;
1296
1297 //~ Begin UMaterialExpression Interface
1298#if WITH_EDITOR
1299 virtual int32 Compile(class FMaterialCompiler* Compiler, int32 OutputIndex) override;
1300 virtual void GetCaption(TArray<FString>& OutCaptions) const override;
1301 virtual EMaterialValueType GetOutputValueType(int32 OutputIndex) override;
1302 virtual EMaterialValueType GetInputValueType(int32 InputIndex) override;
1303 virtual void GetConnectorToolTip(int32 InputIndex, int32 OutputIndex, TArray<FString>& OutToolTip) override;
1304 virtual void GetExpressionToolTip(TArray<FString>& OutToolTip) override;
1305#endif
1306 //~ End UMaterialExpression Interface
1307};
1308
1309UCLASS(MinimalAPI, collapsecategories, hidecategories = Object, DisplayName = "Substrate Thin-Film")
1311{
1313
1314
1317 UPROPERTY()
1319
1323 UPROPERTY()
1325
1329 UPROPERTY()
1330 FExpressionInput F90;
1331
1335 UPROPERTY()
1336 FExpressionInput Thickness;
1337
1341 UPROPERTY()
1342 FExpressionInput IOR;
1343
1344 //~ Begin UMaterialExpression Interface
1345#if WITH_EDITOR
1346 virtual int32 Compile(class FMaterialCompiler* Compiler, int32 OutputIndex) override;
1347 virtual void GetCaption(TArray<FString>& OutCaptions) const override;
1348 virtual EMaterialValueType GetOutputValueType(int32 OutputIndex) override;
1349 virtual EMaterialValueType GetInputValueType(int32 InputIndex) override;
1350 virtual void GetConnectorToolTip(int32 InputIndex, int32 OutputIndex, TArray<FString>& OutToolTip) override;
1351 virtual void GetExpressionToolTip(TArray<FString>& OutToolTip) override;
1352#endif
1353 //~ End UMaterialExpression Interface
1354};
@ Normal
Definition AndroidInputInterface.h:116
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
FPlatformTypes::uint64 uint64
A 64-bit unsigned integer.
Definition Platform.h:1117
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
EMaterialShadingModel
Definition EngineTypes.h:705
void Scatter(const DeltaType &Delta, TArray< ValueType > &OutDest, int32 DestNumElements, TArray< ValueType > &&InSource, const IndexRemapType &IndexRemap, int32 ElementStride=1)
Definition InstanceDataUpdateUtils.h:23
@ Top
Definition MaterialExpressionFunctionInput.h:42
EMaterialSubSurfaceType SubstrateMergeSubSurfaceType(EMaterialSubSurfaceType A, EMaterialSubSurfaceType B)
Definition MaterialExpressionSubstrate.cpp:28
EMaterialSubSurfaceType
Definition MaterialExpressionSubstrate.h:17
@ MSS_TwoSidedWrap
Definition MaterialExpressionSubstrate.h:20
@ MSS_MAX
Definition MaterialExpressionSubstrate.h:24
@ MSS_Diffusion
Definition MaterialExpressionSubstrate.h:21
@ MSS_SimpleVolume
Definition MaterialExpressionSubstrate.h:23
@ MSS_None
Definition MaterialExpressionSubstrate.h:18
@ MSS_DiffusionProfile
Definition MaterialExpressionSubstrate.h:22
@ MSS_Wrap
Definition MaterialExpressionSubstrate.h:19
int32 CompileSubstrateBlendFunction(FMaterialCompiler *Compiler, const int32 A, const int32 B, const int32 Alpha)
Definition MaterialExpressions.cpp:753
EMaterialValueType
Definition MaterialValueType.h:15
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define UMETA(...)
Definition ObjectMacros.h:747
#define GENERATED_UCLASS_BODY(...)
Definition ObjectMacros.h:768
#define UCLASS(...)
Definition ObjectMacros.h:776
#define UENUM(...)
Definition ObjectMacros.h:749
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition MaterialCompiler.h:109
Definition NameTypes.h:617
Definition Array.h:670
Definition EnumAsByte.h:22
Definition Material.h:309
Definition MaterialExpressionSubstrate.h:1092
Definition MaterialExpressionSubstrate.h:59
Definition MaterialExpressionSubstrate.h:928
Definition MaterialExpressionSubstrate.h:898
Definition MaterialExpressionSubstrate.h:638
Definition MaterialExpressionSubstrate.h:578
Definition MaterialExpressionSubstrate.h:1282
Definition MaterialExpressionSubstrate.h:1006
Definition MaterialExpressionSubstrate.h:792
Definition MaterialExpressionSubstrate.h:1247
Definition MaterialExpressionSubstrate.h:824
Definition MaterialExpressionSubstrate.h:1158
Definition MaterialExpressionSubstrate.h:75
Definition MaterialExpressionSubstrate.h:418
Definition MaterialExpressionSubstrate.h:708
Definition MaterialExpressionSubstrate.h:254
Definition MaterialExpressionSubstrate.h:1311
Definition MaterialExpressionSubstrate.h:1217
Definition MaterialExpressionSubstrate.h:861
Definition MaterialExpressionSubstrate.h:542
Definition MaterialExpressionSubstrate.h:1211
Definition MaterialExpressionSubstrate.h:1048
Definition MaterialExpressionSubstrate.h:486
Definition MaterialExpressionSubstrate.h:1128
Definition MaterialExpression.h:150
Definition SubsurfaceProfile.h:170
Definition SubsurfaceProfile.h:321
Definition MaterialExpressionIO.h:23
Definition Guid.h:109
Definition MaterialExpressionIO.h:303
Definition UnrealType.h:6865
Definition MaterialExpressionIO.h:217
Definition SubstrateMaterial.h:18
Definition EngineTypes.h:840
Definition SubstrateMaterialShared.h:105
Definition ObjectPtr.h:488
static TVector< float > Zero()
Definition Vector.h:112