Skip to content

Commit

Permalink
Migrate uses of ColorMaterial to include new field uv_transform
Browse files Browse the repository at this point in the history
  • Loading branch information
hukasu committed Feb 16, 2025
1 parent 120f93f commit 64d58be
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions examples/2d/mesh2d_alpha_mode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ fn setup(
color: WHITE.into(),
alpha_mode: AlphaMode2d::Opaque,
texture: Some(texture_handle.clone()),
..default()
})),
Transform::from_xyz(-400.0, 0.0, 0.0),
));
Expand All @@ -43,6 +44,7 @@ fn setup(
color: BLUE.into(),
alpha_mode: AlphaMode2d::Opaque,
texture: Some(texture_handle.clone()),
..default()
})),
Transform::from_xyz(-300.0, 0.0, 1.0),
));
Expand All @@ -52,6 +54,7 @@ fn setup(
color: GREEN.into(),
alpha_mode: AlphaMode2d::Opaque,
texture: Some(texture_handle.clone()),
..default()
})),
Transform::from_xyz(-200.0, 0.0, -1.0),
));
Expand All @@ -67,6 +70,7 @@ fn setup(
color: WHITE.into(),
alpha_mode: AlphaMode2d::Mask(0.5),
texture: Some(texture_handle.clone()),
..default()
})),
Transform::from_xyz(200.0, 0.0, 0.0),
));
Expand All @@ -76,6 +80,7 @@ fn setup(
color: BLUE.with_alpha(0.7).into(),
alpha_mode: AlphaMode2d::Blend,
texture: Some(texture_handle.clone()),
..Default::default()
})),
Transform::from_xyz(300.0, 0.0, 1.0),
));
Expand All @@ -85,6 +90,7 @@ fn setup(
color: GREEN.with_alpha(0.7).into(),
alpha_mode: AlphaMode2d::Blend,
texture: Some(texture_handle),
..default()
})),
Transform::from_xyz(400.0, 0.0, -1.0),
));
Expand Down
2 changes: 2 additions & 0 deletions examples/stress_tests/bevymark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,7 @@ fn init_materials(
color: Color::WHITE,
texture: textures.first().cloned(),
alpha_mode,
..default()
}));

// We're seeding the PRNG here to make this example deterministic for testing purposes.
Expand All @@ -625,6 +626,7 @@ fn init_materials(
color: Color::srgb_u8(color_rng.gen(), color_rng.gen(), color_rng.gen()),
texture: textures.choose(&mut texture_rng).cloned(),
alpha_mode,
..default()
})
})
.take(capacity - materials.len()),
Expand Down

0 comments on commit 64d58be

Please sign in to comment.