import MaterialParameter; struct RayTracingParams { RaytracingAccelerationStructure scene; RWTexture2D radianceAccumulator; RWTexture2D image; StructuredBuffer indexBuffer; TextureCube skyBox; SamplerState skyBoxSampler; }; ParameterBlock pRayTracingParams; struct RayPayload { LightingParameter params; MaterialParameter materialParams; float3 light; float t; 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)); }