I have a resource/material that accepts an image handle. Usually, this image is generated, but I want to support cases where users provide an image from a file. However, the image is supposed to have "dimension: Cube", instead of "dimension: D2". How do I set a handler that can check if the image is loaded and set the metadata to be correct, before the image is used by the material and it encounters this error (image being the wrong dimension)?
#Image Asset Preprocessing
17 messages · Page 1 of 1 (latest)
Hello!
lol
I think there may be a way to deal with this
Could this be because the FallbackImage is TextureDimension::D2?
Could you use correctly setup "fallback" until they load their image? Then try to use the reinterpret_stacked_2d_as_array() if they supply a D2 image, or pass along if it's already cube?
Maybe, but I think it's because if I try to change the image too early, it gives me an error that it's not loaded. Then, once it loads it breaks.
So maybe I have to fix both.
Or actually, it may not be reinterpret_stacked_2d_as_array that you want to use. But rather just change out the descriptor.
Yeah, that's what I tried. but the image isn't loaded yet
Well, you have to wait for it to load, and put something in place until then
I think I might just wait till Bevy has a way to specify a loader or callback. It's a pain to add a system that checks for it.
Yeah, that seems overkill for a one time thing
Maybe since cart is working on asset stuff now we'll get something for 0.10