[Bf-blender-cvs] [2f08d5f] master: Fix T48002: Wrong behavior with "RGB to Intensity" in Image textures
Sergey Sharybin
noreply at git.blender.org
Mon Apr 4 11:30:40 CEST 2016
Commit: 2f08d5f761e6941e11a712d0cbee2f7bd65e4c91
Author: Sergey Sharybin
Date: Mon Apr 4 11:28:14 2016 +0200
Branches: master
https://developer.blender.org/rB2f08d5f761e6941e11a712d0cbee2f7bd65e4c91
Fix T48002: Wrong behavior with "RGB to Intensity" in Image textures
There was some extra linearization happening in such cases.
===================================================================
M source/blender/render/intern/source/render_texture.c
===================================================================
diff --git a/source/blender/render/intern/source/render_texture.c b/source/blender/render/intern/source/render_texture.c
index 3399f8a..8f61f41 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);
}
More information about the Bf-blender-cvs
mailing list