We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
// The Schlick Fresnel approximation is: // // R = R(0) + (1 - R(0)) (1 - cos theta)^5, // // where R(0) is the reflectance at normal indicence. inline Float SchlickWeight(Float cosTheta) { Float m = Clamp(1 - cosTheta, 0, 1); return (m * m) * (m * m) * m; } inline Float FrSchlick(Float R0, Float cosTheta) { return Lerp(SchlickWeight(cosTheta), R0, 1); } inline Spectrum FrSchlick(const Spectrum &R0, Float cosTheta) { return Lerp(SchlickWeight(cosTheta), R0, Spectrum(1.)); }
Lerp here is (1 - SchlickWeight(cosTheta)) * R0 + SchlickWeight(cosTheta) not R0 + (1 - R0) * SchlickWeight(cosTheta)
The text was updated successfully, but these errors were encountered:
@jxo I think it's just the comment equation that is wrong, and the actual function implementation is still correct.
Sorry, something went wrong.
@eric1221bday see here, the comment equation is right. https://en.wikipedia.org/wiki/Schlick's_approximation Lerp definition: inline Float Lerp(Float t, Float v1, Float v2) { return (1 - t) * v1 + t * v2; } Lerp(R0, SchlickWeight(cosTheta), 1) may be right
No branches or pull requests
Lerp here is (1 - SchlickWeight(cosTheta)) * R0 + SchlickWeight(cosTheta)
not R0 + (1 - R0) * SchlickWeight(cosTheta)
The text was updated successfully, but these errors were encountered: