1 |
– |
/* Copyright (c) 1998 Silicon Graphics, Inc. */ |
2 |
– |
|
1 |
|
#ifndef lint |
2 |
< |
static char SCCSid[] = "$SunId$ SGI"; |
2 |
> |
static const char RCSid[] = "$Id$"; |
3 |
|
#endif |
6 |
– |
|
4 |
|
/* |
5 |
|
* Shading functions for anisotropic materials. |
6 |
|
*/ |
7 |
|
|
8 |
+ |
#include "copyright.h" |
9 |
+ |
|
10 |
|
#include "ray.h" |
11 |
|
|
12 |
|
#include "otypes.h" |
15 |
|
|
16 |
|
#include "random.h" |
17 |
|
|
19 |
– |
extern double specthresh; /* specular sampling threshold */ |
20 |
– |
extern double specjitter; /* specular sampling jitter */ |
21 |
– |
|
22 |
– |
extern int backvis; /* back faces visible? */ |
23 |
– |
|
18 |
|
#ifndef MAXITER |
19 |
|
#define MAXITER 10 /* maximum # specular ray attempts */ |
20 |
|
#endif |
21 |
|
|
28 |
– |
static agaussamp(), getacoords(); |
29 |
– |
|
22 |
|
/* |
23 |
|
* This routine implements the anisotropic Gaussian |
24 |
|
* model described by Ward in Siggraph `92 article. |
60 |
|
double pdot; /* perturbed dot product */ |
61 |
|
} ANISODAT; /* anisotropic material data */ |
62 |
|
|
63 |
+ |
static void getacoords(); |
64 |
+ |
static void agaussamp(); |
65 |
|
|
66 |
+ |
|
67 |
+ |
static void |
68 |
|
diraniso(cval, np, ldir, omega) /* compute source contribution */ |
69 |
|
COLOR cval; /* returned coefficient */ |
70 |
|
register ANISODAT *np; /* material data */ |
178 |
|
} |
179 |
|
|
180 |
|
|
181 |
+ |
int |
182 |
|
m_aniso(m, r) /* shade ray that hit something anisotropic */ |
183 |
|
register OBJREC *m; |
184 |
|
register RAY *r; |
304 |
|
} |
305 |
|
|
306 |
|
|
307 |
< |
static |
307 |
> |
static void |
308 |
|
getacoords(r, np) /* set up coordinate system */ |
309 |
|
RAY *r; |
310 |
|
register ANISODAT *np; |
334 |
|
} |
335 |
|
|
336 |
|
|
337 |
< |
static |
337 |
> |
static void |
338 |
|
agaussamp(r, np) /* sample anisotropic gaussian specular */ |
339 |
|
RAY *r; |
340 |
|
register ANISODAT *np; |