three.js helper to handle dynamically generated texture.