1 |
– |
/* Copyright (c) 1994 Regents of the University of California */ |
2 |
– |
|
1 |
|
#ifndef lint |
2 |
< |
static char SCCSid[] = "$SunId$ LBL"; |
2 |
> |
static const char RCSid[] = "$Id$"; |
3 |
|
#endif |
6 |
– |
|
4 |
|
/* |
5 |
|
* Routines for light-redirecting materials and |
6 |
|
* their associated virtual light sources |
7 |
|
*/ |
8 |
|
|
9 |
+ |
/* ==================================================================== |
10 |
+ |
* The Radiance Software License, Version 1.0 |
11 |
+ |
* |
12 |
+ |
* Copyright (c) 1990 - 2002 The Regents of the University of California, |
13 |
+ |
* through Lawrence Berkeley National Laboratory. All rights reserved. |
14 |
+ |
* |
15 |
+ |
* Redistribution and use in source and binary forms, with or without |
16 |
+ |
* modification, are permitted provided that the following conditions |
17 |
+ |
* are met: |
18 |
+ |
* |
19 |
+ |
* 1. Redistributions of source code must retain the above copyright |
20 |
+ |
* notice, this list of conditions and the following disclaimer. |
21 |
+ |
* |
22 |
+ |
* 2. Redistributions in binary form must reproduce the above copyright |
23 |
+ |
* notice, this list of conditions and the following disclaimer in |
24 |
+ |
* the documentation and/or other materials provided with the |
25 |
+ |
* distribution. |
26 |
+ |
* |
27 |
+ |
* 3. The end-user documentation included with the redistribution, |
28 |
+ |
* if any, must include the following acknowledgment: |
29 |
+ |
* "This product includes Radiance software |
30 |
+ |
* (http://radsite.lbl.gov/) |
31 |
+ |
* developed by the Lawrence Berkeley National Laboratory |
32 |
+ |
* (http://www.lbl.gov/)." |
33 |
+ |
* Alternately, this acknowledgment may appear in the software itself, |
34 |
+ |
* if and wherever such third-party acknowledgments normally appear. |
35 |
+ |
* |
36 |
+ |
* 4. The names "Radiance," "Lawrence Berkeley National Laboratory" |
37 |
+ |
* and "The Regents of the University of California" must |
38 |
+ |
* not be used to endorse or promote products derived from this |
39 |
+ |
* software without prior written permission. For written |
40 |
+ |
* permission, please contact [email protected]. |
41 |
+ |
* |
42 |
+ |
* 5. Products derived from this software may not be called "Radiance", |
43 |
+ |
* nor may "Radiance" appear in their name, without prior written |
44 |
+ |
* permission of Lawrence Berkeley National Laboratory. |
45 |
+ |
* |
46 |
+ |
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED |
47 |
+ |
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
48 |
+ |
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
49 |
+ |
* DISCLAIMED. IN NO EVENT SHALL Lawrence Berkeley National Laboratory OR |
50 |
+ |
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
51 |
+ |
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
52 |
+ |
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF |
53 |
+ |
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
54 |
+ |
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
55 |
+ |
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT |
56 |
+ |
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
57 |
+ |
* SUCH DAMAGE. |
58 |
+ |
* ==================================================================== |
59 |
+ |
* |
60 |
+ |
* This software consists of voluntary contributions made by many |
61 |
+ |
* individuals on behalf of Lawrence Berkeley National Laboratory. For more |
62 |
+ |
* information on Lawrence Berkeley National Laboratory, please see |
63 |
+ |
* <http://www.lbl.gov/>. |
64 |
+ |
*/ |
65 |
+ |
|
66 |
|
#include "ray.h" |
67 |
|
|
68 |
|
#include "otypes.h" |
86 |
|
*/ |
87 |
|
|
88 |
|
|
89 |
< |
int dir_proj(); |
89 |
> |
static int dir_proj(); |
90 |
> |
|
91 |
|
VSMATERIAL direct1_vs = {dir_proj, 1}; |
92 |
|
VSMATERIAL direct2_vs = {dir_proj, 2}; |
93 |
|
|
96 |
|
getfunc(m, 8, 0xff, 1) ) |
97 |
|
|
98 |
|
|
99 |
+ |
int |
100 |
|
m_direct(m, r) /* shade redirected ray */ |
101 |
|
register OBJREC *m; |
102 |
|
register RAY *r; |
116 |
|
} |
117 |
|
|
118 |
|
|
119 |
+ |
int |
120 |
|
redirect(m, r, n) /* compute n'th ray redirection */ |
121 |
|
OBJREC *m; |
122 |
|
RAY *r; |
177 |
|
rayvalue(&nr); |
178 |
|
scalecolor(nr.rcol, coef); |
179 |
|
addcolor(r->rcol, nr.rcol); |
180 |
+ |
if (r->ro != NULL && isflat(r->ro->otype)) |
181 |
+ |
r->rt = r->rot + nr.rt; |
182 |
|
return(1); |
183 |
|
computerr: |
184 |
|
objerror(m, WARNING, "compute error"); |
186 |
|
} |
187 |
|
|
188 |
|
|
189 |
+ |
static int |
190 |
|
dir_proj(pm, o, s, n) /* compute a director's projection */ |
191 |
|
MAT4 pm; |
192 |
|
OBJREC *o; |