Hi...I have a some problem with refract() function
I've used this code
[code]surface test_refraction()
{
float IOR = 1.6;
normal Nn = normalize(N);
vector In = normalize(I);
float eta = (In.Nn < 0 ? IOR/1 : IOR);
vector Refr = refract(In, Nn, eta);
color Sc = trace (P,Refr,"samples",8);
Ci= Sc;
Oi=Os;
}[/code]
and got this image below:
[img]http://img9.imageshack.us/img9/7602/normalize.png[/img]
looks like something wrong with refraction
but if I not normalize N..I get correct result (I guess so =) )but at
compiling time getting error "normal N should be normalized"
[img]http://img263.imageshack.us/img263/605/wonormalize.png[/img]
so can you help me... where I was mistaken? what's wrong?
would be very appreciated for any help