[Impeller Scene] Fix material/vertex color overlapping (flutter/engine#38653)

This commit is contained in:
Brandon DeRosier
2023-01-05 00:04:17 -08:00
committed by GitHub
parent 85d059c715
commit b8fb9e873a

View File

@@ -79,9 +79,11 @@ std::unique_ptr<UnlitMaterial> 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<int32_t>(textures.size())) {
result->SetColorTexture(textures[material.base_color_texture()]);