I have a fairly complicated architecture where I am doing most of my stuff in Three.JS but I also have a special renderer that renders directly to a raw WebGL texture. Is it possible to use this WebGL texture in a three.js "Texture"? It looks like the Three.JS texture class is just a container for an image or video or canvas, and somewhere deep in the guts of three.js it will upload that to a real webgl texture. How can I just have Three.js render my WebGL texture onto a mesh?
相关问题
- debugging webgl in chrome
- Rotating an Object properly around a pivot point g
- SecurityError for same-origin image texImage2D
- Loading texture from Web Worker in Three.js
- My object isn't reflects the light in Three.js
相关文章
- Get size of Object3D in Three.js
- Change color of mesh using mouseover in three js
- THREE.Object3D.add: object not an instance of THRE
- How to get OpenGL version using Javascript?
- Why do I need to define a precision value in webgl
- Check a face is upwards/downwards towards mouse di
- How to change one texture image of a 3d model(maya
- Why do my three.js examples not load properly?
@Brendan's answer no longer works.
No idea when it changed and too lazy to go look it up but as of r102
as of r103
setTexture2D
no longer exists. You can use this insteadNote: There is no such thing as "unsupported behavior" in three.js. Three.js makes no guarantee that anything you are doing today will work tomorrow. Three.js breaks whatever it wants to whenever it wants to
This is completely unsupported behaviour, but you could imitate the WebGLRenderer and set the __webglTexture property on a Texture directly. e.g.
Again, this is completely unsupported and undefined behaviour and likely to break in future versions of three.js, but will likely work for the time being if you're after speed.
I'd instead suggest looking into WebGLRenderTarget if you can, or submitting a feature request to enable the feature correctly.