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
17 lines
347 B
GLSL
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);
|
|
}
|
|
}
|