Skip to content

Commit

Permalink
Merge pull request #216 from tkoeppe/abs
Browse files Browse the repository at this point in the history
[renderergl2/tr_main.c] Use floating-point fabsf() for floating-point values
  • Loading branch information
timangus committed Sep 13, 2016
2 parents bbc9e26 + 0eb72cd commit bd062f7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions code/renderergl2/tr_main.c
Expand Up @@ -2055,7 +2055,7 @@ void R_RenderPshadowMaps(const refdef_t *fd)
VectorScale(lightDir, -1.0f, shadow->lightViewAxis[0]);
VectorSet(up, 0, 0, -1);

if ( abs(DotProduct(up, shadow->lightViewAxis[0])) > 0.9f )
if ( fabsf(DotProduct(up, shadow->lightViewAxis[0])) > 0.9f )
{
VectorSet(up, -1, 0, 0);
}
Expand Down Expand Up @@ -2298,7 +2298,7 @@ void R_RenderSunShadowMaps(const refdef_t *fd, int level)
}

// Check if too close to parallel to light direction
if (abs(DotProduct(lightViewAxis[2], lightViewAxis[0])) > 0.9f)
if (fabsf(DotProduct(lightViewAxis[2], lightViewAxis[0])) > 0.9f)
{
if (level == 3 || lightViewIndependentOfCameraView)
{
Expand Down

0 comments on commit bd062f7

Please sign in to comment.