Files
Seele/res/shaders/raytracing/RayTracingData.slang
T

33 lines
709 B
Plaintext
Raw Normal View History

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;
};
struct RayPayload
{
2024-12-31 10:40:03 +01:00
float3 light;
float emissive;
uint depth;
bool hit;
bool anyHit;
};
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));
}