They are actually already some literals with the `f` suffix that are in our shader codebase and we never had problem in the past 5 years (or even 8 years). So I think it is safe to do and improves convergence of codestyles. Pull Request: https://projects.blender.org/blender/blender/pulls/137352
21 lines
437 B
GLSL
21 lines
437 B
GLSL
/* SPDX-FileCopyrightText: 2019-2022 Blender Authors
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
#include "gpu_shader_math_base_lib.glsl"
|
|
|
|
void node_gamma(vec4 col, float gamma, out vec4 outcol)
|
|
{
|
|
outcol = col;
|
|
|
|
if (col.r > 0.0f) {
|
|
outcol.r = compatible_pow(col.r, gamma);
|
|
}
|
|
if (col.g > 0.0f) {
|
|
outcol.g = compatible_pow(col.g, gamma);
|
|
}
|
|
if (col.b > 0.0f) {
|
|
outcol.b = compatible_pow(col.b, gamma);
|
|
}
|
|
}
|