#include <HairRenderObject.h>
Public Member Functions | |
bool | CreateDynamicGPUResources (Data::Instance< RPI::Shader > computeShader, Data::Instance< RPI::Shader > rasterShader, uint32_t vertexCount, uint32_t strandsCount) |
bool | UploadGPUData (const char *name, void *positions, void *tangents) |
void | PrepareSrgDescriptors (int32_t vertexCount, uint32_t strandsCount) |
Data::Instance< RPI::ShaderResourceGroup > | GetSimSrgForCompute () |
Data::Instance< RPI::ShaderResourceGroup > | GetSimSrgForRaster () |
bool | IsInitialized () |
Static Public Member Functions | |
static void | PrepareSrgDescriptors (AZStd::vector< SrgBufferDescriptor > &descriptorArray, int32_t vertexCount, uint32_t strandsCount) |
Friends | |
class | HairRenderObject |
DynamicHairData
Contains the writable data that is passed and used by 3 modules: simulation, signed distance field (collisions), and rendering. Rendering uses current position and tangent as SRVs in VS for computing creation and skinning. Since this data is per object (hence per object dispatch) and requires sync point (barrier) between the the passes, a single buffer is allocated and is shared by all hair objects and their 'streams' where each have buffer view so that it points to its own portion of the original buffer's data. The shared buffer is therefore declared in the pass Srg to result in an execution dependency so that a barrier will be created. It also represents less overhead since we are using a single
bool AZ::Render::Hair::DynamicHairData::CreateDynamicGPUResources | ( | Data::Instance< RPI::Shader > | computeShader, |
Data::Instance< RPI::Shader > | rasterShader, | ||
uint32_t | vertexCount, | ||
uint32_t | strandsCount | ||
) |
Creates the GPU dynamic buffers of a single hair object Equivalent to TressFXDynamicHairData::CreateGPUResources
|
static |
Preparation of the descriptors table of all the dynamic stream buffers within the class. Do not call this method before calling CreateAndBindGPUResources as it is already called from CreateAndBindGPUResources. This method can be called also for retrieving the descriptors table (SharedBuffer)
bool AZ::Render::Hair::DynamicHairData::UploadGPUData | ( | const char * | name, |
void * | positions, | ||
void * | tangents | ||
) |
Data upload - copy the hair mesh asset data (positions and tangents) into the buffers. In the following line I assume that positions and tangents are of the same size. Equivalent to: TressFXDynamicHairData::UploadGPUData