Replies: 4 comments
-
Sorry for the late reply. I should really make a simple function for doing that so it's easier to do, but it does only require 3 lines of code. You need to create RawAssets manually and insert the PNG bytes, then you can deserialize it as if you loaded the image. See the documentation of the insert method here: https://docs.rs/three-d-asset/latest/three_d_asset/io/struct.RawAssets.html#method.insert |
Beta Was this translation helpful? Give feedback.
-
Thanks! This is what I did, but it felt a bit unnatural to do so. |
Beta Was this translation helpful? Give feedback.
-
Yeah, I know. It's because one 3D model file often consist of several files (geometry, material, textures etc.) so we need everything loaded before we can deserialize. There is probably a better design, but well, this was the best I could think of. I've added a |
Beta Was this translation helpful? Give feedback.
-
Thanks for the function. However, when embedding resources using |
Beta Was this translation helpful? Give feedback.
-
Hi!
I am embedding a PNG file in my Rust executable using the
include_bytes!()
macro. Is there a recommended way to load it into a three-d texture?Thanks.
Beta Was this translation helpful? Give feedback.
All reactions