Skip to content

Plugin does not work for any project with more than one camera #20

@Saratii

Description

@Saratii

Currently the code will produce strange results if you have multiple cameras (most projects do). There is not a way to specify Which cameras should and should not have clouds as it queries a single and will panic if there are multiple cameras.

Here is a minimal modification to the minimal example that breaks the plugin. It is likely taking into account the second camera in the compute shader because there is no way to exclude it.

Image
//! A minimal example featuring clouds.
use bevy::{prelude::*, render::view::Hdr};
use bevy_volumetric_clouds::CloudsPlugin;

fn main() {
    App::new()
        .add_plugins((DefaultPlugins, CloudsPlugin))
        .add_systems(Startup, setup)
        .run();
}

fn setup(mut commands: Commands) {
    commands.spawn((Camera3d::default(), Hdr));
    commands.spawn((
        Camera3d::default(),
        Transform::from_translation(Vec3::new(0., 150., 0.)),
        Camera {
            order: 1,
            ..default()
        },
    ));
}```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions