| Crates.io | xdl-viz3d |
| lib.rs | xdl-viz3d |
| version | 0.1.1 |
| created_at | 2025-12-31 19:08:19.924813+00 |
| updated_at | 2025-12-31 22:59:54.160588+00 |
| description | High-fidelity 3D visualization for scientific simulations using WebGPU |
| homepage | https://turingworks.github.io/xdl |
| repository | https://github.com/turingworks/xdl |
| max_upload_size | |
| id | 2015153 |
| size | 126,443 |
High-fidelity 3D visualization engine for scientific simulations using WebGPU.
; rayleigh_taylor.xdl - Create and visualize 3D volume data
; Create 3D volume
size = 64
density = FLTARR(size, size, size)
; Fill with data
FOR i=0, size-1 DO FOR j=0, size-1 DO FOR k=0, size-1 DO $
density[i,j,k] = EXP(-((i-32)^2 + (j-32)^2 + (k-32)^2) / 400.0)
; Initialize and render
VIZ3D_INIT, WINDOW_SIZE=[1280, 720]
VIZ3D_COLORMAP, 'VIRIDIS'
VIZ3D_VOLUME, density, DIMENSIONS=[size, size, size]
VIZ3D_RENDER, /INTERACTIVE
# From XDL project root
xdl examples/demo/volume_render_simple.xdl
# Or the full Rayleigh-Taylor simulation
xdl examples/demo/rayleigh_taylor.xdl
XDL Script (.xdl)
↓
xdl-stdlib (VIZ3D_* functions)
↓
xdl-viz3d (Rust rendering engine)
↓
wgpu (WebGPU abstraction)
↓
GPU (Metal/Vulkan/DX12/WebGPU)
VIZ3D_INIT - Initialize visualization systemVIZ3D_VOLUME - Upload volume data to GPUVIZ3D_RENDER - Render current volumeVIZ3D_COLORMAP - Set colormapVIZ3D_CAMERA - Configure cameraVIZ3D_TRANSFER - Set transfer functionVIZ3D_ISOSURFACE - Extract and render isosurfaceSee docs/VIZ3D_IMPLEMENTATION.md for full API documentation.
examples/demo/volume_render_simple.xdl - Basic Gaussian blob
examples/demo/rayleigh_taylor.xdl - Full fluid dynamics simulation
# Build the crate
cargo build --release -p xdl-viz3d
# Run tests
cargo test -p xdl-viz3d
# Build for WebAssembly
cargo build --target wasm32-unknown-unknown --release -p xdl-viz3d
See TODO list for remaining work.
Expected performance on modern GPUs:
| Grid Size | Frame Rate | Memory |
|---|---|---|
| 64³ | 60+ FPS | ~10 MB |
| 128³ | 60 FPS | ~50 MB |
| 256³ | 30 FPS | ~200 MB |
| 512³ | 15 FPS | ~1 GB |
wgpu - GPU abstraction layerwinit - Cross-platform windowingglam - Linear algebrabytemuck - Safe GPU data castingSee main XDL project Contributing section.
GPL-2.0 (same as XDL project)