17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-02 10:29:13 +01:00

Vulkan: scene rendering (D1–D7) on a scene walk shared with GL (N6a, N6b)

This commit is contained in:
2026-10-24 20:10:24 +02:00
parent bd589f272d
commit 9b7d02e5fb
107 changed files with 14511 additions and 3924 deletions

View File

@@ -0,0 +1,34 @@
#version 460 core
#define STAGE_VERTEX 1
#include "common.glsl"
const vec2 vert[4] = vec2[]
(
vec2(-1.0, 1.0),
vec2(-1.0, -1.0),
vec2( 1.0, 1.0),
vec2( 1.0, -1.0)
);
layout(location = 2) out vec2 f_coord;
// the corner of the quad, -1...1 across it
layout(location = 15) out vec2 f_local;
void main()
{
gl_Position = projection * (vec4(param[1].xyz, 1.0) + vec4(vert[gl_VertexIndex] * param[1].w, 0.0, 0.0));
f_local = vert[gl_VertexIndex];
vec2 coord = param[2].xy;
float size = param[2].z;
if (gl_VertexIndex == 0)
f_coord = vec2(coord.x, coord.y);
if (gl_VertexIndex == 1)
f_coord = vec2(coord.x, coord.y - size);
if (gl_VertexIndex == 2)
f_coord = vec2(coord.x + size, coord.y);
if (gl_VertexIndex == 3)
f_coord = vec2(coord.x + size, coord.y - size);
}