From 7a7eadaf7f6be4008f49a83d76c5a6d5a6294f14 Mon Sep 17 00:00:00 2001 From: OmarSquircleArt Date: Wed, 14 Aug 2019 10:53:19 +0200 Subject: 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 --- intern/cycles/render/nodes.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'intern/cycles/render/nodes.h') 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 { -- cgit v1.2.3