9 |
|
|
10 |
|
#include <sys/types.h> |
11 |
|
|
12 |
< |
#ifndef NON_POSIX |
13 |
< |
#ifdef BSD |
14 |
< |
#include <sys/time.h> |
15 |
< |
#include <sys/resource.h> |
12 |
> |
#include "platform.h" |
13 |
> |
#ifdef NON_POSIX |
14 |
> |
#ifdef MINGW |
15 |
> |
#include <sys/time.h> |
16 |
> |
#endif |
17 |
|
#else |
18 |
< |
#include <sys/times.h> |
19 |
< |
#include <unistd.h> |
18 |
> |
#ifdef BSD |
19 |
> |
#include <sys/time.h> |
20 |
> |
#include <sys/resource.h> |
21 |
> |
#else |
22 |
> |
#include <sys/times.h> |
23 |
> |
#include <unistd.h> |
24 |
> |
#endif |
25 |
|
#endif |
20 |
– |
#endif |
26 |
|
|
27 |
|
#include <time.h> |
28 |
|
#include <signal.h> |
29 |
|
|
25 |
– |
#include "platform.h" |
30 |
|
#include "ray.h" |
31 |
|
#include "paths.h" |
32 |
|
#include "ambient.h" |
700 |
|
/* optional depth-of-field */ |
701 |
|
if (dblur > FTINY && vdist > FTINY) { |
702 |
|
double vc, dfh, dfv; |
703 |
< |
/* PI/4. square/circle conv. */ |
704 |
< |
dfh = PI/4.*dblur*(.5 - frandom()); |
705 |
< |
dfv = PI/4.*dblur*(.5 - frandom()); |
703 |
> |
/* square/circle conv. */ |
704 |
> |
dfh = vc = 1. - 2.*frandom(); |
705 |
> |
dfv = 1. - 2.*frandom(); |
706 |
> |
dfh *= .5*dblur*sqrt(1. - .5*dfv*dfv); |
707 |
> |
dfv *= .5*dblur*sqrt(1. - .5*vc*vc); |
708 |
|
if (ourview.type == VT_PER || ourview.type == VT_PAR) { |
709 |
|
dfh /= sqrt(ourview.hn2); |
710 |
|
dfv /= sqrt(ourview.vn2); |