diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-10-07 17:48:39 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-10-07 17:48:39 +0400 |
commit | 409b3c9c9c6cff97258f7ab6f6cb48ab0cc00b7c (patch) | |
tree | 727688f4fb696832c44f6905edc3aaf85f29b77e /intern | |
parent | 1a7b7bb74e69f1a28d3f1ee1eef181c6b1c393a3 (diff) |
Fix T42106: Box image mapping shows black triangles if they point to a corner and blend is 0
After discussion with cambo here we decided it's better to choose arbitrary side of the box
(in this case it's X-axis) and use image from it. That's better than doing a blackness.
P.S. This is literally a corner case anyway.
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/kernel/shaders/node_image_texture.osl | 4 | ||||
-rw-r--r-- | intern/cycles/kernel/svm/svm_image.h | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/intern/cycles/kernel/shaders/node_image_texture.osl b/intern/cycles/kernel/shaders/node_image_texture.osl index 7238a1e8862..18b5fb4b31f 100644 --- a/intern/cycles/kernel/shaders/node_image_texture.osl +++ b/intern/cycles/kernel/shaders/node_image_texture.osl @@ -113,6 +113,10 @@ shader node_image_texture( weight[2] = ((2.0 - limit) * Nob[2] + (limit - 1.0)) / (2.0 * limit - 1.0); } } + else { + /* Desperate mode, no valid choice anyway, fallback to one side.*/ + weight[0] = 1.0; + } Color = color(0.0, 0.0, 0.0); Alpha = 0.0; diff --git a/intern/cycles/kernel/svm/svm_image.h b/intern/cycles/kernel/svm/svm_image.h index a7abeda18e5..8a256c9bda5 100644 --- a/intern/cycles/kernel/svm/svm_image.h +++ b/intern/cycles/kernel/svm/svm_image.h @@ -435,6 +435,10 @@ ccl_device void svm_node_tex_image_box(KernelGlobals *kg, ShaderData *sd, float weight.z = ((2.0f - limit)*N.z + (limit - 1.0f))/(2.0f*limit - 1.0f); } } + else { + /* Desperate mode, no valid choice anyway, fallback to one side.*/ + weight.x = 1.0f; + } /* now fetch textures */ uint co_offset, out_offset, alpha_offset, srgb; |