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:
authorSergey Sharybin <sergey.vfx@gmail.com>2015-09-08 09:28:02 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2015-09-08 09:28:02 +0300
commit0e12228bd9976d58068879c80e7bb2bfde22b4f7 (patch)
tree23e772b8fda246c6c45e313c797f08543aa417ee
parent946b850b3eaba1e017755e9eee164c1883740d97 (diff)
Fix T46045: Missing viewport update when adding transparent shader to material
-rw-r--r--intern/cycles/render/shader.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/intern/cycles/render/shader.cpp b/intern/cycles/render/shader.cpp
index 31be2a3d3f4..d5f0da7673e 100644
--- a/intern/cycles/render/shader.cpp
+++ b/intern/cycles/render/shader.cpp
@@ -18,6 +18,7 @@
#include "camera.h"
#include "device.h"
#include "graph.h"
+#include "integrator.h"
#include "light.h"
#include "mesh.h"
#include "nodes.h"
@@ -338,6 +339,7 @@ void ShaderManager::device_update_common(Device *device,
uint *shader_flag = dscene->shader_flag.resize(shader_flag_size);
uint i = 0;
bool has_volumes = false;
+ bool has_transparent_shadow = false;
foreach(Shader *shader, scene->shaders) {
uint flag = 0;
@@ -382,6 +384,8 @@ void ShaderManager::device_update_common(Device *device,
shader_flag[i++] = flag;
shader_flag[i++] = shader->pass_id;
+
+ has_transparent_shadow |= (flag & SD_HAS_TRANSPARENT_SHADOW);
}
device->tex_alloc("__shader_flag", dscene->shader_flag);
@@ -404,6 +408,10 @@ void ShaderManager::device_update_common(Device *device,
/* integrator */
KernelIntegrator *kintegrator = &dscene->data.integrator;
kintegrator->use_volumes = has_volumes;
+ /* TODO(sergey): De-duplicate with flags set in integrator.cpp. */
+ if(scene->integrator->transparent_shadows) {
+ kintegrator->transparent_shadows = has_transparent_shadow;
+ }
}
void ShaderManager::device_free_common(Device *device, DeviceScene *dscene, Scene *scene)