Random() issues with rendering...

- AO and soft shadow AreaLight tables were generated without fixed seed,
  causing animations to give unwanted amounts of noise.
- Made sure these tables now are calculated before render, with fixed seed
- Then found out the BLI_rand() has very bad seeding... it showed up as
  patterns. After some experimenting, found a nice method using noise.c
  hash tables. For compatibility with old code, named it BLI_srandom() to
  use this next to the BLI_srand(). This follows libc rand() and random()
  naming convention.
- Then of course threading should work... so made a BLI_thread_rand version
  of the calls. Now supports up to 16 threads, comments added in .h and .c

Result is stable animation render with AO and soft shadow. But, please
test and feedback!
This commit is contained in:
2005-08-25 13:11:04 +00:00
parent c9f01eefcd
commit 8d940dfafe
9 changed files with 158 additions and 105 deletions

View File

@@ -187,6 +187,13 @@ void do_specular_ramp(ShadeInput *shi, float is, float t, float *spec);
void ramp_spec_result(float *specr, float *specg, float *specb, ShadeInput *shi);
/* --------------------------------------------------------------------- */
/* ray.c (2) */
/* --------------------------------------------------------------------- */
void init_jitter_plane(LampRen *lar);
void init_ao_sphere(float *sphere, int tot, int iter);
/* --------------------------------------------------------------------- */
/* renderdatabase (3) */
/* --------------------------------------------------------------------- */