←back to thread

WebGPU-Based WiFi Simulator

(wifi-solver.com)
325 points jasmcole | 1 comments | | HN request time: 0.206s | source
Show context
noahbp ◴[] No.41897720[source]
It's so frustrating that WebGPU support was released 1.5 years ago on Chrome, and yet is still unavailable on all other browsers.

This is a real killer feature that will dramatically slow adoption of non-Chromium browsers, even with Google defanging ad blockers.

replies(9): >>41897739 #>>41897797 #>>41897800 #>>41897830 #>>41897856 #>>41897860 #>>41897886 #>>41897974 #>>41898014 #
soheil ◴[] No.41897886[source]
Why do you need webgpu? It's unfortunate that people use technology that is "state-of-the-art techniques to run simulations at interactive speeds" without fully understanding what it's for. General compute on GPU is what webgpu is for.. To simulate basic waves like in this demo you absolutely do not need that, in fact it's an indication the author implemented the solution in a non-optimal way. WebGL is fully supported by all browsers fully supported by well-maintained libs like 3js, yet here we are people writing a sin function with basic interference patterns, one of the most elementary 3D primitives, in webgpu and argue that's using the "state-of-the-art" techniques.
replies(1): >>41897933 #
jasmcole ◴[] No.41897933[source]
Good question! This is actually a numerical solver for a few coupled partial differential equations - the method in this context (electromagnetism) is called FDTD. It's implemented as a WebGPU compute shader.

You absolutely could do this using WebGL2 compute shaders too, but I thought it would be fun to try this newer API.

replies(2): >>41898010 #>>41898082 #
soheil ◴[] No.41898082[source]
I don't understand what other type of solution is there to render on a gpu other than a numeric one?

Here is a very basic shader for what you want:

  float freq1 = 2.0;
  float freq2 = 3.0;
  float amp = 0.5;

  pos.z += sin(pos.x * freq1 + uTime) * amp;
  pos.z += cos(pos.y * freq2 + uTime) * amp;

  gl_Position = projectionMatrix * modelViewMatrix * vec4(pos, 1.0);
replies(2): >>41898209 #>>41899281 #
1. vardump ◴[] No.41898209[source]
That's no solver, it just displays a sine wave pattern.