|
| 1 | +{ |
| 2 | + "connections": [ |
| 3 | + { |
| 4 | + "from": "gen_inputs", |
| 5 | + "from_port": 0, |
| 6 | + "to": "buffer", |
| 7 | + "to_port": 0 |
| 8 | + }, |
| 9 | + { |
| 10 | + "from": "buffer", |
| 11 | + "from_port": 0, |
| 12 | + "to": "edge_detect_3_3_2", |
| 13 | + "to_port": 0 |
| 14 | + }, |
| 15 | + { |
| 16 | + "from": "edge_detect_3_3_2", |
| 17 | + "from_port": 0, |
| 18 | + "to": "gen_outputs", |
| 19 | + "to_port": 0 |
| 20 | + }, |
| 21 | + { |
| 22 | + "from": "gen_inputs", |
| 23 | + "from_port": 1, |
| 24 | + "to": "edge_detect_3_3_2", |
| 25 | + "to_port": 1 |
| 26 | + } |
| 27 | + ], |
| 28 | + "label": "Directional Blur", |
| 29 | + "longdesc": "Applies a directional gaussian blur to its input", |
| 30 | + "name": "directional_blur", |
| 31 | + "node_position": { |
| 32 | + "x": 0, |
| 33 | + "y": 0 |
| 34 | + }, |
| 35 | + "nodes": [ |
| 36 | + { |
| 37 | + "name": "buffer", |
| 38 | + "node_position": { |
| 39 | + "x": -364.25, |
| 40 | + "y": -255.75 |
| 41 | + }, |
| 42 | + "parameters": { |
| 43 | + "lod": 0, |
| 44 | + "size": 9 |
| 45 | + }, |
| 46 | + "seed": 20527, |
| 47 | + "type": "buffer" |
| 48 | + }, |
| 49 | + { |
| 50 | + "name": "gen_parameters", |
| 51 | + "node_position": { |
| 52 | + "x": -456.666626, |
| 53 | + "y": -433.666656 |
| 54 | + }, |
| 55 | + "parameters": { |
| 56 | + "param0": 9, |
| 57 | + "param1": 50, |
| 58 | + "param2": 45, |
| 59 | + "param3": 0 |
| 60 | + }, |
| 61 | + "seed": 343, |
| 62 | + "type": "remote", |
| 63 | + "widgets": [ |
| 64 | + { |
| 65 | + "label": "Grid size", |
| 66 | + "linked_widgets": [ |
| 67 | + { |
| 68 | + "node": "buffer", |
| 69 | + "widget": "size" |
| 70 | + }, |
| 71 | + { |
| 72 | + "node": "edge_detect_3_3_2", |
| 73 | + "widget": "size" |
| 74 | + } |
| 75 | + ], |
| 76 | + "longdesc": "The resolution of the input", |
| 77 | + "name": "param0", |
| 78 | + "shortdesc": "Size", |
| 79 | + "type": "linked_control" |
| 80 | + }, |
| 81 | + { |
| 82 | + "label": "Mode", |
| 83 | + "linked_widgets": [ |
| 84 | + { |
| 85 | + "node": "edge_detect_3_3_2", |
| 86 | + "widget": "mode" |
| 87 | + } |
| 88 | + ], |
| 89 | + "longdesc": "Controls whether the blur moves in both directions or only in one.", |
| 90 | + "name": "param3", |
| 91 | + "shortdesc": "Mode", |
| 92 | + "type": "linked_control" |
| 93 | + }, |
| 94 | + { |
| 95 | + "label": "Sigma", |
| 96 | + "linked_widgets": [ |
| 97 | + { |
| 98 | + "node": "edge_detect_3_3_2", |
| 99 | + "widget": "sigma" |
| 100 | + } |
| 101 | + ], |
| 102 | + "longdesc": "The strength of the blur filter", |
| 103 | + "name": "param1", |
| 104 | + "shortdesc": "Sigma", |
| 105 | + "type": "linked_control" |
| 106 | + }, |
| 107 | + { |
| 108 | + "label": "Angle", |
| 109 | + "linked_widgets": [ |
| 110 | + { |
| 111 | + "node": "edge_detect_3_3_2", |
| 112 | + "widget": "angle" |
| 113 | + } |
| 114 | + ], |
| 115 | + "longdesc": "The angle of the directional blur effect", |
| 116 | + "name": "param2", |
| 117 | + "shortdesc": "Angle", |
| 118 | + "type": "linked_control" |
| 119 | + } |
| 120 | + ] |
| 121 | + }, |
| 122 | + { |
| 123 | + "name": "gen_inputs", |
| 124 | + "node_position": { |
| 125 | + "x": -779.666626, |
| 126 | + "y": -247.392853 |
| 127 | + }, |
| 128 | + "parameters": { |
| 129 | + |
| 130 | + }, |
| 131 | + "ports": [ |
| 132 | + { |
| 133 | + "group_size": 0, |
| 134 | + "longdesc": "The input image", |
| 135 | + "name": "in", |
| 136 | + "shortdesc": "Input", |
| 137 | + "type": "rgba" |
| 138 | + }, |
| 139 | + { |
| 140 | + "group_size": 0, |
| 141 | + "longdesc": "A map that controls the strength of the blur filter", |
| 142 | + "name": "amount", |
| 143 | + "shortdesc": "Strength map", |
| 144 | + "type": "f" |
| 145 | + } |
| 146 | + ], |
| 147 | + "seed": 91624, |
| 148 | + "seed_locked": true, |
| 149 | + "type": "ios" |
| 150 | + }, |
| 151 | + { |
| 152 | + "name": "gen_outputs", |
| 153 | + "node_position": { |
| 154 | + "x": -45.452393, |
| 155 | + "y": -195.392853 |
| 156 | + }, |
| 157 | + "parameters": { |
| 158 | + |
| 159 | + }, |
| 160 | + "ports": [ |
| 161 | + { |
| 162 | + "group_size": 0, |
| 163 | + "longdesc": "Shows the generated blurred image", |
| 164 | + "name": "port0", |
| 165 | + "shortdesc": "Output", |
| 166 | + "type": "rgba" |
| 167 | + } |
| 168 | + ], |
| 169 | + "seed": 30896, |
| 170 | + "type": "ios" |
| 171 | + }, |
| 172 | + { |
| 173 | + "name": "edge_detect_3_3_2", |
| 174 | + "node_position": { |
| 175 | + "x": -357.725464, |
| 176 | + "y": -153.178955 |
| 177 | + }, |
| 178 | + "parameters": { |
| 179 | + "angle": 45, |
| 180 | + "mode": 0, |
| 181 | + "sigma": 50, |
| 182 | + "size": 9 |
| 183 | + }, |
| 184 | + "seed": -47470, |
| 185 | + "seed_locked": true, |
| 186 | + "shader_model": { |
| 187 | + "code": "", |
| 188 | + "global": "", |
| 189 | + "inputs": [ |
| 190 | + { |
| 191 | + "default": "vec4(1.0)", |
| 192 | + "function": true, |
| 193 | + "label": "", |
| 194 | + "name": "in", |
| 195 | + "type": "rgba" |
| 196 | + }, |
| 197 | + { |
| 198 | + "default": "1.0", |
| 199 | + "function": true, |
| 200 | + "label": "", |
| 201 | + "name": "amount", |
| 202 | + "type": "f" |
| 203 | + } |
| 204 | + ], |
| 205 | + "instance": [ |
| 206 | + "vec4 $(name)_fct(vec2 uv) {", |
| 207 | + "\tvec2 e = vec2(cos($angle*0.01745329251), -sin($angle*0.01745329251))/$size;", |
| 208 | + "\tvec4 rv = vec4(0.0);", |
| 209 | + "\tfloat sum = 0.0;", |
| 210 | + "\tfloat sigma = max($sigma*$amount(uv), 1e-5);", |
| 211 | + "\tfor (float i = $mode; i <= 50.0; i += 1.0) {", |
| 212 | + "\t\tfloat coef = exp(-0.5*(pow(i/sigma, 2.0)))/(6.28318530718*sigma*sigma);", |
| 213 | + "\t\trv += $in(uv+i*e)*coef;", |
| 214 | + "\t\tsum += coef;", |
| 215 | + "\t}", |
| 216 | + "\treturn rv/sum;", |
| 217 | + "}" |
| 218 | + ], |
| 219 | + "name": "Directional Blur", |
| 220 | + "outputs": [ |
| 221 | + { |
| 222 | + "rgba": "$(name)_fct($uv)", |
| 223 | + "type": "rgba" |
| 224 | + } |
| 225 | + ], |
| 226 | + "parameters": [ |
| 227 | + { |
| 228 | + "default": 9, |
| 229 | + "first": 4, |
| 230 | + "label": "Size", |
| 231 | + "last": 12, |
| 232 | + "name": "size", |
| 233 | + "type": "size" |
| 234 | + }, |
| 235 | + { |
| 236 | + "default": 0, |
| 237 | + "label": "Mode", |
| 238 | + "name": "mode", |
| 239 | + "type": "enum", |
| 240 | + "values": [ |
| 241 | + { |
| 242 | + "name": "Both", |
| 243 | + "value": "-50.0" |
| 244 | + }, |
| 245 | + { |
| 246 | + "name": "Single", |
| 247 | + "value": "0.0" |
| 248 | + } |
| 249 | + ] |
| 250 | + }, |
| 251 | + { |
| 252 | + "control": "None", |
| 253 | + "default": 0.5, |
| 254 | + "label": "Sigma", |
| 255 | + "max": 50, |
| 256 | + "min": 0, |
| 257 | + "name": "sigma", |
| 258 | + "step": 0.1, |
| 259 | + "type": "float" |
| 260 | + }, |
| 261 | + { |
| 262 | + "control": "None", |
| 263 | + "default": 0, |
| 264 | + "label": "Angle", |
| 265 | + "max": 180, |
| 266 | + "min": -180, |
| 267 | + "name": "angle", |
| 268 | + "step": 0.1, |
| 269 | + "type": "float" |
| 270 | + } |
| 271 | + ] |
| 272 | + }, |
| 273 | + "type": "shader" |
| 274 | + } |
| 275 | + ], |
| 276 | + "parameters": { |
| 277 | + "param0": 9, |
| 278 | + "param1": 50, |
| 279 | + "param2": 45, |
| 280 | + "param3": 0 |
| 281 | + }, |
| 282 | + "seed_int": 0, |
| 283 | + "shortdesc": "Directional blur", |
| 284 | + "type": "graph" |
| 285 | +} |
0 commit comments