procedural-3d-engine/shaders/hlsl/raytracingbasic/closesthit.rchit
Sascha Willems 66dce3c991 Fixed HLSL shaders (mostly ray tracing related)
Updated HLSL compile script
2023-10-13 17:26:51 +02:00

18 lines
353 B
GLSL

// Copyright 2020 Google LLC
struct Attributes
{
float2 bary;
};
struct Payload
{
[[vk::location(0)]] float3 hitValue;
};
[shader("closesthit")]
void main(inout Payload p, in Attributes attribs)
{
const float3 barycentricCoords = float3(1.0f - attribs.bary.x - attribs.bary.y, attribs.bary.x, attribs.bary.y);
p.hitValue = barycentricCoords;
}