Name
*
Code
{"properties":{"frame":0,"maxFrame":600,"maxFrameLocked":false,"realtimeState":true,"masterCameraNodePath":"/perspectiveCamera1","versions":{"polygonjs":"1.1.134"}},"root":{"type":"obj","nodes":{"geo1":{"type":"geo","nodes":{"MAT":{"type":"materialsNetwork","nodes":{"meshStandard1":{"type":"meshStandard","params":{"useMap":true,"map":"../../../COP/imageUv","useEnvMap":true,"envMap":"../../../COP/envMap","roughness":0.07}},"meshBasicBuilder1":{"type":"meshBasicBuilder","nodes":{"globals1":{"type":"globals"},"output1":{"type":"output","inputs":[{"index":0,"node":"instanceTransform1","output":"position"},{"index":1,"node":"instanceTransform1","output":"normal"},{"index":2,"node":"hsvToRgb1","output":"rgb"}]},"mix1":{"type":"mix","params":{"value0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true}},"value1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true}},"blend":{"type":"float","default_value":0.5,"options":{"spare":true},"raw_input":1}},"inputs":[{"index":0,"node":"null2","output":"val"},{"index":1,"node":"multAdd1","output":"val"},{"index":2,"node":"easing1","output":"out"}],"connection_points":{"in":[{"name":"value0","type":"vec3"},{"name":"value1","type":"vec3"},{"name":"blend","type":"float"}],"out":[{"name":"mix","type":"vec3"}]}},"mix2":{"type":"mix","params":{"value0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true}},"value1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true}},"blend":{"type":"float","default_value":0.5,"options":{"spare":true},"raw_input":1}},"inputs":[{"index":0,"node":"mix1","output":"mix"},{"index":1,"node":"multAdd2","output":"val"},{"index":2,"node":"easing2","output":"out"}],"connection_points":{"in":[{"name":"value0","type":"vec3"},{"name":"value1","type":"vec3"},{"name":"blend","type":"float"}],"out":[{"name":"mix","type":"vec3"}]}},"multAdd1":{"type":"multAdd","params":{"value":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true}},"preAdd":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true}},"mult":{"type":"vector3","default_value":[1,1,1],"options":{"spare":true},"raw_input":[2,2,0.5]},"postAdd":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true}}},"inputs":[{"index":0,"node":"null2","output":"val"}],"connection_points":{"in":[{"name":"value","type":"vec3"},{"name":"preAdd","type":"vec3"},{"name":"mult","type":"vec3"},{"name":"postAdd","type":"vec3"}],"out":[{"name":"val","type":"vec3"}]}},"multAdd2":{"type":"multAdd","params":{"value":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true}},"preAdd":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true}},"mult":{"type":"vector3","default_value":[1,1,1],"options":{"spare":true},"raw_input":[0.5,0.5,3]},"postAdd":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true}}},"inputs":[{"index":0,"node":"null2","output":"val"}],"connection_points":{"in":[{"name":"value","type":"vec3"},{"name":"preAdd","type":"vec3"},{"name":"mult","type":"vec3"},{"name":"postAdd","type":"vec3"}],"out":[{"name":"val","type":"vec3"}]}},"constant1":{"type":"constant","connection_points":{"in":[],"out":[{"name":"val","type":"float"}]}},"clamp1":{"type":"clamp","params":{"value":{"type":"float","default_value":0,"options":{"spare":true}},"min":{"type":"float","default_value":0,"options":{"spare":true}},"max":{"type":"float","default_value":1,"options":{"spare":true}}},"inputs":[{"index":0,"node":"null1","output":"val"}],"connection_points":{"in":[{"name":"value","type":"float"},{"name":"min","type":"float"},{"name":"max","type":"float"}],"out":[{"name":"val","type":"float"}]}},"clamp2":{"type":"clamp","params":{"value":{"type":"float","default_value":0,"options":{"spare":true}},"min":{"type":"float","default_value":0,"options":{"spare":true},"raw_input":1},"max":{"type":"float","default_value":1,"options":{"spare":true},"raw_input":2}},"inputs":[{"index":0,"node":"null1","output":"val"}],"connection_points":{"in":[{"name":"value","type":"float"},{"name":"min","type":"float"},{"name":"max","type":"float"}],"out":[{"name":"val","type":"float"}]}},"multAdd3":{"type":"multAdd","params":{"value":{"type":"float","default_value":0,"options":{"spare":true}},"preAdd":{"type":"float","default_value":0,"options":{"spare":true},"raw_input":-1},"mult":{"type":"float","default_value":1,"options":{"spare":true}},"postAdd":{"type":"float","default_value":0,"options":{"spare":true}}},"inputs":[{"index":0,"node":"clamp2","output":"val"}],"connection_points":{"in":[{"name":"value","type":"float"},{"name":"preAdd","type":"float"},{"name":"mult","type":"float"},{"name":"postAdd","type":"float"}],"out":[{"name":"val","type":"float"}]}},"null1":{"type":"null","params":{"in":{"type":"float","default_value":0,"options":{"spare":true}}},"inputs":[{"index":0,"node":"multAdd4","output":"val"}],"connection_points":{"in":[{"name":"in","type":"float"}],"out":[{"name":"val","type":"float"}]}},"multAdd4":{"type":"multAdd","params":{"value":{"type":"float","default_value":0,"options":{"spare":true}},"preAdd":{"type":"float","default_value":0,"options":{"spare":true}},"mult":{"type":"float","default_value":1,"options":{"spare":true},"raw_input":3},"postAdd":{"type":"float","default_value":0,"options":{"spare":true}}},"inputs":[{"index":0,"node":"globals1","output":"time"},{"index":1,"node":"multAdd11","output":"val"}],"connection_points":{"in":[{"name":"value","type":"float"},{"name":"preAdd","type":"float"},{"name":"mult","type":"float"},{"name":"postAdd","type":"float"}],"out":[{"name":"val","type":"float"}]}},"multAdd5":{"type":"multAdd","params":{"value":{"type":"float","default_value":0,"options":{"spare":true}},"preAdd":{"type":"float","default_value":0,"options":{"spare":true}},"mult":{"type":"float","default_value":1,"options":{"spare":true},"raw_input":2},"postAdd":{"type":"float","default_value":0,"options":{"spare":true}}},"inputs":[{"index":0,"node":"multAdd3","output":"val"}],"connection_points":{"in":[{"name":"value","type":"float"},{"name":"preAdd","type":"float"},{"name":"mult","type":"float"},{"name":"postAdd","type":"float"}],"out":[{"name":"val","type":"float"}]}},"clamp3":{"type":"clamp","params":{"value":{"type":"float","default_value":0,"options":{"spare":true}},"min":{"type":"float","default_value":0,"options":{"spare":true}},"max":{"type":"float","default_value":1,"options":{"spare":true}}},"inputs":[{"index":0,"node":"multAdd5","output":"val"}],"connection_points":{"in":[{"name":"value","type":"float"},{"name":"min","type":"float"},{"name":"max","type":"float"}],"out":[{"name":"val","type":"float"}]}},"easing1":{"type":"easing","params":{"type":19},"inputs":[{"index":0,"node":"clamp1","output":"val"}]},"easing2":{"type":"easing","params":{"type":21},"inputs":[{"index":0,"node":"clamp3","output":"val"}]},"rotate1":{"type":"rotate","params":{"vector":{"type":"vector3","default_value":[0,0,1],"options":{"spare":true},"raw_input":[0,1,0]},"axis":{"type":"vector3","default_value":[0,1,0],"options":{"spare":true},"raw_input":[0,0,1]},"angle":{"type":"float","default_value":0,"options":{"spare":true},"raw_input":1.5707963267948966}},"maxInputsCount":3,"inputs":[{"index":0,"node":"mix2","output":"mix"}],"connection_points":{"in":[{"name":"vector","type":"vec3"},{"name":"axis","type":"vec3"},{"name":"angle","type":"float"}],"out":[{"name":"val","type":"vec3"}]}},"mix3":{"type":"mix","params":{"value0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true}},"value1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true}},"blend":{"type":"float","default_value":0.5,"options":{"spare":true}}},"inputs":[{"index":0,"node":"mix2","output":"mix"},{"index":1,"node":"multAdd12","output":"val"},{"index":2,"node":"easing3","output":"out"}],"connection_points":{"in":[{"name":"value0","type":"vec3"},{"name":"value1","type":"vec3"},{"name":"blend","type":"float"}],"out":[{"name":"mix","type":"vec3"}]}},"multAdd6":{"type":"multAdd","params":{"value":{"type":"float","default_value":0,"options":{"spare":true}},"preAdd":{"type":"float","default_value":0,"options":{"spare":true},"raw_input":-0.33},"mult":{"type":"float","default_value":1,"options":{"spare":true}},"postAdd":{"type":"float","default_value":0,"options":{"spare":true}}},"inputs":[{"index":0,"node":"null1","output":"val"}],"connection_points":{"in":[{"name":"value","type":"float"},{"name":"preAdd","type":"float"},{"name":"mult","type":"float"},{"name":"postAdd","type":"float"}],"out":[{"name":"val","type":"float"}]}},"clamp4":{"type":"clamp","params":{"value":{"type":"float","default_value":0,"options":{"spare":true}},"min":{"type":"float","default_value":0,"options":{"spare":true},"raw_input":1},"max":{"type":"float","default_value":1,"options":{"spare":true},"raw_input":2}},"inputs":[{"index":0,"node":"multAdd6","output":"val"}],"connection_points":{"in":[{"name":"value","type":"float"},{"name":"min","type":"float"},{"name":"max","type":"float"}],"out":[{"name":"val","type":"float"}]}},"multAdd7":{"type":"multAdd","params":{"value":{"type":"float","default_value":0,"options":{"spare":true}},"preAdd":{"type":"float","default_value":0,"options":{"spare":true},"raw_input":-1},"mult":{"type":"float","default_value":1,"options":{"spare":true}},"postAdd":{"type":"float","default_value":0,"options":{"spare":true}}},"inputs":[{"index":0,"node":"clamp4","output":"val"}],"connection_points":{"in":[{"name":"value","type":"float"},{"name":"preAdd","type":"float"},{"name":"mult","type":"float"},{"name":"postAdd","type":"float"}],"out":[{"name":"val","type":"float"}]}},"multAdd8":{"type":"multAdd","params":{"value":{"type":"float","default_value":0,"options":{"spare":true}},"preAdd":{"type":"float","default_value":0,"options":{"spare":true}},"mult":{"type":"float","default_value":1,"options":{"spare":true},"raw_input":2},"postAdd":{"type":"float","default_value":0,"options":{"spare":true}}},"inputs":[{"index":0,"node":"multAdd7","output":"val"}],"connection_points":{"in":[{"name":"value","type":"float"},{"name":"preAdd","type":"float"},{"name":"mult","type":"float"},{"name":"postAdd","type":"float"}],"out":[{"name":"val","type":"float"}]}},"clamp5":{"type":"clamp","params":{"value":{"type":"float","default_value":0,"options":{"spare":true}},"min":{"type":"float","default_value":0,"options":{"spare":true}},"max":{"type":"float","default_value":1,"options":{"spare":true}}},"inputs":[{"index":0,"node":"multAdd8","output":"val"}],"connection_points":{"in":[{"name":"value","type":"float"},{"name":"min","type":"float"},{"name":"max","type":"float"}],"out":[{"name":"val","type":"float"}]}},"easing3":{"type":"easing","params":{"type":21},"inputs":[{"index":0,"node":"clamp5","output":"val"}]},"instanceTransform1":{"type":"instanceTransform","inputs":[{"index":0,"node":"mix3","output":"mix"}]},"attribute1":{"type":"attribute","params":{"name":"id"},"connection_points":{"in":[],"out":[{"name":"val","type":"float"}]}},"round1":{"type":"round","params":{"in":{"type":"float","default_value":0,"options":{"spare":true}}},"inputs":[{"index":0,"node":"attribute1","output":"val"}],"connection_points":{"in":[{"name":"in","type":"float"}],"out":[{"name":"val","type":"float"}]}},"floatToVec2_1":{"type":"floatToVec2","inputs":[{"index":0,"node":"round1","output":"val"}]},"random1":{"type":"random","inputs":[{"index":0,"node":"floatToVec2_1","output":"vec2"}]},"multAdd9":{"type":"multAdd","params":{"value":{"type":"float","default_value":0,"options":{"spare":true}},"preAdd":{"type":"float","default_value":0,"options":{"spare":true}},"mult":{"type":"float","default_value":1,"options":{"spare":true},"raw_input":26},"postAdd":{"type":"float","default_value":0,"options":{"spare":true}}},"inputs":[{"index":0,"node":"random1","output":"rand"}],"connection_points":{"in":[{"name":"value","type":"float"},{"name":"preAdd","type":"float"},{"name":"mult","type":"float"},{"name":"postAdd","type":"float"}],"out":[{"name":"val","type":"float"}]}},"round2":{"type":"round","params":{"in":{"type":"float","default_value":0,"options":{"spare":true}}},"inputs":[{"index":0,"node":"multAdd9","output":"val"}],"connection_points":{"in":[{"name":"in","type":"float"}],"out":[{"name":"val","type":"float"}]}},"multAdd10":{"type":"multAdd","params":{"value":{"type":"float","default_value":0,"options":{"spare":true}},"preAdd":{"type":"float","default_value":0,"options":{"spare":true},"raw_input":1},"mult":{"type":"float","default_value":1,"options":{"spare":true},"raw_input":-100},"postAdd":{"type":"float","default_value":0,"options":{"spare":true}}},"inputs":[{"index":0,"node":"round2","output":"val"}],"connection_points":{"in":[{"name":"value","type":"float"},{"name":"preAdd","type":"float"},{"name":"mult","type":"float"},{"name":"postAdd","type":"float"}],"out":[{"name":"val","type":"float"}]}},"floatToVec3_1":{"type":"floatToVec3","inputs":[null,null,{"index":2,"node":"multAdd10","output":"val"}]},"attribute2":{"type":"attribute","params":{"name":"instancePosition","type":2},"connection_points":{"in":[],"out":[{"name":"val","type":"vec3"}]}},"add1":{"type":"add","params":{"add0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true}},"add1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true}},"add2":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true}}},"maxInputsCount":3,"inputs":[{"index":0,"node":"attribute2","output":"val"},{"index":1,"node":"floatToVec3_1","output":"vec3"}],"connection_points":{"in":[{"name":"add0","type":"vec3"},{"name":"add1","type":"vec3"},{"name":"add2","type":"vec3"}],"out":[{"name":"sum","type":"vec3"}]}},"attribute3":{"type":"attribute","params":{"name":"id"},"connection_points":{"in":[],"out":[{"name":"val","type":"float"}]}},"round3":{"type":"round","params":{"in":{"type":"float","default_value":0,"options":{"spare":true}}},"inputs":[{"index":0,"node":"attribute3","output":"val"}],"connection_points":{"in":[{"name":"in","type":"float"}],"out":[{"name":"val","type":"float"}]}},"floatToVec2_2":{"type":"floatToVec2","params":{"y":55.032},"inputs":[{"index":0,"node":"round3","output":"val"}]},"random2":{"type":"random","inputs":[{"index":0,"node":"floatToVec2_2","output":"vec2"}]},"floatToVec3_2":{"type":"floatToVec3","params":{"y":0.96,"z":0.6},"inputs":[{"index":0,"node":"random2","output":"rand"}]},"hsvToRgb1":{"type":"hsvToRgb","inputs":[{"index":0,"node":"floatToVec3_2","output":"vec3"}]},"attribute4":{"type":"attribute","params":{"name":"id"},"connection_points":{"in":[],"out":[{"name":"val","type":"float"}]}},"round4":{"type":"round","params":{"in":{"type":"float","default_value":0,"options":{"spare":true}}},"inputs":[{"index":0,"node":"attribute4","output":"val"}],"connection_points":{"in":[{"name":"in","type":"float"}],"out":[{"name":"val","type":"float"}]}},"floatToVec2_3":{"type":"floatToVec2","params":{"y":64.032},"inputs":[{"index":0,"node":"round4","output":"val"}]},"random3":{"type":"random","inputs":[{"index":0,"node":"floatToVec2_3","output":"vec2"}]},"null2":{"type":"null","params":{"in":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true}}},"inputs":[{"index":0,"node":"add2","output":"sum"}],"connection_points":{"in":[{"name":"in","type":"vec3"}],"out":[{"name":"val","type":"vec3"}]}},"add2":{"type":"add","params":{"add0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true}},"add1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true}},"add2":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true}}},"maxInputsCount":3,"inputs":[{"index":0,"node":"floatToVec3_1","output":"vec3"},{"index":1,"node":"globals1","output":"position"}],"connection_points":{"in":[{"name":"add0","type":"vec3"},{"name":"add1","type":"vec3"},{"name":"add2","type":"vec3"}],"out":[{"name":"sum","type":"vec3"}]}},"constant2":{"type":"constant","params":{"type":4,"vec3":[0,0.2,-0.5]},"connection_points":{"in":[],"out":[{"name":"val","type":"vec3"}]}},"multAdd11":{"type":"multAdd","params":{"value":{"type":"float","default_value":0,"options":{"spare":true}},"preAdd":{"type":"float","default_value":0,"options":{"spare":true}},"mult":{"type":"float","default_value":1,"options":{"spare":true},"raw_input":-4},"postAdd":{"type":"float","default_value":0,"options":{"spare":true}}},"inputs":[{"index":0,"node":"random3","output":"rand"}],"connection_points":{"in":[{"name":"value","type":"float"},{"name":"preAdd","type":"float"},{"name":"mult","type":"float"},{"name":"postAdd","type":"float"}],"out":[{"name":"val","type":"float"}]}},"multAdd12":{"type":"multAdd","params":{"value":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true}},"preAdd":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true},"raw_input":[0,0,8.4]},"mult":{"type":"vector3","default_value":[1,1,1],"options":{"spare":true}},"postAdd":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true}}},"inputs":[{"index":0,"node":"rotate1","output":"val"}],"connection_points":{"in":[{"name":"value","type":"vec3"},{"name":"preAdd","type":"vec3"},{"name":"mult","type":"vec3"},{"name":"postAdd","type":"vec3"}],"out":[{"name":"val","type":"vec3"}]}}},"selection":["multAdd12"],"persisted_config":{"material":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/geo1/MAT/meshBasicBuilder1-main","type":"ShaderMaterial","name":"/geo1/MAT/meshBasicBuilder1","depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"glslVersion":null,"uniforms":{"diffuse":{"type":"c","value":15658734},"opacity":{"value":1},"map":{"value":null},"uvTransform":{"type":"m3","value":[1,0,0,0,1,0,0,0,1]},"uv2Transform":{"type":"m3","value":[1,0,0,0,1,0,0,0,1]},"alphaMap":{"value":null},"specularMap":{"value":null},"envMap":{"value":null},"flipEnvMap":{"value":-1},"reflectivity":{"value":1},"refractionRatio":{"value":0.98},"maxMipLevel":{"value":0},"aoMap":{"value":null},"aoMapIntensity":{"value":1},"lightMap":{"value":null},"lightMapIntensity":{"value":1},"fogDensity":{"value":0.00025},"fogNear":{"value":1},"fogFar":{"value":2000},"fogColor":{"type":"c","value":16777215},"time":{"value":0}},"vertexShader":"\n#include <common>\n\n\n\n// /geo1/MAT/meshBasicBuilder1/easing1\nfloat quadraticInOut(float t) {\n float p = 2.0 * t * t;\n return t < 0.5 ? p : -p + (4.0 * t) - 1.0;\n}\n\n\n\n// /geo1/MAT/meshBasicBuilder1/easing2\nfloat quadraticOut(float t) {\n return -t * (t - 2.0);\n}\n\n\n\n// /geo1/MAT/meshBasicBuilder1/rotate1\n\n\n// https://github.com/mattatz/ShibuyaCrowd/blob/master/source/shaders/common/quaternion.glsl\nvec4 quatMult(vec4 q1, vec4 q2)\n{\n\treturn vec4(\n\tq1.w * q2.x + q1.x * q2.w + q1.z * q2.y - q1.y * q2.z,\n\tq1.w * q2.y + q1.y * q2.w + q1.x * q2.z - q1.z * q2.x,\n\tq1.w * q2.z + q1.z * q2.w + q1.y * q2.x - q1.x * q2.y,\n\tq1.w * q2.w - q1.x * q2.x - q1.y * q2.y - q1.z * q2.z\n\t);\n}\n// http://glmatrix.net/docs/quat.js.html#line97\n// let ax = a[0], ay = a[1], az = a[2], aw = a[3];\n\n// let bx = b[0], by = b[1], bz = b[2], bw = b[3];\n\n// out[0] = ax * bw + aw * bx + ay * bz - az * by;\n\n// out[1] = ay * bw + aw * by + az * bx - ax * bz;\n\n// out[2] = az * bw + aw * bz + ax * by - ay * bx;\n\n// out[3] = aw * bw - ax * bx - ay * by - az * bz;\n\n// return out\n\n\n\n// http://www.neilmendoza.com/glsl-rotation-about-an-arbitrary-axis/\nmat4 rotationMatrix(vec3 axis, float angle)\n{\n\taxis = normalize(axis);\n\tfloat s = sin(angle);\n\tfloat c = cos(angle);\n\tfloat oc = 1.0 - c;\n\n \treturn mat4(oc * axis.x * axis.x + c, oc * axis.x * axis.y - axis.z * s, oc * axis.z * axis.x + axis.y * s, 0.0, oc * axis.x * axis.y + axis.z * s, oc * axis.y * axis.y + c, oc * axis.y * axis.z - axis.x * s, 0.0, oc * axis.z * axis.x - axis.y * s, oc * axis.y * axis.z + axis.x * s, oc * axis.z * axis.z + c, 0.0, 0.0, 0.0, 0.0, 1.0);\n}\n\n// https://www.geeks3d.com/20141201/how-to-rotate-a-vertex-by-a-quaternion-in-glsl/\nvec4 quatFromAxisAngle(vec3 axis, float angle)\n{\n\tvec4 qr;\n\tfloat half_angle = (angle * 0.5); // * 3.14159 / 180.0;\n\tfloat sin_half_angle = sin(half_angle);\n\tqr.x = axis.x * sin_half_angle;\n\tqr.y = axis.y * sin_half_angle;\n\tqr.z = axis.z * sin_half_angle;\n\tqr.w = cos(half_angle);\n\treturn qr;\n}\nvec3 rotateWithAxisAngle(vec3 position, vec3 axis, float angle)\n{\n\tvec4 q = quatFromAxisAngle(axis, angle);\n\tvec3 v = position.xyz;\n\treturn v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);\n}\n// vec3 applyQuaternionToVector( vec4 q, vec3 v ){\n// \treturn v + 2.0 * cross( q.xyz, cross( q.xyz, v ) + q.w * v );\n// }\nvec3 rotateWithQuat( vec3 v, vec4 q )\n{\n\t// vec4 qv = multQuat( quat, vec4(vec, 0.0) );\n\t// return multQuat( qv, vec4(-quat.x, -quat.y, -quat.z, quat.w) ).xyz;\n\treturn v + 2.0 * cross( q.xyz, cross( q.xyz, v ) + q.w * v );\n}\n// https://github.com/glslify/glsl-look-at/blob/gh-pages/index.glsl\n// mat3 rotation_matrix(vec3 origin, vec3 target, float roll) {\n// \tvec3 rr = vec3(sin(roll), cos(roll), 0.0);\n// \tvec3 ww = normalize(target - origin);\n// \tvec3 uu = normalize(cross(ww, rr));\n// \tvec3 vv = normalize(cross(uu, ww));\n\n// \treturn mat3(uu, vv, ww);\n// }\n// mat3 rotation_matrix(vec3 target, float roll) {\n// \tvec3 rr = vec3(sin(roll), cos(roll), 0.0);\n// \tvec3 ww = normalize(target);\n// \tvec3 uu = normalize(cross(ww, rr));\n// \tvec3 vv = normalize(cross(uu, ww));\n\n// \treturn mat3(uu, vv, ww);\n// }\n\nfloat vectorAngle(vec3 start, vec3 dest){\n\tstart = normalize(start);\n\tdest = normalize(dest);\n\n\tfloat cosTheta = dot(start, dest);\n\tvec3 c1 = cross(start, dest);\n\t// We use the dot product of the cross with the Y axis.\n\t// This is a little arbitrary, but can still give a good sense of direction\n\tvec3 y_axis = vec3(0.0, 1.0, 0.0);\n\tfloat d1 = dot(c1, y_axis);\n\tfloat angle = acos(cosTheta) * sign(d1);\n\treturn angle;\n}\n\n// http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-17-quaternions/#i-need-an-equivalent-of-glulookat-how-do-i-orient-an-object-towards-a-point-\nvec4 vectorAlign(vec3 start, vec3 dest){\n\tstart = normalize(start);\n\tdest = normalize(dest);\n\n\tfloat cosTheta = dot(start, dest);\n\tvec3 axis;\n\n\t// if (cosTheta < -1 + 0.001f){\n\t// \t// special case when vectors in opposite directions:\n\t// \t// there is no \"ideal\" rotation axis\n\t// \t// So guess one; any will do as long as it's perpendicular to start\n\t// \taxis = cross(vec3(0.0f, 0.0f, 1.0f), start);\n\t// \tif (length2(axis) < 0.01 ) // bad luck, they were parallel, try again!\n\t// \t\taxis = cross(vec3(1.0f, 0.0f, 0.0f), start);\n\n\t// \taxis = normalize(axis);\n\t// \treturn gtx::quaternion::angleAxis(glm::radians(180.0f), axis);\n\t// }\n\tif(cosTheta > (1.0 - 0.0001) || cosTheta < (-1.0 + 0.0001) ){\n\t\taxis = normalize(cross(start, vec3(0.0, 1.0, 0.0)));\n\t\tif (length(axis) < 0.001 ){ // bad luck, they were parallel, try again!\n\t\t\taxis = normalize(cross(start, vec3(1.0, 0.0, 0.0)));\n\t\t}\n\t} else {\n\t\taxis = normalize(cross(start, dest));\n\t}\n\n\tfloat angle = acos(cosTheta);\n\n\treturn quatFromAxisAngle(axis, angle);\n}\nvec4 vectorAlignWithUp(vec3 start, vec3 dest, vec3 up){\n\tvec4 rot1 = vectorAlign(start, dest);\n\tup = normalize(up);\n\n\t// Recompute desiredUp so that it's perpendicular to the direction\n\t// You can skip that part if you really want to force desiredUp\n\t// vec3 right = normalize(cross(dest, up));\n\t// up = normalize(cross(right, dest));\n\n\t// Because of the 1rst rotation, the up is probably completely screwed up.\n\t// Find the rotation between the \"up\" of the rotated object, and the desired up\n\tvec3 newUp = rotateWithQuat(vec3(0.0, 1.0, 0.0), rot1);//rot1 * vec3(0.0, 1.0, 0.0);\n\tvec4 rot2 = vectorAlign(up, newUp);\n\n\t// return rot1;\n\treturn rot2;\n\t// return multQuat(rot1, rot2);\n\t// return rot2 * rot1;\n\n}\n\n// https://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToAngle/index.htm\nfloat quatToAngle(vec4 q){\n\treturn 2.0 * acos(q.w);\n}\nvec3 quatToAxis(vec4 q){\n\treturn vec3(\n\t\tq.x / sqrt(1.0-q.w*q.w),\n\t\tq.y / sqrt(1.0-q.w*q.w),\n\t\tq.z / sqrt(1.0-q.w*q.w)\n\t);\n}\n\nvec4 align(vec3 dir, vec3 up){\n\tvec3 start_dir = vec3(0.0, 0.0, 1.0);\n\tvec3 start_up = vec3(0.0, 1.0, 0.0);\n\tvec4 rot1 = vectorAlign(start_dir, dir);\n\tup = normalize(up);\n\n\t// Recompute desiredUp so that it's perpendicular to the direction\n\t// You can skip that part if you really want to force desiredUp\n\tvec3 right = normalize(cross(dir, up));\n\tif(length(right)<0.001){\n\t\tright = vec3(1.0, 0.0, 0.0);\n\t}\n\tup = normalize(cross(right, dir));\n\n\t// Because of the 1rst rotation, the up is probably completely screwed up.\n\t// Find the rotation between the \"up\" of the rotated object, and the desired up\n\tvec3 newUp = rotateWithQuat(start_up, rot1);//rot1 * vec3(0.0, 1.0, 0.0);\n\tvec4 rot2 = vectorAlign(normalize(newUp), up);\n\n\t// return rot1;\n\treturn quatMult(rot1, rot2);\n\t// return rot2 * rot1;\n\n}\n\n\n\n\n\n\n\n// /geo1/MAT/meshBasicBuilder1/globals1\nuniform float time;\n\n// /geo1/MAT/meshBasicBuilder1/globals1\nvarying vec3 v_POLY_globals1_position;\n\n// /geo1/MAT/meshBasicBuilder1/attribute3\nvarying float varying_v_POLY_attribute3_val;\n\n// /geo1/MAT/meshBasicBuilder1/attribute1\nattribute float id;\n\n// /geo1/MAT/meshBasicBuilder1/instanceTransform1\nattribute vec3 instancePosition;\nattribute vec4 instanceOrientation;\nattribute vec3 instanceScale;\n\n\n\n\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\n\n\n\t// /geo1/MAT/meshBasicBuilder1/attribute1\n\tfloat v_POLY_attribute1_val = id;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/globals1\n\tv_POLY_globals1_position = vec3(position);\n\tfloat v_POLY_globals1_time = time;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/attribute4\n\tfloat v_POLY_attribute4_val = id;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/attribute3\n\tvarying_v_POLY_attribute3_val = float(id);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/round1\n\tfloat v_POLY_round1_val = sign(v_POLY_attribute1_val)*floor(abs(v_POLY_attribute1_val)+0.5);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/round4\n\tfloat v_POLY_round4_val = sign(v_POLY_attribute4_val)*floor(abs(v_POLY_attribute4_val)+0.5);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/floatToVec2_1\n\tvec2 v_POLY_floatToVec2_1_vec2 = vec2(v_POLY_round1_val, 0.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/floatToVec2_3\n\tvec2 v_POLY_floatToVec2_3_vec2 = vec2(v_POLY_round4_val, 64.032);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/random1\n\tfloat v_POLY_random1_rand = rand(v_POLY_floatToVec2_1_vec2);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/random3\n\tfloat v_POLY_random3_rand = rand(v_POLY_floatToVec2_3_vec2);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd9\n\tfloat v_POLY_multAdd9_val = (26.0*(v_POLY_random1_rand + 0.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd11\n\tfloat v_POLY_multAdd11_val = (-4.0*(v_POLY_random3_rand + 0.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/round2\n\tfloat v_POLY_round2_val = sign(v_POLY_multAdd9_val)*floor(abs(v_POLY_multAdd9_val)+0.5);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd4\n\tfloat v_POLY_multAdd4_val = (3.0*(v_POLY_globals1_time + v_POLY_multAdd11_val)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd10\n\tfloat v_POLY_multAdd10_val = (-100.0*(v_POLY_round2_val + 1.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/null1\n\tfloat v_POLY_null1_val = v_POLY_multAdd4_val;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/floatToVec3_1\n\tvec3 v_POLY_floatToVec3_1_vec3 = vec3(0.0, 0.0, v_POLY_multAdd10_val);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/clamp1\n\tfloat v_POLY_clamp1_val = clamp(v_POLY_null1_val, 0.0, 1.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/clamp2\n\tfloat v_POLY_clamp2_val = clamp(v_POLY_null1_val, 1.0, 2.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd6\n\tfloat v_POLY_multAdd6_val = (1.0*(v_POLY_null1_val + -0.33)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/add2\n\tvec3 v_POLY_add2_sum = (v_POLY_floatToVec3_1_vec3 + v_POLY_globals1_position + vec3(0.0, 0.0, 0.0));\n\t\n\t// /geo1/MAT/meshBasicBuilder1/easing1\n\tfloat v_POLY_easing1_out = quadraticInOut(v_POLY_clamp1_val);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd3\n\tfloat v_POLY_multAdd3_val = (1.0*(v_POLY_clamp2_val + -1.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/clamp4\n\tfloat v_POLY_clamp4_val = clamp(v_POLY_multAdd6_val, 1.0, 2.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/null2\n\tvec3 v_POLY_null2_val = v_POLY_add2_sum;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd5\n\tfloat v_POLY_multAdd5_val = (2.0*(v_POLY_multAdd3_val + 0.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd7\n\tfloat v_POLY_multAdd7_val = (1.0*(v_POLY_clamp4_val + -1.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd1\n\tvec3 v_POLY_multAdd1_val = (vec3(2.0, 2.0, 0.5)*(v_POLY_null2_val + vec3(0.0, 0.0, 0.0))) + vec3(0.0, 0.0, 0.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd2\n\tvec3 v_POLY_multAdd2_val = (vec3(0.5, 0.5, 3.0)*(v_POLY_null2_val + vec3(0.0, 0.0, 0.0))) + vec3(0.0, 0.0, 0.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/clamp3\n\tfloat v_POLY_clamp3_val = clamp(v_POLY_multAdd5_val, 0.0, 1.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd8\n\tfloat v_POLY_multAdd8_val = (2.0*(v_POLY_multAdd7_val + 0.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/mix1\n\tvec3 v_POLY_mix1_mix = mix(v_POLY_null2_val, v_POLY_multAdd1_val, v_POLY_easing1_out);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/easing2\n\tfloat v_POLY_easing2_out = quadraticOut(v_POLY_clamp3_val);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/clamp5\n\tfloat v_POLY_clamp5_val = clamp(v_POLY_multAdd8_val, 0.0, 1.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/mix2\n\tvec3 v_POLY_mix2_mix = mix(v_POLY_mix1_mix, v_POLY_multAdd2_val, v_POLY_easing2_out);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/easing3\n\tfloat v_POLY_easing3_out = quadraticOut(v_POLY_clamp5_val);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/rotate1\n\tvec3 v_POLY_rotate1_val = rotateWithAxisAngle(v_POLY_mix2_mix, vec3(0.0, 0.0, 1.0), 1.5707963267948966);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd12\n\tvec3 v_POLY_multAdd12_val = (vec3(1.0, 1.0, 1.0)*(v_POLY_rotate1_val + vec3(0.0, 0.0, 8.4))) + vec3(0.0, 0.0, 0.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/mix3\n\tvec3 v_POLY_mix3_mix = mix(v_POLY_mix2_mix, v_POLY_multAdd12_val, v_POLY_easing3_out);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/instanceTransform1\n\tvec3 v_POLY_instanceTransform1_position = vec3(v_POLY_mix3_mix);\n\tv_POLY_instanceTransform1_position *= instanceScale;\n\tv_POLY_instanceTransform1_position = rotateWithQuat( v_POLY_instanceTransform1_position, instanceOrientation );\n\tv_POLY_instanceTransform1_position += instancePosition;\n\tvec3 v_POLY_instanceTransform1_normal = vec3(normal);\n\tv_POLY_instanceTransform1_normal = rotateWithQuat( v_POLY_instanceTransform1_normal, instanceOrientation );\n\t\n\t// /geo1/MAT/meshBasicBuilder1/output1\n\tvec3 transformed = v_POLY_instanceTransform1_position;\n\tvec3 objectNormal = v_POLY_instanceTransform1_normal;\n\t#ifdef USE_TANGENT\n\t\tvec3 objectTangent = vec3( tangent.xyz );\n\t#endif\n\n\n\n\t#include <skinbase_vertex>\n\n\t#ifdef USE_ENVMAP\n\n// removed:\n//\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\n\t#endif\n\n// removed:\n//\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n\n}\n","fragmentShader":"\nuniform vec3 diffuse;\nuniform float opacity;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n\n#include <common>\n\n\n\n// /geo1/MAT/meshBasicBuilder1/hsvToRgb1\n// https://github.com/hughsk/glsl-hsv2rgb\n// https://stackoverflow.com/questions/15095909/from-rgb-to-hsv-in-opengl-glsl\nvec3 hsv2rgb(vec3 c) {\n\tvec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n\tvec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n\treturn c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\n\n\n\n\n\n\n// /geo1/MAT/meshBasicBuilder1/attribute3\nvarying float varying_v_POLY_attribute3_val;\n\n\n\n\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\n\n\t// /geo1/MAT/meshBasicBuilder1/attribute3\n\tfloat v_POLY_attribute3_val = varying_v_POLY_attribute3_val;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/round3\n\tfloat v_POLY_round3_val = sign(v_POLY_attribute3_val)*floor(abs(v_POLY_attribute3_val)+0.5);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/floatToVec2_2\n\tvec2 v_POLY_floatToVec2_2_vec2 = vec2(v_POLY_round3_val, 55.032);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/random2\n\tfloat v_POLY_random2_rand = rand(v_POLY_floatToVec2_2_vec2);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/floatToVec3_2\n\tvec3 v_POLY_floatToVec3_2_vec3 = vec3(v_POLY_random2_rand, 0.96, 0.6);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/hsvToRgb1\n\tvec3 v_POLY_hsvToRgb1_rgb = hsv2rgb(v_POLY_floatToVec3_2_vec3);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/output1\n\tdiffuseColor.xyz = v_POLY_hsvToRgb1_rgb;\n\n\n\n\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\n\t// accumulation (baked indirect lighting only)\n\t#ifdef USE_LIGHTMAP\n\t\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\n\t#else\n\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\n\t#endif\n\n\t// modulation\n\t#include <aomap_fragment>\n\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\n\t#include <envmap_fragment>\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n\n}\n","shadowSide":null,"lights":false},"uniforms_time_dependent":true,"uniforms_resolution_dependent":false,"param_uniform_pairs":[],"customMaterials":{"customDistanceMaterial":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/geo1/MAT/meshBasicBuilder1-customDistanceMaterial","type":"ShaderMaterial","name":"customDistanceMaterial","depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"glslVersion":null,"uniforms":{"diffuse":{"type":"c","value":15658734},"opacity":{"value":1},"map":{"value":null},"uvTransform":{"type":"m3","value":[1,0,0,0,1,0,0,0,1]},"uv2Transform":{"type":"m3","value":[1,0,0,0,1,0,0,0,1]},"alphaMap":{"value":null},"displacementMap":{"value":null},"displacementScale":{"value":1},"displacementBias":{"value":0},"referencePosition":{"type":"v3","value":[0,0,0]},"nearDistance":{"value":1},"farDistance":{"value":1000}},"defines":{"DEPTH_PACKING":3201},"vertexShader":"\n#define DISTANCE\n\nvarying vec3 vWorldPosition;\n\n#include <common>\n\n\n\n// /geo1/MAT/meshBasicBuilder1/easing1\nfloat quadraticInOut(float t) {\n float p = 2.0 * t * t;\n return t < 0.5 ? p : -p + (4.0 * t) - 1.0;\n}\n\n\n\n// /geo1/MAT/meshBasicBuilder1/easing2\nfloat quadraticOut(float t) {\n return -t * (t - 2.0);\n}\n\n\n\n// /geo1/MAT/meshBasicBuilder1/rotate1\n\n\n// https://github.com/mattatz/ShibuyaCrowd/blob/master/source/shaders/common/quaternion.glsl\nvec4 quatMult(vec4 q1, vec4 q2)\n{\n\treturn vec4(\n\tq1.w * q2.x + q1.x * q2.w + q1.z * q2.y - q1.y * q2.z,\n\tq1.w * q2.y + q1.y * q2.w + q1.x * q2.z - q1.z * q2.x,\n\tq1.w * q2.z + q1.z * q2.w + q1.y * q2.x - q1.x * q2.y,\n\tq1.w * q2.w - q1.x * q2.x - q1.y * q2.y - q1.z * q2.z\n\t);\n}\n// http://glmatrix.net/docs/quat.js.html#line97\n// let ax = a[0], ay = a[1], az = a[2], aw = a[3];\n\n// let bx = b[0], by = b[1], bz = b[2], bw = b[3];\n\n// out[0] = ax * bw + aw * bx + ay * bz - az * by;\n\n// out[1] = ay * bw + aw * by + az * bx - ax * bz;\n\n// out[2] = az * bw + aw * bz + ax * by - ay * bx;\n\n// out[3] = aw * bw - ax * bx - ay * by - az * bz;\n\n// return out\n\n\n\n// http://www.neilmendoza.com/glsl-rotation-about-an-arbitrary-axis/\nmat4 rotationMatrix(vec3 axis, float angle)\n{\n\taxis = normalize(axis);\n\tfloat s = sin(angle);\n\tfloat c = cos(angle);\n\tfloat oc = 1.0 - c;\n\n \treturn mat4(oc * axis.x * axis.x + c, oc * axis.x * axis.y - axis.z * s, oc * axis.z * axis.x + axis.y * s, 0.0, oc * axis.x * axis.y + axis.z * s, oc * axis.y * axis.y + c, oc * axis.y * axis.z - axis.x * s, 0.0, oc * axis.z * axis.x - axis.y * s, oc * axis.y * axis.z + axis.x * s, oc * axis.z * axis.z + c, 0.0, 0.0, 0.0, 0.0, 1.0);\n}\n\n// https://www.geeks3d.com/20141201/how-to-rotate-a-vertex-by-a-quaternion-in-glsl/\nvec4 quatFromAxisAngle(vec3 axis, float angle)\n{\n\tvec4 qr;\n\tfloat half_angle = (angle * 0.5); // * 3.14159 / 180.0;\n\tfloat sin_half_angle = sin(half_angle);\n\tqr.x = axis.x * sin_half_angle;\n\tqr.y = axis.y * sin_half_angle;\n\tqr.z = axis.z * sin_half_angle;\n\tqr.w = cos(half_angle);\n\treturn qr;\n}\nvec3 rotateWithAxisAngle(vec3 position, vec3 axis, float angle)\n{\n\tvec4 q = quatFromAxisAngle(axis, angle);\n\tvec3 v = position.xyz;\n\treturn v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);\n}\n// vec3 applyQuaternionToVector( vec4 q, vec3 v ){\n// \treturn v + 2.0 * cross( q.xyz, cross( q.xyz, v ) + q.w * v );\n// }\nvec3 rotateWithQuat( vec3 v, vec4 q )\n{\n\t// vec4 qv = multQuat( quat, vec4(vec, 0.0) );\n\t// return multQuat( qv, vec4(-quat.x, -quat.y, -quat.z, quat.w) ).xyz;\n\treturn v + 2.0 * cross( q.xyz, cross( q.xyz, v ) + q.w * v );\n}\n// https://github.com/glslify/glsl-look-at/blob/gh-pages/index.glsl\n// mat3 rotation_matrix(vec3 origin, vec3 target, float roll) {\n// \tvec3 rr = vec3(sin(roll), cos(roll), 0.0);\n// \tvec3 ww = normalize(target - origin);\n// \tvec3 uu = normalize(cross(ww, rr));\n// \tvec3 vv = normalize(cross(uu, ww));\n\n// \treturn mat3(uu, vv, ww);\n// }\n// mat3 rotation_matrix(vec3 target, float roll) {\n// \tvec3 rr = vec3(sin(roll), cos(roll), 0.0);\n// \tvec3 ww = normalize(target);\n// \tvec3 uu = normalize(cross(ww, rr));\n// \tvec3 vv = normalize(cross(uu, ww));\n\n// \treturn mat3(uu, vv, ww);\n// }\n\nfloat vectorAngle(vec3 start, vec3 dest){\n\tstart = normalize(start);\n\tdest = normalize(dest);\n\n\tfloat cosTheta = dot(start, dest);\n\tvec3 c1 = cross(start, dest);\n\t// We use the dot product of the cross with the Y axis.\n\t// This is a little arbitrary, but can still give a good sense of direction\n\tvec3 y_axis = vec3(0.0, 1.0, 0.0);\n\tfloat d1 = dot(c1, y_axis);\n\tfloat angle = acos(cosTheta) * sign(d1);\n\treturn angle;\n}\n\n// http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-17-quaternions/#i-need-an-equivalent-of-glulookat-how-do-i-orient-an-object-towards-a-point-\nvec4 vectorAlign(vec3 start, vec3 dest){\n\tstart = normalize(start);\n\tdest = normalize(dest);\n\n\tfloat cosTheta = dot(start, dest);\n\tvec3 axis;\n\n\t// if (cosTheta < -1 + 0.001f){\n\t// \t// special case when vectors in opposite directions:\n\t// \t// there is no \"ideal\" rotation axis\n\t// \t// So guess one; any will do as long as it's perpendicular to start\n\t// \taxis = cross(vec3(0.0f, 0.0f, 1.0f), start);\n\t// \tif (length2(axis) < 0.01 ) // bad luck, they were parallel, try again!\n\t// \t\taxis = cross(vec3(1.0f, 0.0f, 0.0f), start);\n\n\t// \taxis = normalize(axis);\n\t// \treturn gtx::quaternion::angleAxis(glm::radians(180.0f), axis);\n\t// }\n\tif(cosTheta > (1.0 - 0.0001) || cosTheta < (-1.0 + 0.0001) ){\n\t\taxis = normalize(cross(start, vec3(0.0, 1.0, 0.0)));\n\t\tif (length(axis) < 0.001 ){ // bad luck, they were parallel, try again!\n\t\t\taxis = normalize(cross(start, vec3(1.0, 0.0, 0.0)));\n\t\t}\n\t} else {\n\t\taxis = normalize(cross(start, dest));\n\t}\n\n\tfloat angle = acos(cosTheta);\n\n\treturn quatFromAxisAngle(axis, angle);\n}\nvec4 vectorAlignWithUp(vec3 start, vec3 dest, vec3 up){\n\tvec4 rot1 = vectorAlign(start, dest);\n\tup = normalize(up);\n\n\t// Recompute desiredUp so that it's perpendicular to the direction\n\t// You can skip that part if you really want to force desiredUp\n\t// vec3 right = normalize(cross(dest, up));\n\t// up = normalize(cross(right, dest));\n\n\t// Because of the 1rst rotation, the up is probably completely screwed up.\n\t// Find the rotation between the \"up\" of the rotated object, and the desired up\n\tvec3 newUp = rotateWithQuat(vec3(0.0, 1.0, 0.0), rot1);//rot1 * vec3(0.0, 1.0, 0.0);\n\tvec4 rot2 = vectorAlign(up, newUp);\n\n\t// return rot1;\n\treturn rot2;\n\t// return multQuat(rot1, rot2);\n\t// return rot2 * rot1;\n\n}\n\n// https://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToAngle/index.htm\nfloat quatToAngle(vec4 q){\n\treturn 2.0 * acos(q.w);\n}\nvec3 quatToAxis(vec4 q){\n\treturn vec3(\n\t\tq.x / sqrt(1.0-q.w*q.w),\n\t\tq.y / sqrt(1.0-q.w*q.w),\n\t\tq.z / sqrt(1.0-q.w*q.w)\n\t);\n}\n\nvec4 align(vec3 dir, vec3 up){\n\tvec3 start_dir = vec3(0.0, 0.0, 1.0);\n\tvec3 start_up = vec3(0.0, 1.0, 0.0);\n\tvec4 rot1 = vectorAlign(start_dir, dir);\n\tup = normalize(up);\n\n\t// Recompute desiredUp so that it's perpendicular to the direction\n\t// You can skip that part if you really want to force desiredUp\n\tvec3 right = normalize(cross(dir, up));\n\tif(length(right)<0.001){\n\t\tright = vec3(1.0, 0.0, 0.0);\n\t}\n\tup = normalize(cross(right, dir));\n\n\t// Because of the 1rst rotation, the up is probably completely screwed up.\n\t// Find the rotation between the \"up\" of the rotated object, and the desired up\n\tvec3 newUp = rotateWithQuat(start_up, rot1);//rot1 * vec3(0.0, 1.0, 0.0);\n\tvec4 rot2 = vectorAlign(normalize(newUp), up);\n\n\t// return rot1;\n\treturn quatMult(rot1, rot2);\n\t// return rot2 * rot1;\n\n}\n\n\n\n\n\n\n\n// /geo1/MAT/meshBasicBuilder1/globals1\nuniform float time;\n\n// /geo1/MAT/meshBasicBuilder1/globals1\nvarying vec3 v_POLY_globals1_position;\n\n// /geo1/MAT/meshBasicBuilder1/attribute3\nvarying float varying_v_POLY_attribute3_val;\n\n// /geo1/MAT/meshBasicBuilder1/attribute1\nattribute float id;\n\n// /geo1/MAT/meshBasicBuilder1/instanceTransform1\nattribute vec3 instancePosition;\nattribute vec4 instanceOrientation;\nattribute vec3 instanceScale;\n\n\n\n\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\n\t#include <skinbase_vertex>\n\n\t#ifdef USE_DISPLACEMENTMAP\n\n// removed:\n//\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\n\t#endif\n\n// removed:\n//\t#include <begin_vertex>\n\n\n\n\t// /geo1/MAT/meshBasicBuilder1/attribute1\n\tfloat v_POLY_attribute1_val = id;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/globals1\n\tv_POLY_globals1_position = vec3(position);\n\tfloat v_POLY_globals1_time = time;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/attribute4\n\tfloat v_POLY_attribute4_val = id;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/attribute3\n\tvarying_v_POLY_attribute3_val = float(id);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/round1\n\tfloat v_POLY_round1_val = sign(v_POLY_attribute1_val)*floor(abs(v_POLY_attribute1_val)+0.5);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/round4\n\tfloat v_POLY_round4_val = sign(v_POLY_attribute4_val)*floor(abs(v_POLY_attribute4_val)+0.5);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/floatToVec2_1\n\tvec2 v_POLY_floatToVec2_1_vec2 = vec2(v_POLY_round1_val, 0.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/floatToVec2_3\n\tvec2 v_POLY_floatToVec2_3_vec2 = vec2(v_POLY_round4_val, 64.032);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/random1\n\tfloat v_POLY_random1_rand = rand(v_POLY_floatToVec2_1_vec2);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/random3\n\tfloat v_POLY_random3_rand = rand(v_POLY_floatToVec2_3_vec2);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd9\n\tfloat v_POLY_multAdd9_val = (26.0*(v_POLY_random1_rand + 0.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd11\n\tfloat v_POLY_multAdd11_val = (-4.0*(v_POLY_random3_rand + 0.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/round2\n\tfloat v_POLY_round2_val = sign(v_POLY_multAdd9_val)*floor(abs(v_POLY_multAdd9_val)+0.5);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd4\n\tfloat v_POLY_multAdd4_val = (3.0*(v_POLY_globals1_time + v_POLY_multAdd11_val)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd10\n\tfloat v_POLY_multAdd10_val = (-100.0*(v_POLY_round2_val + 1.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/null1\n\tfloat v_POLY_null1_val = v_POLY_multAdd4_val;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/floatToVec3_1\n\tvec3 v_POLY_floatToVec3_1_vec3 = vec3(0.0, 0.0, v_POLY_multAdd10_val);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/clamp1\n\tfloat v_POLY_clamp1_val = clamp(v_POLY_null1_val, 0.0, 1.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/clamp2\n\tfloat v_POLY_clamp2_val = clamp(v_POLY_null1_val, 1.0, 2.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd6\n\tfloat v_POLY_multAdd6_val = (1.0*(v_POLY_null1_val + -0.33)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/add2\n\tvec3 v_POLY_add2_sum = (v_POLY_floatToVec3_1_vec3 + v_POLY_globals1_position + vec3(0.0, 0.0, 0.0));\n\t\n\t// /geo1/MAT/meshBasicBuilder1/easing1\n\tfloat v_POLY_easing1_out = quadraticInOut(v_POLY_clamp1_val);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd3\n\tfloat v_POLY_multAdd3_val = (1.0*(v_POLY_clamp2_val + -1.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/clamp4\n\tfloat v_POLY_clamp4_val = clamp(v_POLY_multAdd6_val, 1.0, 2.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/null2\n\tvec3 v_POLY_null2_val = v_POLY_add2_sum;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd5\n\tfloat v_POLY_multAdd5_val = (2.0*(v_POLY_multAdd3_val + 0.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd7\n\tfloat v_POLY_multAdd7_val = (1.0*(v_POLY_clamp4_val + -1.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd1\n\tvec3 v_POLY_multAdd1_val = (vec3(2.0, 2.0, 0.5)*(v_POLY_null2_val + vec3(0.0, 0.0, 0.0))) + vec3(0.0, 0.0, 0.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd2\n\tvec3 v_POLY_multAdd2_val = (vec3(0.5, 0.5, 3.0)*(v_POLY_null2_val + vec3(0.0, 0.0, 0.0))) + vec3(0.0, 0.0, 0.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/clamp3\n\tfloat v_POLY_clamp3_val = clamp(v_POLY_multAdd5_val, 0.0, 1.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd8\n\tfloat v_POLY_multAdd8_val = (2.0*(v_POLY_multAdd7_val + 0.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/mix1\n\tvec3 v_POLY_mix1_mix = mix(v_POLY_null2_val, v_POLY_multAdd1_val, v_POLY_easing1_out);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/easing2\n\tfloat v_POLY_easing2_out = quadraticOut(v_POLY_clamp3_val);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/clamp5\n\tfloat v_POLY_clamp5_val = clamp(v_POLY_multAdd8_val, 0.0, 1.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/mix2\n\tvec3 v_POLY_mix2_mix = mix(v_POLY_mix1_mix, v_POLY_multAdd2_val, v_POLY_easing2_out);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/easing3\n\tfloat v_POLY_easing3_out = quadraticOut(v_POLY_clamp5_val);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/rotate1\n\tvec3 v_POLY_rotate1_val = rotateWithAxisAngle(v_POLY_mix2_mix, vec3(0.0, 0.0, 1.0), 1.5707963267948966);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd12\n\tvec3 v_POLY_multAdd12_val = (vec3(1.0, 1.0, 1.0)*(v_POLY_rotate1_val + vec3(0.0, 0.0, 8.4))) + vec3(0.0, 0.0, 0.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/mix3\n\tvec3 v_POLY_mix3_mix = mix(v_POLY_mix2_mix, v_POLY_multAdd12_val, v_POLY_easing3_out);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/instanceTransform1\n\tvec3 v_POLY_instanceTransform1_position = vec3(v_POLY_mix3_mix);\n\tv_POLY_instanceTransform1_position *= instanceScale;\n\tv_POLY_instanceTransform1_position = rotateWithQuat( v_POLY_instanceTransform1_position, instanceOrientation );\n\tv_POLY_instanceTransform1_position += instancePosition;\n\tvec3 v_POLY_instanceTransform1_normal = vec3(normal);\n\tv_POLY_instanceTransform1_normal = rotateWithQuat( v_POLY_instanceTransform1_normal, instanceOrientation );\n\t\n\t// /geo1/MAT/meshBasicBuilder1/output1\n\tvec3 transformed = v_POLY_instanceTransform1_position;\n\tvec3 objectNormal = v_POLY_instanceTransform1_normal;\n\t#ifdef USE_TANGENT\n\t\tvec3 objectTangent = vec3( tangent.xyz );\n\t#endif\n\n\n\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\n\tvWorldPosition = worldPosition.xyz;\n\n}\n","fragmentShader":"\n#define DISTANCE\n\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n\n#include <common>\n\n\n\n// /geo1/MAT/meshBasicBuilder1/hsvToRgb1\n// https://github.com/hughsk/glsl-hsv2rgb\n// https://stackoverflow.com/questions/15095909/from-rgb-to-hsv-in-opengl-glsl\nvec3 hsv2rgb(vec3 c) {\n\tvec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n\tvec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n\treturn c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\n\n\n\n\n\n\n// /geo1/MAT/meshBasicBuilder1/attribute3\nvarying float varying_v_POLY_attribute3_val;\n\n\n\n\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main () {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( 1.0 );\n\n\n\n\t// /geo1/MAT/meshBasicBuilder1/attribute3\n\tfloat v_POLY_attribute3_val = varying_v_POLY_attribute3_val;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/round3\n\tfloat v_POLY_round3_val = sign(v_POLY_attribute3_val)*floor(abs(v_POLY_attribute3_val)+0.5);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/floatToVec2_2\n\tvec2 v_POLY_floatToVec2_2_vec2 = vec2(v_POLY_round3_val, 55.032);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/random2\n\tfloat v_POLY_random2_rand = rand(v_POLY_floatToVec2_2_vec2);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/floatToVec3_2\n\tvec3 v_POLY_floatToVec3_2_vec3 = vec3(v_POLY_random2_rand, 0.96, 0.6);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/hsvToRgb1\n\tvec3 v_POLY_hsvToRgb1_rgb = hsv2rgb(v_POLY_floatToVec3_2_vec3);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/output1\n\tdiffuseColor.xyz = v_POLY_hsvToRgb1_rgb;\n\n\n\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist ); // clamp to [ 0, 1 ]\n\n\tgl_FragColor = packDepthToRGBA( dist );\n\n}\n","shadowSide":null,"lights":false},"customDepthMaterial":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/geo1/MAT/meshBasicBuilder1-customDepthMaterial","type":"ShaderMaterial","name":"customDepthMaterial","depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"glslVersion":null,"uniforms":{"diffuse":{"type":"c","value":15658734},"opacity":{"value":1},"map":{"value":null},"uvTransform":{"type":"m3","value":[1,0,0,0,1,0,0,0,1]},"uv2Transform":{"type":"m3","value":[1,0,0,0,1,0,0,0,1]},"alphaMap":{"value":null},"displacementMap":{"value":null},"displacementScale":{"value":1},"displacementBias":{"value":0}},"defines":{"DEPTH_PACKING":3201},"vertexShader":"\n#include <common>\n\n\n\n// /geo1/MAT/meshBasicBuilder1/easing1\nfloat quadraticInOut(float t) {\n float p = 2.0 * t * t;\n return t < 0.5 ? p : -p + (4.0 * t) - 1.0;\n}\n\n\n\n// /geo1/MAT/meshBasicBuilder1/easing2\nfloat quadraticOut(float t) {\n return -t * (t - 2.0);\n}\n\n\n\n// /geo1/MAT/meshBasicBuilder1/rotate1\n\n\n// https://github.com/mattatz/ShibuyaCrowd/blob/master/source/shaders/common/quaternion.glsl\nvec4 quatMult(vec4 q1, vec4 q2)\n{\n\treturn vec4(\n\tq1.w * q2.x + q1.x * q2.w + q1.z * q2.y - q1.y * q2.z,\n\tq1.w * q2.y + q1.y * q2.w + q1.x * q2.z - q1.z * q2.x,\n\tq1.w * q2.z + q1.z * q2.w + q1.y * q2.x - q1.x * q2.y,\n\tq1.w * q2.w - q1.x * q2.x - q1.y * q2.y - q1.z * q2.z\n\t);\n}\n// http://glmatrix.net/docs/quat.js.html#line97\n// let ax = a[0], ay = a[1], az = a[2], aw = a[3];\n\n// let bx = b[0], by = b[1], bz = b[2], bw = b[3];\n\n// out[0] = ax * bw + aw * bx + ay * bz - az * by;\n\n// out[1] = ay * bw + aw * by + az * bx - ax * bz;\n\n// out[2] = az * bw + aw * bz + ax * by - ay * bx;\n\n// out[3] = aw * bw - ax * bx - ay * by - az * bz;\n\n// return out\n\n\n\n// http://www.neilmendoza.com/glsl-rotation-about-an-arbitrary-axis/\nmat4 rotationMatrix(vec3 axis, float angle)\n{\n\taxis = normalize(axis);\n\tfloat s = sin(angle);\n\tfloat c = cos(angle);\n\tfloat oc = 1.0 - c;\n\n \treturn mat4(oc * axis.x * axis.x + c, oc * axis.x * axis.y - axis.z * s, oc * axis.z * axis.x + axis.y * s, 0.0, oc * axis.x * axis.y + axis.z * s, oc * axis.y * axis.y + c, oc * axis.y * axis.z - axis.x * s, 0.0, oc * axis.z * axis.x - axis.y * s, oc * axis.y * axis.z + axis.x * s, oc * axis.z * axis.z + c, 0.0, 0.0, 0.0, 0.0, 1.0);\n}\n\n// https://www.geeks3d.com/20141201/how-to-rotate-a-vertex-by-a-quaternion-in-glsl/\nvec4 quatFromAxisAngle(vec3 axis, float angle)\n{\n\tvec4 qr;\n\tfloat half_angle = (angle * 0.5); // * 3.14159 / 180.0;\n\tfloat sin_half_angle = sin(half_angle);\n\tqr.x = axis.x * sin_half_angle;\n\tqr.y = axis.y * sin_half_angle;\n\tqr.z = axis.z * sin_half_angle;\n\tqr.w = cos(half_angle);\n\treturn qr;\n}\nvec3 rotateWithAxisAngle(vec3 position, vec3 axis, float angle)\n{\n\tvec4 q = quatFromAxisAngle(axis, angle);\n\tvec3 v = position.xyz;\n\treturn v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);\n}\n// vec3 applyQuaternionToVector( vec4 q, vec3 v ){\n// \treturn v + 2.0 * cross( q.xyz, cross( q.xyz, v ) + q.w * v );\n// }\nvec3 rotateWithQuat( vec3 v, vec4 q )\n{\n\t// vec4 qv = multQuat( quat, vec4(vec, 0.0) );\n\t// return multQuat( qv, vec4(-quat.x, -quat.y, -quat.z, quat.w) ).xyz;\n\treturn v + 2.0 * cross( q.xyz, cross( q.xyz, v ) + q.w * v );\n}\n// https://github.com/glslify/glsl-look-at/blob/gh-pages/index.glsl\n// mat3 rotation_matrix(vec3 origin, vec3 target, float roll) {\n// \tvec3 rr = vec3(sin(roll), cos(roll), 0.0);\n// \tvec3 ww = normalize(target - origin);\n// \tvec3 uu = normalize(cross(ww, rr));\n// \tvec3 vv = normalize(cross(uu, ww));\n\n// \treturn mat3(uu, vv, ww);\n// }\n// mat3 rotation_matrix(vec3 target, float roll) {\n// \tvec3 rr = vec3(sin(roll), cos(roll), 0.0);\n// \tvec3 ww = normalize(target);\n// \tvec3 uu = normalize(cross(ww, rr));\n// \tvec3 vv = normalize(cross(uu, ww));\n\n// \treturn mat3(uu, vv, ww);\n// }\n\nfloat vectorAngle(vec3 start, vec3 dest){\n\tstart = normalize(start);\n\tdest = normalize(dest);\n\n\tfloat cosTheta = dot(start, dest);\n\tvec3 c1 = cross(start, dest);\n\t// We use the dot product of the cross with the Y axis.\n\t// This is a little arbitrary, but can still give a good sense of direction\n\tvec3 y_axis = vec3(0.0, 1.0, 0.0);\n\tfloat d1 = dot(c1, y_axis);\n\tfloat angle = acos(cosTheta) * sign(d1);\n\treturn angle;\n}\n\n// http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-17-quaternions/#i-need-an-equivalent-of-glulookat-how-do-i-orient-an-object-towards-a-point-\nvec4 vectorAlign(vec3 start, vec3 dest){\n\tstart = normalize(start);\n\tdest = normalize(dest);\n\n\tfloat cosTheta = dot(start, dest);\n\tvec3 axis;\n\n\t// if (cosTheta < -1 + 0.001f){\n\t// \t// special case when vectors in opposite directions:\n\t// \t// there is no \"ideal\" rotation axis\n\t// \t// So guess one; any will do as long as it's perpendicular to start\n\t// \taxis = cross(vec3(0.0f, 0.0f, 1.0f), start);\n\t// \tif (length2(axis) < 0.01 ) // bad luck, they were parallel, try again!\n\t// \t\taxis = cross(vec3(1.0f, 0.0f, 0.0f), start);\n\n\t// \taxis = normalize(axis);\n\t// \treturn gtx::quaternion::angleAxis(glm::radians(180.0f), axis);\n\t// }\n\tif(cosTheta > (1.0 - 0.0001) || cosTheta < (-1.0 + 0.0001) ){\n\t\taxis = normalize(cross(start, vec3(0.0, 1.0, 0.0)));\n\t\tif (length(axis) < 0.001 ){ // bad luck, they were parallel, try again!\n\t\t\taxis = normalize(cross(start, vec3(1.0, 0.0, 0.0)));\n\t\t}\n\t} else {\n\t\taxis = normalize(cross(start, dest));\n\t}\n\n\tfloat angle = acos(cosTheta);\n\n\treturn quatFromAxisAngle(axis, angle);\n}\nvec4 vectorAlignWithUp(vec3 start, vec3 dest, vec3 up){\n\tvec4 rot1 = vectorAlign(start, dest);\n\tup = normalize(up);\n\n\t// Recompute desiredUp so that it's perpendicular to the direction\n\t// You can skip that part if you really want to force desiredUp\n\t// vec3 right = normalize(cross(dest, up));\n\t// up = normalize(cross(right, dest));\n\n\t// Because of the 1rst rotation, the up is probably completely screwed up.\n\t// Find the rotation between the \"up\" of the rotated object, and the desired up\n\tvec3 newUp = rotateWithQuat(vec3(0.0, 1.0, 0.0), rot1);//rot1 * vec3(0.0, 1.0, 0.0);\n\tvec4 rot2 = vectorAlign(up, newUp);\n\n\t// return rot1;\n\treturn rot2;\n\t// return multQuat(rot1, rot2);\n\t// return rot2 * rot1;\n\n}\n\n// https://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToAngle/index.htm\nfloat quatToAngle(vec4 q){\n\treturn 2.0 * acos(q.w);\n}\nvec3 quatToAxis(vec4 q){\n\treturn vec3(\n\t\tq.x / sqrt(1.0-q.w*q.w),\n\t\tq.y / sqrt(1.0-q.w*q.w),\n\t\tq.z / sqrt(1.0-q.w*q.w)\n\t);\n}\n\nvec4 align(vec3 dir, vec3 up){\n\tvec3 start_dir = vec3(0.0, 0.0, 1.0);\n\tvec3 start_up = vec3(0.0, 1.0, 0.0);\n\tvec4 rot1 = vectorAlign(start_dir, dir);\n\tup = normalize(up);\n\n\t// Recompute desiredUp so that it's perpendicular to the direction\n\t// You can skip that part if you really want to force desiredUp\n\tvec3 right = normalize(cross(dir, up));\n\tif(length(right)<0.001){\n\t\tright = vec3(1.0, 0.0, 0.0);\n\t}\n\tup = normalize(cross(right, dir));\n\n\t// Because of the 1rst rotation, the up is probably completely screwed up.\n\t// Find the rotation between the \"up\" of the rotated object, and the desired up\n\tvec3 newUp = rotateWithQuat(start_up, rot1);//rot1 * vec3(0.0, 1.0, 0.0);\n\tvec4 rot2 = vectorAlign(normalize(newUp), up);\n\n\t// return rot1;\n\treturn quatMult(rot1, rot2);\n\t// return rot2 * rot1;\n\n}\n\n\n\n\n\n\n\n// /geo1/MAT/meshBasicBuilder1/globals1\nuniform float time;\n\n// /geo1/MAT/meshBasicBuilder1/globals1\nvarying vec3 v_POLY_globals1_position;\n\n// /geo1/MAT/meshBasicBuilder1/attribute3\nvarying float varying_v_POLY_attribute3_val;\n\n// /geo1/MAT/meshBasicBuilder1/attribute1\nattribute float id;\n\n// /geo1/MAT/meshBasicBuilder1/instanceTransform1\nattribute vec3 instancePosition;\nattribute vec4 instanceOrientation;\nattribute vec3 instanceScale;\n\n\n\n\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\n// This is used for computing an equivalent of gl_FragCoord.z that is as high precision as possible.\n// Some platforms compute gl_FragCoord at a lower precision which makes the manually computed value better for\n// depth-based postprocessing effects. Reproduced on iPad with A10 processor / iPadOS 13.3.1.\nvarying vec2 vHighPrecisionZW;\n\nvoid main() {\n\n\t#include <uv_vertex>\n\n\t#include <skinbase_vertex>\n\n\t#ifdef USE_DISPLACEMENTMAP\n\n// removed:\n//\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\n\t#endif\n\n// removed:\n//\t#include <begin_vertex>\n\n\n\n\t// /geo1/MAT/meshBasicBuilder1/attribute1\n\tfloat v_POLY_attribute1_val = id;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/globals1\n\tv_POLY_globals1_position = vec3(position);\n\tfloat v_POLY_globals1_time = time;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/attribute4\n\tfloat v_POLY_attribute4_val = id;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/attribute3\n\tvarying_v_POLY_attribute3_val = float(id);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/round1\n\tfloat v_POLY_round1_val = sign(v_POLY_attribute1_val)*floor(abs(v_POLY_attribute1_val)+0.5);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/round4\n\tfloat v_POLY_round4_val = sign(v_POLY_attribute4_val)*floor(abs(v_POLY_attribute4_val)+0.5);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/floatToVec2_1\n\tvec2 v_POLY_floatToVec2_1_vec2 = vec2(v_POLY_round1_val, 0.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/floatToVec2_3\n\tvec2 v_POLY_floatToVec2_3_vec2 = vec2(v_POLY_round4_val, 64.032);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/random1\n\tfloat v_POLY_random1_rand = rand(v_POLY_floatToVec2_1_vec2);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/random3\n\tfloat v_POLY_random3_rand = rand(v_POLY_floatToVec2_3_vec2);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd9\n\tfloat v_POLY_multAdd9_val = (26.0*(v_POLY_random1_rand + 0.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd11\n\tfloat v_POLY_multAdd11_val = (-4.0*(v_POLY_random3_rand + 0.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/round2\n\tfloat v_POLY_round2_val = sign(v_POLY_multAdd9_val)*floor(abs(v_POLY_multAdd9_val)+0.5);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd4\n\tfloat v_POLY_multAdd4_val = (3.0*(v_POLY_globals1_time + v_POLY_multAdd11_val)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd10\n\tfloat v_POLY_multAdd10_val = (-100.0*(v_POLY_round2_val + 1.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/null1\n\tfloat v_POLY_null1_val = v_POLY_multAdd4_val;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/floatToVec3_1\n\tvec3 v_POLY_floatToVec3_1_vec3 = vec3(0.0, 0.0, v_POLY_multAdd10_val);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/clamp1\n\tfloat v_POLY_clamp1_val = clamp(v_POLY_null1_val, 0.0, 1.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/clamp2\n\tfloat v_POLY_clamp2_val = clamp(v_POLY_null1_val, 1.0, 2.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd6\n\tfloat v_POLY_multAdd6_val = (1.0*(v_POLY_null1_val + -0.33)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/add2\n\tvec3 v_POLY_add2_sum = (v_POLY_floatToVec3_1_vec3 + v_POLY_globals1_position + vec3(0.0, 0.0, 0.0));\n\t\n\t// /geo1/MAT/meshBasicBuilder1/easing1\n\tfloat v_POLY_easing1_out = quadraticInOut(v_POLY_clamp1_val);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd3\n\tfloat v_POLY_multAdd3_val = (1.0*(v_POLY_clamp2_val + -1.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/clamp4\n\tfloat v_POLY_clamp4_val = clamp(v_POLY_multAdd6_val, 1.0, 2.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/null2\n\tvec3 v_POLY_null2_val = v_POLY_add2_sum;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd5\n\tfloat v_POLY_multAdd5_val = (2.0*(v_POLY_multAdd3_val + 0.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd7\n\tfloat v_POLY_multAdd7_val = (1.0*(v_POLY_clamp4_val + -1.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd1\n\tvec3 v_POLY_multAdd1_val = (vec3(2.0, 2.0, 0.5)*(v_POLY_null2_val + vec3(0.0, 0.0, 0.0))) + vec3(0.0, 0.0, 0.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd2\n\tvec3 v_POLY_multAdd2_val = (vec3(0.5, 0.5, 3.0)*(v_POLY_null2_val + vec3(0.0, 0.0, 0.0))) + vec3(0.0, 0.0, 0.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/clamp3\n\tfloat v_POLY_clamp3_val = clamp(v_POLY_multAdd5_val, 0.0, 1.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd8\n\tfloat v_POLY_multAdd8_val = (2.0*(v_POLY_multAdd7_val + 0.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/mix1\n\tvec3 v_POLY_mix1_mix = mix(v_POLY_null2_val, v_POLY_multAdd1_val, v_POLY_easing1_out);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/easing2\n\tfloat v_POLY_easing2_out = quadraticOut(v_POLY_clamp3_val);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/clamp5\n\tfloat v_POLY_clamp5_val = clamp(v_POLY_multAdd8_val, 0.0, 1.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/mix2\n\tvec3 v_POLY_mix2_mix = mix(v_POLY_mix1_mix, v_POLY_multAdd2_val, v_POLY_easing2_out);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/easing3\n\tfloat v_POLY_easing3_out = quadraticOut(v_POLY_clamp5_val);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/rotate1\n\tvec3 v_POLY_rotate1_val = rotateWithAxisAngle(v_POLY_mix2_mix, vec3(0.0, 0.0, 1.0), 1.5707963267948966);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd12\n\tvec3 v_POLY_multAdd12_val = (vec3(1.0, 1.0, 1.0)*(v_POLY_rotate1_val + vec3(0.0, 0.0, 8.4))) + vec3(0.0, 0.0, 0.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/mix3\n\tvec3 v_POLY_mix3_mix = mix(v_POLY_mix2_mix, v_POLY_multAdd12_val, v_POLY_easing3_out);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/instanceTransform1\n\tvec3 v_POLY_instanceTransform1_position = vec3(v_POLY_mix3_mix);\n\tv_POLY_instanceTransform1_position *= instanceScale;\n\tv_POLY_instanceTransform1_position = rotateWithQuat( v_POLY_instanceTransform1_position, instanceOrientation );\n\tv_POLY_instanceTransform1_position += instancePosition;\n\tvec3 v_POLY_instanceTransform1_normal = vec3(normal);\n\tv_POLY_instanceTransform1_normal = rotateWithQuat( v_POLY_instanceTransform1_normal, instanceOrientation );\n\t\n\t// /geo1/MAT/meshBasicBuilder1/output1\n\tvec3 transformed = v_POLY_instanceTransform1_position;\n\tvec3 objectNormal = v_POLY_instanceTransform1_normal;\n\t#ifdef USE_TANGENT\n\t\tvec3 objectTangent = vec3( tangent.xyz );\n\t#endif\n\n\n\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\n\tvHighPrecisionZW = gl_Position.zw;\n\n}\n","fragmentShader":"\n#if DEPTH_PACKING == 3200\n\n\tuniform float opacity;\n\n#endif\n\n#include <common>\n\n\n\n// /geo1/MAT/meshBasicBuilder1/hsvToRgb1\n// https://github.com/hughsk/glsl-hsv2rgb\n// https://stackoverflow.com/questions/15095909/from-rgb-to-hsv-in-opengl-glsl\nvec3 hsv2rgb(vec3 c) {\n\tvec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n\tvec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n\treturn c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\n\n\n\n\n\n\n// /geo1/MAT/meshBasicBuilder1/attribute3\nvarying float varying_v_POLY_attribute3_val;\n\n\n\n\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvarying vec2 vHighPrecisionZW;\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( 1.0 );\n\n\n\n\t// /geo1/MAT/meshBasicBuilder1/attribute3\n\tfloat v_POLY_attribute3_val = varying_v_POLY_attribute3_val;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/round3\n\tfloat v_POLY_round3_val = sign(v_POLY_attribute3_val)*floor(abs(v_POLY_attribute3_val)+0.5);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/floatToVec2_2\n\tvec2 v_POLY_floatToVec2_2_vec2 = vec2(v_POLY_round3_val, 55.032);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/random2\n\tfloat v_POLY_random2_rand = rand(v_POLY_floatToVec2_2_vec2);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/floatToVec3_2\n\tvec3 v_POLY_floatToVec3_2_vec3 = vec3(v_POLY_random2_rand, 0.96, 0.6);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/hsvToRgb1\n\tvec3 v_POLY_hsvToRgb1_rgb = hsv2rgb(v_POLY_floatToVec3_2_vec3);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/output1\n\tdiffuseColor.xyz = v_POLY_hsvToRgb1_rgb;\n\n\n\n\n\t#if DEPTH_PACKING == 3200\n\n\t\tdiffuseColor.a = opacity;\n\n\t#endif\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\n\t#include <logdepthbuf_fragment>\n\n\t// Higher precision equivalent of gl_FragCoord.z. This assumes depthRange has been left to its default values.\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\n\t#if DEPTH_PACKING == 3200\n\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\n\t#elif DEPTH_PACKING == 3201\n\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\n\t#endif\n\n}\n","shadowSide":null,"lights":false},"customDepthDOFMaterial":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/geo1/MAT/meshBasicBuilder1-customDepthDOFMaterial","type":"ShaderMaterial","name":"customDepthDOFMaterial","depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"glslVersion":null,"uniforms":{"mNear":{"value":0},"mFar":{"value":10}},"vertexShader":"#include <common>\n\nvarying float vViewZDepth;\n\n// INSERT DEFINES\n\n\n\n// /geo1/MAT/meshBasicBuilder1/easing1\nfloat quadraticInOut(float t) {\n float p = 2.0 * t * t;\n return t < 0.5 ? p : -p + (4.0 * t) - 1.0;\n}\n\n\n\n// /geo1/MAT/meshBasicBuilder1/easing2\nfloat quadraticOut(float t) {\n return -t * (t - 2.0);\n}\n\n\n\n// /geo1/MAT/meshBasicBuilder1/rotate1\n\n\n// https://github.com/mattatz/ShibuyaCrowd/blob/master/source/shaders/common/quaternion.glsl\nvec4 quatMult(vec4 q1, vec4 q2)\n{\n\treturn vec4(\n\tq1.w * q2.x + q1.x * q2.w + q1.z * q2.y - q1.y * q2.z,\n\tq1.w * q2.y + q1.y * q2.w + q1.x * q2.z - q1.z * q2.x,\n\tq1.w * q2.z + q1.z * q2.w + q1.y * q2.x - q1.x * q2.y,\n\tq1.w * q2.w - q1.x * q2.x - q1.y * q2.y - q1.z * q2.z\n\t);\n}\n// http://glmatrix.net/docs/quat.js.html#line97\n// let ax = a[0], ay = a[1], az = a[2], aw = a[3];\n\n// let bx = b[0], by = b[1], bz = b[2], bw = b[3];\n\n// out[0] = ax * bw + aw * bx + ay * bz - az * by;\n\n// out[1] = ay * bw + aw * by + az * bx - ax * bz;\n\n// out[2] = az * bw + aw * bz + ax * by - ay * bx;\n\n// out[3] = aw * bw - ax * bx - ay * by - az * bz;\n\n// return out\n\n\n\n// http://www.neilmendoza.com/glsl-rotation-about-an-arbitrary-axis/\nmat4 rotationMatrix(vec3 axis, float angle)\n{\n\taxis = normalize(axis);\n\tfloat s = sin(angle);\n\tfloat c = cos(angle);\n\tfloat oc = 1.0 - c;\n\n \treturn mat4(oc * axis.x * axis.x + c, oc * axis.x * axis.y - axis.z * s, oc * axis.z * axis.x + axis.y * s, 0.0, oc * axis.x * axis.y + axis.z * s, oc * axis.y * axis.y + c, oc * axis.y * axis.z - axis.x * s, 0.0, oc * axis.z * axis.x - axis.y * s, oc * axis.y * axis.z + axis.x * s, oc * axis.z * axis.z + c, 0.0, 0.0, 0.0, 0.0, 1.0);\n}\n\n// https://www.geeks3d.com/20141201/how-to-rotate-a-vertex-by-a-quaternion-in-glsl/\nvec4 quatFromAxisAngle(vec3 axis, float angle)\n{\n\tvec4 qr;\n\tfloat half_angle = (angle * 0.5); // * 3.14159 / 180.0;\n\tfloat sin_half_angle = sin(half_angle);\n\tqr.x = axis.x * sin_half_angle;\n\tqr.y = axis.y * sin_half_angle;\n\tqr.z = axis.z * sin_half_angle;\n\tqr.w = cos(half_angle);\n\treturn qr;\n}\nvec3 rotateWithAxisAngle(vec3 position, vec3 axis, float angle)\n{\n\tvec4 q = quatFromAxisAngle(axis, angle);\n\tvec3 v = position.xyz;\n\treturn v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);\n}\n// vec3 applyQuaternionToVector( vec4 q, vec3 v ){\n// \treturn v + 2.0 * cross( q.xyz, cross( q.xyz, v ) + q.w * v );\n// }\nvec3 rotateWithQuat( vec3 v, vec4 q )\n{\n\t// vec4 qv = multQuat( quat, vec4(vec, 0.0) );\n\t// return multQuat( qv, vec4(-quat.x, -quat.y, -quat.z, quat.w) ).xyz;\n\treturn v + 2.0 * cross( q.xyz, cross( q.xyz, v ) + q.w * v );\n}\n// https://github.com/glslify/glsl-look-at/blob/gh-pages/index.glsl\n// mat3 rotation_matrix(vec3 origin, vec3 target, float roll) {\n// \tvec3 rr = vec3(sin(roll), cos(roll), 0.0);\n// \tvec3 ww = normalize(target - origin);\n// \tvec3 uu = normalize(cross(ww, rr));\n// \tvec3 vv = normalize(cross(uu, ww));\n\n// \treturn mat3(uu, vv, ww);\n// }\n// mat3 rotation_matrix(vec3 target, float roll) {\n// \tvec3 rr = vec3(sin(roll), cos(roll), 0.0);\n// \tvec3 ww = normalize(target);\n// \tvec3 uu = normalize(cross(ww, rr));\n// \tvec3 vv = normalize(cross(uu, ww));\n\n// \treturn mat3(uu, vv, ww);\n// }\n\nfloat vectorAngle(vec3 start, vec3 dest){\n\tstart = normalize(start);\n\tdest = normalize(dest);\n\n\tfloat cosTheta = dot(start, dest);\n\tvec3 c1 = cross(start, dest);\n\t// We use the dot product of the cross with the Y axis.\n\t// This is a little arbitrary, but can still give a good sense of direction\n\tvec3 y_axis = vec3(0.0, 1.0, 0.0);\n\tfloat d1 = dot(c1, y_axis);\n\tfloat angle = acos(cosTheta) * sign(d1);\n\treturn angle;\n}\n\n// http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-17-quaternions/#i-need-an-equivalent-of-glulookat-how-do-i-orient-an-object-towards-a-point-\nvec4 vectorAlign(vec3 start, vec3 dest){\n\tstart = normalize(start);\n\tdest = normalize(dest);\n\n\tfloat cosTheta = dot(start, dest);\n\tvec3 axis;\n\n\t// if (cosTheta < -1 + 0.001f){\n\t// \t// special case when vectors in opposite directions:\n\t// \t// there is no \"ideal\" rotation axis\n\t// \t// So guess one; any will do as long as it's perpendicular to start\n\t// \taxis = cross(vec3(0.0f, 0.0f, 1.0f), start);\n\t// \tif (length2(axis) < 0.01 ) // bad luck, they were parallel, try again!\n\t// \t\taxis = cross(vec3(1.0f, 0.0f, 0.0f), start);\n\n\t// \taxis = normalize(axis);\n\t// \treturn gtx::quaternion::angleAxis(glm::radians(180.0f), axis);\n\t// }\n\tif(cosTheta > (1.0 - 0.0001) || cosTheta < (-1.0 + 0.0001) ){\n\t\taxis = normalize(cross(start, vec3(0.0, 1.0, 0.0)));\n\t\tif (length(axis) < 0.001 ){ // bad luck, they were parallel, try again!\n\t\t\taxis = normalize(cross(start, vec3(1.0, 0.0, 0.0)));\n\t\t}\n\t} else {\n\t\taxis = normalize(cross(start, dest));\n\t}\n\n\tfloat angle = acos(cosTheta);\n\n\treturn quatFromAxisAngle(axis, angle);\n}\nvec4 vectorAlignWithUp(vec3 start, vec3 dest, vec3 up){\n\tvec4 rot1 = vectorAlign(start, dest);\n\tup = normalize(up);\n\n\t// Recompute desiredUp so that it's perpendicular to the direction\n\t// You can skip that part if you really want to force desiredUp\n\t// vec3 right = normalize(cross(dest, up));\n\t// up = normalize(cross(right, dest));\n\n\t// Because of the 1rst rotation, the up is probably completely screwed up.\n\t// Find the rotation between the \"up\" of the rotated object, and the desired up\n\tvec3 newUp = rotateWithQuat(vec3(0.0, 1.0, 0.0), rot1);//rot1 * vec3(0.0, 1.0, 0.0);\n\tvec4 rot2 = vectorAlign(up, newUp);\n\n\t// return rot1;\n\treturn rot2;\n\t// return multQuat(rot1, rot2);\n\t// return rot2 * rot1;\n\n}\n\n// https://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToAngle/index.htm\nfloat quatToAngle(vec4 q){\n\treturn 2.0 * acos(q.w);\n}\nvec3 quatToAxis(vec4 q){\n\treturn vec3(\n\t\tq.x / sqrt(1.0-q.w*q.w),\n\t\tq.y / sqrt(1.0-q.w*q.w),\n\t\tq.z / sqrt(1.0-q.w*q.w)\n\t);\n}\n\nvec4 align(vec3 dir, vec3 up){\n\tvec3 start_dir = vec3(0.0, 0.0, 1.0);\n\tvec3 start_up = vec3(0.0, 1.0, 0.0);\n\tvec4 rot1 = vectorAlign(start_dir, dir);\n\tup = normalize(up);\n\n\t// Recompute desiredUp so that it's perpendicular to the direction\n\t// You can skip that part if you really want to force desiredUp\n\tvec3 right = normalize(cross(dir, up));\n\tif(length(right)<0.001){\n\t\tright = vec3(1.0, 0.0, 0.0);\n\t}\n\tup = normalize(cross(right, dir));\n\n\t// Because of the 1rst rotation, the up is probably completely screwed up.\n\t// Find the rotation between the \"up\" of the rotated object, and the desired up\n\tvec3 newUp = rotateWithQuat(start_up, rot1);//rot1 * vec3(0.0, 1.0, 0.0);\n\tvec4 rot2 = vectorAlign(normalize(newUp), up);\n\n\t// return rot1;\n\treturn quatMult(rot1, rot2);\n\t// return rot2 * rot1;\n\n}\n\n\n\n\n\n\n\n// /geo1/MAT/meshBasicBuilder1/globals1\nuniform float time;\n\n// /geo1/MAT/meshBasicBuilder1/globals1\nvarying vec3 v_POLY_globals1_position;\n\n// /geo1/MAT/meshBasicBuilder1/attribute3\nvarying float varying_v_POLY_attribute3_val;\n\n// /geo1/MAT/meshBasicBuilder1/attribute1\nattribute float id;\n\n// /geo1/MAT/meshBasicBuilder1/instanceTransform1\nattribute vec3 instancePosition;\nattribute vec4 instanceOrientation;\nattribute vec3 instanceScale;\n\n\n\n\n\n\n\nvoid main() {\n\n\t// INSERT BODY\n\n\n\n\t// /geo1/MAT/meshBasicBuilder1/attribute1\n\tfloat v_POLY_attribute1_val = id;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/globals1\n\tv_POLY_globals1_position = vec3(position);\n\tfloat v_POLY_globals1_time = time;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/attribute4\n\tfloat v_POLY_attribute4_val = id;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/attribute3\n\tvarying_v_POLY_attribute3_val = float(id);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/round1\n\tfloat v_POLY_round1_val = sign(v_POLY_attribute1_val)*floor(abs(v_POLY_attribute1_val)+0.5);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/round4\n\tfloat v_POLY_round4_val = sign(v_POLY_attribute4_val)*floor(abs(v_POLY_attribute4_val)+0.5);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/floatToVec2_1\n\tvec2 v_POLY_floatToVec2_1_vec2 = vec2(v_POLY_round1_val, 0.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/floatToVec2_3\n\tvec2 v_POLY_floatToVec2_3_vec2 = vec2(v_POLY_round4_val, 64.032);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/random1\n\tfloat v_POLY_random1_rand = rand(v_POLY_floatToVec2_1_vec2);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/random3\n\tfloat v_POLY_random3_rand = rand(v_POLY_floatToVec2_3_vec2);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd9\n\tfloat v_POLY_multAdd9_val = (26.0*(v_POLY_random1_rand + 0.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd11\n\tfloat v_POLY_multAdd11_val = (-4.0*(v_POLY_random3_rand + 0.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/round2\n\tfloat v_POLY_round2_val = sign(v_POLY_multAdd9_val)*floor(abs(v_POLY_multAdd9_val)+0.5);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd4\n\tfloat v_POLY_multAdd4_val = (3.0*(v_POLY_globals1_time + v_POLY_multAdd11_val)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd10\n\tfloat v_POLY_multAdd10_val = (-100.0*(v_POLY_round2_val + 1.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/null1\n\tfloat v_POLY_null1_val = v_POLY_multAdd4_val;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/floatToVec3_1\n\tvec3 v_POLY_floatToVec3_1_vec3 = vec3(0.0, 0.0, v_POLY_multAdd10_val);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/clamp1\n\tfloat v_POLY_clamp1_val = clamp(v_POLY_null1_val, 0.0, 1.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/clamp2\n\tfloat v_POLY_clamp2_val = clamp(v_POLY_null1_val, 1.0, 2.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd6\n\tfloat v_POLY_multAdd6_val = (1.0*(v_POLY_null1_val + -0.33)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/add2\n\tvec3 v_POLY_add2_sum = (v_POLY_floatToVec3_1_vec3 + v_POLY_globals1_position + vec3(0.0, 0.0, 0.0));\n\t\n\t// /geo1/MAT/meshBasicBuilder1/easing1\n\tfloat v_POLY_easing1_out = quadraticInOut(v_POLY_clamp1_val);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd3\n\tfloat v_POLY_multAdd3_val = (1.0*(v_POLY_clamp2_val + -1.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/clamp4\n\tfloat v_POLY_clamp4_val = clamp(v_POLY_multAdd6_val, 1.0, 2.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/null2\n\tvec3 v_POLY_null2_val = v_POLY_add2_sum;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd5\n\tfloat v_POLY_multAdd5_val = (2.0*(v_POLY_multAdd3_val + 0.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd7\n\tfloat v_POLY_multAdd7_val = (1.0*(v_POLY_clamp4_val + -1.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd1\n\tvec3 v_POLY_multAdd1_val = (vec3(2.0, 2.0, 0.5)*(v_POLY_null2_val + vec3(0.0, 0.0, 0.0))) + vec3(0.0, 0.0, 0.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd2\n\tvec3 v_POLY_multAdd2_val = (vec3(0.5, 0.5, 3.0)*(v_POLY_null2_val + vec3(0.0, 0.0, 0.0))) + vec3(0.0, 0.0, 0.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/clamp3\n\tfloat v_POLY_clamp3_val = clamp(v_POLY_multAdd5_val, 0.0, 1.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd8\n\tfloat v_POLY_multAdd8_val = (2.0*(v_POLY_multAdd7_val + 0.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/mix1\n\tvec3 v_POLY_mix1_mix = mix(v_POLY_null2_val, v_POLY_multAdd1_val, v_POLY_easing1_out);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/easing2\n\tfloat v_POLY_easing2_out = quadraticOut(v_POLY_clamp3_val);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/clamp5\n\tfloat v_POLY_clamp5_val = clamp(v_POLY_multAdd8_val, 0.0, 1.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/mix2\n\tvec3 v_POLY_mix2_mix = mix(v_POLY_mix1_mix, v_POLY_multAdd2_val, v_POLY_easing2_out);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/easing3\n\tfloat v_POLY_easing3_out = quadraticOut(v_POLY_clamp5_val);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/rotate1\n\tvec3 v_POLY_rotate1_val = rotateWithAxisAngle(v_POLY_mix2_mix, vec3(0.0, 0.0, 1.0), 1.5707963267948966);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd12\n\tvec3 v_POLY_multAdd12_val = (vec3(1.0, 1.0, 1.0)*(v_POLY_rotate1_val + vec3(0.0, 0.0, 8.4))) + vec3(0.0, 0.0, 0.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/mix3\n\tvec3 v_POLY_mix3_mix = mix(v_POLY_mix2_mix, v_POLY_multAdd12_val, v_POLY_easing3_out);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/instanceTransform1\n\tvec3 v_POLY_instanceTransform1_position = vec3(v_POLY_mix3_mix);\n\tv_POLY_instanceTransform1_position *= instanceScale;\n\tv_POLY_instanceTransform1_position = rotateWithQuat( v_POLY_instanceTransform1_position, instanceOrientation );\n\tv_POLY_instanceTransform1_position += instancePosition;\n\tvec3 v_POLY_instanceTransform1_normal = vec3(normal);\n\tv_POLY_instanceTransform1_normal = rotateWithQuat( v_POLY_instanceTransform1_normal, instanceOrientation );\n\t\n\t// /geo1/MAT/meshBasicBuilder1/output1\n\tvec3 transformed = v_POLY_instanceTransform1_position;\n\tvec3 objectNormal = v_POLY_instanceTransform1_normal;\n\t#ifdef USE_TANGENT\n\t\tvec3 objectTangent = vec3( tangent.xyz );\n\t#endif\n\n\n\n\n\n\t#include <project_vertex>\n\n\tvViewZDepth = - mvPosition.z;\n}","fragmentShader":"uniform float mNear;\nuniform float mFar;\n\nvarying float vViewZDepth;\n\nvoid main() {\n\n\tfloat color = 1.0 - smoothstep( mNear, mFar, vViewZDepth );\n\tgl_FragColor = vec4( vec3( color ), 1.0 );\n\n}\n","shadowSide":null,"lights":false}}}},"meshBasicBuilder_DISAPPEARED":{"type":"meshBasicBuilder","nodes":{"attribute3":{"type":"attribute","params":{"name":"id"},"connection_points":{"in":[],"out":[{"name":"val","type":"float"}]}},"floatToVec2_2":{"type":"floatToVec2","params":{"y":55.032},"inputs":[{"index":0,"node":"round3","output":"val"}]},"floatToVec3_2":{"type":"floatToVec3","params":{"y":0.79,"z":0.6},"inputs":[{"index":0,"node":"random2","output":"rand"}]},"hsvToRgb1":{"type":"hsvToRgb","inputs":[{"index":0,"node":"floatToVec3_2","output":"vec3"}]},"output1":{"type":"output","inputs":[null,null,{"index":2,"node":"hsvToRgb1","output":"rgb"}]},"random2":{"type":"random","inputs":[{"index":0,"node":"floatToVec2_2","output":"vec2"}]},"round3":{"type":"round","params":{"in":{"type":"float","default_value":0,"options":{"spare":true}}},"inputs":[{"index":0,"node":"attribute1","output":"val"}],"connection_points":{"in":[{"name":"in","type":"float"}],"out":[{"name":"val","type":"float"}]}},"attribute1":{"type":"attribute","params":{"name":"letterId"},"connection_points":{"in":[],"out":[{"name":"val","type":"float"}]}}},"selection":["floatToVec3_2"],"persisted_config":{"material":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/geo1/MAT/meshBasicBuilder_DISAPPEARED-main","type":"ShaderMaterial","name":"/geo1/MAT/meshBasicBuilder_DISAPPEARED","depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"glslVersion":null,"uniforms":{"diffuse":{"type":"c","value":15658734},"opacity":{"value":1},"map":{"value":null},"uvTransform":{"type":"m3","value":[1,0,0,0,1,0,0,0,1]},"uv2Transform":{"type":"m3","value":[1,0,0,0,1,0,0,0,1]},"alphaMap":{"value":null},"specularMap":{"value":null},"envMap":{"value":null},"flipEnvMap":{"value":-1},"reflectivity":{"value":1},"refractionRatio":{"value":0.98},"maxMipLevel":{"value":0},"aoMap":{"value":null},"aoMapIntensity":{"value":1},"lightMap":{"value":null},"lightMapIntensity":{"value":1},"fogDensity":{"value":0.00025},"fogNear":{"value":1},"fogFar":{"value":2000},"fogColor":{"type":"c","value":16777215}},"vertexShader":"\n#include <common>\n\n\n\n// /geo1/MAT/meshBasicBuilder_DISAPPEARED/attribute1\nvarying float varying_v_POLY_attribute1_val;\n\n// /geo1/MAT/meshBasicBuilder_DISAPPEARED/attribute1\nattribute float letterId;\n\n\n\n\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\n\n\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/attribute1\n\tvarying_v_POLY_attribute1_val = float(letterId);\n\t\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/output1\n\tvec3 transformed = position;\n\tvec3 objectNormal = normal;\n\t#ifdef USE_TANGENT\n\t\tvec3 objectTangent = vec3( tangent.xyz );\n\t#endif\n\n\n\n\t#include <skinbase_vertex>\n\n\t#ifdef USE_ENVMAP\n\n// removed:\n//\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\n\t#endif\n\n// removed:\n//\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n\n}\n","fragmentShader":"\nuniform vec3 diffuse;\nuniform float opacity;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n\n#include <common>\n\n\n\n// /geo1/MAT/meshBasicBuilder_DISAPPEARED/hsvToRgb1\n// https://github.com/hughsk/glsl-hsv2rgb\n// https://stackoverflow.com/questions/15095909/from-rgb-to-hsv-in-opengl-glsl\nvec3 hsv2rgb(vec3 c) {\n\tvec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n\tvec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n\treturn c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\n\n\n\n\n\n\n// /geo1/MAT/meshBasicBuilder_DISAPPEARED/attribute1\nvarying float varying_v_POLY_attribute1_val;\n\n\n\n\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\n\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/attribute1\n\tfloat v_POLY_attribute1_val = varying_v_POLY_attribute1_val;\n\t\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/round3\n\tfloat v_POLY_round3_val = sign(v_POLY_attribute1_val)*floor(abs(v_POLY_attribute1_val)+0.5);\n\t\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/floatToVec2_2\n\tvec2 v_POLY_floatToVec2_2_vec2 = vec2(v_POLY_round3_val, 55.032);\n\t\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/random2\n\tfloat v_POLY_random2_rand = rand(v_POLY_floatToVec2_2_vec2);\n\t\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/floatToVec3_2\n\tvec3 v_POLY_floatToVec3_2_vec3 = vec3(v_POLY_random2_rand, 0.79, 0.6);\n\t\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/hsvToRgb1\n\tvec3 v_POLY_hsvToRgb1_rgb = hsv2rgb(v_POLY_floatToVec3_2_vec3);\n\t\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/output1\n\tdiffuseColor.xyz = v_POLY_hsvToRgb1_rgb;\n\n\n\n\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\n\t// accumulation (baked indirect lighting only)\n\t#ifdef USE_LIGHTMAP\n\t\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\n\t#else\n\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\n\t#endif\n\n\t// modulation\n\t#include <aomap_fragment>\n\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\n\t#include <envmap_fragment>\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n\n}\n","shadowSide":null,"lights":false},"uniforms_time_dependent":false,"uniforms_resolution_dependent":false,"param_uniform_pairs":[],"customMaterials":{"customDistanceMaterial":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/geo1/MAT/meshBasicBuilder_DISAPPEARED-customDistanceMaterial","type":"ShaderMaterial","name":"customDistanceMaterial","depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"glslVersion":null,"uniforms":{"diffuse":{"type":"c","value":15658734},"opacity":{"value":1},"map":{"value":null},"uvTransform":{"type":"m3","value":[1,0,0,0,1,0,0,0,1]},"uv2Transform":{"type":"m3","value":[1,0,0,0,1,0,0,0,1]},"alphaMap":{"value":null},"displacementMap":{"value":null},"displacementScale":{"value":1},"displacementBias":{"value":0},"referencePosition":{"type":"v3","value":[0,0,0]},"nearDistance":{"value":1},"farDistance":{"value":1000}},"defines":{"DEPTH_PACKING":3201},"vertexShader":"\n#define DISTANCE\n\nvarying vec3 vWorldPosition;\n\n#include <common>\n\n\n\n// /geo1/MAT/meshBasicBuilder_DISAPPEARED/attribute1\nvarying float varying_v_POLY_attribute1_val;\n\n// /geo1/MAT/meshBasicBuilder_DISAPPEARED/attribute1\nattribute float letterId;\n\n\n\n\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\n\t#include <skinbase_vertex>\n\n\t#ifdef USE_DISPLACEMENTMAP\n\n// removed:\n//\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\n\t#endif\n\n// removed:\n//\t#include <begin_vertex>\n\n\n\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/attribute1\n\tvarying_v_POLY_attribute1_val = float(letterId);\n\t\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/output1\n\tvec3 transformed = position;\n\tvec3 objectNormal = normal;\n\t#ifdef USE_TANGENT\n\t\tvec3 objectTangent = vec3( tangent.xyz );\n\t#endif\n\n\n\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\n\tvWorldPosition = worldPosition.xyz;\n\n}\n","fragmentShader":"\n#define DISTANCE\n\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n\n#include <common>\n\n\n\n// /geo1/MAT/meshBasicBuilder_DISAPPEARED/hsvToRgb1\n// https://github.com/hughsk/glsl-hsv2rgb\n// https://stackoverflow.com/questions/15095909/from-rgb-to-hsv-in-opengl-glsl\nvec3 hsv2rgb(vec3 c) {\n\tvec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n\tvec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n\treturn c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\n\n\n\n\n\n\n// /geo1/MAT/meshBasicBuilder_DISAPPEARED/attribute1\nvarying float varying_v_POLY_attribute1_val;\n\n\n\n\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main () {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( 1.0 );\n\n\n\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/attribute1\n\tfloat v_POLY_attribute1_val = varying_v_POLY_attribute1_val;\n\t\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/round3\n\tfloat v_POLY_round3_val = sign(v_POLY_attribute1_val)*floor(abs(v_POLY_attribute1_val)+0.5);\n\t\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/floatToVec2_2\n\tvec2 v_POLY_floatToVec2_2_vec2 = vec2(v_POLY_round3_val, 55.032);\n\t\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/random2\n\tfloat v_POLY_random2_rand = rand(v_POLY_floatToVec2_2_vec2);\n\t\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/floatToVec3_2\n\tvec3 v_POLY_floatToVec3_2_vec3 = vec3(v_POLY_random2_rand, 0.79, 0.6);\n\t\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/hsvToRgb1\n\tvec3 v_POLY_hsvToRgb1_rgb = hsv2rgb(v_POLY_floatToVec3_2_vec3);\n\t\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/output1\n\tdiffuseColor.xyz = v_POLY_hsvToRgb1_rgb;\n\n\n\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist ); // clamp to [ 0, 1 ]\n\n\tgl_FragColor = packDepthToRGBA( dist );\n\n}\n","shadowSide":null,"lights":false},"customDepthMaterial":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/geo1/MAT/meshBasicBuilder_DISAPPEARED-customDepthMaterial","type":"ShaderMaterial","name":"customDepthMaterial","depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"glslVersion":null,"uniforms":{"diffuse":{"type":"c","value":15658734},"opacity":{"value":1},"map":{"value":null},"uvTransform":{"type":"m3","value":[1,0,0,0,1,0,0,0,1]},"uv2Transform":{"type":"m3","value":[1,0,0,0,1,0,0,0,1]},"alphaMap":{"value":null},"displacementMap":{"value":null},"displacementScale":{"value":1},"displacementBias":{"value":0}},"defines":{"DEPTH_PACKING":3201},"vertexShader":"\n#include <common>\n\n\n\n// /geo1/MAT/meshBasicBuilder_DISAPPEARED/attribute1\nvarying float varying_v_POLY_attribute1_val;\n\n// /geo1/MAT/meshBasicBuilder_DISAPPEARED/attribute1\nattribute float letterId;\n\n\n\n\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\n// This is used for computing an equivalent of gl_FragCoord.z that is as high precision as possible.\n// Some platforms compute gl_FragCoord at a lower precision which makes the manually computed value better for\n// depth-based postprocessing effects. Reproduced on iPad with A10 processor / iPadOS 13.3.1.\nvarying vec2 vHighPrecisionZW;\n\nvoid main() {\n\n\t#include <uv_vertex>\n\n\t#include <skinbase_vertex>\n\n\t#ifdef USE_DISPLACEMENTMAP\n\n// removed:\n//\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\n\t#endif\n\n// removed:\n//\t#include <begin_vertex>\n\n\n\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/attribute1\n\tvarying_v_POLY_attribute1_val = float(letterId);\n\t\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/output1\n\tvec3 transformed = position;\n\tvec3 objectNormal = normal;\n\t#ifdef USE_TANGENT\n\t\tvec3 objectTangent = vec3( tangent.xyz );\n\t#endif\n\n\n\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\n\tvHighPrecisionZW = gl_Position.zw;\n\n}\n","fragmentShader":"\n#if DEPTH_PACKING == 3200\n\n\tuniform float opacity;\n\n#endif\n\n#include <common>\n\n\n\n// /geo1/MAT/meshBasicBuilder_DISAPPEARED/hsvToRgb1\n// https://github.com/hughsk/glsl-hsv2rgb\n// https://stackoverflow.com/questions/15095909/from-rgb-to-hsv-in-opengl-glsl\nvec3 hsv2rgb(vec3 c) {\n\tvec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n\tvec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n\treturn c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\n\n\n\n\n\n\n// /geo1/MAT/meshBasicBuilder_DISAPPEARED/attribute1\nvarying float varying_v_POLY_attribute1_val;\n\n\n\n\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvarying vec2 vHighPrecisionZW;\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( 1.0 );\n\n\n\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/attribute1\n\tfloat v_POLY_attribute1_val = varying_v_POLY_attribute1_val;\n\t\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/round3\n\tfloat v_POLY_round3_val = sign(v_POLY_attribute1_val)*floor(abs(v_POLY_attribute1_val)+0.5);\n\t\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/floatToVec2_2\n\tvec2 v_POLY_floatToVec2_2_vec2 = vec2(v_POLY_round3_val, 55.032);\n\t\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/random2\n\tfloat v_POLY_random2_rand = rand(v_POLY_floatToVec2_2_vec2);\n\t\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/floatToVec3_2\n\tvec3 v_POLY_floatToVec3_2_vec3 = vec3(v_POLY_random2_rand, 0.79, 0.6);\n\t\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/hsvToRgb1\n\tvec3 v_POLY_hsvToRgb1_rgb = hsv2rgb(v_POLY_floatToVec3_2_vec3);\n\t\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/output1\n\tdiffuseColor.xyz = v_POLY_hsvToRgb1_rgb;\n\n\n\n\n\t#if DEPTH_PACKING == 3200\n\n\t\tdiffuseColor.a = opacity;\n\n\t#endif\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\n\t#include <logdepthbuf_fragment>\n\n\t// Higher precision equivalent of gl_FragCoord.z. This assumes depthRange has been left to its default values.\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\n\t#if DEPTH_PACKING == 3200\n\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\n\t#elif DEPTH_PACKING == 3201\n\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\n\t#endif\n\n}\n","shadowSide":null,"lights":false},"customDepthDOFMaterial":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/geo1/MAT/meshBasicBuilder_DISAPPEARED-customDepthDOFMaterial","type":"ShaderMaterial","name":"customDepthDOFMaterial","depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"glslVersion":null,"uniforms":{"mNear":{"value":0},"mFar":{"value":10}},"vertexShader":"#include <common>\n\nvarying float vViewZDepth;\n\n// INSERT DEFINES\n\n\n\n// /geo1/MAT/meshBasicBuilder_DISAPPEARED/attribute1\nvarying float varying_v_POLY_attribute1_val;\n\n// /geo1/MAT/meshBasicBuilder_DISAPPEARED/attribute1\nattribute float letterId;\n\n\n\n\n\n\n\nvoid main() {\n\n\t// INSERT BODY\n\n\n\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/attribute1\n\tvarying_v_POLY_attribute1_val = float(letterId);\n\t\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/output1\n\tvec3 transformed = position;\n\tvec3 objectNormal = normal;\n\t#ifdef USE_TANGENT\n\t\tvec3 objectTangent = vec3( tangent.xyz );\n\t#endif\n\n\n\n\n\n\t#include <project_vertex>\n\n\tvViewZDepth = - mvPosition.z;\n}","fragmentShader":"uniform float mNear;\nuniform float mFar;\n\nvarying float vViewZDepth;\n\nvoid main() {\n\n\tfloat color = 1.0 - smoothstep( mNear, mFar, vViewZDepth );\n\tgl_FragColor = vec4( vec3( color ), 1.0 );\n\n}\n","shadowSide":null,"lights":false}}}}}},"text1":{"type":"text","params":{"font":"https://raw.githubusercontent.com/polygonjs/polygonjs-assets/master/fonts/SourceCodePro-Semibold.ttf","text":"`arg(js(\"'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('').join(' ')\"),copy('../copy1',0))`","type":1}},"plane1":{"type":"plane","params":{"size":[59,34]}},"scatter1":{"type":"scatter","params":{"pointsCount":5000},"inputs":["plane1"]},"copy1":{"type":"copy","params":{"count":26,"useCopyExpr":1},"inputs":["transform4"]},"transform2":{"type":"transform","params":{"t":[0,"100*copy('../copy1',0)",0]},"inputs":["text1"]},"instance1":{"type":"instance","params":{"attributesToCopy":"instance* id","material":"../MAT/meshBasicBuilder1"},"inputs":["transform3","scatter1"]},"transform3":{"type":"transform","params":{"r":[90,0,0]},"inputs":["merge1"]},"merge1":{"type":"merge","params":{"compact":1},"inputs":["copy1"]},"transform4":{"type":"transform","params":{"t":["-$CEX",0,"-$CEZ"]},"inputs":["transform2"]},"text2":{"type":"text","params":{"font":"https://raw.githubusercontent.com/polygonjs/polygonjs-assets/master/fonts/SourceCodePro-Semibold.ttf","text":"`arg(js(\"'DISAPPEARED?!'.split('').join(' ')\"),copy('../copy2',0))`","type":1}},"attribCreate2":{"type":"attribCreate","params":{"name":"letterId","value1":"copy('../copy2',0)"},"inputs":["text2"]},"copy2":{"type":"copy","params":{"count":13,"useCopyExpr":true},"inputs":["transform6"]},"transform5":{"type":"transform","params":{"t":["1*copy('../copy2',0)",0,0]},"inputs":["attribCreate2"]},"transform6":{"type":"transform","params":{"t":["-$CEX",0,"-$CEZ"]},"inputs":["transform5"],"flags":{"bypass":true}},"merge2":{"type":"merge","inputs":["instance1","material1"],"flags":{"display":true},"cloned_state_overriden":true},"merge3":{"type":"merge","params":{"compact":1},"inputs":["copy2"]},"material1":{"type":"material","params":{"material":"../MAT/meshBasicBuilder_DISAPPEARED"},"inputs":["merge3"]}},"flags":{"display":true}},"perspectiveCamera1":{"type":"perspectiveCamera","nodes":{"events1":{"type":"eventsNetwork","nodes":{"cameraOrbitControls1":{"type":"cameraOrbitControls","params":{"target":[5.756649791221145,-2.5404733270608446,1.5767856951719574]}}},"selection":["cameraOrbitControls1"]}},"params":{"t":[6.098828033164987,3.4903257554558924,18.686931668991953],"r":[-19.456460561758625,1.0764691061638711,0.3802494011857632],"controls":"./events1/cameraOrbitControls1"},"flags":{"display":true}},"COP":{"type":"copNetwork","nodes":{"imageEnv":{"type":"image","params":{"url":"https://raw.githubusercontent.com/polygonjs/polygonjs-assets/master/textures/piz_compressed.exr"}},"imageUv":{"type":"image","params":{"url":"https://raw.githubusercontent.com/polygonjs/polygonjs-assets/master/textures/uv.jpg","tflipY":true}},"envMap":{"type":"envMap","inputs":["imageEnv"]}}},"ground":{"type":"geo","nodes":{"plane1":{"type":"plane","params":{"size":[171,171]},"flags":{"display":true}}},"flags":{"display":false},"selection":["plane1"]},"hemisphereLight1":{"type":"hemisphereLight","flags":{"display":true}},"orthographicCamera1":{"type":"orthographicCamera","params":{"t":[-0.02497605807073451,4.469550975255178,12.7601061247756],"r":[-15.91786252810725,-0.625065518402668,-0.17826118713949604],"controls":"../perspectiveCamera1/events1/cameraOrbitControls1"},"flags":{"display":true}}},"params":{"backgroundMode":1,"fogType":0,"fogColor":[0,0,0],"fogNear":2,"fogFar":5}},"ui":{"nodes":{"geo1":{"pos":[-50,-150],"nodes":{"MAT":{"pos":[-350,150],"nodes":{"meshStandard1":{"pos":[0,100]},"meshBasicBuilder1":{"pos":[0,200],"nodes":{"globals1":{"pos":[-1200,-200]},"output1":{"pos":[2000,-100]},"mix1":{"pos":[0,-200]},"mix2":{"pos":[350,-50]},"multAdd1":{"pos":[-100,-150]},"multAdd2":{"pos":[200,0]},"constant1":{"pos":[-1250,200]},"clamp1":{"pos":[-300,200]},"clamp2":{"pos":[-300,300]},"multAdd3":{"pos":[-150,300]},"null1":{"pos":[-500,200]},"multAdd4":{"pos":[-600,200]},"multAdd5":{"pos":[0,300]},"clamp3":{"pos":[100,300]},"easing1":{"pos":[-200,200]},"easing2":{"pos":[200,300]},"rotate1":{"pos":[550,0]},"mix3":{"pos":[900,-100]},"multAdd6":{"pos":[-400,550]},"clamp4":{"pos":[-250,550]},"multAdd7":{"pos":[-100,550]},"multAdd8":{"pos":[50,550]},"clamp5":{"pos":[150,550]},"easing3":{"pos":[250,550]},"instanceTransform1":{"pos":[1250,-100]},"attribute1":{"pos":[-1700,-750]},"round1":{"pos":[-1600,-750]},"floatToVec2_1":{"pos":[-1500,-750]},"random1":{"pos":[-1400,-750]},"multAdd9":{"pos":[-1300,-750]},"round2":{"pos":[-1200,-750]},"multAdd10":{"pos":[-1100,-750]},"floatToVec3_1":{"pos":[-1000,-750]},"attribute2":{"pos":[-1050,-900]},"add1":{"pos":[-900,-800]},"attribute3":{"pos":[1200,300]},"round3":{"pos":[1300,300]},"floatToVec2_2":{"pos":[1400,300]},"random2":{"pos":[1500,300]},"floatToVec3_2":{"pos":[1650,300]},"hsvToRgb1":{"pos":[1800,300]},"attribute4":{"pos":[-1350,350]},"round4":{"pos":[-1250,350]},"floatToVec2_3":{"pos":[-1150,350]},"random3":{"pos":[-1050,350]},"null2":{"pos":[-650,-300]},"add2":{"pos":[-750,-450]},"constant2":{"pos":[-1000,-500]},"multAdd11":{"pos":[-900,350]},"multAdd12":{"pos":[650,0]}}},"meshBasicBuilder_DISAPPEARED":{"pos":[0,300],"nodes":{"attribute3":{"pos":[1050,-50]},"floatToVec2_2":{"pos":[1250,-50]},"floatToVec3_2":{"pos":[1500,-50]},"hsvToRgb1":{"pos":[1650,-50]},"output1":{"pos":[2000,-100]},"random2":{"pos":[1350,-50]},"round3":{"pos":[1150,-50]},"attribute1":{"pos":[1050,-200]}}}}},"text1":{"pos":[200,-500]},"plane1":{"pos":[600,150]},"scatter1":{"pos":[600,250]},"copy1":{"pos":[200,-200]},"transform2":{"pos":[200,-400]},"instance1":{"pos":[400,450]},"transform3":{"pos":[200,250]},"merge1":{"pos":[200,150]},"transform4":{"pos":[200,-300]},"text2":{"pos":[950,-200]},"attribCreate2":{"pos":[950,-50]},"copy2":{"pos":[950,250]},"transform5":{"pos":[950,50]},"transform6":{"pos":[950,150]},"merge2":{"pos":[650,700]},"merge3":{"pos":[950,350]},"material1":{"pos":[950,450]}}},"perspectiveCamera1":{"pos":[-300,250],"nodes":{"events1":{"pos":[-200,50],"nodes":{"cameraOrbitControls1":{"pos":[150,50]}}}}},"COP":{"pos":[-300,350],"nodes":{"imageEnv":{"pos":[50,100]},"imageUv":{"pos":[-100,100]},"envMap":{"pos":[50,200]}}},"ground":{"pos":[-50,-50],"nodes":{"plane1":{"pos":[100,50]}}},"hemisphereLight1":{"pos":[100,200]},"orthographicCamera1":{"pos":[-300,150]}}}}
Code editor
{"multiple_panel":{"split_ratio":0.5,"split_panel0":{"split_ratio":0.5,"split_panel0":{"panel_types":["viewer"],"current_panel_index":0,"panel_data":{"camera":"/perspectiveCamera1"}},"split_panel1":{"panel_types":["params"],"current_panel_index":0,"panel_data":{"active_folder":null}},"split_mode":"vertical"},"split_panel1":{"panel_types":["network","params","viewer"],"current_panel_index":0,"panel_data":{"camera":{"position":{"x":-58,"y":0},"zoom":0.5},"history":{"2":{"position":{"x":-58,"y":0},"zoom":0.5},"3":{"position":{"x":-48,"y":-22},"zoom":0.5},"6":{"position":{"x":11.339999999999996,"y":-96.49999999999999},"zoom":0.6172839506172841},"9":{"position":{"x":-32,"y":-88},"zoom":0.5},"131":{"position":{"x":-59.04899999999998,"y":-65.1854},"zoom":0.8467543904215146}}}},"split_mode":"horizontal"},"current_node":"/","fullscreen_panel_id":null}
Used nodes
cop/envMap;cop/image;event/cameraOrbitControls;mat/meshBasicBuilder;mat/meshStandard;obj/copNetwork;obj/geo;obj/hemisphereLight;obj/orthographicCamera;obj/perspectiveCamera;sop/attribCreate;sop/copy;sop/eventsNetwork;sop/instance;sop/material;sop/materialsNetwork;sop/merge;sop/plane;sop/scatter;sop/text;sop/transform
Used operations
Used modules
EXRLoader;TTFLoader
Used assemblers
GL_MESH_BASIC
Used integrations
[]
Used assets
Nodes map
{"/geo1":"obj/geo","/geo1/MAT":"sop/materialsNetwork","/geo1/MAT/meshStandard1":"mat/meshStandard","/geo1/MAT/meshBasicBuilder1":"mat/meshBasicBuilder","/geo1/MAT/meshBasicBuilder_DISAPPEARED":"mat/meshBasicBuilder","/geo1/text1":"sop/text","/geo1/plane1":"sop/plane","/geo1/scatter1":"sop/scatter","/geo1/copy1":"sop/copy","/geo1/transform2":"sop/transform","/geo1/instance1":"sop/instance","/geo1/transform3":"sop/transform","/geo1/merge1":"sop/merge","/geo1/transform4":"sop/transform","/geo1/text2":"sop/text","/geo1/attribCreate2":"sop/attribCreate","/geo1/copy2":"sop/copy","/geo1/transform5":"sop/transform","/geo1/transform6":"sop/transform","/geo1/merge2":"sop/merge","/geo1/merge3":"sop/merge","/geo1/material1":"sop/material","/perspectiveCamera1":"obj/perspectiveCamera","/perspectiveCamera1/events1":"sop/eventsNetwork","/perspectiveCamera1/events1/cameraOrbitControls1":"event/cameraOrbitControls","/COP":"obj/copNetwork","/COP/imageEnv":"cop/image","/COP/imageUv":"cop/image","/COP/envMap":"cop/envMap","/ground":"obj/geo","/ground/plane1":"sop/plane","/hemisphereLight1":"obj/hemisphereLight","/orthographicCamera1":"obj/orthographicCamera"}
Js version
Editor version
Engine version
Name
*
Code
{"properties":{"frame":0,"maxFrame":600,"maxFrameLocked":false,"realtimeState":true,"masterCameraNodePath":"/perspectiveCamera1","versions":{"polygonjs":"1.1.134"}},"root":{"type":"obj","nodes":{"geo1":{"type":"geo","nodes":{"MAT":{"type":"materialsNetwork","nodes":{"meshStandard1":{"type":"meshStandard","params":{"useMap":true,"map":"../../../COP/imageUv","useEnvMap":true,"envMap":"../../../COP/envMap","roughness":0.07}},"meshBasicBuilder1":{"type":"meshBasicBuilder","nodes":{"globals1":{"type":"globals"},"output1":{"type":"output","inputs":[{"index":0,"node":"instanceTransform1","output":"position"},{"index":1,"node":"instanceTransform1","output":"normal"},{"index":2,"node":"hsvToRgb1","output":"rgb"}]},"mix1":{"type":"mix","params":{"value0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true}},"value1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true}},"blend":{"type":"float","default_value":0.5,"options":{"spare":true},"raw_input":1}},"inputs":[{"index":0,"node":"null2","output":"val"},{"index":1,"node":"multAdd1","output":"val"},{"index":2,"node":"easing1","output":"out"}],"connection_points":{"in":[{"name":"value0","type":"vec3"},{"name":"value1","type":"vec3"},{"name":"blend","type":"float"}],"out":[{"name":"mix","type":"vec3"}]}},"mix2":{"type":"mix","params":{"value0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true}},"value1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true}},"blend":{"type":"float","default_value":0.5,"options":{"spare":true},"raw_input":1}},"inputs":[{"index":0,"node":"mix1","output":"mix"},{"index":1,"node":"multAdd2","output":"val"},{"index":2,"node":"easing2","output":"out"}],"connection_points":{"in":[{"name":"value0","type":"vec3"},{"name":"value1","type":"vec3"},{"name":"blend","type":"float"}],"out":[{"name":"mix","type":"vec3"}]}},"multAdd1":{"type":"multAdd","params":{"value":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true}},"preAdd":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true}},"mult":{"type":"vector3","default_value":[1,1,1],"options":{"spare":true},"raw_input":[2,2,0.5]},"postAdd":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true}}},"inputs":[{"index":0,"node":"null2","output":"val"}],"connection_points":{"in":[{"name":"value","type":"vec3"},{"name":"preAdd","type":"vec3"},{"name":"mult","type":"vec3"},{"name":"postAdd","type":"vec3"}],"out":[{"name":"val","type":"vec3"}]}},"multAdd2":{"type":"multAdd","params":{"value":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true}},"preAdd":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true}},"mult":{"type":"vector3","default_value":[1,1,1],"options":{"spare":true},"raw_input":[0.5,0.5,3]},"postAdd":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true}}},"inputs":[{"index":0,"node":"null2","output":"val"}],"connection_points":{"in":[{"name":"value","type":"vec3"},{"name":"preAdd","type":"vec3"},{"name":"mult","type":"vec3"},{"name":"postAdd","type":"vec3"}],"out":[{"name":"val","type":"vec3"}]}},"constant1":{"type":"constant","connection_points":{"in":[],"out":[{"name":"val","type":"float"}]}},"clamp1":{"type":"clamp","params":{"value":{"type":"float","default_value":0,"options":{"spare":true}},"min":{"type":"float","default_value":0,"options":{"spare":true}},"max":{"type":"float","default_value":1,"options":{"spare":true}}},"inputs":[{"index":0,"node":"null1","output":"val"}],"connection_points":{"in":[{"name":"value","type":"float"},{"name":"min","type":"float"},{"name":"max","type":"float"}],"out":[{"name":"val","type":"float"}]}},"clamp2":{"type":"clamp","params":{"value":{"type":"float","default_value":0,"options":{"spare":true}},"min":{"type":"float","default_value":0,"options":{"spare":true},"raw_input":1},"max":{"type":"float","default_value":1,"options":{"spare":true},"raw_input":2}},"inputs":[{"index":0,"node":"null1","output":"val"}],"connection_points":{"in":[{"name":"value","type":"float"},{"name":"min","type":"float"},{"name":"max","type":"float"}],"out":[{"name":"val","type":"float"}]}},"multAdd3":{"type":"multAdd","params":{"value":{"type":"float","default_value":0,"options":{"spare":true}},"preAdd":{"type":"float","default_value":0,"options":{"spare":true},"raw_input":-1},"mult":{"type":"float","default_value":1,"options":{"spare":true}},"postAdd":{"type":"float","default_value":0,"options":{"spare":true}}},"inputs":[{"index":0,"node":"clamp2","output":"val"}],"connection_points":{"in":[{"name":"value","type":"float"},{"name":"preAdd","type":"float"},{"name":"mult","type":"float"},{"name":"postAdd","type":"float"}],"out":[{"name":"val","type":"float"}]}},"null1":{"type":"null","params":{"in":{"type":"float","default_value":0,"options":{"spare":true}}},"inputs":[{"index":0,"node":"multAdd4","output":"val"}],"connection_points":{"in":[{"name":"in","type":"float"}],"out":[{"name":"val","type":"float"}]}},"multAdd4":{"type":"multAdd","params":{"value":{"type":"float","default_value":0,"options":{"spare":true}},"preAdd":{"type":"float","default_value":0,"options":{"spare":true}},"mult":{"type":"float","default_value":1,"options":{"spare":true},"raw_input":3},"postAdd":{"type":"float","default_value":0,"options":{"spare":true}}},"inputs":[{"index":0,"node":"globals1","output":"time"},{"index":1,"node":"multAdd11","output":"val"}],"connection_points":{"in":[{"name":"value","type":"float"},{"name":"preAdd","type":"float"},{"name":"mult","type":"float"},{"name":"postAdd","type":"float"}],"out":[{"name":"val","type":"float"}]}},"multAdd5":{"type":"multAdd","params":{"value":{"type":"float","default_value":0,"options":{"spare":true}},"preAdd":{"type":"float","default_value":0,"options":{"spare":true}},"mult":{"type":"float","default_value":1,"options":{"spare":true},"raw_input":2},"postAdd":{"type":"float","default_value":0,"options":{"spare":true}}},"inputs":[{"index":0,"node":"multAdd3","output":"val"}],"connection_points":{"in":[{"name":"value","type":"float"},{"name":"preAdd","type":"float"},{"name":"mult","type":"float"},{"name":"postAdd","type":"float"}],"out":[{"name":"val","type":"float"}]}},"clamp3":{"type":"clamp","params":{"value":{"type":"float","default_value":0,"options":{"spare":true}},"min":{"type":"float","default_value":0,"options":{"spare":true}},"max":{"type":"float","default_value":1,"options":{"spare":true}}},"inputs":[{"index":0,"node":"multAdd5","output":"val"}],"connection_points":{"in":[{"name":"value","type":"float"},{"name":"min","type":"float"},{"name":"max","type":"float"}],"out":[{"name":"val","type":"float"}]}},"easing1":{"type":"easing","params":{"type":19},"inputs":[{"index":0,"node":"clamp1","output":"val"}]},"easing2":{"type":"easing","params":{"type":21},"inputs":[{"index":0,"node":"clamp3","output":"val"}]},"rotate1":{"type":"rotate","params":{"vector":{"type":"vector3","default_value":[0,0,1],"options":{"spare":true},"raw_input":[0,1,0]},"axis":{"type":"vector3","default_value":[0,1,0],"options":{"spare":true},"raw_input":[0,0,1]},"angle":{"type":"float","default_value":0,"options":{"spare":true},"raw_input":1.5707963267948966}},"maxInputsCount":3,"inputs":[{"index":0,"node":"mix2","output":"mix"}],"connection_points":{"in":[{"name":"vector","type":"vec3"},{"name":"axis","type":"vec3"},{"name":"angle","type":"float"}],"out":[{"name":"val","type":"vec3"}]}},"mix3":{"type":"mix","params":{"value0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true}},"value1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true}},"blend":{"type":"float","default_value":0.5,"options":{"spare":true}}},"inputs":[{"index":0,"node":"mix2","output":"mix"},{"index":1,"node":"multAdd12","output":"val"},{"index":2,"node":"easing3","output":"out"}],"connection_points":{"in":[{"name":"value0","type":"vec3"},{"name":"value1","type":"vec3"},{"name":"blend","type":"float"}],"out":[{"name":"mix","type":"vec3"}]}},"multAdd6":{"type":"multAdd","params":{"value":{"type":"float","default_value":0,"options":{"spare":true}},"preAdd":{"type":"float","default_value":0,"options":{"spare":true},"raw_input":-0.33},"mult":{"type":"float","default_value":1,"options":{"spare":true}},"postAdd":{"type":"float","default_value":0,"options":{"spare":true}}},"inputs":[{"index":0,"node":"null1","output":"val"}],"connection_points":{"in":[{"name":"value","type":"float"},{"name":"preAdd","type":"float"},{"name":"mult","type":"float"},{"name":"postAdd","type":"float"}],"out":[{"name":"val","type":"float"}]}},"clamp4":{"type":"clamp","params":{"value":{"type":"float","default_value":0,"options":{"spare":true}},"min":{"type":"float","default_value":0,"options":{"spare":true},"raw_input":1},"max":{"type":"float","default_value":1,"options":{"spare":true},"raw_input":2}},"inputs":[{"index":0,"node":"multAdd6","output":"val"}],"connection_points":{"in":[{"name":"value","type":"float"},{"name":"min","type":"float"},{"name":"max","type":"float"}],"out":[{"name":"val","type":"float"}]}},"multAdd7":{"type":"multAdd","params":{"value":{"type":"float","default_value":0,"options":{"spare":true}},"preAdd":{"type":"float","default_value":0,"options":{"spare":true},"raw_input":-1},"mult":{"type":"float","default_value":1,"options":{"spare":true}},"postAdd":{"type":"float","default_value":0,"options":{"spare":true}}},"inputs":[{"index":0,"node":"clamp4","output":"val"}],"connection_points":{"in":[{"name":"value","type":"float"},{"name":"preAdd","type":"float"},{"name":"mult","type":"float"},{"name":"postAdd","type":"float"}],"out":[{"name":"val","type":"float"}]}},"multAdd8":{"type":"multAdd","params":{"value":{"type":"float","default_value":0,"options":{"spare":true}},"preAdd":{"type":"float","default_value":0,"options":{"spare":true}},"mult":{"type":"float","default_value":1,"options":{"spare":true},"raw_input":2},"postAdd":{"type":"float","default_value":0,"options":{"spare":true}}},"inputs":[{"index":0,"node":"multAdd7","output":"val"}],"connection_points":{"in":[{"name":"value","type":"float"},{"name":"preAdd","type":"float"},{"name":"mult","type":"float"},{"name":"postAdd","type":"float"}],"out":[{"name":"val","type":"float"}]}},"clamp5":{"type":"clamp","params":{"value":{"type":"float","default_value":0,"options":{"spare":true}},"min":{"type":"float","default_value":0,"options":{"spare":true}},"max":{"type":"float","default_value":1,"options":{"spare":true}}},"inputs":[{"index":0,"node":"multAdd8","output":"val"}],"connection_points":{"in":[{"name":"value","type":"float"},{"name":"min","type":"float"},{"name":"max","type":"float"}],"out":[{"name":"val","type":"float"}]}},"easing3":{"type":"easing","params":{"type":21},"inputs":[{"index":0,"node":"clamp5","output":"val"}]},"instanceTransform1":{"type":"instanceTransform","inputs":[{"index":0,"node":"mix3","output":"mix"}]},"attribute1":{"type":"attribute","params":{"name":"id"},"connection_points":{"in":[],"out":[{"name":"val","type":"float"}]}},"round1":{"type":"round","params":{"in":{"type":"float","default_value":0,"options":{"spare":true}}},"inputs":[{"index":0,"node":"attribute1","output":"val"}],"connection_points":{"in":[{"name":"in","type":"float"}],"out":[{"name":"val","type":"float"}]}},"floatToVec2_1":{"type":"floatToVec2","inputs":[{"index":0,"node":"round1","output":"val"}]},"random1":{"type":"random","inputs":[{"index":0,"node":"floatToVec2_1","output":"vec2"}]},"multAdd9":{"type":"multAdd","params":{"value":{"type":"float","default_value":0,"options":{"spare":true}},"preAdd":{"type":"float","default_value":0,"options":{"spare":true}},"mult":{"type":"float","default_value":1,"options":{"spare":true},"raw_input":26},"postAdd":{"type":"float","default_value":0,"options":{"spare":true}}},"inputs":[{"index":0,"node":"random1","output":"rand"}],"connection_points":{"in":[{"name":"value","type":"float"},{"name":"preAdd","type":"float"},{"name":"mult","type":"float"},{"name":"postAdd","type":"float"}],"out":[{"name":"val","type":"float"}]}},"round2":{"type":"round","params":{"in":{"type":"float","default_value":0,"options":{"spare":true}}},"inputs":[{"index":0,"node":"multAdd9","output":"val"}],"connection_points":{"in":[{"name":"in","type":"float"}],"out":[{"name":"val","type":"float"}]}},"multAdd10":{"type":"multAdd","params":{"value":{"type":"float","default_value":0,"options":{"spare":true}},"preAdd":{"type":"float","default_value":0,"options":{"spare":true},"raw_input":1},"mult":{"type":"float","default_value":1,"options":{"spare":true},"raw_input":-100},"postAdd":{"type":"float","default_value":0,"options":{"spare":true}}},"inputs":[{"index":0,"node":"round2","output":"val"}],"connection_points":{"in":[{"name":"value","type":"float"},{"name":"preAdd","type":"float"},{"name":"mult","type":"float"},{"name":"postAdd","type":"float"}],"out":[{"name":"val","type":"float"}]}},"floatToVec3_1":{"type":"floatToVec3","inputs":[null,null,{"index":2,"node":"multAdd10","output":"val"}]},"attribute2":{"type":"attribute","params":{"name":"instancePosition","type":2},"connection_points":{"in":[],"out":[{"name":"val","type":"vec3"}]}},"add1":{"type":"add","params":{"add0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true}},"add1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true}},"add2":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true}}},"maxInputsCount":3,"inputs":[{"index":0,"node":"attribute2","output":"val"},{"index":1,"node":"floatToVec3_1","output":"vec3"}],"connection_points":{"in":[{"name":"add0","type":"vec3"},{"name":"add1","type":"vec3"},{"name":"add2","type":"vec3"}],"out":[{"name":"sum","type":"vec3"}]}},"attribute3":{"type":"attribute","params":{"name":"id"},"connection_points":{"in":[],"out":[{"name":"val","type":"float"}]}},"round3":{"type":"round","params":{"in":{"type":"float","default_value":0,"options":{"spare":true}}},"inputs":[{"index":0,"node":"attribute3","output":"val"}],"connection_points":{"in":[{"name":"in","type":"float"}],"out":[{"name":"val","type":"float"}]}},"floatToVec2_2":{"type":"floatToVec2","params":{"y":55.032},"inputs":[{"index":0,"node":"round3","output":"val"}]},"random2":{"type":"random","inputs":[{"index":0,"node":"floatToVec2_2","output":"vec2"}]},"floatToVec3_2":{"type":"floatToVec3","params":{"y":0.96,"z":0.6},"inputs":[{"index":0,"node":"random2","output":"rand"}]},"hsvToRgb1":{"type":"hsvToRgb","inputs":[{"index":0,"node":"floatToVec3_2","output":"vec3"}]},"attribute4":{"type":"attribute","params":{"name":"id"},"connection_points":{"in":[],"out":[{"name":"val","type":"float"}]}},"round4":{"type":"round","params":{"in":{"type":"float","default_value":0,"options":{"spare":true}}},"inputs":[{"index":0,"node":"attribute4","output":"val"}],"connection_points":{"in":[{"name":"in","type":"float"}],"out":[{"name":"val","type":"float"}]}},"floatToVec2_3":{"type":"floatToVec2","params":{"y":64.032},"inputs":[{"index":0,"node":"round4","output":"val"}]},"random3":{"type":"random","inputs":[{"index":0,"node":"floatToVec2_3","output":"vec2"}]},"null2":{"type":"null","params":{"in":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true}}},"inputs":[{"index":0,"node":"add2","output":"sum"}],"connection_points":{"in":[{"name":"in","type":"vec3"}],"out":[{"name":"val","type":"vec3"}]}},"add2":{"type":"add","params":{"add0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true}},"add1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true}},"add2":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true}}},"maxInputsCount":3,"inputs":[{"index":0,"node":"floatToVec3_1","output":"vec3"},{"index":1,"node":"globals1","output":"position"}],"connection_points":{"in":[{"name":"add0","type":"vec3"},{"name":"add1","type":"vec3"},{"name":"add2","type":"vec3"}],"out":[{"name":"sum","type":"vec3"}]}},"constant2":{"type":"constant","params":{"type":4,"vec3":[0,0.2,-0.5]},"connection_points":{"in":[],"out":[{"name":"val","type":"vec3"}]}},"multAdd11":{"type":"multAdd","params":{"value":{"type":"float","default_value":0,"options":{"spare":true}},"preAdd":{"type":"float","default_value":0,"options":{"spare":true}},"mult":{"type":"float","default_value":1,"options":{"spare":true},"raw_input":-4},"postAdd":{"type":"float","default_value":0,"options":{"spare":true}}},"inputs":[{"index":0,"node":"random3","output":"rand"}],"connection_points":{"in":[{"name":"value","type":"float"},{"name":"preAdd","type":"float"},{"name":"mult","type":"float"},{"name":"postAdd","type":"float"}],"out":[{"name":"val","type":"float"}]}},"multAdd12":{"type":"multAdd","params":{"value":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true}},"preAdd":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true},"raw_input":[0,0,8.4]},"mult":{"type":"vector3","default_value":[1,1,1],"options":{"spare":true}},"postAdd":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true}}},"inputs":[{"index":0,"node":"rotate1","output":"val"}],"connection_points":{"in":[{"name":"value","type":"vec3"},{"name":"preAdd","type":"vec3"},{"name":"mult","type":"vec3"},{"name":"postAdd","type":"vec3"}],"out":[{"name":"val","type":"vec3"}]}}},"selection":["multAdd12"],"persisted_config":{"material":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/geo1/MAT/meshBasicBuilder1-main","type":"ShaderMaterial","name":"/geo1/MAT/meshBasicBuilder1","depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"glslVersion":null,"uniforms":{"diffuse":{"type":"c","value":15658734},"opacity":{"value":1},"map":{"value":null},"uvTransform":{"type":"m3","value":[1,0,0,0,1,0,0,0,1]},"uv2Transform":{"type":"m3","value":[1,0,0,0,1,0,0,0,1]},"alphaMap":{"value":null},"specularMap":{"value":null},"envMap":{"value":null},"flipEnvMap":{"value":-1},"reflectivity":{"value":1},"refractionRatio":{"value":0.98},"maxMipLevel":{"value":0},"aoMap":{"value":null},"aoMapIntensity":{"value":1},"lightMap":{"value":null},"lightMapIntensity":{"value":1},"fogDensity":{"value":0.00025},"fogNear":{"value":1},"fogFar":{"value":2000},"fogColor":{"type":"c","value":16777215},"time":{"value":0}},"vertexShader":"\n#include <common>\n\n\n\n// /geo1/MAT/meshBasicBuilder1/easing1\nfloat quadraticInOut(float t) {\n float p = 2.0 * t * t;\n return t < 0.5 ? p : -p + (4.0 * t) - 1.0;\n}\n\n\n\n// /geo1/MAT/meshBasicBuilder1/easing2\nfloat quadraticOut(float t) {\n return -t * (t - 2.0);\n}\n\n\n\n// /geo1/MAT/meshBasicBuilder1/rotate1\n\n\n// https://github.com/mattatz/ShibuyaCrowd/blob/master/source/shaders/common/quaternion.glsl\nvec4 quatMult(vec4 q1, vec4 q2)\n{\n\treturn vec4(\n\tq1.w * q2.x + q1.x * q2.w + q1.z * q2.y - q1.y * q2.z,\n\tq1.w * q2.y + q1.y * q2.w + q1.x * q2.z - q1.z * q2.x,\n\tq1.w * q2.z + q1.z * q2.w + q1.y * q2.x - q1.x * q2.y,\n\tq1.w * q2.w - q1.x * q2.x - q1.y * q2.y - q1.z * q2.z\n\t);\n}\n// http://glmatrix.net/docs/quat.js.html#line97\n// let ax = a[0], ay = a[1], az = a[2], aw = a[3];\n\n// let bx = b[0], by = b[1], bz = b[2], bw = b[3];\n\n// out[0] = ax * bw + aw * bx + ay * bz - az * by;\n\n// out[1] = ay * bw + aw * by + az * bx - ax * bz;\n\n// out[2] = az * bw + aw * bz + ax * by - ay * bx;\n\n// out[3] = aw * bw - ax * bx - ay * by - az * bz;\n\n// return out\n\n\n\n// http://www.neilmendoza.com/glsl-rotation-about-an-arbitrary-axis/\nmat4 rotationMatrix(vec3 axis, float angle)\n{\n\taxis = normalize(axis);\n\tfloat s = sin(angle);\n\tfloat c = cos(angle);\n\tfloat oc = 1.0 - c;\n\n \treturn mat4(oc * axis.x * axis.x + c, oc * axis.x * axis.y - axis.z * s, oc * axis.z * axis.x + axis.y * s, 0.0, oc * axis.x * axis.y + axis.z * s, oc * axis.y * axis.y + c, oc * axis.y * axis.z - axis.x * s, 0.0, oc * axis.z * axis.x - axis.y * s, oc * axis.y * axis.z + axis.x * s, oc * axis.z * axis.z + c, 0.0, 0.0, 0.0, 0.0, 1.0);\n}\n\n// https://www.geeks3d.com/20141201/how-to-rotate-a-vertex-by-a-quaternion-in-glsl/\nvec4 quatFromAxisAngle(vec3 axis, float angle)\n{\n\tvec4 qr;\n\tfloat half_angle = (angle * 0.5); // * 3.14159 / 180.0;\n\tfloat sin_half_angle = sin(half_angle);\n\tqr.x = axis.x * sin_half_angle;\n\tqr.y = axis.y * sin_half_angle;\n\tqr.z = axis.z * sin_half_angle;\n\tqr.w = cos(half_angle);\n\treturn qr;\n}\nvec3 rotateWithAxisAngle(vec3 position, vec3 axis, float angle)\n{\n\tvec4 q = quatFromAxisAngle(axis, angle);\n\tvec3 v = position.xyz;\n\treturn v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);\n}\n// vec3 applyQuaternionToVector( vec4 q, vec3 v ){\n// \treturn v + 2.0 * cross( q.xyz, cross( q.xyz, v ) + q.w * v );\n// }\nvec3 rotateWithQuat( vec3 v, vec4 q )\n{\n\t// vec4 qv = multQuat( quat, vec4(vec, 0.0) );\n\t// return multQuat( qv, vec4(-quat.x, -quat.y, -quat.z, quat.w) ).xyz;\n\treturn v + 2.0 * cross( q.xyz, cross( q.xyz, v ) + q.w * v );\n}\n// https://github.com/glslify/glsl-look-at/blob/gh-pages/index.glsl\n// mat3 rotation_matrix(vec3 origin, vec3 target, float roll) {\n// \tvec3 rr = vec3(sin(roll), cos(roll), 0.0);\n// \tvec3 ww = normalize(target - origin);\n// \tvec3 uu = normalize(cross(ww, rr));\n// \tvec3 vv = normalize(cross(uu, ww));\n\n// \treturn mat3(uu, vv, ww);\n// }\n// mat3 rotation_matrix(vec3 target, float roll) {\n// \tvec3 rr = vec3(sin(roll), cos(roll), 0.0);\n// \tvec3 ww = normalize(target);\n// \tvec3 uu = normalize(cross(ww, rr));\n// \tvec3 vv = normalize(cross(uu, ww));\n\n// \treturn mat3(uu, vv, ww);\n// }\n\nfloat vectorAngle(vec3 start, vec3 dest){\n\tstart = normalize(start);\n\tdest = normalize(dest);\n\n\tfloat cosTheta = dot(start, dest);\n\tvec3 c1 = cross(start, dest);\n\t// We use the dot product of the cross with the Y axis.\n\t// This is a little arbitrary, but can still give a good sense of direction\n\tvec3 y_axis = vec3(0.0, 1.0, 0.0);\n\tfloat d1 = dot(c1, y_axis);\n\tfloat angle = acos(cosTheta) * sign(d1);\n\treturn angle;\n}\n\n// http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-17-quaternions/#i-need-an-equivalent-of-glulookat-how-do-i-orient-an-object-towards-a-point-\nvec4 vectorAlign(vec3 start, vec3 dest){\n\tstart = normalize(start);\n\tdest = normalize(dest);\n\n\tfloat cosTheta = dot(start, dest);\n\tvec3 axis;\n\n\t// if (cosTheta < -1 + 0.001f){\n\t// \t// special case when vectors in opposite directions:\n\t// \t// there is no \"ideal\" rotation axis\n\t// \t// So guess one; any will do as long as it's perpendicular to start\n\t// \taxis = cross(vec3(0.0f, 0.0f, 1.0f), start);\n\t// \tif (length2(axis) < 0.01 ) // bad luck, they were parallel, try again!\n\t// \t\taxis = cross(vec3(1.0f, 0.0f, 0.0f), start);\n\n\t// \taxis = normalize(axis);\n\t// \treturn gtx::quaternion::angleAxis(glm::radians(180.0f), axis);\n\t// }\n\tif(cosTheta > (1.0 - 0.0001) || cosTheta < (-1.0 + 0.0001) ){\n\t\taxis = normalize(cross(start, vec3(0.0, 1.0, 0.0)));\n\t\tif (length(axis) < 0.001 ){ // bad luck, they were parallel, try again!\n\t\t\taxis = normalize(cross(start, vec3(1.0, 0.0, 0.0)));\n\t\t}\n\t} else {\n\t\taxis = normalize(cross(start, dest));\n\t}\n\n\tfloat angle = acos(cosTheta);\n\n\treturn quatFromAxisAngle(axis, angle);\n}\nvec4 vectorAlignWithUp(vec3 start, vec3 dest, vec3 up){\n\tvec4 rot1 = vectorAlign(start, dest);\n\tup = normalize(up);\n\n\t// Recompute desiredUp so that it's perpendicular to the direction\n\t// You can skip that part if you really want to force desiredUp\n\t// vec3 right = normalize(cross(dest, up));\n\t// up = normalize(cross(right, dest));\n\n\t// Because of the 1rst rotation, the up is probably completely screwed up.\n\t// Find the rotation between the \"up\" of the rotated object, and the desired up\n\tvec3 newUp = rotateWithQuat(vec3(0.0, 1.0, 0.0), rot1);//rot1 * vec3(0.0, 1.0, 0.0);\n\tvec4 rot2 = vectorAlign(up, newUp);\n\n\t// return rot1;\n\treturn rot2;\n\t// return multQuat(rot1, rot2);\n\t// return rot2 * rot1;\n\n}\n\n// https://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToAngle/index.htm\nfloat quatToAngle(vec4 q){\n\treturn 2.0 * acos(q.w);\n}\nvec3 quatToAxis(vec4 q){\n\treturn vec3(\n\t\tq.x / sqrt(1.0-q.w*q.w),\n\t\tq.y / sqrt(1.0-q.w*q.w),\n\t\tq.z / sqrt(1.0-q.w*q.w)\n\t);\n}\n\nvec4 align(vec3 dir, vec3 up){\n\tvec3 start_dir = vec3(0.0, 0.0, 1.0);\n\tvec3 start_up = vec3(0.0, 1.0, 0.0);\n\tvec4 rot1 = vectorAlign(start_dir, dir);\n\tup = normalize(up);\n\n\t// Recompute desiredUp so that it's perpendicular to the direction\n\t// You can skip that part if you really want to force desiredUp\n\tvec3 right = normalize(cross(dir, up));\n\tif(length(right)<0.001){\n\t\tright = vec3(1.0, 0.0, 0.0);\n\t}\n\tup = normalize(cross(right, dir));\n\n\t// Because of the 1rst rotation, the up is probably completely screwed up.\n\t// Find the rotation between the \"up\" of the rotated object, and the desired up\n\tvec3 newUp = rotateWithQuat(start_up, rot1);//rot1 * vec3(0.0, 1.0, 0.0);\n\tvec4 rot2 = vectorAlign(normalize(newUp), up);\n\n\t// return rot1;\n\treturn quatMult(rot1, rot2);\n\t// return rot2 * rot1;\n\n}\n\n\n\n\n\n\n\n// /geo1/MAT/meshBasicBuilder1/globals1\nuniform float time;\n\n// /geo1/MAT/meshBasicBuilder1/globals1\nvarying vec3 v_POLY_globals1_position;\n\n// /geo1/MAT/meshBasicBuilder1/attribute3\nvarying float varying_v_POLY_attribute3_val;\n\n// /geo1/MAT/meshBasicBuilder1/attribute1\nattribute float id;\n\n// /geo1/MAT/meshBasicBuilder1/instanceTransform1\nattribute vec3 instancePosition;\nattribute vec4 instanceOrientation;\nattribute vec3 instanceScale;\n\n\n\n\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\n\n\n\t// /geo1/MAT/meshBasicBuilder1/attribute1\n\tfloat v_POLY_attribute1_val = id;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/globals1\n\tv_POLY_globals1_position = vec3(position);\n\tfloat v_POLY_globals1_time = time;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/attribute4\n\tfloat v_POLY_attribute4_val = id;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/attribute3\n\tvarying_v_POLY_attribute3_val = float(id);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/round1\n\tfloat v_POLY_round1_val = sign(v_POLY_attribute1_val)*floor(abs(v_POLY_attribute1_val)+0.5);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/round4\n\tfloat v_POLY_round4_val = sign(v_POLY_attribute4_val)*floor(abs(v_POLY_attribute4_val)+0.5);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/floatToVec2_1\n\tvec2 v_POLY_floatToVec2_1_vec2 = vec2(v_POLY_round1_val, 0.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/floatToVec2_3\n\tvec2 v_POLY_floatToVec2_3_vec2 = vec2(v_POLY_round4_val, 64.032);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/random1\n\tfloat v_POLY_random1_rand = rand(v_POLY_floatToVec2_1_vec2);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/random3\n\tfloat v_POLY_random3_rand = rand(v_POLY_floatToVec2_3_vec2);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd9\n\tfloat v_POLY_multAdd9_val = (26.0*(v_POLY_random1_rand + 0.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd11\n\tfloat v_POLY_multAdd11_val = (-4.0*(v_POLY_random3_rand + 0.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/round2\n\tfloat v_POLY_round2_val = sign(v_POLY_multAdd9_val)*floor(abs(v_POLY_multAdd9_val)+0.5);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd4\n\tfloat v_POLY_multAdd4_val = (3.0*(v_POLY_globals1_time + v_POLY_multAdd11_val)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd10\n\tfloat v_POLY_multAdd10_val = (-100.0*(v_POLY_round2_val + 1.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/null1\n\tfloat v_POLY_null1_val = v_POLY_multAdd4_val;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/floatToVec3_1\n\tvec3 v_POLY_floatToVec3_1_vec3 = vec3(0.0, 0.0, v_POLY_multAdd10_val);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/clamp1\n\tfloat v_POLY_clamp1_val = clamp(v_POLY_null1_val, 0.0, 1.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/clamp2\n\tfloat v_POLY_clamp2_val = clamp(v_POLY_null1_val, 1.0, 2.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd6\n\tfloat v_POLY_multAdd6_val = (1.0*(v_POLY_null1_val + -0.33)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/add2\n\tvec3 v_POLY_add2_sum = (v_POLY_floatToVec3_1_vec3 + v_POLY_globals1_position + vec3(0.0, 0.0, 0.0));\n\t\n\t// /geo1/MAT/meshBasicBuilder1/easing1\n\tfloat v_POLY_easing1_out = quadraticInOut(v_POLY_clamp1_val);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd3\n\tfloat v_POLY_multAdd3_val = (1.0*(v_POLY_clamp2_val + -1.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/clamp4\n\tfloat v_POLY_clamp4_val = clamp(v_POLY_multAdd6_val, 1.0, 2.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/null2\n\tvec3 v_POLY_null2_val = v_POLY_add2_sum;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd5\n\tfloat v_POLY_multAdd5_val = (2.0*(v_POLY_multAdd3_val + 0.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd7\n\tfloat v_POLY_multAdd7_val = (1.0*(v_POLY_clamp4_val + -1.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd1\n\tvec3 v_POLY_multAdd1_val = (vec3(2.0, 2.0, 0.5)*(v_POLY_null2_val + vec3(0.0, 0.0, 0.0))) + vec3(0.0, 0.0, 0.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd2\n\tvec3 v_POLY_multAdd2_val = (vec3(0.5, 0.5, 3.0)*(v_POLY_null2_val + vec3(0.0, 0.0, 0.0))) + vec3(0.0, 0.0, 0.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/clamp3\n\tfloat v_POLY_clamp3_val = clamp(v_POLY_multAdd5_val, 0.0, 1.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd8\n\tfloat v_POLY_multAdd8_val = (2.0*(v_POLY_multAdd7_val + 0.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/mix1\n\tvec3 v_POLY_mix1_mix = mix(v_POLY_null2_val, v_POLY_multAdd1_val, v_POLY_easing1_out);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/easing2\n\tfloat v_POLY_easing2_out = quadraticOut(v_POLY_clamp3_val);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/clamp5\n\tfloat v_POLY_clamp5_val = clamp(v_POLY_multAdd8_val, 0.0, 1.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/mix2\n\tvec3 v_POLY_mix2_mix = mix(v_POLY_mix1_mix, v_POLY_multAdd2_val, v_POLY_easing2_out);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/easing3\n\tfloat v_POLY_easing3_out = quadraticOut(v_POLY_clamp5_val);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/rotate1\n\tvec3 v_POLY_rotate1_val = rotateWithAxisAngle(v_POLY_mix2_mix, vec3(0.0, 0.0, 1.0), 1.5707963267948966);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd12\n\tvec3 v_POLY_multAdd12_val = (vec3(1.0, 1.0, 1.0)*(v_POLY_rotate1_val + vec3(0.0, 0.0, 8.4))) + vec3(0.0, 0.0, 0.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/mix3\n\tvec3 v_POLY_mix3_mix = mix(v_POLY_mix2_mix, v_POLY_multAdd12_val, v_POLY_easing3_out);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/instanceTransform1\n\tvec3 v_POLY_instanceTransform1_position = vec3(v_POLY_mix3_mix);\n\tv_POLY_instanceTransform1_position *= instanceScale;\n\tv_POLY_instanceTransform1_position = rotateWithQuat( v_POLY_instanceTransform1_position, instanceOrientation );\n\tv_POLY_instanceTransform1_position += instancePosition;\n\tvec3 v_POLY_instanceTransform1_normal = vec3(normal);\n\tv_POLY_instanceTransform1_normal = rotateWithQuat( v_POLY_instanceTransform1_normal, instanceOrientation );\n\t\n\t// /geo1/MAT/meshBasicBuilder1/output1\n\tvec3 transformed = v_POLY_instanceTransform1_position;\n\tvec3 objectNormal = v_POLY_instanceTransform1_normal;\n\t#ifdef USE_TANGENT\n\t\tvec3 objectTangent = vec3( tangent.xyz );\n\t#endif\n\n\n\n\t#include <skinbase_vertex>\n\n\t#ifdef USE_ENVMAP\n\n// removed:\n//\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\n\t#endif\n\n// removed:\n//\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n\n}\n","fragmentShader":"\nuniform vec3 diffuse;\nuniform float opacity;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n\n#include <common>\n\n\n\n// /geo1/MAT/meshBasicBuilder1/hsvToRgb1\n// https://github.com/hughsk/glsl-hsv2rgb\n// https://stackoverflow.com/questions/15095909/from-rgb-to-hsv-in-opengl-glsl\nvec3 hsv2rgb(vec3 c) {\n\tvec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n\tvec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n\treturn c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\n\n\n\n\n\n\n// /geo1/MAT/meshBasicBuilder1/attribute3\nvarying float varying_v_POLY_attribute3_val;\n\n\n\n\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\n\n\t// /geo1/MAT/meshBasicBuilder1/attribute3\n\tfloat v_POLY_attribute3_val = varying_v_POLY_attribute3_val;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/round3\n\tfloat v_POLY_round3_val = sign(v_POLY_attribute3_val)*floor(abs(v_POLY_attribute3_val)+0.5);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/floatToVec2_2\n\tvec2 v_POLY_floatToVec2_2_vec2 = vec2(v_POLY_round3_val, 55.032);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/random2\n\tfloat v_POLY_random2_rand = rand(v_POLY_floatToVec2_2_vec2);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/floatToVec3_2\n\tvec3 v_POLY_floatToVec3_2_vec3 = vec3(v_POLY_random2_rand, 0.96, 0.6);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/hsvToRgb1\n\tvec3 v_POLY_hsvToRgb1_rgb = hsv2rgb(v_POLY_floatToVec3_2_vec3);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/output1\n\tdiffuseColor.xyz = v_POLY_hsvToRgb1_rgb;\n\n\n\n\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\n\t// accumulation (baked indirect lighting only)\n\t#ifdef USE_LIGHTMAP\n\t\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\n\t#else\n\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\n\t#endif\n\n\t// modulation\n\t#include <aomap_fragment>\n\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\n\t#include <envmap_fragment>\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n\n}\n","shadowSide":null,"lights":false},"uniforms_time_dependent":true,"uniforms_resolution_dependent":false,"param_uniform_pairs":[],"customMaterials":{"customDistanceMaterial":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/geo1/MAT/meshBasicBuilder1-customDistanceMaterial","type":"ShaderMaterial","name":"customDistanceMaterial","depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"glslVersion":null,"uniforms":{"diffuse":{"type":"c","value":15658734},"opacity":{"value":1},"map":{"value":null},"uvTransform":{"type":"m3","value":[1,0,0,0,1,0,0,0,1]},"uv2Transform":{"type":"m3","value":[1,0,0,0,1,0,0,0,1]},"alphaMap":{"value":null},"displacementMap":{"value":null},"displacementScale":{"value":1},"displacementBias":{"value":0},"referencePosition":{"type":"v3","value":[0,0,0]},"nearDistance":{"value":1},"farDistance":{"value":1000}},"defines":{"DEPTH_PACKING":3201},"vertexShader":"\n#define DISTANCE\n\nvarying vec3 vWorldPosition;\n\n#include <common>\n\n\n\n// /geo1/MAT/meshBasicBuilder1/easing1\nfloat quadraticInOut(float t) {\n float p = 2.0 * t * t;\n return t < 0.5 ? p : -p + (4.0 * t) - 1.0;\n}\n\n\n\n// /geo1/MAT/meshBasicBuilder1/easing2\nfloat quadraticOut(float t) {\n return -t * (t - 2.0);\n}\n\n\n\n// /geo1/MAT/meshBasicBuilder1/rotate1\n\n\n// https://github.com/mattatz/ShibuyaCrowd/blob/master/source/shaders/common/quaternion.glsl\nvec4 quatMult(vec4 q1, vec4 q2)\n{\n\treturn vec4(\n\tq1.w * q2.x + q1.x * q2.w + q1.z * q2.y - q1.y * q2.z,\n\tq1.w * q2.y + q1.y * q2.w + q1.x * q2.z - q1.z * q2.x,\n\tq1.w * q2.z + q1.z * q2.w + q1.y * q2.x - q1.x * q2.y,\n\tq1.w * q2.w - q1.x * q2.x - q1.y * q2.y - q1.z * q2.z\n\t);\n}\n// http://glmatrix.net/docs/quat.js.html#line97\n// let ax = a[0], ay = a[1], az = a[2], aw = a[3];\n\n// let bx = b[0], by = b[1], bz = b[2], bw = b[3];\n\n// out[0] = ax * bw + aw * bx + ay * bz - az * by;\n\n// out[1] = ay * bw + aw * by + az * bx - ax * bz;\n\n// out[2] = az * bw + aw * bz + ax * by - ay * bx;\n\n// out[3] = aw * bw - ax * bx - ay * by - az * bz;\n\n// return out\n\n\n\n// http://www.neilmendoza.com/glsl-rotation-about-an-arbitrary-axis/\nmat4 rotationMatrix(vec3 axis, float angle)\n{\n\taxis = normalize(axis);\n\tfloat s = sin(angle);\n\tfloat c = cos(angle);\n\tfloat oc = 1.0 - c;\n\n \treturn mat4(oc * axis.x * axis.x + c, oc * axis.x * axis.y - axis.z * s, oc * axis.z * axis.x + axis.y * s, 0.0, oc * axis.x * axis.y + axis.z * s, oc * axis.y * axis.y + c, oc * axis.y * axis.z - axis.x * s, 0.0, oc * axis.z * axis.x - axis.y * s, oc * axis.y * axis.z + axis.x * s, oc * axis.z * axis.z + c, 0.0, 0.0, 0.0, 0.0, 1.0);\n}\n\n// https://www.geeks3d.com/20141201/how-to-rotate-a-vertex-by-a-quaternion-in-glsl/\nvec4 quatFromAxisAngle(vec3 axis, float angle)\n{\n\tvec4 qr;\n\tfloat half_angle = (angle * 0.5); // * 3.14159 / 180.0;\n\tfloat sin_half_angle = sin(half_angle);\n\tqr.x = axis.x * sin_half_angle;\n\tqr.y = axis.y * sin_half_angle;\n\tqr.z = axis.z * sin_half_angle;\n\tqr.w = cos(half_angle);\n\treturn qr;\n}\nvec3 rotateWithAxisAngle(vec3 position, vec3 axis, float angle)\n{\n\tvec4 q = quatFromAxisAngle(axis, angle);\n\tvec3 v = position.xyz;\n\treturn v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);\n}\n// vec3 applyQuaternionToVector( vec4 q, vec3 v ){\n// \treturn v + 2.0 * cross( q.xyz, cross( q.xyz, v ) + q.w * v );\n// }\nvec3 rotateWithQuat( vec3 v, vec4 q )\n{\n\t// vec4 qv = multQuat( quat, vec4(vec, 0.0) );\n\t// return multQuat( qv, vec4(-quat.x, -quat.y, -quat.z, quat.w) ).xyz;\n\treturn v + 2.0 * cross( q.xyz, cross( q.xyz, v ) + q.w * v );\n}\n// https://github.com/glslify/glsl-look-at/blob/gh-pages/index.glsl\n// mat3 rotation_matrix(vec3 origin, vec3 target, float roll) {\n// \tvec3 rr = vec3(sin(roll), cos(roll), 0.0);\n// \tvec3 ww = normalize(target - origin);\n// \tvec3 uu = normalize(cross(ww, rr));\n// \tvec3 vv = normalize(cross(uu, ww));\n\n// \treturn mat3(uu, vv, ww);\n// }\n// mat3 rotation_matrix(vec3 target, float roll) {\n// \tvec3 rr = vec3(sin(roll), cos(roll), 0.0);\n// \tvec3 ww = normalize(target);\n// \tvec3 uu = normalize(cross(ww, rr));\n// \tvec3 vv = normalize(cross(uu, ww));\n\n// \treturn mat3(uu, vv, ww);\n// }\n\nfloat vectorAngle(vec3 start, vec3 dest){\n\tstart = normalize(start);\n\tdest = normalize(dest);\n\n\tfloat cosTheta = dot(start, dest);\n\tvec3 c1 = cross(start, dest);\n\t// We use the dot product of the cross with the Y axis.\n\t// This is a little arbitrary, but can still give a good sense of direction\n\tvec3 y_axis = vec3(0.0, 1.0, 0.0);\n\tfloat d1 = dot(c1, y_axis);\n\tfloat angle = acos(cosTheta) * sign(d1);\n\treturn angle;\n}\n\n// http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-17-quaternions/#i-need-an-equivalent-of-glulookat-how-do-i-orient-an-object-towards-a-point-\nvec4 vectorAlign(vec3 start, vec3 dest){\n\tstart = normalize(start);\n\tdest = normalize(dest);\n\n\tfloat cosTheta = dot(start, dest);\n\tvec3 axis;\n\n\t// if (cosTheta < -1 + 0.001f){\n\t// \t// special case when vectors in opposite directions:\n\t// \t// there is no \"ideal\" rotation axis\n\t// \t// So guess one; any will do as long as it's perpendicular to start\n\t// \taxis = cross(vec3(0.0f, 0.0f, 1.0f), start);\n\t// \tif (length2(axis) < 0.01 ) // bad luck, they were parallel, try again!\n\t// \t\taxis = cross(vec3(1.0f, 0.0f, 0.0f), start);\n\n\t// \taxis = normalize(axis);\n\t// \treturn gtx::quaternion::angleAxis(glm::radians(180.0f), axis);\n\t// }\n\tif(cosTheta > (1.0 - 0.0001) || cosTheta < (-1.0 + 0.0001) ){\n\t\taxis = normalize(cross(start, vec3(0.0, 1.0, 0.0)));\n\t\tif (length(axis) < 0.001 ){ // bad luck, they were parallel, try again!\n\t\t\taxis = normalize(cross(start, vec3(1.0, 0.0, 0.0)));\n\t\t}\n\t} else {\n\t\taxis = normalize(cross(start, dest));\n\t}\n\n\tfloat angle = acos(cosTheta);\n\n\treturn quatFromAxisAngle(axis, angle);\n}\nvec4 vectorAlignWithUp(vec3 start, vec3 dest, vec3 up){\n\tvec4 rot1 = vectorAlign(start, dest);\n\tup = normalize(up);\n\n\t// Recompute desiredUp so that it's perpendicular to the direction\n\t// You can skip that part if you really want to force desiredUp\n\t// vec3 right = normalize(cross(dest, up));\n\t// up = normalize(cross(right, dest));\n\n\t// Because of the 1rst rotation, the up is probably completely screwed up.\n\t// Find the rotation between the \"up\" of the rotated object, and the desired up\n\tvec3 newUp = rotateWithQuat(vec3(0.0, 1.0, 0.0), rot1);//rot1 * vec3(0.0, 1.0, 0.0);\n\tvec4 rot2 = vectorAlign(up, newUp);\n\n\t// return rot1;\n\treturn rot2;\n\t// return multQuat(rot1, rot2);\n\t// return rot2 * rot1;\n\n}\n\n// https://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToAngle/index.htm\nfloat quatToAngle(vec4 q){\n\treturn 2.0 * acos(q.w);\n}\nvec3 quatToAxis(vec4 q){\n\treturn vec3(\n\t\tq.x / sqrt(1.0-q.w*q.w),\n\t\tq.y / sqrt(1.0-q.w*q.w),\n\t\tq.z / sqrt(1.0-q.w*q.w)\n\t);\n}\n\nvec4 align(vec3 dir, vec3 up){\n\tvec3 start_dir = vec3(0.0, 0.0, 1.0);\n\tvec3 start_up = vec3(0.0, 1.0, 0.0);\n\tvec4 rot1 = vectorAlign(start_dir, dir);\n\tup = normalize(up);\n\n\t// Recompute desiredUp so that it's perpendicular to the direction\n\t// You can skip that part if you really want to force desiredUp\n\tvec3 right = normalize(cross(dir, up));\n\tif(length(right)<0.001){\n\t\tright = vec3(1.0, 0.0, 0.0);\n\t}\n\tup = normalize(cross(right, dir));\n\n\t// Because of the 1rst rotation, the up is probably completely screwed up.\n\t// Find the rotation between the \"up\" of the rotated object, and the desired up\n\tvec3 newUp = rotateWithQuat(start_up, rot1);//rot1 * vec3(0.0, 1.0, 0.0);\n\tvec4 rot2 = vectorAlign(normalize(newUp), up);\n\n\t// return rot1;\n\treturn quatMult(rot1, rot2);\n\t// return rot2 * rot1;\n\n}\n\n\n\n\n\n\n\n// /geo1/MAT/meshBasicBuilder1/globals1\nuniform float time;\n\n// /geo1/MAT/meshBasicBuilder1/globals1\nvarying vec3 v_POLY_globals1_position;\n\n// /geo1/MAT/meshBasicBuilder1/attribute3\nvarying float varying_v_POLY_attribute3_val;\n\n// /geo1/MAT/meshBasicBuilder1/attribute1\nattribute float id;\n\n// /geo1/MAT/meshBasicBuilder1/instanceTransform1\nattribute vec3 instancePosition;\nattribute vec4 instanceOrientation;\nattribute vec3 instanceScale;\n\n\n\n\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\n\t#include <skinbase_vertex>\n\n\t#ifdef USE_DISPLACEMENTMAP\n\n// removed:\n//\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\n\t#endif\n\n// removed:\n//\t#include <begin_vertex>\n\n\n\n\t// /geo1/MAT/meshBasicBuilder1/attribute1\n\tfloat v_POLY_attribute1_val = id;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/globals1\n\tv_POLY_globals1_position = vec3(position);\n\tfloat v_POLY_globals1_time = time;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/attribute4\n\tfloat v_POLY_attribute4_val = id;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/attribute3\n\tvarying_v_POLY_attribute3_val = float(id);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/round1\n\tfloat v_POLY_round1_val = sign(v_POLY_attribute1_val)*floor(abs(v_POLY_attribute1_val)+0.5);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/round4\n\tfloat v_POLY_round4_val = sign(v_POLY_attribute4_val)*floor(abs(v_POLY_attribute4_val)+0.5);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/floatToVec2_1\n\tvec2 v_POLY_floatToVec2_1_vec2 = vec2(v_POLY_round1_val, 0.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/floatToVec2_3\n\tvec2 v_POLY_floatToVec2_3_vec2 = vec2(v_POLY_round4_val, 64.032);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/random1\n\tfloat v_POLY_random1_rand = rand(v_POLY_floatToVec2_1_vec2);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/random3\n\tfloat v_POLY_random3_rand = rand(v_POLY_floatToVec2_3_vec2);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd9\n\tfloat v_POLY_multAdd9_val = (26.0*(v_POLY_random1_rand + 0.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd11\n\tfloat v_POLY_multAdd11_val = (-4.0*(v_POLY_random3_rand + 0.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/round2\n\tfloat v_POLY_round2_val = sign(v_POLY_multAdd9_val)*floor(abs(v_POLY_multAdd9_val)+0.5);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd4\n\tfloat v_POLY_multAdd4_val = (3.0*(v_POLY_globals1_time + v_POLY_multAdd11_val)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd10\n\tfloat v_POLY_multAdd10_val = (-100.0*(v_POLY_round2_val + 1.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/null1\n\tfloat v_POLY_null1_val = v_POLY_multAdd4_val;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/floatToVec3_1\n\tvec3 v_POLY_floatToVec3_1_vec3 = vec3(0.0, 0.0, v_POLY_multAdd10_val);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/clamp1\n\tfloat v_POLY_clamp1_val = clamp(v_POLY_null1_val, 0.0, 1.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/clamp2\n\tfloat v_POLY_clamp2_val = clamp(v_POLY_null1_val, 1.0, 2.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd6\n\tfloat v_POLY_multAdd6_val = (1.0*(v_POLY_null1_val + -0.33)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/add2\n\tvec3 v_POLY_add2_sum = (v_POLY_floatToVec3_1_vec3 + v_POLY_globals1_position + vec3(0.0, 0.0, 0.0));\n\t\n\t// /geo1/MAT/meshBasicBuilder1/easing1\n\tfloat v_POLY_easing1_out = quadraticInOut(v_POLY_clamp1_val);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd3\n\tfloat v_POLY_multAdd3_val = (1.0*(v_POLY_clamp2_val + -1.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/clamp4\n\tfloat v_POLY_clamp4_val = clamp(v_POLY_multAdd6_val, 1.0, 2.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/null2\n\tvec3 v_POLY_null2_val = v_POLY_add2_sum;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd5\n\tfloat v_POLY_multAdd5_val = (2.0*(v_POLY_multAdd3_val + 0.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd7\n\tfloat v_POLY_multAdd7_val = (1.0*(v_POLY_clamp4_val + -1.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd1\n\tvec3 v_POLY_multAdd1_val = (vec3(2.0, 2.0, 0.5)*(v_POLY_null2_val + vec3(0.0, 0.0, 0.0))) + vec3(0.0, 0.0, 0.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd2\n\tvec3 v_POLY_multAdd2_val = (vec3(0.5, 0.5, 3.0)*(v_POLY_null2_val + vec3(0.0, 0.0, 0.0))) + vec3(0.0, 0.0, 0.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/clamp3\n\tfloat v_POLY_clamp3_val = clamp(v_POLY_multAdd5_val, 0.0, 1.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd8\n\tfloat v_POLY_multAdd8_val = (2.0*(v_POLY_multAdd7_val + 0.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/mix1\n\tvec3 v_POLY_mix1_mix = mix(v_POLY_null2_val, v_POLY_multAdd1_val, v_POLY_easing1_out);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/easing2\n\tfloat v_POLY_easing2_out = quadraticOut(v_POLY_clamp3_val);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/clamp5\n\tfloat v_POLY_clamp5_val = clamp(v_POLY_multAdd8_val, 0.0, 1.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/mix2\n\tvec3 v_POLY_mix2_mix = mix(v_POLY_mix1_mix, v_POLY_multAdd2_val, v_POLY_easing2_out);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/easing3\n\tfloat v_POLY_easing3_out = quadraticOut(v_POLY_clamp5_val);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/rotate1\n\tvec3 v_POLY_rotate1_val = rotateWithAxisAngle(v_POLY_mix2_mix, vec3(0.0, 0.0, 1.0), 1.5707963267948966);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd12\n\tvec3 v_POLY_multAdd12_val = (vec3(1.0, 1.0, 1.0)*(v_POLY_rotate1_val + vec3(0.0, 0.0, 8.4))) + vec3(0.0, 0.0, 0.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/mix3\n\tvec3 v_POLY_mix3_mix = mix(v_POLY_mix2_mix, v_POLY_multAdd12_val, v_POLY_easing3_out);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/instanceTransform1\n\tvec3 v_POLY_instanceTransform1_position = vec3(v_POLY_mix3_mix);\n\tv_POLY_instanceTransform1_position *= instanceScale;\n\tv_POLY_instanceTransform1_position = rotateWithQuat( v_POLY_instanceTransform1_position, instanceOrientation );\n\tv_POLY_instanceTransform1_position += instancePosition;\n\tvec3 v_POLY_instanceTransform1_normal = vec3(normal);\n\tv_POLY_instanceTransform1_normal = rotateWithQuat( v_POLY_instanceTransform1_normal, instanceOrientation );\n\t\n\t// /geo1/MAT/meshBasicBuilder1/output1\n\tvec3 transformed = v_POLY_instanceTransform1_position;\n\tvec3 objectNormal = v_POLY_instanceTransform1_normal;\n\t#ifdef USE_TANGENT\n\t\tvec3 objectTangent = vec3( tangent.xyz );\n\t#endif\n\n\n\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\n\tvWorldPosition = worldPosition.xyz;\n\n}\n","fragmentShader":"\n#define DISTANCE\n\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n\n#include <common>\n\n\n\n// /geo1/MAT/meshBasicBuilder1/hsvToRgb1\n// https://github.com/hughsk/glsl-hsv2rgb\n// https://stackoverflow.com/questions/15095909/from-rgb-to-hsv-in-opengl-glsl\nvec3 hsv2rgb(vec3 c) {\n\tvec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n\tvec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n\treturn c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\n\n\n\n\n\n\n// /geo1/MAT/meshBasicBuilder1/attribute3\nvarying float varying_v_POLY_attribute3_val;\n\n\n\n\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main () {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( 1.0 );\n\n\n\n\t// /geo1/MAT/meshBasicBuilder1/attribute3\n\tfloat v_POLY_attribute3_val = varying_v_POLY_attribute3_val;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/round3\n\tfloat v_POLY_round3_val = sign(v_POLY_attribute3_val)*floor(abs(v_POLY_attribute3_val)+0.5);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/floatToVec2_2\n\tvec2 v_POLY_floatToVec2_2_vec2 = vec2(v_POLY_round3_val, 55.032);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/random2\n\tfloat v_POLY_random2_rand = rand(v_POLY_floatToVec2_2_vec2);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/floatToVec3_2\n\tvec3 v_POLY_floatToVec3_2_vec3 = vec3(v_POLY_random2_rand, 0.96, 0.6);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/hsvToRgb1\n\tvec3 v_POLY_hsvToRgb1_rgb = hsv2rgb(v_POLY_floatToVec3_2_vec3);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/output1\n\tdiffuseColor.xyz = v_POLY_hsvToRgb1_rgb;\n\n\n\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist ); // clamp to [ 0, 1 ]\n\n\tgl_FragColor = packDepthToRGBA( dist );\n\n}\n","shadowSide":null,"lights":false},"customDepthMaterial":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/geo1/MAT/meshBasicBuilder1-customDepthMaterial","type":"ShaderMaterial","name":"customDepthMaterial","depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"glslVersion":null,"uniforms":{"diffuse":{"type":"c","value":15658734},"opacity":{"value":1},"map":{"value":null},"uvTransform":{"type":"m3","value":[1,0,0,0,1,0,0,0,1]},"uv2Transform":{"type":"m3","value":[1,0,0,0,1,0,0,0,1]},"alphaMap":{"value":null},"displacementMap":{"value":null},"displacementScale":{"value":1},"displacementBias":{"value":0}},"defines":{"DEPTH_PACKING":3201},"vertexShader":"\n#include <common>\n\n\n\n// /geo1/MAT/meshBasicBuilder1/easing1\nfloat quadraticInOut(float t) {\n float p = 2.0 * t * t;\n return t < 0.5 ? p : -p + (4.0 * t) - 1.0;\n}\n\n\n\n// /geo1/MAT/meshBasicBuilder1/easing2\nfloat quadraticOut(float t) {\n return -t * (t - 2.0);\n}\n\n\n\n// /geo1/MAT/meshBasicBuilder1/rotate1\n\n\n// https://github.com/mattatz/ShibuyaCrowd/blob/master/source/shaders/common/quaternion.glsl\nvec4 quatMult(vec4 q1, vec4 q2)\n{\n\treturn vec4(\n\tq1.w * q2.x + q1.x * q2.w + q1.z * q2.y - q1.y * q2.z,\n\tq1.w * q2.y + q1.y * q2.w + q1.x * q2.z - q1.z * q2.x,\n\tq1.w * q2.z + q1.z * q2.w + q1.y * q2.x - q1.x * q2.y,\n\tq1.w * q2.w - q1.x * q2.x - q1.y * q2.y - q1.z * q2.z\n\t);\n}\n// http://glmatrix.net/docs/quat.js.html#line97\n// let ax = a[0], ay = a[1], az = a[2], aw = a[3];\n\n// let bx = b[0], by = b[1], bz = b[2], bw = b[3];\n\n// out[0] = ax * bw + aw * bx + ay * bz - az * by;\n\n// out[1] = ay * bw + aw * by + az * bx - ax * bz;\n\n// out[2] = az * bw + aw * bz + ax * by - ay * bx;\n\n// out[3] = aw * bw - ax * bx - ay * by - az * bz;\n\n// return out\n\n\n\n// http://www.neilmendoza.com/glsl-rotation-about-an-arbitrary-axis/\nmat4 rotationMatrix(vec3 axis, float angle)\n{\n\taxis = normalize(axis);\n\tfloat s = sin(angle);\n\tfloat c = cos(angle);\n\tfloat oc = 1.0 - c;\n\n \treturn mat4(oc * axis.x * axis.x + c, oc * axis.x * axis.y - axis.z * s, oc * axis.z * axis.x + axis.y * s, 0.0, oc * axis.x * axis.y + axis.z * s, oc * axis.y * axis.y + c, oc * axis.y * axis.z - axis.x * s, 0.0, oc * axis.z * axis.x - axis.y * s, oc * axis.y * axis.z + axis.x * s, oc * axis.z * axis.z + c, 0.0, 0.0, 0.0, 0.0, 1.0);\n}\n\n// https://www.geeks3d.com/20141201/how-to-rotate-a-vertex-by-a-quaternion-in-glsl/\nvec4 quatFromAxisAngle(vec3 axis, float angle)\n{\n\tvec4 qr;\n\tfloat half_angle = (angle * 0.5); // * 3.14159 / 180.0;\n\tfloat sin_half_angle = sin(half_angle);\n\tqr.x = axis.x * sin_half_angle;\n\tqr.y = axis.y * sin_half_angle;\n\tqr.z = axis.z * sin_half_angle;\n\tqr.w = cos(half_angle);\n\treturn qr;\n}\nvec3 rotateWithAxisAngle(vec3 position, vec3 axis, float angle)\n{\n\tvec4 q = quatFromAxisAngle(axis, angle);\n\tvec3 v = position.xyz;\n\treturn v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);\n}\n// vec3 applyQuaternionToVector( vec4 q, vec3 v ){\n// \treturn v + 2.0 * cross( q.xyz, cross( q.xyz, v ) + q.w * v );\n// }\nvec3 rotateWithQuat( vec3 v, vec4 q )\n{\n\t// vec4 qv = multQuat( quat, vec4(vec, 0.0) );\n\t// return multQuat( qv, vec4(-quat.x, -quat.y, -quat.z, quat.w) ).xyz;\n\treturn v + 2.0 * cross( q.xyz, cross( q.xyz, v ) + q.w * v );\n}\n// https://github.com/glslify/glsl-look-at/blob/gh-pages/index.glsl\n// mat3 rotation_matrix(vec3 origin, vec3 target, float roll) {\n// \tvec3 rr = vec3(sin(roll), cos(roll), 0.0);\n// \tvec3 ww = normalize(target - origin);\n// \tvec3 uu = normalize(cross(ww, rr));\n// \tvec3 vv = normalize(cross(uu, ww));\n\n// \treturn mat3(uu, vv, ww);\n// }\n// mat3 rotation_matrix(vec3 target, float roll) {\n// \tvec3 rr = vec3(sin(roll), cos(roll), 0.0);\n// \tvec3 ww = normalize(target);\n// \tvec3 uu = normalize(cross(ww, rr));\n// \tvec3 vv = normalize(cross(uu, ww));\n\n// \treturn mat3(uu, vv, ww);\n// }\n\nfloat vectorAngle(vec3 start, vec3 dest){\n\tstart = normalize(start);\n\tdest = normalize(dest);\n\n\tfloat cosTheta = dot(start, dest);\n\tvec3 c1 = cross(start, dest);\n\t// We use the dot product of the cross with the Y axis.\n\t// This is a little arbitrary, but can still give a good sense of direction\n\tvec3 y_axis = vec3(0.0, 1.0, 0.0);\n\tfloat d1 = dot(c1, y_axis);\n\tfloat angle = acos(cosTheta) * sign(d1);\n\treturn angle;\n}\n\n// http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-17-quaternions/#i-need-an-equivalent-of-glulookat-how-do-i-orient-an-object-towards-a-point-\nvec4 vectorAlign(vec3 start, vec3 dest){\n\tstart = normalize(start);\n\tdest = normalize(dest);\n\n\tfloat cosTheta = dot(start, dest);\n\tvec3 axis;\n\n\t// if (cosTheta < -1 + 0.001f){\n\t// \t// special case when vectors in opposite directions:\n\t// \t// there is no \"ideal\" rotation axis\n\t// \t// So guess one; any will do as long as it's perpendicular to start\n\t// \taxis = cross(vec3(0.0f, 0.0f, 1.0f), start);\n\t// \tif (length2(axis) < 0.01 ) // bad luck, they were parallel, try again!\n\t// \t\taxis = cross(vec3(1.0f, 0.0f, 0.0f), start);\n\n\t// \taxis = normalize(axis);\n\t// \treturn gtx::quaternion::angleAxis(glm::radians(180.0f), axis);\n\t// }\n\tif(cosTheta > (1.0 - 0.0001) || cosTheta < (-1.0 + 0.0001) ){\n\t\taxis = normalize(cross(start, vec3(0.0, 1.0, 0.0)));\n\t\tif (length(axis) < 0.001 ){ // bad luck, they were parallel, try again!\n\t\t\taxis = normalize(cross(start, vec3(1.0, 0.0, 0.0)));\n\t\t}\n\t} else {\n\t\taxis = normalize(cross(start, dest));\n\t}\n\n\tfloat angle = acos(cosTheta);\n\n\treturn quatFromAxisAngle(axis, angle);\n}\nvec4 vectorAlignWithUp(vec3 start, vec3 dest, vec3 up){\n\tvec4 rot1 = vectorAlign(start, dest);\n\tup = normalize(up);\n\n\t// Recompute desiredUp so that it's perpendicular to the direction\n\t// You can skip that part if you really want to force desiredUp\n\t// vec3 right = normalize(cross(dest, up));\n\t// up = normalize(cross(right, dest));\n\n\t// Because of the 1rst rotation, the up is probably completely screwed up.\n\t// Find the rotation between the \"up\" of the rotated object, and the desired up\n\tvec3 newUp = rotateWithQuat(vec3(0.0, 1.0, 0.0), rot1);//rot1 * vec3(0.0, 1.0, 0.0);\n\tvec4 rot2 = vectorAlign(up, newUp);\n\n\t// return rot1;\n\treturn rot2;\n\t// return multQuat(rot1, rot2);\n\t// return rot2 * rot1;\n\n}\n\n// https://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToAngle/index.htm\nfloat quatToAngle(vec4 q){\n\treturn 2.0 * acos(q.w);\n}\nvec3 quatToAxis(vec4 q){\n\treturn vec3(\n\t\tq.x / sqrt(1.0-q.w*q.w),\n\t\tq.y / sqrt(1.0-q.w*q.w),\n\t\tq.z / sqrt(1.0-q.w*q.w)\n\t);\n}\n\nvec4 align(vec3 dir, vec3 up){\n\tvec3 start_dir = vec3(0.0, 0.0, 1.0);\n\tvec3 start_up = vec3(0.0, 1.0, 0.0);\n\tvec4 rot1 = vectorAlign(start_dir, dir);\n\tup = normalize(up);\n\n\t// Recompute desiredUp so that it's perpendicular to the direction\n\t// You can skip that part if you really want to force desiredUp\n\tvec3 right = normalize(cross(dir, up));\n\tif(length(right)<0.001){\n\t\tright = vec3(1.0, 0.0, 0.0);\n\t}\n\tup = normalize(cross(right, dir));\n\n\t// Because of the 1rst rotation, the up is probably completely screwed up.\n\t// Find the rotation between the \"up\" of the rotated object, and the desired up\n\tvec3 newUp = rotateWithQuat(start_up, rot1);//rot1 * vec3(0.0, 1.0, 0.0);\n\tvec4 rot2 = vectorAlign(normalize(newUp), up);\n\n\t// return rot1;\n\treturn quatMult(rot1, rot2);\n\t// return rot2 * rot1;\n\n}\n\n\n\n\n\n\n\n// /geo1/MAT/meshBasicBuilder1/globals1\nuniform float time;\n\n// /geo1/MAT/meshBasicBuilder1/globals1\nvarying vec3 v_POLY_globals1_position;\n\n// /geo1/MAT/meshBasicBuilder1/attribute3\nvarying float varying_v_POLY_attribute3_val;\n\n// /geo1/MAT/meshBasicBuilder1/attribute1\nattribute float id;\n\n// /geo1/MAT/meshBasicBuilder1/instanceTransform1\nattribute vec3 instancePosition;\nattribute vec4 instanceOrientation;\nattribute vec3 instanceScale;\n\n\n\n\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\n// This is used for computing an equivalent of gl_FragCoord.z that is as high precision as possible.\n// Some platforms compute gl_FragCoord at a lower precision which makes the manually computed value better for\n// depth-based postprocessing effects. Reproduced on iPad with A10 processor / iPadOS 13.3.1.\nvarying vec2 vHighPrecisionZW;\n\nvoid main() {\n\n\t#include <uv_vertex>\n\n\t#include <skinbase_vertex>\n\n\t#ifdef USE_DISPLACEMENTMAP\n\n// removed:\n//\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\n\t#endif\n\n// removed:\n//\t#include <begin_vertex>\n\n\n\n\t// /geo1/MAT/meshBasicBuilder1/attribute1\n\tfloat v_POLY_attribute1_val = id;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/globals1\n\tv_POLY_globals1_position = vec3(position);\n\tfloat v_POLY_globals1_time = time;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/attribute4\n\tfloat v_POLY_attribute4_val = id;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/attribute3\n\tvarying_v_POLY_attribute3_val = float(id);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/round1\n\tfloat v_POLY_round1_val = sign(v_POLY_attribute1_val)*floor(abs(v_POLY_attribute1_val)+0.5);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/round4\n\tfloat v_POLY_round4_val = sign(v_POLY_attribute4_val)*floor(abs(v_POLY_attribute4_val)+0.5);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/floatToVec2_1\n\tvec2 v_POLY_floatToVec2_1_vec2 = vec2(v_POLY_round1_val, 0.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/floatToVec2_3\n\tvec2 v_POLY_floatToVec2_3_vec2 = vec2(v_POLY_round4_val, 64.032);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/random1\n\tfloat v_POLY_random1_rand = rand(v_POLY_floatToVec2_1_vec2);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/random3\n\tfloat v_POLY_random3_rand = rand(v_POLY_floatToVec2_3_vec2);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd9\n\tfloat v_POLY_multAdd9_val = (26.0*(v_POLY_random1_rand + 0.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd11\n\tfloat v_POLY_multAdd11_val = (-4.0*(v_POLY_random3_rand + 0.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/round2\n\tfloat v_POLY_round2_val = sign(v_POLY_multAdd9_val)*floor(abs(v_POLY_multAdd9_val)+0.5);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd4\n\tfloat v_POLY_multAdd4_val = (3.0*(v_POLY_globals1_time + v_POLY_multAdd11_val)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd10\n\tfloat v_POLY_multAdd10_val = (-100.0*(v_POLY_round2_val + 1.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/null1\n\tfloat v_POLY_null1_val = v_POLY_multAdd4_val;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/floatToVec3_1\n\tvec3 v_POLY_floatToVec3_1_vec3 = vec3(0.0, 0.0, v_POLY_multAdd10_val);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/clamp1\n\tfloat v_POLY_clamp1_val = clamp(v_POLY_null1_val, 0.0, 1.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/clamp2\n\tfloat v_POLY_clamp2_val = clamp(v_POLY_null1_val, 1.0, 2.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd6\n\tfloat v_POLY_multAdd6_val = (1.0*(v_POLY_null1_val + -0.33)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/add2\n\tvec3 v_POLY_add2_sum = (v_POLY_floatToVec3_1_vec3 + v_POLY_globals1_position + vec3(0.0, 0.0, 0.0));\n\t\n\t// /geo1/MAT/meshBasicBuilder1/easing1\n\tfloat v_POLY_easing1_out = quadraticInOut(v_POLY_clamp1_val);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd3\n\tfloat v_POLY_multAdd3_val = (1.0*(v_POLY_clamp2_val + -1.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/clamp4\n\tfloat v_POLY_clamp4_val = clamp(v_POLY_multAdd6_val, 1.0, 2.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/null2\n\tvec3 v_POLY_null2_val = v_POLY_add2_sum;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd5\n\tfloat v_POLY_multAdd5_val = (2.0*(v_POLY_multAdd3_val + 0.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd7\n\tfloat v_POLY_multAdd7_val = (1.0*(v_POLY_clamp4_val + -1.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd1\n\tvec3 v_POLY_multAdd1_val = (vec3(2.0, 2.0, 0.5)*(v_POLY_null2_val + vec3(0.0, 0.0, 0.0))) + vec3(0.0, 0.0, 0.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd2\n\tvec3 v_POLY_multAdd2_val = (vec3(0.5, 0.5, 3.0)*(v_POLY_null2_val + vec3(0.0, 0.0, 0.0))) + vec3(0.0, 0.0, 0.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/clamp3\n\tfloat v_POLY_clamp3_val = clamp(v_POLY_multAdd5_val, 0.0, 1.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd8\n\tfloat v_POLY_multAdd8_val = (2.0*(v_POLY_multAdd7_val + 0.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/mix1\n\tvec3 v_POLY_mix1_mix = mix(v_POLY_null2_val, v_POLY_multAdd1_val, v_POLY_easing1_out);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/easing2\n\tfloat v_POLY_easing2_out = quadraticOut(v_POLY_clamp3_val);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/clamp5\n\tfloat v_POLY_clamp5_val = clamp(v_POLY_multAdd8_val, 0.0, 1.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/mix2\n\tvec3 v_POLY_mix2_mix = mix(v_POLY_mix1_mix, v_POLY_multAdd2_val, v_POLY_easing2_out);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/easing3\n\tfloat v_POLY_easing3_out = quadraticOut(v_POLY_clamp5_val);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/rotate1\n\tvec3 v_POLY_rotate1_val = rotateWithAxisAngle(v_POLY_mix2_mix, vec3(0.0, 0.0, 1.0), 1.5707963267948966);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd12\n\tvec3 v_POLY_multAdd12_val = (vec3(1.0, 1.0, 1.0)*(v_POLY_rotate1_val + vec3(0.0, 0.0, 8.4))) + vec3(0.0, 0.0, 0.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/mix3\n\tvec3 v_POLY_mix3_mix = mix(v_POLY_mix2_mix, v_POLY_multAdd12_val, v_POLY_easing3_out);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/instanceTransform1\n\tvec3 v_POLY_instanceTransform1_position = vec3(v_POLY_mix3_mix);\n\tv_POLY_instanceTransform1_position *= instanceScale;\n\tv_POLY_instanceTransform1_position = rotateWithQuat( v_POLY_instanceTransform1_position, instanceOrientation );\n\tv_POLY_instanceTransform1_position += instancePosition;\n\tvec3 v_POLY_instanceTransform1_normal = vec3(normal);\n\tv_POLY_instanceTransform1_normal = rotateWithQuat( v_POLY_instanceTransform1_normal, instanceOrientation );\n\t\n\t// /geo1/MAT/meshBasicBuilder1/output1\n\tvec3 transformed = v_POLY_instanceTransform1_position;\n\tvec3 objectNormal = v_POLY_instanceTransform1_normal;\n\t#ifdef USE_TANGENT\n\t\tvec3 objectTangent = vec3( tangent.xyz );\n\t#endif\n\n\n\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\n\tvHighPrecisionZW = gl_Position.zw;\n\n}\n","fragmentShader":"\n#if DEPTH_PACKING == 3200\n\n\tuniform float opacity;\n\n#endif\n\n#include <common>\n\n\n\n// /geo1/MAT/meshBasicBuilder1/hsvToRgb1\n// https://github.com/hughsk/glsl-hsv2rgb\n// https://stackoverflow.com/questions/15095909/from-rgb-to-hsv-in-opengl-glsl\nvec3 hsv2rgb(vec3 c) {\n\tvec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n\tvec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n\treturn c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\n\n\n\n\n\n\n// /geo1/MAT/meshBasicBuilder1/attribute3\nvarying float varying_v_POLY_attribute3_val;\n\n\n\n\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvarying vec2 vHighPrecisionZW;\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( 1.0 );\n\n\n\n\t// /geo1/MAT/meshBasicBuilder1/attribute3\n\tfloat v_POLY_attribute3_val = varying_v_POLY_attribute3_val;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/round3\n\tfloat v_POLY_round3_val = sign(v_POLY_attribute3_val)*floor(abs(v_POLY_attribute3_val)+0.5);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/floatToVec2_2\n\tvec2 v_POLY_floatToVec2_2_vec2 = vec2(v_POLY_round3_val, 55.032);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/random2\n\tfloat v_POLY_random2_rand = rand(v_POLY_floatToVec2_2_vec2);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/floatToVec3_2\n\tvec3 v_POLY_floatToVec3_2_vec3 = vec3(v_POLY_random2_rand, 0.96, 0.6);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/hsvToRgb1\n\tvec3 v_POLY_hsvToRgb1_rgb = hsv2rgb(v_POLY_floatToVec3_2_vec3);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/output1\n\tdiffuseColor.xyz = v_POLY_hsvToRgb1_rgb;\n\n\n\n\n\t#if DEPTH_PACKING == 3200\n\n\t\tdiffuseColor.a = opacity;\n\n\t#endif\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\n\t#include <logdepthbuf_fragment>\n\n\t// Higher precision equivalent of gl_FragCoord.z. This assumes depthRange has been left to its default values.\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\n\t#if DEPTH_PACKING == 3200\n\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\n\t#elif DEPTH_PACKING == 3201\n\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\n\t#endif\n\n}\n","shadowSide":null,"lights":false},"customDepthDOFMaterial":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/geo1/MAT/meshBasicBuilder1-customDepthDOFMaterial","type":"ShaderMaterial","name":"customDepthDOFMaterial","depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"glslVersion":null,"uniforms":{"mNear":{"value":0},"mFar":{"value":10}},"vertexShader":"#include <common>\n\nvarying float vViewZDepth;\n\n// INSERT DEFINES\n\n\n\n// /geo1/MAT/meshBasicBuilder1/easing1\nfloat quadraticInOut(float t) {\n float p = 2.0 * t * t;\n return t < 0.5 ? p : -p + (4.0 * t) - 1.0;\n}\n\n\n\n// /geo1/MAT/meshBasicBuilder1/easing2\nfloat quadraticOut(float t) {\n return -t * (t - 2.0);\n}\n\n\n\n// /geo1/MAT/meshBasicBuilder1/rotate1\n\n\n// https://github.com/mattatz/ShibuyaCrowd/blob/master/source/shaders/common/quaternion.glsl\nvec4 quatMult(vec4 q1, vec4 q2)\n{\n\treturn vec4(\n\tq1.w * q2.x + q1.x * q2.w + q1.z * q2.y - q1.y * q2.z,\n\tq1.w * q2.y + q1.y * q2.w + q1.x * q2.z - q1.z * q2.x,\n\tq1.w * q2.z + q1.z * q2.w + q1.y * q2.x - q1.x * q2.y,\n\tq1.w * q2.w - q1.x * q2.x - q1.y * q2.y - q1.z * q2.z\n\t);\n}\n// http://glmatrix.net/docs/quat.js.html#line97\n// let ax = a[0], ay = a[1], az = a[2], aw = a[3];\n\n// let bx = b[0], by = b[1], bz = b[2], bw = b[3];\n\n// out[0] = ax * bw + aw * bx + ay * bz - az * by;\n\n// out[1] = ay * bw + aw * by + az * bx - ax * bz;\n\n// out[2] = az * bw + aw * bz + ax * by - ay * bx;\n\n// out[3] = aw * bw - ax * bx - ay * by - az * bz;\n\n// return out\n\n\n\n// http://www.neilmendoza.com/glsl-rotation-about-an-arbitrary-axis/\nmat4 rotationMatrix(vec3 axis, float angle)\n{\n\taxis = normalize(axis);\n\tfloat s = sin(angle);\n\tfloat c = cos(angle);\n\tfloat oc = 1.0 - c;\n\n \treturn mat4(oc * axis.x * axis.x + c, oc * axis.x * axis.y - axis.z * s, oc * axis.z * axis.x + axis.y * s, 0.0, oc * axis.x * axis.y + axis.z * s, oc * axis.y * axis.y + c, oc * axis.y * axis.z - axis.x * s, 0.0, oc * axis.z * axis.x - axis.y * s, oc * axis.y * axis.z + axis.x * s, oc * axis.z * axis.z + c, 0.0, 0.0, 0.0, 0.0, 1.0);\n}\n\n// https://www.geeks3d.com/20141201/how-to-rotate-a-vertex-by-a-quaternion-in-glsl/\nvec4 quatFromAxisAngle(vec3 axis, float angle)\n{\n\tvec4 qr;\n\tfloat half_angle = (angle * 0.5); // * 3.14159 / 180.0;\n\tfloat sin_half_angle = sin(half_angle);\n\tqr.x = axis.x * sin_half_angle;\n\tqr.y = axis.y * sin_half_angle;\n\tqr.z = axis.z * sin_half_angle;\n\tqr.w = cos(half_angle);\n\treturn qr;\n}\nvec3 rotateWithAxisAngle(vec3 position, vec3 axis, float angle)\n{\n\tvec4 q = quatFromAxisAngle(axis, angle);\n\tvec3 v = position.xyz;\n\treturn v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);\n}\n// vec3 applyQuaternionToVector( vec4 q, vec3 v ){\n// \treturn v + 2.0 * cross( q.xyz, cross( q.xyz, v ) + q.w * v );\n// }\nvec3 rotateWithQuat( vec3 v, vec4 q )\n{\n\t// vec4 qv = multQuat( quat, vec4(vec, 0.0) );\n\t// return multQuat( qv, vec4(-quat.x, -quat.y, -quat.z, quat.w) ).xyz;\n\treturn v + 2.0 * cross( q.xyz, cross( q.xyz, v ) + q.w * v );\n}\n// https://github.com/glslify/glsl-look-at/blob/gh-pages/index.glsl\n// mat3 rotation_matrix(vec3 origin, vec3 target, float roll) {\n// \tvec3 rr = vec3(sin(roll), cos(roll), 0.0);\n// \tvec3 ww = normalize(target - origin);\n// \tvec3 uu = normalize(cross(ww, rr));\n// \tvec3 vv = normalize(cross(uu, ww));\n\n// \treturn mat3(uu, vv, ww);\n// }\n// mat3 rotation_matrix(vec3 target, float roll) {\n// \tvec3 rr = vec3(sin(roll), cos(roll), 0.0);\n// \tvec3 ww = normalize(target);\n// \tvec3 uu = normalize(cross(ww, rr));\n// \tvec3 vv = normalize(cross(uu, ww));\n\n// \treturn mat3(uu, vv, ww);\n// }\n\nfloat vectorAngle(vec3 start, vec3 dest){\n\tstart = normalize(start);\n\tdest = normalize(dest);\n\n\tfloat cosTheta = dot(start, dest);\n\tvec3 c1 = cross(start, dest);\n\t// We use the dot product of the cross with the Y axis.\n\t// This is a little arbitrary, but can still give a good sense of direction\n\tvec3 y_axis = vec3(0.0, 1.0, 0.0);\n\tfloat d1 = dot(c1, y_axis);\n\tfloat angle = acos(cosTheta) * sign(d1);\n\treturn angle;\n}\n\n// http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-17-quaternions/#i-need-an-equivalent-of-glulookat-how-do-i-orient-an-object-towards-a-point-\nvec4 vectorAlign(vec3 start, vec3 dest){\n\tstart = normalize(start);\n\tdest = normalize(dest);\n\n\tfloat cosTheta = dot(start, dest);\n\tvec3 axis;\n\n\t// if (cosTheta < -1 + 0.001f){\n\t// \t// special case when vectors in opposite directions:\n\t// \t// there is no \"ideal\" rotation axis\n\t// \t// So guess one; any will do as long as it's perpendicular to start\n\t// \taxis = cross(vec3(0.0f, 0.0f, 1.0f), start);\n\t// \tif (length2(axis) < 0.01 ) // bad luck, they were parallel, try again!\n\t// \t\taxis = cross(vec3(1.0f, 0.0f, 0.0f), start);\n\n\t// \taxis = normalize(axis);\n\t// \treturn gtx::quaternion::angleAxis(glm::radians(180.0f), axis);\n\t// }\n\tif(cosTheta > (1.0 - 0.0001) || cosTheta < (-1.0 + 0.0001) ){\n\t\taxis = normalize(cross(start, vec3(0.0, 1.0, 0.0)));\n\t\tif (length(axis) < 0.001 ){ // bad luck, they were parallel, try again!\n\t\t\taxis = normalize(cross(start, vec3(1.0, 0.0, 0.0)));\n\t\t}\n\t} else {\n\t\taxis = normalize(cross(start, dest));\n\t}\n\n\tfloat angle = acos(cosTheta);\n\n\treturn quatFromAxisAngle(axis, angle);\n}\nvec4 vectorAlignWithUp(vec3 start, vec3 dest, vec3 up){\n\tvec4 rot1 = vectorAlign(start, dest);\n\tup = normalize(up);\n\n\t// Recompute desiredUp so that it's perpendicular to the direction\n\t// You can skip that part if you really want to force desiredUp\n\t// vec3 right = normalize(cross(dest, up));\n\t// up = normalize(cross(right, dest));\n\n\t// Because of the 1rst rotation, the up is probably completely screwed up.\n\t// Find the rotation between the \"up\" of the rotated object, and the desired up\n\tvec3 newUp = rotateWithQuat(vec3(0.0, 1.0, 0.0), rot1);//rot1 * vec3(0.0, 1.0, 0.0);\n\tvec4 rot2 = vectorAlign(up, newUp);\n\n\t// return rot1;\n\treturn rot2;\n\t// return multQuat(rot1, rot2);\n\t// return rot2 * rot1;\n\n}\n\n// https://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToAngle/index.htm\nfloat quatToAngle(vec4 q){\n\treturn 2.0 * acos(q.w);\n}\nvec3 quatToAxis(vec4 q){\n\treturn vec3(\n\t\tq.x / sqrt(1.0-q.w*q.w),\n\t\tq.y / sqrt(1.0-q.w*q.w),\n\t\tq.z / sqrt(1.0-q.w*q.w)\n\t);\n}\n\nvec4 align(vec3 dir, vec3 up){\n\tvec3 start_dir = vec3(0.0, 0.0, 1.0);\n\tvec3 start_up = vec3(0.0, 1.0, 0.0);\n\tvec4 rot1 = vectorAlign(start_dir, dir);\n\tup = normalize(up);\n\n\t// Recompute desiredUp so that it's perpendicular to the direction\n\t// You can skip that part if you really want to force desiredUp\n\tvec3 right = normalize(cross(dir, up));\n\tif(length(right)<0.001){\n\t\tright = vec3(1.0, 0.0, 0.0);\n\t}\n\tup = normalize(cross(right, dir));\n\n\t// Because of the 1rst rotation, the up is probably completely screwed up.\n\t// Find the rotation between the \"up\" of the rotated object, and the desired up\n\tvec3 newUp = rotateWithQuat(start_up, rot1);//rot1 * vec3(0.0, 1.0, 0.0);\n\tvec4 rot2 = vectorAlign(normalize(newUp), up);\n\n\t// return rot1;\n\treturn quatMult(rot1, rot2);\n\t// return rot2 * rot1;\n\n}\n\n\n\n\n\n\n\n// /geo1/MAT/meshBasicBuilder1/globals1\nuniform float time;\n\n// /geo1/MAT/meshBasicBuilder1/globals1\nvarying vec3 v_POLY_globals1_position;\n\n// /geo1/MAT/meshBasicBuilder1/attribute3\nvarying float varying_v_POLY_attribute3_val;\n\n// /geo1/MAT/meshBasicBuilder1/attribute1\nattribute float id;\n\n// /geo1/MAT/meshBasicBuilder1/instanceTransform1\nattribute vec3 instancePosition;\nattribute vec4 instanceOrientation;\nattribute vec3 instanceScale;\n\n\n\n\n\n\n\nvoid main() {\n\n\t// INSERT BODY\n\n\n\n\t// /geo1/MAT/meshBasicBuilder1/attribute1\n\tfloat v_POLY_attribute1_val = id;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/globals1\n\tv_POLY_globals1_position = vec3(position);\n\tfloat v_POLY_globals1_time = time;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/attribute4\n\tfloat v_POLY_attribute4_val = id;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/attribute3\n\tvarying_v_POLY_attribute3_val = float(id);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/round1\n\tfloat v_POLY_round1_val = sign(v_POLY_attribute1_val)*floor(abs(v_POLY_attribute1_val)+0.5);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/round4\n\tfloat v_POLY_round4_val = sign(v_POLY_attribute4_val)*floor(abs(v_POLY_attribute4_val)+0.5);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/floatToVec2_1\n\tvec2 v_POLY_floatToVec2_1_vec2 = vec2(v_POLY_round1_val, 0.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/floatToVec2_3\n\tvec2 v_POLY_floatToVec2_3_vec2 = vec2(v_POLY_round4_val, 64.032);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/random1\n\tfloat v_POLY_random1_rand = rand(v_POLY_floatToVec2_1_vec2);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/random3\n\tfloat v_POLY_random3_rand = rand(v_POLY_floatToVec2_3_vec2);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd9\n\tfloat v_POLY_multAdd9_val = (26.0*(v_POLY_random1_rand + 0.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd11\n\tfloat v_POLY_multAdd11_val = (-4.0*(v_POLY_random3_rand + 0.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/round2\n\tfloat v_POLY_round2_val = sign(v_POLY_multAdd9_val)*floor(abs(v_POLY_multAdd9_val)+0.5);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd4\n\tfloat v_POLY_multAdd4_val = (3.0*(v_POLY_globals1_time + v_POLY_multAdd11_val)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd10\n\tfloat v_POLY_multAdd10_val = (-100.0*(v_POLY_round2_val + 1.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/null1\n\tfloat v_POLY_null1_val = v_POLY_multAdd4_val;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/floatToVec3_1\n\tvec3 v_POLY_floatToVec3_1_vec3 = vec3(0.0, 0.0, v_POLY_multAdd10_val);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/clamp1\n\tfloat v_POLY_clamp1_val = clamp(v_POLY_null1_val, 0.0, 1.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/clamp2\n\tfloat v_POLY_clamp2_val = clamp(v_POLY_null1_val, 1.0, 2.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd6\n\tfloat v_POLY_multAdd6_val = (1.0*(v_POLY_null1_val + -0.33)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/add2\n\tvec3 v_POLY_add2_sum = (v_POLY_floatToVec3_1_vec3 + v_POLY_globals1_position + vec3(0.0, 0.0, 0.0));\n\t\n\t// /geo1/MAT/meshBasicBuilder1/easing1\n\tfloat v_POLY_easing1_out = quadraticInOut(v_POLY_clamp1_val);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd3\n\tfloat v_POLY_multAdd3_val = (1.0*(v_POLY_clamp2_val + -1.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/clamp4\n\tfloat v_POLY_clamp4_val = clamp(v_POLY_multAdd6_val, 1.0, 2.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/null2\n\tvec3 v_POLY_null2_val = v_POLY_add2_sum;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd5\n\tfloat v_POLY_multAdd5_val = (2.0*(v_POLY_multAdd3_val + 0.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd7\n\tfloat v_POLY_multAdd7_val = (1.0*(v_POLY_clamp4_val + -1.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd1\n\tvec3 v_POLY_multAdd1_val = (vec3(2.0, 2.0, 0.5)*(v_POLY_null2_val + vec3(0.0, 0.0, 0.0))) + vec3(0.0, 0.0, 0.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd2\n\tvec3 v_POLY_multAdd2_val = (vec3(0.5, 0.5, 3.0)*(v_POLY_null2_val + vec3(0.0, 0.0, 0.0))) + vec3(0.0, 0.0, 0.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/clamp3\n\tfloat v_POLY_clamp3_val = clamp(v_POLY_multAdd5_val, 0.0, 1.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd8\n\tfloat v_POLY_multAdd8_val = (2.0*(v_POLY_multAdd7_val + 0.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshBasicBuilder1/mix1\n\tvec3 v_POLY_mix1_mix = mix(v_POLY_null2_val, v_POLY_multAdd1_val, v_POLY_easing1_out);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/easing2\n\tfloat v_POLY_easing2_out = quadraticOut(v_POLY_clamp3_val);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/clamp5\n\tfloat v_POLY_clamp5_val = clamp(v_POLY_multAdd8_val, 0.0, 1.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/mix2\n\tvec3 v_POLY_mix2_mix = mix(v_POLY_mix1_mix, v_POLY_multAdd2_val, v_POLY_easing2_out);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/easing3\n\tfloat v_POLY_easing3_out = quadraticOut(v_POLY_clamp5_val);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/rotate1\n\tvec3 v_POLY_rotate1_val = rotateWithAxisAngle(v_POLY_mix2_mix, vec3(0.0, 0.0, 1.0), 1.5707963267948966);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/multAdd12\n\tvec3 v_POLY_multAdd12_val = (vec3(1.0, 1.0, 1.0)*(v_POLY_rotate1_val + vec3(0.0, 0.0, 8.4))) + vec3(0.0, 0.0, 0.0);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/mix3\n\tvec3 v_POLY_mix3_mix = mix(v_POLY_mix2_mix, v_POLY_multAdd12_val, v_POLY_easing3_out);\n\t\n\t// /geo1/MAT/meshBasicBuilder1/instanceTransform1\n\tvec3 v_POLY_instanceTransform1_position = vec3(v_POLY_mix3_mix);\n\tv_POLY_instanceTransform1_position *= instanceScale;\n\tv_POLY_instanceTransform1_position = rotateWithQuat( v_POLY_instanceTransform1_position, instanceOrientation );\n\tv_POLY_instanceTransform1_position += instancePosition;\n\tvec3 v_POLY_instanceTransform1_normal = vec3(normal);\n\tv_POLY_instanceTransform1_normal = rotateWithQuat( v_POLY_instanceTransform1_normal, instanceOrientation );\n\t\n\t// /geo1/MAT/meshBasicBuilder1/output1\n\tvec3 transformed = v_POLY_instanceTransform1_position;\n\tvec3 objectNormal = v_POLY_instanceTransform1_normal;\n\t#ifdef USE_TANGENT\n\t\tvec3 objectTangent = vec3( tangent.xyz );\n\t#endif\n\n\n\n\n\n\t#include <project_vertex>\n\n\tvViewZDepth = - mvPosition.z;\n}","fragmentShader":"uniform float mNear;\nuniform float mFar;\n\nvarying float vViewZDepth;\n\nvoid main() {\n\n\tfloat color = 1.0 - smoothstep( mNear, mFar, vViewZDepth );\n\tgl_FragColor = vec4( vec3( color ), 1.0 );\n\n}\n","shadowSide":null,"lights":false}}}},"meshBasicBuilder_DISAPPEARED":{"type":"meshBasicBuilder","nodes":{"attribute3":{"type":"attribute","params":{"name":"id"},"connection_points":{"in":[],"out":[{"name":"val","type":"float"}]}},"floatToVec2_2":{"type":"floatToVec2","params":{"y":55.032},"inputs":[{"index":0,"node":"round3","output":"val"}]},"floatToVec3_2":{"type":"floatToVec3","params":{"y":0.79,"z":0.6},"inputs":[{"index":0,"node":"random2","output":"rand"}]},"hsvToRgb1":{"type":"hsvToRgb","inputs":[{"index":0,"node":"floatToVec3_2","output":"vec3"}]},"output1":{"type":"output","inputs":[null,null,{"index":2,"node":"hsvToRgb1","output":"rgb"}]},"random2":{"type":"random","inputs":[{"index":0,"node":"floatToVec2_2","output":"vec2"}]},"round3":{"type":"round","params":{"in":{"type":"float","default_value":0,"options":{"spare":true}}},"inputs":[{"index":0,"node":"attribute1","output":"val"}],"connection_points":{"in":[{"name":"in","type":"float"}],"out":[{"name":"val","type":"float"}]}},"attribute1":{"type":"attribute","params":{"name":"letterId"},"connection_points":{"in":[],"out":[{"name":"val","type":"float"}]}}},"selection":["floatToVec3_2"],"persisted_config":{"material":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/geo1/MAT/meshBasicBuilder_DISAPPEARED-main","type":"ShaderMaterial","name":"/geo1/MAT/meshBasicBuilder_DISAPPEARED","depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"glslVersion":null,"uniforms":{"diffuse":{"type":"c","value":15658734},"opacity":{"value":1},"map":{"value":null},"uvTransform":{"type":"m3","value":[1,0,0,0,1,0,0,0,1]},"uv2Transform":{"type":"m3","value":[1,0,0,0,1,0,0,0,1]},"alphaMap":{"value":null},"specularMap":{"value":null},"envMap":{"value":null},"flipEnvMap":{"value":-1},"reflectivity":{"value":1},"refractionRatio":{"value":0.98},"maxMipLevel":{"value":0},"aoMap":{"value":null},"aoMapIntensity":{"value":1},"lightMap":{"value":null},"lightMapIntensity":{"value":1},"fogDensity":{"value":0.00025},"fogNear":{"value":1},"fogFar":{"value":2000},"fogColor":{"type":"c","value":16777215}},"vertexShader":"\n#include <common>\n\n\n\n// /geo1/MAT/meshBasicBuilder_DISAPPEARED/attribute1\nvarying float varying_v_POLY_attribute1_val;\n\n// /geo1/MAT/meshBasicBuilder_DISAPPEARED/attribute1\nattribute float letterId;\n\n\n\n\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\n\n\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/attribute1\n\tvarying_v_POLY_attribute1_val = float(letterId);\n\t\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/output1\n\tvec3 transformed = position;\n\tvec3 objectNormal = normal;\n\t#ifdef USE_TANGENT\n\t\tvec3 objectTangent = vec3( tangent.xyz );\n\t#endif\n\n\n\n\t#include <skinbase_vertex>\n\n\t#ifdef USE_ENVMAP\n\n// removed:\n//\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\n\t#endif\n\n// removed:\n//\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n\n}\n","fragmentShader":"\nuniform vec3 diffuse;\nuniform float opacity;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n\n#include <common>\n\n\n\n// /geo1/MAT/meshBasicBuilder_DISAPPEARED/hsvToRgb1\n// https://github.com/hughsk/glsl-hsv2rgb\n// https://stackoverflow.com/questions/15095909/from-rgb-to-hsv-in-opengl-glsl\nvec3 hsv2rgb(vec3 c) {\n\tvec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n\tvec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n\treturn c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\n\n\n\n\n\n\n// /geo1/MAT/meshBasicBuilder_DISAPPEARED/attribute1\nvarying float varying_v_POLY_attribute1_val;\n\n\n\n\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\n\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/attribute1\n\tfloat v_POLY_attribute1_val = varying_v_POLY_attribute1_val;\n\t\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/round3\n\tfloat v_POLY_round3_val = sign(v_POLY_attribute1_val)*floor(abs(v_POLY_attribute1_val)+0.5);\n\t\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/floatToVec2_2\n\tvec2 v_POLY_floatToVec2_2_vec2 = vec2(v_POLY_round3_val, 55.032);\n\t\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/random2\n\tfloat v_POLY_random2_rand = rand(v_POLY_floatToVec2_2_vec2);\n\t\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/floatToVec3_2\n\tvec3 v_POLY_floatToVec3_2_vec3 = vec3(v_POLY_random2_rand, 0.79, 0.6);\n\t\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/hsvToRgb1\n\tvec3 v_POLY_hsvToRgb1_rgb = hsv2rgb(v_POLY_floatToVec3_2_vec3);\n\t\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/output1\n\tdiffuseColor.xyz = v_POLY_hsvToRgb1_rgb;\n\n\n\n\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\n\t// accumulation (baked indirect lighting only)\n\t#ifdef USE_LIGHTMAP\n\t\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\n\t#else\n\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\n\t#endif\n\n\t// modulation\n\t#include <aomap_fragment>\n\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\n\t#include <envmap_fragment>\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n\n}\n","shadowSide":null,"lights":false},"uniforms_time_dependent":false,"uniforms_resolution_dependent":false,"param_uniform_pairs":[],"customMaterials":{"customDistanceMaterial":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/geo1/MAT/meshBasicBuilder_DISAPPEARED-customDistanceMaterial","type":"ShaderMaterial","name":"customDistanceMaterial","depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"glslVersion":null,"uniforms":{"diffuse":{"type":"c","value":15658734},"opacity":{"value":1},"map":{"value":null},"uvTransform":{"type":"m3","value":[1,0,0,0,1,0,0,0,1]},"uv2Transform":{"type":"m3","value":[1,0,0,0,1,0,0,0,1]},"alphaMap":{"value":null},"displacementMap":{"value":null},"displacementScale":{"value":1},"displacementBias":{"value":0},"referencePosition":{"type":"v3","value":[0,0,0]},"nearDistance":{"value":1},"farDistance":{"value":1000}},"defines":{"DEPTH_PACKING":3201},"vertexShader":"\n#define DISTANCE\n\nvarying vec3 vWorldPosition;\n\n#include <common>\n\n\n\n// /geo1/MAT/meshBasicBuilder_DISAPPEARED/attribute1\nvarying float varying_v_POLY_attribute1_val;\n\n// /geo1/MAT/meshBasicBuilder_DISAPPEARED/attribute1\nattribute float letterId;\n\n\n\n\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\n\t#include <skinbase_vertex>\n\n\t#ifdef USE_DISPLACEMENTMAP\n\n// removed:\n//\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\n\t#endif\n\n// removed:\n//\t#include <begin_vertex>\n\n\n\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/attribute1\n\tvarying_v_POLY_attribute1_val = float(letterId);\n\t\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/output1\n\tvec3 transformed = position;\n\tvec3 objectNormal = normal;\n\t#ifdef USE_TANGENT\n\t\tvec3 objectTangent = vec3( tangent.xyz );\n\t#endif\n\n\n\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\n\tvWorldPosition = worldPosition.xyz;\n\n}\n","fragmentShader":"\n#define DISTANCE\n\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n\n#include <common>\n\n\n\n// /geo1/MAT/meshBasicBuilder_DISAPPEARED/hsvToRgb1\n// https://github.com/hughsk/glsl-hsv2rgb\n// https://stackoverflow.com/questions/15095909/from-rgb-to-hsv-in-opengl-glsl\nvec3 hsv2rgb(vec3 c) {\n\tvec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n\tvec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n\treturn c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\n\n\n\n\n\n\n// /geo1/MAT/meshBasicBuilder_DISAPPEARED/attribute1\nvarying float varying_v_POLY_attribute1_val;\n\n\n\n\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main () {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( 1.0 );\n\n\n\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/attribute1\n\tfloat v_POLY_attribute1_val = varying_v_POLY_attribute1_val;\n\t\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/round3\n\tfloat v_POLY_round3_val = sign(v_POLY_attribute1_val)*floor(abs(v_POLY_attribute1_val)+0.5);\n\t\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/floatToVec2_2\n\tvec2 v_POLY_floatToVec2_2_vec2 = vec2(v_POLY_round3_val, 55.032);\n\t\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/random2\n\tfloat v_POLY_random2_rand = rand(v_POLY_floatToVec2_2_vec2);\n\t\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/floatToVec3_2\n\tvec3 v_POLY_floatToVec3_2_vec3 = vec3(v_POLY_random2_rand, 0.79, 0.6);\n\t\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/hsvToRgb1\n\tvec3 v_POLY_hsvToRgb1_rgb = hsv2rgb(v_POLY_floatToVec3_2_vec3);\n\t\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/output1\n\tdiffuseColor.xyz = v_POLY_hsvToRgb1_rgb;\n\n\n\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist ); // clamp to [ 0, 1 ]\n\n\tgl_FragColor = packDepthToRGBA( dist );\n\n}\n","shadowSide":null,"lights":false},"customDepthMaterial":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/geo1/MAT/meshBasicBuilder_DISAPPEARED-customDepthMaterial","type":"ShaderMaterial","name":"customDepthMaterial","depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"glslVersion":null,"uniforms":{"diffuse":{"type":"c","value":15658734},"opacity":{"value":1},"map":{"value":null},"uvTransform":{"type":"m3","value":[1,0,0,0,1,0,0,0,1]},"uv2Transform":{"type":"m3","value":[1,0,0,0,1,0,0,0,1]},"alphaMap":{"value":null},"displacementMap":{"value":null},"displacementScale":{"value":1},"displacementBias":{"value":0}},"defines":{"DEPTH_PACKING":3201},"vertexShader":"\n#include <common>\n\n\n\n// /geo1/MAT/meshBasicBuilder_DISAPPEARED/attribute1\nvarying float varying_v_POLY_attribute1_val;\n\n// /geo1/MAT/meshBasicBuilder_DISAPPEARED/attribute1\nattribute float letterId;\n\n\n\n\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\n// This is used for computing an equivalent of gl_FragCoord.z that is as high precision as possible.\n// Some platforms compute gl_FragCoord at a lower precision which makes the manually computed value better for\n// depth-based postprocessing effects. Reproduced on iPad with A10 processor / iPadOS 13.3.1.\nvarying vec2 vHighPrecisionZW;\n\nvoid main() {\n\n\t#include <uv_vertex>\n\n\t#include <skinbase_vertex>\n\n\t#ifdef USE_DISPLACEMENTMAP\n\n// removed:\n//\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\n\t#endif\n\n// removed:\n//\t#include <begin_vertex>\n\n\n\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/attribute1\n\tvarying_v_POLY_attribute1_val = float(letterId);\n\t\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/output1\n\tvec3 transformed = position;\n\tvec3 objectNormal = normal;\n\t#ifdef USE_TANGENT\n\t\tvec3 objectTangent = vec3( tangent.xyz );\n\t#endif\n\n\n\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\n\tvHighPrecisionZW = gl_Position.zw;\n\n}\n","fragmentShader":"\n#if DEPTH_PACKING == 3200\n\n\tuniform float opacity;\n\n#endif\n\n#include <common>\n\n\n\n// /geo1/MAT/meshBasicBuilder_DISAPPEARED/hsvToRgb1\n// https://github.com/hughsk/glsl-hsv2rgb\n// https://stackoverflow.com/questions/15095909/from-rgb-to-hsv-in-opengl-glsl\nvec3 hsv2rgb(vec3 c) {\n\tvec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n\tvec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n\treturn c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\n\n\n\n\n\n\n\n// /geo1/MAT/meshBasicBuilder_DISAPPEARED/attribute1\nvarying float varying_v_POLY_attribute1_val;\n\n\n\n\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvarying vec2 vHighPrecisionZW;\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( 1.0 );\n\n\n\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/attribute1\n\tfloat v_POLY_attribute1_val = varying_v_POLY_attribute1_val;\n\t\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/round3\n\tfloat v_POLY_round3_val = sign(v_POLY_attribute1_val)*floor(abs(v_POLY_attribute1_val)+0.5);\n\t\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/floatToVec2_2\n\tvec2 v_POLY_floatToVec2_2_vec2 = vec2(v_POLY_round3_val, 55.032);\n\t\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/random2\n\tfloat v_POLY_random2_rand = rand(v_POLY_floatToVec2_2_vec2);\n\t\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/floatToVec3_2\n\tvec3 v_POLY_floatToVec3_2_vec3 = vec3(v_POLY_random2_rand, 0.79, 0.6);\n\t\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/hsvToRgb1\n\tvec3 v_POLY_hsvToRgb1_rgb = hsv2rgb(v_POLY_floatToVec3_2_vec3);\n\t\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/output1\n\tdiffuseColor.xyz = v_POLY_hsvToRgb1_rgb;\n\n\n\n\n\t#if DEPTH_PACKING == 3200\n\n\t\tdiffuseColor.a = opacity;\n\n\t#endif\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\n\t#include <logdepthbuf_fragment>\n\n\t// Higher precision equivalent of gl_FragCoord.z. This assumes depthRange has been left to its default values.\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\n\t#if DEPTH_PACKING == 3200\n\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\n\t#elif DEPTH_PACKING == 3201\n\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\n\t#endif\n\n}\n","shadowSide":null,"lights":false},"customDepthDOFMaterial":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/geo1/MAT/meshBasicBuilder_DISAPPEARED-customDepthDOFMaterial","type":"ShaderMaterial","name":"customDepthDOFMaterial","depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"glslVersion":null,"uniforms":{"mNear":{"value":0},"mFar":{"value":10}},"vertexShader":"#include <common>\n\nvarying float vViewZDepth;\n\n// INSERT DEFINES\n\n\n\n// /geo1/MAT/meshBasicBuilder_DISAPPEARED/attribute1\nvarying float varying_v_POLY_attribute1_val;\n\n// /geo1/MAT/meshBasicBuilder_DISAPPEARED/attribute1\nattribute float letterId;\n\n\n\n\n\n\n\nvoid main() {\n\n\t// INSERT BODY\n\n\n\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/attribute1\n\tvarying_v_POLY_attribute1_val = float(letterId);\n\t\n\t// /geo1/MAT/meshBasicBuilder_DISAPPEARED/output1\n\tvec3 transformed = position;\n\tvec3 objectNormal = normal;\n\t#ifdef USE_TANGENT\n\t\tvec3 objectTangent = vec3( tangent.xyz );\n\t#endif\n\n\n\n\n\n\t#include <project_vertex>\n\n\tvViewZDepth = - mvPosition.z;\n}","fragmentShader":"uniform float mNear;\nuniform float mFar;\n\nvarying float vViewZDepth;\n\nvoid main() {\n\n\tfloat color = 1.0 - smoothstep( mNear, mFar, vViewZDepth );\n\tgl_FragColor = vec4( vec3( color ), 1.0 );\n\n}\n","shadowSide":null,"lights":false}}}}}},"text1":{"type":"text","params":{"font":"https://raw.githubusercontent.com/polygonjs/polygonjs-assets/master/fonts/SourceCodePro-Semibold.ttf","text":"`arg(js(\"'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('').join(' ')\"),copy('../copy1',0))`","type":1}},"plane1":{"type":"plane","params":{"size":[59,34]}},"scatter1":{"type":"scatter","params":{"pointsCount":5000},"inputs":["plane1"]},"copy1":{"type":"copy","params":{"count":26,"useCopyExpr":1},"inputs":["transform4"]},"transform2":{"type":"transform","params":{"t":[0,"100*copy('../copy1',0)",0]},"inputs":["text1"]},"instance1":{"type":"instance","params":{"attributesToCopy":"instance* id","material":"../MAT/meshBasicBuilder1"},"inputs":["transform3","scatter1"]},"transform3":{"type":"transform","params":{"r":[90,0,0]},"inputs":["merge1"]},"merge1":{"type":"merge","params":{"compact":1},"inputs":["copy1"]},"transform4":{"type":"transform","params":{"t":["-$CEX",0,"-$CEZ"]},"inputs":["transform2"]},"text2":{"type":"text","params":{"font":"https://raw.githubusercontent.com/polygonjs/polygonjs-assets/master/fonts/SourceCodePro-Semibold.ttf","text":"`arg(js(\"'DISAPPEARED?!'.split('').join(' ')\"),copy('../copy2',0))`","type":1}},"attribCreate2":{"type":"attribCreate","params":{"name":"letterId","value1":"copy('../copy2',0)"},"inputs":["text2"]},"copy2":{"type":"copy","params":{"count":13,"useCopyExpr":true},"inputs":["transform6"]},"transform5":{"type":"transform","params":{"t":["1*copy('../copy2',0)",0,0]},"inputs":["attribCreate2"]},"transform6":{"type":"transform","params":{"t":["-$CEX",0,"-$CEZ"]},"inputs":["transform5"],"flags":{"bypass":true}},"merge2":{"type":"merge","inputs":["instance1","material1"],"flags":{"display":true},"cloned_state_overriden":true},"merge3":{"type":"merge","params":{"compact":1},"inputs":["copy2"]},"material1":{"type":"material","params":{"material":"../MAT/meshBasicBuilder_DISAPPEARED"},"inputs":["merge3"]}},"flags":{"display":true}},"perspectiveCamera1":{"type":"perspectiveCamera","nodes":{"events1":{"type":"eventsNetwork","nodes":{"cameraOrbitControls1":{"type":"cameraOrbitControls","params":{"target":[5.756649791221145,-2.5404733270608446,1.5767856951719574]}}},"selection":["cameraOrbitControls1"]}},"params":{"t":[6.098828033164987,3.4903257554558924,18.686931668991953],"r":[-19.456460561758625,1.0764691061638711,0.3802494011857632],"controls":"./events1/cameraOrbitControls1"},"flags":{"display":true}},"COP":{"type":"copNetwork","nodes":{"imageEnv":{"type":"image","params":{"url":"https://raw.githubusercontent.com/polygonjs/polygonjs-assets/master/textures/piz_compressed.exr"}},"imageUv":{"type":"image","params":{"url":"https://raw.githubusercontent.com/polygonjs/polygonjs-assets/master/textures/uv.jpg","tflipY":true}},"envMap":{"type":"envMap","inputs":["imageEnv"]}}},"ground":{"type":"geo","nodes":{"plane1":{"type":"plane","params":{"size":[171,171]},"flags":{"display":true}}},"flags":{"display":false},"selection":["plane1"]},"hemisphereLight1":{"type":"hemisphereLight","flags":{"display":true}},"orthographicCamera1":{"type":"orthographicCamera","params":{"t":[-0.02497605807073451,4.469550975255178,12.7601061247756],"r":[-15.91786252810725,-0.625065518402668,-0.17826118713949604],"controls":"../perspectiveCamera1/events1/cameraOrbitControls1"},"flags":{"display":true}}},"params":{"backgroundMode":1,"fogType":0,"fogColor":[0,0,0],"fogNear":2,"fogFar":5}},"ui":{"nodes":{"geo1":{"pos":[-50,-150],"nodes":{"MAT":{"pos":[-350,150],"nodes":{"meshStandard1":{"pos":[0,100]},"meshBasicBuilder1":{"pos":[0,200],"nodes":{"globals1":{"pos":[-1200,-200]},"output1":{"pos":[2000,-100]},"mix1":{"pos":[0,-200]},"mix2":{"pos":[350,-50]},"multAdd1":{"pos":[-100,-150]},"multAdd2":{"pos":[200,0]},"constant1":{"pos":[-1250,200]},"clamp1":{"pos":[-300,200]},"clamp2":{"pos":[-300,300]},"multAdd3":{"pos":[-150,300]},"null1":{"pos":[-500,200]},"multAdd4":{"pos":[-600,200]},"multAdd5":{"pos":[0,300]},"clamp3":{"pos":[100,300]},"easing1":{"pos":[-200,200]},"easing2":{"pos":[200,300]},"rotate1":{"pos":[550,0]},"mix3":{"pos":[900,-100]},"multAdd6":{"pos":[-400,550]},"clamp4":{"pos":[-250,550]},"multAdd7":{"pos":[-100,550]},"multAdd8":{"pos":[50,550]},"clamp5":{"pos":[150,550]},"easing3":{"pos":[250,550]},"instanceTransform1":{"pos":[1250,-100]},"attribute1":{"pos":[-1700,-750]},"round1":{"pos":[-1600,-750]},"floatToVec2_1":{"pos":[-1500,-750]},"random1":{"pos":[-1400,-750]},"multAdd9":{"pos":[-1300,-750]},"round2":{"pos":[-1200,-750]},"multAdd10":{"pos":[-1100,-750]},"floatToVec3_1":{"pos":[-1000,-750]},"attribute2":{"pos":[-1050,-900]},"add1":{"pos":[-900,-800]},"attribute3":{"pos":[1200,300]},"round3":{"pos":[1300,300]},"floatToVec2_2":{"pos":[1400,300]},"random2":{"pos":[1500,300]},"floatToVec3_2":{"pos":[1650,300]},"hsvToRgb1":{"pos":[1800,300]},"attribute4":{"pos":[-1350,350]},"round4":{"pos":[-1250,350]},"floatToVec2_3":{"pos":[-1150,350]},"random3":{"pos":[-1050,350]},"null2":{"pos":[-650,-300]},"add2":{"pos":[-750,-450]},"constant2":{"pos":[-1000,-500]},"multAdd11":{"pos":[-900,350]},"multAdd12":{"pos":[650,0]}}},"meshBasicBuilder_DISAPPEARED":{"pos":[0,300],"nodes":{"attribute3":{"pos":[1050,-50]},"floatToVec2_2":{"pos":[1250,-50]},"floatToVec3_2":{"pos":[1500,-50]},"hsvToRgb1":{"pos":[1650,-50]},"output1":{"pos":[2000,-100]},"random2":{"pos":[1350,-50]},"round3":{"pos":[1150,-50]},"attribute1":{"pos":[1050,-200]}}}}},"text1":{"pos":[200,-500]},"plane1":{"pos":[600,150]},"scatter1":{"pos":[600,250]},"copy1":{"pos":[200,-200]},"transform2":{"pos":[200,-400]},"instance1":{"pos":[400,450]},"transform3":{"pos":[200,250]},"merge1":{"pos":[200,150]},"transform4":{"pos":[200,-300]},"text2":{"pos":[950,-200]},"attribCreate2":{"pos":[950,-50]},"copy2":{"pos":[950,250]},"transform5":{"pos":[950,50]},"transform6":{"pos":[950,150]},"merge2":{"pos":[650,700]},"merge3":{"pos":[950,350]},"material1":{"pos":[950,450]}}},"perspectiveCamera1":{"pos":[-300,250],"nodes":{"events1":{"pos":[-200,50],"nodes":{"cameraOrbitControls1":{"pos":[150,50]}}}}},"COP":{"pos":[-300,350],"nodes":{"imageEnv":{"pos":[50,100]},"imageUv":{"pos":[-100,100]},"envMap":{"pos":[50,200]}}},"ground":{"pos":[-50,-50],"nodes":{"plane1":{"pos":[100,50]}}},"hemisphereLight1":{"pos":[100,200]},"orthographicCamera1":{"pos":[-300,150]}}}}
Code editor
{"multiple_panel":{"split_ratio":0.5,"split_panel0":{"split_ratio":0.5,"split_panel0":{"panel_types":["viewer"],"current_panel_index":0,"panel_data":{"camera":"/perspectiveCamera1"}},"split_panel1":{"panel_types":["params"],"current_panel_index":0,"panel_data":{"active_folder":null}},"split_mode":"vertical"},"split_panel1":{"panel_types":["network","params","viewer"],"current_panel_index":0,"panel_data":{"camera":{"position":{"x":-58,"y":0},"zoom":0.5},"history":{"2":{"position":{"x":-58,"y":0},"zoom":0.5},"3":{"position":{"x":-48,"y":-22},"zoom":0.5},"6":{"position":{"x":11.339999999999996,"y":-96.49999999999999},"zoom":0.6172839506172841},"9":{"position":{"x":-32,"y":-88},"zoom":0.5},"131":{"position":{"x":-59.04899999999998,"y":-65.1854},"zoom":0.8467543904215146}}}},"split_mode":"horizontal"},"current_node":"/","fullscreen_panel_id":null}
Used nodes
cop/envMap;cop/image;event/cameraOrbitControls;mat/meshBasicBuilder;mat/meshStandard;obj/copNetwork;obj/geo;obj/hemisphereLight;obj/orthographicCamera;obj/perspectiveCamera;sop/attribCreate;sop/copy;sop/eventsNetwork;sop/instance;sop/material;sop/materialsNetwork;sop/merge;sop/plane;sop/scatter;sop/text;sop/transform
Used operations
Used modules
EXRLoader;TTFLoader
Used assemblers
GL_MESH_BASIC
Used integrations
[]
Used assets
Nodes map
{"/geo1":"obj/geo","/geo1/MAT":"sop/materialsNetwork","/geo1/MAT/meshStandard1":"mat/meshStandard","/geo1/MAT/meshBasicBuilder1":"mat/meshBasicBuilder","/geo1/MAT/meshBasicBuilder_DISAPPEARED":"mat/meshBasicBuilder","/geo1/text1":"sop/text","/geo1/plane1":"sop/plane","/geo1/scatter1":"sop/scatter","/geo1/copy1":"sop/copy","/geo1/transform2":"sop/transform","/geo1/instance1":"sop/instance","/geo1/transform3":"sop/transform","/geo1/merge1":"sop/merge","/geo1/transform4":"sop/transform","/geo1/text2":"sop/text","/geo1/attribCreate2":"sop/attribCreate","/geo1/copy2":"sop/copy","/geo1/transform5":"sop/transform","/geo1/transform6":"sop/transform","/geo1/merge2":"sop/merge","/geo1/merge3":"sop/merge","/geo1/material1":"sop/material","/perspectiveCamera1":"obj/perspectiveCamera","/perspectiveCamera1/events1":"sop/eventsNetwork","/perspectiveCamera1/events1/cameraOrbitControls1":"event/cameraOrbitControls","/COP":"obj/copNetwork","/COP/imageEnv":"cop/image","/COP/imageUv":"cop/image","/COP/envMap":"cop/envMap","/ground":"obj/geo","/ground/plane1":"sop/plane","/hemisphereLight1":"obj/hemisphereLight","/orthographicCamera1":"obj/orthographicCamera"}
Js version
Editor version
Engine version
Logout
0%
There was a problem displaying your scene:
view scene source