Add line shadow shader

This commit is contained in:
2021-06-26 22:20:41 +02:00
parent 726cd425f2
commit 06f22a3ea5
21 changed files with 128 additions and 74 deletions
+19
View File
@@ -0,0 +1,19 @@
#version 430 core
layout (lines) in;
layout (triangle_strip, max_vertices = 4) out;
layout (std140, binding = 0) uniform TheMat { mat4 theMat; } ;
uniform vec3 lightPos;
vec4 shift (vec4 p) { return (vec4 (p.xyz + (2000*(p.xyz-lightPos)), 1));}
vec4 f (vec4 p) {return (theMat * p);}
void main()
{
vec4 p0 = gl_in[0].gl_Position;
gl_Position = f(p0); EmitVertex();
vec4 p1 = gl_in[1].gl_Position;
gl_Position = f(p1); EmitVertex();
vec4 p2 = shift(p0);
gl_Position = f(p2); EmitVertex();
vec4 p3 = shift(p1);
gl_Position = f(p3); EmitVertex();
EndPrimitive();
}