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 some arcane magic to pack the vertex data more tightly #119

Open
bsansouci opened this issue Oct 2, 2018 · 0 comments
Open

Use some arcane magic to pack the vertex data more tightly #119

bsansouci opened this issue Oct 2, 2018 · 0 comments

Comments

@bsansouci
Copy link
Collaborator

Right now we are transforming our RGBA colors to floats and sending those to the GPU. That's a total of 16 bytes, but the precision of the colors based on the API is really just 0 to 255, so we should be able to only use 4 bytes instead.
To do that we'd have to write some C code to cast the bigarray to an array of char and set the rgba.
In JS we should be able to call setUInt8 (something like this https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setInt8).

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