Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Oeser <info@graphics-engineer.com>2019-04-11 10:34:54 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2019-04-11 11:30:33 +0300
commit87f07af737cd0de433a418988486c3d98aa58549 (patch)
tree001c2ae76cff2949c7afb921263ae1392f836bc4 /source/blender/draw/intern/draw_cache_impl_mesh.c
parenta3b88c9172999deb120d98ab0da3206e31fe2527 (diff)
Fix T63464: Multi UV Maps limited to three with eevee
this was very similar to T60684 (and the UV case was actually reported back then as well), so the fix goes hand in hand with rBbd8039399575 Reviewers: fclem Maniphest Tasks: T63464 Differential Revision: https://developer.blender.org/D4672
Diffstat (limited to 'source/blender/draw/intern/draw_cache_impl_mesh.c')
-rw-r--r--source/blender/draw/intern/draw_cache_impl_mesh.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/draw/intern/draw_cache_impl_mesh.c b/source/blender/draw/intern/draw_cache_impl_mesh.c
index 5643d23c7cd..e35a191cad5 100644
--- a/source/blender/draw/intern/draw_cache_impl_mesh.c
+++ b/source/blender/draw/intern/draw_cache_impl_mesh.c
@@ -982,11 +982,13 @@ static MeshRenderData *mesh_render_data_create_ex(
CustomData_free_layers(cd_ldata, CD_MLOOPTANGENT, rdata->loop_len);
if (rdata->cd.layers.uv_len != 0) {
+ int act_uv = rdata->cd.layers.uv_active;
for (int i_src = 0, i_dst = 0; i_src < cd_layers_src.uv_len; i_src++, i_dst++) {
if ((cd_used->uv & (1 << i_src)) == 0) {
+ /* This is a non-used UV slot. Skip. */
i_dst--;
if (rdata->cd.layers.uv_active >= i_src) {
- rdata->cd.layers.uv_active--;
+ act_uv--;
}
}
else {
@@ -1002,6 +1004,10 @@ static MeshRenderData *mesh_render_data_create_ex(
BLI_snprintf(rdata->cd.uuid.auto_mix[i_dst], sizeof(*rdata->cd.uuid.auto_mix), "a%u", hash);
}
}
+ if (rdata->cd.layers.uv_active != -1) {
+ /* Actual active UV slot inside uv layers used for shading. */
+ rdata->cd.layers.uv_active = act_uv;
+ }
}
if (rdata->cd.layers.tangent_len != 0) {