From 09bfd81bc77568c06ac31dafbb0883c95c49926d Mon Sep 17 00:00:00 2001 From: Luan Nico Date: Sat, 14 Dec 2024 08:55:54 -0500 Subject: [PATCH] fix: Fix albedo texture binding on shader [flame_3d] --- .../flame_3d/lib/src/resources/texture/color_texture.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/flame_3d/lib/src/resources/texture/color_texture.dart b/packages/flame_3d/lib/src/resources/texture/color_texture.dart index eff4966856..4b4d161de4 100644 --- a/packages/flame_3d/lib/src/resources/texture/color_texture.dart +++ b/packages/flame_3d/lib/src/resources/texture/color_texture.dart @@ -14,10 +14,10 @@ class ColorTexture extends Texture { List.filled( width * height, // Convert to a 32 bit value representing this color. - (color.a ~/ 255) << 24 | - (color.r ~/ 255) << 16 | - (color.g ~/ 255) << 8 | - (color.b ~/ 255), + (color.a * 255).round() << 24 | + (color.r * 255).round() << 16 | + (color.g * 255).round() << 8 | + (color.b * 255).round(), ), ).buffer.asByteData(), width: width,