2023-08-24 10:54:59 +10:00
|
|
|
/* SPDX-FileCopyrightText: 2018-2022 Blender Authors
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
2018-04-26 15:42:08 +02:00
|
|
|
|
2025-09-25 10:57:02 +02:00
|
|
|
#include "infos/gpu_shader_2D_image_desaturate_color_infos.hh"
|
2024-11-12 18:53:34 +01:00
|
|
|
|
|
|
|
|
FRAGMENT_SHADER_CREATE_INFO(gpu_shader_2D_image_desaturate_color)
|
|
|
|
|
|
2018-04-26 15:42:08 +02:00
|
|
|
void main()
|
|
|
|
|
{
|
2025-04-14 13:46:41 +02:00
|
|
|
float4 tex = texture(image, texCoord_interp);
|
|
|
|
|
tex.rgb = ((0.3333333f * factor) * float3(tex.r + tex.g + tex.b)) + (tex.rgb * (1.0f - factor));
|
2018-04-26 15:42:08 +02:00
|
|
|
fragColor = tex * color;
|
|
|
|
|
}
|