-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Open
Labels
A-RenderingDrawing game state to the screenDrawing game state to the screenC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorS-Needs-InvestigationThis issue requires detective work to figure out what's going wrongThis issue requires detective work to figure out what's going wrong
Milestone
Description
Bevy 0.16 - 0.18, main fa379de
Bisected to: d82d323, #19041
Bevy 0.15 seems to work as expected.
When over 65535 unique material instances are created, instances are rendered using the incorrect material.
use bevy::prelude::*;
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_systems(Startup, setup)
.run();
}
fn setup(
mut commands: Commands,
mut standard_materials: ResMut<Assets<StandardMaterial>>,
mut meshes: ResMut<Assets<Mesh>>,
) {
let mesh = Mesh3d(meshes.add(Cuboid::default()));
for i in 0..65536i64 {
let x = i.rem_euclid(360) as f32;
let y = (i / 360) as f32;
commands
.spawn((mesh.clone(), Transform::from_translation(vec3(x, -y, 0.0))))
.insert(MeshMaterial3d(
standard_materials.add(StandardMaterial {
emissive: Color::hsl(
(i as f32).rem_euclid(360.0),
(y * 0.05).sin().abs() * 0.8,
(x * 0.05).cos().abs() * 0.8,
)
.to_linear(),
..Default::default()
}),
));
}
commands.spawn((
Camera3d::default(),
bevy::core_pipeline::tonemapping::Tonemapping::None,
Transform::from_xyz(200.0, -100.0, 500.0).looking_at(vec3(200.0, -100.0, 0.0), Vec3::Y),
));
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-RenderingDrawing game state to the screenDrawing game state to the screenC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorS-Needs-InvestigationThis issue requires detective work to figure out what's going wrongThis issue requires detective work to figure out what's going wrong
Type
Projects
Status
Needs SME Triage

