Skip to content

The combination of Skybox + MotionVectorPrepass + NormalPrepass is broken on WebGPU #20459

@janhohenheim

Description

@janhohenheim

Bevy version

0.17.0-dev and 0.16.0

Relevant system information

`AdapterInfo { name: "", vendor: 0, device: 0, device_type: Other, driver: "", driver_info: "", backend: BrowserWebGpu }`

Running on Google Chrome Version 138.0.7204.168 on Fedora Linux 42, using the Wayland + Vulkan + WebGPU flags

What you did

use bevy::{
    core_pipeline::{
        Skybox,
        prepass::{MotionVectorPrepass, NormalPrepass},
    },
    prelude::*,
};

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

fn setup(
    mut commands: Commands,
    mut meshes: ResMut<Assets<Mesh>>,
    mut materials: ResMut<Assets<StandardMaterial>>,
    assets: Res<AssetServer>,
) {
    commands.spawn((
        Mesh3d(meshes.add(Cuboid::default())),
        MeshMaterial3d(materials.add(Color::WHITE)),
    ));

    commands.spawn((
        Camera3d::default(),
        Transform::from_xyz(0.0, 2.0, 10.0).looking_at(Vec3::ZERO, Vec3::Y),
        Msaa::Off,
        // Remove any of the following three components to fix the blackscreen on WebGPU
        Skybox {
            image: assets.load("textures/Ryfjallet_cubemap_bc7.ktx2"),
            brightness: 800.0,
            ..default()
        },
        MotionVectorPrepass,
        NormalPrepass::default(),
    ));
}

Then run it on WebGPU using

bevy run --features bevy/webgpu web

and natively using

bevy run

What went wrong

WebGPU gives me a backscreen:

Image

Native runs fine:

Image

Additional information

Closeup of logs:

Image

This comes up organically when trying to use Skyboxes + TAA + SSAO on WebGPU, which seems like a fairly normal use-case

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-RenderingDrawing game state to the screenC-BugAn unexpected or incorrect behaviorO-WebSpecific to web (WASM) buildsO-WebGPUSpecific to the WebGPU render API

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions