Related to bug #27004: there is now an option to disable color management for
[blender.git] / source / blender / gpu / intern / gpu_material.c
index 4155b7a8ac0cabeabfbc9701668da811631e7368..134bffc7b8cb5a0150f4d168d390237f03d3790b 100644 (file)
@@ -1011,7 +1011,8 @@ static void do_material_tex(GPUShadeInput *shi)
                                }
 
                                if(tex->type==TEX_IMAGE)
-                                       if(mat->scene->r.color_mgt_flag & R_COLOR_MANAGEMENT)
+                                       if((mat->scene->r.color_mgt_flag & R_COLOR_MANAGEMENT) &&
+                                          !((mat->scene->gm.flag & GAME_GLSL_NO_COLOR_MANAGEMENT)))
                                                GPU_link(mat, "srgb_to_linearrgb", tcol, &tcol);
                                
                                if(mtex->mapto & MAP_COL) {
@@ -1363,7 +1364,8 @@ void GPU_shaderesult_set(GPUShadeInput *shi, GPUShadeResult *shr)
                GPU_link(mat, "shade_alpha_obcolor", shr->combined, GPU_builtin(GPU_OBCOLOR), &shr->combined);
        }
 
-       if(mat->scene->r.color_mgt_flag & R_COLOR_MANAGEMENT)
+       if((mat->scene->r.color_mgt_flag & R_COLOR_MANAGEMENT) &&
+          !((mat->scene->gm.flag & GAME_GLSL_NO_COLOR_MANAGEMENT)))
                GPU_link(mat, "linearrgb_to_srgb", shr->combined, &shr->combined);
 }