Common.hlsl 556 B

12345678910111213141516171819
  1. // Hit information, aka ray payload
  2. // This sample only carries a shading color and hit distance.
  3. // Note that the payload should be kept as small as possible,
  4. // and that its size must be declared in the corresponding
  5. // D3D12_RAYTRACING_SHADER_CONFIG pipeline subobjet.
  6. #pragma pack_matrix(row_major)
  7. struct [raypayload] HitInfo
  8. {
  9. float4 colorAndDistance : write(caller, closesthit, miss) : read(caller);
  10. };
  11. // Attributes output by the raytracing when hitting a surface,
  12. // here the barycentric coordinates
  13. struct Attributes
  14. {
  15. float2 bary;
  16. };