From cf1cbbd97936ace35840af18b0f22e3d20caabb3 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Wed, 6 Dec 2006 08:10:13 +0000 Subject: [PATCH] Render error: option "All Z" for render layers crashed. I forgot it uses face index -1 for it... :) --- .../blender/render/intern/source/shadeinput.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/source/blender/render/intern/source/shadeinput.c b/source/blender/render/intern/source/shadeinput.c index a5bff2a350a..b0ca460a33e 100644 --- a/source/blender/render/intern/source/shadeinput.c +++ b/source/blender/render/intern/source/shadeinput.c @@ -919,32 +919,31 @@ static void shade_samples_fill_with_ps(ShadeSample *ssamp, PixStr *ps, int x, in ssamp->tot= 0; - for(shi= ssamp->shi; ps; ps= ps->next, shi++) { + for(shi= ssamp->shi; ps; ps= ps->next) { shade_input_set_triangle(shi, ps->facenr, 1); - /* officially should always be true... we have no sky info */ - if(shi->vlr) { + if(shi->vlr) { /* NULL happens for env material or for 'all z' */ unsigned short curmask= ps->mask; /* full osa is only set for OSA renders */ if(shi->vlr->flag & R_FULL_OSA) { - short shi_inc= 0, samp; + short shi_cp= 0, samp; for(samp=0; sampmask= (1<z); shade_input_set_uv(shi); shade_input_set_normals(shi); - shi_inc= 1; + shi_cp= 1; + shi++; } } } @@ -962,10 +961,12 @@ static void shade_samples_fill_with_ps(ShadeSample *ssamp, PixStr *ps, int x, in shade_input_set_viewco(shi, xs, ys, (float)ps->z); shade_input_set_uv(shi); shade_input_set_normals(shi); + shi++; } /* total sample amount, shi->sample is static set in initialize */ - ssamp->tot= shi->sample+1; + if(shi!=ssamp->shi) + ssamp->tot= (shi-1)->sample + 1; } } }