bevyengine / bevyengine/bevy

Indirect drawing causes `AlphaMode::Blend` meshes to flicker

Open
#21,739 1 comment 1 reaction 0 assignees View on GitHub
A-Rendering C-Bug S-Needs-Investigation
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

## Bevy version and features

0.17.2

## Relevant system information

```
2025-11-04T12:50:12.387804Z INFO plugin build{plugin="bevy_render::RenderPlugin"}: bevy_render::renderer: AdapterInfo { name: "AMD Radeon Graphics (RADV RENOIR)", vendor: 4098, device: 5686, device_type: IntegratedGpu, driver: "radv", driver_info: "Mesa 25.2.5-arch1.2", backend: Vulkan }
```

## What you did

```rust

fn setup(
mut commands: Commands,
mut meshes: ResMut>,
mut materials: ResMut>,
) {
// Camera
commands.spawn((
Camera3d::default(),
Transform::from_xyz(10.0, 10.0, 10.0).looking_at(Vec3::ZERO, Vec3::Y),
// OrderIndependentTransparencySettings {
// layer_count: 8,
// alpha_threshold: 0.0,
// },
Msaa::Off,
// NoIndirectDrawing,
));

// Directional light
commands.spawn((
DirectionalLight::default(),
Transform::from_xyz(0.0, 0.0, 0.0).looking_at(Vec3::new(-0.15, -0.1, 0.15), Vec3::Y),
));

// Ambient light
commands.insert_resource(AmbientLight {
brightness: 800.0,
..Default::default()
});

let cube = meshes.add(bevy::math::primitives::Cuboid::new(0.5, 0.5, 0.5));
let material_handle = materials.add(StandardMaterial {
alpha_mode: AlphaMode::Blend,
..Default::default()
});
let mut bundles = Vec::with_capacity(8 * 8 * 8);

for z in -4..4 {
for y in -4..4 {
for x in -4..4 {
bundles.push((
Mesh3d(cube.clone()),
MeshMaterial3d(material_handle.clone()),
Transform::from_xyz(x as f32, y as f32, z as f32),
));
}
}
}
commands.spawn_batch(bundles);
}

```

## What went wrong

https://github.com/user-attachments/assets/30bc2761-a3d5-4e47-bc0e-7e97c9b665c3

## Additional information

This doesn't happend with `AlphaMode::Opaque`/`Mask`/`Add`/`Multiply` or with `NoIndirectDrawing`. Enabling OIT can mitigate this issue but flickering still occurs if the overlapping meshes exceed the OIT layers.
I also tried #21475 but it doesn't fix this.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.