diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-09-09 15:04:49 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-09-09 15:04:49 +0400 |
commit | c810e417bde1dd81c8218915748b5bc55f926c6e (patch) | |
tree | fd77bae179bcde7a425b9a86f589c687af94406a /source/blender/gpu/intern | |
parent | 521c085af80669a021020d3cdd38dfde38018925 (diff) |
Fix #32513: incorrect color management in Material draw mode for Cycles.
Diffstat (limited to 'source/blender/gpu/intern')
-rw-r--r-- | source/blender/gpu/intern/gpu_material.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c index c831b92936f..61be4057843 100644 --- a/source/blender/gpu/intern/gpu_material.c +++ b/source/blender/gpu/intern/gpu_material.c @@ -387,7 +387,7 @@ void gpu_material_add_node(GPUMaterial *material, GPUNode *node) /* Code generation */ -static int gpu_do_color_management(GPUMaterial *mat) +int GPU_material_do_color_management(GPUMaterial *mat) { return ((mat->scene->r.color_mgt_flag & R_COLOR_MANAGEMENT) && !((mat->scene->gm.flag & GAME_GLSL_NO_COLOR_MANAGEMENT))); @@ -1076,7 +1076,7 @@ static void do_material_tex(GPUShadeInput *shi) } if (tex->type==TEX_IMAGE) - if (gpu_do_color_management(mat)) + if (GPU_material_do_color_management(mat)) GPU_link(mat, "srgb_to_linearrgb", tcol, &tcol); if (mtex->mapto & MAP_COL) { @@ -1372,7 +1372,7 @@ void GPU_shadeinput_set(GPUMaterial *mat, Material *ma, GPUShadeInput *shi) GPU_link(mat, "set_value", GPU_uniform(&ma->amb), &shi->amb); GPU_link(mat, "shade_view", GPU_builtin(GPU_VIEW_POSITION), &shi->view); GPU_link(mat, "vcol_attribute", GPU_attribute(CD_MCOL, ""), &shi->vcol); - if (gpu_do_color_management(mat)) + if (GPU_material_do_color_management(mat)) GPU_link(mat, "srgb_to_linearrgb", shi->vcol, &shi->vcol); GPU_link(mat, "texco_refl", shi->vn, shi->view, &shi->ref); } @@ -1516,12 +1516,9 @@ GPUMaterial *GPU_material_from_blender(Scene *scene, Material *ma) GPU_material_output_link(mat, outlink); } - if (!BKE_scene_use_new_shading_nodes(scene)) { - if (gpu_do_color_management(mat)) - if (mat->outlink) - GPU_link(mat, "linearrgb_to_srgb", mat->outlink, &mat->outlink); - } - + if (GPU_material_do_color_management(mat)) + if (mat->outlink) + GPU_link(mat, "linearrgb_to_srgb", mat->outlink, &mat->outlink); GPU_material_construct_end(mat); |