diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-10-29 18:27:24 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-10-29 18:27:24 +0400 |
commit | 238f3a7d343875992f5b9c2ad657f2bc6f148938 (patch) | |
tree | ddc809124879b7eef15a708470f9de6bce43118a /intern/cycles/render | |
parent | 996f2cd8b2362779e16fdfbd3913231c38e4a623 (diff) |
Cycles: seed value to get different noise values from renders, there was a patch
for this but I've implemented it differently.
Diffstat (limited to 'intern/cycles/render')
-rw-r--r-- | intern/cycles/render/integrator.cpp | 9 | ||||
-rw-r--r-- | intern/cycles/render/integrator.h | 3 |
2 files changed, 11 insertions, 1 deletions
diff --git a/intern/cycles/render/integrator.cpp b/intern/cycles/render/integrator.cpp index 78ea464d836..9d129d8e8db 100644 --- a/intern/cycles/render/integrator.cpp +++ b/intern/cycles/render/integrator.cpp @@ -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) diff --git a/intern/cycles/render/integrator.h b/intern/cycles/render/integrator.h index 5bab4470089..52032fa1a26 100644 --- a/intern/cycles/render/integrator.h +++ b/intern/cycles/render/integrator.h @@ -42,6 +42,9 @@ public: bool no_caustics; float blur_caustics; + + int seed; + bool need_update; Integrator(); |