double I1 I2 if intens I1 else I1 intens Vector Normalize Nt Normalize

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
double I,I1,I2;
if(intens>1) I1=1; else I1=intens;
Vector r=2*((Normalize(Nt)&Normalize(intens_v-vt)))*Normalize(Nt)-Normalize(intens_v-vt);
//I=0.8*0.5 + I1*(0.8*(Normalize(Nt)&Normalize(intens_v-vt))+0.3*(Normalize(proect)&Normalize(r)));
I2=I1*0.5*(Normalize(Nt)&Normalize(intens_v-vt));
I=I1*0.3*(Normalize(proect)&Normalize(r));
if(I<0) I=0;
if(I2<0) I2=0;
red=R+R*I2;
red+=(I/(I1*0.3))*(255-red);
grn=G+G*I2;
grn+=(I/(I1*0.3))*(255-grn);
blu=B+B*I2;
blu+=(I/(I1*0.3))*(255-blu);
//red=R+(I/(0.8*0.5 + I1*(0.8+0.3)))*(255-R);
//grn=G+(I/(0.8*0.5 + I1*(0.8+0.3)))*(255-G);
//blu=B+(I/(0.8*0.5 + I1*(0.8+0.3)))*(255-B);
//red=0.4*R+I1*0.8*(Normalize(Nt)&Normalize(intens_v-vt))*R+0.3*(Normalize(proect)&Normalize(r))*R;//I1*0.8*(Normalize(Nt)&Normalize(intens_v-vt))*R;//0.4*R;
//grn=0.4*G+I1*0.8*(Normalize(Nt)&Normalize(intens_v-vt))*G+0.3*(Normalize(proect)&Normalize(r))*G;//I1*0.8*(Normalize(Nt)&Normalize(intens_v-vt))*G;//0.4*G;
//blu=0.4*B+I1*0.8*(Normalize(Nt)&Normalize(intens_v-vt))*B+0.3*(Normalize(proect)&Normalize(r))*B;//I