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.
This commit is contained in:
2011-02-05 17:54:00 +00:00
parent 6011bac989
commit 00d95fb4bf
2 changed files with 7 additions and 26 deletions

View File

@@ -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;

View File

@@ -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]++;