WebGPU tech demo showcasing various rendering techniques.
A WebGPU deferred rendering playground written as a personal project to familiarize myself better with the API and explore various rendering techniques. As WebGPU is still considered experimental browser technology certain things might break for you.
Check out the accompanying frame analysis article here.
- glTF loading and parsing
- Physically based shading
- Cascaded shadow mapping (2 cascades)
- Deferred Renderer (3 MRT) with culled light volumes using a stencil buffer
- 400+ dynamic light sources moved in a compute shader
- Separate forward pass for alpha masked objects (foliage)
- SSAO
- Screen Space Reflections with the ability to switch between Hi-Z and Linear raymarching
- Physically based bloom
- Temporal Anti-Aliasing (TAA)
- UI controls to tweak various different rendering parameters
- Dynamic performance degradation if the framerate dips below 60fps for longer than 2 seconds
- Mobile support
WebGPU is still considered experimental technology and might not be implemented in the version of your browser of choice. Please refer to the WebGPU Implementation Status for more info.
- @loaders.gl/gltf - Loading and parsing the glTF Sponza file
- webgpu-utils - Random useful things for WebGPU
- wgpu-matrix - Fast 3d math library for webgpu
- wgsl-preprocessor - Adds simple preprocessor macros to your WGSL shader
- hdr.js - RGBE(.hdr) file reader/writer
- WebGPU Shadow Playground
- WebGPU Clustered Forward Shading
- SSAO
- Screen Space Reflections: Implementation and optimization – HI-Z Tracing Method
- Temporal Anti-Aliasing(TAA) Tutorial
- Physically Based Bloom
- Cascaded Shadow Mapping
- Satin - A 3D Graphics Framework built on Apple's Metal
- WebGPU Spec
- WGSL Spec
- Clone the repo locally
npm i
npm run dev
Copyright (c) 2024 Georgi Nikolov
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial
portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.