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.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user