Open 3D Engine Meshlets Gem API Reference  24.09
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AZ::Meshlets::MeshletsModel Class Reference

#include <MeshletsAssets.h>

Public Member Functions

 MeshletsModel (Data::Asset< RPI::ModelAsset > sourceModelAsset)
 
Data::Instance< RPI::Model > GetMeshletsModel ()
 
AZStd::string & GetName ()
 

Static Public Member Functions

static Data::Instance< RPI::ShaderResourceGroup > CreateShaderResourceGroup (Data::Instance< RPI::Shader > shader, const char *shaderResourceGroupId, [[maybe_unused]] const char *moduleName)
 

Public Attributes

Name IndicesSemanticName
 
Name PositionSemanticName
 
Name NormalSemanticName
 
Name TangentSemanticName
 
Name BiTangentSemanticName
 
Name UVSemanticName
 
Name MeshletsDescriptorsName
 
Name MeshletsTrianglesName
 
Name MeshletsIndicesLookupName
 

Static Public Attributes

static uint32_t s_modelNumber
 

Protected Member Functions

bool ProcessBuffersData (float *position, uint32_t vtxNum)
 
void debugMarkMeshletsUVs (GeneratorMesh &mesh)
 
uint32_t CreateMeshlets (GeneratorMesh &mesh)
 
uint8_t * RetrieveBufferData (const RPI::BufferAssetView *bufferView, RHI::Format &format, uint32_t expectedAmount, uint32_t &existingAmount, RHI::BufferViewDescriptor &bufferDesc)
 
Data::Asset< RPI::BufferAsset > CreateBufferAsset (const AZStd::string &bufferName, const RHI::BufferViewDescriptor &bufferViewDescriptor, RHI::BufferBindFlags bufferBindFlags, const void *data)
 
uint32_t CreateMeshlets (float *positions, float *normals, float *texCoords, uint32_t vtxNum, uint16_t *indices, uint32_t idxNum, RHI::Format IndexStreamFormat)
 
uint32_t CreateMeshletsFromModelAsset (Data::Asset< RPI::ModelAsset > sourceModelAsset)
 
uint32_t CreateMeshletsModel (const RPI::ModelLod &modelLod)
 
uint32_t CreateMeshletsModel (const RPI::ModelLodAsset::Mesh &meshAsset)
 
uint32_t GetMehsletsAmount ()
 

Detailed Description

Reference Class to Demonstrate Meshlets Prep in CPU The following class is taking in ModelAsset and based on it, generates a new Atom Model that now contains enhanced meshlet data. This class is built to demonstrate and used as reference for using the mesh data to generate the meshlets on the fly and send them to the regular render. This is NOT the class that will be used to create indirect Compute and Draw calls. For this we will be using the MeshletRenderObject class.

Currently assuming single model without Lods so that the handling of the meshlet creation and handling of the array is easier. If several meshes or Lods exist, they will be created as separate models and the last model's instance will be kept in this class. Each one of the ModelLods contains a vector of meshes, representing possible multiple element within the mesh - to fully represent a mesh, the replication method will need to run and gather all data, unify it within a single stream and address from each of the Lods.


The documentation for this class was generated from the following file: