Skip to content

kylc/egui_wgpu_plot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

egui_wgpu_plot

Experiments in rendering 2D line plots in egui directly on the GPU with minimal copying.

Demo

cargo run --release --example lorenz
output.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 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.

About

Experiments in 2D plotting on the GPU with egui

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published