Talk:Schlick's approximation

n₁ and n₂

edit

Looking at the formula for R₀, it seems to me that R₀ is the same entering a medium versus leaving a medium, which may be conceptually important to state explicitly. It does matter a great deal though which angle you measure and the article isn't clear enough about it and doesn't motivate the approximation to begin with.

Also, traditionally normalised vectors are written as lowercase letters with hats on. Maybe there's a different convention in computer graphics, but Wikipedia is targeted at the general public and I think general conventions should be used. The article also isn't clear enough about which vectors to use.

Multifacet

edit

The language in that paragraph paints with too broad of a brush and doesn't cite enough sources.

‘Approximation’

edit

Having read his paper, which by the way doesn't score high marks for mathematical rigour, I don't think the article properly conveys that this is a rough graphical approximation and not an approximation in the usual physical sense. It doesn't try to approximate the actual curve, rather this power formula is used because it's cheap to calculate on commodity hardware, which is also why the power is an integer. The author wasn't concerned with the precise shape of the curve, beyond that it should start and end at the right points and that in the perpendicular case the derivative and double derivative should be 0, I'm guessing because a sudden change in the derivative might trigger the eye's edge detection and might cause ghost spots to appear.

The author claims the approximation sticks to the actual curve exceptionally well, but this perhaps somewhat flattering evaluation is due to the way his statistical error calculation works, which doesn't look at the whole image integrally like we would but at individual points, and which also gives undue weight to low-contribution points.

By the way, the author never explains why the exponent 5 is used. Well, if one plots the exponent implied by the terminal slope of the actual full Fresnel function from n = n₂ / n₁ = 1 up to infinity, one gets a kind of U-shape. On the left it's very steep with a vertical asymptote at n = 1, then it reaches a minimum near nglass in air = 1.5 and then it rises more gently towards infinity. At the minimum it's just over 6, but because the actual curve isn't a simple power function, the effective exponent needed is 5, and 4 is definitely too low.

An effective exponent of 6 would only be a closer match if n were outside the range (just eyeballing here) of about 1.22 to 2.45, which includes most common materials. Outside of this range you're talking about liquid helium, or maybe perfluorohexane if you want to emphasise its weird look, on the low end, or rare minerals like moissanite on the high end. But if you're going to use pow( ) in your shader anyway, like some of Nvidia's documentation actually does, maybe there's something to be said for tweaking the exponent. I think it's usually not worth it though and I've seen a benchmark that seems to show that on modern hardware calculating the power manually is almost three times as fast.