-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using native WebGLTexture as a RawShaderMaterial uniform #5230
Comments
Ops, I just found a way : var texture = new THREE.Texture();
texture.__webglInit = true;
texture.__webglTexture = myWebGLNativeTexture; Is there anything wrong with this workaround? |
Hmmm, what's wrong is that there isn't a better API for it :P |
Maybe we can do some sort of |
Yes, a THREE.WebGLTexture would be great, but is not as easy as I thought.. there are some issues when using this approach, while another Three geometry is at the viewport, the webglTexture seems like removed from the material :( I think this should be because the texture slot of the webGLTexture is static and the engine doesn't know nothing about it so probably is overriding it. I still looking for a good approach to solve this and being able to use our GPU stuff within Three.js without issues :) |
I'd like to put in a vote for a variety of Texture that uses a WebGLTexture as the source image. It would be much more flexible than passing it directly to a RawShaderMaterial because you'd still be able to use the Texture as a source for other kinds of material. |
Is there any progress on this issue? |
This seems to work in r85: var texture = new THREE.Texture();
var properties = renderer.properties.get( texture );
properties.__webglTexture = myWebGLNativeTexture;
properties.__webglInit = true; |
Duplicate of #17766. |
Do you have any clue for passing a native WebGLTexture to one Shader in a Three material?
We are sharing the Three gl context to do a series of calculations and stuff on the GPU, but the main purpose is to render the final data with three, so I need to put my output texture (WebGLTexture) as a Sampler2D uniform in a THREE.RawShaderMaterial. I don't know if this is possible using the available API of the engine.
Thanks in advance and keep up the great work!
The text was updated successfully, but these errors were encountered: