From ca79952dc013c40e08f11f8e79976ece8a04d15a Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 18 Feb 2008 19:32:57 +0000 Subject: [PATCH] Fix for bug #7787: QMC AO could give bad results tracing rays from an untraceable material, cause is that the ray start position got set only once, but it needs to be set for each ray since it can be clipped to the octree bounding box. --- source/blender/render/intern/source/rayshade.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/render/intern/source/rayshade.c b/source/blender/render/intern/source/rayshade.c index 218f5fe931e..27e1a4d98fa 100644 --- a/source/blender/render/intern/source/rayshade.c +++ b/source/blender/render/intern/source/rayshade.c @@ -1505,7 +1505,6 @@ void ray_ao_qmc(ShadeInput *shi, float *shadfac) isec.ob_last= 0; isec.mode= (R.wrld.aomode & WO_AODIST)?RE_RAY_SHADOW_TRA:RE_RAY_SHADOW; isec.lay= -1; - VECCOPY(isec.start, shi->co); shadfac[0]= shadfac[1]= shadfac[2]= 0.0f; @@ -1558,6 +1557,7 @@ void ray_ao_qmc(ShadeInput *shi, float *shadfac) Normalize(dir); + VECCOPY(isec.start, shi->co); isec.end[0] = shi->co[0] - maxdist*dir[0]; isec.end[1] = shi->co[1] - maxdist*dir[1]; isec.end[2] = shi->co[2] - maxdist*dir[2];