Add wall shadow shaders
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,7 @@
|
||||
#version 430 core
|
||||
out vec4 fColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
fColor = vec4 (0.9,0.9,0,1);
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user