Cycles: seed value to get different noise values from renders, there was a patch

for this but I've implemented it differently.
This commit is contained in:
Brecht Van Lommel
2011-10-29 14:27:24 +00:00
parent 996f2cd8b2
commit 238f3a7d34
8 changed files with 32 additions and 3 deletions

View File

@@ -21,6 +21,8 @@
#include "scene.h"
#include "sobol.h"
#include "util_hash.h"
CCL_NAMESPACE_BEGIN
Integrator::Integrator()
@@ -41,6 +43,8 @@ Integrator::Integrator()
no_caustics = false;
blur_caustics = 0.0f;
seed = 0;
need_update = true;
}
@@ -79,6 +83,8 @@ void Integrator::device_update(Device *device, DeviceScene *dscene)
kintegrator->no_caustics = no_caustics;
kintegrator->blur_caustics = blur_caustics;
kintegrator->seed = hash_int(seed);
/* sobol directions table */
int dimensions = PRNG_BASE_NUM + (max_bounce + transparent_max_bounce + 2)*PRNG_BOUNCE_NUM;
uint *directions = dscene->sobol_directions.resize(SOBOL_BITS*dimensions);
@@ -109,7 +115,8 @@ bool Integrator::modified(const Integrator& integrator)
transparent_probalistic == integrator.transparent_probalistic &&
transparent_shadows == integrator.transparent_shadows &&
no_caustics == integrator.no_caustics &&
blur_caustics == integrator.blur_caustics);
blur_caustics == integrator.blur_caustics &&
seed == integrator.seed);
}
void Integrator::tag_update(Scene *scene)

View File

@@ -42,6 +42,9 @@ public:
bool no_caustics;
float blur_caustics;
int seed;
bool need_update;
Integrator();