Closed alice-i-cecile closed 9 months ago
I started implementing a screen with render-to-texture on UI Images and it wasn't working right and I found this issue. At some point, I realized what I was doing wrong and got it working for my use case so I tried to see if I could reproduce the issues you wrote here on 0.11, but it seems to be working for me.
When I first tried it, all I saw was white I think because of the size of the window I had it running in, so I setup the image to take up less space so I could see it:
commands.spawn(ImageBundle {
style: Style {
width: Val::Percent(25.),
height: Val::Percent(50.),
..default()
},
image: UiImage {
texture: image_handle,
..default()
},
..default()
});
https://github.com/bevyengine/bevy/assets/1421719/8a355f38-4092-4a54-9ca4-ff7d5c6c0799
At this point I needed to add the UiCameraConfig to make the camera ignore the image node
UiCameraConfig {
show_ui: false,
}
https://github.com/bevyengine/bevy/assets/1421719/a7c44352-e070-4cb9-89f3-644f5f27bc4a
And this has been working consistently for me. I'm curious if this issue has potentially been resolved or if I'm just incredibly lucky 🤔
I'm going to close this as fixed for now. If people encounter further errors, please re-open this!
Bevy version
0.9.1 and https://github.com/bevyengine/bevy/commit/9153bd0e786df602e8f86f3c564c131f9d738242
[Optional] Relevant system information
What you did
Attempt to render to texture, then use the returned handle in an
ImageNode
.This can be reproduced by adding the following code to the
render_to_texture
example (and fixing the minor compilation issues).A full reproduction for Bevy 0.9.1 can be found here.
What went wrong
Some very interesting symptoms here!
ImageNode
.