| 10 |
|
#include "copyright.h" |
| 11 |
|
|
| 12 |
|
#include "ray.h" |
| 13 |
+ |
#include "func.h" |
| 14 |
|
#include "paths.h" |
| 15 |
|
#include "pmapopt.h" |
| 16 |
|
|
| 17 |
|
extern char *progname; /* global argv[0] */ |
| 18 |
|
|
| 19 |
|
char RFeatureList[2048] = /* newline-separated feature list */ |
| 20 |
< |
"AdaptiveShadowTesting\nVirtualSources\nSecondarySources\n" |
| 21 |
< |
"SourceSubsampling\nSourceVisibility\nAmbientModifierSelection\n" |
| 22 |
< |
"PathTracing\nBackFaceVisibility\nRussianRoulette\nLowDiscrepancySeq\n" |
| 23 |
< |
"SpecularSampling\nMaterialMixtures\nAntimatter\n" |
| 24 |
< |
"ParticipatingMedia=Mist\nScatteringModels=WGMD,Ashikhmin-Shirley\n" |
| 20 |
> |
"VirtualSources\nSecondarySources\nSourceSubsampling\n" |
| 21 |
> |
"SourceVisibility\nAmbientModifierSelection\n" |
| 22 |
> |
"PathTracing\nRussianRoulette\nLowDiscrepancySeq\n" |
| 23 |
> |
"SpecularSampling\nMaterialMixtures\nAntimatter\nBackFaceVisibility\n" |
| 24 |
> |
"ScatteringModels=WGMD,Ashikhmin-Shirley\n" |
| 25 |
|
"TabulatedBSDFs=DataFile,KlemsXML,TensorTreeXML,+ViewPeakExtraction\n" |
| 26 |
|
"Instancing=Octree,TriangleMesh\nAliases\n" |
| 27 |
+ |
#if MAXCSAMP>3 |
| 28 |
+ |
"Hyperspectral\n" |
| 29 |
+ |
#endif |
| 30 |
|
#if !defined(SHADCACHE) || SHADCACHE > 0 |
| 31 |
|
"ShadowCache\n" |
| 32 |
|
#endif |
| 76 |
|
while (*reqs && (*cp = *reqs++) != ',') |
| 77 |
|
cp++; |
| 78 |
|
*cp = '\0'; |
| 79 |
< |
n = cp - subfeat; |
| 80 |
< |
if (!(cp = strstr(mysublist, subfeat)) || |
| 81 |
< |
(cp[n] != ',') & (cp[n] != '\n')) |
| 79 |
> |
if (!(n = cp - subfeat)) |
| 80 |
> |
continue; /* empty subfeature */ |
| 81 |
> |
for (cp = mysublist; (cp = strstr(cp, subfeat)) != NULL; cp++) |
| 82 |
> |
if ((cp[-1] == ',') | (cp[-1] == '=') && |
| 83 |
> |
(cp[n] == ',') | (cp[n] == '\n')) |
| 84 |
> |
break; /* match */ |
| 85 |
> |
if (!cp) |
| 86 |
|
return(0); /* missing this one! */ |
| 87 |
|
} |
| 88 |
|
return(1); /* matched them all */ |
| 314 |
|
return(1); |
| 315 |
|
} |
| 316 |
|
break; |
| 317 |
+ |
case 'f': /* .cal file */ |
| 318 |
+ |
if (av[0][2]) |
| 319 |
+ |
break; |
| 320 |
+ |
check(2,"s"); |
| 321 |
+ |
loadfunc(av[1]); |
| 322 |
+ |
return(1); |
| 323 |
+ |
case 'e': /* .cal expression */ |
| 324 |
+ |
if (av[0][2]) |
| 325 |
+ |
break; |
| 326 |
+ |
check(2,"s"); |
| 327 |
+ |
if (!strchr(av[1], '=') && !strchr(av[1], ':')) |
| 328 |
+ |
break; |
| 329 |
+ |
scompile(av[1], NULL, 0); |
| 330 |
+ |
return(1); |
| 331 |
+ |
#if MAXCSAMP>3 |
| 332 |
+ |
case 'c': /* spectral sampling */ |
| 333 |
+ |
switch (av[0][2]) { |
| 334 |
+ |
case 's': /* spectral bin count */ |
| 335 |
+ |
check(3,"i"); |
| 336 |
+ |
NCSAMP = atoi(av[1]); |
| 337 |
+ |
return(1); |
| 338 |
+ |
case 'w': /* wavelength extrema */ |
| 339 |
+ |
check(3,"ff"); |
| 340 |
+ |
WLPART[0] = atof(av[1]); |
| 341 |
+ |
WLPART[3] = atof(av[2]); |
| 342 |
+ |
return(2); |
| 343 |
+ |
} |
| 344 |
+ |
break; |
| 345 |
+ |
#endif |
| 346 |
|
} |
| 347 |
|
|
| 348 |
|
/* PMAP: Parse photon mapping options */ |
| 390 |
|
colval(salbedo,GRN), colval(salbedo,BLU)); |
| 391 |
|
printf("-mg %f\t\t\t# mist scattering eccentricity\n", seccg); |
| 392 |
|
printf("-ms %f\t\t\t# mist sampling distance\n", ssampdist); |
| 393 |
+ |
if (NCSAMP > 3) { |
| 394 |
+ |
printf("-cs %-2d\t\t\t\t# number of spectral bins\n", NCSAMP); |
| 395 |
+ |
printf("-cw %3.0f %3.0f\t\t\t# wavelength limits (nm)\n", |
| 396 |
+ |
WLPART[3], WLPART[0]); |
| 397 |
+ |
} |
| 398 |
|
printf("-lr %-9d\t\t\t# limit reflection%s\n", maxdepth, |
| 399 |
|
maxdepth<=0 ? " (Russian roulette)" : ""); |
| 400 |
|
printf("-lw %.2e\t\t\t# limit weight\n", minweight); |