mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 12:43:34 +00:00
render: visualize depth in z_sort_debug
This commit is contained in:
parent
99bc2d0ea7
commit
b6dbbf04db
1 changed files with 7 additions and 4 deletions
|
@ -18,14 +18,17 @@ fn rotator_system(time: Res<Time>, _rotator: ComMut<Rotator>, mut rotation: ComM
|
|||
|
||||
fn camera_order_color_system(
|
||||
world: &mut SubWorld,
|
||||
mut materials: ResMut<Assets<StandardMaterial>>,
|
||||
camera_query: &mut Query<(Read<Camera>, Read<VisibleEntities>)>,
|
||||
_material_query: &mut Query<Write<StandardMaterial>>,
|
||||
_material_query: &mut Query<Read<Handle<StandardMaterial>>>,
|
||||
) {
|
||||
for (_camera, visible_entities) in camera_query.iter(world) {
|
||||
for visible_entity in visible_entities.value.iter() {
|
||||
println!("visible_entity: {:?}", visible_entity.order);
|
||||
// let mut material = world.get_component_mut::<StandardMaterial>(visible_entity.entity).unwrap();
|
||||
// println!("entity {:?}", visible_entity.order);
|
||||
if let Some(material_handle) = world.get_component::<Handle<StandardMaterial>>(visible_entity.entity) {
|
||||
let material = materials.get_mut(&material_handle).unwrap();
|
||||
let value = 1.0 - (20.0 - visible_entity.order.0) / 7.0;
|
||||
material.albedo = Color::rgb(value, value, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue