This repository has been archived on 2023-10-09. You can view files and clone it, but cannot push or open issues or pull requests.
Files
blender-archive/source/blender/gpu/shaders/material/gpu_shader_material_gamma.glsl
Omar Emara 8f6f28a0dc GPU: Move common shaders into a common directory
This patch moves some of the utility library shaders into a common
directory and makes the necessary renames across shaders. Additionally,
material-specific transform functions were moved outside of math utils
into a separate transform_utils.glsl file.

This is needed in preparation for the viewport compositor, which will
make use of some of those utilities and will require all material
specific bit to be removed out of those files.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D14688
2022-05-06 12:58:14 +02:00

17 lines
347 B
GLSL

#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);
}
}