vkdoom_m/wadsrc/static/shaders/lightmap/vert_viewer.glsl
Magnus Norddahl 4655b02f06 Fix using wrong surface for the extra BLAS structures for trace hits
Add gl_raytrace for ray tracing the level mesh
2024-09-05 00:15:59 +02:00

21 lines
476 B
GLSL

#include <shaders/lightmap/binding_viewer.glsl>
layout(location = 0) out vec3 FragRay;
vec2 positions[4] = vec2[](
vec2(0.0, 0.0),
vec2(1.0, 0.0),
vec2(0.0, 1.0),
vec2(1.0, 1.0)
);
void main()
{
vec4 viewpos = vec4(positions[gl_VertexIndex] * 2.0 - 1.0, -1.0, 1.0);
viewpos.x /= ProjX;
viewpos.y = -viewpos.y / ProjY;
FragRay = ((ViewToWorld * viewpos).xyz - CameraPos);
gl_Position = vec4((positions[gl_VertexIndex] * 2.0 - 1.0) * vec2(1.0, -1.0), 1.0, 1.0);
}