Skip to content

Commit

Permalink
Use a varying and swizzles to do something interesting
Browse files Browse the repository at this point in the history
  • Loading branch information
iondune committed Oct 2, 2017
1 parent 1ffa9e3 commit a1a0b38
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions resources/fancy_frag33.glsl
Expand Up @@ -2,10 +2,18 @@

uniform vec3 uColor;

in vec2 fVertPos;

out vec3 color;


void main()
{
color = uColor;

if (mod(fVertPos.x * 4.0, 1.0) < 0.5 || mod(fVertPos.y * 4.0, 1.0) < 0.5)
color *= 0.5;

if (mod(gl_FragCoord.x, 64.0) < 32.0 || mod(gl_FragCoord.y, 64.0) < 32.0)
color.rg = color.gr;
}
3 changes: 3 additions & 0 deletions resources/fancy_vert33.glsl
Expand Up @@ -6,9 +6,12 @@ uniform mat4 P;
uniform mat4 MV;
uniform float uTime;

out vec2 fVertPos;


void main()
{
fVertPos = vertPos.xy;
vec3 position = vertPos;

const float radius = 0.8;
Expand Down

0 comments on commit a1a0b38

Please sign in to comment.