Draw floor of windows

This commit is contained in:
jgk
2021-03-21 12:27:57 +01:00
parent e7b4e54f9a
commit a8ebf2f7f1
3 changed files with 10 additions and 8 deletions
+6 -6
View File
@@ -13,8 +13,8 @@ float isLHS (vec2 startV, vec2 testV)
{
return sign( -startV.x * testV.y + startV.y * testV.x);
}
vec4 shiftUp (vec4 v)
{ return vec4 (v.xy , v.z-0.1 , v.w) ; }
vec4 shiftCloser (vec4 v)
{ return vec4 (v.xy , v.z-0.0001 , v.w) ; }
void main()
{
@@ -31,10 +31,10 @@ if (isLHS (p1.xy - lightPos, p2.xy - lightPos) < 0)
vec2 d1 = p1.xy - lightPos;
vec2 d2 = p2.xy - lightPos;
vec4 a1 = shiftUp( perpMat * p1 );
vec4 a2 = shiftUp( perpMat * p2 );
vec4 a3 = shiftUp( perpMat * p3 );
vec4 a4 = shiftUp( perpMat * p4 );
vec4 a1 = shiftCloser( perpMat * p1 );
vec4 a2 = shiftCloser( perpMat * p2 );
vec4 a3 = shiftCloser( perpMat * p3 );
vec4 a4 = shiftCloser( perpMat * p4 );
dField = vec3( d1.x/rad, d1.y/rad, 0);
gl_Position = a1;