OpenGL: cleanup edit overlay shaders
Mostly simple fixes to spacing & comments.
This commit is contained in:
parent
941e739d70
commit
a1c558e19f
|
@ -1,8 +1,8 @@
|
|||
|
||||
flat in int vertFlag;
|
||||
|
||||
#define VERTEX_SELECTED (1 << 0)
|
||||
#define VERTEX_ACTIVE (1 << 1)
|
||||
#define VERTEX_SELECTED (1 << 0)
|
||||
#define VERTEX_ACTIVE (1 << 1)
|
||||
|
||||
out vec4 FragColor;
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ void main()
|
|||
|
||||
vec4 pPos = ModelViewProjectionMatrix * vec4(pos, 1.0);
|
||||
|
||||
/* only verterx position 0 is used */
|
||||
/* only vertex position 0 is used */
|
||||
eData1 = eData2 = vec4(1e10);
|
||||
eData2.zw = proj(pPos);
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
|
||||
flat in int vertFlag;
|
||||
|
||||
#define VERTEX_SELECTED (1 << 0)
|
||||
#define VERTEX_ACTIVE (1 << 1)
|
||||
#define VERTEX_SELECTED (1 << 0)
|
||||
#define VERTEX_ACTIVE (1 << 1)
|
||||
|
||||
out vec4 FragColor;
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ void main()
|
|||
|
||||
vec4 pPos = ModelViewProjectionMatrix * vec4(pos, 1.0);
|
||||
|
||||
/* only verterx position 0 is used */
|
||||
/* only vertex position 0 is used */
|
||||
eData1 = eData2 = vec4(1e10);
|
||||
eData2.zw = proj(pPos);
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@ in ivec4 data;
|
|||
flat out vec4 faceColor;
|
||||
flat out int faceActive;
|
||||
|
||||
#define FACE_ACTIVE (1 << 2)
|
||||
#define FACE_SELECTED (1 << 3)
|
||||
#define FACE_ACTIVE (1 << 2)
|
||||
#define FACE_SELECTED (1 << 3)
|
||||
|
||||
void main()
|
||||
{
|
||||
|
|
|
@ -19,7 +19,7 @@ smooth in vec3 vertexColor;
|
|||
/* We use a vec4[2] interface to pass edge data
|
||||
* (without fragmenting memory accesses)
|
||||
*
|
||||
* There is 2 cases :
|
||||
* There are 2 cases :
|
||||
*
|
||||
* - Simple case : geometry shader return edge distances
|
||||
* in the first 2 components of the first vec4.
|
||||
|
@ -38,19 +38,19 @@ flat in vec4 eData2;
|
|||
|
||||
out vec4 FragColor;
|
||||
|
||||
#define EDGE_EXISTS (1 << 0)
|
||||
#define EDGE_ACTIVE (1 << 1)
|
||||
#define EDGE_SELECTED (1 << 2)
|
||||
#define EDGE_SEAM (1 << 3)
|
||||
#define EDGE_SHARP (1 << 4)
|
||||
#define EDGE_EXISTS (1 << 0)
|
||||
#define EDGE_ACTIVE (1 << 1)
|
||||
#define EDGE_SELECTED (1 << 2)
|
||||
#define EDGE_SEAM (1 << 3)
|
||||
#define EDGE_SHARP (1 << 4)
|
||||
/* Vertex flag is shifted and combined with the edge flag */
|
||||
#define VERTEX_ACTIVE (1 << (0 + 8))
|
||||
#define VERTEX_SELECTED (1 << (1 + 8))
|
||||
#define FACE_ACTIVE (1 << (2 + 8))
|
||||
#define VERTEX_ACTIVE (1 << (0 + 8))
|
||||
#define VERTEX_SELECTED (1 << (1 + 8))
|
||||
#define FACE_ACTIVE (1 << (2 + 8))
|
||||
|
||||
/* Style Parameters in pixel */
|
||||
|
||||
/* Array to retreive vert/edge indices */
|
||||
/* Array to retrieve vert/edge indices */
|
||||
const ivec3 clipEdgeIdx[6] = ivec3[6](
|
||||
ivec3(1, 0, 2),
|
||||
ivec3(2, 0, 1),
|
||||
|
|
|
@ -104,7 +104,7 @@ void main()
|
|||
/* perpendicular to dir */
|
||||
dirs1.zw = vec2(-dirs1.y, dirs1.x);
|
||||
|
||||
/* Make it view independant */
|
||||
/* Make it view independent */
|
||||
dirs1 *= sizeEdgeFix / viewportSize.xyxy;
|
||||
|
||||
dirs2 = dirs1;
|
||||
|
|
|
@ -198,7 +198,7 @@ void main()
|
|||
perp = -perp;
|
||||
}
|
||||
|
||||
/* Make it view independant */
|
||||
/* Make it view independent */
|
||||
perp *= sizeEdgeFix / viewportSize;
|
||||
cornervec[i] *= sizeEdgeFix / viewportSize;
|
||||
fixvec[i] = fixvecaf[i] = perp;
|
||||
|
@ -214,9 +214,9 @@ void main()
|
|||
}
|
||||
|
||||
/* to not let face color bleed */
|
||||
faceColor = vec4(0.0, 0.0, 0.0, 0.0);
|
||||
faceColor = vec4(0.0);
|
||||
|
||||
/* we don't want other edges : make them far*/
|
||||
/* we don't want other edges : make them far */
|
||||
eData1 = vec4(1e10);
|
||||
|
||||
/* Start with the same last vertex to create a
|
||||
|
@ -227,7 +227,7 @@ void main()
|
|||
int vaf = (i + 1) % 3;
|
||||
int v = i % 3;
|
||||
|
||||
/* Position of the "hidden" thrid vertex */
|
||||
/* Position of the "hidden" third vertex */
|
||||
eData1.zw = pos[vbe];
|
||||
|
||||
doVertex(v, pPos[v]);
|
||||
|
@ -249,7 +249,7 @@ void main()
|
|||
doVertex(vaf, pPos[vaf]);
|
||||
doVertex(vaf, pPos[vaf] + vec4(fixvecaf[v], 0.0, 0.0));
|
||||
|
||||
/* corner vertices should not drax edges but draw point only */
|
||||
/* corner vertices should not draw edges but draw point only */
|
||||
flag[2] = (vData[vbe].x << 8);
|
||||
#ifdef VERTEX_SELECTION
|
||||
doVertex(vaf, pPos[vaf]);
|
||||
|
|
|
@ -47,7 +47,7 @@ void main()
|
|||
vertexColor = vec3(0.0);
|
||||
#endif
|
||||
|
||||
/* only verterx position 0 is used */
|
||||
/* only vertex position 0 is used */
|
||||
eData1 = eData2 = vec4(1e10);
|
||||
eData2.zw = proj(pPos);
|
||||
|
||||
|
|
Loading…
Reference in New Issue