Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gpu_shader_material_hue_sat_val.glsl « material « shaders « gpu « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 30b808508e9238b35f75baa7fcee9be10901e415 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#pragma BLENDER_REQUIRE(gpu_shader_material_color_util.glsl)

void hue_sat(float hue, float sat, float value, float fac, vec4 col, out vec4 outcol)
{
  vec4 hsv;

  rgb_to_hsv(col, hsv);

  hsv[0] = fract(hsv[0] + hue + 0.5);
  hsv[1] = clamp(hsv[1] * sat, 0.0, 1.0);
  hsv[2] = hsv[2] * value;

  hsv_to_rgb(hsv, outcol);

  outcol = mix(col, outcol, fac);
}