Skip to content

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

Open
@jes5199

Description

@jes5199

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

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