Can I create instance of Image struct with Rg32float texture? #13363
-
Hi! I'm learning how to work with custom material in bevy. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
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. |
Beta Was this translation helpful? Give feedback.
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.