{
	"generic_size": 2,
	"name": "mwf_mix",
	"node_position": {
		"x": 0,
		"y": 0
	},
	"parameters": {

	},
	"seed_int": 0,
	"shader_model": {
		"code": [
			"float $(name_uv)_h = 0.0;",
			"int $(name_uv)_i = 0;",
			"#for",
			"float $(name_uv)_h# = $h#($uv);",
			"if ($(name_uv)_h# > $(name_uv)_h) {",
			"\t$(name_uv)_h = $(name_uv)_h#;",
			"\t$(name_uv)_i = #;",
			"}",
			"#end"
		],
		"global": "",
		"inputs": [
			{
				"default": "0.0",
				"group_size": 5,
				"label": "Height #",
				"longdesc": "An height map",
				"name": "h#",
				"shortdesc": "Height#",
				"type": "f"
			},
			{
				"default": "vec3(0.0)",
				"function": true,
				"label": "Albedo #",
				"longdesc": "An albedo channel",
				"name": "c#",
				"shortdesc": "Albedo#",
				"type": "rgb"
			},
			{
				"default": "vec3(0.0)",
				"function": true,
				"label": "ORM #",
				"longdesc": "A combination of ambient occlusion, roughness and metallic channels",
				"name": "orm#",
				"shortdesc": "ORM#",
				"type": "rgb"
			},
			{
				"default": "vec3(0.0)",
				"function": true,
				"label": "Emission #",
				"longdesc": "An emission channel",
				"name": "em#",
				"shortdesc": "Emission#",
				"type": "rgb"
			},
			{
				"default": "vec3(0.5, 0.5, 1.0)",
				"function": true,
				"label": "Normal #",
				"longdesc": "A normal map",
				"name": "nm#",
				"shortdesc": "Normal#",
				"type": "rgb"
			}
		],
		"instance": [
			"vec3 mix_c_$name(vec2 uv, int i) {",
			"#for",
			"\tif (i == #) {",
			"\t\treturn $c#(uv);",
			"\t} else",
			"#end",
			"\t{",
			"\t\treturn vec3(0.0);",
			"\t}",
			"}",
			"",
			"vec3 mix_orm_$name(vec2 uv, int i) {",
			"#for",
			"\tif (i == #) {",
			"\t\treturn $orm#(uv);",
			"\t} else",
			"#end",
			"\t{",
			"\t\treturn vec3(0.0);",
			"\t}",
			"}",
			"",
			"vec3 mix_em_$name(vec2 uv, int i) {",
			"#for",
			"\tif (i == #) {",
			"\t\treturn $em#(uv);",
			"\t} else",
			"#end",
			"\t{",
			"\t\treturn vec3(0.0);",
			"\t}",
			"}",
			"",
			"vec3 mix_nm_$name(vec2 uv, int i) {",
			"#for",
			"\tif (i == #) {",
			"\t\treturn $nm#(uv);",
			"\t} else",
			"#end",
			"\t{",
			"\t\treturn vec3(0.5, 0.5, 1.0);",
			"\t}",
			"}",
			"",
			"",
			""
		],
		"longdesc": "Combines the outputs of several mapped base materials, keeping the \"highest\" material",
		"name": "Mix",
		"outputs": [
			{
				"f": "$(name_uv)_h",
				"group_size": 5,
				"longdesc": "Generates the height of the result",
				"shortdesc": "Height",
				"type": "f"
			},
			{
				"longdesc": "Shows the output albedo channel",
				"rgb": "mix_c_$name($uv, $(name_uv)_i)",
				"shortdesc": "Albedo",
				"type": "rgb"
			},
			{
				"longdesc": "Shows the output ambient occlusion, roughness and metallic channels",
				"rgb": "mix_orm_$name($uv, $(name_uv)_i)",
				"shortdesc": "ORM",
				"type": "rgb"
			},
			{
				"longdesc": "Shows the output emission channel",
				"rgb": "mix_em_$name($uv, $(name_uv)_i)",
				"shortdesc": "Emission",
				"type": "rgb"
			},
			{
				"longdesc": "Shows the output normal map",
				"rgb": "mix_nm_$name($uv, $(name_uv)_i)",
				"shortdesc": "Normal",
				"type": "rgb"
			}
		],
		"parameters": [

		],
		"shortdesc": "Mix"
	},
	"type": "shader"
}