Cycles: Fix wrong pointiness caused by precision issues

This commit is contained in:
Sergey Sharybin 2017-02-15 12:39:06 +01:00
parent b36e26bbce
commit 5723aa8c02
Notes: blender-bot 2023-02-14 08:25:14 +01:00
Referenced by issue #54446, Pointness gives a white spots on a small objects
1 changed files with 2 additions and 2 deletions

View File

@ -589,12 +589,12 @@ static void attr_create_pointiness(Scene *scene,
const float3 &other_vert_co = mesh->verts[other_vert_index];
/* We are too far away now, we wouldn't have duplicate. */
if ((other_vert_co.x + other_vert_co.y + other_vert_co.z) -
(vert_co.x + vert_co.y + vert_co.z) > 0.0f)
(vert_co.x + vert_co.y + vert_co.z) > 3 * FLT_EPSILON)
{
break;
}
/* Found duplicate. */
if(other_vert_co == vert_co) {
if(len_squared(other_vert_co - vert_co) < FLT_EPSILON) {
found = true;
vert_orig_index[vert_index] = other_vert_index;
break;