Make Skybox’s image optional so that Skybox::default() is valid.#23691
Make Skybox’s image optional so that Skybox::default() is valid.#23691alice-i-cecile merged 1 commit intobevyengine:mainfrom
Skybox’s image optional so that Skybox::default() is valid.#23691Conversation
|
I would prefer the |
|
@IceSentry Happy to turn this PR into that instead, if I hear a more confident statement that that is the way to go. |
Insert more confident statement that this is the way to go. (I spent a ton of time last week writing docs for the crate and that will play much nicer.) |
Skybox::default() and add Skybox::new().Skybox’s image optional so that Skybox::default() is valid.
|
I have updated the code to make the |
|
This PR is a breaking change. Should I be doing anything regarding the migration guide? |
|
It looks like your PR is a breaking change, but you didn't provide a migration guide. Please review the instructions for writing migration guides, then expand or revise the content in the migration guides directory to reflect your changes. |
|
Yep: something brief would be good. The bot will be by with advice momentarily <3 |
|
Sibling to #23689. |
0a3c784 to
0ff7151
Compare
|
Added migration guide. |
This makes `Skybox::default()` a valid no-op `Skybox` component rather than one that contains an image that cannot be rendered as a skybox.
|
I rebased and, as a consequence, had to add |
|
You might be able to use the new |
|
Just to confirm I understand correctly: |
bevyengine#23691) # Objective - Partially addresses bevyengine#23688. - Prevents use of `Skybox::default()` from causing errors. ## Solution `Skybox::default()` is problematic because it contains an `Image` that is not a valid skybox. ~~This change removes the `Default` implementation and instead provides a `new()` function which takes the image as a parameter (and also the brightness, which is practically required).~~ This change makes the `image` field optional so that the default `None` renders nothing. Things we could do instead of this: * Make `Skybox` not implement `Default`. I am informed this is a bad idea. * Create a default cubemap image for `default()` to use. ## Testing Ran the `skybox` and `irradiance_volumes` examples.
Objective
Skybox::default()causes an internal error #23688.Skybox::default()from causing errors.Solution
Skybox::default()is problematic because it contains anImagethat is not a valid skybox.This change removes theThis change makes theDefaultimplementation and instead provides anew()function which takes the image as a parameter (and also the brightness, which is practically required).imagefield optional so that the defaultNonerenders nothing.Things we could do instead of this:
Skyboxnot implementDefault. I am informed this is a bad idea.default()to use.Testing
Ran the
skyboxandirradiance_volumesexamples.