An extremely fast pixel framebuffer using webgl via ThreeJS
Why is this fast?
Rendering literally just takes subview of wasm's memory and pushes it to the GPU via webgl to be rendered by an uber minimal shader for particles.
see the demo here
```html
```
see the demo here
toml
[dependencies]
hyperpixel = "0.1"
web_timer = "0.0.2" # for interacting with timing functions in browser
rand = "0.7.2" # for getting a psuedo random number generator
js_ffi = "0.1" # for creating the callback that gets sent into web_timer's `request_animation_loop`
```rust
use hyperpixel::;
use rand::rngs::StdRng;
use rand::Rng;
use rand::SeedableRng;
use web_timer::;
use js_ffi::*;
pub fn main() -> () {
let timer = Timer::default();
let mut rng:StdRng = SeedableRng::fromseed([
1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2,
3, 4,
]);
let framebuffer = HyperPixel::new("#screen");
let (width,height) = framebuffer.dimensions()
let mut pixels = vec![0.0f32; width * height * 3];
timer.requestanimationloop(createcallback1(Box::new(move |delta_time| {
for i in 0..pixels.len() {
pixels[i] = rng.gen::
This project is licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in hyperpixel
by you, as defined in the Apache-2.0 license, shall be
dual licensed as above, without any additional terms or conditions.