Bug fix #2431
Underflow case in Blinn spec... resulting in large negative values to be returned in certain cases, causing (again!) black dots. Thanks randall for clear report with nice demo file. :)
This commit is contained in:
@@ -794,6 +794,7 @@ float Blinn_Spec(float *n, float *l, float *v, float refrac, float spec_power )
|
|||||||
ang = saacos(nh);
|
ang = saacos(nh);
|
||||||
|
|
||||||
i= f * g * exp((double)(-(ang*ang) / (2.0*spec_power*spec_power)));
|
i= f * g * exp((double)(-(ang*ang) / (2.0*spec_power*spec_power)));
|
||||||
|
if(i<0.0) i= 0.0;
|
||||||
|
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user