Cesium for Unreal 2.22.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
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|Features")
48 FString Name;
49
50 /**
51 * The type of the feature ID set.
52 */
53 UPROPERTY(EditAnywhere, Category = "Cesium|Features")
55
56 /**
57 * The name of the property table that this feature ID set corresponds to.
58 */
59 UPROPERTY(EditAnywhere, Category = "Cesium|Features")
61};
62
63/**
64 * @brief Description of the feature ID sets available from the
65 * EXT_mesh_features and EXT_instance_features extensions in a glTF.
66 *
67 * This aggregates the feature ID sets of all visible glTF primitives in the
68 * model. This describes the feature IDs that can be made accessible
69 * to Unreal Engine materials.
70 */
71USTRUCT()
72struct CESIUMRUNTIME_API FCesiumPrimitiveFeaturesDescription {
73 GENERATED_USTRUCT_BODY()
74
75 /**
76 * @brief The feature ID sets to make accessible to the material. Note that
77 * the order of feature ID sets in this array does not necessarily
78 * correspond to the order of these feature ID sets in a glTF
79 * primitive.
80 */
81 UPROPERTY(
82 EditAnywhere,
83 Category = "Cesium|Features",
84 Meta = (TitleProperty = "Name"))
86};
87#pragma endregion
88
89#pragma region Metadata descriptions
90
91// These don't exhaustively cover the possibilities of glTF metadata
92// classes, they only cover the subset that can be encoded into textures. The
93// following types are excluded:
94// - enums
95// - strings that cannot be parsed as numbers or colors
96// - matrices
97// - variable length arrays
98// - arrays of non-scalar, non-boolean elements
99//
100// Additionally, if a property contains fixed-length arrays, only the first four
101// elements can be encoded.
102
103/**
104 * @brief Description of a property table property that should be encoded for
105 * access on the GPU.
106 */
107USTRUCT()
109 GENERATED_USTRUCT_BODY()
110
111 /**
112 * The name of this property. This will be how it is referenced in the
113 * material.
114 */
115 UPROPERTY(EditAnywhere, Category = "Cesium|Metadata")
116 FString Name;
117
118 /**
119 * Describes the underlying type of this property and other relevant
120 * information from its EXT_structural_metadata definition. Not all types of
121 * properties can be encoded to the GPU, or coerced to GPU-compatible types.
122 */
123 UPROPERTY(EditAnywhere, Category = "Cesium|Metadata")
125
126 /**
127 * Describes how the property will be encoded as data on the GPU, if possible.
128 */
129 UPROPERTY(EditAnywhere, Category = "Cesium|Metadata")
131};
132
133/**
134 * @brief Description of a property table containing properties to be encoded
135 * for access in Unreal materials.
136 */
137USTRUCT()
138struct CESIUMRUNTIME_API FCesiumPropertyTableDescription {
139 GENERATED_USTRUCT_BODY()
140
141 /**
142 * @brief The name of this property table. If this property table has no name
143 * in the EXT_structural_metadata extension, then its class name is used
144 * instead.
145 */
146 UPROPERTY(EditAnywhere, Category = "Cesium|Metadata")
147 FString Name;
148
149 /**
150 * @brief Descriptions of the properties to upload to the GPU.
151 */
152 UPROPERTY(
153 EditAnywhere,
154 Category = "Cesium|Metadata",
155 Meta = (TitleProperty = "Name"))
157};
158
159/**
160 * @brief Description of a property texture property that should be made
161 * accessible to Unreal materials. A property texture property's data is
162 * already available through a texture, so no additional encoding details need
163 * to be specified.
164 */
165USTRUCT()
167 GENERATED_USTRUCT_BODY()
168
169 /**
170 * The name of this property. This will be how it is referenced in the
171 * material.
172 */
173 UPROPERTY(EditAnywhere, Category = "Cesium|Metadata")
174 FString Name;
175
176 /**
177 * Describes the underlying type of this property and other relevant
178 * information from its EXT_structural_metadata definition.
179 */
180 UPROPERTY(EditAnywhere, Category = "Cesium|Metadata")
182};
183
184/**
185 * @brief Description of a property texture with properties that should be
186 * made accessible to Unreal materials.
187 */
188USTRUCT()
189struct CESIUMRUNTIME_API FCesiumPropertyTextureDescription {
190 GENERATED_USTRUCT_BODY()
191
192 /**
193 * @brief The name of this property texture.
194 */
195 UPROPERTY(EditAnywhere, Category = "Cesium|Metadata")
196 FString Name;
197
198 /**
199 * @brief Descriptions of the properties to upload to the GPU.
200 */
201 UPROPERTY(
202 EditAnywhere,
203 Category = "Cesium|Metadata",
204 Meta = (TitleProperty = "Name"))
206};
207
208/**
209 * @brief Names of the metadata entities referenced by the
210 * EXT_structural_metadata on a glTF's primitives.
211 *
212 * This aggregates the metadata of all visible glTF primitives in the model.
213 * This lists the names of the property textures actually used by the glTF
214 * primitive, indicating it can be sampled with the primitive's texture
215 * coordinates in the Unreal material.
216 */
217USTRUCT()
218struct CESIUMRUNTIME_API FCesiumPrimitiveMetadataDescription {
219 GENERATED_USTRUCT_BODY()
220
221 /**
222 * @brief The names of the property textures used by the glTF primitives
223 * across the tileset.
224 *
225 * This should be a subset of the property textures listed in the model
226 * metadata. Property textures can be passed to the material even if they are
227 * not explicitly used by a glTF primitive, but the primitive may lack the
228 * corresponding sets of texture coordinates intended to sample them.
229 */
230 UPROPERTY(
231 EditAnywhere,
232 Category = "Cesium|Metadata",
233 Meta = (TitleProperty = "Name"))
234 TSet<FString> PropertyTextureNames;
235};
236
237/**
238 * @brief Description of metadata from a glTF's EXT_structural_metadata
239 * extension that should be uploaded to the GPU for access in Unreal materials.
240 */
241USTRUCT()
242struct CESIUMRUNTIME_API FCesiumModelMetadataDescription {
243 GENERATED_USTRUCT_BODY()
244
245 /**
246 * @brief Descriptions of property tables to encode for access in Unreal
247 * materials.
248 */
249 UPROPERTY(
250 EditAnywhere,
251 Category = "Cesium|Metadata",
252 Meta = (TitleProperty = "Name"))
254
255 /**
256 * @brief Descriptions of property textures to make accessible to Unreal
257 * materials.
258 */
259 UPROPERTY(
260 EditAnywhere,
261 Category = "Cesium|Metadata",
262 Meta = (TitleProperty = "Name"))
264};
265
266#pragma endregion
267
268/**
269 * @brief Description of both feature IDs and metadata from a glTF via the
270 * EXT_mesh_Features and EXT_structural_metadata extensions. Indicates what
271 * parts of the extension should be uploaded to the GPU for access in Unreal
272 * materials.
273 */
274USTRUCT()
275struct CESIUMRUNTIME_API FCesiumFeaturesMetadataDescription {
276 GENERATED_USTRUCT_BODY()
277
278public:
279 /**
280 * @brief Description of the feature ID sets available from the
281 * EXT_mesh_features or EXT_instance_features extensions in a glTF.
282 */
283 UPROPERTY(EditAnywhere, Category = "Cesium", Meta = (TitleProperty = "Name"))
285
286 /**
287 * @brief Description of the metadata used by the EXT_structural_metadata on a
288 * glTF's primitives.
289 */
290 UPROPERTY(EditAnywhere, Category = "Cesium", Meta = (TitleProperty = "Name"))
292
293 /**
294 * @brief Description of metadata from a glTF's EXT_structural_metadata
295 * extension.
296 */
297 UPROPERTY(EditAnywhere, Category = "Cesium", Meta = (TitleProperty = "Name"))
299};
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.
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...
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.
FCesiumMetadataPropertyDetails PropertyDetails
Describes the underlying type of this property and other relevant information from its EXT_structural...