Skip to content

Can I create instance of Image struct with Rg32float texture? #13363

Answered by JMS55
vino-volare asked this question in Q&A
Discussion options

You must be logged in to vote

For one pixel of an Rg32Float texture, it'll be 8 bytes. 4 bytes for the R channel, and another 4 bytes for the G channel. So you should convert your [f32; 2] into [u8; 8]. You can use crates like bytemuck to perform the cast.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@vino-volare
Comment options

Answer selected by JMS55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants