[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15027] trunk/blender/source/blender/ render/intern/source/rayshade.c: bugfix for baking AO with greater then 16 samples, since it was being clamped in sphere_sampler but not in ray_ao_spheresamp that calls it .

Campbell Barton ideasman42 at gmail.com
Wed May 28 19:13:15 CEST 2008


Revision: 15027
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15027
Author:   campbellbarton
Date:     2008-05-28 19:13:15 +0200 (Wed, 28 May 2008)

Log Message:
-----------
bugfix for baking AO with greater then 16 samples, since it was being clamped in sphere_sampler but not in ray_ao_spheresamp that calls it. giving uneven art deco 
results.

Modified Paths:
--------------
    trunk/blender/source/blender/render/intern/source/rayshade.c

Modified: trunk/blender/source/blender/render/intern/source/rayshade.c
===================================================================
--- trunk/blender/source/blender/render/intern/source/rayshade.c	2008-05-28 16:39:05 UTC (rev 15026)
+++ trunk/blender/source/blender/render/intern/source/rayshade.c	2008-05-28 17:13:15 UTC (rev 15027)
@@ -1473,8 +1473,6 @@
 	int tot;
 	float *vec;
 	
-	if(resol>16) resol= 16;
-	
 	tot= 2*resol*resol;
 
 	if (type & WO_AORNDSMP) {
@@ -1663,7 +1661,7 @@
 	float *vec, *nrm, div, bias, sh=0.0f;
 	float maxdist = R.wrld.aodist;
 	float dxyview[3];
-	int j= -1, tot, actual=0, skyadded=0, aocolor;
+	int j= -1, tot, actual=0, skyadded=0, aocolor, resol= R.wrld.aosamp;
 	
 	isec.faceorig= (RayFace*)shi->vlr;
 	isec.oborig= RAY_OBJECT_SET(&R, shi->obi);
@@ -1690,14 +1688,16 @@
 	if(shi->mat->mode & MA_ONLYSHADOW)
 		aocolor= WO_AOPLAIN;
 	
-	vec= sphere_sampler(R.wrld.aomode, R.wrld.aosamp, shi->thread, shi->xs, shi->ys);
+	if(resol>32) resol= 32;
 	
+	vec= sphere_sampler(R.wrld.aomode, resol, shi->thread, shi->xs, shi->ys);
+	
 	// warning: since we use full sphere now, and dotproduct is below, we do twice as much
-	tot= 2*R.wrld.aosamp*R.wrld.aosamp;
+	tot= 2*resol*resol;
 
 	if(aocolor == WO_AOSKYTEX) {
-		dxyview[0]= 1.0f/(float)R.wrld.aosamp;
-		dxyview[1]= 1.0f/(float)R.wrld.aosamp;
+		dxyview[0]= 1.0f/(float)resol;
+		dxyview[1]= 1.0f/(float)resol;
 		dxyview[2]= 0.0f;
 	}
 	





More information about the Bf-blender-cvs mailing list