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

Comparing ray/src/rt/rv2.c (file contents):
Revision 2.13 by greg, Thu Nov 19 20:27:03 1992 UTC vs.
Revision 2.17 by greg, Thu Aug 5 13:17:54 1993 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1992 Regents of the University of California */
1 > /* Copyright (c) 1993 Regents of the University of California */
2  
3   #ifndef lint
4   static char SCCSid[] = "$SunId$ LBL";
# Line 263 | Line 263 | char  *s;
263   {
264          char  buf[128];
265          register char  *cp;
266        register PNODE  *p;
266          RECT  r;
267          int  x, y;
268 <        double  e;
269 <
268 >        register PNODE  *p = &ptrunk;
269 >        int  adapt = 0;
270 >        double  e = 1.0;
271 > start:
272          for (cp = s; isspace(*cp); cp++)
273                  ;
274 +        if (*cp == '@') {
275 +                adapt++;
276 +                goto start;
277 +        }
278          if (*cp == '\0') {              /* normalize to point */
279                  if (dev->getcur == NULL)
280                          return;
# Line 279 | Line 284 | char  *s;
284                  r.l = r.d = 0;
285                  r.r = hresolu; r.u = vresolu;
286                  p = findrect(x, y, &ptrunk, &r, -1);
282                e = 1.0;
287          } else {
288                  if (*cp == '=') {       /* absolute setting */
289                          p = NULL;
# Line 287 | Line 291 | char  *s;
291                          for (cp++; isspace(*cp); cp++)
292                                  ;
293                          if (*cp == '\0') {      /* interactive */
294 <                                sprintf(buf, "exposure (%lf): ", exposure);
294 >                                sprintf(buf, "exposure (%f): ", exposure);
295                                  (*dev->comout)(buf);
296                                  (*dev->comin)(buf, NULL);
297                                  for (cp = buf; isspace(*cp); cp++)
# Line 295 | Line 299 | char  *s;
299                                  if (*cp == '\0')
300                                          return;
301                          }
298                } else {                /* normalize to average */
299                        p = &ptrunk;
300                        e = 1.0;
302                  }
303                  if (*cp == '+' || *cp == '-')   /* f-stops */
304                          e *= pow(2.0, atof(cp));
# Line 305 | Line 306 | char  *s;
306                          e *= atof(cp);
307          }
308          if (p != NULL) {                /* relative setting */
309 <                if (bright(p->v) < 1e-25) {
309 >                if (bright(p->v) < 1e-15) {
310                          error(COMMAND, "cannot normalize to zero");
311                          return;
312                  }
313 <                e *= 0.5 / bright(p->v);
313 >                if (adapt)
314 >                        e *= 106./pow(1.219+pow(luminance(p->v)/exposure,.4),2.5)/exposure;
315 >                else
316 >                        e *= 0.5 / bright(p->v);
317          }
318          if (e <= FTINY || fabs(1.0 - e) <= FTINY)
319                  return;
# Line 458 | Line 462 | register char  *s;
462                          getparam(s+2, "ambient value", 'C', (COLOR *)ambval);
463                          break;
464                  case 'a':                       /* accuracy */
465 <                        getparam(s+2, "ambient accuracy", 'r', &ambacc);
465 >                        if (getparam(s+2, "ambient accuracy", 'r', &ambacc))
466 >                                setambacc(ambacc);
467                          break;
468                  case 'd':                       /* divisions */
469                          getparam(s+2, "ambient divisions", 'i', &ambdiv);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines