Hi.
I need a litle help.
I know the dot product between 2 vectors A and B
is |A|*|B|*cos alpha
So, if the angle is (in istance) 110the dot prod is negative.
I'm written a simple exercise shader:
surface foo (float Ka = 1, Kd = 1) {
//normal Nf = faceforward (normalize(N),I);
normal Nf = Ng;
float ill;
color C = 0;
illuminance (P, Nf, PI/2){
ill = (normalize (L). normalize(Nf));
if (ill<< 0){
printf("%f\n", ill);}
C += Cl * ill;
}
Ci = Cs * C;
Oi = Os; Ci *= Oi;
}
And test it into a simple scene, on a sphere.
The strange is the 'ill' is always>> 0. I don't understand why...
Can you help me?
Thanks,
Manuel Bastioni