
96 II Rendering
#d e f i n e THREAD GROUP SIZE 64
RWStructuredBuffer<uint> QuantizedLODDistance : register( u6 );
RWStructuredBuffer<uint> LODSortedStrandIndex : register( u7 );
// cameraPos , cameraDir , and maxDist are given through
// const buffer .
[ numthreads ( THREAD_GROUP_SIZE ,1,1)]
void ComputeCameraDistance ( uint GIndex : SV_GroupIndex ,
uint3 GId : SV_GroupID ,
uint3 DTid : SV_DispatchThreadID )
{
uint globalBladedIndex , globalRootVertexIndex ;
// Calculate indices above here .
float4 pos = g_HairVertexPositions [ globalRootVertexIndex +1];
float dist = dot (( pos . xyz − cameraPos . xyz), cameraDir . xyz );
// Perform frustum culling and ass ...