BRL-CAD
sh_fire.c
Go to the documentation of this file.
1 /* S H _ F I R E . C
2  * BRL-CAD
3  *
4  * Copyright (c) 1997-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/sh_fire.c
21  *
22  * Fire shader
23  *
24  * Parameters:
25  *
26  * flicker=rate Specifies rate of translation through noise space for
27  * animation. swp->frametime * flicker gives a delta in Z of noise
28  * space for animation. Useful values probably in range 0 > flicker >
29  * 10
30  *
31  * stretch=dist Specifies a scaling of the exponential stretch of the
32  * flames. flame stretch = e^(pos[Z] * -stretch)
33  *
34  *
35  * Standard fbm parameters:
36  *
37  * lacunarity Scale between different levels of noise detail
38  *
39  * octaves Number of different levels of noise to add to get structure
40  * of the flames.
41  *
42  * h_val power for frequency (usually 1)
43  *
44  * scale 3-tuple which scales noise WRT shader space: "how big is the
45  * largest noise frequency on object"
46  *
47  * delta 3-tuple specifying origin delta in noise space: "what piece
48  * of noise space maps to shader origin"
49  *
50  * Usage:
51  * mged> shader flame.r {fire {st 1.25}}
52  *
53  * Note: The fire shader provides its own color. It does not read any
54  * color information from the region definition.
55  *
56  */
57 
58 #include "common.h"
59 
60 #include <stddef.h>
61 #include <stdio.h>
62 #include <string.h>
63 #include <math.h>
64 
65 #include "bu/units.h"
66 #include "vmath.h"
67 #include "raytrace.h"
68 #include "optical.h"
69 
70 
71 #define fire_MAGIC 0x46697265 /* ``Fire'' */
72 #define CK_fire_SP(_p) BU_CKMAG(_p, fire_MAGIC, "fire_specific")
73 
74 /*
75  * the shader specific structure contains all variables which are unique
76  * to any particular use of the shader.
77  */
78 struct fire_specific {
79  uint32_t magic; /* magic # for memory validity check, must come 1st */
81  double fire_flicker; /* flicker rate */
82  double fire_stretch;
84  double noise_h_val;
85  double noise_octaves;
86  double noise_size;
87  vect_t noise_vscale;
88  vect_t noise_delta;
89  /* the following values are computed */
90  point_t fire_min;
91  point_t fire_max;
92  mat_t fire_m_to_sh; /* model to shader space matrix */
93  mat_t fire_sh_to_noise; /* shader to noise space matrix */
95 };
96 
97 
98 /* The default values for the variables in the shader specific structure */
99 static const
100 struct fire_specific fire_defaults = {
101  fire_MAGIC,
102  0, /* fire_debug */
103  1.0, /* fire flicker rate */
104  0.0, /* fire_stretch */
105  2.1753974, /* noise_lacunarity */
106  1.0, /* noise_h_val */
107  2.0, /* noise_octaves */
108  -1.0, /* noise_size */
109  VINITALL(10.0), /* noise_vscale */
110  VINIT_ZERO, /* noise_delta */
111  VINIT_ZERO, /* fire_min */
112  VINIT_ZERO, /* fire_max */
113  MAT_INIT_IDN, /* fire_m_to_sh */
114  MAT_INIT_IDN, /* fire_sh_to_noise */
115  MAT_INIT_ZERO /* fire_colorspline_mat */
116 };
117 
118 
119 #define SHDR_NULL ((struct fire_specific *)0)
120 #define SHDR_O(m) bu_offsetof(struct fire_specific, m)
121 
122 
123 /* description of how to parse/print the arguments to the shader
124  * There is at least one line here for each variable in the shader specific
125  * structure above
126  */
128  {"%d", 1, "debug", SHDR_O(fire_debug), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
129  {"%f", 1, "flicker", SHDR_O(fire_flicker), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
130  {"%f", 1, "stretch", SHDR_O(fire_stretch), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
131  {"%g", 1, "lacunarity", SHDR_O(noise_lacunarity), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
132  {"%g", 1, "H", SHDR_O(noise_h_val), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
133  {"%g", 1, "octaves", SHDR_O(noise_octaves), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
134  {"%g", 3, "scale", SHDR_O(noise_size), bu_mm_cvt, NULL, NULL },
135  {"%f", 3, "vscale", SHDR_O(noise_vscale), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
136  {"%f", 3, "delta", SHDR_O(noise_delta), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
137  {"%f", 3, "max", SHDR_O(fire_max), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
138  {"%f", 3, "min", SHDR_O(fire_min), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
139  {"", 0, (char *)0, 0, BU_STRUCTPARSE_FUNC_NULL, NULL, NULL }
140 
141 };
143  {"%p", 1, "fire_print_tab", bu_byteoffset(fire_print_tab[0]), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
144  {"%f", 1, "f", SHDR_O(fire_flicker), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
145  {"%f", 1, "st", SHDR_O(fire_stretch), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
146  {"%g", 1, "l", SHDR_O(noise_lacunarity), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
147  {"%g", 1, "H", SHDR_O(noise_h_val), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
148  {"%g", 1, "o", SHDR_O(noise_octaves), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
149  {"%g", 1, "s", SHDR_O(noise_size), bu_mm_cvt, NULL, NULL },
150  {"%f", 3, "v", SHDR_O(noise_vscale), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
151  {"%f", 3, "vs", SHDR_O(noise_vscale), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
152  {"%f", 3, "d", SHDR_O(noise_delta), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
153  {"", 0, (char *)0, 0, BU_STRUCTPARSE_FUNC_NULL, NULL, NULL }
154 };
155 
156 
157 HIDDEN int fire_setup(register struct region *rp, struct bu_vls *matparm, void **dpp, const struct mfuncs *mfp, struct rt_i *rtip);
158 HIDDEN int fire_render(struct application *ap, const struct partition *pp, struct shadework *swp, void *dp);
159 HIDDEN void fire_print(register struct region *rp, void *dp);
160 HIDDEN void fire_free(void *cp);
161 
162 /* The "mfuncs" structure defines the external interface to the shader.
163  * Note that more than one shader "name" can be associated with a given
164  * shader by defining more than one mfuncs struct in this array.
165  * See sh_phong.c for an example of building more than one shader "name"
166  * from a set of source functions. There you will find that "glass" "mirror"
167  * and "plastic" are all names for the same shader with different default
168  * values for the parameters.
169  */
170 struct mfuncs fire_mfuncs[] = {
171  {MF_MAGIC, "fire", 0, MFI_HIT, 0,
172  fire_setup, fire_render, fire_print, fire_free },
173 
174  {0, (char *)0, 0, 0, 0,
175  0, 0, 0, 0 }
176 };
177 
178 
179 const double flame_colors[18][3] = {
180  {0.0, 0.0, 0.0},
181  {0.0, 0.0, 0.0},
182  {0.106, 0.0, 0.0},
183  {0.212, 0.0, 0.0},
184  {0.318, 0.0, 0.0},
185  {0.427, 0.0, 0.0},
186  {0.533, 0.0, 0.0},
187  {0.651, 0.02, 0.0},
188  {0.741, 0.118, 0.0},
189  {0.827, 0.235, 0.0},
190  {0.906, 0.353, 0.0},
191  {0.933, 0.500, 0.0},
192  {0.957, 0.635, 0.047},
193  {0.973, 0.733, 0.227},
194  {0.984, 0.820, 0.451},
195  {0.990, 0.925, 0.824},
196  {1.0, 0.945, 0.902},
197  {1.0, 0.945, 0.902}
198 };
199 
200 
201 /*
202  * This routine is called (at prep time)
203  * once for each region which uses this shader.
204  * Any shader-specific initialization should be done here.
205  */
206 HIDDEN int
207 fire_setup(register struct region *rp, struct bu_vls *matparm, void **dpp, const struct mfuncs *UNUSED(mfp), struct rt_i *rtip)
208 /* pointer to reg_udata in *rp */
209 /* New since 4.4 release */
210 {
211  register struct fire_specific *fire_sp;
212 
213  /* check the arguments */
214  RT_CHECK_RTI(rtip);
215  BU_CK_VLS(matparm);
216  RT_CK_REGION(rp);
217 
218 
219  if (rdebug&RDEBUG_SHADE)
220  bu_log("fire_setup(%s)\n", rp->reg_name);
221 
222  /* Get memory for the shader parameters and shader-specific data */
223  BU_GET(fire_sp, struct fire_specific);
224  *dpp = fire_sp;
225 
226  /* initialize the default values for the shader */
227  memcpy(fire_sp, &fire_defaults, sizeof(struct fire_specific));
228 
229  /* parse the user's arguments for this use of the shader. */
230  if (bu_struct_parse(matparm, fire_parse_tab, (char *)fire_sp, NULL) < 0)
231  return -1;
232 
233  if (!EQUAL(fire_sp->noise_size, -1.0)) {
234  VSETALL(fire_sp->noise_vscale, fire_sp->noise_size);
235  }
236 
237  /*
238  * The shader needs to operate in a coordinate system which stays
239  * fixed on the region when the region is moved (as in animation).
240  * We need to get a matrix to perform the appropriate transform(s).
241  */
242 
243  rt_shader_mat(fire_sp->fire_m_to_sh, rtip, rp, fire_sp->fire_min,
244  fire_sp->fire_max, &rt_uniresource);
245 
246  /* Build matrix to map shader space to noise space.
247  * XXX If only we could get the frametime at this point
248  * we could factor the flicker of flames into this matrix
249  * rather than having to recompute it on a pixel-by-pixel basis.
250  */
251  MAT_IDN(fire_sp->fire_sh_to_noise);
252  MAT_DELTAS_VEC(fire_sp->fire_sh_to_noise, fire_sp->noise_delta);
253  MAT_SCALE_VEC(fire_sp->fire_sh_to_noise, fire_sp->noise_vscale);
254 
255  /* get matrix for performing spline of fire colors */
256  rt_dspline_matrix(fire_sp->fire_colorspline_mat, "Catmull", 0.5, 0.0);
257 
258 
259  if (rdebug&RDEBUG_SHADE || fire_sp->fire_debug) {
260  bu_struct_print(" FIRE Parameters:", fire_print_tab, (char *)fire_sp);
261  bn_mat_print("m_to_sh", fire_sp->fire_m_to_sh);
262  bn_mat_print("sh_to_noise", fire_sp->fire_sh_to_noise);
263  bn_mat_print("colorspline", fire_sp->fire_colorspline_mat);
264  }
265 
266  return 1;
267 }
268 
269 
270 HIDDEN void
271 fire_print(register struct region *rp, void *dp)
272 {
273  bu_struct_print(rp->reg_name, fire_print_tab, (char *)dp);
274 }
275 
276 
277 HIDDEN void
278 fire_free(void *cp)
279 {
280  BU_PUT(cp, struct fire_specific);
281 }
282 
283 
284 /*
285  * This is called (from viewshade() in shade.c) once for each hit point
286  * to be shaded. The purpose here is to fill in values in the shadework
287  * structure.
288  */
289 int
290 fire_render(struct application *ap, const struct partition *pp, struct shadework *swp, void *dp)
291 /* defined in material.h */
292 /* ptr to the shader-specific struct */
293 {
294 #define DEBUG_SPACE_PRINT(str, i_pt, o_pt) \
295  if (rdebug&RDEBUG_SHADE || fire_sp->fire_debug) { \
296  bu_log("fire_render() %s space \n", str); \
297  bu_log("fire_render() i_pt(%g %g %g)\n", V3ARGS(i_pt)); \
298  bu_log("fire_render() o_pt(%g %g %g)\n", V3ARGS(o_pt)); \
299  }
300 
301 #define SHADER_TO_NOISE(n_pt, sh_pt, fire_sp, zdelta) { \
302  point_t tmp_pt; \
303  tmp_pt[X] = sh_pt[X]; \
304  tmp_pt[Y] = sh_pt[Y]; \
305  if (! NEAR_ZERO(fire_sp->fire_stretch, SQRT_SMALL_FASTF)) \
306  tmp_pt[Z] = exp((sh_pt[Z]+0.125) * -fire_sp->fire_stretch); \
307  else \
308  tmp_pt[Z] = sh_pt[Z]; \
309  MAT4X3PNT(n_pt, fire_sp->fire_sh_to_noise, tmp_pt); \
310  n_pt[Z] += zdelta; \
311  }
312 
313 
314  register struct fire_specific *fire_sp =
315  (struct fire_specific *)dp;
316  point_t m_i_pt, m_o_pt; /* model space in/out points */
317  point_t sh_i_pt, sh_o_pt; /* shader space in/out points */
318  point_t noise_i_pt, noise_o_pt; /* shader space in/out points */
319  point_t noise_pt;
320  double color[3];
321  vect_t noise_r_dir;
322  double noise_r_thick;
323  int i;
324  double samples_per_unit_noise;
325  double noise_dist_per_sample;
326  point_t shader_pt;
327  vect_t shader_r_dir;
328  double shader_r_thick;
329  double shader_dist_per_sample;
330  double noise_zdelta;
331 
332  int samples;
333  double dist;
334  double noise_val;
335  double lumens;
336 
337  /* check the validity of the arguments we got */
338  RT_AP_CHECK(ap);
339  RT_CHECK_PT(pp);
340  CK_fire_SP(fire_sp);
341 
342  if (rdebug&RDEBUG_SHADE || fire_sp->fire_debug) {
343 /* bu_struct_print("fire_render Parameters:", fire_print_tab, (char *)fire_sp); */
344  bu_log("fire_render()\n");
345  }
346  /* If we are performing the shading in "region" space, we must
347  * transform the hit point from "model" space to "region" space.
348  * See the call to db_region_mat in fire_setup().
349  */
350 
351  /*
352  * Compute the ray/solid in and out points,
353  */
354  VMOVE(m_i_pt, swp->sw_hit.hit_point);
355  VJOIN1(m_o_pt, ap->a_ray.r_pt, pp->pt_outhit->hit_dist, ap->a_ray.r_dir);
356  DEBUG_SPACE_PRINT("model", m_i_pt, m_o_pt);
357 
358  /* map points into shader space */
359  MAT4X3PNT(sh_i_pt, fire_sp->fire_m_to_sh, m_i_pt);
360  MAT4X3PNT(sh_o_pt, fire_sp->fire_m_to_sh, m_o_pt);
361  DEBUG_SPACE_PRINT("shader", sh_i_pt, sh_o_pt);
362 
363  noise_zdelta = fire_sp->fire_flicker * swp->sw_frametime;
364 
365  SHADER_TO_NOISE(noise_i_pt, sh_i_pt, fire_sp, noise_zdelta);
366  SHADER_TO_NOISE(noise_o_pt, sh_o_pt, fire_sp, noise_zdelta);
367 
368  VSUB2(noise_r_dir, noise_o_pt, noise_i_pt);
369 
370  noise_r_thick = MAGNITUDE(noise_r_dir);
371 
372  if (rdebug&RDEBUG_SHADE || fire_sp->fire_debug) {
373  bu_log("fire_render() noise_r_dir (%g %g %g)\n",
374  V3ARGS(noise_r_dir));
375  bu_log("fire_render() noise_r_thick %g\n", noise_r_thick);
376  }
377 
378 
379  /* compute number of samples per unit length in noise space.
380  *
381  * The noise field used by the bn_noise_turb and bn_noise_fbm routines
382  * has a maximum frequency of about 1 cycle per integer step in
383  * noise space. Each octave increases this frequency by the
384  * "lacunarity" factor. To sample this space adequately, nyquist
385  * tells us we need at least 4 samples/cycle at the highest octave
386  * rate.
387  */
388 
389  samples_per_unit_noise =
390  pow(fire_sp->noise_lacunarity, fire_sp->noise_octaves-1) * 4.0;
391 
392  noise_dist_per_sample = 1.0 / samples_per_unit_noise;
393 
394  samples = samples_per_unit_noise * noise_r_thick;
395 
396  if (samples < 1) samples = 1;
397 
398  if (rdebug&RDEBUG_SHADE || fire_sp->fire_debug) {
399  bu_log("samples:%d\n", samples);
400  bu_log("samples_per_unit_noise %g\n", samples_per_unit_noise);
401  bu_log("noise_dist_per_sample %g\n", noise_dist_per_sample);
402  }
403 
404  /* To do the exponential stretch and decay properly we need to
405  * do the computations in shader space, and convert the points
406  * to noise space. Performance pig.
407  */
408 
409  VSUB2(shader_r_dir, sh_o_pt, sh_i_pt);
410  shader_r_thick = MAGNITUDE(shader_r_dir);
411  VUNITIZE(shader_r_dir);
412 
413  shader_dist_per_sample = shader_r_thick / samples;
414 
415  lumens = 0.0;
416  for (i = 0; i < samples; i++) {
417  dist = (double)i * shader_dist_per_sample;
418  VJOIN1(shader_pt, sh_i_pt, dist, shader_r_dir);
419 
420  SHADER_TO_NOISE(noise_pt, shader_pt, fire_sp, noise_zdelta);
421 
422  noise_val = bn_noise_turb(noise_pt, fire_sp->noise_h_val,
423  fire_sp->noise_lacunarity, fire_sp->noise_octaves);
424 
425  if (rdebug&RDEBUG_SHADE || fire_sp->fire_debug)
426  bu_log("bn_noise_turb(%g %g %g) = %g\n",
427  V3ARGS(noise_pt),
428  noise_val);
429 
430  /* XXX
431  * When doing the exponential stretch, we scale the noise
432  * value by the height in shader space
433  */
434 
435  if (NEAR_ZERO(fire_sp->fire_stretch, SQRT_SMALL_FASTF))
436  lumens += noise_val * 0.025;
437  else {
438  register double t;
439  t = lumens;
440  lumens += noise_val * 0.025 * (1.0 -shader_pt[Z]);
441  if (rdebug&RDEBUG_SHADE || fire_sp->fire_debug)
442  bu_log("lumens:%g = %g + %g * %g\n",
443  lumens, t, noise_val,
444  0.025 * (1.0 - shader_pt[Z]));
445 
446  }
447  if (lumens >= 1.0) {
448  lumens = 1.0;
449  if (rdebug&RDEBUG_SHADE || fire_sp->fire_debug)
450  bu_log("early exit from lumens loop\n");
451  break;
452  }
453 
454  }
455 
456  if (rdebug&RDEBUG_SHADE || fire_sp->fire_debug)
457  bu_log("lumens = %g\n", lumens);
458 
459  if (lumens < 0.0) lumens = 0.0;
460  else if (lumens > 1.0) lumens = 1.0;
461 
462 
463  rt_dspline_n(color, fire_sp->fire_colorspline_mat, (double *)flame_colors,
464  18, 3, lumens);
465 
466  VMOVE(swp->sw_color, color);
467 /* VSETALL(swp->sw_basecolor, 1.0);*/
468 
469  swp->sw_transmit = 1.0 - (lumens * 4.0);
470  if (swp->sw_reflect > 0 || swp->sw_transmit > 0)
471  (void)rr_render(ap, pp, swp);
472 
473  return 1;
474 }
475 
476 
477 /*
478  * Local Variables:
479  * mode: C
480  * tab-width: 8
481  * indent-tabs-mode: t
482  * c-file-style: "stroustrup"
483  * End:
484  * ex: shiftwidth=4 tabstop=8
485  */
struct xray a_ray
Actual ray to be shot.
Definition: raytrace.h:1583
const double flame_colors[18][3]
Definition: sh_fire.c:179
void bu_log(const char *,...) _BU_ATTR_PRINTF12
Definition: log.c:176
double fire_flicker
Definition: sh_fire.c:81
struct hit * pt_outhit
OUT hit ptr.
Definition: raytrace.h:579
#define DEBUG_SPACE_PRINT(str, i_pt, o_pt)
#define bu_byteoffset(_i)
Definition: parse.h:81
HIDDEN void fire_free(void *cp)
Definition: sh_fire.c:278
HIDDEN int fire_setup(register struct region *rp, struct bu_vls *matparm, void **dpp, const struct mfuncs *mfp, struct rt_i *rtip)
Definition: sh_fire.c:207
#define MF_MAGIC
Definition: magic.h:205
vect_t noise_vscale
Definition: sh_fire.c:87
int rt_shader_mat(mat_t model_to_shader, const struct rt_i *rtip, const struct region *rp, point_t p_min, point_t p_max, struct resource *resp)
Definition: db_tree.c:2300
double noise_h_val
Definition: sh_fire.c:84
struct bu_structparse fire_parse_tab[]
Definition: sh_fire.c:142
#define VSETALL(a, s)
Definition: color.c:54
double bn_noise_turb(point_t point, double h_val, double lacunarity, double octaves)
Procedural turbulence evaluated at "point";.
struct bu_structparse fire_print_tab[]
Definition: sh_fire.c:127
Header file for the BRL-CAD common definitions.
const char * reg_name
Identifying string.
Definition: raytrace.h:539
void bu_mm_cvt(const struct bu_structparse *sdp, const char *name, void *base, const char *value, void *data)
Definition: units.c:386
#define RT_CK_REGION(_p)
Definition: raytrace.h:559
#define HIDDEN
Definition: common.h:86
#define SHDR_O(m)
Definition: sh_fire.c:120
mat_t fire_sh_to_noise
Definition: sh_fire.c:93
void bu_struct_print(const char *title, const struct bu_structparse *parsetab, const char *base)
Definition: parse.c:1221
double noise_octaves
Definition: sh_fire.c:85
#define RT_AP_CHECK(_ap)
Definition: raytrace.h:1685
uint32_t magic
Definition: sh_fire.c:79
#define BU_CK_VLS(_vp)
Definition: vls.h:69
struct resource rt_uniresource
default. Defined in librt/globals.c
Definition: globals.c:41
void bn_mat_print(const char *title, const mat_t m)
Definition: mat.c:81
#define fire_MAGIC
Definition: sh_fire.c:71
mat_t fire_m_to_sh
Definition: sh_fire.c:92
#define RT_CHECK_RTI(_p)
Definition: raytrace.h:1832
#define V3ARGS(a)
Definition: color.c:56
#define NEAR_ZERO(val, epsilon)
Definition: color.c:55
vect_t noise_delta
Definition: sh_fire.c:88
#define BU_GET(_ptr, _type)
Definition: malloc.h:201
#define SQRT_SMALL_FASTF
Definition: defines.h:346
struct mfuncs fire_mfuncs[]
Definition: sh_fire.c:170
point_t fire_max
Definition: sh_fire.c:91
void rt_dspline_matrix(fastf_t *m, const char *type, const double tension, const double bias)
Definition: dspline.c:122
#define UNUSED(parameter)
Definition: common.h:239
mat_t fire_colorspline_mat
Definition: sh_fire.c:94
#define BU_PUT(_ptr, _type)
Definition: malloc.h:215
#define BU_STRUCTPARSE_FUNC_NULL
Definition: parse.h:153
vect_t r_dir
Direction of ray (UNIT Length)
Definition: raytrace.h:219
point_t r_pt
Point at which ray starts.
Definition: raytrace.h:218
HIDDEN int fire_render(struct application *ap, const struct partition *pp, struct shadework *swp, void *dp)
Definition: sh_fire.c:290
#define RDEBUG_SHADE
Definition: optical.h:130
double noise_size
Definition: sh_fire.c:86
int bu_struct_parse(const struct bu_vls *in_vls, const struct bu_structparse *desc, const char *base, void *data)
Definition: parse.c:878
#define CK_fire_SP(_p)
Definition: sh_fire.c:72
Definition: color.c:51
double noise_lacunarity
Definition: sh_fire.c:83
HIDDEN void fire_print(register struct region *rp, void *dp)
Definition: sh_fire.c:271
int rr_render(struct application *app, const struct partition *pp, struct shadework *swp)
point_t fire_min
Definition: sh_fire.c:90
int fire_debug
Definition: sh_fire.c:80
#define RT_CHECK_PT(_p)
compat
Definition: raytrace.h:588
fastf_t hit_dist
dist from r_pt to hit_point
Definition: raytrace.h:250
Definition: vls.h:56
#define SHADER_TO_NOISE(n_pt, sh_pt, fire_sp, zdelta)
Header file for the BRL-CAD Optical Library, LIBOPTICAL.
void rt_dspline_n(double *r, const fastf_t *m, const double *knots, const int nknots, const int depth, const double alpha)
Definition: dspline.c:182
int rdebug
Definition: init.c:39
double fire_stretch
Definition: sh_fire.c:82