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

Add packing expression functions #261

Merged
merged 1 commit into from
Dec 2, 2023
Merged

Add packing expression functions #261

merged 1 commit into from
Dec 2, 2023

Conversation

djeedai
Copy link
Owner

@djeedai djeedai commented Dec 2, 2023

Add some new packing and unpacking expression functions corresponding to the WGSL functions pack4x8snorm, pack4x8unorm, and their unpack equivalent. Those are very commonly used to convert between low definition u32 color 0xAABBGGRR and high-definition vec4<f32> color.

Update the billboard.rs example to use those new expressions to store a per-particle color initialized randomly on spawn.

Bug: #259

Add some new packing and unpacking expression functions corresponding to
the WGSL functions `pack4x8snorm`, `pack4x8unorm`, and their unpack
equivalent. Those are very commonly used to convert between low
definition `u32` color 0xAABBGGRR and high-definition `vec4<f32>` color.

Update the `billboard.rs` example to use those new expressions to store
a per-particle color initialized randomly on spawn.

Bug: #259
@djeedai djeedai added C - enhancement New feature or request A - examples Change related to examples A - expressions Change related to the Expression API labels Dec 2, 2023
@djeedai djeedai merged commit 15d8a35 into main Dec 2, 2023
12 of 13 checks passed
@djeedai djeedai deleted the u/pack-expr branch December 2, 2023 13:40
@djeedai djeedai restored the u/pack-expr branch December 22, 2023 12:11
@djeedai djeedai deleted the u/pack-expr branch December 22, 2023 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A - examples Change related to examples A - expressions Change related to the Expression API C - enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant