From 231840a99f19cd2a08448e6417890bf40e2e4bb0 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sat, 19 Jan 2008 19:33:32 +0000 Subject: [PATCH] Bugfix for crash in approximate AO pixel cache. --- source/blender/render/intern/source/occlusion.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/blender/render/intern/source/occlusion.c b/source/blender/render/intern/source/occlusion.c index 19394b4235a..bcd6ed3aa0d 100644 --- a/source/blender/render/intern/source/occlusion.c +++ b/source/blender/render/intern/source/occlusion.c @@ -1641,7 +1641,7 @@ void cache_occ_samples(Render *re, RenderPart *pa, ShadeSample *ssamp) /* compute a sample at every step pixels */ for(y=pa->disprect.ymin; ydisprect.ymax; y++) { - for(x=pa->disprect.xmin; xdisprect.xmax; x++, ro++, rp++, rz++) { + for(x=pa->disprect.xmin; xdisprect.xmax; x++, ro++, rp++, rz++, sample++) { if((((x - pa->disprect.xmin + step) % step) == 0 || x == pa->disprect.xmax-1) && (((y - pa->disprect.ymin + step) % step) == 0 || y == pa->disprect.ymax-1)) { if(*rp) { ps.obi= *ro; @@ -1650,6 +1650,8 @@ void cache_occ_samples(Render *re, RenderPart *pa, ShadeSample *ssamp) shade_samples_fill_with_ps(ssamp, &ps, x, y); shi= ssamp->shi; + if(!shi->vlr) + continue; onlyshadow= (shi->mat->mode & MA_ONLYSHADOW); exclude.obi= shi->obi - re->objectinstance; @@ -1669,8 +1671,6 @@ void cache_occ_samples(Render *re, RenderPart *pa, ShadeSample *ssamp) if(re->test_break()) break; } - - sample++; } } }