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>2012-02-08 01:04:10 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2012-02-08 01:04:10 +0400
commit9467ddb9037c3486bcbe80e9b9be510c05dfe526 (patch)
treefa580cd73237dfe3c925f67922f2946d9b22a8be /source/blender/render/intern
parent54c7f374c8bc25fbca40ab950c83635fd7f18655 (diff)
Fix #30081: the fix for #30026 related to rendering indirect/environment light
with material ambient zero broke backwards compatibility too much. The behavior to have ambient zero affect things even if it is not used as a factor does not make much sense but keeps things compatible. Now instead fixed the use of uninitialized memory.
Diffstat (limited to 'source/blender/render/intern')
-rw-r--r--source/blender/render/intern/source/shadeoutput.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/render/intern/source/shadeoutput.c b/source/blender/render/intern/source/shadeoutput.c
index 0e9cfd11a68..9aac7aae53e 100644
--- a/source/blender/render/intern/source/shadeoutput.c
+++ b/source/blender/render/intern/source/shadeoutput.c
@@ -1030,12 +1030,17 @@ static void do_specular_ramp(ShadeInput *shi, float is, float t, float spec[3])
/* preprocess, textures were not done, don't use shi->amb for that reason */
void ambient_occlusion(ShadeInput *shi)
{
- if(R.wrld.ao_gather_method == WO_AOGATHER_APPROX)
+ if((R.wrld.ao_gather_method == WO_AOGATHER_APPROX) && shi->mat->amb!=0.0f) {
sample_occ(&R, shi);
- else if(R.r.mode & R_RAYTRACE)
+ }
+ else if((R.r.mode & R_RAYTRACE) && shi->mat->amb!=0.0f) {
ray_ao(shi, shi->ao, shi->env);
- else
+ }
+ else {
shi->ao[0]= shi->ao[1]= shi->ao[2]= 1.0f;
+ zero_v3(shi->env);
+ zero_v3(shi->indirect);
+ }
}