Crates.io | re_renderer |
lib.rs | re_renderer |
version | 0.21.0-alpha.1 |
source | src |
created_at | 2023-02-12 21:16:14.57577 |
updated_at | 2024-12-11 14:50:18.488515 |
description | A wgpu based renderer for all your visualization needs. |
homepage | https://rerun.io |
repository | https://github.com/rerun-io/rerun |
max_upload_size | |
id | 783511 |
size | 824,009 |
Part of the rerun
family of crates.
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:
Goals & philosophy:
Handle fully dynamic data
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
In debug mode shaders are live-reloaded. If a failure occurs during live-reload, an error is logged and the previous shader is kept.
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