{
	"name": "warp2",
	"node_position": {
		"x": 0,
		"y": 0
	},
	"parameters": {
		"amount": 0.05,
		"mode": 0
	},
	"seed_int": 0,
	"shader_model": {
		"code": [
			"vec2 $(name_uv)_slope = $(name)_slope($uv);",
			"vec2 $(name_uv)_warp = $mode;"
		],
		"global": "",
		"inputs": [
			{
				"default": "vec4(sin($uv.x*20.0)*0.5+0.5, sin($uv.y*20.0)*0.5+0.5, 0, 1)",
				"label": "",
				"longdesc": "The input image to be warped",
				"name": "in",
				"shortdesc": "Input",
				"type": "rgba"
			},
			{
				"default": "0.0",
				"function": true,
				"label": "",
				"longdesc": "The height map whose slopes are used to deform the input",
				"name": "d",
				"shortdesc": "Height map",
				"type": "f"
			}
		],
		"instance": [
			"vec2 $(name)_slope(vec2 uv) {",
			"\tvec2 e = vec2(0.001, 0.0);",
			"\treturn 0.5*vec2($d(uv+e)-$d(uv-e), $d(uv+e.yx)-$d(uv-e.yx))/e.x;",
			"}"
		],
		"longdesc": "Warps its input according to a heightmap",
		"name": "Warp",
		"outputs": [
			{
				"longdesc": "Shows the warped image",
				"rgba": "$in($uv+$amount*$(name_uv)_warp)",
				"shortdesc": "Output",
				"type": "rgba"
			}
		],
		"parameters": [
			{
				"default": 0,
				"label": "",
				"longdesc": "Both warp modes extract their direction from the height map slopes:\n- Slope warp intensity only depends on the slope\n- Distance to top warp intensity depends on the slope and the distance to the top, and can be used to create mosaic-like patterns\n\nA Transform node with translate maps can produce effects similar to Slope Warp and is generally faster.",
				"name": "mode",
				"shortdesc": "Mode",
				"type": "enum",
				"values": [
					{
						"name": "Slope",
						"value": "$(name_uv)_slope"
					},
					{
						"name": "Distance to top",
						"value": "$(name_uv)_slope*(1.0-$d($uv))"
					}
				]
			},
			{
				"control": "None",
				"default": 0,
				"label": "",
				"longdesc": "The strength of the warp effect",
				"max": 1,
				"min": 0,
				"name": "amount",
				"shortdesc": "Strength",
				"step": 0.005,
				"type": "float"
			}
		],
		"shortdesc": "Warp"
	},
	"type": "shader"
}