Skip to content
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

Use WebGLTexture texture directly #2906

Closed
YousefED opened this issue Oct 6, 2017 · 1 comment
Closed

Use WebGLTexture texture directly #2906

YousefED opened this issue Oct 6, 2017 · 1 comment

Comments

@YousefED
Copy link

YousefED commented Oct 6, 2017

If we have a handle to a webgltexture, is there an option to use it directly as a material / babylon texture?

I'm trying to accomplish something similar to the example here: mrdoob/three.js#5230

Thanks!

@deltakosh
Copy link
Contributor

Hello you can create a RawTexture and the do this:

myTexture._texture = myHandleToWebGLTexture

Here is how to create a RawTexture:

var myTexture = BABYLON.RawTexture.CreateRGBATexture(new Uint8Array(4), 1, 1, scene)

obviously this will generate a 1x1 texture. for a bigger one do not forget to change the size of the UInt8Array :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants