kig / spirv-wasm

Run SPIR-V shaders in WebAssembly
Apache License 2.0
11 stars 0 forks source link

GLSL front-end framework #4

Open kig opened 4 years ago

kig commented 4 years ago

Imagine this: you have a compute shader that animates every element on the page using a fluid simulation. At animation frame time, the latest simulation results are applied to the page elements as CSS transforms. You can still mess and interact with the elements with touch / mouse / keyboard. How do you wire this up?

Collect element coords into a big buffer, pass it over, get another big buffer back, apply results?

kig commented 4 years ago

Client-side web application structure:

Tenets:

kig commented 4 years ago

Input stream limits:

In a nutshell:

People would likely use this kind of library only for doing lots of computation or having large local datasets, like semi-local web apps where you load data from local storage. Here maximizing bandwidth and storage efficiency are nice to have.