Blender V5.3
gpu_shader_material_bright_contrast.bsl.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2019 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
8
9[[node]]
10void brightness_contrast(float4 col, float brightness, float contrast, float4 &outcol)
11{
12 float a = 1.0f + contrast;
13 float b = brightness - contrast * 0.5f;
14
15 outcol.r = max(a * col.r + b, 0.0f);
16 outcol.g = max(a * col.g + b, 0.0f);
17 outcol.b = max(a * col.b + b, 0.0f);
18 outcol.a = col.a;
19}
btScalar max
void brightness_contrast(float4 col, float brightness, float contrast, float4 &outcol)