diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2017-11-15 12:11:01 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2017-11-15 12:40:27 +0300 |
commit | 44517c5f2177d1f260ba691fb59fbacfef576915 (patch) | |
tree | 94d8cefa0a86c2a3de8eae236979d292ddb9d175 /intern/cycles/render | |
parent | 258292abc0252360e19654db454c7ef8bd2b63fe (diff) | |
parent | 212a8d9e5ae78a30ed4c35161d91eeca35eaa41f (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.cpp | 4 | ||||
-rw-r--r-- | intern/cycles/render/light.h | 1 |
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); |