2024-07-12 13:33:52 +02:00
|
|
|
import MaterialParameter;
|
|
|
|
|
|
2024-07-08 13:46:49 +02:00
|
|
|
struct RayTracingParams
|
|
|
|
|
{
|
|
|
|
|
RaytracingAccelerationStructure scene;
|
2024-12-25 14:59:08 +01:00
|
|
|
RWTexture2D<float4> radianceAccumulator;
|
2024-07-10 21:07:10 +02:00
|
|
|
RWTexture2D<float4> image;
|
2024-07-08 13:46:49 +02:00
|
|
|
StructuredBuffer<uint> indexBuffer;
|
2024-12-25 14:59:08 +01:00
|
|
|
TextureCube<float4> skyBox;
|
|
|
|
|
SamplerState skyBoxSampler;
|
2024-07-08 13:46:49 +02:00
|
|
|
};
|
2024-07-12 13:33:52 +02:00
|
|
|
layout(set=5)
|
2024-07-08 13:46:49 +02:00
|
|
|
ParameterBlock<RayTracingParams> pRayTracingParams;
|
2024-07-12 13:33:52 +02:00
|
|
|
|
|
|
|
|
struct CallablePayload
|
|
|
|
|
{
|
|
|
|
|
FragmentParameter params;
|
|
|
|
|
float3 color;
|
|
|
|
|
};
|
|
|
|
|
|
2024-12-25 14:59:08 +01:00
|
|
|
struct ShadingParams
|
|
|
|
|
{
|
|
|
|
|
float3 position;
|
|
|
|
|
float3 normal;
|
|
|
|
|
float3 normalLight;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct MaterialParams
|
|
|
|
|
{
|
|
|
|
|
float4 color;
|
|
|
|
|
float3 emissive;
|
|
|
|
|
}
|
|
|
|
|
|
2024-07-12 13:33:52 +02:00
|
|
|
struct RayPayload
|
|
|
|
|
{
|
2024-12-25 14:59:08 +01:00
|
|
|
ShadingParams shading;
|
|
|
|
|
MaterialParams material;
|
2024-07-12 13:33:52 +02:00
|
|
|
};
|