Note (8/31/2021): these have fallen a bit out of date with WebGPU API changes coming up to the final release. I haven't had time to update them yet, but will update this repo when I've done so.
A series of examples written while learning about WebGPU: a glTF viewer, a web-based LiDAR viewer, and a data-parallel Marching Cubes implementation using compute shaders. The glTF viewer uses a custom glb importer to load data efficiently into WebGPU and supports the basic glTF features. The LiDAR viewer uses LAStools.js, a version of libLAS compiled to Web Assembly, to load las and laz files directly in the browser. The Marching Cubes example is a data-parallel implementation of marching cubes written using compute shaders to leverage GPU compute for interactive isosurface extraction. If you have a browser with WebGPU enabled, you can try them out: glTF Viewer, LiDAR Viewer, Marching Cubes.
Basic demos of rendering a triangle, or generating one and the draw calls in a compute shader.
This project has been updated and split out into its own repo: https://github.com/Twinklebear/webgpu-gltf
A binary glTF viewer supporting static scenes with multi-level instancing, different materials, and textures.
Marching Cubes Try it out!
A data-parallel implementation of Marching Cubes using compute shaders. Note that as of 5/7/2020 some functionality (3D texture uploads) is not implemented in WebGPU which would make this easier to implement or include some other features (e.g., sampling the volume, adding volume rendering),
LiDAR Viewer Try it out!
A viewer for las/laz files. Uses LASTools.js
to load las/laz files directly in the browser, and renders them as instanced billboard quads.
To run this demo, download the LASTools.js release (liblas.js, liblas.wasm, liblas_wrapper.js)
and place them under js/
.