Skip to content

Instantly share code, notes, and snippets.

@velenoise
velenoise / upload-texture.js
Last active January 31, 2017 23:14 — forked from mattdesl/upload-texture.js
immediate texture upload for threejs
/*
Uploads to GPU immediately when the image is ready, then fires callback.
//takes a string path or image/canvas/video/ImageData
uploadTexture(renderer, pathOrImage, function(err, texture) {
if (err) console.error(err)
//do something with the ThreeJS 'texture' result
})
*/
var THREE = require('three');