thedocruby / resounding

A New Minecraft mod that provides realistic audio physics using parallel wave tracing and an improved physics algorithm.
https://thedocruby.dev/resounding
GNU Lesser General Public License v3.0
85 stars 4 forks source link

Wave Refraction & Diffusion #98

Open mikenrafter opened 1 year ago

mikenrafter commented 1 year ago

Is your feature request related to a problem? Please describe. The current raytracing solution treats sound like light, but sound travels in circular/spherical waves.

Describe the solution you'd like Split a ray into multiple rays whenever a lone-ray no longer properly samples the environment as a circular/spherical wave would.

Some examples are whenever a ray:

Performance considerations:

  1. Apply restrictions to ray-splitting.
  2. Decrease amplitude of any secondary ray.
  3. Limit total rays separately from initial rays.
  4. Use a queue, and append all secondary rays to said queue.
  5. Rework: Treat each reflection independently (ignoring ray-paths).

The arcs would need to be physically accurate, and more research would be needed to get this right. One (unvetted) approach would be to treat the current theta allotted to each initial ray as the global arc. This approach would have the (theoretical) benefit of improving the quality of sound for lower-end computers using less-intensive settings.

My current way of thinking about ray quantities is: initial × (2^((initialDistance-splitDistance)/bounceEstimate)-1)

Describe alternatives you've considered None.

Describe any compatibility requirements None.

Additional context https://www.britannica.com/science/sound-physics/Circular-and-spherical-waves https://noisetools.net/barriercalculator Dependent upon #99