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:
Diffstat (limited to 'source/blender/gpu/intern/gpu_material.c')
-rw-r--r--source/blender/gpu/intern/gpu_material.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c
index 9ed7729fea3..429eaea9b43 100644
--- a/source/blender/gpu/intern/gpu_material.c
+++ b/source/blender/gpu/intern/gpu_material.c
@@ -1004,6 +1004,10 @@ static void do_material_tex(GPUShadeInput *shi)
else
GPU_link(mat, "set_value_one", &tin);
}
+
+ if(tex->type==TEX_IMAGE)
+ if(mat->scene->r.color_mgt_flag & R_COLOR_MANAGEMENT)
+ GPU_link(mat, "srgb_to_linearrgb", tcol, tcol);
if(mtex->mapto & MAP_COL) {
GPUNodeLink *colfac;
@@ -1244,6 +1248,9 @@ void GPU_shaderesult_set(GPUShadeInput *shi, GPUShadeResult *shr)
mat->obcolalpha = 1;
GPU_link(mat, "shade_alpha_obcolor", shr->combined, GPU_builtin(GPU_OBCOLOR), &shr->combined);
}
+
+ if(mat->scene->r.color_mgt_flag & R_COLOR_MANAGEMENT)
+ GPU_link(mat, "linearrgb_to_srgb", shr->combined, &shr->combined);
}
GPUNodeLink *GPU_blender_material(GPUMaterial *mat, Material *ma)