[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [26679] trunk/blender/source/blender/ render/intern: Fix #20914: non-normalized AO baking was not working anymore .
Brecht Van Lommel
brecht at blender.org
Sun Feb 7 16:24:10 CET 2010
Revision: 26679
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=26679
Author: blendix
Date: 2010-02-07 16:24:10 +0100 (Sun, 07 Feb 2010)
Log Message:
-----------
Fix #20914: non-normalized AO baking was not working anymore.
Modified Paths:
--------------
trunk/blender/source/blender/render/intern/include/shading.h
trunk/blender/source/blender/render/intern/source/rendercore.c
trunk/blender/source/blender/render/intern/source/shadeoutput.c
Modified: trunk/blender/source/blender/render/intern/include/shading.h
===================================================================
--- trunk/blender/source/blender/render/intern/include/shading.h 2010-02-07 14:59:00 UTC (rev 26678)
+++ trunk/blender/source/blender/render/intern/include/shading.h 2010-02-07 15:24:10 UTC (rev 26679)
@@ -86,8 +86,8 @@
void shade_color(struct ShadeInput *shi, ShadeResult *shr);
-void ambient_occlusion_to_diffuse(struct ShadeInput *shi, float *diff);
void ambient_occlusion(struct ShadeInput *shi);
+void environment_lighting_apply(struct ShadeInput *shi, struct ShadeResult *shr);
ListBase *get_lights(struct ShadeInput *shi);
float lamp_get_visibility(struct LampRen *lar, float *co, float *lv, float *dist);
Modified: trunk/blender/source/blender/render/intern/source/rendercore.c
===================================================================
--- trunk/blender/source/blender/render/intern/source/rendercore.c 2010-02-07 14:59:00 UTC (rev 26678)
+++ trunk/blender/source/blender/render/intern/source/rendercore.c 2010-02-07 15:24:10 UTC (rev 26679)
@@ -2135,7 +2135,13 @@
if(bs->type==RE_BAKE_AO) {
ambient_occlusion(shi);
- VECCOPY(shr.combined, shi->ao)
+ if(R.r.bake_flag & R_BAKE_NORMALIZE) {
+ copy_v3_v3(shr.combined, shi->ao);
+ }
+ else {
+ zero_v3(shr.combined);
+ environment_lighting_apply(shi, &shr);
+ }
}
else {
if (bs->type==RE_BAKE_SHADOW) /* Why do shadows set the color anyhow?, ignore material color for baking */
Modified: trunk/blender/source/blender/render/intern/source/shadeoutput.c
===================================================================
--- trunk/blender/source/blender/render/intern/source/shadeoutput.c 2010-02-07 14:59:00 UTC (rev 26678)
+++ trunk/blender/source/blender/render/intern/source/shadeoutput.c 2010-02-07 15:24:10 UTC (rev 26679)
@@ -1050,7 +1050,7 @@
}
}
-static void environment_lighting_apply(ShadeInput *shi, ShadeResult *shr)
+void environment_lighting_apply(ShadeInput *shi, ShadeResult *shr)
{
float f= R.wrld.ao_env_energy*shi->amb;
More information about the Bf-blender-cvs
mailing list