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@gmail.com>2016-02-06 22:35:36 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2016-02-06 23:02:02 +0300
commit7faa9d1304bc500185684a41f8bd65fb4893b8bb (patch)
tree02e6351c2be5955373bb9797a1b87f8d661e9599 /intern/cycles/blender
parentc502114ee11dcd2e737452944b652205517b5682 (diff)
Fix T46550: Cycles combined baking black in some cases.
Now pass_filter is modified to have exactly the flags for the light components that need to be baked, based on the shader type. This simplifies the logic.
Diffstat (limited to 'intern/cycles/blender')
-rw-r--r--intern/cycles/blender/blender_session.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/intern/cycles/blender/blender_session.cpp b/intern/cycles/blender/blender_session.cpp
index 544ae97d93f..f1b524f7b44 100644
--- a/intern/cycles/blender/blender_session.cpp
+++ b/intern/cycles/blender/blender_session.cpp
@@ -611,7 +611,6 @@ void BlenderSession::bake(BL::Object& b_object,
ShaderEvalType shader_type = get_shader_type(pass_type);
size_t object_index = OBJECT_NONE;
int tri_offset = 0;
- int bake_pass_filter = bake_pass_filter_get(pass_filter);
/* Set baking flag in advance, so kernel loading can check if we need
* any baking capabilities.
@@ -629,8 +628,11 @@ void BlenderSession::bake(BL::Object& b_object,
Pass::add(PASS_UV, scene->film->passes);
}
- if(BakeManager::is_light_pass(shader_type, bake_pass_filter)) {
- /* force use_light_pass to be true */
+ int bake_pass_filter = bake_pass_filter_get(pass_filter);
+ bake_pass_filter = BakeManager::shader_type_to_pass_filter(shader_type, bake_pass_filter);
+
+ /* force use_light_pass to be true if we bake more than just colors */
+ if (bake_pass_filter & ~BAKE_FILTER_COLOR) {
Pass::add(PASS_LIGHT, scene->film->passes);
}