Remove inputs to wallShadow shader
This commit is contained in:
+1
-30
@@ -1,8 +1,7 @@
|
|||||||
#version 430 core
|
#version 430 core
|
||||||
layout (points) in;
|
layout (points) in;
|
||||||
layout (triangle_strip, max_vertices = 12) out;
|
layout (triangle_strip, max_vertices = 4) out;
|
||||||
|
|
||||||
in vec4 vBackPoss[];
|
|
||||||
uniform vec2 lightPos;
|
uniform vec2 lightPos;
|
||||||
uniform mat4 worldMat;
|
uniform mat4 worldMat;
|
||||||
|
|
||||||
@@ -14,40 +13,12 @@ void emitLine (vec2 pa)
|
|||||||
EmitVertex();
|
EmitVertex();
|
||||||
}
|
}
|
||||||
|
|
||||||
float isLHS (vec2 startV, vec2 testV)
|
|
||||||
{
|
|
||||||
return sign( -startV.x * testV.y + startV.y * testV.x);
|
|
||||||
}
|
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
vec4 frontL4 = worldMat * vec4(gl_in[0].gl_Position.xy, 0 ,1);
|
vec4 frontL4 = worldMat * vec4(gl_in[0].gl_Position.xy, 0 ,1);
|
||||||
vec4 frontR4 = worldMat * vec4(gl_in[0].gl_Position.zw, 0 ,1);
|
vec4 frontR4 = worldMat * vec4(gl_in[0].gl_Position.zw, 0 ,1);
|
||||||
vec2 frontL = frontL4.xy;
|
vec2 frontL = frontL4.xy;
|
||||||
vec2 frontR = frontR4.xy;
|
vec2 frontR = frontR4.xy;
|
||||||
vec4 backR4 = worldMat * vec4(vBackPoss[0].xy, 0 ,1);
|
|
||||||
vec4 backL4 = worldMat * vec4(vBackPoss[0].zw, 0 ,1);
|
|
||||||
vec2 backL = backL4.xy;
|
|
||||||
vec2 backR = backR4.xy;
|
|
||||||
|
|
||||||
// if (isLHS( lightPos - frontL, frontR - frontL) < 0)
|
|
||||||
// // if (isLHS( lightPos - backL, backR - backL) < 0)
|
|
||||||
// {
|
|
||||||
// // emitLine (frontL);
|
|
||||||
// // emitLine (backL);
|
|
||||||
// // emitLine (frontL);
|
|
||||||
// // emitLine (frontR);
|
|
||||||
// // emitLine (backR);
|
|
||||||
// // emitLine (frontR);
|
|
||||||
//
|
|
||||||
// emitLine (backR);
|
|
||||||
// emitLine (backL);
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// emitLine (backR);
|
|
||||||
// emitLine (backL);
|
|
||||||
// }
|
|
||||||
|
|
||||||
emitLine (frontR);
|
emitLine (frontR);
|
||||||
emitLine (frontL);
|
emitLine (frontL);
|
||||||
|
|||||||
@@ -1,17 +1,7 @@
|
|||||||
#version 430 core
|
#version 430 core
|
||||||
layout (location = 0) in vec4 poss;
|
layout (location = 0) in vec4 poss;
|
||||||
layout (location = 1) in vec4 backPoss;
|
|
||||||
|
|
||||||
out vec4 vBackPoss;
|
|
||||||
|
|
||||||
//uniform vec2 winSize;
|
|
||||||
//uniform float zoom;
|
|
||||||
//uniform float rotation;
|
|
||||||
//uniform vec2 translation;
|
|
||||||
//uniform mat4 worldMat;
|
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
gl_Position = poss;
|
gl_Position = poss;
|
||||||
vBackPoss = backPoss;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ preloadRender = do
|
|||||||
bgShad <- makeTextureShader "background" [vert,geom,frag] [(0,4),(1,2)] Points pokeBGStrat
|
bgShad <- makeTextureShader "background" [vert,geom,frag] [(0,4),(1,2)] Points pokeBGStrat
|
||||||
"data/texture/smudgedDirt.png"
|
"data/texture/smudgedDirt.png"
|
||||||
|
|
||||||
wsShad <- makeShaderCustomUnis "wallShadow" [vert,geom,frag] [(0,4),(1,4)] Points pokeWPStrat
|
wsShad <- makeShaderCustomUnis "wallShadow" [vert,geom,frag] [(0,4)] Points pokeWPStrat
|
||||||
["lightPos"]
|
["lightPos"]
|
||||||
|
|
||||||
wlLightShad <- makeShaderCustomUnis "wallLight" [vert,frag] [(0,3)] TriangleStrip pokeLightWallStrat
|
wlLightShad <- makeShaderCustomUnis "wallLight" [vert,frag] [(0,3)] TriangleStrip pokeLightWallStrat
|
||||||
@@ -172,7 +172,7 @@ geom = GeometryShader
|
|||||||
frag = FragmentShader
|
frag = FragmentShader
|
||||||
|
|
||||||
pokeWPStrat :: (Point2,Point2,Point2,Point2) -> [[[Float]]]
|
pokeWPStrat :: (Point2,Point2,Point2,Point2) -> [[[Float]]]
|
||||||
pokeWPStrat ((x,y),(z,w),(a,b),(c,d)) = [[[x,y,z,w],[a,b,c,d]]]
|
pokeWPStrat ((x,y),(z,w),(a,b),(c,d)) = [[[x,y,z,w]]]
|
||||||
|
|
||||||
pokeLightWallStrat :: Point3 -> [[[Float]]]
|
pokeLightWallStrat :: Point3 -> [[[Float]]]
|
||||||
pokeLightWallStrat (x,y,z) = [[[x,y,z]]]
|
pokeLightWallStrat (x,y,z) = [[[x,y,z]]]
|
||||||
|
|||||||
Reference in New Issue
Block a user