diff options
Diffstat (limited to 'intern/cycles/render')
-rw-r--r-- | intern/cycles/render/light.cpp | 7 | ||||
-rw-r--r-- | intern/cycles/render/shader.cpp | 10 |
2 files changed, 10 insertions, 7 deletions
diff --git a/intern/cycles/render/light.cpp b/intern/cycles/render/light.cpp index 3b7935803f4..93f6d7902f0 100644 --- a/intern/cycles/render/light.cpp +++ b/intern/cycles/render/light.cpp @@ -661,11 +661,6 @@ void LightManager::device_update_points(Device *device, use_light_visibility = true; } - float3 fixed_emission = make_float3(0.0f, 0.0f, 0.0f); - if(shader->is_constant_emission(&fixed_emission)) { - shader_id |= SHADER_FIXED_EMISSION; - } - if(light->type == LIGHT_POINT) { shader_id &= ~SHADER_AREA_LIGHT; @@ -765,7 +760,7 @@ void LightManager::device_update_points(Device *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, fixed_emission.x, fixed_emission.y, fixed_emission.z); + light_data[light_index*LIGHT_SIZE + 4] = make_float4(max_bounces, 0.0f, 0.0f, 0.0f); light_index++; } diff --git a/intern/cycles/render/shader.cpp b/intern/cycles/render/shader.cpp index 1849161ead9..06b6dd969d8 100644 --- a/intern/cycles/render/shader.cpp +++ b/intern/cycles/render/shader.cpp @@ -401,7 +401,7 @@ void ShaderManager::device_update_common(Device *device, if(scene->shaders.size() == 0) return; - uint shader_flag_size = scene->shaders.size()*2; + uint shader_flag_size = scene->shaders.size()*SHADER_SIZE; uint *shader_flag = dscene->shader_flag.resize(shader_flag_size); uint i = 0; bool has_volumes = false; @@ -446,9 +446,17 @@ void ShaderManager::device_update_common(Device *device, if(shader->displacement_method != DISPLACE_TRUE && shader->graph_bump) flag |= SD_HAS_BSSRDF_BUMP; + /* constant emission check */ + float3 constant_emission = make_float3(0.0f, 0.0f, 0.0f); + if(shader->is_constant_emission(&constant_emission)) + flag |= SD_HAS_CONSTANT_EMISSION; + /* regular shader */ shader_flag[i++] = flag; shader_flag[i++] = shader->pass_id; + shader_flag[i++] = __float_as_int(constant_emission.x); + shader_flag[i++] = __float_as_int(constant_emission.y); + shader_flag[i++] = __float_as_int(constant_emission.z); has_transparent_shadow |= (flag & SD_HAS_TRANSPARENT_SHADOW) != 0; } |