News for hackers. Stuff that matters.
Re:Fluid Simulation and Web Assembly by leephillips on Friday August 23, 2024 @01:28AM (#41326403)
When on this page almost all my keyboard shortcuts stopped working and it was difficult to close the page. I consider this a form of malware.
Re:Fluid Simulation and Web Assembly by nighthawk454 on Friday August 23, 2024 @02:42AM (#41326622)
It’s running flawlessly on my iPad mini. Perhaps the site isn’t the issue.
Re:Fluid Simulation and Web Assembly by zamadatix on Friday August 23, 2024 @09:58AM (#41329071)
I don't think they mean the performance or anything like that, rather the site literally requests to eat all keyboard events (among other things). To even open dev tools on a completely different system I had to do it via the browser menu as right click, Ctrl+Shift+I, and f12 were set to be globally consumed for input on the site instead of just certain needed events in the app area.
Re:Fluid Simulation and Web Assembly by pekim on Friday August 23, 2024 @04:34AM (#41327227)
The page appears to install global keydown/up handlers that swallow all key events. And it also disables the browser's context menu.
Re:Fluid Simulation and Web Assembly by ellellem on Friday August 23, 2024 @01:34AM (#41326430)
Fluid simulation is more suited to GPU (because particles/molecules...) than CPU. What am I missing? SIMD maybe? Not sure...
Re:Fluid Simulation and Web Assembly by s-macke on Friday August 23, 2024 @02:43AM (#41326625)
WebAssembly programming is simply easier than GPU programming.

My game here [0] 6 years ago uses WebAssembly with a Finite Difference approach for the fluid part. Nowadays, fixed-width SIMD [1] is standardized and supported in the browser. But I don't now any website using it.

I have tried porting it to WebGPU. It is much more complicated and only Chrome supports it right now. To get fluid simulation working via the older standard WebGL is more like a hack.

[0| https://github.com/s-macke/Interplanetary-Postal-Service

[1] https://github.com/WebAssembly/simd/blob/master/proposals/si...

Re:Fluid Simulation and Web Assembly by pornel on Friday August 23, 2024 @07:12AM (#41327975)
https://wgpu.rs can emulate newer APIs on WebGL2. It's really nice to work with.