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
+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();
}