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

Comparing ray/src/cv/mgf2rad.c (file contents):
Revision 2.5 by greg, Fri Jul 1 10:20:19 1994 UTC vs.
Revision 2.6 by greg, Fri Jul 1 18:06:36 1994 UTC

# Line 48 | Line 48 | char   *argv[];
48          mg_ehand[MG_E_RD] = c_hmaterial;
49          mg_ehand[MG_E_RING] = r_ring;
50          mg_ehand[MG_E_RS] = c_hmaterial;
51 +        mg_ehand[MG_E_SIDES] = c_hmaterial;
52          mg_ehand[MG_E_SPH] = r_sph;
53          mg_ehand[MG_E_TD] = c_hmaterial;
54          mg_ehand[MG_E_TS] = c_hmaterial;
# Line 431 | Line 432 | material()                     /* get (and print) current material */
432          if (c_cmaterial->td > .01 || c_cmaterial->ts > .01) {
433                  double  ts, a5, a6;
434  
435 <                ts = sqrt(c_cmaterial->ts);     /* because we use 2 sides */
435 >                if (c_cmaterial->sided) {
436 >                        ts = sqrt(c_cmaterial->ts);     /* approximate */
437 >                        a5 = .5;
438 >                } else
439 >                        a5 = 1.;
440                                                  /* average colors */
441                  d = c_cmaterial->rd + c_cmaterial->td + ts;
442                  cvtcolor(radrgb, &c_cmaterial->rd_c, c_cmaterial->rd/d);
# Line 441 | Line 446 | material()                     /* get (and print) current material */
446                  addcolor(radrgb, c2);
447                  if (c_cmaterial->rs + ts > .0001)
448                          a5 = (c_cmaterial->rs*c_cmaterial->rs_a +
449 <                                        ts*.5*c_cmaterial->ts_a) /
449 >                                        ts*a5*c_cmaterial->ts_a) /
450                                          (c_cmaterial->rs + ts);
451                  a6 = (c_cmaterial->td + ts) /
452                                  (c_cmaterial->rd + c_cmaterial->td + ts);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines