Browse Source

First commit

shaders
master
mmtalaie 3 years ago
committed by h-4nd-h
commit
32e1230192
  1. 6
      ellipse.fs
  2. 9
      ellipse.vs
  3. 7
      line.fs
  4. 9
      line.vs
  5. 10
      text.fs
  6. 10
      text.vs

6
ellipse.fs

@ -0,0 +1,6 @@
#version 330 core
in vec4 color;
out vec4 FragColor;
void main() {
FragColor = color;
}

9
ellipse.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;
}

7
line.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;
}

9
line.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;
}

10
text.fs

@ -0,0 +1,10 @@
#version 330 core
in vec2 TexCoords;
out vec4 FragColor;
uniform sampler2D text;
uniform vec3 textColor;
void main()
{
vec4 sampled = vec4(1.0, 1.0, 1.0, texture(text, TexCoords).r);
FragColor = vec4(textColor, 1.00) * sampled;
}

10
text.vs

@ -0,0 +1,10 @@
#version 330 core
layout (location = 4) in vec4 vertex;
out vec2 TexCoords;
uniform mat4 projection;
void main()
{
gl_Position = projection * vec4(vertex.xy, 0.0, 1.0);
TexCoords.x = vertex.z;
TexCoords.y = vertex.w;
}
Loading…
Cancel
Save