Welcome to mirror list, hosted at ThFree Co, Russian Federation.

node_clamp.osl « shaders « osl « kernel « cycles « intern - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 827c56d106cea56b0afd29d4f527baee5b322360 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/* SPDX-License-Identifier: Apache-2.0
 * Copyright 2011-2022 Blender Foundation */

#include "stdcycles.h"

shader node_clamp(string clamp_type = "minmax",
                  float Value = 1.0,
                  float Min = 0.0,
                  float Max = 1.0,
                  output float Result = 0.0)
{
  Result = (clamp_type == "range" && (Min > Max)) ? clamp(Value, Max, Min) :
                                                    clamp(Value, Min, Max);
}