{
	"name": "box",
	"node_position": {
		"x": 0,
		"y": 0
	},
	"parameters": {
		"cx": 0.5,
		"cy": 0.5,
		"cz": 0.5,
		"rx": 0,
		"ry": 0,
		"rz": 0,
		"sx": 0.25,
		"sy": 0.25,
		"sz": 0.25
	},
	"seed_int": 0,
	"shader_model": {
		"code": "",
		"global": [
			"float box(vec2 uv, vec3 center, vec3 rad, vec3 rot) {",
			"\tvec3 ro = vec3(uv, 1.0)-center;",
			"\tvec3 rd = vec3(0.0000001, 0.0000001, -1.0);",
			"\tmat3 r = mat3(vec3(1, 0, 0), vec3(0, cos(rot.x), -sin(rot.x)), vec3(0, sin(rot.x), cos(rot.x)));",
			"\tr *= mat3(vec3(cos(rot.y), 0, -sin(rot.y)), vec3(0, 1, 0), vec3(sin(rot.y), 0, cos(rot.y)));",
			"\tr *= mat3(vec3(cos(rot.z), -sin(rot.z), 0), vec3(sin(rot.z), cos(rot.z), 0), vec3(0, 0, 1));",
			"\tro = r * ro;",
			"\trd = r * rd;",
			"\tvec3 m = 1.0/rd;",
			"\tvec3 n = m*ro;",
			"\tvec3 k = abs(m)*rad;",
			"\tvec3 t1 = -n - k;",
			"\tvec3 t2 = -n + k;",
			"",
			"\tfloat tN = max(max(t1.x, t1.y), t1.z);",
			"\tfloat tF = min(min(t2.x, t2.y), t2.z);",
			"\tif(tN>tF || tF<0.0) return 1.0;",
			"\treturn tN;",
			"}"
		],
		"inputs": [],
		"instance": "",
		"longdesc": "Generates depth of a 3D Box",
		"name": "Box",
		"outputs": [
			{
				"f": "1.0-box($uv, vec3($cx, $cy, $cz), vec3($sx, $sy, $sz), 0.01745329251*vec3($rx, $ry, $rz))",
				"longdesc": "A heightmap of the specified box",
				"shortdesc": "Output",
				"type": "f"
			}
		],
		"parameters": [
			{
				"control": "None",
				"default": 0.5,
				"label": "Center X",
				"longdesc": "X coordinate of the center of the box",
				"max": 1,
				"min": 0,
				"name": "cx",
				"shortdesc": "Center.x",
				"step": 0.01,
				"type": "float"
			},
			{
				"control": "None",
				"default": 0.5,
				"label": "Center Y",
				"longdesc": "Y coordinate of the center of the box",
				"max": 1,
				"min": 0,
				"name": "cy",
				"shortdesc": "Center.y",
				"step": 0.01,
				"type": "float"
			},
			{
				"control": "None",
				"default": 0,
				"label": "Center Z",
				"longdesc": "Z coordinate of the center of the box",
				"max": 0.5,
				"min": -0.5,
				"name": "cz",
				"shortdesc": "Center.z",
				"step": 0.01,
				"type": "float"
			},
			{
				"control": "None",
				"default": 0.5,
				"label": "Size X",
				"longdesc": "Size along X axis",
				"max": 1,
				"min": 0,
				"name": "sx",
				"shortdesc": "Size.x",
				"step": 0.01,
				"type": "float"
			},
			{
				"control": "None",
				"default": 0.5,
				"label": "Size Y",
				"longdesc": "Size along Y axis",
				"max": 1,
				"min": 0,
				"name": "sy",
				"shortdesc": "Size.y",
				"step": 0.01,
				"type": "float"
			},
			{
				"control": "None",
				"default": 0.5,
				"label": "Size Z",
				"longdesc": "Size along Z axis",
				"max": 1,
				"min": 0,
				"name": "sz",
				"shortdesc": "Size.z",
				"step": 0.01,
				"type": "float"
			},
			{
				"control": "None",
				"default": 0,
				"label": "Rot X",
				"longdesc": "Rotation angle around X axis",
				"max": 180,
				"min": -180,
				"name": "rx",
				"shortdesc": "Rot.x",
				"step": 0.1,
				"type": "float"
			},
			{
				"control": "None",
				"default": 0,
				"label": "Rot Y",
				"longdesc": "Rotation angle around Y axis",
				"max": 180,
				"min": -180,
				"name": "ry",
				"shortdesc": "Rot.y",
				"step": 0.1,
				"type": "float"
			},
			{
				"control": "None",
				"default": 0,
				"label": "Rot Z",
				"longdesc": "Rotation angle around Y axis",
				"max": 180,
				"min": -180,
				"name": "rz",
				"shortdesc": "Rot.z",
				"step": 0.1,
				"type": "float"
			}
		],
		"shortdesc": "Box"
	},
	"type": "shader"
}