BRL-CAD
shadework.h
Go to the documentation of this file.
1/* S H A D E W O R K . H
2 * BRL-CAD
3 *
4 * Copyright (c) 1993-2023 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/** @addtogroup liboptical */
21/** @{ */
22/** @file shadework.h
23 *
24 */
25
26#ifndef OPTICAL_SHADEWORK_H
27#define OPTICAL_SHADEWORK_H
28
29#include "common.h"
30#include "bn/tabdata.h"
31#include "rt/hit.h"
32#include "rt/seg.h"
33
34/* for light_specific, cyclic dependency */
35/* # include "optical/light.h" */
36
37#define SW_NLIGHTS 16 /* Max # of light sources */
38
39struct shadework {
40 fastf_t sw_transmit; /**< @brief 0.0 -> 1.0 */
41 fastf_t sw_reflect; /**< @brief 0.0 -> 1.0 */
42 fastf_t sw_extinction; /**< @brief extinction coeff, mm^-1 */
43 fastf_t sw_refrac_index; /**< @brief refactive index */
44 fastf_t sw_temperature; /**< @brief color temperature */
45 fastf_t sw_color[3]; /**< @brief shaded color */
46 fastf_t sw_basecolor[3]; /**< @brief base color */
47 struct hit sw_hit; /**< @brief ray hit (dist, point, normal) */
48 struct uvcoord sw_uv;
49 fastf_t sw_intensity[3*SW_NLIGHTS]; /**< @brief light intensities */
50 fastf_t sw_tolight[3*SW_NLIGHTS]; /**< @brief light directions */
51 struct light_specific *sw_visible[SW_NLIGHTS]; /**< @brief visibility flags/ptrs */
52 fastf_t sw_lightfract[SW_NLIGHTS]; /**< @brief % light visible */
53 int sw_xmitonly; /**< @brief flag: need sw_transmit only */
54 int sw_inputs; /**< @brief fields from mf_inputs actually filled */
55 int sw_frame; /**< @brief # of current frame */
56 struct seg * sw_segs; /**< @brief segs which made partition */
57};
58
59__BEGIN_DECLS
60
61extern void pr_shadework(const char *str, const struct shadework *swp);
62
63__END_DECLS
64
65#endif /* OPTICAL_SHADEWORK_H */
66
67/** @} */
68/*
69 * Local Variables:
70 * mode: C
71 * tab-width: 8
72 * indent-tabs-mode: t
73 * c-file-style: "stroustrup"
74 * End:
75 * ex: shiftwidth=4 tabstop=8
76 */
Header file for the BRL-CAD common definitions.
void pr_shadework(const char *str, const struct shadework *swp)
#define SW_NLIGHTS
Definition: shadework.h:37
double fastf_t
fastest 64-bit (or larger) floating point type
Definition: vmath.h:330
Information about where a ray hits the surface.
Definition: hit.h:61
Definition: seg.h:59
fastf_t sw_extinction
extinction coeff, mm^-1
Definition: shadework.h:42
fastf_t sw_tolight[3 *SW_NLIGHTS]
light directions
Definition: shadework.h:50
int sw_inputs
fields from mf_inputs actually filled
Definition: shadework.h:54
struct light_specific * sw_visible[SW_NLIGHTS]
visibility flags/ptrs
Definition: shadework.h:51
struct seg * sw_segs
segs which made partition
Definition: shadework.h:56
fastf_t sw_lightfract[SW_NLIGHTS]
% light visible
Definition: shadework.h:52
struct hit sw_hit
ray hit (dist, point, normal)
Definition: shadework.h:47
int sw_frame
# of current frame
Definition: shadework.h:55
fastf_t sw_refrac_index
refactive index
Definition: shadework.h:43
struct uvcoord sw_uv
Definition: shadework.h:48
fastf_t sw_transmit
0.0 -> 1.0
Definition: shadework.h:40
fastf_t sw_temperature
color temperature
Definition: shadework.h:44
int sw_xmitonly
flag: need sw_transmit only
Definition: shadework.h:53
fastf_t sw_color[3]
shaded color
Definition: shadework.h:45
fastf_t sw_intensity[3 *SW_NLIGHTS]
light intensities
Definition: shadework.h:49
fastf_t sw_basecolor[3]
base color
Definition: shadework.h:46
fastf_t sw_reflect
0.0 -> 1.0
Definition: shadework.h:41
Definition: hit.h:152