diff options
Diffstat (limited to 'source/blender/render/intern/source/occlusion.c')
-rw-r--r-- | source/blender/render/intern/source/occlusion.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/source/blender/render/intern/source/occlusion.c b/source/blender/render/intern/source/occlusion.c index b3d31e3b93a..cd93898d846 100644 --- a/source/blender/render/intern/source/occlusion.c +++ b/source/blender/render/intern/source/occlusion.c @@ -329,7 +329,7 @@ static void occ_face(const OccFace *face, float co[3], float normal[3], float *a if (vlr->v4) mid_v3_v3v3(co, vlr->v1->co, vlr->v3->co); else - cent_tri_v3(co, vlr->v1->co, vlr->v2->co, vlr->v3->co); + mid_v3_v3v3v3(co, vlr->v1->co, vlr->v2->co, vlr->v3->co); if (obi->flag & R_TRANSFORMED) mul_m4_v3(obi->mat, co); @@ -1190,9 +1190,14 @@ static void sample_occ_surface(ShadeInput *shi) co1 = mesh->co[face[0]]; co2 = mesh->co[face[1]]; co3 = mesh->co[face[2]]; - co4 = (face[3]) ? mesh->co[face[3]] : NULL; - interp_weights_face_v3(w, co1, co2, co3, co4, strand->vert->co); + if (face[3]) { + co4 = mesh->co[face[3]]; + interp_weights_quad_v3(w, co1, co2, co3, co4, strand->vert->co); + } + else { + interp_weights_tri_v3(w, co1, co2, co3, strand->vert->co); + } zero_v3(shi->ao); zero_v3(shi->env); @@ -1245,7 +1250,7 @@ static void *exec_strandsurface_sample(void *data) normal_quad_v3(n, co1, co2, co3, co4); } else { - cent_tri_v3(co, co1, co2, co3); + mid_v3_v3v3v3(co, co1, co2, co3); normal_tri_v3(n, co1, co2, co3); } negate_v3(n); |