Author: Not specified Language: glsl
Description: Not specified Timestamp: 2017-08-29 06:50:48 +0000
View raw paste Reply
  1. precision highp float;
  2. varying vec4 vertexPosition;
  3. void main(void) {
  4.   float polarTheta = atan(vertexPosition.y, vertexPosition.x);
  5.   float radius = pow(pow(vertexPosition.x, 2.0) + pow(vertexPosition.y, 2.0), 1.0 / 2.0) * 2.0;
  6.   float polarFunctionRadius = (1.0 + 0.9*cos(8.0*polarTheta))*(1.0 + 0.1 * cos(24.0*polarTheta))*(0.9 + 0.05*cos(200.0*polarTheta)*(1.0 + sin(polarTheta)));
  7.   vec4 circleColor;
  8.   if (radius < polarFunctionRadius) {
  9.     circleColor = vec4(1.0, 1.0, 1.0, 1.0);
  10.   } else {
  11.     circleColor = vec4(0.0, 0.0, 0.0, 1.0);
  12.   }
  13.   gl_FragColor = circleColor;
  14. }
View raw paste Reply