This repository has been archived on 2023-05-27. You can view files and clone it, but cannot push or open issues or pull requests.
api8/shaders/manif.vs

22 lines
570 B
Text
Raw Permalink Normal View History

2023-05-01 01:00:50 +02:00
#version 330
layout(location = 0) in vec3 pos;
layout(location = 1) in vec3 normal;
2023-05-08 12:16:29 +02:00
out vec4 pos_model;
out vec3 vec_normal;
2023-05-27 04:22:31 +02:00
out vec4 shadowMapCoord;
2023-05-08 12:16:29 +02:00
2023-05-08 10:23:45 +02:00
uniform mat4 proj, model, view;
2023-05-27 04:22:31 +02:00
uniform mat4 lightView, lightProjection;
2023-05-01 01:00:50 +02:00
void main() {
2023-05-27 04:22:31 +02:00
const mat4 bias = mat4(0.5, 0.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.5, 0.5, 0.5, 1.0);
2023-05-08 12:16:29 +02:00
pos_model = model * vec4(pos, 1);
vec_normal = normalize(transpose(inverse(model)) * vec4(normal, 0)).xyz;
2023-05-08 11:29:12 +02:00
2023-05-27 04:22:31 +02:00
shadowMapCoord = bias * lightProjection * lightView * pos_model;
2023-05-08 11:29:12 +02:00
gl_Position = proj * view * pos_model;
2023-05-01 01:00:50 +02:00
}