Spawned a small plane mesh with a transparent ring texture and a depth_bias of f32::INFINITY.
(
PbrBundle {
mesh: meshes.add(Plane3d::new(Vec3::Y, Vec2::splat(0.3))),
material: materials.add(StandardMaterial {
base_color_texture: Some(
asset_cache.cache(asset_server.load("textures/ring.ktx2")), // NOTE: `asset_cache.cache` simply clones the strong handle into a vector and returns the original handle
),
base_color: Srgba::WHITE.with_alpha(0.12549019).into(), // 32 alpha
alpha_mode: AlphaMode::Blend,
unlit: true,
depth_bias: f32::INFINITY, // Render the ring above all other 3d objects
..Default::default()
}),
transform: Transform::from_translation(Vec3::new(
0.0,
-HALF_PLAYER_HEIGHT - GROUND_OFFSET, // Places the ring exactly on the surface level
0.0,
)),
..Default::default()
},
NotShadowCaster,
)
What went wrong
Z-fighting:
Additional information
This was previously functional on Bevy 0.13.2. As a "workaround" (probably how I should've done it from the beginning) I made a different camera on a higher render layer to render the ring on top of all other 3d meshes.
Bevy version
0.14.0
Relevant system information
What you did
Spawned a small plane mesh with a transparent ring texture and a
depth_bias
off32::INFINITY
.What went wrong
Z-fighting:
Additional information
This was previously functional on Bevy 0.13.2. As a "workaround" (probably how I should've done it from the beginning) I made a different camera on a higher render layer to render the ring on top of all other 3d meshes.