From 1dd7156c4c1d6a62f17fb6621ec3dc31297ba54a Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 15 Jul 2013 14:47:58 +0000 Subject: 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! --- source/blender/blenkernel/intern/smoke.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source/blender/blenkernel/intern/smoke.c') diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c index 05c3550d810..9fa4cc2ae40 100644 --- a/source/blender/blenkernel/intern/smoke.c +++ b/source/blender/blenkernel/intern/smoke.c @@ -1413,12 +1413,14 @@ static void emit_from_particles(Object *flow_ob, SmokeDomainSettings *sds, Smoke } } +/* TODO(sergey): de-duplicate with get_texture_value from modifier utils */ +/* NOTE: Skips color management, because result is only used for value now, not for color. */ static void get_texture_value(Tex *texture, float tex_co[3], TexResult *texres) { int result_type; /* no node textures for now */ - result_type = multitex_ext_safe(texture, tex_co, texres, NULL); + result_type = multitex_ext_safe(texture, tex_co, texres, NULL, false); /* if the texture gave an RGB value, we assume it didn't give a valid * intensity, since this is in the context of modifiers don't use perceptual color conversion. -- cgit v1.2.3