{
	"name": "mirror",
	"node_position": {
		"x": 0,
		"y": 0
	},
	"parameters": {
		"direction": 0,
		"flip_sides": false,
		"offset": 0
	},
	"seed_int": 0,
	"shader_model": {
		"code": "",
		"global": [
			"vec2 uvmirror_h(vec2 uv, float offset, float flip_sides) {",
			"\treturn vec2(flip_sides*max(0.0, (abs(uv.x-0.5)-0.5*offset))+0.5, uv.y);",
			"}",
			"vec2 uvmirror_v(vec2 uv, float offset, float flip_sides) {",
			"\treturn vec2(uv.x, flip_sides*max(0.0, (abs(uv.y-0.5)-0.5*offset))+0.5);",
			"}",
			""
		],
		"inputs": [
			{
				"default": "vec4($uv, 0, 1)",
				"label": "",
				"longdesc": "The input image",
				"name": "i#",
				"shortdesc": "Input#",
				"type": "rgba"
			}
		],
		"instance": "",
		"longdesc": "Mirrors its input while applying an offset from the center",
		"name": "Mirror",
		"outputs": [
			{
				"longdesc": "Shows the mirrored image",
				"rgba": "$i#(uvmirror_$direction($uv, $offset, $flip_sides ? -1.0 : 1.0))",
				"shortdesc": "Output#",
				"type": "rgba"
			}
		],
		"parameters": [
			{
				"default": 0,
				"label": "",
				"longdesc": "The mirror direction (horizontal or vertical)",
				"name": "direction",
				"shortdesc": "Direction",
				"type": "enum",
				"values": [
					{
						"name": "Horizontal",
						"value": "h"
					},
					{
						"name": "Vertical",
						"value": "v"
					}
				]
			},
			{
				"control": "None",
				"default": 0,
				"label": "",
				"longdesc": "The offset from the center",
				"max": 1,
				"min": 0,
				"name": "offset",
				"shortdesc": "Offset",
				"step": 0.005,
				"type": "float"
			},
			{
				"default": false,
				"label": "Flip sides",
				"name": "flip_sides",
				"type": "boolean"
			}
		],
		"shortdesc": "Mirror"
	},
	"type": "shader"
}