Author: Not specified Language: glsl
Description: Not specified Timestamp: 2017-08-29 06:55:22 +0000
View raw paste Reply
  1. precision highp float;
  2. varying vec4 vertexPosition;
  3. void main(void) {
  4.   vec2 localPos = vec2(mod(vertexPosition.x, 0.1), mod(vertexPosition.y, 0.1));
  5.   float cornerSquareness = 15.0;
  6.   float rss = pow(pow(localPos.x - 0.05, cornerSquareness) + pow(localPos.y - 0.05, cornerSquareness), 1.0 / cornerSquareness);
  7.   vec4 circleColor;
  8.   if (rss < 0.04) {
  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 = vec4((1.0 - vertexPosition.y) * circleColor.r, abs(vertexPosition.x) * circleColor.g, abs(vertexPosition.y) * circleColor.b, 1.0);
  14. }
View raw paste Reply