2015-10-26 20:36:19 +00:00
|
|
|
#version 120
|
2021-07-09 17:05:27 +00:00
|
|
|
|
|
|
|
uniform mat4 projectionMatrix;
|
|
|
|
|
2015-10-26 20:36:19 +00:00
|
|
|
varying vec3 screenCoordsPassthrough;
|
|
|
|
varying vec4 position;
|
2020-03-14 12:39:32 +00:00
|
|
|
varying float linearDepth;
|
2015-10-26 20:36:19 +00:00
|
|
|
|
2018-06-24 22:40:52 +00:00
|
|
|
#include "shadows_vertex.glsl"
|
2021-06-01 19:15:25 +00:00
|
|
|
#include "depth.glsl"
|
2017-10-30 20:06:52 +00:00
|
|
|
|
2015-10-26 20:36:19 +00:00
|
|
|
void main(void)
|
|
|
|
{
|
2021-07-09 17:05:27 +00:00
|
|
|
gl_Position = projectionMatrix * (gl_ModelViewMatrix * gl_Vertex);
|
2015-10-26 20:36:19 +00:00
|
|
|
|
|
|
|
mat4 scalemat = mat4(0.5, 0.0, 0.0, 0.0,
|
2018-06-22 00:05:45 +00:00
|
|
|
0.0, -0.5, 0.0, 0.0,
|
|
|
|
0.0, 0.0, 0.5, 0.0,
|
|
|
|
0.5, 0.5, 0.5, 1.0);
|
2015-10-26 20:36:19 +00:00
|
|
|
|
|
|
|
vec4 texcoordProj = ((scalemat) * ( gl_Position));
|
2019-08-30 19:01:03 +00:00
|
|
|
screenCoordsPassthrough = texcoordProj.xyw;
|
2015-10-26 20:36:19 +00:00
|
|
|
|
|
|
|
position = gl_Vertex;
|
|
|
|
|
2021-06-01 19:15:25 +00:00
|
|
|
vec4 viewPos = gl_ModelViewMatrix * gl_Vertex;
|
2021-07-09 17:05:27 +00:00
|
|
|
linearDepth = getLinearDepth(gl_Position.z, viewPos.z);
|
2017-10-30 20:06:52 +00:00
|
|
|
|
2021-06-01 19:15:25 +00:00
|
|
|
setupShadowCoords(viewPos, normalize((gl_NormalMatrix * gl_Normal).xyz));
|
2015-10-26 20:36:19 +00:00
|
|
|
}
|