{
  "history": [
    {
      "breakpoints": [],
      "visible": true,
      "aspectRatio": 1,
      "userDownsample": 0.25,
      "layerType": "effect",
      "type": "gradient",
      "usesPingPong": false,
      "speed": 0.25,
      "trackMouse": 0,
      "trackAxes": "xy",
      "mouseMomentum": 0,
      "texture": false,
      "animating": false,
      "isMask": 0,
      "compiledFragmentShaders": [
        "#version 300 es\nprecision highp float;in vec2 vTextureCoord;uniform vec2 uMousePos;vec3 getColor(int index) { switch(index) { case 0: return vec3(0, 0, 0); case 1: return vec3(0, 0, 0); case 2: return vec3(0, 0, 0); case 3: return vec3(0, 0, 0); case 4: return vec3(0, 0, 0); case 5: return vec3(0, 0, 0); case 6: return vec3(0, 0, 0); case 7: return vec3(0, 0, 0); case 8: return vec3(0, 0, 0); case 9: return vec3(0, 0, 0); case 10: return vec3(0, 0, 0); case 11: return vec3(0, 0, 0); case 12: return vec3(0, 0, 0); case 13: return vec3(0, 0, 0); case 14: return vec3(0, 0, 0); case 15: return vec3(0, 0, 0); default: return vec3(0.0); } }const float PI = 3.14159265;vec2 rotate(vec2 coord, float angle) { float s = sin(angle); float c = cos(angle); return vec2( coord.x * c - coord.y * s, coord.x * s + coord.y * c ); }out vec4 fragColor;vec3 getColor(vec2 uv) {return vec3(0, 0, 0); }void main() {vec2 uv = vTextureCoord; vec2 pos = vec2(0.5, 0.5) + mix(vec2(0), (uMousePos-0.5), 0.0000); uv -= pos; uv /= (0.5000*2.); uv = rotate(uv, (0.0000 - 0.5) * 2. * PI); vec4 color = vec4(getColor(uv), 1.); fragColor = color; }"
      ],
      "compiledVertexShaders": [
        "#version 300 es\nprecision mediump float;in vec3 aVertexPosition; in vec2 aTextureCoord;uniform mat4 uMVMatrix; uniform mat4 uPMatrix;out vec2 vTextureCoord; out vec3 vVertexPosition;void main() { gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0); vTextureCoord = aTextureCoord; }"
      ],
      "data": {
        "downSample": 0.5,
        "depth": false,
        "uniforms": {},
        "isBackground": true
      },
      "id": "effect"
    },
    {
      "breakpoints": [
        {
          "max": null,
          "min": 992,
          "name": "Desktop",
          "props": { "thickness": 0.5 }
        },
        {
          "name": "Tablet",
          "max": 991,
          "min": 576,
          "props": { "thickness": 1 }
        },
        {
          "min": 0,
          "props": { "thickness": 1.58 },
          "name": "Mobile",
          "max": 575
        }
      ],
      "visible": true,
      "aspectRatio": 1,
      "userDownsample": 0.25,
      "layerType": "effect",
      "type": "beam",
      "usesPingPong": false,
      "speed": 0.25,
      "trackMouse": 0,
      "trackAxes": "xy",
      "mouseMomentum": 0,
      "texture": false,
      "animating": false,
      "isMask": 0,
      "compiledFragmentShaders": [
        "#version 300 es\nprecision highp float; precision highp int;in vec2 vTextureCoord;uniform sampler2D uTexture;uniform float uThickness;uniform vec2 uMousePos; vec3 blend (int blendMode, vec3 src, vec3 dst) { return src + dst; }uvec2 pcg2d(uvec2 v) { v = v * 1664525u + 1013904223u; v.x += v.y * v.y * 1664525u + 1013904223u; v.y += v.x * v.x * 1664525u + 1013904223u; v ^= v >> 16; v.x += v.y * v.y * 1664525u + 1013904223u; v.y += v.x * v.x * 1664525u + 1013904223u; return v; }float randFibo(vec2 p) { uvec2 v = floatBitsToUint(p); v = pcg2d(v); uint r = v.x ^ v.y; return float(r) / float(0xffffffffu); }vec3 Tonemap_tanh(vec3 x) { x = clamp(x, -40.0, 40.0); return (exp(x) - exp(-x)) / (exp(x) + exp(-x)); }out vec4 fragColor;const float PI = 3.14159265359; const float TWO_PI = 2.0 * PI;float luma(vec3 color) { return dot(color, vec3(0.299, 0.587, 0.114)); }vec3 drawViewportEdges(vec2 uv) { float distToEdge = min(min(uv.x, uv.y), min(1.0 - uv.x, 1.0 - uv.y)); float sdf = distToEdge; float glowThickness = uThickness * 0.8; float glow = glowThickness / (1.0 - smoothstep(0.12, 0.01, abs(sdf) + 0.02)); return glow * pow(1.0-abs(sdf), 3.0) * vec3(1, 1, 1); }vec3 getBeam(vec2 uv) { vec2 pos = vec2(0.5, 0.5) + mix(vec2(0), (uMousePos-0.5), 0.0000); return drawViewportEdges(uv); }void main() { vec2 uv = vTextureCoord; vec4 bg = texture(uTexture, uv);vec3 beam = getBeam(uv); float dither = (randFibo(gl_FragCoord.xy) - 0.5) / 255.0;vec3 blended = blend(1, Tonemap_tanh(beam), bg.rgb); vec3 result = mix(bg.rgb, blended, 0.3900); result += dither;vec4 color = vec4(result, max(bg.a, luma(beam))); fragColor = color;}"
      ],
      "compiledVertexShaders": [
        "#version 300 es\nprecision mediump float;in vec3 aVertexPosition; in vec2 aTextureCoord;uniform mat4 uMVMatrix; uniform mat4 uPMatrix; uniform mat4 uTextureMatrix;out vec2 vTextureCoord; out vec3 vVertexPosition;void main() { gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0); vTextureCoord = (uTextureMatrix * vec4(aTextureCoord, 0.0, 1.0)).xy; }"
      ],
      "data": {
        "depth": false,
        "uniforms": {
          "thickness": { "name": "uThickness", "type": "1f", "value": 0.5 }
        },
        "isBackground": false
      },
      "id": "effect1"
    },
    {
      "breakpoints": [],
      "visible": true,
      "aspectRatio": 1,
      "userDownsample": 0.5,
      "layerType": "effect",
      "type": "mouse",
      "usesPingPong": true,
      "mouseMomentum": 0,
      "texture": false,
      "animating": false,
      "isMask": 0,
      "compiledFragmentShaders": [
        "#version 300 es\nprecision highp float;in vec2 vTextureCoord; in vec3 vVertexPosition;uniform sampler2D uTexture; uniform sampler2D uPingPongTexture; uniform vec2 uResolution;const float PI = 3.1415926; const float ITERATIONS = 24.0;float getGaussianWeight(int index) { switch(index) { case 0: return 0.7978845608028654; case 1: return 0.795118932516684; case 2: return 0.7868794322038799; case 3: return 0.7733362336056986; case 4: return 0.7547664553859864; case 5: return 0.7315447328280048; case 6: return 0.704130653528599; case 7: return 0.6730536454899063; case 8: return 0.6388960110447045; case 9: return 0.6022748643096089; case 10: return 0.5638237508206051; case 11: return 0.5241747061566029; case 12: return 0.48394144903828673; case 13: return 0.443704309411472; case 14: return 0.40399737110811773; case 15: return 0.36529817077804383; case 16: return 0.3280201493519873; case 17: return 0.29250790855907144; case 18: return 0.2590351913317835; case 19: return 0.2278053882403838; case 20: return 0.19895427758549736; case 21: return 0.17255463765302306; case 22: return 0.1486223271179862; case 23: return 0.12712341303392466; default: return 0.0; } }out vec4 fragColor;vec3 rgb2hsv(vec3 c) { vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g)); vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));float d = q.x - min(q.w, q.y); float e = 1.0e-10; return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x); }vec3 chromatic_aberration(vec3 color, vec2 uv, vec2 offset) { vec4 left = texture(uTexture, uv - offset); vec4 right = texture(uTexture, uv + offset);color.r = left.r; color.b = right.b;return color; }vec2 angleToDir(float angle) { float rad = angle * 2.0 * PI; return vec2(cos(rad), sin(rad)); }vec4 blurTrail(vec2 uv, vec2 mouseDir) { if (dot(mouseDir, mouseDir) <= 1e-8) { return texture(uTexture, uv); } vec2 distorted = mouseDir * 0.4; float total_weight = 0.0; vec4 color = vec4(0); float scale = 0.0001 + 0.5000 * 0.5;for (int i = 0; i <= 24; i++) { float weight = getGaussianWeight(i); vec2 offset = distorted * (1.5 + scale) * mix(1.0, float(i) / ITERATIONS, scale); vec2 st = uv - offset; vec4 samp = texture(uTexture, st); samp.rgb = chromatic_aberration(samp.rgb, st, offset * 0.2500 * 0.12); color += weight * samp; total_weight += weight; } return color / total_weight; }vec4 getTrailColor(vec2 uv, vec2 mouseDir, float strength, float aspectRatio) { vec4 color = vec4(0);return blurTrail(uv, mouseDir); }void main() { vec2 uv = vTextureCoord; vec2 pingpongUv = uv; float aspectRatio = uResolution.x / uResolution.y;vec3 mouseRgb = texture(uPingPongTexture, pingpongUv).rgb; vec3 mouseTrail = rgb2hsv(mouseRgb);float angle = mouseTrail.x; float strength = mouseTrail.z * (0.2900 * 2.0); vec2 direction = angleToDir(angle); vec2 mouseDir = direction * strength;vec4 color = getTrailColor(uv, mouseDir, abs(strength), aspectRatio);fragColor = color; }",
        "#version 300 es\nprecision highp float;in vec3 vVertexPosition; in vec2 vTextureCoord;uniform sampler2D uPingPongTexture; uniform vec2 uPreviousMousePos; uniform float uTime;uniform vec2 uMousePos; uniform vec2 uResolution;const float PI = 3.1415926; const float TWOPI = 6.2831852;out vec4 fragColor;vec3 hsv2rgb(vec3 c) { vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www); return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y); }mat2 rot(float a) { return mat2(cos(a), -sin(a), sin(a), cos(a)); }vec2 liquify(vec2 st, float angle) { float aspectRatio = uResolution.x / uResolution.y; st.x *= aspectRatio; st = st * rot(angle * TWOPI); float amplitude = 0.003; for (float i = 1.0; i <= 5.0; i++) { st = st * rot(i / 5.0 * PI * 2.0); st += vec2( amplitude * cos(i * 5.0 * st.y + uTime * 0.02), amplitude * sin(i * 5.0 * st.x + uTime * 0.02) ); } st = st * rot(-angle * TWOPI); st.x /= aspectRatio; return st; }void main() { float aspectRatio = uResolution.x / uResolution.y; vec2 aspectVec = vec2(aspectRatio, 1.0); vec2 uv = vTextureCoord; vec2 correctedUv = uv * aspectVec;vec2 dir = (uMousePos - uPreviousMousePos) * aspectVec; float dist = length(dir); if (dist > 0.0) { dir = dir / dist; } else { dir = vec2(1.0, 0.0); }float rad = 0.5000 * 0.4 * mix(aspectRatio, 1.0, 0.5); float angle = atan(dir.y, dir.x); if (angle < 0.0) angle += TWOPI;uv = mix(uv, liquify(uv, smoothstep(0.0, 1.0, angle)), 0.3200);float t = dist > 0.0 ? clamp(dot(correctedUv - uPreviousMousePos * aspectVec, dir) / dist, 0.0, 1.0) : 0.0; vec2 closestPoint = mix(uPreviousMousePos, uMousePos, t) * aspectVec; float distanceToLine = distance(correctedUv, closestPoint);float s = smoothstep(rad, rad * 0.0000, distanceToLine);s = s * s;vec3 color = vec3(angle / TWOPI, 1.0, 1.0); vec3 mouseColor = hsv2rgb(color);vec2 sampleUv = mix(uv, uv / (1.0 + 0.5600 * 0.03) + 0.5600 * 0.015, 0.5600); vec3 lastFrameColor = texture(uPingPongTexture, sampleUv).rgb; lastFrameColor = pow(lastFrameColor, vec3(2.2)); mouseColor = pow(mouseColor, vec3(2.2)); float intensity = min(0.7, dist * 10.0) * s * 0.4; vec3 draw = mix(lastFrameColor, mouseColor, intensity); draw *= pow(0.7300, 0.2); draw = pow(draw, vec3(1.0/2.2)); fragColor = vec4(draw, 1.0); }"
      ],
      "compiledVertexShaders": [
        "#version 300 es\nprecision mediump float;in vec3 aVertexPosition; in vec2 aTextureCoord;uniform mat4 uMVMatrix; uniform mat4 uPMatrix; uniform mat4 uTextureMatrix;out vec2 vTextureCoord; out vec3 vVertexPosition;void main() { gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0); vTextureCoord = (uTextureMatrix * vec4(aTextureCoord, 0.0, 1.0)).xy; }",
        "#version 300 es\nprecision mediump float;in vec3 aVertexPosition; in vec2 aTextureCoord;uniform mat4 uMVMatrix; uniform mat4 uPMatrix;out vec2 vTextureCoord; out vec3 vVertexPosition;void main() { gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0); vTextureCoord = aTextureCoord; }"
      ],
      "data": { "depth": false, "uniforms": {}, "isBackground": false },
      "id": "effect2"
    },
    {
      "breakpoints": [],
      "visible": true,
      "aspectRatio": 1,
      "userDownsample": 1,
      "layerType": "effect",
      "type": "custom",
      "usesPingPong": false,
      "texture": false,
      "speed": 0.5,
      "mouseMomentum": 0,
      "animating": true,
      "isMask": 0,
      "customFragmentShaders": [
        "#version 300 es\nprecision highp float;\n\n// Unicorn Studio inputs\nin vec2 vTextureCoord;\n\nuniform sampler2D uTexture;\nuniform sampler2D uCustomTexture;\n\nuniform vec2 uResolution;   // px\nuniform vec2 uMousePos;     // 0..1\nuniform float uMouseClick;   // 0 or 1\nuniform vec3 uColor1;\nuniform vec3 uColor2;\nuniform vec2 uPos;\nuniform float uAmount;\nuniform float uScale;\nuniform float uFrequency;\nuniform float uAngle;\nuniform float uAmplitude;\nuniform int uVariant;\n\nuniform float uTime;\n\nout vec4 fragColor;\n\n// ==============================\n// configuration\n// ==============================\n\nconst float DENSITY_MIN   = 6.0;\nconst float DENSITY_MAX   = 80.0;\nconst float CONTRAST_MIN  = 0.6;\nconst float CONTRAST_MAX  = 1.8;\n\nconst float STEP_CELLS_Y  = 1.2;   // small Y offset\nconst float CHANNEL_DELAY = 0.10;   // slight phase lag\n\nconst float MACRO_SCALE   = 0.13;\nconst float MICRO_FREQ    = 1.5;\nconst float MACRO_WEIGHT  = 0.90;\n\nconst float MICRO_SPEED_MIN = 0.02;\nconst float MICRO_SPEED_MAX = 0.06;\nconst float MACRO_SPEED_MIN = 0.006;\nconst float MACRO_SPEED_MAX = 0.018;\n\n// NEW — center “freeze” controls\nconst float CENTER_STABILITY_RADIUS   = 0.35; // radius (0–1)\nconst float CENTER_STABILITY_STRENGTH = 0.7;  // how strong to bias towards max size\n\n// Fresnel-like radial size bias (center + rim larger)\nconst float FRESNEL_CENTER_RADIUS    = 0.4; // where center lobe fades\nconst float FRESNEL_CENTER_SOFTNESS  = 0.8; // width of the center fade\nconst float FRESNEL_CENTER_STRENGTH  = 0.8; // 0..1, how much bigger at center\n\nconst float FRESNEL_RIM_START        = 0.8; // start of rim boost (radius 0..1)\nconst float FRESNEL_RIM_END          = 0.2; // end of rim boost\nconst float FRESNEL_RIM_STRENGTH     = 0.5; // 0..1, how much bigger near edges\n\n\n// ==============================\n// helpers\n// ==============================\nfloat luma(vec3 c) { return dot(c, vec3(0.2126, 0.7152, 0.0722)); }\nmat2 rot(float a) { float s = sin(a), c = cos(a); return mat2(c, -s, s, c); }\n\nfloat hash21(vec2 p) {\n  p = fract(p * vec2(123.34, 345.45));\n  p += dot(p, p + 34.345);\n  return fract(p.x * p.y);\n}\n\nfloat noise2(vec2 p) {\n  vec2 i = floor(p);\n  vec2 f = fract(p);\n  float a = hash21(i);\n  float b = hash21(i + vec2(1.0, 0.0));\n  float c = hash21(i + vec2(0.0, 1.0));\n  float d = hash21(i + vec2(1.0, 1.0));\n  vec2  u = f * f * (3.0 - 2.0 * f);\n  return mix(mix(a, b, u.x), mix(c, d, u.x), u.y);\n}\n\nfloat centerMask(vec2 uv, float yyScale) {\n  vec2 g = (uv - 0.5) * vec2(1.0, 1.0 / yyScale);\n  float d = length(g) * 2.0;\n  return smoothstep(0.65, 1.3, d);\n}\n\n// ===================================================\n// Dot function: per-cell, seam-safe, with center bias\n// ===================================================\nfloat dotFromCell(vec2 id, vec2 fu, float val, float noiseAmp, float mouseLocal,float t, float aaWidth, vec2 uv) {\n  // sample modulation once per cell (prevents wobble)\n  vec2 cellCenter = id + vec2(0.5);\n\n  float tmMicro = mix(MICRO_SPEED_MIN, MICRO_SPEED_MAX, clamp(uFrequency, 0.0, 1.0));\n  float tmMacro = mix(MACRO_SPEED_MIN, MACRO_SPEED_MAX, clamp(uFrequency, 0.0, 1.0));\n\n  float nMicro = noise2(cellCenter * MICRO_FREQ + t * tmMicro);\n  float nMacro = noise2(cellCenter * MACRO_SCALE + t * tmMacro);\n  nMacro = mix(nMacro, noise2(cellCenter * (MACRO_SCALE * 1.8) + 11.7 + t * tmMacro), 0.2);\n\n  float n = mix(nMicro, nMacro, MACRO_WEIGHT);\n\n  // Fresnel-like radial bias: larger at center and near edges (rim)\n  vec2 centered = uv - 0.5;\n  centered.x *= uResolution.x / max(uResolution.y, 1.0); // keep circle round on non-square viewports\nfloat rRad = length(centered);\n\nfloat centerFalloff = 1.0 - smoothstep(\n  FRESNEL_CENTER_RADIUS - FRESNEL_CENTER_SOFTNESS,\n  FRESNEL_CENTER_RADIUS + FRESNEL_CENTER_SOFTNESS,\n  rRad\n);\n\nfloat rim = smoothstep(FRESNEL_RIM_START, FRESNEL_RIM_END, rRad);\n\n  // combined Fresnel profile (0..1)\n  float fresnelProfile = clamp(\n    centerFalloff * FRESNEL_CENTER_STRENGTH +\n    rim           * FRESNEL_RIM_STRENGTH,\n    0.0, 1.0\n  );\n\n  // bias modulation toward larger dots where fresnelProfile > 0\n  n = mix(n, 1.0, fresnelProfile);\n\n\n  // final ink radius\n  float ink = 1.0 - val;\n  ink += (n - 0.5) * 2.0 * noiseAmp;\n  ink = clamp(ink, 0.0, 1.0);\n\n  float r = sqrt(2.0) * ink * 0.5;\n  float d = length(fu);\n\n  float fw = aaWidth;\n  return 1.0 - smoothstep(r, r + fw, d);\n}\n\n// ==============================\n// Main\n// ==============================\nvoid main() {\n  vec2 uv  = vTextureCoord;\n  vec4 src = texture(uTexture, uv);\n  vec3 base = src.rgb;\n\n  float density  = mix(DENSITY_MIN, DENSITY_MAX, clamp(uScale,   0.0, 1.0));\n  float contrast = mix(CONTRAST_MIN, CONTRAST_MAX, clamp(uAmount, 0.0, 1.0));\n  float nAmp     = uAmplitude * 0.35;\n  float angle    = uAngle;\n\n  // mouse local effect\n  float distMouse     = distance(uv, uMousePos);\n  float cursorRadius  = 0.12;\n  float cursorFalloff = 1.0 - smoothstep(cursorRadius * 0.5, cursorRadius, distMouse);\n  float mouseLocal    = max(cursorFalloff * (0.35 + 0.65 * uMouseClick), 0.0);\n\n  // subtle center reduction (keeps previous tone balance)\n  float cMask      = centerMask(uv, 0.70);\n  float centerBias = -(1.0 - cMask) * 0.25 * 0.6;\n\n  // grid setup\n  float aspect = uResolution.x / max(uResolution.y, 1.0);\n  vec2 suv = (uv - 0.5);\n  suv.x *= aspect;\n\n  vec2 gridBase = (rot(angle) * suv) * density;\n\n  vec2 offA = vec2(0.0,  STEP_CELLS_Y);\n  vec2 offB = vec2(0.0,  0.0);\n  vec2 offC = vec2(0.0, -STEP_CELLS_Y);\n\n  vec2 gridA = gridBase + offA;\n  vec2 gridB = gridBase + offB;\n  vec2 gridC = gridBase + offC;\n\n  vec2 idA = floor(gridA), fuA = fract(gridA) - 0.5;\n  vec2 idB = floor(gridB), fuB = fract(gridB) - 0.5;\n  vec2 idC = floor(gridC), fuC = fract(gridC) - 0.5;\n\n  vec2 wA = fwidth(gridA);\n  vec2 wB = fwidth(gridB);\n  vec2 wC = fwidth(gridC);\n  float aaA = max(wA.x, wA.y);\n  float aaB = max(wB.x, wB.y);\n  float aaC = max(wC.x, wC.y);\n\n  float tA = uTime + CHANNEL_DELAY;\n  float tB = uTime;\n  float tC = uTime - CHANNEL_DELAY;\n\n  vec3 outCol = vec3(0.0);\n\n  if (uVariant == 0) {\n    vec3 cmy = 1.0 - clamp(base * contrast, 0.0, 1.0);\n\n    float cDot = dotFromCell(idA, fuA, clamp(1.0 - cmy.x - centerBias, 0.0, 1.0),\n                             nAmp, mouseLocal, tA, aaA, uv);\n    float mDot = dotFromCell(idB, fuB, clamp(1.0 - cmy.y - centerBias, 0.0, 1.0),\n                             nAmp, mouseLocal, tB, aaB, uv);\n    float yDot = dotFromCell(idC, fuC, clamp(1.0 - cmy.z - centerBias, 0.0, 1.0),\n                             nAmp, mouseLocal, tC, aaC, uv);\n\n    vec3 paper = vec3(1.0);\n    paper -= vec3(cDot, 0.0, 0.0);\n    paper -= vec3(0.0, mDot, 0.0);\n    paper -= vec3(0.0, 0.0, yDot);\n\n    float overlap = min(min(cDot, mDot), yDot);\n    paper = mix(paper, vec3(0.3), overlap * 0.2);\n\n    outCol = clamp(paper, 0.0, 1.0);\n  }\n  else if (uVariant == 1) {\n    float v = clamp(luma(base) * contrast - centerBias, 0.0, 1.0);\n    float kDot = dotFromCell(idB, fuB, v, nAmp, mouseLocal, tB, aaB, uv);\n    outCol = mix(vec3(1.0), vec3(0.0), kDot);\n  }\n  else {\n    float rDot = dotFromCell(idA, fuA, clamp(base.r * contrast - centerBias, 0.0, 1.0),\n                             nAmp, mouseLocal, tA, aaA, uv);\n    float gDot = dotFromCell(idB, fuB, clamp(base.g * contrast - centerBias, 0.0, 1.0),\n                             nAmp, mouseLocal, tB, aaB, uv);\n    float bDot = dotFromCell(idC, fuC, clamp(base.b * contrast - centerBias, 0.0, 1.0),\n                             nAmp, mouseLocal, tC, aaC, uv);\n\n    vec3 dots = vec3(rDot, gDot, bDot);\n    float overlap = min(min(dots.r, dots.g), dots.b);\n    dots = mix(dots, vec3(1.0), overlap * 0.5);\n    outCol = clamp(dots, 0.0, 1.0);\n  }\n\n  float outA = src.a > 0.0 ? src.a : 1.0;\n  fragColor = vec4(outCol, outA);\n}\n"
      ],
      "customVertexShaders": [
        "#version 300 es\nprecision mediump float;\n\nin vec3 aVertexPosition;\nin vec2 aTextureCoord;\n\nuniform mat4 uMVMatrix;\nuniform mat4 uPMatrix;\nuniform mat4 uTextureMatrix;\n\nout vec2 vTextureCoord;\nout vec3 vVertexPosition;\n\nvoid main() {\n  gl_Position = vec4(aVertexPosition, 1.0);\n  vTextureCoord = (vec4(aTextureCoord, 0.0, 1.0)).xy;\n}"
      ],
      "compiledFragmentShaders": [
        "#version 300 es\nprecision highp float;in vec2 vTextureCoord;uniform sampler2D uTexture;uniform vec2 uResolution; uniform vec2 uMousePos;uniform float uTime;out vec4 fragColor;const float DENSITY_MIN = 6.0; const float DENSITY_MAX = 80.0; const float CONTRAST_MIN = 0.6; const float CONTRAST_MAX = 1.8;const float STEP_CELLS_Y = 1.2; const float CHANNEL_DELAY = 0.10;const float MACRO_SCALE = 0.13; const float MICRO_FREQ = 1.5; const float MACRO_WEIGHT = 0.90;const float MICRO_SPEED_MIN = 0.02; const float MICRO_SPEED_MAX = 0.06; const float MACRO_SPEED_MIN = 0.006; const float MACRO_SPEED_MAX = 0.018;const float CENTER_STABILITY_RADIUS = 0.35; const float CENTER_STABILITY_STRENGTH = 0.7;const float FRESNEL_CENTER_RADIUS = 0.4; const float FRESNEL_CENTER_SOFTNESS = 0.8; const float FRESNEL_CENTER_STRENGTH = 0.8;const float FRESNEL_RIM_START = 0.8; const float FRESNEL_RIM_END = 0.2; const float FRESNEL_RIM_STRENGTH = 0.5;float luma(vec3 c) { return dot(c, vec3(0.2126, 0.7152, 0.0722)); } mat2 rot(float a) { float s = sin(a), c = cos(a); return mat2(c, -s, s, c); }float hash21(vec2 p) { p = fract(p * vec2(123.34, 345.45)); p += dot(p, p + 34.345); return fract(p.x * p.y); }float noise2(vec2 p) { vec2 i = floor(p); vec2 f = fract(p); float a = hash21(i); float b = hash21(i + vec2(1.0, 0.0)); float c = hash21(i + vec2(0.0, 1.0)); float d = hash21(i + vec2(1.0, 1.0)); vec2 u = f * f * (3.0 - 2.0 * f); return mix(mix(a, b, u.x), mix(c, d, u.x), u.y); }float centerMask(vec2 uv, float yyScale) { vec2 g = (uv - 0.5) * vec2(1.0, 1.0 / yyScale); float d = length(g) * 2.0; return smoothstep(0.65, 1.3, d); }float dotFromCell(vec2 id, vec2 fu, float val, float noiseAmp, float mouseLocal,float t, float aaWidth, vec2 uv) { vec2 cellCenter = id + vec2(0.5);float tmMicro = mix(MICRO_SPEED_MIN, MICRO_SPEED_MAX, clamp(0.5000, 0.0, 1.0)); float tmMacro = mix(MACRO_SPEED_MIN, MACRO_SPEED_MAX, clamp(0.5000, 0.0, 1.0));float nMicro = noise2(cellCenter * MICRO_FREQ + t * tmMicro); float nMacro = noise2(cellCenter * MACRO_SCALE + t * tmMacro); nMacro = mix(nMacro, noise2(cellCenter * (MACRO_SCALE * 1.8) + 11.7 + t * tmMacro), 0.2);float n = mix(nMicro, nMacro, MACRO_WEIGHT); vec2 centered = uv - 0.5; centered.x *= uResolution.x / max(uResolution.y, 1.0); float rRad = length(centered);float centerFalloff = 1.0 - smoothstep( FRESNEL_CENTER_RADIUS - FRESNEL_CENTER_SOFTNESS, FRESNEL_CENTER_RADIUS + FRESNEL_CENTER_SOFTNESS, rRad );float rim = smoothstep(FRESNEL_RIM_START, FRESNEL_RIM_END, rRad); float fresnelProfile = clamp( centerFalloff * FRESNEL_CENTER_STRENGTH + rim * FRESNEL_RIM_STRENGTH, 0.0, 1.0 ); n = mix(n, 1.0, fresnelProfile); float ink = 1.0 - val; ink += (n - 0.5) * 2.0 * noiseAmp; ink = clamp(ink, 0.0, 1.0);float r = sqrt(2.0) * ink * 0.5; float d = length(fu);float fw = aaWidth; return 1.0 - smoothstep(r, r + fw, d); }void main() { vec2 uv = vTextureCoord; vec4 src = texture(uTexture, uv); vec3 base = src.rgb;float density = mix(DENSITY_MIN, DENSITY_MAX, clamp(0.6700, 0.0, 1.0)); float contrast = mix(CONTRAST_MIN, CONTRAST_MAX, clamp(0.0000, 0.0, 1.0)); float nAmp = 0.7500 * 0.35; float angle = 0.0000; float distMouse = distance(uv, uMousePos); float cursorRadius = 0.12; float cursorFalloff = 1.0 - smoothstep(cursorRadius * 0.5, cursorRadius, distMouse); float mouseLocal = max(cursorFalloff * (0.35 + 0.65 * 0.0000), 0.0); float cMask = centerMask(uv, 0.70); float centerBias = -(1.0 - cMask) * 0.25 * 0.6; float aspect = uResolution.x / max(uResolution.y, 1.0); vec2 suv = (uv - 0.5); suv.x *= aspect;vec2 gridBase = (rot(angle) * suv) * density;vec2 offA = vec2(0.0, STEP_CELLS_Y); vec2 offB = vec2(0.0, 0.0); vec2 offC = vec2(0.0, -STEP_CELLS_Y);vec2 gridA = gridBase + offA; vec2 gridB = gridBase + offB; vec2 gridC = gridBase + offC;vec2 idA = floor(gridA), fuA = fract(gridA) - 0.5; vec2 idB = floor(gridB), fuB = fract(gridB) - 0.5; vec2 idC = floor(gridC), fuC = fract(gridC) - 0.5;vec2 wA = fwidth(gridA); vec2 wB = fwidth(gridB); vec2 wC = fwidth(gridC); float aaA = max(wA.x, wA.y); float aaB = max(wB.x, wB.y); float aaC = max(wC.x, wC.y);float tA = uTime + CHANNEL_DELAY; float tB = uTime; float tC = uTime - CHANNEL_DELAY;vec3 outCol = vec3(0.0);if (0 == 0) { vec3 cmy = 1.0 - clamp(base * contrast, 0.0, 1.0);float cDot = dotFromCell(idA, fuA, clamp(1.0 - cmy.x - centerBias, 0.0, 1.0), nAmp, mouseLocal, tA, aaA, uv); float mDot = dotFromCell(idB, fuB, clamp(1.0 - cmy.y - centerBias, 0.0, 1.0), nAmp, mouseLocal, tB, aaB, uv); float yDot = dotFromCell(idC, fuC, clamp(1.0 - cmy.z - centerBias, 0.0, 1.0), nAmp, mouseLocal, tC, aaC, uv);vec3 paper = vec3(1.0); paper -= vec3(cDot, 0.0, 0.0); paper -= vec3(0.0, mDot, 0.0); paper -= vec3(0.0, 0.0, yDot);float overlap = min(min(cDot, mDot), yDot); paper = mix(paper, vec3(0.3), overlap * 0.2);outCol = clamp(paper, 0.0, 1.0); } else if (0 == 1) { float v = clamp(luma(base) * contrast - centerBias, 0.0, 1.0); float kDot = dotFromCell(idB, fuB, v, nAmp, mouseLocal, tB, aaB, uv); outCol = mix(vec3(1.0), vec3(0.0), kDot); } else { float rDot = dotFromCell(idA, fuA, clamp(base.r * contrast - centerBias, 0.0, 1.0), nAmp, mouseLocal, tA, aaA, uv); float gDot = dotFromCell(idB, fuB, clamp(base.g * contrast - centerBias, 0.0, 1.0), nAmp, mouseLocal, tB, aaB, uv); float bDot = dotFromCell(idC, fuC, clamp(base.b * contrast - centerBias, 0.0, 1.0), nAmp, mouseLocal, tC, aaC, uv);vec3 dots = vec3(rDot, gDot, bDot); float overlap = min(min(dots.r, dots.g), dots.b); dots = mix(dots, vec3(1.0), overlap * 0.5); outCol = clamp(dots, 0.0, 1.0); }float outA = src.a > 0.0 ? src.a : 1.0; fragColor = vec4(outCol, outA); }"
      ],
      "compiledVertexShaders": [
        "#version 300 es\nprecision mediump float;in vec3 aVertexPosition; in vec2 aTextureCoord;out vec2 vTextureCoord; out vec3 vVertexPosition;void main() { gl_Position = vec4(aVertexPosition, 1.0); vTextureCoord = (vec4(aTextureCoord, 0.0, 1.0)).xy; }"
      ],
      "data": {
        "depth": false,
        "uniforms": {},
        "isBackground": false,
        "heightSegments": 250,
        "widthSegments": 250
      },
      "id": "effect3"
    }
  ],
  "options": {
    "name": "Copy of Fresnel (live on storybook)",
    "fps": 60,
    "dpi": 1,
    "scale": 1,
    "includeLogo": false,
    "isProduction": false
  },
  "version": "1.4.33",
  "id": "YKlVrTX5kZTTIUZf4HmM"
}
