armory/Shaders/compositor_pass/compositor_pass.vert.glsl

35 lines
579 B
Plaintext
Raw Permalink Normal View History

2016-03-23 23:35:44 +01:00
#version 450
#include "compiled.inc"
2018-02-18 19:10:14 +01:00
2016-12-20 01:39:16 +01:00
// #ifdef _CPos
2016-10-23 15:32:26 +02:00
// uniform mat4 invVP;
// uniform vec3 eye;
// #endif
2016-08-15 23:45:03 +02:00
2016-03-23 23:35:44 +01:00
in vec2 pos;
out vec2 texCoord;
2016-12-20 01:39:16 +01:00
// #ifdef _CPos
2016-10-23 15:32:26 +02:00
// out vec3 viewRay;
// #endif
2016-03-23 23:35:44 +01:00
void main() {
2016-08-15 23:45:03 +02:00
// Scale vertex attribute to [0-1] range
2016-10-17 17:39:40 +02:00
const vec2 madd = vec2(0.5, 0.5);
2016-08-15 23:45:03 +02:00
texCoord = pos.xy * madd + madd;
2020-05-04 00:19:11 +02:00
#ifdef _InvY
2017-06-23 15:47:51 +02:00
texCoord.y = 1.0 - texCoord.y;
#endif
2016-03-23 23:35:44 +01:00
2016-08-15 23:45:03 +02:00
gl_Position = vec4(pos.xy, 0.0, 1.0);
2016-12-20 01:39:16 +01:00
// #ifdef _CPos
2016-08-15 23:45:03 +02:00
// NDC (at the back of cube)
2020-05-04 00:19:11 +02:00
// vec4 v = vec4(pos.xy, 1.0, 1.0);
2016-10-23 15:32:26 +02:00
// v = vec4(invVP * v);
// v.xyz /= v.w;
// viewRay = v.xyz - eye;
// #endif
2016-03-23 23:35:44 +01:00
}