14 |
|
#include "otypes.h" |
15 |
|
#include "otspecial.h" |
16 |
|
#include "random.h" |
17 |
+ |
#include "pmap.h" |
18 |
|
|
19 |
|
#define MAXCSET ((MAXSET+1)*2-1) /* maximum check set size */ |
20 |
|
|
36 |
|
static void checkset(OBJECT *os, OBJECT *cs); |
37 |
|
|
38 |
|
|
39 |
< |
extern int |
39 |
> |
int |
40 |
|
rayorigin( /* start new ray from old one */ |
41 |
|
RAY *r, |
42 |
|
int rt, |
125 |
|
} |
126 |
|
|
127 |
|
|
128 |
< |
extern void |
128 |
> |
void |
129 |
|
rayclear( /* clear a ray for (re)evaluation */ |
130 |
|
RAY *r |
131 |
|
) |
144 |
|
} |
145 |
|
|
146 |
|
|
147 |
< |
extern void |
147 |
> |
void |
148 |
|
raytrace( /* trace a ray and compute its value */ |
149 |
|
RAY *r |
150 |
|
) |
164 |
|
} |
165 |
|
|
166 |
|
|
167 |
< |
extern void |
167 |
> |
void |
168 |
|
raycont( /* check for clipped object and continue */ |
169 |
|
RAY *r |
170 |
|
) |
175 |
|
} |
176 |
|
|
177 |
|
|
178 |
< |
extern void |
178 |
> |
void |
179 |
|
raytrans( /* transmit ray as is */ |
180 |
|
RAY *r |
181 |
|
) |
191 |
|
} |
192 |
|
|
193 |
|
|
194 |
< |
extern int |
194 |
> |
int |
195 |
|
rayshade( /* shade ray r with material mod */ |
196 |
|
RAY *r, |
197 |
|
int mod |
226 |
|
} |
227 |
|
|
228 |
|
|
229 |
< |
extern void |
229 |
> |
void |
230 |
|
rayparticipate( /* compute ray medium participation */ |
231 |
|
RAY *r |
232 |
|
) |
250 |
|
multcolor(r->rcol, ce); /* path extinction */ |
251 |
|
if (r->crtype & SHADOW || intens(r->albedo) <= FTINY) |
252 |
|
return; /* no scattering */ |
253 |
< |
setcolor(ca, |
254 |
< |
colval(r->albedo,RED)*colval(ambval,RED)*(1.-colval(ce,RED)), |
255 |
< |
colval(r->albedo,GRN)*colval(ambval,GRN)*(1.-colval(ce,GRN)), |
256 |
< |
colval(r->albedo,BLU)*colval(ambval,BLU)*(1.-colval(ce,BLU))); |
257 |
< |
addcolor(r->rcol, ca); /* ambient in scattering */ |
253 |
> |
|
254 |
> |
/* PMAP: indirect inscattering accounted for by volume photons? */ |
255 |
> |
if (!volumePhotonMapping) { |
256 |
> |
setcolor(ca, |
257 |
> |
colval(r->albedo,RED)*colval(ambval,RED)*(1.-colval(ce,RED)), |
258 |
> |
colval(r->albedo,GRN)*colval(ambval,GRN)*(1.-colval(ce,GRN)), |
259 |
> |
colval(r->albedo,BLU)*colval(ambval,BLU)*(1.-colval(ce,BLU))); |
260 |
> |
addcolor(r->rcol, ca); /* ambient in scattering */ |
261 |
> |
} |
262 |
> |
|
263 |
|
srcscatter(r); /* source in scattering */ |
264 |
|
} |
265 |
|
|
266 |
|
|
267 |
< |
extern void |
267 |
> |
void |
268 |
|
raytexture( /* get material modifiers */ |
269 |
|
RAY *r, |
270 |
|
OBJECT mod |
289 |
|
} |
290 |
|
|
291 |
|
|
292 |
< |
extern int |
292 |
> |
int |
293 |
|
raymixture( /* mix modifiers */ |
294 |
|
RAY *r, |
295 |
|
OBJECT fore, |
349 |
|
} |
350 |
|
|
351 |
|
|
352 |
< |
extern double |
352 |
> |
double |
353 |
|
raydist( /* compute (cumulative) ray distance */ |
354 |
|
const RAY *r, |
355 |
|
int flags |
365 |
|
} |
366 |
|
|
367 |
|
|
368 |
< |
extern void |
368 |
> |
void |
369 |
|
raycontrib( /* compute (cumulative) ray contribution */ |
370 |
|
RREAL rc[3], |
371 |
|
const RAY *r, |
391 |
|
} |
392 |
|
|
393 |
|
|
394 |
< |
extern double |
394 |
> |
double |
395 |
|
raynormal( /* compute perturbed normal for ray */ |
396 |
|
FVECT norm, |
397 |
|
RAY *r |
427 |
|
} |
428 |
|
|
429 |
|
|
430 |
< |
extern void |
430 |
> |
void |
431 |
|
newrayxf( /* get new tranformation matrix for ray */ |
432 |
|
RAY *r |
433 |
|
) |
465 |
|
} |
466 |
|
|
467 |
|
|
468 |
< |
extern void |
468 |
> |
void |
469 |
|
flipsurface( /* reverse surface orientation */ |
470 |
|
RAY *r |
471 |
|
) |
480 |
|
} |
481 |
|
|
482 |
|
|
483 |
< |
extern void |
483 |
> |
void |
484 |
|
rayhit( /* standard ray hit test */ |
485 |
|
OBJECT *oset, |
486 |
|
RAY *r |
497 |
|
} |
498 |
|
|
499 |
|
|
500 |
< |
extern int |
500 |
> |
int |
501 |
|
localhit( /* check for hit in the octree */ |
502 |
|
RAY *r, |
503 |
|
CUBE *scene |