There is currently no official way for using a custom WebGLTexture
object. The code at stackoverflow is considered as a hack since it accesses a private variable of the renderer.
The management of WebGLTexture
objects inside the renderer is not trivial since we want to share texture data whenever possible. So hacking in WebGL resources from outside is not something I would recommend since it bypasses internal optimizations. I would rather think about a new GLTexture
class (similar to GLBufferAttribute) that enables the usage of a custom WebGLTexture
object. But frankly I have a hard time to understand why it’s really necessary to use WebGLTexture
objects on app level. I tend to believe it’s better to not work with the raw WebGL context and migrate the code to three.js
entities instead.