ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/cv/bsdf2rad.c
(Generate patch)

Comparing ray/src/cv/bsdf2rad.c (file contents):
Revision 2.23 by greg, Tue Apr 11 03:47:23 2017 UTC vs.
Revision 2.33 by greg, Mon Oct 2 22:11:32 2017 UTC

# Line 13 | Line 13 | static const char RCSid[] = "$Id$";
13   #include "resolu.h"
14   #include "bsdfrep.h"
15  
16 + #ifndef NINCIDENT
17   #define NINCIDENT       37              /* number of samples/hemisphere */
18 <
18 > #endif
19 > #ifndef GRIDSTEP
20   #define GRIDSTEP        2               /* our grid step size */
21 + #endif
22   #define SAMPRES         (GRIDRES/GRIDSTEP)
23  
24   int     front_comp = 0;                 /* front component flags (SDsamp*) */
# Line 24 | Line 27 | double overall_min = 1./PI;            /* overall minimum BSDF v
27   double  min_log10;                      /* smallest log10 value for plotting */
28   double  overall_max = .0;               /* overall maximum BSDF value */
29  
30 < char    ourTempDir[TEMPLEN] = "";       /* our temporary directory */
30 > char    ourTempDir[TEMPLEN+1] = "";     /* our temporary directory */
31  
32 < const char      frpref[] = "frefl";
33 < const char      ftpref[] = "ftrans";
34 < const char      brpref[] = "brefl";
35 < const char      btpref[] = "btrans";
32 > const char      frpref[] = "rf";
33 > const char      ftpref[] = "tf";
34 > const char      brpref[] = "rb";
35 > const char      btpref[] = "tb";
36   const char      dsuffix[] = ".txt";
37  
38 < const char      sph_mat[] = "BSDFmat";
38 > const char      sph_fmat[] = "fBSDFmat";
39 > const char      sph_bmat[] = "bBSDFmat";
40   const double    sph_rad = 10.;
41   const double    sph_xoffset = 15.;
42  
# Line 41 | Line 45 | const double   sph_xoffset = 15.;
45  
46   #define FEQ(a,b)        ((a)-(b) <= 1e-7 && (b)-(a) <= 1e-7)
47  
48 < #define set_minlog()    (min_log10 = log10(overall_min + 1e-5) - .1)
48 > #define set_minlog()    overall_min = (overall_min < 1e-5) ? 1e-5 : overall_min; \
49 >                                min_log10 = log10(overall_min) - .1
50  
51   char    *progname;
52  
# Line 75 | Line 80 | cvt_sposition(FVECT sp, const FVECT iv, int inc_side)
80   static char *
81   tfile_name(const char *prefix, const char *suffix, int i)
82   {
83 <        static char     buf[128];
83 >        static char     buf[256];
84  
85          if (!ourTempDir[0]) {           /* create temporary directory */
86                  mktemp(strcpy(ourTempDir,TEMPLATE));
# Line 269 | Line 274 | build_wRBF(void)
274  
275   /* Put out mirror arrow for the given incident vector */
276   static void
277 < put_mirror_arrow(const FVECT ivec, int inc_side)
277 > put_mirror_arrow(const FVECT origin, const FVECT nrm)
278   {
279          const double    arrow_len = 1.2*bsdf_rad;
280          const double    tip_len = 0.2*bsdf_rad;
281 <        FVECT           origin, refl;
281 >        static int      cnt = 1;
282 >        FVECT           refl;
283          int             i;
284  
285 <        cvt_sposition(origin, ivec, inc_side);
285 >        refl[0] = 2.*nrm[2]*nrm[0];
286 >        refl[1] = 2.*nrm[2]*nrm[1];
287 >        refl[2] = 2.*nrm[2]*nrm[2] - 1.;
288  
289 <        refl[0] = -2.*ivec[2]*ivec[0];
290 <        refl[1] = -2.*ivec[2]*ivec[1];
283 <        refl[2] = 2.*ivec[2]*ivec[2] - 1.;
284 <
285 <        printf("\n# Mirror arrow\n");
286 <        printf("\narrow_mat cylinder inc_dir\n0\n0\n7");
289 >        printf("\n# Mirror arrow #%d\n", cnt);
290 >        printf("\nshaft_mat cylinder inc_dir%d\n0\n0\n7", cnt);
291          printf("\n\t%f %f %f\n\t%f %f %f\n\t%f\n",
292                          origin[0], origin[1], origin[2]+arrow_len,
293                          origin[0], origin[1], origin[2],
294                          arrow_rad);
295 <        printf("\narrow_mat cylinder mir_dir\n0\n0\n7");
295 >        printf("\nshaft_mat cylinder mir_dir%d\n0\n0\n7", cnt);
296          printf("\n\t%f %f %f\n\t%f %f %f\n\t%f\n",
297                          origin[0], origin[1], origin[2],
298                          origin[0] + arrow_len*refl[0],
299                          origin[1] + arrow_len*refl[1],
300                          origin[2] + arrow_len*refl[2],
301                          arrow_rad);
302 <        printf("\narrow_mat cone mir_tip\n0\n0\n8");
302 >        printf("\ntip_mat cone mir_tip%d\n0\n0\n8", cnt);
303          printf("\n\t%f %f %f\n\t%f %f %f\n\t%f 0\n",
304                          origin[0] + (arrow_len-.5*tip_len)*refl[0],
305                          origin[1] + (arrow_len-.5*tip_len)*refl[1],
# Line 304 | Line 308 | put_mirror_arrow(const FVECT ivec, int inc_side)
308                          origin[1] + (arrow_len+.5*tip_len)*refl[1],
309                          origin[2] + (arrow_len+.5*tip_len)*refl[2],
310                          2.*arrow_rad);
311 +        ++cnt;
312   }
313  
314   /* Put out transmitted direction arrow for the given incident vector */
315   static void
316 < put_trans_arrow(const FVECT ivec, int inc_side)
316 > put_trans_arrow(const FVECT origin)
317   {
318          const double    arrow_len = 1.2*bsdf_rad;
319          const double    tip_len = 0.2*bsdf_rad;
320 <        FVECT           origin;
320 >        static int      cnt = 1;
321          int             i;
322  
323 <        cvt_sposition(origin, ivec, inc_side);
324 <
320 <        printf("\n# Transmission arrow\n");
321 <        printf("\narrow_mat cylinder trans_dir\n0\n0\n7");
323 >        printf("\n# Transmission arrow #%d\n", cnt);
324 >        printf("\nshaft_mat cylinder trans_dir%d\n0\n0\n7", cnt);
325          printf("\n\t%f %f %f\n\t%f %f %f\n\t%f\n",
326                          origin[0], origin[1], origin[2],
327                          origin[0], origin[1], origin[2]-arrow_len,
328                          arrow_rad);
329 <        printf("\narrow_mat cone trans_tip\n0\n0\n8");
329 >        printf("\ntip_mat cone trans_tip%d\n0\n0\n8", cnt);
330          printf("\n\t%f %f %f\n\t%f %f %f\n\t%f 0\n",
331                          origin[0], origin[1], origin[2]-arrow_len+.5*tip_len,
332                          origin[0], origin[1], origin[2]-arrow_len-.5*tip_len,
333 <                        2.*arrow_rad);  
333 >                        2.*arrow_rad);
334 >        ++cnt;
335   }
336  
337   /* Compute rotation (x,y,z) => (xp,yp,zp) */
# Line 371 | Line 375 | static int
375   put_BSDFs(void)
376   {
377          const double    scalef = bsdf_rad/(log10(overall_max) - min_log10);
378 <        FVECT           ivec, sorg, upv;
378 >        FVECT           ivec, sorg, nrm, upv;
379          RREAL           vMtx[3][3];
380          char            *fname;
381          char            cmdbuf[256];
382 <        char            xfargs[128];
383 <        int             nxfa;
382 >        char            rotargs[64];
383 >        int             nrota;
384          int             i;
385  
386          printf("\n# Gensurf output corresponding to %d incident directions\n",
387                          NINCIDENT);
388  
389 <        printf("\nvoid glow arrow_glow\n0\n0\n4 1 0 1 0\n");
390 <        printf("\nvoid mixfunc arrow_mat\n4 arrow_glow void 0.25 .\n0\n0\n");
389 >        printf("\nvoid glow tip_mat\n0\n0\n4 1 0 1 0\n");
390 >        printf("\nvoid mixfunc shaft_mat\n4 tip_mat void 0.25 .\n0\n0\n");
391  
392 <        if (front_comp & SDsampR)                       /* front reflection */
393 <                for (i = 0; i < NINCIDENT; i++) {
394 <                        get_ivector(ivec, i);
395 <                        put_mirror_arrow(ivec, 1);
392 >        for (i = 0; i < NINCIDENT; i++) {
393 >                get_ivector(ivec, i);
394 >                nrm[0] = -ivec[0]; nrm[1] = -ivec[1]; nrm[2] = ivec[2];
395 >                upv[0] = nrm[0]*nrm[1]*(nrm[2] - 1.);
396 >                upv[1] = nrm[0]*nrm[0] + nrm[1]*nrm[1]*nrm[2];
397 >                upv[2] = -nrm[1]*(nrm[0]*nrm[0] + nrm[1]*nrm[1]);
398 >                if (SDcompXform(vMtx, nrm, upv) != SDEnone)
399 >                        continue;
400 >                nrota = addrot(rotargs, vMtx[0], vMtx[1], vMtx[2]);
401 >                if (front_comp) {
402                          cvt_sposition(sorg, ivec, 1);
393                        ivec[0] = -ivec[0]; ivec[1] = -ivec[1]; /* normal */
394                        upv[0] = ivec[0]*ivec[1]*(ivec[2] - 1.);
395                        upv[1] = ivec[0]*ivec[0] + ivec[1]*ivec[1]*ivec[2];
396                        upv[2] = -ivec[1]*(ivec[0]*ivec[0] + ivec[1]*ivec[1]);
397                        sprintf(xfargs, "-s %f -t %f %f %f", bsdf_rad,
398                                        sorg[0], sorg[1], sorg[2]);
399                        nxfa = 6;
403                          printf("\nvoid colorfunc scale_pat\n");
404 <                        printf("%d bsdf_red bsdf_grn bsdf_blu bsdf2rad.cal\n\t%s\n0\n0\n",
405 <                                        4+nxfa, xfargs);
404 >                        printf("10 bsdf_red bsdf_grn bsdf_blu bsdf2rad.cal\n");
405 >                        printf("\t-s %f -t %f %f %f\n0\n0\n",
406 >                                        bsdf_rad, sorg[0], sorg[1], sorg[2]);
407                          printf("\nscale_pat glow scale_mat\n0\n0\n4 1 1 1 0\n");
408 <                        if (SDcompXform(vMtx, ivec, upv) != SDEnone)
409 <                                continue;
410 <                        nxfa = addrot(xfargs, vMtx[0], vMtx[1], vMtx[2]);
407 <                        sprintf(xfargs+strlen(xfargs), " -s %f -t %f %f %f",
408 <                                        scalef, sorg[0], sorg[1], sorg[2]);
409 <                        nxfa += 6;
408 >                }
409 >                if (front_comp & SDsampR) {
410 >                        put_mirror_arrow(sorg, nrm);
411                          fname = tfile_name(frpref, dsuffix, i);
412 <                        sprintf(cmdbuf, "gensurf scale_mat %s%d %s %s %s %d %d | xform %s",
412 >                        sprintf(cmdbuf,
413 >                "gensurf scale_mat %s%d %s %s %s %d %d | xform %s -s %f -t %f %f %f",
414                                          frpref, i, fname, fname, fname, SAMPRES-1, SAMPRES-1,
415 <                                        xfargs);
415 >                                        rotargs, scalef, sorg[0], sorg[1], sorg[2]);
416                          if (!run_cmd(cmdbuf))
417                                  return(0);
418                  }
419 <        if (front_comp & SDsampT)                       /* front transmission */
420 <                for (i = 0; i < NINCIDENT; i++) {
419 <                        get_ivector(ivec, i);
420 <                        put_trans_arrow(ivec, 1);
421 <                        cvt_sposition(sorg, ivec, 1);
422 <                        ivec[0] = -ivec[0]; ivec[1] = -ivec[1]; /* normal */
423 <                        upv[0] = ivec[0]*ivec[1]*(ivec[2] - 1.);
424 <                        upv[1] = ivec[0]*ivec[0] + ivec[1]*ivec[1]*ivec[2];
425 <                        upv[2] = -ivec[1]*(ivec[0]*ivec[0] + ivec[1]*ivec[1]);
426 <                        sprintf(xfargs, "-s %f -t %f %f %f", bsdf_rad,
427 <                                        sorg[0], sorg[1], sorg[2]);
428 <                        nxfa = 6;
429 <                        printf("\nvoid colorfunc scale_pat\n");
430 <                        printf("%d bsdf_red bsdf_grn bsdf_blu bsdf2rad.cal\n\t%s\n0\n0\n",
431 <                                        4+nxfa, xfargs);
432 <                        printf("\nscale_pat glow scale_mat\n0\n0\n4 1 1 1 0\n");
433 <                        if (SDcompXform(vMtx, ivec, upv) != SDEnone)
434 <                                continue;
435 <                        nxfa = addrot(xfargs, vMtx[0], vMtx[1], vMtx[2]);
436 <                        sprintf(xfargs+strlen(xfargs), " -s %f -t %f %f %f",
437 <                                        scalef, sorg[0], sorg[1], sorg[2]);
438 <                        nxfa += 6;
419 >                if (front_comp & SDsampT) {
420 >                        put_trans_arrow(sorg);
421                          fname = tfile_name(ftpref, dsuffix, i);
422 <                        sprintf(cmdbuf, "gensurf scale_mat %s%d %s %s %s %d %d | xform -I %s",
422 >                        sprintf(cmdbuf,
423 >                "gensurf scale_mat %s%d %s %s %s %d %d | xform -I %s -s %f -t %f %f %f",
424                                          ftpref, i, fname, fname, fname, SAMPRES-1, SAMPRES-1,
425 <                                        xfargs);
425 >                                        rotargs, scalef, sorg[0], sorg[1], sorg[2]);
426                          if (!run_cmd(cmdbuf))
427                                  return(0);
428                  }
429 <        if (back_comp & SDsampR)                        /* rear reflection */
447 <                for (i = 0; i < NINCIDENT; i++) {
448 <                        get_ivector(ivec, i);
449 <                        put_mirror_arrow(ivec, -1);
429 >                if (back_comp) {
430                          cvt_sposition(sorg, ivec, -1);
451                        ivec[0] = -ivec[0]; ivec[1] = -ivec[1]; /* normal */
452                        upv[0] = ivec[0]*ivec[1]*(ivec[2] - 1.);
453                        upv[1] = ivec[0]*ivec[0] + ivec[1]*ivec[1]*ivec[2];
454                        upv[2] = -ivec[1]*(ivec[0]*ivec[0] + ivec[1]*ivec[1]);
455                        sprintf(xfargs, "-s %f -t %f %f %f", bsdf_rad,
456                                        sorg[0], sorg[1], sorg[2]);
457                        nxfa = 6;
431                          printf("\nvoid colorfunc scale_pat\n");
432 <                        printf("%d bsdf_red bsdf_grn bsdf_blu bsdf2rad.cal\n\t%s\n0\n0\n",
433 <                                        4+nxfa, xfargs);
432 >                        printf("10 bsdf_red bsdf_grn bsdf_blu bsdf2rad.cal\n");
433 >                        printf("\t-s %f -t %f %f %f\n0\n0\n",
434 >                                        bsdf_rad, sorg[0], sorg[1], sorg[2]);
435                          printf("\nscale_pat glow scale_mat\n0\n0\n4 1 1 1 0\n");
436 <                        if (SDcompXform(vMtx, ivec, upv) != SDEnone)
437 <                                continue;
438 <                        nxfa = addrot(xfargs, vMtx[0], vMtx[1], vMtx[2]);
465 <                        sprintf(xfargs+strlen(xfargs), " -s %f -t %f %f %f",
466 <                                        scalef, sorg[0], sorg[1], sorg[2]);
467 <                        nxfa += 6;
436 >                }
437 >                if (back_comp & SDsampR) {
438 >                        put_mirror_arrow(sorg, nrm);
439                          fname = tfile_name(brpref, dsuffix, i);
440 <                        sprintf(cmdbuf, "gensurf scale_mat %s%d %s %s %s %d %d | xform -I -ry 180 %s",
440 >                        sprintf(cmdbuf,
441 >                "gensurf scale_mat %s%d %s %s %s %d %d | xform -I -ry 180 %s -s %f -t %f %f %f",
442                                          brpref, i, fname, fname, fname, SAMPRES-1, SAMPRES-1,
443 <                                        xfargs);
443 >                                        rotargs, scalef, sorg[0], sorg[1], sorg[2]);
444                          if (!run_cmd(cmdbuf))
445                                  return(0);
446                  }
447 <        if (back_comp & SDsampT)                        /* rear transmission */
448 <                for (i = 0; i < NINCIDENT; i++) {
477 <                        get_ivector(ivec, i);
478 <                        put_trans_arrow(ivec, -1);
479 <                        cvt_sposition(sorg, ivec, -1);
480 <                        ivec[0] = -ivec[0]; ivec[1] = -ivec[1]; /* normal */
481 <                        upv[0] = ivec[0]*ivec[1]*(ivec[2] - 1.);
482 <                        upv[1] = ivec[0]*ivec[0] + ivec[1]*ivec[1]*ivec[2];
483 <                        upv[2] = -ivec[1]*(ivec[0]*ivec[0] + ivec[1]*ivec[1]);
484 <                        sprintf(xfargs, "-s %f -t %f %f %f", bsdf_rad,
485 <                                        sorg[0], sorg[1], sorg[2]);
486 <                        nxfa = 6;
487 <                        printf("\nvoid colorfunc scale_pat\n");
488 <                        printf("%d bsdf_red bsdf_grn bsdf_blu bsdf2rad.cal\n\t%s\n0\n0\n",
489 <                                        4+nxfa, xfargs);
490 <                        printf("\nscale_pat glow scale_mat\n0\n0\n4 1 1 1 0\n");
491 <                        if (SDcompXform(vMtx, ivec, upv) != SDEnone)
492 <                                continue;
493 <                        nxfa = addrot(xfargs, vMtx[0], vMtx[1], vMtx[2]);
494 <                        sprintf(xfargs+strlen(xfargs), " -s %f -t %f %f %f",
495 <                                        scalef, sorg[0], sorg[1], sorg[2]);
496 <                        nxfa += 6;
447 >                if (back_comp & SDsampT) {
448 >                        put_trans_arrow(sorg);
449                          fname = tfile_name(btpref, dsuffix, i);
450 <                        sprintf(cmdbuf, "gensurf scale_mat %s%d %s %s %s %d %d | xform -ry 180 %s",
450 >                        sprintf(cmdbuf,
451 >                "gensurf scale_mat %s%d %s %s %s %d %d | xform -ry 180 %s -s %f -t %f %f %f",
452                                          btpref, i, fname, fname, fname, SAMPRES-1, SAMPRES-1,
453 <                                        xfargs);
453 >                                        rotargs, scalef, sorg[0], sorg[1], sorg[2]);
454                          if (!run_cmd(cmdbuf))
455                                  return(0);
456                  }
457 +        }
458          return(1);
459   }
460  
# Line 515 | Line 469 | put_matBSDF(const char *XMLfile)
469                  printf("\nvoid brightfunc latlong\n2 latlong bsdf2rad.cal\n0\n0\n");
470                  if ((front_comp|back_comp) & SDsampT)
471                          printf("\nlatlong trans %s\n0\n0\n7 .75 .75 .75 0 .04 .5 .8\n",
472 <                                        sph_mat);
472 >                                        sph_fmat);
473                  else
474                          printf("\nlatlong plastic %s\n0\n0\n5 .5 .5 .5 0 0\n",
475 <                                        sph_mat);
475 >                                        sph_fmat);
476 >                printf("\ninherit alias %s %s\n", sph_bmat, sph_fmat);
477                  return;
478          }
479          switch (XMLfile[0]) {           /* avoid RAYPATH search */
480          case '.':
481 +        case '~':
482          CASEDIRSEP:
483                  curdir = "";
484                  break;
# Line 531 | Line 487 | put_matBSDF(const char *XMLfile)
487                  exit(1);
488                  break;
489          }
490 <        printf("\n# Actual BSDF material for rendering the hemispheres\n");
491 <        printf("\nvoid BSDF BSDFmat\n6 0 \"%s%s\" upx upy upz bsdf2rad.cal\n0\n0\n",
490 >        printf("\n# Actual BSDF materials for rendering the hemispheres\n");
491 >        printf("\nvoid BSDF BSDF_f\n6 0 \"%s%s\" upx upy upz bsdf2rad.cal\n0\n0\n",
492                          curdir, XMLfile);
493          printf("\nvoid plastic black\n0\n0\n5 0 0 0 0 0\n");
494 <        printf("\nvoid mixfunc %s\n4 BSDFmat black latlong bsdf2rad.cal\n0\n0\n",
495 <                        sph_mat);
494 >        printf("\nvoid mixfunc %s\n4 BSDF_f black latlong bsdf2rad.cal\n0\n0\n",
495 >                        sph_fmat);
496 >        printf("\nvoid BSDF BSDF_b\n8 0 \"%s%s\" upx upy upz bsdf2rad.cal -ry 180\n0\n0\n",
497 >                        curdir, XMLfile);
498 >        printf("\nvoid mixfunc %s\n4 BSDF_b black latlong bsdf2rad.cal\n0\n0\n",
499 >                        sph_bmat);
500   }
501  
502   /* Put out overhead parallel light source */
# Line 560 | Line 520 | put_hemispheres(void)
520          if (front_comp) {
521                  printf(
522   "\n!genrev %s Front \"R*sin(A*t)\" \"R*cos(A*t)\" %d -e \"R:%g;A:%f\" -s | xform -t %g 0 0\n",
523 <                                sph_mat, nsegs, sph_rad, 0.495*PI, sph_xoffset);
523 >                                sph_fmat, nsegs, sph_rad, 0.5*PI, sph_xoffset);
524                  printf("\nvoid brighttext front_text\n3 helvet.fnt . FRONT\n0\n");
525                  printf("12\n\t%f %f 0\n\t%f 0 0\n\t0 %f 0\n\t.01 1 -.1\n",
526                                  -.22*sph_rad + sph_xoffset, -1.4*sph_rad,
# Line 576 | Line 536 | put_hemispheres(void)
536          if (back_comp) {
537                  printf(
538   "\n!genrev %s Back \"R*cos(A*t)\" \"R*sin(A*t)\" %d -e \"R:%g;A:%f\" -s | xform -t %g 0 0\n",
539 <                                sph_mat, nsegs, sph_rad, 0.495*PI, -sph_xoffset);
539 >                                sph_bmat, nsegs, sph_rad, 0.5*PI, -sph_xoffset);
540                  printf("\nvoid brighttext back_text\n3 helvet.fnt . BACK\n0\n");
541                  printf("12\n\t%f %f 0\n\t%f 0 0\n\t0 %f 0\n\t.01 1 -.1\n",
542                                  -.22*sph_rad - sph_xoffset, -1.4*sph_rad,
# Line 798 | Line 758 | main(int argc, char *argv[])
758                  strcpy(bsdf_manuf, myBSDF.makr);
759                  put_matBSDF(argv[1]);
760          } else {
761 <                FILE    *fp;
761 >                FILE    *fp[4];
762 >                if (argc > 5) {
763 >                        fprintf(stderr, "%s: more than 4 hemispheres!\n", progname);
764 >                        return(1);
765 >                }
766                  for (n = 1; n < argc; n++) {
767 <                        fp = fopen(argv[n], "rb");
768 <                        if (fp == NULL) {
767 >                        fp[n-1] = fopen(argv[n], "rb");
768 >                        if (fp[n-1] == NULL) {
769                                  fprintf(stderr, "%s: cannot open BSDF interpolant '%s'\n",
770                                                  progname, argv[n]);
771                                  return(1);
772                          }
773 <                        if (getheader(fp, rbf_headline, NULL) < 0) {
773 >                        if (getheader(fp[n-1], rbf_headline, NULL) < 0) {
774                                  fprintf(stderr, "%s: bad BSDF interpolant '%s'\n",
775                                                  progname, argv[n]);
776                                  return(1);
777                          }
814                        fclose(fp);
778                  }
779                  set_minlog();
780                  for (n = 1; n < argc; n++) {
781 <                        fp = fopen(argv[n], "rb");
782 <                        if (!load_bsdf_rep(fp))
781 >                        if (fseek(fp[n-1], 0L, SEEK_SET) < 0) {
782 >                                fprintf(stderr, "%s: cannot seek on '%s'\n",
783 >                                                progname, argv[n]);
784                                  return(1);
785 <                        fclose(fp);
785 >                        }
786 >                        if (!load_bsdf_rep(fp[n-1]))
787 >                                return(1);
788 >                        fclose(fp[n-1]);
789                          if (!build_wRBF())
790                                  return(1);
791                  }
# Line 829 | Line 796 | main(int argc, char *argv[])
796          put_scale();
797          if (inpXML && myBSDF.mgf)
798                  convert_mgf(myBSDF.mgf);
799 <        if (!put_BSDFs())
799 >        if (!put_BSDFs())               /* most of the output happens here */
800                  return(1);
801          cleanup_tmp();
802          return(0);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines