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>2010-02-07 18:24:10 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2010-02-07 18:24:10 +0300
commitf9917af00b5459f56f1108a1aa20498ed1b62ad4 (patch)
treeb46233a8af02960a26cf67582098816a99d6284f /source/blender/render
parent3bd78cf8f65b00b8727ab22d11c5e8210ece7207 (diff)
Fix #20914: non-normalized AO baking was not working anymore.
Diffstat (limited to 'source/blender/render')
-rw-r--r--source/blender/render/intern/include/shading.h2
-rw-r--r--source/blender/render/intern/source/rendercore.c8
-rw-r--r--source/blender/render/intern/source/shadeoutput.c2
3 files changed, 9 insertions, 3 deletions
diff --git a/source/blender/render/intern/include/shading.h b/source/blender/render/intern/include/shading.h
index 95bccd2be1e..d6a18cf2cd8 100644
--- a/source/blender/render/intern/include/shading.h
+++ b/source/blender/render/intern/include/shading.h
@@ -86,8 +86,8 @@ void shade_lamp_loop(struct ShadeInput *shi, struct ShadeResult *shr);
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);
diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c
index dec826faa65..958ed0c2fa5 100644
--- a/source/blender/render/intern/source/rendercore.c
+++ b/source/blender/render/intern/source/rendercore.c
@@ -2135,7 +2135,13 @@ static void bake_shade(void *handle, Object *ob, ShadeInput *shi, int quad, int
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 */
diff --git a/source/blender/render/intern/source/shadeoutput.c b/source/blender/render/intern/source/shadeoutput.c
index eeb353eb66f..85b06837c92 100644
--- a/source/blender/render/intern/source/shadeoutput.c
+++ b/source/blender/render/intern/source/shadeoutput.c
@@ -1050,7 +1050,7 @@ static void ambient_occlusion_apply(ShadeInput *shi, ShadeResult *shr)
}
}
-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;