UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
MaterialMerging.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"
7#include "EngineTypes.h"
8#include "MaterialMerging.generated.h"
9
10struct FMeshDescription;
11
12UENUM()
14{
15 TextureSizingType_UseSingleTextureSize UMETA(DisplayName = "Use TextureSize for all material properties"),
16 TextureSizingType_UseAutomaticBiasedSizes UMETA(DisplayName = "Use automatically biased texture sizes based on TextureSize"),
17 TextureSizingType_UseManualOverrideTextureSize UMETA(DisplayName = "Use per property manually overriden texture sizes"),
18 TextureSizingType_UseSimplygonAutomaticSizing UMETA(DisplayName = "Use Simplygon's automatic texture sizing"),
19 TextureSizingType_AutomaticFromTexelDensity UMETA(DisplayName = "Automatic - From Texel Density"),
20 TextureSizingType_AutomaticFromMeshScreenSize UMETA(DisplayName = "Automatic - From Mesh Screen Size"),
21 TextureSizingType_AutomaticFromMeshDrawDistance UMETA(DisplayName = "Automatic - From Mesh Draw Distance", ToolTip = "When working with World Partition HLODs, the draw distance is automatically deduced from the runtime grid loading range."),
23};
24
25UENUM()
31
32USTRUCT(Blueprintable)
34{
36
37 // Method that should be used to generate the sizes of the output textures
38 UPROPERTY(Category = Material, BlueprintReadWrite, EditAnywhere)
39 TEnumAsByte<ETextureSizingType> TextureSizingType;
40
41 // Size of generated BaseColor map
42 UPROPERTY(Category = Material, EditAnywhere, meta =(ClampMin = "1", UIMin = "1", EditConditionHides, EditCondition = "TextureSizingType == ETextureSizingType::TextureSizingType_UseSingleTextureSize || TextureSizingType == ETextureSizingType::TextureSizingType_UseAutomaticBiasedSizes"))
43 FIntPoint TextureSize;
44
45 // Target texel density
46 UPROPERTY(Category = Material, BlueprintReadWrite, EditAnywhere, meta = (ClampMin = "0.1", ClampMax = "1024", EditConditionHides, EditCondition = "TextureSizingType == ETextureSizingType::TextureSizingType_AutomaticFromTexelDensity"))
47 float TargetTexelDensityPerMeter;
48
49 // Expected maximum screen size for the mesh
50 UPROPERTY(Category = Material, BlueprintReadWrite, EditAnywhere, meta = (ClampMin = "0.01", ClampMax = "1.0", EditConditionHides, EditCondition = "TextureSizingType == ETextureSizingType::TextureSizingType_AutomaticFromMeshScreenSize"))
51 float MeshMaxScreenSizePercent;
52
53 // Expected minimum distance at which the mesh will be rendered
54 UPROPERTY(Category = Material, BlueprintReadWrite, EditAnywhere, meta = (ClampMin = "0", EditConditionHides, EditCondition = "TextureSizingType == ETextureSizingType::TextureSizingType_AutomaticFromMeshDrawDistance"))
55 double MeshMinDrawDistance;
56
57 // Gutter space to take into account
58 UPROPERTY(Category = Material, BlueprintReadWrite, AdvancedDisplay, EditAnywhere)
59 float GutterSpace;
60
61 // Constant value to use for the Metallic property
62 UPROPERTY(Category = Material, BlueprintReadWrite, EditAnywhere, meta = (DisplayAfter="bMetallicMap", ClampMin = "0", ClampMax = "1", UIMin = "0", UIMax = "1", editcondition = "!bMetallicMap"))
63 float MetallicConstant;
64
65 // Constant value to use for the Roughness property
66 UPROPERTY(Category = Material, BlueprintReadWrite, EditAnywhere, meta = (DisplayAfter="bRoughnessMap", ClampMin = "0", ClampMax = "1", UIMin = "0", UIMax = "1", editcondition = "!bRoughnessMap"))
67 float RoughnessConstant;
68
69 // Constant value to use for the Anisotropy property
70 UPROPERTY(Category = Material, BlueprintReadWrite, EditAnywhere, meta = (DisplayAfter="bAnisotropyMap", ClampMin = "-1", ClampMax = "1", UIMin = "-1", UIMax = "1", editcondition = "!bAnisotropyMap"))
71 float AnisotropyConstant;
72
73 // Constant value to use for the Specular property
74 UPROPERTY(Category = Material, BlueprintReadWrite, EditAnywhere, meta = (DisplayAfter="bSpecularMap", ClampMin = "0", ClampMax = "1", UIMin = "0", UIMax = "1", editcondition = "!bSpecularMap"))
75 float SpecularConstant;
76
77 // Constant value to use for the Opacity property
78 UPROPERTY(Category = Material, BlueprintReadWrite, EditAnywhere, meta = (DisplayAfter="bOpacityMap", ClampMin = "0", ClampMax = "1", UIMin = "0", UIMax = "1", editcondition = "!bOpacityMap"))
79 float OpacityConstant;
80
81 // Constant value to use for the Opacity mask property
82 UPROPERTY(Category = Material, BlueprintReadWrite, EditAnywhere, meta = (DisplayAfter="bOpacityMaskMap", ClampMin = "0", ClampMax = "1", UIMin = "0", UIMax = "1", editcondition = "!bOpacityMaskMap"))
83 float OpacityMaskConstant;
84
85 // Constant value to use for the Ambient Occlusion property
86 UPROPERTY(Category = Material, BlueprintReadWrite, EditAnywhere, meta = (DisplayAfter="bAmbientOcclusionMap", ClampMin = "0", ClampMax = "1", UIMin = "0", UIMax = "1", editcondition = "!bAmbientOcclusionMap"))
87 float AmbientOcclusionConstant;
88
89 UPROPERTY()
90 TEnumAsByte<EMaterialMergeType> MaterialMergeType;
91
92 // Target blend mode for the generated material
93 UPROPERTY(Category = Material, BlueprintReadWrite, AdvancedDisplay, EditAnywhere, meta=(DisplayAfter="AmbientOcclusionTextureSize"))
95
96 // Whether or not to allow the generated material can be two-sided
97 UPROPERTY(Category = Material, BlueprintReadWrite, EditAnywhere, meta = (DisplayAfter = "BlendMode"))
98 uint8 bAllowTwoSidedMaterial : 1;
99
100 // Whether to generate a texture for the Normal property
101 UPROPERTY(Category = Material, BlueprintReadWrite, EditAnywhere)
102 uint8 bNormalMap:1;
103
104 // Whether to generate a texture for the Tangent property
105 UPROPERTY(Category = Material, BlueprintReadWrite, EditAnywhere)
106 uint8 bTangentMap:1;
107
108 // Whether to generate a texture for the Metallic property
109 UPROPERTY(Category = Material, BlueprintReadWrite, EditAnywhere)
110 uint8 bMetallicMap:1;
111
112 // Whether to generate a texture for the Roughness property
113 UPROPERTY(Category = Material, BlueprintReadWrite, EditAnywhere)
114 uint8 bRoughnessMap:1;
115
116 // Whether to generate a texture for the Anisotropy property
117 UPROPERTY(Category = Material, BlueprintReadWrite, EditAnywhere)
118 uint8 bAnisotropyMap:1;
119
120 // Whether to generate a texture for the Specular property
121 UPROPERTY(Category = Material, BlueprintReadWrite, EditAnywhere)
122 uint8 bSpecularMap:1;
123
124 // Whether to generate a texture for the Emissive property
125 UPROPERTY(Category = Material, BlueprintReadWrite, EditAnywhere)
126 uint8 bEmissiveMap:1;
127
128 // Whether to generate a texture for the Opacity property
129 UPROPERTY(Category = Material, BlueprintReadWrite, EditAnywhere)
130 uint8 bOpacityMap:1;
131
132 // Whether to generate a texture for the Opacity Mask property
133 UPROPERTY(Category = Material, BlueprintReadWrite, EditAnywhere)
134 uint8 bOpacityMaskMap:1;
135
136 // Whether to generate a texture for the Ambient Occlusion property
137 UPROPERTY(Category = Material, BlueprintReadWrite, EditAnywhere)
138 uint8 bAmbientOcclusionMap:1;
139
140 // Override Diffuse texture size
141 UPROPERTY(Category = Material, BlueprintReadWrite, AdvancedDisplay, EditAnywhere, meta = (ClampMin = "1", UIMin = "1"))
142 FIntPoint DiffuseTextureSize;
143
144 // Override Normal texture size
145 UPROPERTY(Category = Material, BlueprintReadWrite, AdvancedDisplay, EditAnywhere, meta = (ClampMin = "1", UIMin = "1"))
146 FIntPoint NormalTextureSize;
147
148 // Override Tangent texture size
149 UPROPERTY(Category = Material, BlueprintReadWrite, AdvancedDisplay, EditAnywhere, meta = (ClampMin = "1", UIMin = "1"))
150 FIntPoint TangentTextureSize;
151
152 // Override Metallic texture size
153 UPROPERTY(Category = Material, BlueprintReadWrite, AdvancedDisplay, EditAnywhere, meta = (ClampMin = "1", UIMin = "1"))
154 FIntPoint MetallicTextureSize;
155
156 // Override Roughness texture size
157 UPROPERTY(Category = Material, BlueprintReadWrite, AdvancedDisplay, EditAnywhere, meta = (ClampMin = "1", UIMin = "1"))
158 FIntPoint RoughnessTextureSize;
159
160 // Override Anisotropy texture size
161 UPROPERTY(Category = Material, BlueprintReadWrite, AdvancedDisplay, EditAnywhere, meta = (ClampMin = "1", UIMin = "1"))
162 FIntPoint AnisotropyTextureSize;
163
164 // Override Specular texture size
165 UPROPERTY(Category = Material, BlueprintReadWrite, AdvancedDisplay, EditAnywhere, meta = (ClampMin = "1", UIMin = "1"))
166 FIntPoint SpecularTextureSize;
167
168 // Override Emissive texture size
169 UPROPERTY(Category = Material, BlueprintReadWrite, AdvancedDisplay, EditAnywhere, meta = (ClampMin = "1", UIMin = "1"))
170 FIntPoint EmissiveTextureSize;
171
172 // Override Opacity texture size
173 UPROPERTY(Category = Material, BlueprintReadWrite, AdvancedDisplay, EditAnywhere, meta = (ClampMin = "1", UIMin = "1"))
174 FIntPoint OpacityTextureSize;
175
176 // Override Opacity Mask texture size
177 UPROPERTY(Category = Material, BlueprintReadWrite, AdvancedDisplay, EditAnywhere, meta = (ClampMin = "1", UIMin = "1"))
178 FIntPoint OpacityMaskTextureSize;
179
180 // Override Ambient Occlusion texture size
181 UPROPERTY(Category = Material, BlueprintReadWrite, AdvancedDisplay, EditAnywhere, meta = (ClampMin = "1", UIMin = "1"))
182 FIntPoint AmbientOcclusionTextureSize;
183
185
186 ENGINE_API bool operator == (const FMaterialProxySettings& Other) const;
187 ENGINE_API bool operator != (const FMaterialProxySettings& Other) const;
188
189 ENGINE_API FIntPoint GetMaxTextureSize() const;
190
191#if WITH_EDITOR
194
196 ENGINE_API void ResolveTextureSize(const float InWorldSpaceRadius, const double InWorldSpaceArea, const double InUVSpaceArea = 1.0);
197#endif
198};
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
EBlendMode
Definition EngineTypes.h:245
ETextureSizingType
Definition MaterialMerging.h:14
@ TextureSizingType_MAX
Definition MaterialMerging.h:22
@ UMETA
Definition MaterialMerging.h:15
EMaterialMergeType
Definition MaterialMerging.h:27
@ MaterialMergeType_Default
Definition MaterialMerging.h:28
@ MaterialMergeType_Simplygon
Definition MaterialMerging.h:29
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define UENUM(...)
Definition ObjectMacros.h:749
#define USTRUCT(...)
Definition ObjectMacros.h:746
#define GENERATED_USTRUCT_BODY(...)
Definition ObjectMacros.h:767
uint8_t uint8
Definition binka_ue_file_header.h:8
Definition Array.h:670
Definition EnumAsByte.h:22
Definition MaterialMerging.h:34
Definition MeshDescription.h:94
Definition IntPoint.h:25