ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/initotypes.c
Revision: 2.3
Committed: Thu May 27 15:27:59 1993 UTC (30 years, 11 months ago) by greg
Content type: text/plain
Branch: MAIN
Changes since 2.2: +3 -2 lines
Log Message:
removed approximation to Fresnel reflection, since the direct
component was not being calculated accordingly (BRDF not bidirectional)
changed BRDTfunc arguments and operation, fixed one or two bugs there also

File Contents

# User Rev Content
1 greg 2.2 /* Copyright (c) 1992 Regents of the University of California */
2 greg 1.1
3     #ifndef lint
4     static char SCCSid[] = "$SunId$ LBL";
5     #endif
6    
7     /*
8     * Initialize ofun[] list for renderers
9     */
10    
11     #include "standard.h"
12    
13     #include "otypes.h"
14    
15 greg 1.2 #include "otspecial.h"
16    
17 greg 1.1 extern int o_sphere();
18     extern int o_face();
19     extern int o_cone();
20     extern int o_instance();
21     extern int m_light();
22     extern int m_normal();
23 greg 2.2 extern int m_aniso();
24 greg 1.1 extern int m_dielectric();
25     extern int m_glass();
26     extern int m_clip();
27 greg 1.5 extern int m_mirror();
28 greg 1.6 extern int m_direct();
29 greg 1.1 extern int m_brdf();
30 greg 2.3 extern int m_brdf2();
31 greg 1.1 extern int t_func(), t_data();
32     extern int p_cfunc(), p_bfunc();
33     extern int p_pdata(), p_cdata(), p_bdata();
34     extern int mx_func(), mx_data();
35     extern int text();
36    
37     FUN ofun[NUMOTYPE] = INIT_OTYPE;
38    
39    
40     initotypes() /* initialize ofun array */
41     {
42     ofun[OBJ_SPHERE].funp =
43     ofun[OBJ_BUBBLE].funp = o_sphere;
44     ofun[OBJ_FACE].funp = o_face;
45     ofun[OBJ_CONE].funp =
46     ofun[OBJ_CUP].funp =
47     ofun[OBJ_CYLINDER].funp =
48     ofun[OBJ_TUBE].funp =
49     ofun[OBJ_RING].funp = o_cone;
50     ofun[OBJ_INSTANCE].funp = o_instance;
51     ofun[MAT_LIGHT].funp =
52     ofun[MAT_ILLUM].funp =
53     ofun[MAT_GLOW].funp =
54     ofun[MAT_SPOT].funp = m_light;
55     ofun[MAT_PLASTIC].funp =
56     ofun[MAT_METAL].funp =
57     ofun[MAT_TRANS].funp = m_normal;
58 greg 1.2 ofun[MAT_TRANS].flags |= T_IRR_IGN;
59 greg 2.2 ofun[MAT_PLASTIC2].funp =
60     ofun[MAT_METAL2].funp =
61     ofun[MAT_TRANS2].funp = m_aniso;
62     ofun[MAT_TRANS2].flags |= T_IRR_IGN;
63 greg 1.1 ofun[MAT_DIELECTRIC].funp =
64     ofun[MAT_INTERFACE].funp = m_dielectric;
65 greg 1.2 ofun[MAT_DIELECTRIC].flags |= T_IRR_IGN;
66     ofun[MAT_INTERFACE].flags |= T_IRR_IGN;
67 greg 1.1 ofun[MAT_GLASS].funp = m_glass;
68 greg 1.2 ofun[MAT_GLASS].flags |= T_IRR_IGN;
69 greg 1.5 ofun[MAT_MIRROR].funp = m_mirror;
70 greg 1.6 ofun[MAT_DIRECT1].funp =
71     ofun[MAT_DIRECT2].funp = m_direct;
72 greg 1.1 ofun[MAT_CLIP].funp = m_clip;
73 greg 2.3 ofun[MAT_BRTDF].funp = m_brdf;
74 greg 1.1 ofun[MAT_PFUNC].funp =
75     ofun[MAT_MFUNC].funp =
76     ofun[MAT_PDATA].funp =
77 greg 1.4 ofun[MAT_MDATA].funp =
78     ofun[MAT_TFUNC].funp =
79 greg 2.3 ofun[MAT_TDATA].funp = m_brdf2;
80 greg 1.1 ofun[TEX_FUNC].funp = t_func;
81     ofun[TEX_DATA].funp = t_data;
82     ofun[PAT_CFUNC].funp = p_cfunc;
83     ofun[PAT_BFUNC].funp = p_bfunc;
84     ofun[PAT_CPICT].funp = p_pdata;
85     ofun[PAT_CDATA].funp = p_cdata;
86     ofun[PAT_BDATA].funp = p_bdata;
87     ofun[PAT_CTEXT].funp =
88     ofun[PAT_BTEXT].funp =
89     ofun[MIX_TEXT].funp = text;
90     ofun[MIX_FUNC].funp = mx_func;
91     ofun[MIX_DATA].funp = mx_data;
92     }
93    
94    
95     o_default() /* default action is error */
96     {
97     error(INTERNAL, "unexpected object call");
98     }