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 |
|
* dielectric.c - shading function for transparent materials. |
9 |
– |
* |
10 |
– |
* 9/6/85 |
6 |
|
*/ |
7 |
|
|
8 |
+ |
#include "copyright.h" |
9 |
+ |
|
10 |
|
#include "ray.h" |
11 |
|
|
12 |
|
#include "otypes.h" |
47 |
|
|
48 |
|
#define MINCOS 0.997 /* minimum dot product for dispersion */ |
49 |
|
|
53 |
– |
extern COLOR cextinction; /* global coefficient of extinction */ |
54 |
– |
extern COLOR salbedo; /* global scattering albedo */ |
50 |
|
|
56 |
– |
|
51 |
|
static double |
52 |
|
mylog(x) /* special log for extinction coefficients */ |
53 |
|
double x; |
150 |
|
|
151 |
|
refl *= 0.5; |
152 |
|
trans = 1.0 - refl; |
153 |
+ |
|
154 |
+ |
trans *= nratio*nratio; /* solid angle ratio */ |
155 |
|
|
156 |
|
if (rayorigin(&p, r, REFRACTED, trans) == 0) { |
157 |
|
|