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

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

#include "node_ramp_util.h"
#include "stdcycles.h"

shader node_float_curve(float ramp[] = {0.0},
                        float min_x = 0.0,
                        float max_x = 1.0,
                        int extrapolate = 1,

                        float ValueIn = 0.0,
                        float Factor = 0.0,
                        output float ValueOut = 0.0)
{
  float c = (ValueIn - min_x) / (max_x - min_x);

  ValueOut = rgb_ramp_lookup(ramp, c, 1, extrapolate);

  ValueOut = mix(ValueIn, ValueOut, Factor);
}