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

Change u_Color to uint #1475

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

VReaperV
Copy link
Contributor

Picked from #1473.

u_Color was a vec4 that was being set from a Color object, which only has 8-bit precision per colour, so using up 4 times more memory than that to transfer it was quite atrocious. Instead, pack it into a uint32_t, then use unpackUnorm4x8() to unpack in the shader.

Also adds a macro for unpacking for hardware that doesn't support GL_ARB_gpu_shader5.

`u_Color` was a vec4 that was being set from a `Color` object, which only has 8-bit precision per colour, so using up 4 times more memory than that to transfer it was quite atrocious. Instead, pack it into a uint32_t, then use `unpackUnorm4x8()` to unpack in the shader.

Also adds a macro for unpacking for hardware that doesn't support `GL_ARB_gpu_shader5`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Renderer T-Improvement Improvement for an existing feature T-Performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant