diff --git a/addons/material_maker/nodes/tones_map.mmg b/addons/material_maker/nodes/tones_map.mmg new file mode 100644 index 00000000..8ec7d304 --- /dev/null +++ b/addons/material_maker/nodes/tones_map.mmg @@ -0,0 +1,90 @@ +{ + "name": "tones_map", + "node_position": { + "x": 0, + "y": 0 + }, + "parameters": { + "in_max": 1, + "in_min": 0, + "out_max": 1, + "out_min": 0 + }, + "shader_model": { + "code": "", + "global": "", + "inputs": [ + { + "default": "vec4(0.5 ,0.5, 0.5, 1.0)", + "label": "", + "longdesc": "The input image", + "name": "in", + "shortdesc": "Input", + "type": "rgba" + } + ], + "instance": "", + "longdesc": "A node that maps linearly an input tones interval to an output tones interval.", + "name": "Tones map", + "outputs": [ + { + "longdesc": "Shows the generated remapped image", + "rgba": "vec4(vec3($out_min)+($in($uv).rgb-vec3($in_min))*vec3(($out_max-$out_min)/($in_max-$in_min)), $in($uv).a)", + "shortdesc": "Output", + "type": "rgba" + } + ], + "parameters": [ + { + "control": "None", + "default": 0.5, + "label": "Input min", + "longdesc": "The minimum value of the input interval", + "max": 1, + "min": 0, + "name": "in_min", + "shortdesc": "InputMin", + "step": 0.01, + "type": "float" + }, + { + "control": "None", + "default": 0.5, + "label": "Input max", + "longdesc": "The maximum value of the input interval", + "max": 1, + "min": 0, + "name": "in_max", + "shortdesc": "InputMax", + "step": 0.01, + "type": "float" + }, + { + "control": "None", + "default": 1, + "label": "Output min", + "longdesc": "The minimum value of the output interval", + "max": 1, + "min": 0, + "name": "out_min", + "shortdesc": "OutputMin", + "step": 0.01, + "type": "float" + }, + { + "control": "None", + "default": 0.5, + "label": "Output max", + "longdesc": "The maximum value of the output interval", + "max": 1, + "min": 0, + "name": "out_max", + "shortdesc": "OutputMax", + "step": 0.01, + "type": "float" + } + ], + "shortdesc": "Tones map" + }, + "type": "shader" +} \ No newline at end of file diff --git a/material_maker/library/base.json b/material_maker/library/base.json index 60383f9e..69f54cf7 100644 --- a/material_maker/library/base.json +++ b/material_maker/library/base.json @@ -1812,6 +1812,17 @@ "tree_item": "Filter/Tones", "type": "tones" }, + { + "icon": "filter_tones_map", + "name": "tones_map", + "parameters": { + "invert": false, + "value": 0.5, + "width": 0.1 + }, + "tree_item": "Filter/Tones/Map", + "type": "tones_map" + }, { "icon": "filter_tones_step", "name": "tones_step", diff --git a/material_maker/library/base/filter_tones_map.png b/material_maker/library/base/filter_tones_map.png new file mode 100644 index 00000000..3e5c4f99 Binary files /dev/null and b/material_maker/library/base/filter_tones_map.png differ