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

Container for all the buffers and views needed for per-source model input to both the skinning shader and subsequent mesh shaders. More...

#include <SkinnedMeshInputBuffers.h>

Inherits AZStd::intrusive_base.

Public Member Functions

 AZ_CLASS_ALLOCATOR (SkinnedMeshInputBuffers, AZ::SystemAllocator)
 
void CreateFromModelAsset (const Data::Asset< RPI::ModelAsset > &modelAsset)
 Create SkinnedMeshInputBuffers from a model.
 
Data::Asset< RPI::ModelAssetGetModelAsset () const
 Get the ModelAsset used to create the SkinnedMeshInputBuffers.
 
Data::Instance< RPI::ModelGetModel () const
 Get the Model used to as input to the skinning compute shader.
 
uint32_t GetMeshCount (uint32_t lodIndex) const
 Get the number of meshes for the lod.
 
uint32_t GetLodCount () const
 Get the total number of lods.
 
const SkinnedMeshInputLodGetLod (uint32_t lodIndex) const
 Get an individual lod.
 
uint32_t GetVertexCount (uint32_t lodIndex, uint32_t meshIndex) const
 Get the number of vertices for the specified lod.
 
void SetBufferViewsOnShaderResourceGroup (uint32_t lodIndex, uint32_t meshIndex, const Data::Instance< RPI::ShaderResourceGroup > &perInstanceSRG)
 Set the buffer views and vertex count on the given SRG.
 
AZStd::intrusive_ptr< SkinnedMeshInstanceCreateSkinnedMeshInstance () const
 Create a model and resource views into the SkinnedMeshOutputBuffer that can be used as a target for the skinned vertices.
 
uint32_t GetInfluenceCountPerVertex (uint32_t lodIndex, uint32_t meshIndex) const
 Returns the number of influences per vertex for a mesh.
 
const AZStd::vector< MorphTargetComputeMetaData > & GetMorphTargetComputeMetaDatas (uint32_t lodIndex) const
 Returns a vector of MorphTargetMetaData with one entry for each morph target that could be applied to this mesh.
 
const AZStd::vector< AZStd::intrusive_ptr< MorphTargetInputBuffers > > & GetMorphTargetInputBuffers (uint32_t lodIndex) const
 Returns a vector of MorphTargetInputBuffers which serve as input to the morph target pass.
 
float GetMorphTargetIntegerEncoding (uint32_t lodIndex, uint32_t meshIndex) const
 
void AddMorphTarget (uint32_t lodIndex, const RPI::MorphTargetMetaAsset::MorphTarget &morphTarget, const RPI::BufferAssetView *morphBufferAssetView, const AZStd::string &bufferNamePrefix, float minWeight, float maxWeight)
 
void Finalize ()
 

Detailed Description

Container for all the buffers and views needed for per-source model input to both the skinning shader and subsequent mesh shaders.

Member Function Documentation

◆ AddMorphTarget()

void AZ::Render::SkinnedMeshInputBuffers::AddMorphTarget ( uint32_t  lodIndex,
const RPI::MorphTargetMetaAsset::MorphTarget morphTarget,
const RPI::BufferAssetView morphBufferAssetView,
const AZStd::string &  bufferNamePrefix,
float  minWeight,
float  maxWeight 
)

Add a single morph target that can be applied to an instance of this skinned mesh Creates a view into the larger morph target buffer to be used for applying an individual morph Must call Finalize after all morph targets have been added

Parameters
lodIndexThe index of the lod modified by the morph target
morphTargetThe metadata that has info such as the min/max weight, offset, and vertex count for the morph
morphBufferAssetViewThe view of all the morph target deltas that can be applied to this mesh
bufferNamePrefixA prefix that can be used to identify this morph target when creating the view into the morph target buffer.
minWeightThe minimum weight that might be applied to this morph target. It's possible for the weight of a morph target to be outside the 0-1 range. Defaults to 0
maxWeightThe maximum weight that might be applied to this morph target. It's possible for the weight of a morph target to be outside the 0-1 range.

◆ Finalize()

void AZ::Render::SkinnedMeshInputBuffers::Finalize ( )

Do any internal calculations that must be done after the input buffers are created from the model and after all morph targets have been added

◆ GetMorphTargetIntegerEncoding()

float AZ::Render::SkinnedMeshInputBuffers::GetMorphTargetIntegerEncoding ( uint32_t  lodIndex,
uint32_t  meshIndex 
) const

Return the integer encoding used for the morph targets for a given lod/mesh, or -1 if there are no morph targets for the mesh. If the values are not yet pre-calculated, they will be when calling this function


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