material-maker/addons/material_maker/nodes/tones_step.mmg

73 lines
1.6 KiB
Plaintext

{
"name": "tones_step",
"node_position": {
"x": 0,
"y": 0
},
"parameters": {
"invert": false,
"value": 0.5,
"width": 0.1
},
"shader_model": {
"code": "vec3 $(name_uv)_false = clamp(($in($uv).rgb-vec3($value))/max(0.0001, $width)+vec3(0.5), vec3(0.0), vec3(1.0));\nvec3 $(name_uv)_true = vec3(1.0)-$(name_uv)_false;",
"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": "Emphasizes dark and light tones around a specified value",
"name": "Tones step",
"outputs": [
{
"longdesc": "Shows the generated high contrast image",
"rgba": "vec4($(name_uv)_$invert, $in($uv).a)",
"shortdesc": "Output",
"type": "rgba"
}
],
"parameters": [
{
"control": "None",
"default": 0.5,
"label": "Value",
"longdesc": "The value of the input that separate dark and light zones of the result",
"max": 1,
"min": 0,
"name": "value",
"shortdesc": "Value",
"step": 0.01,
"type": "float"
},
{
"control": "None",
"default": 1,
"label": "Width",
"longdesc": "The width (in tones space) of the transition area",
"max": 1,
"min": 0,
"name": "width",
"shortdesc": "width",
"step": 0.01,
"type": "float"
},
{
"default": false,
"label": "Invert",
"longdesc": "Invert the generated image if set",
"name": "invert",
"shortdesc": "Invert",
"type": "boolean"
}
],
"shortdesc": "Tones step"
},
"type": "shader"
}