690 |
|
puts("\tc"); /* put diffuse component */ |
691 |
|
d = cxyz[0] + cxyz[1] + cxyz[2]; |
692 |
|
if (d > FTINY) |
693 |
< |
printf("\t\tcxy %.4f %.4f\n", cxyz[0]/d, cxyz[1]/d); |
694 |
< |
printf("\trd %.4f\n", cxyz[1]*(1. - fa->farg[3])); |
693 |
> |
printf("\t\tcxy %.6f %.6f\n", cxyz[0]/d, cxyz[1]/d); |
694 |
> |
printf("\trd %.6f\n", cxyz[1]*(1. - fa->farg[3])); |
695 |
|
if (fa->farg[3] > FTINY) { /* put specular component */ |
696 |
|
puts("\tc"); |
697 |
< |
printf("\trs %.4f %.4f\n", fa->farg[3], |
697 |
> |
printf("\trs %.6f %.6f\n", fa->farg[3], |
698 |
|
typ[7]=='2' ? .5*(fa->farg[4] + fa->farg[5]) : |
699 |
|
fa->farg[4]); |
700 |
|
} |
721 |
|
puts("\tc"); /* put diffuse component */ |
722 |
|
d = cxyz[0] + cxyz[1] + cxyz[2]; |
723 |
|
if (d > FTINY) |
724 |
< |
printf("\t\tcxy %.4f %.4f\n", cxyz[0]/d, cxyz[1]/d); |
725 |
< |
printf("\trd %.4f\n", cxyz[1]*(1. - fa->farg[3])); |
724 |
> |
printf("\t\tcxy %.6f %.6f\n", cxyz[0]/d, cxyz[1]/d); |
725 |
> |
printf("\trd %.6f\n", cxyz[1]*(1. - fa->farg[3])); |
726 |
|
/* put specular component */ |
727 |
< |
printf("\trs %.4f %.4f\n", cxyz[1]*fa->farg[3], |
727 |
> |
printf("\trs %.6f %.6f\n", cxyz[1]*fa->farg[3], |
728 |
|
typ[5]=='2' ? .5*(fa->farg[4] + fa->farg[5]) : |
729 |
|
fa->farg[4]); |
730 |
|
return(0); |
761 |
|
puts("\tc"); |
762 |
|
d = cxyz[0] + cxyz[1] + cxyz[2]; |
763 |
|
if (d > FTINY) |
764 |
< |
printf("\t\tcxy %.4f %.4f\n", cxyz[0]/d, cxyz[1]/d); |
765 |
< |
printf("\trs %.4f 0\n", cxyz[1]); |
764 |
> |
printf("\t\tcxy %.6f %.6f\n", cxyz[0]/d, cxyz[1]/d); |
765 |
> |
printf("\trs %.6f 0\n", cxyz[1]); |
766 |
|
rgb_cie(cxyz, trgb); /* put transmitted component */ |
767 |
|
puts("\tc"); |
768 |
|
d = cxyz[0] + cxyz[1] + cxyz[2]; |
769 |
|
if (d > FTINY) |
770 |
< |
printf("\t\tcxy %.4f %.4f\n", cxyz[0]/d, cxyz[1]/d); |
771 |
< |
printf("\tts %.4f 0\n", cxyz[1]); |
770 |
> |
printf("\t\tcxy %.6f %.6f\n", cxyz[0]/d, cxyz[1]/d); |
771 |
> |
printf("\tts %.6f 0\n", cxyz[1]); |
772 |
|
return(0); |
773 |
|
} |
774 |
|
|
795 |
|
printf("\tir %f 0\n", fa->farg[3]); /* put index of refraction */ |
796 |
|
printf("\tsides 1\n"); |
797 |
|
puts("\tc"); /* put reflected component */ |
798 |
< |
printf("\trs %.4f 0\n", F); |
798 |
> |
printf("\trs %.6f 0\n", F); |
799 |
|
rgb_cie(cxyz, trgb); /* put transmitted component */ |
800 |
|
puts("\tc"); |
801 |
|
d = cxyz[0] + cxyz[1] + cxyz[2]; |
802 |
|
if (d > FTINY) |
803 |
< |
printf("\t\tcxy %.4f %.4f\n", cxyz[0]/d, cxyz[1]/d); |
804 |
< |
printf("\tts %.4f 0\n", cxyz[1]); |
803 |
> |
printf("\t\tcxy %.6f %.6f\n", cxyz[0]/d, cxyz[1]/d); |
804 |
> |
printf("\tts %.6f 0\n", cxyz[1]); |
805 |
|
return(0); |
806 |
|
} |
807 |
|
|
829 |
|
puts("\tc"); /* put specular component */ |
830 |
|
d = cxyz[0] + cxyz[1] + cxyz[2]; |
831 |
|
if (d > FTINY) |
832 |
< |
printf("\t\tcxy %.4f %.4f\n", cxyz[0]/d, cxyz[1]/d); |
833 |
< |
printf("\trs %.4f 0\n", cxyz[1]); |
832 |
> |
printf("\t\tcxy %.6f %.6f\n", cxyz[0]/d, cxyz[1]/d); |
833 |
> |
printf("\trs %.6f 0\n", cxyz[1]); |
834 |
|
return(0); |
835 |
|
} |
836 |
|
|
865 |
|
puts("\tc"); /* put transmitted diffuse */ |
866 |
|
d = cxyz[0] + cxyz[1] + cxyz[2]; |
867 |
|
if (d > FTINY) |
868 |
< |
printf("\t\tcxy %.4f %.4f\n", cxyz[0]/d, cxyz[1]/d); |
869 |
< |
printf("\ttd %.4f\n", cxyz[1]*trans*(1. - fa->farg[3])*(1. - tspec)); |
868 |
> |
printf("\t\tcxy %.6f %.6f\n", cxyz[0]/d, cxyz[1]/d); |
869 |
> |
printf("\ttd %.6f\n", cxyz[1]*trans*(1. - fa->farg[3])*(1. - tspec)); |
870 |
|
/* put transmitted specular */ |
871 |
< |
printf("\tts %.4f %.4f\n", cxyz[1]*trans*tspec*(1. - fa->farg[3]), rough); |
871 |
> |
printf("\tts %.6f %.6f\n", cxyz[1]*trans*tspec*(1. - fa->farg[3]), rough); |
872 |
|
/* put reflected diffuse */ |
873 |
< |
printf("\trd %.4f\n", cxyz[1]*(1. - fa->farg[3])*(1. - trans)); |
873 |
> |
printf("\trd %.6f\n", cxyz[1]*(1. - fa->farg[3])*(1. - trans)); |
874 |
|
puts("\tc"); /* put reflected specular */ |
875 |
< |
printf("\trs %.4f %.4f\n", fa->farg[3], rough); |
875 |
> |
printf("\trs %.6f %.6f\n", fa->farg[3], rough); |
876 |
|
return(0); |
877 |
|
} |
878 |
|
|
896 |
|
d = cxyz[0] + cxyz[1] + cxyz[2]; |
897 |
|
puts("\tc"); |
898 |
|
if (d > FTINY) |
899 |
< |
printf("\t\tcxy %.4f %.4f\n", cxyz[0]/d, cxyz[1]/d); |
899 |
> |
printf("\t\tcxy %.6f %.6f\n", cxyz[0]/d, cxyz[1]/d); |
900 |
|
printf("\ted %.4g\n", cxyz[1]*(PI*WHTEFFICACY)); |
901 |
|
return(0); |
902 |
|
} |