mirror of
https://github.com/Relintai/mat_maker_gd.git
synced 2025-04-30 10:57:56 +02:00
50 lines
1.2 KiB
Plaintext
50 lines
1.2 KiB
Plaintext
{
|
|
"name": "edge_detect_3",
|
|
"node_position": {
|
|
"x": 0,
|
|
"y": 0
|
|
},
|
|
"parameters": {
|
|
"size": 6
|
|
},
|
|
"shader_model": {
|
|
"code": "",
|
|
"global": "",
|
|
"inputs": [
|
|
{
|
|
"default": "vec3(0.0)",
|
|
"function": true,
|
|
"label": "",
|
|
"longdesc": "The input image",
|
|
"name": "in",
|
|
"shortdesc": "Input",
|
|
"type": "rgb"
|
|
}
|
|
],
|
|
"instance": "float $(name)_fct(vec2 uv) {\n\tvec2 e = vec2(1.0/$size, -1.0/$size);\n\tvec3 rv = 4.0*$in(uv);\n\trv -= $in(uv+e.xy);\n\trv -= $in(uv-e.xy);\n\trv -= $in(uv+e.xx);\n\trv -= $in(uv-e.xx);\n\trv = abs(rv);\n\treturn max(rv.x, max(rv.y ,rv.z))*$size;\n}",
|
|
"longdesc": "An edge detect filter that detects edges along diagonals and draws them in white on a black background",
|
|
"name": "Edge detect 3",
|
|
"outputs": [
|
|
{
|
|
"f": "clamp($(name)_fct($uv), 0.0, 1.0)",
|
|
"longdesc": "Shows the generated outlines",
|
|
"shortdesc": "Output",
|
|
"type": "f"
|
|
}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"default": 9,
|
|
"first": 4,
|
|
"label": "Size",
|
|
"last": 12,
|
|
"longdesc": "The resolution of the input image",
|
|
"name": "size",
|
|
"shortdesc": "Size",
|
|
"type": "size"
|
|
}
|
|
],
|
|
"shortdesc": "Edge detect"
|
|
},
|
|
"type": "shader"
|
|
} |