mirror of
https://github.com/ioquake/ioq3.git
synced 2025-02-21 11:11:20 +00:00
Add epsilon to avoid division by zero in CalcSpecular().
This commit is contained in:
parent
bc7842e301
commit
66cb20a7f3
1 changed files with 1 additions and 1 deletions
|
@ -201,7 +201,7 @@ vec3 CalcSpecular(vec3 specular, float NH, float EH, float roughness)
|
|||
float rr = roughness*roughness;
|
||||
float rrrr = rr*rr;
|
||||
float d = (NH * NH) * (rrrr - 1.0) + 1.0;
|
||||
float v = (EH * EH) * (roughness + 0.5);
|
||||
float v = (EH * EH) * (roughness + 0.5) + EPSILON;
|
||||
return specular * (rrrr / (4.0 * d * d * v));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue