Skip to content

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

Description

@bsansouci

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).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions