WebGPU is an API that exposes the capabilities of GPU hardware. As the name indicates, it’s primarily designed for the Web. However, it’s not only for the Web^1.
As the name indicates, the wgpugd package uses wgpu, a pure-Rust implementation of the WebGPU standard. wgpu is what’s behind the WebGPU support of Firefox and Deno, and is widely used over the Rust’s graphics ecosystem.
Yes! extendr is the Rust framework for interacting with R.
The main motivation is to add post-effect to graphics with WebGPU Shader Language (WGSL). But, of course, the power of GPU should simply contribute to high performance!
You can install the development version of wgpugd like so:
devtools::install_github("yutannihilation/wgpugd")
:warning: wgpugd is currently at its verrry early stage of the development! :warning:
library(wgpugd)
library(ggplot2)
file <- knitr::fig_path('.png')
wgpugd(file, 10, 10)
# ragg::agg_png(file, 10, 10, unit = "in")
set.seed(10)
dsamp <- diamonds[sample(nrow(diamonds), 1000), ]
ggplot(dsamp, aes(carat, price)) +
geom_point(aes(colour = clarity)) +
ggtitle("\( 'ω')/ウオオオオオオアアアアーーーーッッッ!!!!") +
theme(text = element_text(size = 30, family = "Noto Sans JP"))
dev.off()
#> png
#> 2
knitr::include_graphics(file)