All Projects → brendan-duncan → webgpu_recorder

brendan-duncan / webgpu_recorder

Licence: MIT License
WebGPU debugging tool for recording and playing back of WebGPU commands.

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Labels

Projects that are alternatives of or similar to webgpu recorder

webgpu-cca
Experiment implementation of Multiple Neighborhoods Cellular Automata using WebGPU
Stars: ✭ 31 (+106.67%)
Mutual labels:  webgpu
zig-gamedev
Building game development ecosystem for @ziglang!
Stars: ✭ 1,059 (+6960%)
Mutual labels:  webgpu
deno desktop
Windowing support for Deno WebGPU.
Stars: ✭ 49 (+226.67%)
Mutual labels:  webgpu
online-wgsl-editor
A tiny WGSL online editor
Stars: ✭ 128 (+753.33%)
Mutual labels:  webgpu
foxtrot
A fast, experimental STEP file viewer
Stars: ✭ 151 (+906.67%)
Mutual labels:  webgpu
redcube
JS renderer based on GLTF to WebGPU or WebGL backends.
Stars: ✭ 86 (+473.33%)
Mutual labels:  webgpu
WebGPU-Step-By-Step
WebGPU Tutorial: Step-by-step graphics programming with WebGPU - the next-generation graphics API for the web.
Stars: ✭ 232 (+1446.67%)
Mutual labels:  webgpu
rendiation
Rendiation Rendering Framework
Stars: ✭ 31 (+106.67%)
Mutual labels:  webgpu
KTX-Parse
KTX 2.0 (.ktx2) parser and serializer.
Stars: ✭ 23 (+53.33%)
Mutual labels:  webgpu
wonnx
A GPU-accelerated ONNX inference run-time written 100% in Rust, ready for the web
Stars: ✭ 160 (+966.67%)
Mutual labels:  webgpu
webgpu
WebGPU Samples & RnD
Stars: ✭ 72 (+380%)
Mutual labels:  webgpu
hecs
An experimental ECS written in Javascript.
Stars: ✭ 16 (+6.67%)
Mutual labels:  webgpu
THREE.WebGPURenderer
Experimental Three.js WebGPU renderer
Stars: ✭ 117 (+680%)
Mutual labels:  webgpu
vscode-wgsl
VsCode Syntax highlight for WGSL files
Stars: ✭ 55 (+266.67%)
Mutual labels:  webgpu
ossos
Webbased Character Animation System
Stars: ✭ 158 (+953.33%)
Mutual labels:  webgpu
RASM
3D Ray-Tracing WebGPU Game Engine Written in Rust WebAssembly.
Stars: ✭ 20 (+33.33%)
Mutual labels:  webgpu
sandbox
A sand simulation game
Stars: ✭ 189 (+1160%)
Mutual labels:  webgpu
webgpufundamentals
webgpufundamentals.org
Stars: ✭ 56 (+273.33%)
Mutual labels:  webgpu
webgpu-trial
WebGPU trial
Stars: ✭ 48 (+220%)
Mutual labels:  webgpu
webgpu-seed
🔺🌱 An example on how to render a hello triangle with WebGPU.
Stars: ✭ 178 (+1086.67%)
Mutual labels:  webgpu

WebGPU Recorder

WebGPU Recorder is a debugging tool for WebGPU.

It is a playback recorder, designed to capture all WebGPU commands and data, with the ability to play back the commands to recreate the render.

It captures all WebGPU commands, buffers, and textures, over a given number of frames. It will then generate an HTML file containing javascript with all of the WebGPU commands recorded. This generated HTML file can be opened in the browser to play back the recording.

This can be used to diagnose issues with WebGPU rendering by eliminating everything but the raw WebGPU commands. This is also very helpful for submitting self-contained reproduction examples for bug reports.

Usage

Load From CDN

You can load the script through a CDN so you don't have to store it locally and make sure you're always using the latest version of the recorder.

<script src="https://cdn.jsdelivr.net/gh/brendan-duncan/webgpu_recorder/webgpu_recorder.js"></script>

Load From Local Script Reference

If you prefer to host your own version, copy the script to your project and load it by adding the following to your project's HTML.

<script src="webgpu_recorder.js"></script>

Start The Recorder

Once the recorder script has been loaded in your app, you can instantiate the recorder by using the following:

<script>
    new WebGPURecorder();
</script>

Because the recorder needs to record all commands and data, it starts recording as soon as it is contructed, and will continue recording for the maximum number of frames. The recorder should be created before any rendering code starts so it has a chance to wrap WebGPU.

The recording will download automatically as an HTML file with embedded Javascript after the maximum number of frames have been recorded.

You can optionally configure the recorder

<script>
    new WebGPURecorder({
        "frames": 100,
        "export": "WebGPURecord",
        "width": 800,
        "height": 600
    });
</script>

Where

  • frames is the maximum number of frames to record.
  • export is the basename of the generated HTML file.
  • width is the width of the canvas in the recording. This should match the width of the original canvas.
  • height is the height of the canvas in the recording. This should match the height of the original canvas.

Play The Recording

The recording is a self-contained HTML file so you don't need a local server to view it.

Open the downloaded HTML file in a WebGPU capable browser to play back the recording.


A recording from a WebGPU game:

Recording Screenshot Recording Code


Notes

It is necessary to start the recorder prior to rendering so that all WebGPU objects are correctly recorded.

It is best suited for small tests, as the recorded data can get quite large.

All buffer and texture data is stored in the recording. The recording stores the data in base64 format to reduce file size, but it can still make the recording files large.

External textures in WebGPU can't be captured. copyExternalImageToTexture will get converted to writeTexture in the recording, with the external image data getting converted to raw data.

External video textures can't currently be recorded.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].