threers 0.0.2

Drop-in three.js replacement for Rust and WebAssembly (wgpu) — THREE.* API, scene graph, PBR, post-fx, mesh BVH, CSG, headless render, and native media codecs
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use super::Texture;

/// Convenience constructor for textures populated with raw bytes (no decoder).
/// Mirrors three.js's `DataTexture`.
pub struct DataTexture;

impl DataTexture {
    pub fn new(width: u32, height: u32, format: super::TextureFormat, data: Vec<u8>) -> Texture {
        let mut t = Texture::new(width, height, format, data);
        // DataTextures default to no flip — matches three.js.
        t.flip_y = false;
        t
    }
}