Cesium for Unreal 2.28.0
Loading...
Searching...
No Matches
CesiumFeaturesMetadataDescription.h
Go to the documentation of this file.
1// Copyright 2020-2026 CesiumGS, Inc. and Contributors
2
3#pragma once
4
9#include "Containers/Array.h"
10#include "Containers/UnrealString.h"
11#include "Misc/Guid.h"
12
13#include "CesiumFeaturesMetadataDescription.generated.h"
14
15#pragma region Features descriptions
16
17/**
18 * @brief Determines how features in a Cesium3DTileset will be visually styled.
19 */
20UENUM()
21enum class ECesiumFeatureStylingMode : uint8 {
22 /**
23 * Metadata values are passed through textures to the generated material. This
24 * enables numeric properties to be used with typical material logic.
25 *
26 * Due to limitations with Unreal materials, properties that contain strings,
27 * matrices, and arrays may not be able to be properly encoded.
28 */
30 /**
31 * Visual styles for each feature are evaluated in Blueprints before being
32 * passed to the generated material. This enables flexible interaction with
33 * metadata properties that are not supported in materials, such as strings
34 * and big integers. However, this can impact performance since Blueprints are
35 * executed on the main thread.
36 *
37 * The class assigned to BlueprintStyleClass on the component must implement
38 * the ICesium3DTilesStylingProvider interface.
39 */
41};
42
43/**
44 * @brief Description of a feature ID set from either EXT_mesh_features or
45 * EXT_instance_features.
46 */
47USTRUCT()
48struct CESIUMRUNTIME_API FCesiumFeatureIdSetDescription {
49 GENERATED_USTRUCT_BODY()
50
51 /**
52 * The display name of the feature ID set. If the feature ID set already has a
53 * label, this will use the label. Otherwise, if the feature ID set is
54 * unlabeled, a name will be generated like so:
55 *
56 * - If the feature ID set is an attribute, this will appear as
57 * "_FEATURE_ID_<index>", where <index> is the set index specified in
58 * the attribute.
59 * - If the feature ID set is a texture, this will appear as
60 * "_FEATURE_ID_TEXTURE_<index>", where <index> increments with the number
61 * of feature ID textures seen in an individual primitive.
62 * - If the feature ID set is an implicit set, this will appear as
63 * "_IMPLICIT_FEATURE_ID". Implicit feature ID sets don't vary in definition,
64 * so any additional implicit feature ID sets across the primitives are
65 * counted by this one.
66 *
67 * This name will also be used to represent the feature ID set in the
68 * generated material.
69 */
70 UPROPERTY(EditAnywhere, Category = "Cesium|Features")
71 FString Name;
72
73 /**
74 * The type of the feature ID set.
75 */
76 UPROPERTY(EditAnywhere, Category = "Cesium|Features")
78
79 /**
80 * The name of the property table that this feature ID set corresponds to.
81 */
82 UPROPERTY(EditAnywhere, Category = "Cesium|Features")
84
85 /**
86 * The method used to apply styling to individual features.
87 *
88 * By default, metadata properties are encoded to textures and passed the
89 * generated material, allowing use with material logic. However, they can
90 * also be styled in a prepass using Blueprints.
91 */
92 UPROPERTY(EditAnywhere, Category = "Cesium|Features")
94};
95
96/**
97 * @brief Description of the feature ID sets available from the
98 * EXT_mesh_features and EXT_instance_features extensions in a glTF.
99 *
100 * This aggregates the feature ID sets of all visible glTF primitives in the
101 * model. This describes the feature IDs that can be made accessible
102 * to Unreal Engine materials.
103 */
104USTRUCT()
105struct CESIUMRUNTIME_API FCesiumPrimitiveFeaturesDescription {
106 GENERATED_USTRUCT_BODY()
107
108 /**
109 * @brief The feature ID sets to make accessible to the material. Note that
110 * the order of feature ID sets in this array does not necessarily
111 * correspond to the order of these feature ID sets in a glTF
112 * primitive.
113 */
114 UPROPERTY(
115 EditAnywhere,
116 Category = "Cesium|Features",
117 Meta = (TitleProperty = "Name"))
119};
120#pragma endregion
121
122#pragma region Metadata descriptions
123
124// These don't exhaustively cover the possibilities of glTF metadata
125// classes, they only cover the subset that can be encoded into textures. The
126// following types are excluded:
127// - enums
128// - strings that cannot be parsed as numbers or colors
129// - matrices
130// - variable length arrays
131// - arrays of non-scalar, non-boolean elements
132//
133// Additionally, if a property contains fixed-length arrays, only the first four
134// elements can be encoded.
135
136/**
137 * @brief Description of a property table property that should be encoded for
138 * access on the GPU.
139 */
140USTRUCT()
142 GENERATED_USTRUCT_BODY()
143
144 /**
145 * The name of this property. This will be how it is referenced in the
146 * material.
147 */
148 UPROPERTY(EditAnywhere, Category = "Cesium|Metadata")
149 FString Name;
150
151 /**
152 * Describes the underlying type of this property and other relevant
153 * information from its EXT_structural_metadata definition. Not all types of
154 * properties can be encoded to the GPU, or coerced to GPU-compatible types.
155 */
156 UPROPERTY(EditAnywhere, Category = "Cesium|Metadata")
158
159 /**
160 * Describes how the property will be encoded as data on the GPU, if possible.
161 */
162 UPROPERTY(EditAnywhere, Category = "Cesium|Metadata")
164};
165
166/**
167 * @brief Description of a property table containing properties to be encoded
168 * for access in Unreal materials.
169 */
170USTRUCT()
171struct CESIUMRUNTIME_API FCesiumPropertyTableDescription {
172 GENERATED_USTRUCT_BODY()
173
174 /**
175 * @brief The name of this property table. If this property table has no name
176 * in the EXT_structural_metadata extension, then its class name is used
177 * instead.
178 */
179 UPROPERTY(EditAnywhere, Category = "Cesium|Metadata")
180 FString Name;
181
182 /**
183 * @brief Descriptions of the properties to upload to the GPU.
184 */
185 UPROPERTY(
186 EditAnywhere,
187 Category = "Cesium|Metadata",
188 Meta = (TitleProperty = "Name"))
190};
191
192/**
193 * @brief Description of a property texture property that should be made
194 * accessible to Unreal materials. A property texture property's data is
195 * already available through a texture, so no additional encoding details need
196 * to be specified.
197 */
198USTRUCT()
200 GENERATED_USTRUCT_BODY()
201
202 /**
203 * The name of this property. This will be how it is referenced in the
204 * material.
205 */
206 UPROPERTY(EditAnywhere, Category = "Cesium|Metadata")
207 FString Name;
208
209 /**
210 * Describes the underlying type of this property and other relevant
211 * information from its EXT_structural_metadata definition.
212 */
213 UPROPERTY(EditAnywhere, Category = "Cesium|Metadata")
215};
216
217/**
218 * @brief Description of a property texture with properties that should be
219 * made accessible to Unreal materials.
220 */
221USTRUCT()
222struct CESIUMRUNTIME_API FCesiumPropertyTextureDescription {
223 GENERATED_USTRUCT_BODY()
224
225 /**
226 * @brief The name of this property texture.
227 */
228 UPROPERTY(EditAnywhere, Category = "Cesium|Metadata")
229 FString Name;
230
231 /**
232 * @brief Descriptions of the properties to upload to the GPU.
233 */
234 UPROPERTY(
235 EditAnywhere,
236 Category = "Cesium|Metadata",
237 Meta = (TitleProperty = "Name"))
239};
240
241/**
242 * @brief Description of a property attribute property that should be encoded
243 * for access on the GPU.
244 *
245 * This is similar to FCesiumPropertyTablePropertyDescription, but is limited to
246 * the types that are supported for property attribute properties.
247 */
248USTRUCT()
250 GENERATED_USTRUCT_BODY()
251
252 /**
253 * The name of this property. This will be how it is referenced in the
254 * material.
255 */
256 UPROPERTY(EditAnywhere, Category = "Cesium")
257 FString Name;
258
259 /**
260 * Describes the underlying type of this property and other relevant
261 * information from its EXT_structural_metadata definition. Not all types of
262 * properties can be encoded to the GPU, or coerced to GPU-compatible types.
263 */
264 UPROPERTY(EditAnywhere, Category = "Cesium")
266
267 /**
268 * Describes how the property will be encoded as data on the GPU, if possible.
269 */
270 UPROPERTY(EditAnywhere, Category = "Cesium")
272};
273
274/**
275 * @brief Description of a property attribute with properties that should be
276 * made accessible to Unreal materials.
277 */
278USTRUCT()
279struct CESIUMRUNTIME_API FCesiumPropertyAttributeDescription {
280 GENERATED_USTRUCT_BODY()
281
282 /**
283 * @brief The name of this property attribute.
284 */
285 UPROPERTY(EditAnywhere, Category = "Cesium")
286 FString Name;
287
288 /**
289 * @brief Descriptions of the properties to upload to the GPU.
290 */
291 UPROPERTY(EditAnywhere, Category = "Cesium", Meta = (TitleProperty = "Name"))
293};
294
295/**
296 * @brief Names of the metadata entities referenced by the
297 * EXT_structural_metadata on a glTF's primitives.
298 *
299 * This aggregates the metadata of all visible glTF primitives in the model.
300 * This lists the names of the property textures actually used by the glTF
301 * primitive, indicating it can be sampled with the primitive's texture
302 * coordinates in the Unreal material.
303 */
304USTRUCT()
305struct CESIUMRUNTIME_API FCesiumPrimitiveMetadataDescription {
306 GENERATED_USTRUCT_BODY()
307
308 /**
309 * @brief The names of the property textures used by the glTF primitives
310 * across the tileset.
311 *
312 * This should be a subset of the property textures listed in the model
313 * metadata. Property textures can be passed to the material even if they are
314 * not explicitly used by a glTF primitive, but the primitive may lack the
315 * corresponding sets of texture coordinates intended to sample them.
316 */
317 UPROPERTY(
318 EditAnywhere,
319 Category = "Cesium|Metadata",
320 Meta = (TitleProperty = "Name"))
321 TSet<FString> PropertyTextureNames;
322};
323
324/**
325 * @brief Description of metadata from a glTF's EXT_structural_metadata
326 * extension that should be uploaded to the GPU for access in Unreal materials.
327 */
328USTRUCT()
329struct CESIUMRUNTIME_API FCesiumModelMetadataDescription {
330 GENERATED_USTRUCT_BODY()
331
332 /**
333 * @brief Descriptions of property tables to encode for access in Unreal
334 * materials.
335 */
336 UPROPERTY(
337 EditAnywhere,
338 Category = "Cesium|Metadata",
339 Meta = (TitleProperty = "Name"))
341
342 /**
343 * @brief Descriptions of property textures to make accessible to Unreal
344 * materials.
345 */
346 UPROPERTY(
347 EditAnywhere,
348 Category = "Cesium|Metadata",
349 Meta = (TitleProperty = "Name"))
351};
352
353#pragma endregion
354
355#pragma region Tileset Statistics
356
357/**
358 * @brief Supported statistic semantics from the 3D Tiles specification.
359 */
360UENUM()
362 None = 0 UMETA(Hidden),
363 /**
364 * The minimum property value occurring in the tileset.
365 */
367 /**
368 * The maximum property value occurring in the tileset.
369 */
371 /**
372 * The arithmetic mean of property values occurring in the tileset.
373 */
375 /**
376 * The median of property values occurring in the tileset.
377 */
379 /**
380 * The standard deviation of property values occurring in the tileset.
381 */
383 /**
384 * The variance of property values occurring in the tileset.
385 */
387 /**
388 * The sum of property values occurring in the tileset.
389 */
391};
392
393/**
394 * @brief A statistic for a metadata property's values.
395 */
396USTRUCT()
398 GENERATED_USTRUCT_BODY()
399 /**
400 * @brief The semantic of this statistic.
401 */
402 UPROPERTY(EditAnywhere, Category = "Cesium|Metadata|Statistics")
404
405 /**
406 * @brief The value of this statistic. This reflects the value on the tileset
407 * it is attached to and should not be edited by users.
408 */
409 UPROPERTY(Transient, VisibleAnywhere, Category = "Cesium|Metadata|Statistics")
411};
412
413/**
414 * @brief The statistics for a given metadata property.
415 */
416USTRUCT()
418 GENERATED_USTRUCT_BODY()
419 /**
420 * @brief The identifier of this property.
421 */
422 UPROPERTY(EditAnywhere, Category = "Cesium|Metadata|Statistics")
423 FString Id;
424
425 /**
426 * @brief The available statistics for this property.
427 */
428 UPROPERTY(
429 EditAnywhere,
430 Category = "Cesium|Metadata|Statistics",
431 Meta = (TitleProperty = "Semantic"))
433};
434
435/**
436 * @brief The statistics for a given metadata class.
437 */
438USTRUCT()
440 GENERATED_USTRUCT_BODY()
441 /**
442 * @brief The identifier of this class.
443 */
444 UPROPERTY(EditAnywhere, Category = "Cesium|Metadata|Statistics")
445 FString Id;
446
447 /**
448 * @brief The statistics of properties belonging to this class.
449 */
450 UPROPERTY(
451 EditAnywhere,
452 Category = "Cesium|Metadata|Statistics",
453 Meta = (TitleProperty = "Id"))
455};
456
457#pragma endregion
458
459/**
460 * @brief Description of both feature IDs and metadata from a glTF via the
461 * EXT_mesh_features and EXT_structural_metadata extensions. Indicates what
462 * parts of the extension should be uploaded to the GPU for access in Unreal
463 * materials.
464 */
465USTRUCT()
466struct CESIUMRUNTIME_API FCesiumFeaturesMetadataDescription {
467 GENERATED_USTRUCT_BODY()
468
469public:
470 /**
471 * @brief Description of the statistics reported by the tileset. Each entry
472 * represents a class and its cumulative statistics.
473 */
474 UPROPERTY(EditAnywhere, Category = "Cesium", Meta = (TitleProperty = "Id"))
476
477 /**
478 * @brief Description of the feature ID sets available from the
479 * EXT_mesh_features or EXT_instance_features extensions in a glTF.
480 */
481 UPROPERTY(EditAnywhere, Category = "Cesium", Meta = (TitleProperty = "Name"))
483
484 /**
485 * @brief Description of the metadata used by the EXT_structural_metadata on a
486 * glTF's primitives.
487 */
488 UPROPERTY(EditAnywhere, Category = "Cesium", Meta = (TitleProperty = "Name"))
490
491 /**
492 * @brief Description of metadata from a glTF's EXT_structural_metadata
493 * extension.
494 */
495 UPROPERTY(EditAnywhere, Category = "Cesium", Meta = (TitleProperty = "Name"))
497};
@ UMETA
The tileset will be loaded from Cesium Ion using the provided IonAssetID and IonAccessToken.
ECesiumFeatureIdSetType
The type of a feature ID set.
ECesiumFeatureStylingMode
Determines how features in a Cesium3DTileset will be visually styled.
@ Blueprint
Visual styles for each feature are evaluated in Blueprints before being passed to the generated mater...
@ Material
Metadata values are passed through textures to the generated material.
ECesiumMetadataStatisticSemantic
Supported statistic semantics from the 3D Tiles specification.
@ Mean
The arithmetic mean of property values occurring in the tileset.
@ Median
The median of property values occurring in the tileset.
@ StandardDeviation
The standard deviation of property values occurring in the tileset.
@ Max
The maximum property value occurring in the tileset.
@ Variance
The variance of property values occurring in the tileset.
@ Min
The minimum property value occurring in the tileset.
@ Sum
The sum of property values occurring in the tileset.
USTRUCT() struct FCesiumVoxelClassDescription
Description of the metadata properties available in the class used by the 3DTILES_content_voxels exte...
Description of a feature ID set from either EXT_mesh_features or EXT_instance_features.
ECesiumFeatureStylingMode StylingMode
The method used to apply styling to individual features.
FString PropertyTableName
The name of the property table that this feature ID set corresponds to.
ECesiumFeatureIdSetType Type
The type of 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...
TArray< FCesiumMetadataClassStatisticsDescription > Statistics
Description of the statistics reported by the tileset.
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.
TArray< FCesiumMetadataPropertyStatisticsDescription > Properties
The statistics of properties belonging to this class.
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...
A statistic for a metadata property's values.
ECesiumMetadataStatisticSemantic Semantic
The semantic of this statistic.
FCesiumMetadataValue Value
The value of this statistic.
The statistics for a given metadata property.
TArray< FCesiumMetadataPropertyStatisticValue > Values
The available statistics for this property.
A Blueprint-accessible wrapper for a glTF metadata value.
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 attribute with properties that should be made accessible to Unreal material...
TArray< FCesiumPropertyAttributePropertyDescription > Properties
Descriptions of the properties to upload to the GPU.
FString Name
The name of this property attribute.
Description of a property attribute 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 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.
FCesiumMetadataPropertyDetails PropertyDetails
Describes the underlying type of this property and other relevant information from its EXT_structural...