Add wall shadow shaders

This commit is contained in:
2021-02-21 20:51:56 +01:00
parent 2f7ab06aa4
commit 3dc566b6af
7 changed files with 63 additions and 21 deletions
Binary file not shown.
Binary file not shown.
+7
View File
@@ -0,0 +1,7 @@
#version 430 core
out vec4 fColor;
void main()
{
fColor = vec4 (0.9,0.9,0,1);
}
+26
View File
@@ -0,0 +1,26 @@
#version 430 core
layout (points) in;
layout (triangle_strip, max_vertices = 4) out;
in vec4 vBackPoss[];
uniform vec2 lightPos;
void main()
{
vec2 posa = gl_in[0].gl_Position.xy;
vec2 posb = gl_in[0].gl_Position.zw;
vec2 v = normalize( posb - posa);
vec2 off = vec2( -(v.y *0.2)
, v.x *0.2 );
gl_Position = vec4 (posa, 0 , 1);
EmitVertex();
gl_Position = vec4 (posb, 0 , 1);
EmitVertex();
gl_Position = vec4 (posa + off, 0 , 1);
EmitVertex();
gl_Position = vec4 (posb + off, 0 , 1);
EmitVertex();
EndPrimitive();
}
+11
View File
@@ -0,0 +1,11 @@
#version 430 core
layout (location = 0) in vec4 poss;
layout (location = 1) in vec4 backPoss;
out vec4 vBackPoss;
void main()
{
gl_Position = poss;
vBackPoss = backPoss;
}