0

I'm having trouble understanding the code.
Note you can't use vertex shader doing this.

here's kaiware007's grid code:

float grid(vec2 uv, float battery)
{
    vec2 size = vec2(uv.y, uv.y * uv.y * 0.2) * 0.01;
    uv += vec2(0.0, iTime * 4.0 * (battery + 0.05));
    uv = abs(fract(uv) - 0.5);
    vec2 lines = smoothstep(size, vec2(0.0), uv);
    lines += smoothstep(size * 5.0, vec2(0.0), uv) * 0.4 * battery;
    return clamp(lines.x + lines.y, 0.0, 3.0);
}

His code is showing at shadertoy, link's this: https://www.shadertoy.com/view/Wt33Wf

I tried to understand the code but I really can't...

genpfault
  • 51,148
  • 11
  • 85
  • 139
Simon
  • 1
  • 1

0 Answers0