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

Fix mesh casting color components incorrectly #8807

Merged
merged 3 commits into from
Jan 27, 2025

Conversation

Wumpf
Copy link
Member

@Wumpf Wumpf commented Jan 24, 2025

Messed up the swizzling of colors when doing to aggressive bytemuck slice casts. Causing this
image

This pr gets us back to
image


What did we re-learn today that we knew all along but didn't pay attention to?

Our user facing API says The color is stored as a 32-bit integer, where the most significant byte is Rand the least significant byte isA. - which allows you to write 0xFF00FFFF for a beautiful magenta and is what everyone is used to. But written as an array this is [a, b, g, r] because most of the world is little endian and that means that the least significant byte (alpha!) comes first. But in rendering (that includes re_renderer & egui) everything is [r,g,b,a]!

@Wumpf Wumpf added 🦟 regression A thing that used to work in an earlier release exclude from changelog PRs with this won't show up in CHANGELOG.md labels Jan 24, 2025
Copy link

github-actions bot commented Jan 24, 2025

Web viewer built successfully. If applicable, you should also test it:

  • I have tested the web viewer
Result Commit Link Manifest
331a4f1 https://rerun.io/viewer/pr/8807 +nightly +main

Note: This comment is updated whenever you push a commit.

@Wumpf Wumpf changed the title Fix incorrect conversion of color components to re_renderer colors Fix mesh casting color components incorrectly Jan 24, 2025
@Wumpf Wumpf merged commit 486d662 into main Jan 27, 2025
31 checks passed
@Wumpf Wumpf deleted the andreas/fix-incorrecet-vertex-color-interpretation branch January 27, 2025 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exclude from changelog PRs with this won't show up in CHANGELOG.md 🦟 regression A thing that used to work in an earlier release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants