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

Texture does not work #45

Closed
whatisor opened this issue Dec 21, 2015 · 1 comment
Closed

Texture does not work #45

whatisor opened this issue Dec 21, 2015 · 1 comment
Labels

Comments

@whatisor
Copy link

Texture does not work without any error logging.
I use data from this :
//create image data

var canvas = document.createElement('canvas'),
ctx = canvas.getContext('2d');
ctx.drawImage(image, 0, 0);

                //now we can finally get a Uint8ClampedArray
                var imageData = ctx.getImageData(0, 0, image.width, image.height);
            image =  imageData;

Then pass image to texImage2D

@mikolalysenko
Copy link
Member

headless-gl doesn't support image data or implement the canvas 2D API. If you want to use a texture, you'll need to unpack the pixels into a typedarray and initialize it manually.

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

No branches or pull requests

2 participants