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

Vector is in backwards order from what gl.readPixels returns #3

Open
jes5199 opened this issue Feb 6, 2017 · 0 comments
Open

Vector is in backwards order from what gl.readPixels returns #3

jes5199 opened this issue Feb 6, 2017 · 0 comments

Comments

@jes5199
Copy link

jes5199 commented Feb 6, 2017

Hey, thank you for sharing this code, it's a big help.

I noticed that if you reverse the order that you're storing bytes in encode_float, (e.g., wzyx isntead of xyzw) then you can use the results from readPixels directly, like so:

buffer = new ArrayBuffer(width * height * 4);
floats = new Float32Array(buffer);
bytes = new Uint8Array(buffer);
gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, bytes);
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

1 participant