Cleanup
This commit is contained in:
@@ -1,13 +0,0 @@
|
||||
#version 450 core
|
||||
in vec4 vCol;
|
||||
in vec3 vPos;
|
||||
in vec3 vparams;
|
||||
layout (location=0) out vec4 fCol;
|
||||
layout (location=1) out vec4 fPos;
|
||||
void main()
|
||||
{
|
||||
float d = (dot(vec2(vparams.xy),vec2(vparams.xy)));
|
||||
if ( d > 1 || d < (vparams.z * vparams.z) ) {discard;}
|
||||
fCol = vCol;
|
||||
fPos = vec4(vPos,1);
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
#version 450 core
|
||||
layout (location = 0) in vec4 pos;
|
||||
layout (location = 1) in vec4 col;
|
||||
layout (location = 2) in vec3 boxXboxYwidth;
|
||||
layout (std140, binding = 0) uniform TheMat { mat4 theMat; } ;
|
||||
layout (location = 0) uniform int layoff;
|
||||
out vec4 vCol;
|
||||
out vec3 vPos;
|
||||
out vec3 vparams;
|
||||
void main() {
|
||||
gl_Position = theMat * pos;
|
||||
vCol = col;
|
||||
vparams = boxXboxYwidth;
|
||||
vPos = pos.xyz;
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
#version 450 core
|
||||
in vec4 vCol;
|
||||
in vec3 vPos;
|
||||
layout (location=0) out vec4 fCol;
|
||||
layout (location=1) out vec4 fPos;
|
||||
void main()
|
||||
{
|
||||
fCol = vCol;
|
||||
fPos = vec4(vPos,1);
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
#version 450 core
|
||||
layout (location = 0) in vec4 pos;
|
||||
layout (location = 1) in vec4 col;
|
||||
layout (location = 0) uniform int layoff;
|
||||
layout (std140, binding = 0) uniform TheMat { mat4 theMat; } ;
|
||||
out vec4 vCol;
|
||||
out vec3 vPos;
|
||||
void main() {
|
||||
gl_Position = theMat * pos;
|
||||
vCol = col;
|
||||
vPos = pos.xyz;
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
#version 450 core
|
||||
layout (location=0) out vec4 fCol;
|
||||
layout (location=1) out vec4 fPos;
|
||||
in vec4 vCol;
|
||||
in vec3 vPos;
|
||||
void main() {
|
||||
fCol = vCol;
|
||||
fPos = vec4(vPos,1) ;
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
#version 450 core
|
||||
layout (location = 0) in vec4 position;
|
||||
layout (location = 1) in vec4 color;
|
||||
layout (std140, binding = 0) uniform TheMat { mat4 theMat; } ;
|
||||
out vec4 vCol;
|
||||
out vec3 vPos;
|
||||
void main()
|
||||
{
|
||||
vec4 posxy = theMat * vec4(position.xyz,1);
|
||||
vec4 posz = theMat * vec4(position.xyw,1);
|
||||
gl_Position = vec4(posxy.xy,posz.z,1);
|
||||
vCol = color;
|
||||
vPos = position.xyz;
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
#version 450 core
|
||||
in vec4 vColor;
|
||||
in vec2 boxOut;
|
||||
in vec2 boxIn;
|
||||
|
||||
layout (location=0) out vec4 fCol;
|
||||
layout (location=1) out vec4 fPos;
|
||||
|
||||
void main()
|
||||
{
|
||||
//float d = x - y - 1 + 2* sqrt(y);
|
||||
float d = sqrt(boxOut.x) + sqrt(boxOut.y) - 1.0;
|
||||
// float e = sqrt(f(x,wStart)) + sqrt(f(y,wEnd)) - 1.0;
|
||||
float e = sqrt(boxIn.x) + sqrt(boxIn.y) - 1.0;
|
||||
if ( d < 0 || e > 0) { discard; }
|
||||
fCol = vColor;
|
||||
fPos = vec4(0,0,0,0) ;
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
#version 450 core
|
||||
layout (triangles) in;
|
||||
layout (triangle_strip, max_vertices = 5) out;
|
||||
in vec4 vColor[];
|
||||
in vec2 vPosOff[];
|
||||
in float vRadMag[];
|
||||
out vec4 gColor;
|
||||
out float wStart;
|
||||
out float wEnd;
|
||||
out vec3 gBoundingBox;
|
||||
|
||||
out vec2 box2 ;
|
||||
|
||||
vec2 normV2 (vec2 v)
|
||||
{ return vec2(-v.y,v.x) ;
|
||||
}
|
||||
float lhs (vec2 da, vec2 db)
|
||||
{ return sign(dot(da, normV2(db))) ;
|
||||
}
|
||||
|
||||
float extrapolate (vec2 inOne, vec2 inZeroA, vec2 inZeroB, vec2 xy)
|
||||
{
|
||||
float det = inOne.x * (inZeroA.y - inZeroB.y)
|
||||
+ inZeroA.x * (inZeroB.y - inOne.y)
|
||||
+ inZeroB.x * (inOne.y - inZeroA.y)
|
||||
;
|
||||
float r = (inZeroA.y - inZeroB.y) ;
|
||||
float s = (inZeroB.x - inZeroA.x) ;
|
||||
float t = (inZeroA.x * inZeroB.y - inZeroB.x * inZeroA.y) ;
|
||||
return r * xy.x + s * xy.y + t
|
||||
/ det ;
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
vec3 pa = gl_in[0].gl_Position.xyz;
|
||||
vec3 pb = gl_in[1].gl_Position.xyz;
|
||||
vec3 pc = gl_in[2].gl_Position.xyz;
|
||||
|
||||
wStart = vRadMag [0];
|
||||
wEnd = vRadMag [2];
|
||||
|
||||
box2 = vec2 (1,0);
|
||||
gBoundingBox = vec3 (0.9,0.1,0);
|
||||
gColor = vColor[0];
|
||||
gl_Position = vec4 (vPosOff[0] , pa.z , 1);
|
||||
EmitVertex();
|
||||
box2 = vec2 (0,1);
|
||||
gBoundingBox = vec3 (0.1,0.9,0);
|
||||
gColor = vColor[2];
|
||||
gl_Position = vec4 (vPosOff[2] , pc.z , 1);
|
||||
EmitVertex();
|
||||
box2 = vec2( extrapolate(vPosOff[0],vPosOff[2],pb.xy,pa.xy)
|
||||
, extrapolate(vPosOff[2],vPosOff[0],pb.xy,pa.xy)
|
||||
) ;
|
||||
box2 = vec2(0.2,0);
|
||||
gBoundingBox = vec3 (1,0,1);
|
||||
gColor = vColor[0];
|
||||
gl_Position = vec4 (pa, 1);
|
||||
EmitVertex();
|
||||
box2 = vec2( extrapolate(vPosOff[0],vPosOff[2],pb.xy,pc.xy)
|
||||
, extrapolate(vPosOff[2],vPosOff[0],pb.xy,pc.xy)
|
||||
) ;
|
||||
box2 = vec2(0,0.2);
|
||||
gBoundingBox = vec3 (0,1,1);
|
||||
gColor = vColor[2];
|
||||
gl_Position = vec4 (pc, 1);
|
||||
EmitVertex();
|
||||
box2 = vec2( 0,0 ) ;
|
||||
gBoundingBox = vec3 (0,0,0);
|
||||
gColor = vColor[1];
|
||||
gl_Position = vec4 (pb, 1);
|
||||
EmitVertex();
|
||||
|
||||
EndPrimitive();
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
#version 450 core
|
||||
layout (location = 0) in vec3 position;
|
||||
layout (location = 1) in vec4 color;
|
||||
layout (location = 2) in vec4 boxes;
|
||||
layout (std140, binding = 0) uniform TheMat { mat4 theMat; } ;
|
||||
out vec4 vColor;
|
||||
out vec2 boxOut;
|
||||
out vec2 boxIn;
|
||||
void main()
|
||||
{
|
||||
gl_Position = theMat * vec4(position.xyz,1);
|
||||
vColor = color;
|
||||
boxOut = boxes.xy ;
|
||||
boxIn = boxes.zw ;
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
#version 450 core
|
||||
layout (location=0) out vec4 fCol;
|
||||
layout (location=1) out vec4 fPos;
|
||||
uniform sampler2D aTexture;
|
||||
in vec4 gColor;
|
||||
in vec2 gTexCoord;
|
||||
void main()
|
||||
{
|
||||
fCol = texture(aTexture, vec2 (gTexCoord.x * 0.0078125, gTexCoord.y)) * gColor;
|
||||
fPos = vec4(0,0,0,0);
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
#version 450 core
|
||||
layout (points) in;
|
||||
layout (triangle_strip, max_vertices = 4) out;
|
||||
in vec4 vColor [];
|
||||
in vec3 vTexCoord [];
|
||||
out vec4 gColor;
|
||||
out vec2 gTex;
|
||||
void main()
|
||||
{
|
||||
vec3 cenPos = gl_in[0].gl_Position.xyz;
|
||||
float sizex = vTexCoord[0].y;
|
||||
float sizey = vTexCoord[0].z;
|
||||
//float size = 0.05;
|
||||
gColor = vColor[0];
|
||||
float texPos = vTexCoord[0].x;
|
||||
|
||||
gl_Position = vec4 (cenPos.x - sizex*0.5, cenPos.y - sizey*0.5, cenPos.z , 1);
|
||||
//gl_Position = vec4 (0, 0 , 5 , 1);
|
||||
gTex = vec2 (texPos*0.0078125, 1);
|
||||
EmitVertex();
|
||||
gl_Position = vec4 (cenPos.x - sizex*0.5, cenPos.y + sizey*0.5, cenPos.z , 1);
|
||||
//gl_Position = vec4 (0, 0.5 , 5 , 1);
|
||||
gTex = vec2 (texPos*0.0078125, 0);
|
||||
EmitVertex();
|
||||
gl_Position = vec4 (cenPos.x + sizex*0.5, cenPos.y - sizey*0.5, cenPos.z , 1);
|
||||
//gl_Position = vec4 (0.5, 0.5 , -5 , 1);
|
||||
gTex = vec2 ((texPos+1)*0.0078125, 1);
|
||||
EmitVertex();
|
||||
gl_Position = vec4 (cenPos.x + sizex*0.5, cenPos.y + sizey*0.5, cenPos.z , 1);
|
||||
gTex = vec2 ((texPos+1)*0.0078125, 0);
|
||||
//gl_Position = vec4 (0.5, 0 , -5 , 1);
|
||||
EmitVertex();
|
||||
|
||||
EndPrimitive();
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
#version 450 core
|
||||
layout (location = 0) in vec3 aPos;
|
||||
layout (location = 1) in vec4 aColor;
|
||||
layout (location = 2) in vec2 aTexCoord;
|
||||
layout (std140, binding = 0) uniform TheMat { mat4 theMat; } ;
|
||||
out vec4 gColor;
|
||||
out vec2 gTexCoord;
|
||||
void main()
|
||||
{
|
||||
gl_Position = theMat * vec4(aPos, 1.0);
|
||||
gColor = aColor;
|
||||
gTexCoord = aTexCoord;
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
#version 450 core
|
||||
layout (location=0) out vec4 fCol;
|
||||
layout (location=1) out vec4 fPos;
|
||||
in vec4 gColC;
|
||||
in vec4 gColE;
|
||||
in vec3 gPos;
|
||||
in vec2 gBoundingBox;
|
||||
void main() {
|
||||
float d = dot(gBoundingBox,gBoundingBox);
|
||||
if ( d > 1) { discard; }
|
||||
fCol = mix (gColE , gColC, d);
|
||||
fPos = vec4(gPos,1);
|
||||
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
#version 450 core
|
||||
layout (triangles) in;
|
||||
layout (triangle_strip, max_vertices = 4) out;
|
||||
layout (std140, binding = 0) uniform TheMat { mat4 theMat; } ;
|
||||
in vec4 vCol[];
|
||||
out vec4 gColC; // center color
|
||||
out vec4 gColE; // edge color
|
||||
out vec2 gBoundingBox;
|
||||
out vec3 gPos;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 pat = gl_in[0].gl_Position;
|
||||
vec4 pbt = gl_in[1].gl_Position;
|
||||
vec4 pct = gl_in[2].gl_Position;
|
||||
vec4 pa = theMat * pat;
|
||||
vec4 pb = theMat * pbt;
|
||||
vec4 pc = theMat * pct;
|
||||
gColC = vCol[0];
|
||||
gColE = vCol[1];
|
||||
|
||||
gBoundingBox = vec2 (-1,1);
|
||||
gl_Position = pb;
|
||||
gPos = pbt.xyz;
|
||||
EmitVertex();
|
||||
gBoundingBox = vec2 (1,1);
|
||||
gl_Position = pa;
|
||||
gPos = pat.xyz;
|
||||
EmitVertex();
|
||||
gBoundingBox = vec2 (-1,-1);
|
||||
gl_Position = pc;
|
||||
gPos = pct.xyz;
|
||||
EmitVertex();
|
||||
gBoundingBox = vec2 (1,-1);
|
||||
gl_Position = pa + pc - pb;
|
||||
gPos = pat.xyz + pct.xyz - pbt.xyz;
|
||||
EmitVertex();
|
||||
|
||||
EndPrimitive();
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
#version 450 core
|
||||
struct PosCol { vec4 posx; vec4 colx; };
|
||||
layout (std140, binding = 0) uniform TheMat { mat4 theMat; } ;
|
||||
layout (std430, binding = 13) readonly buffer Data { PosCol data[]; };
|
||||
layout (location = 0) uniform int n;
|
||||
out vec4 gColC; // center color
|
||||
out vec4 gColE; // edge color
|
||||
out vec2 gBoundingBox;
|
||||
out vec3 gPos;
|
||||
const int ks[6] = //
|
||||
{1,0,2 // 2--3
|
||||
,2,0,3 // | |
|
||||
}; // 1--0
|
||||
//
|
||||
const vec2 bs[4] =
|
||||
{ vec2( 1, 1)
|
||||
, vec2(-1, 1)
|
||||
, vec2(-1,-1)
|
||||
, vec2( 1,-1)
|
||||
} ;
|
||||
void main()
|
||||
{
|
||||
int i0 = n + (3 * ((gl_VertexID-n)/6) );
|
||||
gColC = data[i0].colx;
|
||||
gColE = data[i0+1].colx;
|
||||
int k = ks[(gl_VertexID - n) % 6];
|
||||
gBoundingBox = bs[k];
|
||||
gPos = (k > 2.5
|
||||
? data[i0].posx + data[i0+2].posx - data[i0+1].posx
|
||||
: data[i0+k].posx
|
||||
).xyz;
|
||||
gl_Position = theMat * vec4(gPos,1);
|
||||
}
|
||||
Reference in New Issue
Block a user