[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [20237] trunk/blender/source/blender/ render/intern/source/shadeoutput.c: Bugfix #18676

Ton Roosendaal ton at blender.org
Sun May 17 12:30:13 CEST 2009


Revision: 20237
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=20237
Author:   ton
Date:     2009-05-17 12:30:13 +0200 (Sun, 17 May 2009)

Log Message:
-----------
Bugfix #18676

Texture "map to" Ambient did work now (previous fix) but not for
ambient occlusion yet. 

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

Modified: trunk/blender/source/blender/render/intern/source/shadeoutput.c
===================================================================
--- trunk/blender/source/blender/render/intern/source/shadeoutput.c	2009-05-17 09:56:48 UTC (rev 20236)
+++ trunk/blender/source/blender/render/intern/source/shadeoutput.c	2009-05-17 10:30:13 UTC (rev 20237)
@@ -1007,9 +1007,9 @@
 /* pure AO, check for raytrace and world should have been done */
 void ambient_occlusion(ShadeInput *shi)
 {
-	if((R.wrld.ao_gather_method == WO_AOGATHER_APPROX) && shi->mat->amb!=0.0f)
+	if((R.wrld.ao_gather_method == WO_AOGATHER_APPROX) && shi->amb!=0.0f)
 		sample_occ(&R, shi);
-	else if((R.r.mode & R_RAYTRACE) && shi->mat->amb!=0.0f)
+	else if((R.r.mode & R_RAYTRACE) && shi->amb!=0.0f)
 		ray_ao(shi, shi->ao);
 	else
 		shi->ao[0]= shi->ao[1]= shi->ao[2]= 1.0f;
@@ -1020,8 +1020,8 @@
 void ambient_occlusion_to_diffuse(ShadeInput *shi, float *diff)
 {
 	if((R.r.mode & R_RAYTRACE) || R.wrld.ao_gather_method == WO_AOGATHER_APPROX) {
-		if(shi->mat->amb!=0.0f) {
-			float f= R.wrld.aoenergy*shi->mat->amb;
+		if(shi->amb!=0.0f) {
+			float f= R.wrld.aoenergy*shi->amb;
 
 			if (R.wrld.aomix==WO_AOADDSUB) {
 				diff[0] = 2.0f*shi->ao[0]-1.0f;





More information about the Bf-blender-cvs mailing list