Basic diffuse mapping and gamma correction

This commit is contained in:
Phireh 2021-08-21 19:43:19 +02:00
commit 4497cc7f68
4 changed files with 41 additions and 10 deletions

View file

@ -13,7 +13,7 @@ double degrees_to_radians(double d)
/* Returns a double in the range [0,1) */
inline double random_double()
{
return rand() / RAND_MAX + 1.0;
return rand() * (1.0 / RAND_MAX);
}
/* Returns a double in the range [min,max) */