Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kylc/egui_wgpu_plot
Experiments in 2D plotting on the GPU with egui
https://github.com/kylc/egui_wgpu_plot
egui gpu
Last synced: about 2 months ago
JSON representation
Experiments in 2D plotting on the GPU with egui
- Host: GitHub
- URL: https://github.com/kylc/egui_wgpu_plot
- Owner: kylc
- Created: 2022-09-24T22:32:26.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2022-09-24T22:45:11.000Z (about 2 years ago)
- Last Synced: 2024-08-02T12:23:09.130Z (5 months ago)
- Topics: egui, gpu
- Language: Rust
- Homepage:
- Size: 20.5 KB
- Stars: 20
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-egui - egui_wgpu_plot
README
# egui_wgpu_plot
Experiments in rendering 2D line plots in egui directly on the GPU with minimal
copying.## Demo
cargo run --release --example lorenz
https://user-images.githubusercontent.com/233860/192120927-0761b56c-a50e-4ee9-a7ab-147b3b3c04e0.mp4
## Theory
In order to achieve realtime rendering performance on large datasets (1M+
points), the transformation from data-space to screen-space is performed on the
GPU. This means that GPU vertex buffers are only updated if the data changes,
not when the view is panned or zoomed.In order to draw nice-looking lines, the approach described in [Drawing
Antialiased Lines with OpenGL][1] is used. Duplicate vertices are provided to
the GPU, one with each normal vector of the line at that point. This is provided
to the shader as a triangle strip, which then offsets the vertices along their
normals to add line width and feathers the edge for anti-aliasing.![](https://miro.medium.com/max/640/0*8ZZJdx9kleLSsT_Z.png)
[1]: https://blog.mapbox.com/drawing-antialiased-lines-with-opengl-8766f34192dc