diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-04-04 12:28:14 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-04-04 12:30:35 +0300 |
commit | 2f08d5f761e6941e11a712d0cbee2f7bd65e4c91 (patch) | |
tree | a8004fb8c75e2b2a6c2cc0302190025b2291ebcc /source | |
parent | f4875bed89de6500f333df3a87001919e95ec346 (diff) |
Fix T48002: Wrong behavior with "RGB to Intensity" in Image textures
There was some extra linearization happening in such cases.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/render/intern/source/render_texture.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/source/blender/render/intern/source/render_texture.c b/source/blender/render/intern/source/render_texture.c index 3399f8a21b1..8f61f4159e6 100644 --- a/source/blender/render/intern/source/render_texture.c +++ b/source/blender/render/intern/source/render_texture.c @@ -1270,8 +1270,13 @@ static int multitex_nodes_intern(Tex *tex, ImBuf *ibuf = BKE_image_pool_acquire_ibuf(tex->ima, &tex->iuser, pool); /* don't linearize float buffers, assumed to be linear */ - if (ibuf && !(ibuf->rect_float) && scene_color_manage) + if (ibuf != NULL && + ibuf->rect_float == NULL && + (rgbnor & TEX_RGB) && + scene_color_manage) + { IMB_colormanagement_colorspace_to_scene_linear_v3(&texres->tr, ibuf->rect_colorspace); + } BKE_image_pool_release_ibuf(tex->ima, ibuf, pool); } @@ -1312,8 +1317,13 @@ static int multitex_nodes_intern(Tex *tex, ImBuf *ibuf = BKE_image_pool_acquire_ibuf(tex->ima, &tex->iuser, pool); /* don't linearize float buffers, assumed to be linear */ - if (ibuf && !(ibuf->rect_float) && scene_color_manage) + if (ibuf != NULL && + ibuf->rect_float == NULL && + (rgbnor & TEX_RGB) && + scene_color_manage) + { IMB_colormanagement_colorspace_to_scene_linear_v3(&texres->tr, ibuf->rect_colorspace); + } BKE_image_pool_release_ibuf(tex->ima, ibuf, pool); } @@ -2501,8 +2511,13 @@ void do_material_tex(ShadeInput *shi, Render *re) ImBuf *ibuf = BKE_image_pool_acquire_ibuf(ima, &tex->iuser, re->pool); /* don't linearize float buffers, assumed to be linear */ - if (ibuf && !(ibuf->rect_float) && R.scene_color_manage) + if (ibuf != NULL && + ibuf->rect_float == NULL && + (rgbnor & TEX_RGB) && + R.scene_color_manage) + { IMB_colormanagement_colorspace_to_scene_linear_v3(tcol, ibuf->rect_colorspace); + } BKE_image_pool_release_ibuf(ima, ibuf, re->pool); } |