BRL-CAD
init.c
Go to the documentation of this file.
1 /* I N I T . C
2  * BRL-CAD
3  *
4  * Copyright (c) 1998-2014 United States Government as represented by
5  * the U.S. Army Research Laboratory.
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public License
9  * version 2.1 as published by the Free Software Foundation.
10  *
11  * This library is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this file; see the file named COPYING for more
18  * information.
19  */
20 /** @file liboptical/init.c
21  *
22  * This file represents the single function exported from the
23  * shader library whose "name" is known.
24  * All other functions are called through the function table.
25  *
26  * Shaders are, of course, permitted to "upcall" into LIBRT as
27  * necessary.
28  *
29  */
30 
31 #include "common.h"
32 
33 #include <stdio.h>
34 #include "vmath.h"
35 #include "raytrace.h"
36 #include "optical.h"
37 
38 int rt_verbosity = -1; /* blather incessantly by default */
39 int rdebug; /* RT program debugging */
40 double AmbientIntensity = 0.4; /* Ambient light intensity */
41 struct bn_table *spectrum = NULL;
42 
43 #ifdef RT_MULTISPECTRAL
44 struct bn_tabdata *background = NULL; /* radiant emittance of bg */
45 #else
46 vect_t background = VINIT_ZERO; /* Black */
47 #endif
48 
49 /* initialized in the app code view handler */
51 
52 
53 #define MFUNCS(_name) \
54  { mlib_add_shader(headp, _name); }
55 
56 #define DMFUNCS(_name) \
57  { extern struct mfuncs _name[]; mlib_add_shader(headp, _name); }
58 
59 
60 void
61 optical_shader_init(struct mfuncs **headp)
62 {
63  /*
64  * Connect up shader ("material") interfaces
65  * Note that sh_plastic.c defines the required "default" entry.
66  */
72 
73 #ifndef RT_MULTISPECTRAL
74  DMFUNCS(null_mfuncs); /* null test shader */
95 
96 #ifdef OSL_ENABLED
97  /* This shader requires OSL, so it won't be compiled if this library was not enabled */
99 #endif
100 
101 #endif
102 }
103 
104 
105 /*
106  * Local Variables:
107  * mode: C
108  * tab-width: 8
109  * indent-tabs-mode: t
110  * c-file-style: "stroustrup"
111  * End:
112  * ex: shiftwidth=4 tabstop=8
113  */
struct mfuncs toyota_mfuncs[]
Definition: sh_toyota.c:112
#define MFUNCS(_name)
Definition: init.c:53
vect_t background
Definition: init.c:46
struct mfuncs stxt_mfuncs[]
Definition: sh_stxt.c:80
struct mfuncs light_mfuncs[]
Definition: sh_light.c:65
struct mfuncs brdf_mfuncs[]
Definition: sh_brdf.c:90
Header file for the BRL-CAD common definitions.
struct mfuncs rtrans_mfuncs[]
Definition: sh_rtrans.c:70
struct mfuncs phg_mfuncs[]
Definition: sh_plastic.c:83
struct mfuncs txt_mfuncs[]
Definition: sh_text.c:965
struct mfuncs toon_mfuncs[]
Definition: sh_toon.c:91
struct region env_region
Definition: init.c:50
void optical_shader_init(struct mfuncs **headp)
Definition: init.c:61
struct mfuncs spm_mfuncs[]
Definition: sh_spm.c:61
struct mfuncs points_mfuncs[]
Definition: sh_points.c:69
int rt_verbosity
Definition: init.c:38
struct mfuncs fire_mfuncs[]
Definition: sh_fire.c:170
struct mfuncs grass_mfuncs[]
Definition: sh_grass.c:232
struct mfuncs tthrm_mfuncs[]
Definition: sh_treetherm.c:159
struct mfuncs camo_mfuncs[]
Definition: sh_camo.c:157
struct mfuncs cook_mfuncs[]
Definition: sh_cook.c:87
struct mfuncs bbd_mfuncs[]
Definition: sh_billboard.c:585
struct mfuncs gauss_mfuncs[]
Definition: sh_gauss.c:142
struct mfuncs noise_mfuncs[]
Definition: sh_noise.c:453
struct mfuncs scloud_mfuncs[]
Definition: sh_scloud.c:109
struct mfuncs wood_mfuncs[]
Definition: sh_wood.c:100
#define DMFUNCS(_name)
Definition: init.c:56
struct mfuncs cloud_mfuncs[]
Definition: sh_cloud.c:55
struct bn_table * spectrum
Definition: init.c:41
struct mfuncs air_mfuncs[]
Definition: sh_air.c:80
struct mfuncs stk_mfuncs[]
Definition: sh_stack.c:43
Header file for the BRL-CAD Optical Library, LIBOPTICAL.
struct mfuncs null_mfuncs[]
Definition: sh_null.c:48
int rdebug
Definition: init.c:39
struct mfuncs flat_mfuncs[]
Definition: sh_flat.c:121
double AmbientIntensity
Definition: init.c:40
struct mfuncs osl_mfuncs[]
Definition: sh_osl.cpp:106
struct mfuncs prj_mfuncs[]
Definition: sh_prj.c:428