Rename shaders, remove a dependency on Dodge.Data
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
#version 430 core
|
||||
in vec4 gColor;
|
||||
|
||||
out vec4 fColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
fColor = gColor;
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
#version 430 core
|
||||
layout (points) in;
|
||||
layout (triangle_strip, max_vertices = 4) out;
|
||||
|
||||
in vec4 vColor [];
|
||||
out vec4 gColor;
|
||||
|
||||
uniform mat4 perpMat;
|
||||
|
||||
// consider using isLHS to check if the wall is facing the center
|
||||
// this needs the view from point
|
||||
float isLHS (vec2 startV, vec2 testV)
|
||||
{
|
||||
return sign( -startV.x * testV.y + startV.y * testV.x);
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
gColor = vColor[0];
|
||||
|
||||
vec4 p1 = vec4 (gl_in[0].gl_Position.xy,0,1);
|
||||
vec4 p2 = vec4 (gl_in[0].gl_Position.zw,0,1);
|
||||
|
||||
vec4 a1 = perpMat * p1;
|
||||
vec4 a2 = perpMat * p2;
|
||||
|
||||
// if (0 > isLHS (a1.xy - a2.xy, a1.xy - "viewFromPoint")) {
|
||||
|
||||
vec4 p3 = vec4 (p1.xy,-0.5,1);
|
||||
vec4 p4 = vec4 (p2.xy,-0.5,1);
|
||||
|
||||
vec4 a3 = perpMat * p3;
|
||||
vec4 a4 = perpMat * p4;
|
||||
|
||||
gl_Position = a1; EmitVertex();
|
||||
gl_Position = a3; EmitVertex();
|
||||
gl_Position = a2; EmitVertex();
|
||||
gl_Position = a4; EmitVertex();
|
||||
EndPrimitive();
|
||||
// }
|
||||
}
|
||||
@@ -9,4 +9,5 @@ out vec4 fColor;
|
||||
void main()
|
||||
{
|
||||
fColor = gColor * texture(tex,tPos);
|
||||
// fColor = gColor;
|
||||
}
|
||||
Reference in New Issue
Block a user