Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

[Impeller Scene] Fix material/vertex color overlapping #38653

Merged
merged 1 commit into from
Jan 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions impeller/scene/material.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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()]);
Expand Down