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

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

void node_gamma(vec4 col, float gamma, out vec4 outcol)
{
  outcol = col;

  if (col.r > 0.0) {
    outcol.r = compatible_pow(col.r, gamma);
  }
  if (col.g > 0.0) {
    outcol.g = compatible_pow(col.g, gamma);
  }
  if (col.b > 0.0) {
    outcol.b = compatible_pow(col.b, gamma);
  }
}