Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2008-10-07 19:01:44 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2008-10-07 19:01:44 +0400
commit94a9fa4711be6411002bdd32ffbb01c7402f4920 (patch)
tree22c8efaa75886c840044ad1c58b0450c6d29a44c /source/blender/render/intern/source/rendercore.c
parent0d7d520ffa3cf52829f765687766db694b92f2b1 (diff)
Fix for bug #13363: ray (qmc) shadows had some light leaking issues,
due to jittering of the start position for antialiasing in a pixel. Now it distributes the start position over the fixed osa sample positions, instead of of random positions in space. The ugly bit is that a custom ordering was defined for osa 8/11/16 to ensure that the first 4 are distributed relatively fair for adaptive sampling to decide if more samples need to be taken.
Diffstat (limited to 'source/blender/render/intern/source/rendercore.c')
-rw-r--r--source/blender/render/intern/source/rendercore.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c
index 05ff0d3c020..1eb42bca569 100644
--- a/source/blender/render/intern/source/rendercore.c
+++ b/source/blender/render/intern/source/rendercore.c
@@ -1465,7 +1465,7 @@ static void shade_sample_sss(ShadeSample *ssamp, Material *mat, ObjectInstanceRe
{
ShadeInput *shi= ssamp->shi;
ShadeResult shr;
- float texfac, orthoarea, nor[3], alpha;
+ float texfac, orthoarea, nor[3], alpha, sx, sy;
/* cache for shadow */
shi->samplenr= R.shadowsamplenr[shi->thread]++;
@@ -1476,8 +1476,8 @@ static void shade_sample_sss(ShadeSample *ssamp, Material *mat, ObjectInstanceRe
shade_input_set_triangle_i(shi, obi, vlr, 0, 1, 2);
/* center pixel */
- x += 0.5f;
- y += 0.5f;
+ sx = x + 0.5f;
+ sy = y + 0.5f;
/* we estimate the area here using shi->dxco and shi->dyco. we need to
enabled shi->osatex these are filled. we compute two areas, one with
@@ -1486,13 +1486,13 @@ static void shade_sample_sss(ShadeSample *ssamp, Material *mat, ObjectInstanceRe
shi->osatex= 1;
VECCOPY(nor, shi->facenor);
- calc_view_vector(shi->facenor, x, y);
+ calc_view_vector(shi->facenor, sx, sy);
Normalize(shi->facenor);
- shade_input_set_viewco(shi, x, y, z);
+ shade_input_set_viewco(shi, x, y, sx, sy, z);
orthoarea= VecLength(shi->dxco)*VecLength(shi->dyco);
VECCOPY(shi->facenor, nor);
- shade_input_set_viewco(shi, x, y, z);
+ shade_input_set_viewco(shi, x, y, sx, sy, z);
*area= VecLength(shi->dxco)*VecLength(shi->dyco);
*area= MIN2(*area, 2.0f*orthoarea);