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

Comparing ray/src/cv/pabopto2bsdf.c (file contents):
Revision 2.10 by greg, Sat Nov 9 05:47:49 2013 UTC vs.
Revision 2.11 by greg, Thu Jan 30 18:19:43 2014 UTC

# Line 219 | Line 219 | main(int argc, char *argv[])
219   #ifdef DEBUG
220          fprintf(stderr, "Minimum BSDF = %.4f\n", bsdf_min);
221   #endif
222 <                                                /* produce spheres at meas. */
222 > #if 1                                           /* produce spheres at meas. */
223          puts("void plastic yellow\n0\n0\n5 .6 .4 .01 .04 .08\n");
224          min_log = log(bsdf_min*.5);
225          n = 0;
# Line 238 | Line 238 | main(int argc, char *argv[])
238                                          dir[0]*bsdf, dir[1]*bsdf, dir[2]*bsdf,
239                                          .007*bsdf);
240                  }
241 <                                                /* output continuous surface */
241 > #endif
242 > #if 1                                           /* spheres at RBF peaks */
243 >        puts("void plastic red\n0\n0\n5 .8 .01 .01 .04 .08\n");
244 >        for (n = 0; n < dsf_list->nrbf; n++) {
245 >                RBFVAL  *rbf = &dsf_list->rbfa[n];
246 >                ovec_from_pos(dir, rbf->gx, rbf->gy);
247 >                bsdf = eval_rbfrep(dsf_list, dir) / (output_orient*dir[2]);
248 >                bsdf = log(bsdf) - min_log;
249 >                printf("red sphere p%04d\n0\n0\n", ++n);
250 >                printf("4 %.6g %.6g %.6g %.6g\n\n",
251 >                                dir[0]*bsdf, dir[1]*bsdf, dir[2]*bsdf,
252 >                                .011*bsdf);
253 >        }
254 > #endif
255 > #if 1                                           /* output continuous surface */
256          puts("void trans tgreen\n0\n0\n7 .7 1 .7 .04 .04 .9 1\n");
257          fflush(stdout);
258          sprintf(buf, "gensurf tgreen bsdf - - - %d %d", GRIDRES-1, GRIDRES-1);
# Line 255 | Line 269 | main(int argc, char *argv[])
269                  fprintf(pfp, "%.8e %.8e %.8e\n",
270                                  dir[0]*bsdf, dir[1]*bsdf, dir[2]*bsdf);
271              }
272 <        return(pclose(pfp)==0 ? 0 : 1);
272 >        if (pclose(pfp) != 0)
273 >                return(1);
274 > #endif
275 >        return(0);
276   }
277   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines