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.
This commit is contained in:
@@ -113,6 +113,10 @@ shader node_image_texture(
|
|||||||
weight[2] = ((2.0 - limit) * Nob[2] + (limit - 1.0)) / (2.0 * limit - 1.0);
|
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);
|
Color = color(0.0, 0.0, 0.0);
|
||||||
Alpha = 0.0;
|
Alpha = 0.0;
|
||||||
|
@@ -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);
|
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 */
|
/* now fetch textures */
|
||||||
uint co_offset, out_offset, alpha_offset, srgb;
|
uint co_offset, out_offset, alpha_offset, srgb;
|
||||||
|
Reference in New Issue
Block a user