Fix T49609: Point density textures: vertex colors are not properly averaged in BI

Nice to have in 2.78a, though not a regression.
This commit is contained in:
Daisuke Takahashi 2016-10-09 13:16:19 +02:00 committed by Sergey Sharybin
parent 29fdcbbf9f
commit 880ebfff58
1 changed files with 10 additions and 1 deletions

View File

@ -333,7 +333,16 @@ static void pointdensity_cache_vertex_color(PointDensity *pd, Object *UNUSED(ob)
for (i = 0; i < totloop; i++) {
int v = mloop[i].v;
rgb_uchar_to_float(&data_color[v*3], &mcol[i].r);
if (mcorners[v] == 0) {
rgb_uchar_to_float(&data_color[v * 3], &mcol[i].r);
}
else {
float col[3];
rgb_uchar_to_float(col, &mcol[i].r);
add_v3_v3(&data_color[v * 3], col);
}
++mcorners[v];
}