Commit aa344fc8 authored by Rico Schüller's avatar Rico Schüller Committed by Alexandre Julliard

d3dx9: Use float function in D3DXFresnelTerm().

parent e420409b
......@@ -81,13 +81,14 @@ FLOAT WINAPI D3DXFresnelTerm(FLOAT costheta, FLOAT refractionindex)
{
FLOAT a, d, g, result;
TRACE("(%f, %f)\n", costheta, refractionindex);
TRACE("costheta %f, refractionindex %f)\n", costheta, refractionindex);
g = sqrt(refractionindex * refractionindex + costheta * costheta - 1.0f);
g = sqrtf(refractionindex * refractionindex + costheta * costheta - 1.0f);
a = g + costheta;
d = g - costheta;
result = ( costheta * a - 1.0f ) * ( costheta * a - 1.0f ) / ( ( costheta * d + 1.0f ) * ( costheta * d + 1.0f ) ) + 1.0f;
result = result * 0.5f * d * d / ( a * a );
result = (costheta * a - 1.0f) * (costheta * a - 1.0f) / ((costheta * d + 1.0f) * (costheta * d + 1.0f)) + 1.0f;
result *= 0.5f * d * d / (a * a);
return result;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment