forked from Dynamitos/Seele
refactor ray tracing
This commit is contained in:
1 parent
0fb5320a30
commit
d3a2617d7f
4 files changed
+127
-132
No files matched your search
@@ -18,21 +18,16 @@ struct CallablePayload
|
||||
float3 color;
|
||||
};
|
||||
|
||||
struct ShadingParams
|
||||
{
|
||||
float3 position;
|
||||
float3 normal;
|
||||
float3 normalLight;
|
||||
};
|
||||
|
||||
struct MaterialParams
|
||||
{
|
||||
float4 color;
|
||||
float3 emissive;
|
||||
}
|
||||
|
||||
struct RayPayload
|
||||
{
|
||||
ShadingParams shading;
|
||||
MaterialParams material;
|
||||
};
|
||||
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));
|
||||
}
|
||||
Reference in new issue
Block a user