SPIRV-Cross/shaders/vulkan/rgen/execute_callable.nocompat.vk.rgen
2019-06-05 13:31:24 +02:00

17 lines
567 B
Plaintext

#version 460
#extension GL_NV_ray_tracing : require
layout(set = 0, binding = 0) uniform accelerationStructureNV as;
layout(set = 0, binding = 1, rgba32f) uniform writeonly image2D image;
layout(location = 0) rayPayloadNV vec4 payload;
layout(location = 0) callableDataNV float blend;
void main()
{
vec3 origin = vec3(0.0);
vec3 direction = vec3(0.0, 0.0, -1.0);
traceNV(as, gl_RayFlagsOpaqueNV, 0xFF, 0u, 0u, 0u, origin, 0.0, direction, 100.0f, 0);
executeCallableNV(0u, 0);
imageStore(image, ivec2(gl_LaunchIDNV.xy), payload + vec4(blend));
}