| Crates.io | wgpu-3dgs-viewer |
| lib.rs | wgpu-3dgs-viewer |
| version | 0.4.0 |
| created_at | 2025-02-27 05:15:39.172011+00 |
| updated_at | 2025-09-20 04:22:15.521264+00 |
| description | A 3D Gaussian splatting viewing library written in Rust using wgpu. |
| homepage | https://github.com/LioQing/wgpu-3dgs-viewer |
| repository | https://github.com/LioQing/wgpu-3dgs-viewer |
| max_upload_size | |
| id | 1571323 |
| size | 356,775 |
...written in Rust using wgpu.

[!WARNING]
This library is under active development, breaking API changes between versions may occur frequently.
Use at your own risk.
This library displays 3D Gaussian Splatting models with wgpu. It includes a ready‑to‑use pipeline and modular pieces you can swap out.
You may read the documentation of the following types for more details:
Viewer]: Manages buffers and renders a model.
Preprocessor]: Culls Gaussians and fills indirect args and depths.RadixSorter]: Sorts Gaussians by depth on the GPU.Renderer]: Draws Gaussians with the selected display mode.MultiModelViewer]: [Viewer] equivalent for multiple models. Requires multi-model feature.selection]: Select Gaussians based on viewport interactions, e.g. rectangle or brush. Requires selection feature.[!TIP]
The design principles of this crate are to provide modularity and flexibility to the end user of the API, which means exposing low-level WebGPU APIs. However, this means that you have to take care of your code when accessing low-level components. You risk breaking things at run-time if you don't handle them properly.
If you do not want to take the risk, consider using the higher-level wrappers and avoid any instances of passing
wgputypes into functions.
You can use [Viewer] to render a single 3D Gaussian Splatting model:
use wgpu_3dgs_viewer as gs;
use glam::UVec2;
// Setup wgpu...
// Read the Gaussians from the .ply file
let f = std::fs::File::open(model_path).expect("ply file");
let mut reader = std::io::BufReader::new(f);
let gaussians = gs::core::Gaussians::read_ply(&mut reader).expect("gaussians");
// Create the camera
let camera = gs::Camera::new(0.1..1e4, 60f32.to_radians());
// Create the viewer
let mut viewer = gs::Viewer::new(&device, config.view_formats[0], &gaussians).expect("viewer");
// Setup camera parameters...
// Update the viewer's camera buffer
viewer.update_camera(
&queue,
&camera,
UVec2::new(config.width, config.height),
);
// Create wgpu command encoder...
// Render the model
viewer.render(
&mut encoder,
&texture_view,
gaussians.gaussians.len() as u32,
);
See the examples directory for usage examples.
This crate depends on the following crates:
wgpu-3dgs-viewer |
wgpu |
glam |
wesl |
|---|---|---|---|
| 0.4 | 26.0 | 0.30 | 0.2 |
| 0.3 | 25.0 | 0.30 | N/A |
| 0.1 - 0.2 | 24.0 | 0.29 | N/A |
This crate uses modified code from KeKsBoTer's wgpu_sort.
References are also taken from other 3D Gaussian splatting renderer implemntations, including antimatter15's splat, KeKsBoTer's web-splat, and Aras' Unity Gaussian Splatting.