Skip to content

Armchair-Software/webgpu-demo2

Repository files navigation

CI Build

WebGPU Emscripten demo 2 for the Armchair Engine

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.

image

For other demos, see:

Live 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.

Dependencies

Building

The easiest way to assemble everything (including in-tree shader resource assembly) is to use the included build script:

./build.sh

To launch a local server and bring up a browser:

./run.sh

For manual builds with CMake, and to adjust how the example is run locally, inspect the build.sh and run.sh scripts.

About

A demo using WebGPU with Emscripten and ImGUI

Resources

License

Stars

Watchers

Forks