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

Comparing ray/src/rt/m_mist.c (file contents):
Revision 2.5 by greg, Thu Mar 21 10:24:59 1996 UTC vs.
Revision 2.7 by greg, Wed Jun 5 11:27:33 1996 UTC

# Line 33 | Line 33 | static char SCCSid[] = "$SunId$ LBL";
33   *
34   *  Up to five real arguments may be given for MAT_MIST:
35   *
36 < *      [ext_r  ext_g  ext_b  [albedo [gecc]]]
36 > *      [ext_r  ext_g  ext_b  [albedo_r albedo_g albedo_b [gecc]]]
37   *
38   *  The primaries indicate medium extinction per unit length (absorption
39   *  plus scattering), which is added to the global extinction coefficient, set
# Line 44 | Line 44 | static char SCCSid[] = "$SunId$ LBL";
44   *  scattering.  A value approaching 1 indicates strong forward scattering.
45   */
46  
47 + #ifndef  MAXSLIST
48 + #define  MAXSLIST       32      /* maximum sources to check */
49 + #endif
50 +
51   #define RELAYDELIM      '>'             /* relay delimiter character */
52  
53   extern COLOR  cextinction;              /* global coefficient of extinction */
54 < extern double  salbedo;                 /* global scattering albedo */
54 > extern COLOR  salbedo;                  /* global scattering albedo */
55   extern double  seccg;                   /* global scattering eccentricity */
56  
57  
# Line 166 | Line 170 | register RAY  *r;
170                  p.slights[0] = 0;
171          if (r->rod > 0.) {                      /* entering ray */
172                  addcolor(p.cext, mext);
173 <                if (m->oargs.nfargs > 3)
174 <                        p.albedo = m->oargs.farg[3];
175 <                if (m->oargs.nfargs > 4)
176 <                        p.gecc = m->oargs.farg[4];
173 >                if (m->oargs.nfargs > 5)
174 >                        setcolor(p.albedo, m->oargs.farg[3],
175 >                                        m->oargs.farg[4], m->oargs.farg[5]);
176 >                if (m->oargs.nfargs > 6)
177 >                        p.gecc = m->oargs.farg[6];
178                  add2slist(&p, myslist);                 /* add to list */
179          } else {                                /* leaving ray */
180                  if (myslist != NULL) {                  /* delete from list */
# Line 181 | Line 186 | register RAY  *r;
186                                          p.slights[++i] = p.slights[j];
187                          if (p.slights[0] - i < myslist[0]) {    /* fix old */
188                                  addcolor(r->cext, mext);
189 <                                if (m->oargs.nfargs > 3)
190 <                                        r->albedo = m->oargs.farg[3];
191 <                                if (m->oargs.nfargs > 4)
192 <                                        r->gecc = m->oargs.farg[4];
189 >                                if (m->oargs.nfargs > 5)
190 >                                        setcolor(r->albedo, m->oargs.farg[3],
191 >                                        m->oargs.farg[4], m->oargs.farg[5]);
192 >                                if (m->oargs.nfargs > 6)
193 >                                        r->gecc = m->oargs.farg[6];
194                                  add2slist(r, myslist);
195                          }
196                          p.slights[0] = i;
# Line 199 | Line 205 | register RAY  *r;
205                                  colval(cextinction,BLU))
206                          be = colval(cextinction,BLU);
207                  setcolor(p.cext, re, ge, be);
208 <                if (m->oargs.nfargs > 3)
209 <                        p.albedo = salbedo;
210 <                if (m->oargs.nfargs > 4)
208 >                if (m->oargs.nfargs > 5)
209 >                        copycolor(p.albedo, salbedo);
210 >                if (m->oargs.nfargs > 6)
211                          p.gecc = seccg;
212          }
213          rayvalue(&p);                           /* calls rayparticipate() */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines