Hacker News new | past | comments | ask | show | jobs | submit login

The point was that the implementation of this tool is not a sin+cos function. It's more like

  let newEz = Ez0[me] +  calcEzDiff(vec2u(id.x, id.y), dx, dy, aspect);

  let newEzAbove = Ez0[above] +  calcEzDiff(vec2u(id.x, id.y + 1), dx, dy, aspect);
  let newEzRight = Ez0[right] +  calcEzDiff(vec2u(id.x + 1, id.y), dx, dy, aspect);

  Hx1[me] = Hx0[me] - (uniforms.dt/mu0)*(newEzAbove - newEz) / dy;
  Hy1[me] = Hy0[me] + (uniforms.dt/mu0)*(newEzRight - newEz) / dx;

  Ez1[me] = newEz;

  let localDelta = delta[me];
  let fac = 1 + uniforms.omega * uniforms.dt * (delta[me] / eps[me] / 2);
  Ez1[me] = Ez1[me] / fac;
  Hx1[me] = Hx1[me] / fac;
  Hy1[me] = Hy1[me] / fac;
and then a bunch of other GPU code. You can find this with little effort from the bundle, if you care, by base64-decoding the Pt("xxx") parts.

Though I do imagine it indeed could be implementable with WebGL shaders, but I also wouldn't start a new compute-based on it, unless I had a particular need to support older systems. And this I say as a Firefox user..




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: