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

vk: Use VK_FORMAT_R8G8B8A8_UNORM for vertex colors #1690

Merged
merged 1 commit into from
Oct 13, 2024

Conversation

Wunkolo
Copy link
Contributor

@Wunkolo Wunkolo commented Oct 12, 2024

Rather than using VK_FORMAT_R8G8B8A8_UINT for these vertex attributes and then dividing by 255.0 in each of the shaders, the VK_FORMAT_R8G8B8A8_UNORM format will automatically remap byte components into the 0.0-1.0 range and removes the need to do the extra divisions or castings within the shader.

Rather than using `VK_FORMAT_R8G8B8A8_UINT` for these vertex attributes and then dividing by `255.0` in each of the shaders, the `VK_FORMAT_R8G8B8A8_UNORM` format will automatically remap byte components into the `0.0-1.0` range and removes the need to do the extra divisions or castings within the shader.
@flyinghead flyinghead merged commit 8f74f78 into flyinghead:master Oct 13, 2024
14 of 15 checks passed
@Wunkolo Wunkolo deleted the vk-unorm-vertex-color branch October 13, 2024 21:21
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

Successfully merging this pull request may close these issues.

2 participants