PDA

View Full Version : ref_at_norm_incidence


Ace-Angel
02-26-2012, 08:34 AM
Hey to all,

I was wondering if anyone had any idea about the following;

fresnel = pow( 1.0f - VdotH, 5.0f ) * ( 1.0f - ref_at_norm_incidence ) + ref_at_norm_incidence;
I'm abit lost as to what ref_at_norm_incidence may stand for, is the plain old normal, or is there something more sinister?

Cheers!

equil
02-26-2012, 09:41 AM
Well, that's schlick's approximation, so it's safe to assume that it says "reflectance at normal angle". In essence that's your specular value.

It's not a bad idea to check out how the actual fresnel calculations (http://en.wikipedia.org/wiki/Fresnel_reflection) work. the value of R (in the context of computer graphics it's more generally referred to as f0) is calculated from the index of refractions of the material and the medium it's in. Video games all take place in a vacuum so the equation gets simplified to

((1-IOR)/(1+IOR))^2

as an example here's the reflectance at normal incidence of window glass (IOR 1.520)

( (1-1.52)/(1+1.52) )^2 = 0.04...
transform that into an RGB value..
0.04*255 = ~10

piece of cake. it's a bit more involved for non-dielectric materials but i hope this explains what the value means.

Ace-Angel
02-26-2012, 12:07 PM
Ah, thanks, that makes sense, and thank you also for the extra info. it helps to visualize it better.

Oh, by the way, Schlick's approx. does get included into CookTorrance, right? I was following this gem here: http://content.gpwiki.org/index.php/D3DBook:%28Lighting%29_Cook-Torrance

Never knew Cook had Schlick's in it.