From f1f9bebd3270c0fdc3d8dbb10385241175238002 Mon Sep 17 00:00:00 2001 From: Abnormal Brain Studios <102993888+abnormalbrain@users.noreply.github.com> Date: Fri, 3 Feb 2023 17:57:56 -0500 Subject: [PATCH] Only compute color once per quad --- crates/bevy_sprite/src/render/mod.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/bevy_sprite/src/render/mod.rs b/crates/bevy_sprite/src/render/mod.rs index 112c066605bc0..74bcde4bcc1e4 100644 --- a/crates/bevy_sprite/src/render/mod.rs +++ b/crates/bevy_sprite/src/render/mod.rs @@ -640,11 +640,12 @@ pub fn queue_sprites( // Store the vertex data and add the item to the render phase if current_batch.colored { + let vertex_color = extracted_sprite.color.as_linear_rgba_f32(); for i in QUAD_INDICES { sprite_meta.colored_vertices.push(ColoredSpriteVertex { position: positions[i], uv: uvs[i].into(), - color: extracted_sprite.color.as_linear_rgba_f32(), + color: vertex_color, }); } let item_start = colored_index;