diff --git a/ellipse.fs b/ellipse.fs old mode 100644 new mode 100755 diff --git a/ellipse.vs b/ellipse.vs old mode 100644 new mode 100755 diff --git a/line.fs b/line.fs old mode 100644 new mode 100755 index 6836b4d..57d242a --- a/line.fs +++ b/line.fs @@ -4,4 +4,4 @@ out vec4 FragColor; void main() { // FragColor = vec4(1.,1.,0., 1.0); FragColor = color; -} \ No newline at end of file +} diff --git a/line.vs b/line.vs old mode 100644 new mode 100755 diff --git a/lineStipple.fs b/lineStipple.fs new file mode 100644 index 0000000..633a7ee --- /dev/null +++ b/lineStipple.fs @@ -0,0 +1,16 @@ +#version 330 core +in vec4 color; + +in float dist; +uniform vec2 u_resolution; +uniform float u_dashSize; +uniform float u_gapSize; + +out vec4 FragColor; +void main() +{ + if (fract(dist / (u_dashSize + u_gapSize)) > u_dashSize/(u_dashSize + u_gapSize)) + discard; + + FragColor = color; +} diff --git a/lineStipple.vs b/lineStipple.vs new file mode 100644 index 0000000..71f52ca --- /dev/null +++ b/lineStipple.vs @@ -0,0 +1,16 @@ +#version 330 core +layout (location = 0) in vec3 vertices; +layout (location = 1) in float distances; +uniform vec4 ourColor; + +out float dist; +out vec4 color; + +uniform mat4 MVP; + +void main() +{ + dist = distances; + gl_Position = MVP * vec4(vertices,1.0); + color = ourColor; +} \ No newline at end of file diff --git a/mline.fs b/mline.fs new file mode 100755 index 0000000..6836b4d --- /dev/null +++ b/mline.fs @@ -0,0 +1,7 @@ +#version 330 core +in vec4 color; +out vec4 FragColor; +void main() { + // FragColor = vec4(1.,1.,0., 1.0); + FragColor = color; +} \ No newline at end of file diff --git a/mline.vs b/mline.vs new file mode 100755 index 0000000..12934bc --- /dev/null +++ b/mline.vs @@ -0,0 +1,9 @@ +#version 330 core +layout (location = 0) in vec4 vertices; +uniform vec4 ourColor; +out vec4 color; +void main() +{ + color = ourColor; + gl_Position = vertices; +} diff --git a/target.fs b/target.fs new file mode 100755 index 0000000..b102dc4 --- /dev/null +++ b/target.fs @@ -0,0 +1,11 @@ +#version 330 core +uniform sampler2D texture; +varying vec2 vTexCoord; +varying vec3 color; +void main() +{ + if(texture2D(texture, vTexCoord).w == 0) + discard; + + gl_FragColor = vec4(color.x,color.y,color.z,1); +} diff --git a/target.vs b/target.vs new file mode 100755 index 0000000..f3767fe --- /dev/null +++ b/target.vs @@ -0,0 +1,12 @@ +#version 330 core +attribute vec4 aPosition; +attribute vec3 aColor; +attribute vec2 aTexCoord; +varying vec2 vTexCoord; +varying vec3 color; +void main() +{ + color = aColor; + gl_Position = aPosition; + vTexCoord = aTexCoord; +} diff --git a/text.fs b/text.fs old mode 100644 new mode 100755 diff --git a/text.vs b/text.vs old mode 100644 new mode 100755 diff --git a/zoomgate.fs b/zoomgate.fs new file mode 100755 index 0000000..1ea26cd --- /dev/null +++ b/zoomgate.fs @@ -0,0 +1,6 @@ +#version 330 core +in vec4 color; +out vec4 FragColor; +void main() { + FragColor = color; +} \ No newline at end of file diff --git a/zoomgate.vs b/zoomgate.vs new file mode 100755 index 0000000..e6ab2e9 --- /dev/null +++ b/zoomgate.vs @@ -0,0 +1,9 @@ +#version 330 core +layout (location = 0) in vec4 vertices; +uniform vec4 ourColor; +out vec4 color; +void main() +{ + color = ourColor; + gl_Position = vertices; +} \ No newline at end of file