Week 4: Audio and Rendering
Summary
Date: 2020-04-05 to 2020-04-11
- GL depth buffer fix -- rendering is corrected on Windows.
- Audio plays in WASM, albeit delayed.
End Result
Implementation
-
Split audio logic from other systems. (amethyst#2215, amethyst#2216, pong_wasm#2)
This allows the rest of Pong to run even if audio is disabled.
-
Initialization stability on Windows:
Make drag and drop
winit
feature optional. (amethyst/winit#a2eea3e, winit#1524) -
Fixed
gfx
issues.- Clear GL depth buffer. (gfx#35c45ac, gfx#3202, gfx#3205)
- Load
Rgb8Srgb
texture format. (gfx#c4b75d3, gfx#3222, gfx#3223)
-
Get audio to play on WASM.
- Use ishitatsuyuki/cpal#dpeckett-webaudio-poc, which is based off wasm-bindgen POC by
dpeckett
. (amethyst/cpal#ee1ee1a, cpal#372) - Send audio through
AudioBuffer
in JavaScript. (amethyst#2195, amethyst#2219) - Use
sed
hack to allow web workers to be instantiated without anAudioContext
. (pong_wasm#3)
- Use ishitatsuyuki/cpal#dpeckett-webaudio-poc, which is based off wasm-bindgen POC by