import MaterialParameter; struct RayTracingParams { RaytracingAccelerationStructure scene; RWTexture2D radianceAccumulator; RWTexture2D image; StructuredBuffer indexBuffer; TextureCube skyBox; SamplerState skyBoxSampler; }; layout(set=5) ParameterBlock pRayTracingParams; struct CallablePayload { FragmentParameter params; float3 color; }; struct RayPayload { float3 light; float emissive; uint depth; bool hit; bool anyHit; uint3 rndSeed; }; float3 rand01(uint3 x){ // pseudo-random number generator for (int i=3; i-->0;) x = ((x>>8U)^x.yzx)*1103515245U; return float3(x)*(1.0/float(0xffffffffU)); }