diff options
author | OmarSquircleArt <omar.squircleart@gmail.com> | 2019-08-14 11:53:19 +0300 |
---|---|---|
committer | OmarSquircleArt <omar.squircleart@gmail.com> | 2019-08-14 11:53:19 +0300 |
commit | 7a7eadaf7f6be4008f49a83d76c5a6d5a6294f14 (patch) | |
tree | 8a064999db636d7c8c49f41156fd526193cee658 /intern/cycles/render/nodes.h | |
parent | c9acc5faad08422e07be59fc160a028a45b7440c (diff) |
Shading: Add a clamp option to the Map Range node.
If the option is enabled, the output is clamped to the target range.
The target range is [To Min, To Max]. The option is enabled by default.
The clamp option is implemented in EEVEE by linking to the `clamp_value`
GLSL function. And it is implemented in Cycles using a graph expand
function.
Reviewers: brecht, JacquesLucke
Differential Revision: https://developer.blender.org/D5477
Diffstat (limited to 'intern/cycles/render/nodes.h')
-rw-r--r-- | intern/cycles/render/nodes.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/intern/cycles/render/nodes.h b/intern/cycles/render/nodes.h index 9ac42ffc76c..d4708adf9af 100644 --- a/intern/cycles/render/nodes.h +++ b/intern/cycles/render/nodes.h @@ -1236,7 +1236,10 @@ class MapRangeNode : public ShaderNode { { return NODE_GROUP_LEVEL_3; } + void expand(ShaderGraph *graph); + float value, from_min, from_max, to_min, to_max; + bool clamp; }; class ClampNode : public ShaderNode { |