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.16 by greg, Sun Apr 9 21:39:26 2017 UTC vs.
Revision 2.18 by greg, Sun Apr 9 22:51:19 2017 UTC

# Line 13 | Line 13 | static const char RCSid[] = "$Id$";
13   #include "resolu.h"
14   #include "bsdfrep.h"
15  
16 < #define NINCIDENT       25              /* number of samples/hemisphere */
16 > #define NINCIDENT       37              /* number of samples/hemisphere */
17  
18   #define GRIDSTEP        2               /* our grid step size */
19   #define SAMPRES         (GRIDRES/GRIDSTEP)
# Line 53 | Line 53 | char   *progname;
53   static void
54   get_ivector(FVECT iv, int i)
55   {
56        const double    zstep = 1./(2*NINCIDENT-1);
56          const double    phistep = PI*(3. - 2.236067978);
57          double          r;
58  
59 <        iv[2] = 1. - (i+.5)*zstep;
59 >        iv[2] = 1. - (i+.5)*(1./NINCIDENT);
60          r = sqrt(1. - iv[2]*iv[2]);
61          iv[0] = r * cos((i+1.)*phistep);
62          iv[1] = r * sin((i+1.)*phistep);
# Line 524 | Line 523 | static void
523   put_source(void)
524   {
525          printf("\n# Overhead parallel light source\n");
526 <        printf("\nvoid light bright\n0\n0\n3 1000 1000 1000\n");
526 >        printf("\nvoid light bright\n0\n0\n3 2000 2000 2000\n");
527          printf("\nbright source light\n0\n0\n4 0 0 1 2\n");
528          printf("\n# Material used for labels\n");
529          printf("\nvoid trans vellum\n0\n0\n7 1 1 1 0 0 .5 0\n");
# Line 544 | Line 543 | put_hemispheres(void)
543                                  -1.01*sph_rad - sph_xoffset, -1.01*sph_rad, -1.01*sph_rad);
544                  printf("\nvoid brighttext front_text\n3 helvet.fnt . FRONT\n0\n");
545                  printf("12\n\t%f %f 0\n\t%f 0 0\n\t0 %f 0\n\t.01 1 -.1\n",
546 <                                -.22*sph_rad - sph_xoffset, -1.2*sph_rad,
546 >                                -.22*sph_rad - sph_xoffset, -1.4*sph_rad,
547                                  .35/5.*sph_rad, -1.6*.35/5.*sph_rad);
548                  printf("\nfront_text alias front_label_mat vellum\n");
549                  printf("\nfront_label_mat polygon front_label\n0\n0\n12");
550                  printf("\n\t%f %f 0\n\t%f %f 0\n\t%f %f 0\n\t%f %f 0\n",
551 <                                -.25*sph_rad - sph_xoffset, -1.1*sph_rad,
552 <                                -.25*sph_rad - sph_xoffset, (-1.2-1.6*.35/5.-.1)*sph_rad,
553 <                                .25*sph_rad - sph_xoffset, (-1.2-1.6*.35/5.-.1)*sph_rad,
554 <                                .25*sph_rad - sph_xoffset, -1.1*sph_rad );
551 >                                -.25*sph_rad - sph_xoffset, -1.3*sph_rad,
552 >                                -.25*sph_rad - sph_xoffset, (-1.4-1.6*.35/5.-.1)*sph_rad,
553 >                                .25*sph_rad - sph_xoffset, (-1.4-1.6*.35/5.-.1)*sph_rad,
554 >                                .25*sph_rad - sph_xoffset, -1.3*sph_rad );
555          }
556          if (back_comp) {
557                  printf("\n%s bubble Back\n0\n0\n4 %f 0 0 %f\n",
# Line 562 | Line 561 | put_hemispheres(void)
561                                  -1.01*sph_rad + sph_xoffset, -1.01*sph_rad, -1.01*sph_rad);
562                  printf("\nvoid brighttext back_text\n3 helvet.fnt . BACK\n0\n");
563                  printf("12\n\t%f %f 0\n\t%f 0 0\n\t0 %f 0\n\t.01 1 -.1\n",
564 <                                -.22*sph_rad + sph_xoffset, -1.2*sph_rad,
564 >                                -.22*sph_rad + sph_xoffset, -1.4*sph_rad,
565                                  .35/4.*sph_rad, -1.6*.35/4.*sph_rad);
566                  printf("\nback_text alias back_label_mat vellum\n");
567                  printf("\nback_label_mat polygon back_label\n0\n0\n12");
568                  printf("\n\t%f %f 0\n\t%f %f 0\n\t%f %f 0\n\t%f %f 0\n",
569 <                                -.25*sph_rad + sph_xoffset, -1.1*sph_rad,
570 <                                -.25*sph_rad + sph_xoffset, (-1.2-1.6*.35/4.-.1)*sph_rad,
571 <                                .25*sph_rad + sph_xoffset, (-1.2-1.6*.35/4.-.1)*sph_rad,
572 <                                .25*sph_rad + sph_xoffset, -1.1*sph_rad );
569 >                                -.25*sph_rad + sph_xoffset, -1.3*sph_rad,
570 >                                -.25*sph_rad + sph_xoffset, (-1.4-1.6*.35/4.-.1)*sph_rad,
571 >                                .25*sph_rad + sph_xoffset, (-1.4-1.6*.35/4.-.1)*sph_rad,
572 >                                .25*sph_rad + sph_xoffset, -1.3*sph_rad );
573          }
574   }
575  
# Line 582 | Line 581 | put_scale(void)
581          const double    leg_width = 2.*.75*(sph_xoffset - sph_rad);
582          const double    leg_height = 2.*sph_rad;
583          const int       text_lines = 6;
584 <        const int       text_digits = 7;
584 >        const int       text_digits = 8;
585          char            fmt[16];
586          int             i;
587  
588          printf("\n# BSDF legend with falsecolor scale\n");
589          printf("\nvoid colorfunc lscale\n10 sca_red(Py) sca_grn(Py) sca_blu(Py)");
590          printf("\n\tbsdf2rad.cal -s %f -t 0 %f 0\n0\n0\n", leg_height, -.5*leg_height);
591 <        sprintf(fmt, "%%%dg", text_digits-2);
591 >        sprintf(fmt, "%%.%df", text_digits-3);
592          for (i = 0; i < text_lines; i++) {
593                  char    vbuf[16];
594                  sprintf(vbuf, fmt, pow(10., (i+.5)/text_lines*(max_log10-min_log10)+min_log10));
595                  printf("\nlscale brighttext lscale\n");
596                  printf("3 helvet.fnt . %s\n0\n12\n", vbuf);
597                  printf("\t%f %f 0\n", -.45*leg_width, ((i+.9)/text_lines-.5)*leg_height);
598 <                printf("\t%f 0 0\n", .9*leg_width/strlen(vbuf));
598 >                printf("\t%f 0 0\n", .8*leg_width/strlen(vbuf));
599                  printf("\t0 %f 0\n", -.9/text_lines*leg_height);
600                  printf("\t.01 1 -.1\n");
601          }
# Line 623 | Line 622 | put_scale(void)
622                  return;
623          printf("\nvoid brighttext BSDFname\n3 helvet.fnt . \"%s\"\n0\n12\n", bsdf_name);
624          printf("\t%f %f 0\n", -.95*leg_width, -.6*leg_height);
625 <        printf("\t%f 0 0\n", .4/strlen(bsdf_name)*leg_width);
625 >        printf("\t%f 0 0\n", 1.8/strlen(bsdf_name)*leg_width);
626          printf("\t0 %f 0\n", -.1*leg_height);
627          printf("\t.01 1 -.1\n");
628          printf("\nBSDFname alias name_mat vellum\n");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines