Diligent Engine
 
Loading...
Searching...
No Matches
Diligent::GLTF::ModelCreateInfo Struct Reference

Model create information. More...

#include <GLTFLoader.hpp>

Public Attributes

const char * FileName = nullptr
 File name.
 
TextureCacheType * pTextureCache = nullptr
 
ResourceManagerpResourceManager = nullptr
 Optional resource manager to use when allocating resources for the model.
 
NodeLoadCallbackType NodeLoadCallback = nullptr
 Node loading callback function.
 
MeshLoadCallbackType MeshLoadCallback = nullptr
 Mesh loading callback function.
 
PrimitiveLoadCallbackType PrimitiveLoadCallback = nullptr
 Primitive loading callback function.
 
MaterialLoadCallbackType MaterialLoadCallback = nullptr
 Material loading callback function.
 
FileExistsCallbackType FileExistsCallback = nullptr
 Optional callback function that will be called by the loader to check if the file exists.
 
ReadWholeFileCallbackType ReadWholeFileCallback = nullptr
 Optional callback function that will be called by the loader to read the whole file.
 
VALUE_TYPE IndexType = VT_UINT32
 Index data type.
 
BIND_FLAGS IndBufferBindFlags = BIND_INDEX_BUFFER
 Index buffer bind flags.
 
BIND_FLAGS VertBufferBindFlags [MaxBuffers] = {}
 Vertex buffer bind flags for each buffer slot.
 
const VertexAttributeDescVertexAttributes = nullptr
 
Uint32 NumVertexAttributes = 0
 The number of elements in the VertexAttributes array.
 
const TextureAttributeDescTextureAttributes = nullptr
 
Uint32 NumTextureAttributes = 0
 The number of elements in the TextureAttributes array.
 
Int32 SceneId = -1
 Index of the scene to load. If -1, default scene will be loaded.
 
bool ComputeBoundingBoxes = false
 Whether to compute primitive bounding boxes from vertex positions.
 
bool CreateStubVertexBuffers = false
 

Detailed Description

Model create information.

Member Data Documentation

◆ ComputeBoundingBoxes

bool Diligent::GLTF::ModelCreateInfo::ComputeBoundingBoxes = false

Whether to compute primitive bounding boxes from vertex positions.

By default, primitive bounding boxes are defined by the min/max values of the primitive's position accessor in the source GLTF model. If this flag is set to true, the bounding boxes will be computed from vertex positions instead. This may be useful if the source model does not define bounding boxes for its primitives or if the bounding boxes are imprecise.

◆ CreateStubVertexBuffers

bool Diligent::GLTF::ModelCreateInfo::CreateStubVertexBuffers = false

Whether to create stub vertex buffers even if the model does provide any attribute to store in the buffer.

By default, if the model does not provide any attribute to store in the vertex buffer, the buffer will not be created. However, an application may still request the buffer to be created by setting this flag to true. This may be useful if the application uses the same vertex layout for all models and wants to avoid checking if the buffer is null.

The buffer will be zero-initialized.

◆ MaterialLoadCallback

MaterialLoadCallbackType Diligent::GLTF::ModelCreateInfo::MaterialLoadCallback = nullptr

Material loading callback function.

User-provided material loading callback function that will be called for every material being loaded.

Parameters
[in]pSrcModel- a pointer to the source model.
[in]pSrcMat- a pointer to the source material.
[out]DstMat- reference to the destination material.

The application should cast pSrcMat to the appropriate type depending on the loader it is using (e.g. tinygltf::Material*).

◆ MeshLoadCallback

MeshLoadCallbackType Diligent::GLTF::ModelCreateInfo::MeshLoadCallback = nullptr

Mesh loading callback function.

User-provided mesh loading callback function that will be called for every mesh being loaded.

Parameters
[in]pSrcModel- a pointer to the source GLTF model.
[in]pSrcMesh- a pointer to the source mesh.
[out]DstMesh- reference to the destination mesh.

The application should cast pSrcMesh to the appropriate type depending on the loader it is using (e.g. tinygltf::Mesh*).

◆ NodeLoadCallback

NodeLoadCallbackType Diligent::GLTF::ModelCreateInfo::NodeLoadCallback = nullptr

Node loading callback function.

User-provided node loading callback function that will be called for every node being loaded.

Parameters
[in]pSrcModel- a pointer to the source GLTF model.
[in]SrcNodeIndex- an index of the node in the source GLTF model.
[in]pSrcNode- a pointer to the source node.
[out]DstNode- reference to the destination node.

The application should cast pSrcNode to the appropriate type depending on the loader it is using (e.g. tinygltf::Node*).

◆ PrimitiveLoadCallback

PrimitiveLoadCallbackType Diligent::GLTF::ModelCreateInfo::PrimitiveLoadCallback = nullptr

Primitive loading callback function.

User-provided primitive loading callback function that will be called for every primitive being loaded.

Parameters
[in]pSrcModel- a pointer to the source model.
[in]pSrcPrim- a pointer to the source primitive.
[out]DstPrim- reference to the destination primitive.

The application should cast pSrcPrim to the appropriate type depending on the loader it is using (e.g. tinygltf::Primitive*).

◆ pTextureCache

TextureCacheType* Diligent::GLTF::ModelCreateInfo::pTextureCache = nullptr

Optional texture cache to use when loading the model. The loader will try to find all the textures in the cache and add all new textures to the cache.

◆ TextureAttributes

const TextureAttributeDesc* Diligent::GLTF::ModelCreateInfo::TextureAttributes = nullptr

A pointer to the array of NumTextureAttributes texture attributes.

If null is provided, default vertex attributes will be used (see DefaultTextureAttributes).

◆ VertexAttributes

const VertexAttributeDesc* Diligent::GLTF::ModelCreateInfo::VertexAttributes = nullptr

A pointer to the array of NumVertexAttributes vertex attributes defining the vertex layout.

If null is provided, default vertex attributes will be used (see DefaultVertexAttributes).