Dashboard/Quik/res/gl21.vert

36 lines
936 B
GLSL
Raw Normal View History

2023-06-30 18:35:24 +02:00
/**
* QUIK: User Interface Kit
* Copyright (C) 2023 Halit Utku Maden, et al.
*/
2024-04-14 21:51:10 +02:00
#version 130
2023-06-30 18:35:24 +02:00
2024-04-14 21:51:10 +02:00
in vec2 v2Position; /**< The vertex position.*/
in float fZIndex; /**< The z index. */
in vec2 v2TexPos; /**< The texture coorindates. */
in float fTexLayer; /**< The texture layer for 3D textures. */
in vec4 v4Color; /**< The vertex color. */
2023-06-30 18:35:24 +02:00
2024-04-14 21:51:10 +02:00
out vec2 fv2TexPos;
out float ffTexLayer;
out vec4 fv4Color;
2023-06-30 18:35:24 +02:00
uniform mat4 m4Transforms; /**< The view matrix. */
2024-04-14 21:51:10 +02:00
uniform float fMaxZ; /**< Highest Z coordinate. */
const mat4 m4BaseTransforms = mat4(
vec4( 2.0, 0.0, 0.0, 0.0),
vec4( 0.0, -2.0, 0.0, 0.0),
vec4( 0.0, 0.0, 1.0, 0.0),
vec4(-1.0, 1.0, 0.0, 1.0)
);
2023-06-30 18:35:24 +02:00
void main(void)
{
2024-04-14 21:51:10 +02:00
vec4 v = vec4(v2Position, fZIndex/fMaxZ, 1);
gl_Position = m4Transforms * v;
2023-06-30 18:35:24 +02:00
fv2TexPos = v2TexPos;
2023-09-22 20:23:59 +02:00
fv4Color = v4Color;
2024-04-14 21:51:10 +02:00
ffTexLayer = fTexLayer;
}