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:
authorDalai Felinto <dfelinto@gmail.com>2017-11-15 12:11:01 +0300
committerDalai Felinto <dfelinto@gmail.com>2017-11-15 12:40:27 +0300
commit44517c5f2177d1f260ba691fb59fbacfef576915 (patch)
tree94d8cefa0a86c2a3de8eae236979d292ddb9d175 /intern/cycles/render
parent258292abc0252360e19654db454c7ef8bd2b63fe (diff)
parent212a8d9e5ae78a30ed4c35161d91eeca35eaa41f (diff)
Merge commit '212a8d9e5ae7' into blender2.8
Considerable non-trivial merge conflict fixes.
Diffstat (limited to 'intern/cycles/render')
-rw-r--r--intern/cycles/render/light.cpp4
-rw-r--r--intern/cycles/render/light.h1
2 files changed, 4 insertions, 1 deletions
diff --git a/intern/cycles/render/light.cpp b/intern/cycles/render/light.cpp
index b37a0768b53..b62453cf5fc 100644
--- a/intern/cycles/render/light.cpp
+++ b/intern/cycles/render/light.cpp
@@ -134,6 +134,7 @@ NODE_DEFINE(Light)
SOCKET_INT(samples, "Samples", 1);
SOCKET_INT(max_bounces, "Max Bounces", 1024);
+ SOCKET_UINT(random_id, "Random ID", 0);
SOCKET_BOOLEAN(is_portal, "Is Portal", false);
SOCKET_BOOLEAN(is_enabled, "Is Enabled", true);
@@ -638,6 +639,7 @@ void LightManager::device_update_points(Device *,
int shader_id = scene->shader_manager->get_shader_id(shader);
float samples = __int_as_float(light->samples);
float max_bounces = __int_as_float(light->max_bounces);
+ float random = (float)light->random_id * (1.0f/(float)0xFFFFFFFF);
if(!light->cast_shadow)
shader_id &= ~SHADER_CAST_SHADOW;
@@ -758,7 +760,7 @@ void LightManager::device_update_points(Device *,
light_data[light_index*LIGHT_SIZE + 3] = make_float4(samples, 0.0f, 0.0f, 0.0f);
}
- light_data[light_index*LIGHT_SIZE + 4] = make_float4(max_bounces, 0.0f, 0.0f, 0.0f);
+ light_data[light_index*LIGHT_SIZE + 4] = make_float4(max_bounces, random, 0.0f, 0.0f);
Transform tfm = light->tfm;
Transform itfm = transform_inverse(tfm);
diff --git a/intern/cycles/render/light.h b/intern/cycles/render/light.h
index 7e9014eb823..97b7b971c73 100644
--- a/intern/cycles/render/light.h
+++ b/intern/cycles/render/light.h
@@ -70,6 +70,7 @@ public:
Shader *shader;
int samples;
int max_bounces;
+ uint random_id;
void tag_update(Scene *scene);