Add a component to specify which camera has clouds#21
Add a component to specify which camera has clouds#21Saratii wants to merge 6 commits intoevroon:masterfrom
Conversation
|
Thanks for the issue and PR! I only wonder whether setting this component should be required when having only one camera, to keep things as simple as possible. Could you maybe also add an example with two cameras based on what you posted? #20 (comment) |
| let Some(camera) = camera else { | ||
| warn_once!("No camera with CloudCamera component found. Clouds will not render."); | ||
| return; | ||
| }; |
There was a problem hiding this comment.
I think it should just panic here with an error message. Logs are easy to miss and this is clearly a case where the user should either remove the CloudsPlugin or add CloudsCamera. Although we might still want to allow not having CloudsCamera when there is only one render camera, but not sure.
This doesn't add all of the functionality required to have clouds on two cameras it just prevents clouds from breaking on both cameras when two cameras exist. An example here might not be necessary until that feature is added. |
This pull requests adds a tag component that can be applied to a camera to specify that it should have clouds. Previously, this plugin will not work for any project with multiple cameras. I changed the compute shader pipeline to not assume that there is only one camera. I did not make it fully support rendering clouds to multiple cameras but a lot of the support for that feature is included in this PR. I updated the examples and the readme with information about the CloudCamera component.