Blender V5.3
gpu_shader_material_gamma.bsl.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2019-2022 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
8
9[[node]]
10void node_gamma(float4 col, float gamma, float4 &outcol)
11{
12 outcol = col;
13
14 if (col.r > 0.0f) {
15 outcol.r = compatible_pow(col.r, gamma);
16 }
17 if (col.g > 0.0f) {
18 outcol.g = compatible_pow(col.g, gamma);
19 }
20 if (col.b > 0.0f) {
21 outcol.b = compatible_pow(col.b, gamma);
22 }
23}
void node_gamma(float4 col, float gamma, float4 &outcol)
float compatible_pow(float x, float y)