Add enviromental samples per pixel
This commit is contained in:
parent
1eeb328b60
commit
f622a55c5c
4 changed files with 93 additions and 20 deletions
|
|
@ -10,6 +10,24 @@ double degrees_to_radians(double d)
|
|||
return d * M_PI / 180;
|
||||
}
|
||||
|
||||
/* Returns a double in the range [0,1) */
|
||||
inline double random_double()
|
||||
{
|
||||
return rand() / RAND_MAX + 1.0;
|
||||
}
|
||||
|
||||
/* Returns a double in the range [min,max) */
|
||||
inline double random_double(double min, double max)
|
||||
{
|
||||
return min + (max-min) * random_double();
|
||||
}
|
||||
|
||||
/* Clamps a value between [min,max] */
|
||||
inline double clamp(double v, double min, double max)
|
||||
{
|
||||
return v < min ? min : v > max ? max : v;
|
||||
}
|
||||
|
||||
/* Common internal headers */
|
||||
|
||||
#include "ray.hpp"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue