ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/initotypes.c
Revision: 2.11
Committed: Wed Dec 31 01:50:02 2003 UTC (20 years, 4 months ago) by greg
Content type: text/plain
Branch: MAIN
Changes since 2.10: +11 -1 lines
Log Message:
Created a source occluder cache to accelerate shadow testing.

File Contents

# Content
1 #ifndef lint
2 static const char RCSid[] = "$Id: initotypes.c,v 2.10 2003/03/11 19:29:05 greg Exp $";
3 #endif
4 /*
5 * Initialize ofun[] list for renderers
6 */
7
8 #include "copyright.h"
9
10 #include "standard.h"
11
12 #include "otypes.h"
13
14 #include "otspecial.h"
15
16 extern int o_sphere();
17 extern int o_face();
18 extern int o_cone();
19 extern int o_instance();
20 extern int o_mesh();
21 extern int m_light();
22 extern int m_normal();
23 extern int m_aniso();
24 extern int m_dielectric();
25 extern int m_mist();
26 extern int m_glass();
27 extern int m_clip();
28 extern int m_mirror();
29 extern int m_direct();
30 extern int m_brdf();
31 extern int m_brdf2();
32 extern int m_alias();
33 extern int t_func(), t_data();
34 extern int p_cfunc(), p_bfunc();
35 extern int p_pdata(), p_cdata(), p_bdata();
36 extern int mx_func(), mx_data(), mx_pdata();
37 extern int do_text();
38
39 FUN ofun[NUMOTYPE] = INIT_OTYPE;
40
41
42 initotypes() /* initialize ofun array */
43 {
44 ofun[OBJ_SPHERE].funp =
45 ofun[OBJ_BUBBLE].funp = o_sphere;
46 ofun[OBJ_FACE].funp = o_face;
47 ofun[OBJ_CONE].funp =
48 ofun[OBJ_CUP].funp =
49 ofun[OBJ_CYLINDER].funp =
50 ofun[OBJ_TUBE].funp =
51 ofun[OBJ_RING].funp = o_cone;
52 ofun[OBJ_INSTANCE].funp = o_instance;
53 ofun[OBJ_MESH].funp = o_mesh;
54 ofun[MOD_ALIAS].funp = m_alias;
55 ofun[MAT_LIGHT].funp =
56 ofun[MAT_ILLUM].funp =
57 ofun[MAT_GLOW].funp =
58 ofun[MAT_SPOT].funp = m_light;
59 ofun[MAT_LIGHT].flags |= T_OPAQUE;
60 ofun[MAT_SPOT].flags |= T_OPAQUE;
61 ofun[MAT_PLASTIC].funp =
62 ofun[MAT_METAL].funp =
63 ofun[MAT_TRANS].funp = m_normal;
64 ofun[MAT_PLASTIC].flags |= T_OPAQUE;
65 ofun[MAT_METAL].flags |= T_OPAQUE;
66 ofun[MAT_TRANS].flags |= T_IRR_IGN;
67 ofun[MAT_PLASTIC2].funp =
68 ofun[MAT_METAL2].funp =
69 ofun[MAT_TRANS2].funp = m_aniso;
70 ofun[MAT_PLASTIC2].flags |= T_OPAQUE;
71 ofun[MAT_METAL2].flags |= T_OPAQUE;
72 ofun[MAT_TRANS2].flags |= T_IRR_IGN;
73 ofun[MAT_DIELECTRIC].funp =
74 ofun[MAT_INTERFACE].funp = m_dielectric;
75 ofun[MAT_DIELECTRIC].flags |= T_IRR_IGN;
76 ofun[MAT_INTERFACE].flags |= T_IRR_IGN;
77 ofun[MAT_MIST].funp = m_mist;
78 ofun[MAT_MIST].flags |= T_IRR_IGN;
79 ofun[MAT_GLASS].funp = m_glass;
80 ofun[MAT_GLASS].flags |= T_IRR_IGN;
81 ofun[MAT_MIRROR].funp = m_mirror;
82 ofun[MAT_DIRECT1].funp =
83 ofun[MAT_DIRECT2].funp = m_direct;
84 ofun[MAT_CLIP].funp = m_clip;
85 ofun[MAT_BRTDF].funp = m_brdf;
86 ofun[MAT_PFUNC].funp =
87 ofun[MAT_MFUNC].funp =
88 ofun[MAT_PDATA].funp =
89 ofun[MAT_MDATA].funp =
90 ofun[MAT_TFUNC].funp =
91 ofun[MAT_TDATA].funp = m_brdf2;
92 ofun[MAT_PFUNC].flags |= T_OPAQUE;
93 ofun[MAT_MFUNC].flags |= T_OPAQUE;
94 ofun[MAT_PDATA].flags |= T_OPAQUE;
95 ofun[MAT_MDATA].flags |= T_OPAQUE;
96 ofun[TEX_FUNC].funp = t_func;
97 ofun[TEX_DATA].funp = t_data;
98 ofun[PAT_CFUNC].funp = p_cfunc;
99 ofun[PAT_BFUNC].funp = p_bfunc;
100 ofun[PAT_CPICT].funp = p_pdata;
101 ofun[PAT_CDATA].funp = p_cdata;
102 ofun[PAT_BDATA].funp = p_bdata;
103 ofun[PAT_CTEXT].funp =
104 ofun[PAT_BTEXT].funp =
105 ofun[MIX_TEXT].funp = do_text;
106 ofun[MIX_FUNC].funp = mx_func;
107 ofun[MIX_DATA].funp = mx_data;
108 ofun[MIX_PICT].funp = mx_pdata;
109 }
110
111
112 o_default() /* default action is error */
113 {
114 error(INTERNAL, "unexpected object call");
115 /* call to pull in freeobjmem.o */
116 free_objs(0, 0);
117 }