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>2013-07-15 18:47:58 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2013-07-15 18:47:58 +0400
commit1dd7156c4c1d6a62f17fb6621ec3dc31297ba54a (patch)
treef135c227e6ebecee7c44b80aeb55ec0799441f01 /source/blender/blenkernel/intern/effect.c
parent86ba5c4fc5fd0ae1f1c8610a81026d939fb68404 (diff)
Fix #36058: Displace Modifier errors using a baked Image and displace baking inconsistency between 2.67/2.68RC and previous versions
This was in fact really nasty bug, caused by multitex_nodes function using global variable R (which is a copy of current renderer). this variable is not initialized to anything meaningful for until first rendering (preview or final) happened. Since multitex_nodes might be used outside of render pipeline, made it so whether CM is on or off as an argument to functions multitex_ext_safe and multitex_ext. Now multitex_nodes() is only shall be used for stuff happening from render pipeline! Also needed to make some changes to other places, so all the usages of texture sampling knows for the fact whether CM is on or off. And one more change is related on behavior of dispalcement, wave, warp, weightvg modifiers and smoke. They'll be always using CM off since texture is used for influence, not for color. It's rather bigger patch, but it's mostly straightforward changes, which we really need to be done. Reviewed by Brecht, thanks!
Diffstat (limited to 'source/blender/blenkernel/intern/effect.c')
-rw-r--r--source/blender/blenkernel/intern/effect.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c
index 02d1621e408..0df8684044a 100644
--- a/source/blender/blenkernel/intern/effect.c
+++ b/source/blender/blenkernel/intern/effect.c
@@ -744,6 +744,7 @@ static void do_texture_effector(EffectorCache *eff, EffectorData *efd, EffectedP
float nabla = eff->pd->tex_nabla;
int hasrgb;
short mode = eff->pd->tex_mode;
+ bool scene_color_manage;
if (!eff->pd->tex)
return;
@@ -763,7 +764,9 @@ static void do_texture_effector(EffectorCache *eff, EffectorData *efd, EffectedP
mul_m4_v3(eff->ob->imat, tex_co);
}
- hasrgb = multitex_ext(eff->pd->tex, tex_co, NULL, NULL, 0, result, NULL);
+ scene_color_manage = BKE_scene_check_color_management_enabled(eff->scene);
+
+ hasrgb = multitex_ext(eff->pd->tex, tex_co, NULL, NULL, 0, result, NULL, scene_color_manage);
if (hasrgb && mode==PFIELD_TEX_RGB) {
force[0] = (0.5f - result->tr) * strength;
@@ -774,15 +777,15 @@ static void do_texture_effector(EffectorCache *eff, EffectorData *efd, EffectedP
strength/=nabla;
tex_co[0] += nabla;
- multitex_ext(eff->pd->tex, tex_co, NULL, NULL, 0, result+1, NULL);
+ multitex_ext(eff->pd->tex, tex_co, NULL, NULL, 0, result+1, NULL, scene_color_manage);
tex_co[0] -= nabla;
tex_co[1] += nabla;
- multitex_ext(eff->pd->tex, tex_co, NULL, NULL, 0, result+2, NULL);
+ multitex_ext(eff->pd->tex, tex_co, NULL, NULL, 0, result+2, NULL, scene_color_manage);
tex_co[1] -= nabla;
tex_co[2] += nabla;
- multitex_ext(eff->pd->tex, tex_co, NULL, NULL, 0, result+3, NULL);
+ multitex_ext(eff->pd->tex, tex_co, NULL, NULL, 0, result+3, NULL, scene_color_manage);
if (mode == PFIELD_TEX_GRAD || !hasrgb) { /* if we don't have rgb fall back to grad */
/* generate intensity if texture only has rgb value */