diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-08-30 21:42:04 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-08-30 21:42:04 +0400 |
commit | b25ca62f20d03b400454156e5b26b26e469844dc (patch) | |
tree | 479445ea33c3e35ccbf028de24c30b0ace5d79a0 /source/blender/nodes | |
parent | f9bccc069c3ec2d6dc049f615b1f3ce8769a5b0b (diff) |
Fix #32404: GLSL normal maps using float images were incorrectly getting
color managed.
Diffstat (limited to 'source/blender/nodes')
3 files changed, 7 insertions, 3 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 572f06e007b..e857d0571cd 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_environment.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_environment.c @@ -58,6 +58,8 @@ static int node_shader_gpu_tex_environment(GPUMaterial *mat, bNode *node, GPUNod { Image *ima= (Image*)node->id; ImageUser *iuser= NULL; + NodeTexImage *tex = node->storage; + int ncd = tex->color_space == SHD_COLORSPACE_NONE; if (!ima) return GPU_stack_link(mat, "node_tex_environment_empty", in, out); @@ -67,7 +69,7 @@ static int node_shader_gpu_tex_environment(GPUMaterial *mat, bNode *node, GPUNod node_shader_gpu_tex_mapping(mat, node, in, out); - return GPU_stack_link(mat, "node_tex_environment", in, out, GPU_image(ima, iuser)); + return GPU_stack_link(mat, "node_tex_environment", in, out, GPU_image(ima, iuser, ncd)); } /* node type definition */ 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 176c50bcabb..c492fe9efc7 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_image.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_image.c @@ -58,6 +58,8 @@ static int node_shader_gpu_tex_image(GPUMaterial *mat, bNode *node, GPUNodeStack { Image *ima= (Image*)node->id; ImageUser *iuser= NULL; + NodeTexImage *tex = node->storage; + int ncd = tex->color_space == SHD_COLORSPACE_NONE; if (!ima) return GPU_stack_link(mat, "node_tex_image_empty", in, out); @@ -67,7 +69,7 @@ static int node_shader_gpu_tex_image(GPUMaterial *mat, bNode *node, GPUNodeStack node_shader_gpu_tex_mapping(mat, node, in, out); - return GPU_stack_link(mat, "node_tex_image", in, out, GPU_image(ima, iuser)); + return GPU_stack_link(mat, "node_tex_image", in, out, GPU_image(ima, iuser, ncd)); } /* node type definition */ diff --git a/source/blender/nodes/shader/nodes/node_shader_texture.c b/source/blender/nodes/shader/nodes/node_shader_texture.c index 3f90d4fbcd5..73c3b846fe3 100644 --- a/source/blender/nodes/shader/nodes/node_shader_texture.c +++ b/source/blender/nodes/shader/nodes/node_shader_texture.c @@ -122,7 +122,7 @@ static int gpu_shader_texture(GPUMaterial *mat, bNode *node, GPUNodeStack *in, G Tex *tex = (Tex*)node->id; if (tex && tex->type == TEX_IMAGE && tex->ima) { - GPUNodeLink *texlink = GPU_image(tex->ima, NULL); + GPUNodeLink *texlink = GPU_image(tex->ima, NULL, FALSE); return GPU_stack_link(mat, "texture_image", in, out, texlink); } else |