--- ray/src/rt/rview.c 2003/02/22 02:07:29 2.18 +++ ray/src/rt/rview.c 2005/06/13 20:07:56 2.28 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: rview.c,v 2.18 2003/02/22 02:07:29 greg Exp $"; +static const char RCSid[] = "$Id: rview.c,v 2.28 2005/06/13 20:07:56 greg Exp $"; #endif /* * rview.c - routines and variables for interactive view generation. @@ -7,71 +7,15 @@ static const char RCSid[] = "$Id: rview.c,v 2.18 2003/ * External symbols declared in rpaint.h */ -/* ==================================================================== - * The Radiance Software License, Version 1.0 - * - * Copyright (c) 1990 - 2002 The Regents of the University of California, - * through Lawrence Berkeley National Laboratory. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, - * if any, must include the following acknowledgment: - * "This product includes Radiance software - * (http://radsite.lbl.gov/) - * developed by the Lawrence Berkeley National Laboratory - * (http://www.lbl.gov/)." - * Alternately, this acknowledgment may appear in the software itself, - * if and wherever such third-party acknowledgments normally appear. - * - * 4. The names "Radiance," "Lawrence Berkeley National Laboratory" - * and "The Regents of the University of California" must - * not be used to endorse or promote products derived from this - * software without prior written permission. For written - * permission, please contact radiance@radsite.lbl.gov. - * - * 5. Products derived from this software may not be called "Radiance", - * nor may "Radiance" appear in their name, without prior written - * permission of Lawrence Berkeley National Laboratory. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL Lawrence Berkeley National Laboratory OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of Lawrence Berkeley National Laboratory. For more - * information on Lawrence Berkeley National Laboratory, please see - * . - */ +#include "copyright.h" -#include "ray.h" +#include +#include +#include "ray.h" #include "rpaint.h" -#include -#include - CUBE thescene; /* our scene */ OBJECT nsceneobjs; /* number of objects in our scene */ @@ -89,6 +33,8 @@ void (*trace)() = NULL; /* trace call */ int do_irrad = 0; /* compute irradiance? */ +int rand_samp = 0; /* pure Monte Carlo sampling? */ + int psample = 8; /* pixel sample size */ double maxdiff = .15; /* max. sample difference */ @@ -112,18 +58,18 @@ double specjitter = 1.; /* specular sampling jitter * int backvis = 1; /* back face visibility */ -int maxdepth = 4; /* maximum recursion depth */ +int maxdepth = 6; /* maximum recursion depth */ double minweight = 1e-2; /* minimum ray weight */ char *ambfile = NULL; /* ambient file name */ COLOR ambval = BLKCOLOR; /* ambient value */ int ambvwt = 0; /* initial weight for ambient value */ -double ambacc = 0.2; /* ambient accuracy */ -int ambres = 8; /* ambient resolution */ -int ambdiv = 32; /* ambient divisions */ -int ambssamp = 0; /* ambient super-samples */ +double ambacc = 0.3; /* ambient accuracy */ +int ambres = 32; /* ambient resolution */ +int ambdiv = 256; /* ambient divisions */ +int ambssamp = 64; /* ambient super-samples */ int ambounce = 0; /* ambient bounces */ -char *amblist[128]; /* ambient include/exclude list */ +char *amblist[AMBLLEN]; /* ambient include/exclude list */ int ambincl = -1; /* include == 1, exclude == 0 */ int greyscale = 0; /* map colors to brightness? */ @@ -170,19 +116,18 @@ char *dname; id = octname!=NULL ? octname : progname; /* check device table */ for (i = 0; devtable[i].name; i++) - if (!strcmp(dname, devtable[i].name)) + if (!strcmp(dname, devtable[i].name)) { if ((dev = (*devtable[i].init)(dname, id)) == NULL) { sprintf(errmsg, "cannot initialize %s", dname); error(USER, errmsg); } else return; -#ifndef NIX + } /* not there, try exec */ if ((dev = comm_init(dname, id)) == NULL) { sprintf(errmsg, "cannot start device \"%s\"", dname); error(USER, errmsg); } -#endif } @@ -272,11 +217,15 @@ again: else *++args = '\0'; switch (inpbuf[0]) { - case 'f': /* new frame (or free mem.) */ + case 'f': /* new frame (|focus|free) */ if (badcom("frame")) { - if (badcom("free")) - goto commerr; - free_objmem(); + if (badcom("focus")) { + if (badcom("free")) + goto commerr; + free_objmem(); + break; + } + getfocus(args); break; } getframe(args);