opengl-triangle

Basic application that draws triangle on a window using opengl
Index Commits Files Refs
main.frag (326B)
   1 #version 330 core
   2 
   3 // out vec4 fragColor;
   4 
   5 uniform float time;
   6 
   7 vec3 hsl2rgb(vec3 c) {
   8     vec3 rgb = clamp(abs(mod(c.x*6.0+vec3(0.0,4.0,2.0),6.0)-3.0)-1.0, 0.0, 1.0);
   9     return c.z + c.y * (rgb-0.5)*(1.0-abs(2.0*c.z-1.0));
  10 }
  11 
  12 void main() {
  13     vec4 rainbow = vec4(hsl2rgb(vec3(time*0.10, 1.0, 0.5)), 1.0);
  14     gl_FragColor = rainbow;
  15 }