Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2012-05-29 14:34:16 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2012-05-29 14:34:16 +0400
commit9e2f377273d60ec8de09f2c5c6f140908bc5f9a6 (patch)
treec329b92cd6b49b93bce0ff298c7965b3d7ec68b8 /intern/cycles/render/object.cpp
parente530b50d172f1ad78b303059de483d1e31952578 (diff)
Fix #31556: cycles object info random value was not properly randomized for
dupligroups.
Diffstat (limited to 'intern/cycles/render/object.cpp')
-rw-r--r--intern/cycles/render/object.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/intern/cycles/render/object.cpp b/intern/cycles/render/object.cpp
index e38b2635f90..5c7e48a38eb 100644
--- a/intern/cycles/render/object.cpp
+++ b/intern/cycles/render/object.cpp
@@ -23,7 +23,6 @@
#include "scene.h"
#include "util_foreach.h"
-#include "util_hash.h"
#include "util_map.h"
#include "util_progress.h"
@@ -37,7 +36,7 @@ Object::Object()
mesh = NULL;
tfm = transform_identity();
visibility = ~0;
- instance_id = 0;
+ random_id = 0;
pass_id = 0;
bounds = BoundBox::empty;
motion.pre = transform_identity();
@@ -165,9 +164,7 @@ void ObjectManager::device_update_transforms(Device *device, DeviceScene *dscene
float uniform_scale;
float surface_area = 0.0f;
float pass_id = ob->pass_id;
-
- uint ob_hash = hash_int_2d(hash_string(ob->name.c_str()), ob->instance_id);
- float random_number = (float)ob_hash * (1.0f/(float)0xFFFFFFFF);
+ float random_number = (float)ob->random_id * (1.0f/(float)0xFFFFFFFF);
if(transform_uniform_scale(tfm, uniform_scale)) {
map<Mesh*, float>::iterator it = surface_area_map.find(mesh);