bevy
bevy copied to clipboard
Update post_processing example to not render UI with first pass camera
Objective
Make sure the post processing example won't render UI twice.
Solution
Disable UI on the first pass camera with UiCameraConfig
I have seen at least one other person get hit by the double-UI thing while trying to build off of this example.
I think a PR to disable UI for the other camera would be welcome.
I have seen at least one other person get hit by the double-UI thing while trying to build off of this example.
I think a PR to disable UI for the other camera would be welcome.
Not sure if it makes sense to make a new PR for that, but just for simplicity I pushed the changes here since the original changes don't make sense anymore. The only change now is what you said, the disabling of the UI being rendered by the first camera.
Just need to update the PR title and description if we're reusing this PR.
Okay PR title and description updated.
Is it possible to make it so that UI rendering is only enabled by default for when there's a single camera? When multiple cameras are added, it's disabled by default and you need to add UiCameraConfig { show_ui: true } to one of them? Also if there are UI elements to render and not a single UI-enabled camera, you get a warning? That would perhaps be less surprising, and people wouldn't stumble on it then.
bors r+
Pull request successfully merged into main.
Build succeeded:
- build-and-install-on-iOS
- build-android
- build (macos-latest)
- build (ubuntu-latest)
- build-wasm
- build (windows-latest)
- build-without-default-features (bevy)
- build-without-default-features (bevy_ecs)
- build-without-default-features (bevy_reflect)
- check-compiles
- check-doc
- check-missing-examples-in-docs
- ci
- markdownlint
- run-examples
- run-examples-on-wasm
- run-examples-on-windows-dx12