Skip to content

Commit a00c71e

Browse files
authored
Cleanup deterministic example (#11416)
# Objective - Example `deterministic` crashes on CI on Windows because it uses too much memory ## Solution - Reduce the number of planes displayed while still having the issue - While there, add a small margin to the text so that it's prettier
1 parent e9b8c71 commit a00c71e

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

examples/3d/deterministic.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,22 @@ fn setup(
2626
deterministic_rendering_config.stable_sort_z_fighting = true;
2727

2828
// Help message will be rendered there.
29-
commands.spawn(TextBundle::default());
29+
commands.spawn(TextBundle::default().with_style(Style {
30+
position_type: PositionType::Absolute,
31+
top: Val::Px(12.0),
32+
left: Val::Px(12.0),
33+
..default()
34+
}));
3035

3136
commands.spawn(Camera3dBundle {
3237
transform: Transform::from_xyz(3.0, 3.0, 3.0).looking_at(Vec3::new(0., 0., 0.), Vec3::Y),
3338
..default()
3439
});
3540

3641
let mesh = meshes.add(Plane::from_size(2.0));
37-
for i in 0..360 {
38-
let color = Color::hsl(i as f32, 1.0, 0.5);
42+
let nb_plane = 10;
43+
for i in 0..nb_plane {
44+
let color = Color::hsl(i as f32 * 360.0 / nb_plane as f32, 1.0, 0.5);
3945
commands.spawn(PbrBundle {
4046
mesh: mesh.clone(),
4147
material: materials.add(StandardMaterial {

0 commit comments

Comments
 (0)