-
Notifications
You must be signed in to change notification settings - Fork 2
Add a component to specify which camera has clouds #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
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) |
src/compute.rs
Outdated
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.