| 23 |
|
|
| 24 |
|
#include "ray.h" |
| 25 |
|
|
| 26 |
+ |
#include "random.h" |
| 27 |
+ |
|
| 28 |
|
#include "resolu.h" |
| 29 |
|
|
| 30 |
|
#include "octree.h" |
| 57 |
|
|
| 58 |
|
extern char VersionID[]; /* version ID string */ |
| 59 |
|
|
| 58 |
– |
extern int stderr_v(); /* standard error output */ |
| 59 |
– |
int (*errvec)() = stderr_v; /* error output vector */ |
| 60 |
– |
int (*wrnvec)() = stderr_v; /* warning output vector */ |
| 61 |
– |
int (*cmdvec)() = NULL; /* command error vector */ |
| 62 |
– |
|
| 60 |
|
int (*trace)() = NULL; /* trace call */ |
| 61 |
|
int do_irrad = 0; /* compute irradiance? */ |
| 62 |
|
|
| 81 |
|
extern unsigned long raynum, nrays; /* ray counts */ |
| 82 |
|
|
| 83 |
|
extern int imm_irrad; /* calculate immediate irradiance? */ |
| 84 |
+ |
extern int lim_dist; /* limit distance? */ |
| 85 |
|
|
| 86 |
|
extern int ralrm; /* seconds between reports */ |
| 87 |
|
|
| 106 |
|
extern double maxdiff; /* max. sample difference */ |
| 107 |
|
extern double dstrpix; /* square pixel distribution */ |
| 108 |
|
|
| 109 |
+ |
extern double mblur; /* motion blur parameter */ |
| 110 |
+ |
|
| 111 |
|
extern double dstrsrc; /* square source distribution */ |
| 112 |
|
extern double shadthresh; /* shadow threshold */ |
| 113 |
|
extern double shadcert; /* shadow testing certainty */ |
| 305 |
|
check(3,"f"); |
| 306 |
|
pixaspect = atof(argv[++i]); |
| 307 |
|
break; |
| 308 |
+ |
case 'm': /* motion */ |
| 309 |
+ |
check(3,"f"); |
| 310 |
+ |
mblur = atof(argv[++i]); |
| 311 |
+ |
break; |
| 312 |
|
#endif |
| 313 |
|
#if RVIEW |
| 314 |
|
case 'e': /* exposure */ |
| 334 |
|
break; |
| 335 |
|
#endif |
| 336 |
|
case 'w': /* warnings */ |
| 337 |
< |
rval = wrnvec != NULL; |
| 337 |
> |
rval = erract[WARNING].pf != NULL; |
| 338 |
|
bool(2,rval); |
| 339 |
< |
if (rval) wrnvec = stderr_v; |
| 340 |
< |
else wrnvec = NULL; |
| 339 |
> |
if (rval) erract[WARNING].pf = wputs; |
| 340 |
> |
else erract[WARNING].pf = NULL; |
| 341 |
|
break; |
| 342 |
|
case 'e': /* error file */ |
| 343 |
|
check(2,"s"); |
| 353 |
|
check(3,"f"); |
| 354 |
|
minweight = atof(argv[++i]); |
| 355 |
|
break; |
| 356 |
+ |
#if RTRACE |
| 357 |
+ |
case 'd': /* distance */ |
| 358 |
+ |
bool(3,lim_dist); |
| 359 |
+ |
break; |
| 360 |
+ |
#endif |
| 361 |
|
default: |
| 362 |
|
goto badopt; |
| 363 |
|
} |
| 776 |
|
} |
| 777 |
|
|
| 778 |
|
|
| 779 |
< |
eputs(s) /* error output */ |
| 780 |
< |
char *s; |
| 779 |
> |
wputs(s) /* warning output function */ |
| 780 |
> |
char *s; |
| 781 |
|
{ |
| 782 |
< |
if (errvec != NULL) |
| 783 |
< |
(*errvec)(s); |
| 775 |
< |
} |
| 776 |
< |
|
| 777 |
< |
|
| 778 |
< |
wputs(s) /* warning output */ |
| 779 |
< |
char *s; |
| 780 |
< |
{ |
| 781 |
< |
int lasterrno = errno; /* save errno */ |
| 782 |
< |
|
| 783 |
< |
if (wrnvec != NULL) |
| 784 |
< |
(*wrnvec)(s); |
| 785 |
< |
|
| 782 |
> |
int lasterrno = errno; |
| 783 |
> |
eputs(s); |
| 784 |
|
errno = lasterrno; |
| 785 |
|
} |
| 786 |
|
|
| 787 |
|
|
| 788 |
< |
cputs(s) /* command error output */ |
| 791 |
< |
char *s; |
| 792 |
< |
{ |
| 793 |
< |
if (cmdvec != NULL) |
| 794 |
< |
(*cmdvec)(s); |
| 795 |
< |
} |
| 796 |
< |
|
| 797 |
< |
|
| 798 |
< |
stderr_v(s) /* put string to stderr */ |
| 788 |
> |
eputs(s) /* put string to stderr */ |
| 789 |
|
register char *s; |
| 790 |
|
{ |
| 791 |
|
static int midline = 0; |
| 874 |
|
#if RPICT |
| 875 |
|
printf("-pa %f\t\t\t# pixel aspect ratio\n", pixaspect); |
| 876 |
|
printf("-pj %f\t\t\t# pixel jitter\n", dstrpix); |
| 877 |
+ |
printf("-pm %f\t\t\t# pixel motion\n", mblur); |
| 878 |
|
#endif |
| 879 |
|
#if RVIEW |
| 880 |
|
printf("-pe %f\t\t\t# pixel exposure\n", exposure); |
| 903 |
|
printf("-ar %-9d\t\t\t# ambient resolution\n", ambres); |
| 904 |
|
printf("-ad %-9d\t\t\t# ambient divisions\n", ambdiv); |
| 905 |
|
printf("-as %-9d\t\t\t# ambient super-samples\n", ambssamp); |
| 906 |
< |
printf("-me %.2e %.2e %.2e\t# extinction coefficient\n", |
| 906 |
> |
printf("-me %.2e %.2e %.2e\t# mist extinction coefficient\n", |
| 907 |
|
colval(cextinction,RED), |
| 908 |
|
colval(cextinction,GRN), |
| 909 |
|
colval(cextinction,BLU)); |
| 910 |
< |
printf("-ma %f %f %f\t# scattering albedo\n", colval(salbedo,RED), |
| 910 |
> |
printf("-ma %f %f %f\t# mist scattering albedo\n", colval(salbedo,RED), |
| 911 |
|
colval(salbedo,GRN), colval(salbedo,BLU)); |
| 912 |
< |
printf("-mg %f\t\t\t# scattering eccentricity\n", seccg); |
| 912 |
> |
printf("-mg %f\t\t\t# mist scattering eccentricity\n", seccg); |
| 913 |
|
printf("-ms %f\t\t\t# mist sampling distance\n", ssampdist); |
| 914 |
|
printf("-lr %-9d\t\t\t# limit reflection\n", maxdepth); |
| 915 |
|
printf("-lw %f\t\t\t# limit weight\n", minweight); |
| 916 |
+ |
#if RTRACE |
| 917 |
+ |
printf(lim_dist ? "-ld+\t\t\t\t# limit distance on\n" : |
| 918 |
+ |
"-ld-\t\t\t\t# limit distance off\n"); |
| 919 |
+ |
#endif |
| 920 |
|
#if RPICT |
| 921 |
|
printf("-t %-9d\t\t\t# time between reports\n", ralrm); |
| 922 |
|
#endif |
| 944 |
|
} |
| 945 |
|
putchar('\n'); |
| 946 |
|
#endif |
| 947 |
< |
printf(wrnvec != NULL ? "-w+\t\t\t\t# warning messages on\n" : |
| 947 |
> |
printf(erract[WARNING].pf != NULL ? |
| 948 |
> |
"-w+\t\t\t\t# warning messages on\n" : |
| 949 |
|
"-w-\t\t\t\t# warning messages off\n"); |
| 950 |
|
} |