From c791fb3141d91631785139cb210202206f9e71e4 Mon Sep 17 00:00:00 2001 From: Brandon DeRosier Date: Wed, 4 Jan 2023 17:36:22 -0800 Subject: [PATCH] [Impeller Scene] Fix material/vertex color overlapping --- impeller/scene/material.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/impeller/scene/material.cc b/impeller/scene/material.cc index 9e141d29ec9e2..73ce339babe7f 100644 --- a/impeller/scene/material.cc +++ b/impeller/scene/material.cc @@ -79,9 +79,11 @@ std::unique_ptr UnlitMaterial::MakeFromFlatbuffer( auto result = Material::MakeUnlit(); - result->SetColor(material.base_color_factor() - ? importer::ToColor(*material.base_color_factor()) - : Color::White()); + if (material.base_color_factor()) { + result->SetColor(importer::ToColor(*material.base_color_factor())); + result->SetVertexColorWeight(0); + } + if (material.base_color_texture() >= 0 && material.base_color_texture() < static_cast(textures.size())) { result->SetColorTexture(textures[material.base_color_texture()]);