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::ModelAsset > | GetModelAsset () const |
Get the ModelAsset used to create the SkinnedMeshInputBuffers. | |
Data::Instance< RPI::Model > | GetModel () 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 SkinnedMeshInputLod & | GetLod (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< SkinnedMeshInstance > | CreateSkinnedMeshInstance () 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 () |
Container for all the buffers and views needed for per-source model input to both the skinning shader and subsequent mesh shaders.
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
lodIndex | The index of the lod modified by the morph target |
morphTarget | The metadata that has info such as the min/max weight, offset, and vertex count for the morph |
morphBufferAssetView | The view of all the morph target deltas that can be applied to this mesh |
bufferNamePrefix | A prefix that can be used to identify this morph target when creating the view into the morph target buffer. |
minWeight | The 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 |
maxWeight | The 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. |
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
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