Cesium for Unreal 2.24.1
Loading...
Searching...
No Matches
CesiumFeaturesMetadataDescription.h
Go to the documentation of this file.
1// Copyright 2020-2025 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 Description of a feature ID set from either EXT_mesh_features or
19 * EXT_instance_features.
20 */
21USTRUCT()
22struct CESIUMRUNTIME_API FCesiumFeatureIdSetDescription {
23 GENERATED_USTRUCT_BODY()
24
25 /**
26 * The display name of the feature ID set. If the feature ID set already has a
27 * label, this will use the label. Otherwise, if the feature ID set is
28 * unlabeled, a name will be generated like so:
29 *
30 * - If the feature ID set is an attribute, this will appear as
31 * "_FEATURE_ID_<index>", where <index> is the set index specified in
32 * the attribute.
33 * - If the feature ID set is a texture, this will appear as
34 * "_FEATURE_ID_TEXTURE_<index>", where <index> increments with the number
35 * of feature ID textures seen in an individual primitive.
36 * - If the feature ID set is an implicit set, this will appear as
37 * "_IMPLICIT_FEATURE_ID". Implicit feature ID sets don't vary in definition,
38 * so any additional implicit feature ID sets across the primitives are
39 * counted by this one.
40 *
41 * This name will also be used to represent the feature ID set in the
42 * generated material.
43 */
44 UPROPERTY(EditAnywhere, Category = "Cesium|Features")
45 FString Name;
46
47 /**
48 * The type of the feature ID set.
49 */
50 UPROPERTY(EditAnywhere, Category = "Cesium|Features")
52
53 /**
54 * The name of the property table that this feature ID set corresponds to.
55 */
56 UPROPERTY(EditAnywhere, Category = "Cesium|Features")
58};
59
60/**
61 * @brief Description of the feature ID sets available from the
62 * EXT_mesh_features and EXT_instance_features extensions in a glTF.
63 *
64 * This aggregates the feature ID sets of all visible glTF primitives in the
65 * model. This describes the feature IDs that can be made accessible
66 * to Unreal Engine materials.
67 */
68USTRUCT()
69struct CESIUMRUNTIME_API FCesiumPrimitiveFeaturesDescription {
70 GENERATED_USTRUCT_BODY()
71
72 /**
73 * @brief The feature ID sets to make accessible to the material. Note that
74 * the order of feature ID sets in this array does not necessarily
75 * correspond to the order of these feature ID sets in a glTF
76 * primitive.
77 */
78 UPROPERTY(
79 EditAnywhere,
80 Category = "Cesium|Features",
81 Meta = (TitleProperty = "Name"))
83};
84#pragma endregion
85
86#pragma region Metadata descriptions
87
88// These don't exhaustively cover the possibilities of glTF metadata
89// classes, they only cover the subset that can be encoded into textures. The
90// following types are excluded:
91// - enums
92// - strings that cannot be parsed as numbers or colors
93// - matrices
94// - variable length arrays
95// - arrays of non-scalar, non-boolean elements
96//
97// Additionally, if a property contains fixed-length arrays, only the first four
98// elements can be encoded.
99
100/**
101 * @brief Description of a property table property that should be encoded for
102 * access on the GPU.
103 */
104USTRUCT()
106 GENERATED_USTRUCT_BODY()
107
108 /**
109 * The name of this property. This will be how it is referenced in the
110 * material.
111 */
112 UPROPERTY(EditAnywhere, Category = "Cesium|Metadata")
113 FString Name;
114
115 /**
116 * Describes the underlying type of this property and other relevant
117 * information from its EXT_structural_metadata definition. Not all types of
118 * properties can be encoded to the GPU, or coerced to GPU-compatible types.
119 */
120 UPROPERTY(EditAnywhere, Category = "Cesium|Metadata")
122
123 /**
124 * Describes how the property will be encoded as data on the GPU, if possible.
125 */
126 UPROPERTY(EditAnywhere, Category = "Cesium|Metadata")
128};
129
130/**
131 * @brief Description of a property table containing properties to be encoded
132 * for access in Unreal materials.
133 */
134USTRUCT()
135struct CESIUMRUNTIME_API FCesiumPropertyTableDescription {
136 GENERATED_USTRUCT_BODY()
137
138 /**
139 * @brief The name of this property table. If this property table has no name
140 * in the EXT_structural_metadata extension, then its class name is used
141 * instead.
142 */
143 UPROPERTY(EditAnywhere, Category = "Cesium|Metadata")
144 FString Name;
145
146 /**
147 * @brief Descriptions of the properties to upload to the GPU.
148 */
149 UPROPERTY(
150 EditAnywhere,
151 Category = "Cesium|Metadata",
152 Meta = (TitleProperty = "Name"))
154};
155
156/**
157 * @brief Description of a property texture property that should be made
158 * accessible to Unreal materials. A property texture property's data is
159 * already available through a texture, so no additional encoding details need
160 * to be specified.
161 */
162USTRUCT()
164 GENERATED_USTRUCT_BODY()
165
166 /**
167 * The name of this property. This will be how it is referenced in the
168 * material.
169 */
170 UPROPERTY(EditAnywhere, Category = "Cesium|Metadata")
171 FString Name;
172
173 /**
174 * Describes the underlying type of this property and other relevant
175 * information from its EXT_structural_metadata definition.
176 */
177 UPROPERTY(EditAnywhere, Category = "Cesium|Metadata")
179};
180
181/**
182 * @brief Description of a property texture with properties that should be
183 * made accessible to Unreal materials.
184 */
185USTRUCT()
186struct CESIUMRUNTIME_API FCesiumPropertyTextureDescription {
187 GENERATED_USTRUCT_BODY()
188
189 /**
190 * @brief The name of this property texture.
191 */
192 UPROPERTY(EditAnywhere, Category = "Cesium|Metadata")
193 FString Name;
194
195 /**
196 * @brief Descriptions of the properties to upload to the GPU.
197 */
198 UPROPERTY(
199 EditAnywhere,
200 Category = "Cesium|Metadata",
201 Meta = (TitleProperty = "Name"))
203};
204
205/**
206 * @brief Names of the metadata entities referenced by the
207 * EXT_structural_metadata on a glTF's primitives.
208 *
209 * This aggregates the metadata of all visible glTF primitives in the model.
210 * This lists the names of the property textures actually used by the glTF
211 * primitive, indicating it can be sampled with the primitive's texture
212 * coordinates in the Unreal material.
213 */
214USTRUCT()
215struct CESIUMRUNTIME_API FCesiumPrimitiveMetadataDescription {
216 GENERATED_USTRUCT_BODY()
217
218 /**
219 * @brief The names of the property textures used by the glTF primitives
220 * across the tileset.
221 *
222 * This should be a subset of the property textures listed in the model
223 * metadata. Property textures can be passed to the material even if they are
224 * not explicitly used by a glTF primitive, but the primitive may lack the
225 * corresponding sets of texture coordinates intended to sample them.
226 */
227 UPROPERTY(
228 EditAnywhere,
229 Category = "Cesium|Metadata",
230 Meta = (TitleProperty = "Name"))
231 TSet<FString> PropertyTextureNames;
232};
233
234/**
235 * @brief Description of metadata from a glTF's EXT_structural_metadata
236 * extension that should be uploaded to the GPU for access in Unreal materials.
237 */
238USTRUCT()
239struct CESIUMRUNTIME_API FCesiumModelMetadataDescription {
240 GENERATED_USTRUCT_BODY()
241
242 /**
243 * @brief Descriptions of property tables to encode for access in Unreal
244 * materials.
245 */
246 UPROPERTY(
247 EditAnywhere,
248 Category = "Cesium|Metadata",
249 Meta = (TitleProperty = "Name"))
251
252 /**
253 * @brief Descriptions of property textures to make accessible to Unreal
254 * materials.
255 */
256 UPROPERTY(
257 EditAnywhere,
258 Category = "Cesium|Metadata",
259 Meta = (TitleProperty = "Name"))
261};
262
263#pragma endregion
264
265#pragma region Tileset Statistics
266
267/**
268 * @brief Supported statistic semantics from the 3D Tiles specification.
269 */
270UENUM()
272 None = 0 UMETA(Hidden),
273 /**
274 * The minimum property value occurring in the tileset.
275 */
277 /**
278 * The maximum property value occurring in the tileset.
279 */
281 /**
282 * The arithmetic mean of property values occurring in the tileset.
283 */
285 /**
286 * The median of property values occurring in the tileset.
287 */
289 /**
290 * The standard deviation of property values occurring in the tileset.
291 */
293 /**
294 * The variance of property values occurring in the tileset.
295 */
297 /**
298 * The sum of property values occurring in the tileset.
299 */
301};
302
303/**
304 * @brief A statistic for a metadata property's values.
305 */
306USTRUCT()
308 GENERATED_USTRUCT_BODY()
309 /**
310 * @brief The semantic of this statistic.
311 */
312 UPROPERTY(EditAnywhere, Category = "Cesium|Metadata|Statistics")
314
315 /**
316 * @brief The value of this statistic. This reflects the value on the tileset
317 * it is attached to and should not be edited by users.
318 */
319 UPROPERTY(Transient, VisibleAnywhere, Category = "Cesium|Metadata|Statistics")
321};
322
323/**
324 * @brief The statistics for a given metadata property.
325 */
326USTRUCT()
328 GENERATED_USTRUCT_BODY()
329 /**
330 * @brief The identifier of this property.
331 */
332 UPROPERTY(EditAnywhere, Category = "Cesium|Metadata|Statistics")
333 FString Id;
334
335 /**
336 * @brief The available statistics for this property.
337 */
338 UPROPERTY(
339 EditAnywhere,
340 Category = "Cesium|Metadata|Statistics",
341 Meta = (TitleProperty = "Semantic"))
343};
344
345/**
346 * @brief The statistics for a given metadata class.
347 */
348USTRUCT()
350 GENERATED_USTRUCT_BODY()
351 /**
352 * @brief The identifier of this class.
353 */
354 UPROPERTY(EditAnywhere, Category = "Cesium|Metadata|Statistics")
355 FString Id;
356
357 /**
358 * @brief The statistics of properties belonging to this class.
359 */
360 UPROPERTY(
361 EditAnywhere,
362 Category = "Cesium|Metadata|Statistics",
363 Meta = (TitleProperty = "Id"))
365};
366
367#pragma endregion
368
369/**
370 * @brief Description of both feature IDs and metadata from a glTF via the
371 * EXT_mesh_features and EXT_structural_metadata extensions. Indicates what
372 * parts of the extension should be uploaded to the GPU for access in Unreal
373 * materials.
374 */
375USTRUCT()
376struct CESIUMRUNTIME_API FCesiumFeaturesMetadataDescription {
377 GENERATED_USTRUCT_BODY()
378
379public:
380 /**
381 * @brief Description of the statistics reported by the tileset. Each entry
382 * represents a class and its cumulative statistics.
383 */
384 UPROPERTY(EditAnywhere, Category = "Cesium", Meta = (TitleProperty = "Id"))
386
387 /**
388 * @brief Description of the feature ID sets available from the
389 * EXT_mesh_features or EXT_instance_features extensions in a glTF.
390 */
391 UPROPERTY(EditAnywhere, Category = "Cesium", Meta = (TitleProperty = "Name"))
393
394 /**
395 * @brief Description of the metadata used by the EXT_structural_metadata on a
396 * glTF's primitives.
397 */
398 UPROPERTY(EditAnywhere, Category = "Cesium", Meta = (TitleProperty = "Name"))
400
401 /**
402 * @brief Description of metadata from a glTF's EXT_structural_metadata
403 * extension.
404 */
405 UPROPERTY(EditAnywhere, Category = "Cesium", Meta = (TitleProperty = "Name"))
407};
@ UMETA
The tileset will be loaded from Cesium Ion using the provided IonAssetID and IonAccessToken.
ECesiumFeatureIdSetType
The type of a feature ID set.
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.
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.
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 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...