bevyengine/bevy · error · AtmosphereBindGroupError

Failed to prepare atmosphere bind groups. Light uniform buff

Error message

Failed to prepare atmosphere bind groups. Light uniform buffer missing

What it means

`prepare_atmosphere_bind_groups` (crates/bevy_pbr/src/atmosphere/resources.rs:668) needs a GPU binding for the per-view light uniform buffer `LightMeta.view_gpu_lights`, which the PBR light-preparation system writes each frame. If that buffer has never been written, `.binding()` returns `None` and the system returns `AtmosphereBindGroupError::LightUniforms` as a `BevyError` — Bevy's scheduler logs it and atmosphere bind groups are not created that frame.

Source

Thrown at crates/bevy_pbr/src/atmosphere/resources.rs:617

    pub multiscattering_lut: BindGroup,
    pub sky_view_lut: BindGroup,
    pub aerial_view_lut: BindGroup,
    pub render_sky: BindGroup,
}

#[derive(Copy, Clone, Debug, thiserror::Error)]
enum AtmosphereBindGroupError {
    #[error("Failed to prepare atmosphere bind groups. Atmosphere uniform buffer missing")]
    Atmosphere,
    #[error(
        "Failed to prepare atmosphere bind groups. AtmosphereTransforms uniform buffer missing"
    )]
    Transforms,
    #[error("Failed to prepare atmosphere bind groups. AtmosphereSettings uniform buffer missing")]
    Settings,
    #[error("Failed to prepare atmosphere bind groups. View uniform buffer missing")]
    ViewUniforms,
    #[error("Failed to prepare atmosphere bind groups. Light uniform buffer missing")]
    LightUniforms,
}

pub(super) fn prepare_atmosphere_bind_groups(
    views: Query<
        (
            Entity,
            &ExtractedAtmosphere,
            &AtmosphereTextures,
            &ViewDepthStencilTexture,
            &Msaa,
        ),
        (With<Camera3d>, With<ExtractedAtmosphere>),
    >,
    render_device: Res<RenderDevice>,
    layouts: Res<AtmosphereBindGroupLayouts>,
    render_sky_layouts: Res<RenderSkyBindGroupLayouts>,
    atmosphere_sampler: Res<AtmosphereSampler>,

View on GitHub (pinned to 396ca72708)

Solutions

  1. Add `AtmospherePlugin` alongside `DefaultPlugins` (which includes the PBR light pipeline), not in isolation
  2. If you trimmed plugins, re-enable the light preparation systems so `LightMeta.view_gpu_lights` is populated before atmosphere preparation
  3. In custom render setups, verify the atmosphere prepare system runs after light prepare in the same schedule

Example fix

// before: atmosphere plugin without the PBR light pipeline
app.add_plugins((MinimalPlugins, AtmospherePlugin));

// after: keep the standard PBR plugins alongside
app.add_plugins((DefaultPlugins, AtmospherePlugin));
Defensive patterns

Strategy: validation

Validate before calling

null

Prevention

When it happens

Trigger: An extracted atmosphere-enabled `Camera3d` exists while `view_gpu_lights` is still empty: the PBR light plugin was removed or never ran (system ordering in a custom RenderApp), or a stripped-down render app added `AtmospherePlugin` without the rest of the MeshPbrPlugin machinery.

Common situations: Adding the atmosphere feature to a minimal/custom renderer instead of the default plugin set; disabling lighting-related plugins or reordering render-graph setup; integrating the atmosphere pass into a custom pipeline where light preparation runs later (or not at all).

Related errors


AI-assisted analysis of bevyengine/bevy@396ca72708 (2026-08-20). Data as JSON: /api/errors/f80838d52b028cfd. Report an issue: GitHub.