Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: WebGPU Particles Simulation (github.com/psincf)
41 points by psincf 11 months ago | hide | past | favorite | 29 comments
This is a small particles simulation that can run either with WebGPU (GPU Compute) or with the CPU, and it can be changed in real time



Link in case anyone missed it on the sidebar: https://web-gpu-particles.vercel.app


"WebGL Water" (2023) https://news.ycombinator.com/item?id=38370118 :

> Three.js interactive webgl particle wave simulator: https://threejs.org/examples/webgl_points_waves.html

> [Curl, Vorticity,]

From https://news.ycombinator.com/item?id=31049970 re: Deep Learning / CFS: Computational Fluid Dynamics:

> google/jax-cfd https://github.com/google/jax-cfd#other-awesome-projects lists "Other differentiable CFD codes compatible with deep learning"


WebGL Water is from 2010. Interestingly the author went on to make esbuild. Also one of my favorite utilities "diskitude" (just because it's 10 kb, not necessarily because it's the best disk analyzer).


The author (Ean Wallace) also went on to co-found Figma, which was just sold to Adobe for 20B - https://madebyevan.com/



Must've copied the year from the cited HN post.

Geiss (1998; now on GitHub) and Smoke (2002) https://www.geisswerks.com/

Smoke does 2D Navier-Stokes optionally as a wallpaper or a screensaver. There are current mobile apps that work as wallpapers.

ProjectM is an open source MilkDrop implementation, which supports input [audio] waveforms for music data visualization; IIRC it's already ported to WebGL but not yet WebGPU.

IDK how slow Navier-Stokes or Gross-Pitaevski would be in WASM with WebGL and or WebGPU


"Machine Learning for Fluid Dynamics Playlist" by Steve Brunton https://news.ycombinator.com/item?id=34574514


"error: WebGPU not supported"

iOS 17.1.2, iPhone 13 pro. no option to try cpu instead, just the error message.


Yeah WebGPU doesn't work on mobile for the moment. https://caniuse.com/webgpu Also the simulation can be done on CPU, but the rendering in always done in WebGPU, so you need it anyways


I thought Apple came up w/ WebGPU, and also that it had worked on iPhones in the past..? Maybe I misremembered. Caniuse shows it as red /unsupported in iOS, and further searching led me to this huge list of webgl bugs in webkit: https://bugs.webkit.org/buglist.cgi?bug_status=__open__&comp...


Apple made a proposal for WebGPU that was kind of WebMetal with a dialect of HLSL. The final WebGPU standard has little in common and is not supported by Safari yet. My belief is that a big part of Apple's reason for proposing a new standard at all was to force a venue change to W3C instead of Khronos, due to legal disputes they had (maybe still have?) with Nvidia.


Apple also created the OpenCL standard; they love nothing more than setting up cross vendor standards to fail. I absolutely hate them for that one in particular.


Actually the blame lies on Khronos side, alongside Google, Intel and AMD ineptude to do anything of value with OpenCL.

For a very long time Apple's platforms were the only ones with a proper OpenCL support, until they gave up and went their own merry way, without Khronos politics.


> For a very long time Apple's platforms were the only ones with a proper OpenCL support

I'm curious about this, since I never had a problem with OpenCL on Intel, AMD, Nvidia and am pretty sure I did with Apple in the beginning. Shipping two commercial OpenCL apps since 2010 (and they still work excellently on all of them).


Well how did you enjoy their version of NVIDIA Nsight for GPGPU debugging?

Yeah, it was mostly printf debugging, I imagine.

The drivers apparently not always that good, specially in regards to OpenCL 2.x.

Then there was zero support on Android, with Google pushing Renderscript instead.


It doesn't work for me on Safari, macOS, M1: "Error: WebGPU not supported".

WebGL pixels works in the same browser, e.g.: https://plotapi.com/docs/visualizations/terminus/#default-vi...



Yeah WebGPU is very new and still not finished. It's apparently not supported by Safari. https://caniuse.com/webgpu I don't know if it's working on chrome on MacOS ?


webgpu is only available on chromium atm


.. on some platforms - not on Android, desktop Linux or iOS.


Hmm. Even with WebGPU enabled in Firefox I get shader compilation errors and nothing on screen. Oh well.


I love these simulations, they're beautiful. Anyone else find that WebGPU is always glitchy for them? I must have tried the tech on countless different laptops now. But there's always problems with it like: latency, tearing, flicking, crashes. Is the tech just very unstable?


IIRC it was delayed multiple times. I think the first intent to ship from chrome was before 100 but they kept pushing it off. Firefox still does not support it. There are projects like wgpu[0] that provide a higher level API for WebGPU and I have used some projects using it with no issues. WFIW I didn't see any issue with OP's demo either.

[0] https://github.com/gfx-rs/wgpu


Yes it is still a bit new. WebGPU is not finished and is still being worked on: https://webgpu.io/ And it is supported by very few browser also: https://caniuse.com/webgpu


Smooth as a baby's bottom for me.


I'm just seeing single frame of white noise (Chrome 120, macOS 14.2, MBP 14" M1 Pro)


I'm just seeing a white frame - no noise. Clicking on the white frame doesn't help. (Chrome 119, Windows 10, Intel NUC6i3).


Click somewhere in the noise


For those just seeing noise: click somewhere in the noise.




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

Search: