[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [30897] branches/render25/source/blender/ render/intern/source: Fix for #23006: approximate AO/env/ indirect used averaged subpixel location

Brecht Van Lommel brecht at blender.org
Fri Jul 30 13:26:38 CEST 2010


Revision: 30897
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=30897
Author:   blendix
Date:     2010-07-30 13:26:38 +0200 (Fri, 30 Jul 2010)

Log Message:
-----------
Fix for #23006: approximate AO/env/indirect used averaged subpixel location
which could give light leaks, this uses same trick as raytracing to fix it.

Modified Paths:
--------------
    branches/render25/source/blender/render/intern/source/diskocclusion.c
    branches/render25/source/blender/render/intern/source/shadeoutput.c

Modified: branches/render25/source/blender/render/intern/source/diskocclusion.c
===================================================================
--- branches/render25/source/blender/render/intern/source/diskocclusion.c	2010-07-30 11:19:41 UTC (rev 30896)
+++ branches/render25/source/blender/render/intern/source/diskocclusion.c	2010-07-30 11:26:38 UTC (rev 30897)
@@ -1080,8 +1080,8 @@
 {
 	OcclusionTree *tree= re->db.occlusiontree;
 	OccFace exclude;
-	float *vn;
-	int onlyshadow;
+	float jitco[RE_MAX_OSA][3], co[3], *vn;
+	int onlyshadow, totjitco= 0;
 
 	onlyshadow= (shi->material.mat->mode & MA_ONLYSHADOW);
 	exclude.obi= shi->primitive.obi - re->db.objectinstance;
@@ -1091,8 +1091,11 @@
 		vn= shi->geometry.vno;
 	else
 		vn= shi->geometry.vn;
+	
+	shade_jittered_coords(re, shi, RE_MAX_OSA, jitco, &totjitco);
+	copy_v3_v3(co, jitco[0]);
 
-	sample_occ_tree(re, tree, &exclude, shi->geometry.co, vn, shi->shading.thread, onlyshadow, shi->shading.ao, shi->shading.env, shi->shading.indirect);
+	sample_occ_tree(re, tree, &exclude, co, vn, shi->shading.thread, onlyshadow, shi->shading.ao, shi->shading.env, shi->shading.indirect);
 }
 
 void disk_occlusion_sample(Render *re, ShadeInput *shi)

Modified: branches/render25/source/blender/render/intern/source/shadeoutput.c
===================================================================
--- branches/render25/source/blender/render/intern/source/shadeoutput.c	2010-07-30 11:19:41 UTC (rev 30896)
+++ branches/render25/source/blender/render/intern/source/shadeoutput.c	2010-07-30 11:26:38 UTC (rev 30897)
@@ -370,7 +370,7 @@
 
 	/* for better antialising shadow samples are distributed over the subpixel
 	 * sample coordinates, this only works for raytracing depth 0 though */
-	if(!shi->primitive.strand && shi->shading.depth == 0 && count > 1 && count <= max) {
+	if(!shi->primitive.strand && shi->shading.depth == 0 && count > 1) {
 		float xs, ys, zs, view[3];
 		int samp, ordsamp, tot= 0;
 		int osa= (re->params.osa)? re->params.osa: 1;





More information about the Bf-blender-cvs mailing list