Common.hlsl 862 B

1234567891011121314151617181920212223
  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. #define MAX_TRANSPACENT_HITS 5
  8. struct [raypayload] HitInfo
  9. {
  10. float4 color[MAX_TRANSPACENT_HITS] : write(caller, closesthit, anyhit, miss) : read(caller, anyhit, closesthit, miss);
  11. float distance[MAX_TRANSPACENT_HITS] : write(caller, closesthit, anyhit) : read(caller, anyhit, closesthit);
  12. uint hitCount : write(caller, anyhit, closesthit, miss) : read(caller, anyhit, closesthit, miss);
  13. };
  14. // Attributes output by the raytracing when hitting a surface,
  15. // here the barycentric coordinates
  16. struct Attributes
  17. {
  18. float2 texCoord;
  19. int textureId;
  20. };