From 00d95fb4bf6402c63cc5aa41d05cdcc4c848d985 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sat, 5 Feb 2011 17:54:00 +0000 Subject: [PATCH] Another fix for the raytracing commit, forgot that it also included vertex reordering to be consistent with the rest of the render engine. That means the self intersection issues with non-planar quads should also be gone now. --- .../blender/render/intern/source/rayshade.c | 11 +++------- .../blender/render/intern/source/rendercore.c | 22 ++++--------------- 2 files changed, 7 insertions(+), 26 deletions(-) diff --git a/source/blender/render/intern/source/rayshade.c b/source/blender/render/intern/source/rayshade.c index d1a0860545b..00092b8b053 100644 --- a/source/blender/render/intern/source/rayshade.c +++ b/source/blender/render/intern/source/rayshade.c @@ -534,15 +534,10 @@ void shade_ray(Isect *is, ShadeInput *shi, ShadeResult *shr) shi->mat= vlr->mat; shade_input_init_material(shi); - if(vlr->v4) { - if(is->isect==2) - shade_input_set_triangle_i(shi, obi, vlr, 2, 1, 3); - else - shade_input_set_triangle_i(shi, obi, vlr, 0, 1, 3); - } - else { + if(is->isect==2) + shade_input_set_triangle_i(shi, obi, vlr, 0, 2, 3); + else shade_input_set_triangle_i(shi, obi, vlr, 0, 1, 2); - } shi->u= is->u; shi->v= is->v; diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c index 83e9abc0906..fac2e39c89a 100644 --- a/source/blender/render/intern/source/rendercore.c +++ b/source/blender/render/intern/source/rendercore.c @@ -2082,24 +2082,10 @@ static void bake_mask_clear( ImBuf *ibuf, char *mask, char val ) static void bake_set_shade_input(ObjectInstanceRen *obi, VlakRen *vlr, ShadeInput *shi, int quad, int isect, int x, int y, float u, float v) { - if(isect) { - /* raytrace intersection with different u,v than scanconvert */ - if(vlr->v4) { - if(quad) - shade_input_set_triangle_i(shi, obi, vlr, 2, 1, 3); - else - shade_input_set_triangle_i(shi, obi, vlr, 0, 1, 3); - } - else - shade_input_set_triangle_i(shi, obi, vlr, 0, 1, 2); - } - else { - /* regular scanconvert */ - if(quad) - shade_input_set_triangle_i(shi, obi, vlr, 0, 2, 3); - else - shade_input_set_triangle_i(shi, obi, vlr, 0, 1, 2); - } + if(quad) + shade_input_set_triangle_i(shi, obi, vlr, 0, 2, 3); + else + shade_input_set_triangle_i(shi, obi, vlr, 0, 1, 2); /* cache for shadow */ shi->samplenr= R.shadowsamplenr[shi->thread]++;