Published
Edited
Mar 28, 2022
2 forks
15 stars
Also listed in…
Hello
Insert cell
Insert cell
html`${video}${kernel.canvas}`
Insert cell
video = html`<video src="https://upload.wikimedia.org/wikipedia/commons/e/ec/Jellyfish_in_Vr%C3%A5ngo.webm" controls width="337" height="599" crossorigin="anonymous" loop autoplay style="float:left"></video>`
Insert cell
GPU = require("gpu.js@2.15.2")
Insert cell
gpu = new GPU.GPU({ mode: 'webgl2' })
Insert cell
kernel = gpu.createKernel(
function(frame) {
const pixel =
frame[this.output.y - this.thread.y][this.output.x - this.thread.x];
this.color(pixel.b, pixel.g, pixel.r, pixel.a);
},
{
output: [337, 599],
graphical: true
}
)
Insert cell
{
while (true) {
kernel(video);
yield;
}
}
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more