fork download
  1. const static char *fragmentShader=\
  2. "void main() {"
  3. "vec2 resolution = vec2(800.,600.);"
  4. "vec2 uPos = ( gl_FragCoord.xy / resolution.y ); //normalize wrt y axis"
  5. "uPos -= vec2((resolution.x/resolution.y)/2.0, 0.5); //shift origin to center"
  6. "float time = gl_Color.x; // The time sent by color"
  7. "float multiplier = 0.005; // Grosseur"
  8. "const float step = 0.2; //segmentation"
  9. "const float loop = 100.0; //Longueur"
  10. "const float timeSCale = 1.05; // Vitesse"
  11.  
  12. "vec3 blueGodColor = vec3(0.0);"
  13. "float i = 0.0;"
  14. "for(i=1.0;i<loop;i++){ "
  15. " float t = time*timeSCale-step*i;"
  16. "vec2 point = vec2(0.75*sin(t), 0.5*sin(t*.02));"
  17. "point += vec2(0.75*cos(t*0.1), 0.5*sin(t*0.3));"
  18. "point /= 4. * sin(i);"
  19. "float componentColor= multiplier/((uPos.x-point.x)*(uPos.x-point.x) + (uPos.y-point.y)*(uPos.y-point.y))/i;"
  20. "blueGodColor += vec3(componentColor/2.0, componentColor/3.0, componentColor);"
  21. "}"
  22.  
  23.  
  24. "vec3 color = vec3(0,0,0);"
  25. "color += pow(blueGodColor,vec3(1.1,1.1,0.8));"
  26.  
  27.  
  28. "gl_FragColor = vec4(1.0,0.0,1.0, 1.0);"
  29. "}";
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1: warning: ‘fragmentShader’ defined but not used
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/../../../crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
collect2: ld returned 1 exit status
stdout
Standard output is empty