Blender
V5.3
source
blender
gpu
shaders
material
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
7
#include "
gpu_shader_math_safe.bsl.hh
"
8
9
[[
node
]]
10
void
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
}
node
#define node
Definition
gpu_shader_cxx_attribute.hh:142
node_gamma
void node_gamma(float4 col, float gamma, float4 &outcol)
Definition
gpu_shader_material_gamma.bsl.hh:10
gpu_shader_math_safe.bsl.hh
compatible_pow
float compatible_pow(float x, float y)
Definition
gpu_shader_math_safe.bsl.hh:83
float4
Definition
sky_math.h:224
Generated on
for Blender by
doxygen
1.18.0