PDA

View Full Version : BMRT's fresnel() function


CrashVicta
10-07-2003, 10:44 PM
Hi all,

I'm having trouble using BMRT's fresnel() function. I'm positive I'm calling it correctly:
fresnel(V,N,1/ior,Kr,Kt,R,T);
The problem is that I am getting negative values for Kt and values >> 1 for Kr sometimes. Any thoughts?

Thanks,
Victor

rendermaniac
10-08-2003, 12:11 AM
BMRT's fresnel function isn't as physically acurate as it should be. Nor is the one in Pixar's RenderMan. Just have a look at glass.sl - Larry's (I think) comment not mine:

float kr, kt;
fresnel (IN, Nf, (I.N < 0) ? 1.0/eta : eta, kr, kt, Rfldir, Rfrdir);
kt = 1-kr; /* Physically incorrect, but portable */

This is a good way of making sure the reflection and refraction add up to one, but is not acurate. If you want accuracy you'll have to roll your own. It should look good enough doing it this way though.

Simon

CrashVicta
10-08-2003, 02:41 AM
Thanks for your help.
However Kt = 1-Kr isn't working for me becauses I get kr >1 sometimes. Do you know where I can get details on BMRT's implementation of fresnel?

playmesumch00ns
10-08-2003, 10:32 AM
Not meaning to be patronising, but you are normalizing V and N before you pass them aren't you?

CrashVicta
10-09-2003, 04:52 AM
Not meaning to be patronising, but you are normalizing V and N before you pass them aren't you?

Hehe yup absolutely.

CGTalk Moderation
01-16-2006, 07:00 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.