Add line shadow shader
This commit is contained in:
@@ -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();
|
||||
}
|
||||
Reference in New Issue
Block a user