156 releases (18 breaking)

new 0.20.3 Dec 3, 2024
0.20.2 Nov 28, 2024
0.19.1 Nov 5, 2024
0.17.0 Jul 8, 2024
0.4.0 Mar 28, 2023

#218 in Graphics APIs

Download history 2484/week @ 2024-08-14 1873/week @ 2024-08-21 2446/week @ 2024-08-28 2225/week @ 2024-09-04 1945/week @ 2024-09-11 1747/week @ 2024-09-18 2710/week @ 2024-09-25 2529/week @ 2024-10-02 2764/week @ 2024-10-09 3222/week @ 2024-10-16 1805/week @ 2024-10-23 3195/week @ 2024-10-30 2542/week @ 2024-11-06 4366/week @ 2024-11-13 2729/week @ 2024-11-20 2559/week @ 2024-11-27

12,712 downloads per month
Used in 26 crates (15 directly)

MIT/Apache

1MB
18K SLoC

The Rerun renderer

Part of the rerun family of crates.

Latest version Documentation MIT Apache

A custom wgpu based renderer tailored towards re_viewer's needs. Nevertheless, it can be used standalone and comes with its own examples!

Some key features:

  • Key primitives for visualization like lines and points are first class citizens
  • Built with multiple independent views/cameras in mind
  • WebGL compatible quality tier allows use in the browser without WebGPU support
  • Hot shader reloading
  • … and more to come!

Goals & philosophy:

  • Handle fully dynamic data
    • assumes that most data may change every frame!
  • Automatic resource re-use & caching
  • Lazy loading whenever possible for best startup performance
  • Run great both on the desktop and web
  • No dependencies on re_viewer or Rerun chunk store libraries

Debugging

Shader

Iterating

In debug mode shaders are live-reloaded. If a failure occurs during live-reload, an error is logged and the previous shader is kept.

Inspecting final source

If RERUN_WGSL_SHADER_DUMP_PATH is set, all readily stitched (import resolve) and patched wgsl shaders will be written to the specified directory.

Often you're also interested in the Naga translated shader. This can be done easily from command line using

cargo install naga-cli --all-features

Example for translating a wgsl fragment shader to GL as used on WebGL:

naga ./wgsl_dump/rectangle_fs.wgsl ./wgsl_dump/rectangle_fs.frag --entry-point fs_main --profile es300

Example for translating a wgsl vertex shader to GL as used on WebGL:

naga ./wgsl_dump/rectangle_vs.wgsl ./wgsl_dump/rectangle_vs.vert --entry-point vs_main --profile es300

Note that a single shader entry point from wgsl maps to a single frag/vert file!

Example for translating a wgsl to MSL as used on MacOS. Note that a single metal file maps to a single wgsl file.

naga ./wgsl_dump/rectangle_fs.wgsl ./wgsl_dump/rectangle_fs.metal

Dependencies

~22–54MB
~1M SLoC