Skip to content

Attaching an AmbientLight to a Camera causes unexpected warning message #19203

Open
@phi-fell

Description

@phi-fell

Bevy version

Bevy "0.16" via cargo

[Optional] Relevant system information

cargo 1.86.0

Windows 11 Home 64 bit

AdapterInfo { name: "NVIDIA GeForce RTX 4070 SUPER", vendor: 4318, device: 10115, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "572.70", backend: Vulkan }

What you did

Attached an AmbientLight component to an entity with a camera:

Cargo.toml

[package]
name = "ambient_light_issue"
version = "0.1.0"
edition = "2024"

[dependencies]
bevy = "0.16.0"

src/main.rs

use bevy::prelude::*;

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

fn setup_camera(mut commands: Commands) {
    commands.spawn((Camera2d, Camera { ..default() }, AmbientLight::NONE));
}

(also works without the explicit Camera component, or with a Camera3d, etc.)

What went wrong

Warning:
WARN bevy_render::camera::camera: Entity 3v1 has a Camera component, but it doesn't have a render graph configured. Consider adding a Camera2d or Camera3d component, or manually adding a CameraRenderGraph component if you need a custom render graph.

Additional information

Removing the AmbientLight component fixes it. printing a list of entities with Camera components during Update, does not print 3v1, and 3v1 is not the id of the spawned entity with the light and camera

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-BugAn unexpected or incorrect behaviorS-Needs-TriageThis issue needs to be labelled

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions