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

GLTF model. More...

#include <GLTFLoader.hpp>

Public Member Functions

void PrepareGPUResources (IRenderDevice *pDevice, IDeviceContext *pCtx)
 
Uint32 GetVertexPoolIndex () const
 Returns an index of the vertex pool in the resource manager.
 
Uint32 GetIndexAllocatorIndex () const
 Returns an index of the index buffer allocator in the resource manager.
 
int GetTextureAttributeIndex (const char *Name) const
 

Detailed Description

GLTF model.

Member Function Documentation

◆ GetIndexAllocatorIndex()

Uint32 Diligent::GLTF::Model::GetIndexAllocatorIndex ( ) const
inline

Returns an index of the index buffer allocator in the resource manager.

This index should be passed to the GetIndexBuffer method of the resource manager.

◆ GetTextureAttributeIndex()

int Diligent::GLTF::Model::GetTextureAttributeIndex ( const char * Name) const

Returns the material texture attribute index in Material.ShaderAttribs for the given texture attribute name, or -1 if the attribute is not defined. For example, for default attributes:

"baseColorTexture"         -> 0
"metallicRoughnessTexture" -> 1
"normalTexture"            -> 2
Note
This index is NOT the texture index in Textures array. To get this index, use Material.TextureIds[TextureAttributeIndex].

◆ GetVertexPoolIndex()

Uint32 Diligent::GLTF::Model::GetVertexPoolIndex ( ) const
inline

Returns an index of the vertex pool in the resource manager.

This index should be passed to the GetVertexPool method of the resource manager.

◆ PrepareGPUResources()

void Diligent::GLTF::Model::PrepareGPUResources ( IRenderDevice * pDevice,
IDeviceContext * pCtx )

Prepares the model's GPU resources:

  • Uploads pending vertex and index data to the GPU buffers
  • Uploads textures to the GPU
  • If the model does not use the resource cache, transitions resources to required states