-
Notifications
You must be signed in to change notification settings - Fork 163
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
[Feature Request] Uint8Array as a Texture #300
Comments
Alrighty, after finally figuring this out and anyone like me poking around how to do this. You'll want to use a library called NDArray and set it up as And for a few keywords for anyone googling this problem: putImageData, Uint8Array, imageData |
Actually, gonna reopen this since it could use further documentation. |
👍 btw i think it's [height,width,4] with NDArray, but well it depends how your data is aligned indeed. |
It'd be great if there was an example showing how to use the Uint8Array to make a data texture, perhaps something to the effect of this tutorial? https://webglfundamentals.org/webgl/lessons/webgl-qna-how-to-get-audio-data-into-a-shader.html |
@Lemon-King did you use ndarray node module for this? I've tried to use Edit: oh I am using reactjs also not native. |
I had a Node with an OnDraw event which I used to capture the NDArray when there was a draw event. This will return the NDArray from the node, from there you may have to flip it as it'll be in opengl uv space.
|
Hi I have a feature request,
I'm unable to utilize a Uint8Array as a source for a texture. Having this would be a flexible feature for some projects utilizing raw image data arrays both web and native.
For reference I'm using gl-react on react-native.
The text was updated successfully, but these errors were encountered: