9 |
|
#include "octree.h" |
10 |
|
#include "object.h" |
11 |
|
#include "color.h" |
12 |
+ |
#include "pmapparm.h" |
13 |
|
|
14 |
|
#ifdef __cplusplus |
15 |
|
extern "C" { |
46 |
|
RREAL rod; /* -DOT(rdir, ron) */ |
47 |
|
RREAL uv[2]; /* local coordinates */ |
48 |
|
FVECT pert; /* surface normal perturbation */ |
49 |
< |
RREAL rt; /* returned effective ray length */ |
49 |
> |
RREAL rmt; /* returned mirrored ray length */ |
50 |
> |
RREAL rxt; /* returned unmirrored ray length */ |
51 |
|
const struct ray *parent; /* ray this originated from */ |
52 |
|
OBJECT *clipset; /* set of objects currently clipped */ |
53 |
|
OBJECT *newcset; /* next clipset, used for transmission */ |
62 |
|
float rweight; /* cumulative weight (for termination) */ |
63 |
|
COLOR rcoef; /* contribution coefficient w.r.t. parent */ |
64 |
|
COLOR pcol; /* pattern color */ |
65 |
+ |
COLOR mcol; /* mirrored color contribution */ |
66 |
|
COLOR rcol; /* returned radiance value */ |
67 |
|
COLOR cext; /* medium extinction coefficient */ |
68 |
|
COLOR albedo; /* medium scattering albedo */ |
74 |
|
|
75 |
|
#define rayvalue(r) (*(r)->revf)(r) |
76 |
|
|
77 |
+ |
#define raydistance(r) (bright((r)->mcol) > 0.5*bright((r)->rcol) ? \ |
78 |
+ |
(r)->rmt : (r)->rxt) |
79 |
+ |
|
80 |
|
extern char VersionID[]; /* Radiance version ID string */ |
81 |
|
|
82 |
|
extern CUBE thescene; /* our scene */ |
170 |
|
int ambincl; |
171 |
|
short amblndx[AMBLLEN+1]; |
172 |
|
char amblval[AMBLLEN*AMBWORD]; |
173 |
+ |
|
174 |
+ |
/* PMAP: photon mapping parameters */ |
175 |
+ |
PhotonMapParams pmapParams [NUM_PMAP_TYPES]; |
176 |
|
} RAYPARAMS; |
177 |
|
|
178 |
|
#define rpambmod(p,i) ( (i)>=AMBLLEN||(p)->amblndx[i]<0 ? \ |
221 |
|
extern void rayhit(OBJECT *oset, RAY *r); |
222 |
|
extern void raycont(RAY *r); |
223 |
|
extern void raytrans(RAY *r); |
224 |
+ |
extern int raytirrad(OBJREC *m, RAY *r); |
225 |
|
extern int rayshade(RAY *r, int mod); |
226 |
|
extern void rayparticipate(RAY *r); |
227 |
|
extern void raytexture(RAY *r, OBJECT mod); |
228 |
|
extern int raymixture(RAY *r, OBJECT fore, OBJECT back, double coef); |
229 |
< |
extern void raycontrib(double rc[3], const RAY *r, int flags); |
229 |
> |
extern void raycontrib(RREAL rc[3], const RAY *r, int flags); |
230 |
|
extern double raydist(const RAY *r, int flags); |
231 |
|
extern double raynormal(FVECT norm, RAY *r); |
232 |
|
extern void newrayxf(RAY *r); |
248 |
|
extern void rpict(int seq, char *pout, char *zout, char *prvr); |
249 |
|
|
250 |
|
#ifdef __FAST_MATH__ |
251 |
< |
#define checknorm(vn) normalize(vn) |
251 |
> |
#define checknorm(vn) (void)normalize(vn) |
252 |
|
#else |
253 |
< |
#define checknorm(vn) 1.0 |
253 |
> |
#define checknorm(vn) |
254 |
|
#endif |
255 |
|
|
256 |
|
#ifdef __cplusplus |