This is part two of a simple proof of concept, a minimal 3D engine written in C++, compiled to WASM with Emscripten. Running in the browser, rendering with WebGPU.
For the basic initial demo, see https://github.com/Armchair-Software/webgpu-demo.
This is a follow-up, adding GUI rendering with dear imgui, demonstrating the new emscripten imgui backend.
This also demonstrates how you might set up gamepad input with the above backend. Plug in a gamepad, joystick, or other controller to test the integration - the cube can be rotated, and the gui can be interacted with. There is no dependency on GLFW.
For other demos, see:
- https://github.com/Armchair-Software/boids-webgpu-demo
- https://github.com/Armchair-Software/webgpu-shader-demo
- https://github.com/Armchair-Software/chatgpt-emscripten-demo
Live demo: https://armchair-software.github.io/webgpu-demo2/
This requires Firefox Nightly, or a recent version of Chrome or Chromium, with webgpu and Vulkan support explicitly enabled.
- Emscripten
- CMake
- VectorStorm (included)
- LogStorm (included)
- Emscripten Browser Clipboard (included)
- magic_enum (included)
- dear imgui with the proposed
imgui_impl_emscriptenbackend (included)
The easiest way to assemble everything (including in-tree shader resource assembly) is to use the included build script:
./build.shTo launch a local server and bring up a browser:
./run.shFor manual builds with CMake, and to adjust how the example is run locally, inspect the build.sh and run.sh scripts.
