This repository has been archived on 2023-10-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
blender-archive/source/blender/gpu/shaders/material/gpu_shader_material_gamma.glsl

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
347 B
GLSL
Raw Normal View History

#pragma BLENDER_REQUIRE(gpu_shader_common_math_utils.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);
}
}