wave-sim
lets you define walls, emitters, and the c value (wave speed) at every point with an image.
The red channel is used for walls, the green channel is used for emitters, and the blue channel defines what percent of the global c value is at the position (base-map.png
for an example.
You can also use a shader function to modify the simulation while it's running, for example for a moving emitter.
The shaders are written in WSGL, and the example shader (base-shader.wsgl
) explains all the variables and function you can access.
To run these, just supply the path to a params.toml
as the only command line argument when starting the program.
The classic double-slit experiment. This example uses a shader, even though a map would be fine, to make it resizable.
This example uses a map file to define the lense shape. In the params file, you can change map to any of the the map files to play with the other types of lenses.