Blender V5.3
gpu_shader_material_clamp.bsl.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2019-2020 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
8
9[[node]]
10void clamp_value(float value, float min, float max, float &result)
11{
12 result = clamp(value, min, max);
13}
14
15[[node]]
16void clamp_minmax(float value, float min_allowed, float max_allowed, float &result)
17{
18 result = min(max(value, min_allowed), max_allowed);
19}
20
21[[node]]
22void clamp_range(float value, float min, float max, float &result)
23{
24 result = (max > min) ? clamp(value, min, max) : clamp(value, max, min);
25}
btScalar max
constexpr T clamp(T, U, U) RET
void clamp_range(float value, float min, float max, float &result)
void clamp_minmax(float value, float min_allowed, float max_allowed, float &result)
void clamp_value(float value, float min, float max, float &result)
#define min(a, b)
Definition sort.cc:38