diff --git a/source/blender/gpu/shaders/gpu_shader_image_color_frag.glsl b/source/blender/gpu/shaders/gpu_shader_image_color_frag.glsl index 6c93dd81069..69c946eb121 100644 --- a/source/blender/gpu/shaders/gpu_shader_image_color_frag.glsl +++ b/source/blender/gpu/shaders/gpu_shader_image_color_frag.glsl @@ -6,7 +6,10 @@ FRAGMENT_SHADER_CREATE_INFO(gpu_shader_2D_image_rect_color) +#include "gpu_shader_colorspace_lib.glsl" + void main() { fragColor = texture(image, texCoord_interp) * color; + fragColor = blender_srgb_to_framebuffer_space(fragColor); } diff --git a/source/blender/gpu/shaders/gpu_shader_image_frag.glsl b/source/blender/gpu/shaders/gpu_shader_image_frag.glsl index 87a78d8c122..fdef13a437b 100644 --- a/source/blender/gpu/shaders/gpu_shader_image_frag.glsl +++ b/source/blender/gpu/shaders/gpu_shader_image_frag.glsl @@ -6,7 +6,10 @@ FRAGMENT_SHADER_CREATE_INFO(gpu_shader_2D_image_common) +#include "gpu_shader_colorspace_lib.glsl" + void main() { fragColor = texture(image, texCoord_interp); + fragColor = blender_srgb_to_framebuffer_space(fragColor); } diff --git a/source/blender/gpu/shaders/infos/gpu_shader_2D_image_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_2D_image_info.hh index c5bb852cc9a..75bb6b65461 100644 --- a/source/blender/gpu/shaders/infos/gpu_shader_2D_image_info.hh +++ b/source/blender/gpu/shaders/infos/gpu_shader_2D_image_info.hh @@ -11,6 +11,8 @@ # include "gpu_glsl_cpp_stubs.hh" # include "GPU_shader_shared.hh" + +# include "gpu_srgb_to_framebuffer_space_info.hh" #endif #include "gpu_interface_info.hh" @@ -24,4 +26,5 @@ FRAGMENT_OUT(0, float4, fragColor) PUSH_CONSTANT(float4x4, ModelViewProjectionMatrix) SAMPLER(0, sampler2D, image) VERTEX_SOURCE("gpu_shader_2D_image_vert.glsl") +ADDITIONAL_INFO(gpu_srgb_to_framebuffer_space) GPU_SHADER_CREATE_END() diff --git a/source/blender/gpu/shaders/infos/gpu_shader_2D_image_rect_color_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_2D_image_rect_color_info.hh index c04706d8fef..5a41ab26cf8 100644 --- a/source/blender/gpu/shaders/infos/gpu_shader_2D_image_rect_color_info.hh +++ b/source/blender/gpu/shaders/infos/gpu_shader_2D_image_rect_color_info.hh @@ -11,6 +11,8 @@ # include "gpu_glsl_cpp_stubs.hh" # include "GPU_shader_shared.hh" + +# include "gpu_srgb_to_framebuffer_space_info.hh" #endif #include "gpu_interface_info.hh" @@ -26,5 +28,6 @@ PUSH_CONSTANT(float4, rect_geom) SAMPLER(0, sampler2D, image) VERTEX_SOURCE("gpu_shader_2D_image_rect_vert.glsl") FRAGMENT_SOURCE("gpu_shader_image_color_frag.glsl") +ADDITIONAL_INFO(gpu_srgb_to_framebuffer_space) DO_STATIC_COMPILATION() GPU_SHADER_CREATE_END() diff --git a/source/blender/gpu/shaders/infos/gpu_shader_3D_image_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_3D_image_info.hh index 26b3f816a78..61ca25d902f 100644 --- a/source/blender/gpu/shaders/infos/gpu_shader_3D_image_info.hh +++ b/source/blender/gpu/shaders/infos/gpu_shader_3D_image_info.hh @@ -11,6 +11,8 @@ # include "gpu_glsl_cpp_stubs.hh" # include "GPU_shader_shared.hh" + +# include "gpu_srgb_to_framebuffer_space_info.hh" #endif #include "gpu_interface_info.hh" @@ -24,6 +26,7 @@ FRAGMENT_OUT(0, float4, fragColor) PUSH_CONSTANT(float4x4, ModelViewProjectionMatrix) SAMPLER(0, sampler2D, image) VERTEX_SOURCE("gpu_shader_3D_image_vert.glsl") +ADDITIONAL_INFO(gpu_srgb_to_framebuffer_space) GPU_SHADER_CREATE_END() GPU_SHADER_CREATE_INFO(gpu_shader_3D_image)