Cesium for Unreal 2.15.0
Loading...
Searching...
No Matches
CesiumFeaturesMetadataDescription.h
Go to the documentation of this file.
1// Copyright 2020-2024 CesiumGS, Inc. and Contributors
2
3#pragma once
4
8#include "Containers/Array.h"
9#include "Containers/UnrealString.h"
10#include "Misc/Guid.h"
11
12#if WITH_EDITOR
13#include "Materials/MaterialFunctionMaterialLayer.h"
14#endif
15
16#include "CesiumFeaturesMetadataDescription.generated.h"
17
18#pragma region Features descriptions
19
20/**
21 * @brief Description of a feature ID set from either EXT_mesh_features or
22 * EXT_instance_features.
23 */
24USTRUCT()
25struct CESIUMRUNTIME_API FCesiumFeatureIdSetDescription {
26 GENERATED_USTRUCT_BODY()
27
28 /**
29 * The display name of the feature ID set. If the feature ID set already has a
30 * label, this will use the label. Otherwise, if the feature ID set is
31 * unlabeled, a name will be generated like so:
32 *
33 * - If the feature ID set is an attribute, this will appear as
34 * "_FEATURE_ID_<index>", where <index> is the set index specified in
35 * the attribute.
36 * - If the feature ID set is a texture, this will appear as
37 * "_FEATURE_ID_TEXTURE_<index>", where <index> increments with the number
38 * of feature ID textures seen in an individual primitive.
39 * - If the feature ID set is an implicit set, this will appear as
40 * "_IMPLICIT_FEATURE_ID". Implicit feature ID sets don't vary in definition,
41 * so any additional implicit feature ID sets across the primitives are
42 * counted by this one.
43 *
44 * This name will also be used to represent the feature ID set in the
45 * generated material.
46 */
47 UPROPERTY(EditAnywhere, Category = "Cesium")
48 FString Name;
49
50 /**
51 * The type of the feature ID set.
52 */
53 UPROPERTY(EditAnywhere, Category = "Cesium")
55
56 /**
57 * Whether this feature ID set contains a KHR_texture_transform glTF
58 * extension. Only applicable if the feature ID set is a feature ID texture.
59 */
60 UPROPERTY(
61 EditAnywhere,
62 Category = "Cesium",
63 Meta = (EditCondition = "Type == ECesiumFeatureIdSetType::Texture"))
65
66 /**
67 * The name of the property table that this feature ID set corresponds to.
68 */
69 UPROPERTY(EditAnywhere, Category = "Cesium")
71
72 /**
73 * The null feature ID for the feature ID set. This value indicates that no
74 * feature is associated with the vertex or texel containing the value. If no
75 * such value is specified, this defaults to -1, which prevents it from being
76 * unnecessarily included in the generated material.
77 */
78 UPROPERTY(EditAnywhere, Category = "Cesium")
79 bool bHasNullFeatureId = false;
80};
81
82/**
83 * @brief Description of the feature ID sets available from the
84 * EXT_mesh_features and EXT_instance_features extensions in a glTF.
85 *
86 * This aggregates the feature ID sets of all visible glTF primitives in the
87 * model. This describes the feature IDs that can be made accessible
88 * to Unreal Engine materials.
89 */
90USTRUCT()
91struct CESIUMRUNTIME_API FCesiumPrimitiveFeaturesDescription {
92 GENERATED_USTRUCT_BODY()
93
94 /**
95 * @brief The feature ID sets to make accessible to the material. Note that
96 * the order of feature ID sets in this array does not necessarily
97 * correspond to the order of these feature ID sets in a glTF
98 * primitive.
99 */
100 UPROPERTY(
101 EditAnywhere,
102 Category = "Features",
103 Meta = (TitleProperty = "Name"))
105};
106#pragma endregion
107
108#pragma region Metadata descriptions
109
110// These don't exhaustively cover the possibilities of glTF metadata
111// classes, they only cover the subset that can be encoded into textures. The
112// following types are excluded:
113// - enums
114// - strings that cannot be parsed as numbers or colors
115// - matrices
116// - variable length arrays
117// - arrays of non-scalar, non-boolean elements
118//
119// Additionally, if a property contains fixed-length arrays, only the first four
120// elements can be encoded.
121
122/**
123 * @brief Description of a property table property that should be encoded for
124 * access on the GPU.
125 */
126USTRUCT()
128 GENERATED_USTRUCT_BODY()
129
130 /**
131 * The name of this property. This will be how it is referenced in the
132 * material.
133 */
134 UPROPERTY(EditAnywhere, Category = "Cesium")
135 FString Name;
136
137 /**
138 * Describes the underlying type of this property and other relevant
139 * information from its EXT_structural_metadata definition. Not all types of
140 * properties can be encoded to the GPU, or coerced to GPU-compatible types.
141 */
142 UPROPERTY(EditAnywhere, Category = "Cesium")
144
145 /**
146 * Describes how the property will be encoded as data on the GPU, if possible.
147 */
148 UPROPERTY(EditAnywhere, Category = "Cesium")
150};
151
152/**
153 * @brief Description of a property table containing properties to be encoded
154 * for access in Unreal materials.
155 */
156USTRUCT()
157struct CESIUMRUNTIME_API FCesiumPropertyTableDescription {
158 GENERATED_USTRUCT_BODY()
159
160 /**
161 * @brief The name of this property table. If this property table has no name
162 * in the EXT_structural_metadata extension, then its class name is used
163 * instead.
164 */
165 UPROPERTY(EditAnywhere, Category = "Cesium")
166 FString Name;
167
168 /**
169 * @brief Descriptions of the properties to upload to the GPU.
170 */
171 UPROPERTY(EditAnywhere, Category = "Cesium", Meta = (TitleProperty = "Name"))
173};
174
175/**
176 * @brief Description of a property texture property that should be made
177 * accessible to Unreal materials. A property texture property's data is
178 * already available through a texture, so no additional encoding details need
179 * to be specified.
180 */
181USTRUCT()
183 GENERATED_USTRUCT_BODY()
184
185 /**
186 * The name of this property. This will be how it is referenced in the
187 * material.
188 */
189 UPROPERTY(EditAnywhere, Category = "Cesium")
190 FString Name;
191
192 /**
193 * Describes the underlying type of this property and other relevant
194 * information from its EXT_structural_metadata definition.
195 */
196 UPROPERTY(EditAnywhere, Category = "Cesium")
198
199 /**
200 * Whether this property texture property contains a KHR_texture_transform
201 * glTF extension.
202 */
203 UPROPERTY(EditAnywhere, Category = "Cesium")
205};
206
207/**
208 * @brief Description of a property texture with properties that should be
209 * made accessible to Unreal materials.
210 */
211USTRUCT()
212struct CESIUMRUNTIME_API FCesiumPropertyTextureDescription {
213 GENERATED_USTRUCT_BODY()
214
215 /**
216 * @brief The name of this property texture.
217 */
218 UPROPERTY(EditAnywhere, Category = "Cesium")
219 FString Name;
220
221 /**
222 * @brief Descriptions of the properties to upload to the GPU.
223 */
224 UPROPERTY(EditAnywhere, Category = "Cesium", Meta = (TitleProperty = "Name"))
226};
227
228/**
229 * @brief Names of the metadata entities referenced by the
230 * EXT_structural_metadata on a glTF's primitives.
231 *
232 * This aggregates the metadata of all visible glTF primitives in the model.
233 * This lists the names of the property textures actually used by the glTF
234 * primitive, indicating it can be sampled with the primitive's texture
235 * coordinates in the Unreal material.
236 */
237USTRUCT()
238struct CESIUMRUNTIME_API FCesiumPrimitiveMetadataDescription {
239 GENERATED_USTRUCT_BODY()
240
241 /**
242 * @brief The names of the property textures used by the glTF primitives
243 * across the tileset.
244 *
245 * This should be a subset of the property textures listed in the model
246 * metadata. Property textures can be passed to the material even if they are
247 * not explicitly used by a glTF primitive, but the primitive may lack the
248 * corresponding sets of texture coordinates intended to sample them.
249 */
250 UPROPERTY(
251 EditAnywhere,
252 Category = "Metadata",
253 Meta = (TitleProperty = "Name"))
254 TSet<FString> PropertyTextureNames;
255};
256
257/**
258 * @brief Description of metadata from a glTF's EXT_structural_metadata
259 * extension that should be uploaded to the GPU for access in Unreal materials.
260 */
261USTRUCT()
262struct CESIUMRUNTIME_API FCesiumModelMetadataDescription {
263 GENERATED_USTRUCT_BODY()
264
265 /**
266 * @brief Descriptions of property tables to encode for access in Unreal
267 * materials.
268 */
269 UPROPERTY(
270 EditAnywhere,
271 Category = "Metadata",
272 Meta = (TitleProperty = "Name"))
274
275 /**
276 * @brief Descriptions of property textures to make accessible to Unreal
277 * materials.
278 */
279 UPROPERTY(
280 EditAnywhere,
281 Category = "Metadata",
282 Meta = (TitleProperty = "Name"))
284};
285
286#pragma endregion
287
288/**
289 * @brief Description of both feature IDs and metadata from a glTF via the
290 * EXT_mesh_Features and EXT_structural_metadata extensions. Indicates what
291 * parts of the extension should be uploaded to the GPU for access in Unreal
292 * materials.
293 */
294USTRUCT()
295struct CESIUMRUNTIME_API FCesiumFeaturesMetadataDescription {
296 GENERATED_USTRUCT_BODY()
297
298public:
299 /**
300 * @brief Description of the feature ID sets available from the
301 * EXT_mesh_features or EXT_instance_features extensions in a glTF.
302 */
303 UPROPERTY(EditAnywhere, Category = "Cesium", Meta = (TitleProperty = "Name"))
305
306 /**
307 * @brief Description of the metadata used by the EXT_structural_metadata on a
308 * glTF's primitives.
309 */
310 UPROPERTY(EditAnywhere, Category = "Cesium", Meta = (TitleProperty = "Name"))
312
313 /**
314 * @brief Description of metadata from a glTF's EXT_structural_metadata
315 * extension.
316 */
317 UPROPERTY(EditAnywhere, Category = "Cesium", Meta = (TitleProperty = "Name"))
319};
ECesiumFeatureIdSetType
The type of a feature ID set.
Description of a feature ID set from either EXT_mesh_features or EXT_instance_features.
FString PropertyTableName
The name of the property table that this feature ID set corresponds to.
bool bHasKhrTextureTransform
Whether this feature ID set contains a KHR_texture_transform glTF extension.
ECesiumFeatureIdSetType Type
The type of the feature ID set.
bool bHasNullFeatureId
The null feature ID for the feature ID set.
FString Name
The display name of the feature ID set.
Description of both feature IDs and metadata from a glTF via the EXT_mesh_Features and EXT_structural...
FCesiumPrimitiveMetadataDescription PrimitiveMetadata
Description of the metadata used by the EXT_structural_metadata on a glTF's primitives.
FCesiumPrimitiveFeaturesDescription PrimitiveFeatures
Description of the feature ID sets available from the EXT_mesh_features or EXT_instance_features exte...
FCesiumModelMetadataDescription ModelMetadata
Description of metadata from a glTF's EXT_structural_metadata extension.
Describes how a property from EXT_structural_metadata will be encoded for access in Unreal materials.
Represents information about a metadata property according to how the property is defined in EXT_stru...
Description of metadata from a glTF's EXT_structural_metadata extension that should be uploaded to th...
TArray< FCesiumPropertyTableDescription > PropertyTables
Descriptions of property tables to encode for access in Unreal materials.
TArray< FCesiumPropertyTextureDescription > PropertyTextures
Descriptions of property textures to make accessible to Unreal materials.
Description of the feature ID sets available from the EXT_mesh_features and EXT_instance_features ext...
TArray< FCesiumFeatureIdSetDescription > FeatureIdSets
The feature ID sets to make accessible to the material.
Names of the metadata entities referenced by the EXT_structural_metadata on a glTF's primitives.
TSet< FString > PropertyTextureNames
The names of the property textures used by the glTF primitives across the tileset.
Description of a property table containing properties to be encoded for access in Unreal materials.
TArray< FCesiumPropertyTablePropertyDescription > Properties
Descriptions of the properties to upload to the GPU.
FString Name
The name of this property table.
Description of a property table property that should be encoded for access on the GPU.
FCesiumMetadataPropertyDetails PropertyDetails
Describes the underlying type of this property and other relevant information from its EXT_structural...
FCesiumMetadataEncodingDetails EncodingDetails
Describes how the property will be encoded as data on the GPU, if possible.
Description of a property texture with properties that should be made accessible to Unreal materials.
TArray< FCesiumPropertyTexturePropertyDescription > Properties
Descriptions of the properties to upload to the GPU.
FString Name
The name of this property texture.
Description of a property texture property that should be made accessible to Unreal materials.
bool bHasKhrTextureTransform
Whether this property texture property contains a KHR_texture_transform glTF extension.
FCesiumMetadataPropertyDetails PropertyDetails
Describes the underlying type of this property and other relevant information from its EXT_structural...