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