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>2012-10-23 15:44:47 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2012-10-23 15:44:47 +0400
commitb518197db7fd63f878c4360312c47f15b61f780a (patch)
tree549cce367abb6a3e8b1949b897dc82f8024501d6 /source/blender/nodes
parent38a76aff8b166e8bfedbea532e909fa881d7da10 (diff)
Correction to recent fix for shader nodes -- image could be not loaded yet
when tree is being executed. This could lead to nor initialized color space for the image. Solved by insuring image buffer is loaded before checking for whether color conversion is needed.
Diffstat (limited to 'source/blender/nodes')
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_tex_environment.c5
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_tex_image.c5
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_texture.c5
3 files changed, 9 insertions, 6 deletions
diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_environment.c b/source/blender/nodes/shader/nodes/node_shader_tex_environment.c
index 8c3f243169f..08a3b47af91 100644
--- a/source/blender/nodes/shader/nodes/node_shader_tex_environment.c
+++ b/source/blender/nodes/shader/nodes/node_shader_tex_environment.c
@@ -75,8 +75,9 @@ static int node_shader_gpu_tex_environment(GPUMaterial *mat, bNode *node, GPUNod
ret = GPU_stack_link(mat, "node_tex_environment", in, out, GPU_image(ima, iuser, ncd));
if (ret) {
- if (GPU_material_do_color_management(mat) &&
- IMB_colormanagement_colorspace_is_data(ima->colorspace_settings.name) == FALSE)
+ ImBuf *ibuf = BKE_image_get_ibuf(ima, iuser);
+ if (ibuf && (ibuf->colormanage_flag & IMB_COLORMANAGE_IS_DATA) == 0 &&
+ GPU_material_do_color_management(mat))
{
GPU_link(mat, "srgb_to_linearrgb", out[0].link, &out[0].link);
}
diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_image.c b/source/blender/nodes/shader/nodes/node_shader_tex_image.c
index 342e06ff050..82d4e501cb8 100644
--- a/source/blender/nodes/shader/nodes/node_shader_tex_image.c
+++ b/source/blender/nodes/shader/nodes/node_shader_tex_image.c
@@ -75,8 +75,9 @@ static int node_shader_gpu_tex_image(GPUMaterial *mat, bNode *node, GPUNodeStack
ret = GPU_stack_link(mat, "node_tex_image", in, out, GPU_image(ima, iuser, ncd));
if (ret) {
- if (GPU_material_do_color_management(mat) &&
- IMB_colormanagement_colorspace_is_data(ima->colorspace_settings.name) == FALSE)
+ ImBuf *ibuf = BKE_image_get_ibuf(ima, iuser);
+ if (ibuf && (ibuf->colormanage_flag & IMB_COLORMANAGE_IS_DATA) == 0 &&
+ GPU_material_do_color_management(mat))
{
GPU_link(mat, "srgb_to_linearrgb", out[0].link, &out[0].link);
}
diff --git a/source/blender/nodes/shader/nodes/node_shader_texture.c b/source/blender/nodes/shader/nodes/node_shader_texture.c
index b39f0e62fa9..6d1b3ff6dba 100644
--- a/source/blender/nodes/shader/nodes/node_shader_texture.c
+++ b/source/blender/nodes/shader/nodes/node_shader_texture.c
@@ -128,8 +128,9 @@ static int gpu_shader_texture(GPUMaterial *mat, bNode *node, GPUNodeStack *in, G
int ret = GPU_stack_link(mat, "texture_image", in, out, texlink);
if (ret) {
- if (GPU_material_do_color_management(mat) &&
- IMB_colormanagement_colorspace_is_data(tex->ima->colorspace_settings.name) == FALSE)
+ ImBuf *ibuf = BKE_image_get_ibuf(tex->ima, &tex->iuser);
+ if (ibuf && (ibuf->colormanage_flag & IMB_COLORMANAGE_IS_DATA) ==0 &&
+ GPU_material_do_color_management(mat))
{
GPU_link(mat, "srgb_to_linearrgb", out[1].link, &out[1].link);
}