Name
*
Code
{"properties":{"frame":0,"maxFrame":600,"maxFrameLocked":false,"realtimeState":true,"mainCameraPath":"/perspectiveCamera1","versions":{"polygonjs":"1.1.266"}},"root":{"type":"root","nodes":{"hemisphereLight1":{"type":"hemisphereLight","flags":{"display":true}},"polarTransform1":{"type":"polarTransform","params":{"center":[0,1.7,0],"longitude":327.6,"latitude":3.6,"depth":16},"flags":{"display":false}},"perspectiveCamera_MAIN":{"type":"perspectiveCamera","inputs":["null_camRot"],"flags":{"display":true}},"null_camRot":{"type":"null","params":{"r":[-21.5,0,0]},"inputs":["polarTransform1"],"flags":{"display":true}},"geo1":{"type":"geo","nodes":{"BVH1":{"type":"BVH","inputs":["material2"]},"BVHVisualizer1":{"type":"BVHVisualizer","inputs":["BVH1"]},"MAT":{"type":"materialsNetwork","nodes":{"meshPhysicalBuilder1":{"type":"meshPhysicalBuilder","nodes":{"add1":{"type":"add","params":{"add0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"add1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"add2":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":true}}},"maxInputsCount":3,"inputs":[{"index":0,"node":"multScalar1","output":"val"},{"index":1,"node":"add2","output":"sum"}],"connection_points":{"in":[{"name":"add0","type":"vec3"},{"name":"add1","type":"vec3"},{"name":"add2","type":"vec3"}],"out":[{"name":"sum","type":"vec3"}]}},"add2":{"type":"add","params":{"add0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"add1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"add2":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":true}}},"maxInputsCount":3,"inputs":[{"index":0,"node":"subtract2","output":"subtract"},{"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"}]}},"add3":{"type":"add","params":{"add0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"add1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"add2":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":true}}},"maxInputsCount":3,"inputs":[{"index":0,"node":"add4","output":"sum"},{"index":1,"node":"attribute4","output":"val"}],"connection_points":{"in":[{"name":"add0","type":"vec3"},{"name":"add1","type":"vec3"},{"name":"add2","type":"vec3"}],"out":[{"name":"sum","type":"vec3"}]}},"add4":{"type":"add","params":{"add0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"add1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"add2":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":true}}},"maxInputsCount":3,"inputs":[{"index":0,"node":"multScalar2","output":"val"},{"index":1,"node":"subnet_rotation","output":"input1"}],"connection_points":{"in":[{"name":"add0","type":"vec3"},{"name":"add1","type":"vec3"},{"name":"add2","type":"vec3"}],"out":[{"name":"sum","type":"vec3"}]}},"attribute1":{"type":"attribute","params":{"name":"piececentroid","type":2},"connection_points":{"in":[],"out":[{"name":"val","type":"vec3"}]}},"attribute2":{"type":"attribute","params":{"name":"objectcentroid","type":2},"connection_points":{"in":[],"out":[{"name":"val","type":"vec3"}]}},"attribute3":{"type":"attribute","params":{"name":"inside"},"connection_points":{"in":[],"out":[{"name":"val","type":"float"}]}},"attribute4":{"type":"attribute","params":{"name":"piececentroid","type":2},"connection_points":{"in":[],"out":[{"name":"val","type":"vec3"}]}},"attribute5":{"type":"attribute","params":{"name":"objectcentroid","type":2},"connection_points":{"in":[],"out":[{"name":"val","type":"vec3"}]}},"clamp1":{"type":"clamp","params":{"value":{"type":"float","default_value":0,"options":{"spare":true,"editable":false}},"min":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}},"max":{"type":"float","default_value":1,"options":{"spare":true,"editable":true}}},"inputs":[{"index":0,"node":"complement1","output":"val"}],"connection_points":{"in":[{"name":"value","type":"float"},{"name":"min","type":"float"},{"name":"max","type":"float"}],"out":[{"name":"val","type":"float"}]}},"complement1":{"type":"complement","params":{"in":{"type":"float","default_value":0,"options":{"spare":true,"editable":false}}},"inputs":[{"index":0,"node":"distance1","output":"val"}],"connection_points":{"in":[{"name":"in","type":"float"}],"out":[{"name":"val","type":"float"}]}},"distance1":{"type":"distance","params":{"p0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"p1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}}},"inputs":[{"index":0,"node":"floatToVec3_1","output":"vec3"},{"index":1,"node":"attribute1","output":"val"}],"connection_points":{"in":[{"name":"p0","type":"vec3"},{"name":"p1","type":"vec3"}],"out":[{"name":"val","type":"float"}]}},"floatToVec3_1":{"type":"floatToVec3","params":{"x":{"overriden_options":{}},"y":{"overriden_options":{}},"z":{"overriden_options":{}}},"inputs":[{"index":0,"node":"vec3ToFloat1","output":"x"},{"index":1,"node":"vec3ToFloat1","output":"y"},{"index":2,"node":"vec3ToFloat1","output":"z"}]},"floatToVec3_2":{"type":"floatToVec3","params":{"x":{"overriden_options":{}},"y":{"overriden_options":{}},"z":{"overriden_options":{}}},"inputs":[null,{"index":1,"node":"vec3ToFloat2","output":"y"}]},"floatToVec3_3":{"type":"floatToVec3","params":{"x":{"overriden_options":{}},"y":{"raw_input":1.8,"overriden_options":{}},"z":{"overriden_options":{}}},"inputs":[{"index":0,"node":"vec3ToFloat3","output":"x"},null,{"index":2,"node":"vec3ToFloat3","output":"z"}]},"floatToVec3_4":{"type":"floatToVec3","params":{"x":{"overriden_options":{}},"y":{"overriden_options":{}},"z":{"overriden_options":{}}},"inputs":[{"index":0,"node":"vec3ToFloat4","output":"x"},{"index":1,"node":"vec3ToFloat4","output":"y"},{"index":2,"node":"vec3ToFloat4","output":"z"}]},"floatToVec3_5":{"type":"floatToVec3","params":{"x":{"overriden_options":{}},"y":{"overriden_options":{}},"z":{"overriden_options":{}}},"inputs":[{"index":0,"node":"vec3ToFloat5","output":"x"},{"index":1,"node":"max1","output":"val"},{"index":2,"node":"vec3ToFloat5","output":"z"}]},"globals1":{"type":"globals"},"max1":{"type":"max","params":{"in0":{"type":"float","default_value":0,"options":{"spare":true,"editable":false}},"in1":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}}},"inputs":[{"index":0,"node":"vec3ToFloat5","output":"y"}],"connection_points":{"in":[{"name":"in0","type":"float"},{"name":"in1","type":"float"}],"out":[{"name":"val","type":"float"}]}},"mult1":{"type":"mult","params":{"mult0":{"type":"vector3","default_value":[1,1,1],"options":{"spare":true,"editable":false}},"mult1":{"type":"vector3","default_value":[1,1,1],"options":{"spare":true,"editable":true},"raw_input":[1,0.30000000000000004,1]}},"inputs":[{"index":0,"node":"subtract2","output":"subtract"}],"connection_points":{"in":[{"name":"mult0","type":"vec3"},{"name":"mult1","type":"vec3"}],"out":[{"name":"product","type":"vec3"}]}},"multAdd1":{"type":"multAdd","params":{"value":{"type":"float","default_value":0,"options":{"spare":true,"editable":false}},"preAdd":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}},"mult":{"type":"float","default_value":1,"options":{"spare":true,"editable":true}},"postAdd":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}}},"inputs":[{"index":0,"node":"clamp1","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"}]}},"multAdd2":{"type":"multAdd","params":{"value":{"type":"float","default_value":0,"options":{"spare":true,"editable":false}},"preAdd":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}},"mult":{"type":"float","default_value":1,"options":{"spare":true,"editable":true}},"postAdd":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}}},"inputs":[{"index":0,"node":"multAdd1","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"}]}},"multAdd3":{"type":"multAdd","params":{"value":{"type":"float","default_value":0,"options":{"spare":true,"editable":false}},"preAdd":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}},"mult":{"type":"float","default_value":1,"options":{"spare":true,"editable":true},"raw_input":3},"postAdd":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}}},"inputs":[{"index":0,"node":"multAdd1","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"}]}},"multScalar1":{"type":"multScalar","params":{"value":{"type":"vector3","default_value":[1,1,1],"options":{"spare":true,"editable":false}},"mult":{"type":"float","default_value":1,"options":{"spare":true,"editable":false},"raw_input":1.5}},"inputs":[{"index":0,"node":"subtract2","output":"subtract"},{"index":1,"node":"multAdd2","output":"val"}],"connection_points":{"in":[{"name":"value","type":"vec3"},{"name":"mult","type":"float"}],"out":[{"name":"val","type":"vec3"}]}},"multScalar2":{"type":"multScalar","params":{"value":{"type":"vector3","default_value":[1,1,1],"options":{"spare":true,"editable":false}},"mult":{"type":"float","default_value":1,"options":{"spare":true,"editable":false}}},"inputs":[{"index":0,"node":"floatToVec3_5","output":"vec3"},{"index":1,"node":"multAdd3","output":"val"}],"connection_points":{"in":[{"name":"value","type":"vec3"},{"name":"mult","type":"float"}],"out":[{"name":"val","type":"vec3"}]}},"normalize1":{"type":"normalize","params":{"in":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}}},"inputs":[{"index":0,"node":"subtract2","output":"subtract"}],"connection_points":{"in":[{"name":"in","type":"vec3"}],"out":[{"name":"normalized","type":"vec3"}]}},"null1":{"type":"null","params":{"in":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}}},"inputs":[{"index":0,"node":"floatToVec3_4","output":"vec3"}],"connection_points":{"in":[{"name":"in","type":"vec3"}],"out":[{"name":"val","type":"vec3"}]}},"output1":{"type":"output","inputs":[{"index":0,"node":"add3","output":"sum"},{"index":1,"node":"subnet_rotation","output":"input2"},null,null,null,{"index":5,"node":"smoothstep1","output":"val"}]},"param1":{"type":"param","params":{"name":"cursor","type":4},"connection_points":{"in":[],"out":[{"name":"val","type":"vec3"}]}},"smoothstep1":{"type":"smoothstep","params":{"edge0":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}},"edge1":{"type":"float","default_value":1,"options":{"spare":true,"editable":true},"raw_input":0.46},"x":{"type":"float","default_value":0,"options":{"spare":true,"editable":false}}},"inputs":[null,null,{"index":2,"node":"attribute3","output":"val"}],"connection_points":{"in":[{"name":"edge0","type":"float"},{"name":"edge1","type":"float"},{"name":"x","type":"float"}],"out":[{"name":"val","type":"float"}]}},"subnet_rotation":{"type":"subnet","nodes":{"attribute4":{"type":"attribute","params":{"name":"piececentroid","type":2},"connection_points":{"in":[],"out":[{"name":"val","type":"vec3"}]}},"constant_UP":{"type":"constant","params":{"type":4,"vec3":[0,1,0]},"connection_points":{"in":[],"out":[{"name":"val","type":"vec3"}]}},"cross1":{"type":"cross","params":{"x":{"overriden_options":{}},"y":{"overriden_options":{}}},"inputs":[{"index":0,"node":"constant_UP","output":"val"},{"index":1,"node":"normalize1","output":"normalized"}]},"length1":{"type":"length","params":{"x":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}}},"inputs":[{"index":0,"node":"subnetInput1","output":"input1"}],"connection_points":{"in":[{"name":"x","type":"vec3"}],"out":[{"name":"val","type":"float"}]}},"max1":{"type":"max","params":{"in0":{"type":"float","default_value":0,"options":{"spare":true,"editable":false}},"in1":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}}},"inputs":[{"index":0,"node":"multAdd3","output":"val"}],"connection_points":{"in":[{"name":"in0","type":"float"},{"name":"in1","type":"float"}],"out":[{"name":"val","type":"float"}]}},"multAdd3":{"type":"multAdd","params":{"value":{"type":"float","default_value":0,"options":{"spare":true,"editable":false}},"preAdd":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}},"mult":{"type":"float","default_value":1,"options":{"spare":true,"editable":true},"raw_input":4},"postAdd":{"type":"float","default_value":0,"options":{"spare":true,"editable":true},"raw_input":-0.5}},"inputs":[{"index":0,"node":"subnetInput1","output":"input0"}],"connection_points":{"in":[{"name":"value","type":"float"},{"name":"preAdd","type":"float"},{"name":"mult","type":"float"},{"name":"postAdd","type":"float"}],"out":[{"name":"val","type":"float"}]}},"multScalar1":{"type":"multScalar","params":{"value":{"type":"vector3","default_value":[1,1,1],"options":{"spare":true,"editable":false}},"mult":{"type":"float","default_value":1,"options":{"spare":true,"editable":false}}},"inputs":[{"index":0,"node":"rotate1","output":"val"},{"index":1,"node":"length1","output":"val"}],"connection_points":{"in":[{"name":"value","type":"vec3"},{"name":"mult","type":"float"}],"out":[{"name":"val","type":"vec3"}]}},"normalize1":{"type":"normalize","params":{"in":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}}},"inputs":[{"index":0,"node":"attribute4","output":"val"}],"connection_points":{"in":[{"name":"in","type":"vec3"}],"out":[{"name":"normalized","type":"vec3"}]}},"normalize2":{"type":"normalize","params":{"in":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}}},"inputs":[{"index":0,"node":"cross1","output":"cross"}],"connection_points":{"in":[{"name":"in","type":"vec3"}],"out":[{"name":"normalized","type":"vec3"}]}},"normalize3":{"type":"normalize","params":{"in":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}}},"inputs":[{"index":0,"node":"subnetInput1","output":"input1"}],"connection_points":{"in":[{"name":"in","type":"vec3"}],"out":[{"name":"normalized","type":"vec3"}]}},"rotate1":{"type":"rotate","params":{"vector":{"type":"vector3","default_value":[0,0,1],"options":{"spare":true,"editable":false}},"axis":{"type":"vector3","default_value":[0,1,0],"options":{"spare":true,"editable":false},"raw_input":[0,0,1]},"angle":{"type":"float","default_value":0,"options":{"spare":true,"editable":false},"raw_input":-3.2}},"maxInputsCount":3,"inputs":[{"index":0,"node":"normalize3","output":"normalized"},{"index":1,"node":"normalize2","output":"normalized"},{"index":2,"node":"max1","output":"val"}],"connection_points":{"in":[{"name":"vector","type":"vec3"},{"name":"axis","type":"vec3"},{"name":"angle","type":"float"}],"out":[{"name":"val","type":"vec3"}]}},"rotate2":{"type":"rotate","params":{"vector":{"type":"vector3","default_value":[0,0,1],"options":{"spare":true,"editable":false}},"axis":{"type":"vector3","default_value":[0,1,0],"options":{"spare":true,"editable":false},"raw_input":[0,0,1]},"angle":{"type":"float","default_value":0,"options":{"spare":true,"editable":false},"raw_input":-3.2}},"maxInputsCount":3,"inputs":[{"index":0,"node":"subnetInput1","output":"input2"},{"index":1,"node":"normalize2","output":"normalized"},{"index":2,"node":"max1","output":"val"}],"connection_points":{"in":[{"name":"vector","type":"vec3"},{"name":"axis","type":"vec3"},{"name":"angle","type":"float"}],"out":[{"name":"val","type":"vec3"}]}},"subnetInput1":{"type":"subnetInput","connection_points":{"in":[],"out":[{"name":"input0","type":"float"},{"name":"input1","type":"vec3"},{"name":"input2","type":"vec3"}]}},"subnetOutput1":{"type":"subnetOutput","inputs":[null,{"index":1,"node":"multScalar1","output":"val"},{"index":2,"node":"rotate2","output":"val"}],"connection_points":{"in":[{"name":"input0","type":"float"},{"name":"input1","type":"vec3"},{"name":"input2","type":"vec3"}],"out":[]}}},"params":{"inputsCount":3,"inputType1":4,"inputType2":4,"input0":{"type":"float","default_value":0,"options":{"spare":true,"editable":false}},"input1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"input2":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}}},"maxInputsCount":3,"inputs":[{"index":0,"node":"multAdd1","output":"val"},{"index":1,"node":"subtract5","output":"subtract"},{"index":2,"node":"globals1","output":"normal"}],"connection_points":{"in":[{"name":"input0","type":"float"},{"name":"input1","type":"vec3"},{"name":"input2","type":"vec3"}],"out":[{"name":"input0","type":"float"},{"name":"input1","type":"vec3"},{"name":"input2","type":"vec3"}]}},"subtract1":{"type":"subtract","params":{"sub0":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}},"sub1":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}}},"connection_points":{"in":[{"name":"sub0","type":"float"},{"name":"sub1","type":"float"}],"out":[{"name":"subtract","type":"float"}]}},"subtract2":{"type":"subtract","params":{"sub0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"sub1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"sub2":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":true}}},"maxInputsCount":3,"inputs":[{"index":0,"node":"null1","output":"val"},{"index":1,"node":"floatToVec3_3","output":"vec3"}],"connection_points":{"in":[{"name":"sub0","type":"vec3"},{"name":"sub1","type":"vec3"},{"name":"sub2","type":"vec3"}],"out":[{"name":"subtract","type":"vec3"}]}},"subtract3":{"type":"subtract","params":{"sub0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"sub1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"sub2":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":true}}},"maxInputsCount":3,"inputs":[{"index":0,"node":"globals1","output":"position"},{"index":1,"node":"null1","output":"val"}],"connection_points":{"in":[{"name":"sub0","type":"vec3"},{"name":"sub1","type":"vec3"},{"name":"sub2","type":"vec3"}],"out":[{"name":"subtract","type":"vec3"}]}},"subtract4":{"type":"subtract","params":{"sub0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"sub1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"sub2":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":true}}},"maxInputsCount":3,"inputs":[{"index":0,"node":"floatToVec3_2","output":"vec3"},{"index":1,"node":"subtract2","output":"subtract"}],"connection_points":{"in":[{"name":"sub0","type":"vec3"},{"name":"sub1","type":"vec3"},{"name":"sub2","type":"vec3"}],"out":[{"name":"subtract","type":"vec3"}]}},"subtract5":{"type":"subtract","params":{"sub0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"sub1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"sub2":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":true}}},"maxInputsCount":3,"inputs":[{"index":0,"node":"globals1","output":"position"},{"index":1,"node":"attribute4","output":"val"}],"connection_points":{"in":[{"name":"sub0","type":"vec3"},{"name":"sub1","type":"vec3"},{"name":"sub2","type":"vec3"}],"out":[{"name":"subtract","type":"vec3"}]}},"vec3ToFloat1":{"type":"vec3ToFloat","params":{"vec":{"overriden_options":{}}},"inputs":[{"index":0,"node":"param1","output":"val"}]},"vec3ToFloat2":{"type":"vec3ToFloat","params":{"vec":{"overriden_options":{}}},"inputs":[{"index":0,"node":"attribute1","output":"val"}]},"vec3ToFloat3":{"type":"vec3ToFloat","params":{"vec":{"overriden_options":{}}},"inputs":[{"index":0,"node":"attribute2","output":"val"}]},"vec3ToFloat4":{"type":"vec3ToFloat","params":{"vec":{"overriden_options":{}}},"inputs":[{"index":0,"node":"attribute1","output":"val"}]},"vec3ToFloat5":{"type":"vec3ToFloat","params":{"vec":{"overriden_options":{}}},"inputs":[{"index":0,"node":"mult1","output":"product"}]}},"params":{"useEnvMap":true,"envMap":"../../../COP/envMap","roughness":0,"cursor":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"computeOnDirty":true,"cook":false,"dependentOnFoundNode":true},"raw_input":[8.942121763008997,5.444515662415952,0],"overriden_options":{"callback":"{}"}}},"persisted_config":{"material":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/geo1/MAT/meshPhysicalBuilder1-main","type":"MeshPhysicalMaterial","name":"/geo1/MAT/meshPhysicalBuilder1","color":16777215,"roughness":0,"metalness":1,"sheen":0,"sheenColor":0,"sheenRoughness":1,"emissive":0,"specularIntensity":1,"specularColor":16777215,"clearcoat":0,"clearcoatRoughness":0,"envMapIntensity":1,"reflectivity":0.49999999999999983,"transmission":0,"thickness":0.01,"attenuationDistance":0,"attenuationColor":16777215,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},"onBeforeCompileDataJSON":{"vertexShader":"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n\n\n\n// /geo1/MAT/meshPhysicalBuilder1/complement1\nfloat complement(float x){return 1.0-x;}\nvec2 complement(vec2 x){return vec2(1.0-x.x, 1.0-x.y);}\nvec3 complement(vec3 x){return vec3(1.0-x.x, 1.0-x.y, 1.0-x.z);}\nvec4 complement(vec4 x){return vec4(1.0-x.x, 1.0-x.y, 1.0-x.z, 1.0-x.w);}\n\n\n// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/rotate1\n\n\n// https://stackoverflow.com/questions/23793698/how-to-implement-slerp-in-glsl-hlsl\n// vec4 quatSlerp(vec4 p0, vec4 p1, float t)\n// {\n// \tfloat dotp = dot(normalize(p0), normalize(p1));\n// \tif ((dotp > 0.9999) || (dotp < -0.9999))\n// \t{\n// \t\tif (t<=0.5)\n// \t\t\treturn p0;\n// \t\treturn p1;\n// \t}\n// \tfloat theta = acos(dotp);\n// \tvec4 P = ((p0*sin((1.0-t)*theta) + p1*sin(t*theta)) / sin(theta));\n// \tP.w = 1.0;\n// \treturn P;\n// }\n\n// https://devcry.heiho.net/html/2017/20170521-slerp.html\n// float lerp(float a, float b, float t) {\n// \treturn (1.0 - t) * a + t * b;\n// }\n// vec4 quatSlerp(vec4 p0, vec4 p1, float t){\n// \tvec4 qb = p1;\n\n// \t// cos(a) = dot product\n// \tfloat cos_a = p0.x * qb.x + p0.y * qb.y + p0.z * qb.z + p0.w * qb.w;\n// \tif (cos_a < 0.0f) {\n// \t\tcos_a = -cos_a;\n// \t\tqb = -qb;\n// \t}\n\n// \t// close to zero, cos(a) ~= 1\n// \t// do linear interpolation\n// \tif (cos_a > 0.999) {\n// \t\treturn vec4(\n// \t\t\tlerp(p0.x, qb.x, t),\n// \t\t\tlerp(p0.y, qb.y, t),\n// \t\t\tlerp(p0.z, qb.z, t),\n// \t\t\tlerp(p0.w, qb.w, t)\n// \t\t);\n// \t}\n\n// \tfloat alpha = acos(cos_a);\n// \treturn (p0 * sin(1.0 - t) + p1 * sin(t * alpha)) / sin(alpha);\n// }\n\n// https://stackoverflow.com/questions/62943083/interpolate-between-two-quaternions-the-long-way\nvec4 quatSlerp(vec4 q1, vec4 q2, float t){\n\tfloat angle = acos(dot(q1, q2));\n\tfloat denom = sin(angle);\n\t//check if denom is zero\n\treturn (q1*sin((1.0-t)*angle)+q2*sin(t*angle))/denom;\n}\n// TO CHECK:\n// this page https://www.reddit.com/r/opengl/comments/704la7/glsl_quaternion_library/\n// has a link to a potentially nice pdf:\n// http://web.mit.edu/2.998/www/QuaternionReport1.pdf\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/meshPhysicalBuilder1/param1\nuniform vec3 v_POLY_param_cursor;\n\n// /geo1/MAT/meshPhysicalBuilder1/globals1\nvarying vec3 v_POLY_globals1_position;\nvarying vec3 v_POLY_globals1_normal;\n\n// /geo1/MAT/meshPhysicalBuilder1/attribute3\nvarying float v_POLY_attribute_inside;\n\n// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/attribute4\nvarying vec3 v_POLY_attribute_piececentroid;\n\n// /geo1/MAT/meshPhysicalBuilder1/attribute1\nattribute vec3 piececentroid;\n\n// /geo1/MAT/meshPhysicalBuilder1/attribute2\nattribute vec3 objectcentroid;\n\n// /geo1/MAT/meshPhysicalBuilder1/attribute3\nattribute float inside;\n\n\n\n\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\n\n\n\t// /geo1/MAT/meshPhysicalBuilder1/attribute1\n\tvec3 v_POLY_attribute1_val = piececentroid;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/attribute2\n\tvec3 v_POLY_attribute2_val = objectcentroid;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/param1\n\tvec3 v_POLY_param1_val = v_POLY_param_cursor;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/globals1\n\tv_POLY_globals1_position = vec3(position);\n\tv_POLY_globals1_normal = vec3(normal);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/attribute4\n\tvec3 v_POLY_attribute4_val = piececentroid;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/attribute3\n\tv_POLY_attribute_inside = float(inside);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/vec3ToFloat4\n\tfloat v_POLY_vec3ToFloat4_x = v_POLY_attribute1_val.x;\n\tfloat v_POLY_vec3ToFloat4_y = v_POLY_attribute1_val.y;\n\tfloat v_POLY_vec3ToFloat4_z = v_POLY_attribute1_val.z;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/vec3ToFloat3\n\tfloat v_POLY_vec3ToFloat3_x = v_POLY_attribute2_val.x;\n\tfloat v_POLY_vec3ToFloat3_z = v_POLY_attribute2_val.z;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/vec3ToFloat1\n\tfloat v_POLY_vec3ToFloat1_x = v_POLY_param1_val.x;\n\tfloat v_POLY_vec3ToFloat1_y = v_POLY_param1_val.y;\n\tfloat v_POLY_vec3ToFloat1_z = v_POLY_param1_val.z;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/subtract5\n\tvec3 v_POLY_subtract5_subtract = (v_POLY_globals1_position - v_POLY_attribute4_val - vec3(0.0, 0.0, 0.0));\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/floatToVec3_4\n\tvec3 v_POLY_floatToVec3_4_vec3 = vec3(v_POLY_vec3ToFloat4_x, v_POLY_vec3ToFloat4_y, v_POLY_vec3ToFloat4_z);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/floatToVec3_3\n\tvec3 v_POLY_floatToVec3_3_vec3 = vec3(v_POLY_vec3ToFloat3_x, 1.8, v_POLY_vec3ToFloat3_z);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/floatToVec3_1\n\tvec3 v_POLY_floatToVec3_1_vec3 = vec3(v_POLY_vec3ToFloat1_x, v_POLY_vec3ToFloat1_y, v_POLY_vec3ToFloat1_z);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/null1\n\tvec3 v_POLY_null1_val = v_POLY_floatToVec3_4_vec3;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/distance1\n\tfloat v_POLY_distance1_val = distance(v_POLY_floatToVec3_1_vec3, v_POLY_attribute1_val);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/subtract2\n\tvec3 v_POLY_subtract2_subtract = (v_POLY_null1_val - v_POLY_floatToVec3_3_vec3 - vec3(0.0, 0.0, 0.0));\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/complement1\n\tfloat v_POLY_complement1_val = complement(v_POLY_distance1_val);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/mult1\n\tvec3 v_POLY_mult1_product = (v_POLY_subtract2_subtract * vec3(1.0, 0.30000000000000004, 1.0));\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/clamp1\n\tfloat v_POLY_clamp1_val = clamp(v_POLY_complement1_val, 0.0, 1.0);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/vec3ToFloat5\n\tfloat v_POLY_vec3ToFloat5_x = v_POLY_mult1_product.x;\n\tfloat v_POLY_vec3ToFloat5_z = v_POLY_mult1_product.z;\n\tfloat v_POLY_vec3ToFloat5_y = v_POLY_mult1_product.y;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/multAdd1\n\tfloat v_POLY_multAdd1_val = (1.0*(v_POLY_clamp1_val + 0.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/max1\n\tfloat v_POLY_max1_val = max(v_POLY_vec3ToFloat5_y, 0.0);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/multAdd3\n\tfloat v_POLY_multAdd3_val = (3.0*(v_POLY_multAdd1_val + 0.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation\n\tfloat v_POLY_subnet_rotation_input0 = v_POLY_multAdd1_val;\n\tvec3 v_POLY_subnet_rotation_input1 = v_POLY_subtract5_subtract;\n\tvec3 v_POLY_subnet_rotation_input2 = v_POLY_globals1_normal;\n\tif(true){\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/subnetInput1\n\t\tfloat v_POLY_subnet_rotation_subnetInput1_input0 = v_POLY_multAdd1_val;\n\t\tvec3 v_POLY_subnet_rotation_subnetInput1_input1 = v_POLY_subtract5_subtract;\n\t\tvec3 v_POLY_subnet_rotation_subnetInput1_input2 = v_POLY_globals1_normal;\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/constant_UP\n\t\tvec3 v_POLY_subnet_rotation_constant_UP_val = vec3(0.0, 1.0, 0.0);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/attribute4\n\t\tvec3 v_POLY_subnet_rotation_attribute4_val = piececentroid;\n\t\tv_POLY_attribute_piececentroid = vec3(piececentroid);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/normalize3\n\t\tvec3 v_POLY_subnet_rotation_normalize3_normalized = normalize(v_POLY_subnet_rotation_subnetInput1_input1);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/multAdd3\n\t\tfloat v_POLY_subnet_rotation_multAdd3_val = (4.0*(v_POLY_subnet_rotation_subnetInput1_input0 + 0.0)) + -0.5;\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/length1\n\t\tfloat v_POLY_subnet_rotation_length1_val = length(v_POLY_subnet_rotation_subnetInput1_input1);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/normalize1\n\t\tvec3 v_POLY_subnet_rotation_normalize1_normalized = normalize(v_POLY_subnet_rotation_attribute4_val);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/max1\n\t\tfloat v_POLY_subnet_rotation_max1_val = max(v_POLY_subnet_rotation_multAdd3_val, 0.0);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/cross1\n\t\tvec3 v_POLY_subnet_rotation_cross1_cross = cross(v_POLY_subnet_rotation_constant_UP_val, v_POLY_subnet_rotation_normalize1_normalized);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/normalize2\n\t\tvec3 v_POLY_subnet_rotation_normalize2_normalized = normalize(v_POLY_subnet_rotation_cross1_cross);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/rotate1\n\t\tvec3 v_POLY_subnet_rotation_rotate1_val = rotateWithAxisAngle(v_POLY_subnet_rotation_normalize3_normalized, v_POLY_subnet_rotation_normalize2_normalized, v_POLY_subnet_rotation_max1_val);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/rotate2\n\t\tvec3 v_POLY_subnet_rotation_rotate2_val = rotateWithAxisAngle(v_POLY_subnet_rotation_subnetInput1_input2, v_POLY_subnet_rotation_normalize2_normalized, v_POLY_subnet_rotation_max1_val);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/multScalar1\n\t\tvec3 v_POLY_subnet_rotation_multScalar1_val = (v_POLY_subnet_rotation_length1_val*v_POLY_subnet_rotation_rotate1_val);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/subnetOutput1\n\t\tv_POLY_subnet_rotation_input1 = v_POLY_subnet_rotation_multScalar1_val;\n\t\tv_POLY_subnet_rotation_input2 = v_POLY_subnet_rotation_rotate2_val;\n\t}\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/floatToVec3_5\n\tvec3 v_POLY_floatToVec3_5_vec3 = vec3(v_POLY_vec3ToFloat5_x, v_POLY_max1_val, v_POLY_vec3ToFloat5_z);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/multScalar2\n\tvec3 v_POLY_multScalar2_val = (v_POLY_multAdd3_val*v_POLY_floatToVec3_5_vec3);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/add4\n\tvec3 v_POLY_add4_sum = (v_POLY_multScalar2_val + v_POLY_subnet_rotation_input1 + vec3(0.0, 0.0, 0.0));\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/add3\n\tvec3 v_POLY_add3_sum = (v_POLY_add4_sum + v_POLY_attribute4_val + vec3(0.0, 0.0, 0.0));\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/output1\n\tvec3 transformed = v_POLY_add3_sum;\n\tvec3 objectNormal = v_POLY_subnet_rotation_input2;\n\t#ifdef USE_TANGENT\n\t\tvec3 objectTangent = vec3( tangent.xyz );\n\t#endif\n\n\n\n\t#include <morphcolor_vertex>\n// removed:\n//\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n// removed:\n//\t#include <begin_vertex>\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\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}","fragmentShader":"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULARINTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n\t#ifdef USE_SPECULARCOLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEENCOLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n\n\n\n// /geo1/MAT/meshPhysicalBuilder1/attribute3\nvarying float v_POLY_attribute_inside;\n\n// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/attribute4\nvarying vec3 v_POLY_attribute_piececentroid;\n\n\n\n\n#include <packing>\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 <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nstruct SSSModel {\n\tbool isActive;\n\tvec3 color;\n\tfloat thickness;\n\tfloat power;\n\tfloat scale;\n\tfloat distortion;\n\tfloat ambient;\n\tfloat attenuation;\n};\n\nvoid RE_Direct_Scattering(\n\tconst in IncidentLight directLight,\n\tconst in GeometricContext geometry,\n\tconst in SSSModel sssModel,\n\tinout ReflectedLight reflectedLight\n\t){\n\tvec3 scatteringHalf = normalize(directLight.direction + (geometry.normal * sssModel.distortion));\n\tfloat scatteringDot = pow(saturate(dot(geometry.viewDir, -scatteringHalf)), sssModel.power) * sssModel.scale;\n\tvec3 scatteringIllu = (scatteringDot + sssModel.ambient) * (sssModel.color * (1.0-sssModel.thickness));\n\treflectedLight.directDiffuse += scatteringIllu * sssModel.attenuation * directLight.color;\n}\n\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\n\n\t// /geo1/MAT/meshPhysicalBuilder1/attribute3\n\tfloat v_POLY_attribute3_val = v_POLY_attribute_inside;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/smoothstep1\n\tfloat v_POLY_smoothstep1_val = smoothstep(0.0, 0.46, v_POLY_attribute3_val);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/output1\n\tfloat POLY_metalness = v_POLY_smoothstep1_val;\n\tfloat POLY_roughness = 1.0;\n\tvec3 POLY_emissive = vec3(1.0, 1.0, 1.0);\n\tSSSModel POLY_SSSModel = SSSModel(/*isActive*/false,/*color*/vec3(1.0, 1.0, 1.0), /*thickness*/0.1, /*power*/2.0, /*scale*/16.0, /*distortion*/0.1,/*ambient*/0.4,/*attenuation*/0.8 );\n\tfloat POLY_transmission = 1.0;\n\tfloat POLY_thickness = 1.0;\n\n\n\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive * POLY_emissive;\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\tfloat roughnessFactor = roughness * POLY_roughness;\n\n#ifdef USE_ROUGHNESSMAP\n\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\n\t// reads channel G, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\n\troughnessFactor *= texelRoughness.g;\n\n#endif\n\n\tfloat metalnessFactor = metalness * POLY_metalness;\n\n#ifdef USE_METALNESSMAP\n\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\n\t// reads channel B, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\n\tmetalnessFactor *= texelMetalness.b;\n\n#endif\n\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\nif(POLY_SSSModel.isActive){\n\tRE_Direct_Scattering(directLight, geometry, POLY_SSSModel, reflectedLight);\n}\n\n\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t\n#ifdef USE_TRANSMISSION\n\n\tfloat transmissionAlpha = 1.0;\nfloat transmissionFactor = transmission * POLY_transmission;\nfloat thicknessFactor = thickness * POLY_thickness;\n\n\t#ifdef USE_TRANSMISSIONMAP\n\n\t\ttransmissionFactor *= texture2D( transmissionMap, vUv ).r;\n\n\t#endif\n\n\t#ifdef USE_THICKNESSMAP\n\n\t\tthicknessFactor *= texture2D( thicknessMap, vUv ).g;\n\n\t#endif\n\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\n\tvec4 transmission = getIBLVolumeRefraction(\n\t\tn, v, roughnessFactor, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor,\n\t\tattenuationColor, attenuationDistance );\n\n\ttotalDiffuse = mix( totalDiffuse, transmission.rgb, transmissionFactor );\n\ttransmissionAlpha = mix( transmissionAlpha, transmission.a, transmissionFactor );\n#endif\n\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;\n\t#endif\n\t#include <output_fragment>\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}","timeDependent":false,"resolutionDependent":false,"paramConfigs":[{"type":"vector3","name":"cursor","defaultValue":[0,0,0],"uniformName":"v_POLY_param_cursor"}]},"customMaterials":{"customDepthMaterial":{"material":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/geo1/MAT/meshPhysicalBuilder1-customDepthMaterial","type":"MeshDepthMaterial","name":"customDepthMaterial","side":1,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"depthPacking":3201},"onBeforeCompileDataJSON":{"vertexShader":"#include <common>\n\n\n\n// /geo1/MAT/meshPhysicalBuilder1/complement1\nfloat complement(float x){return 1.0-x;}\nvec2 complement(vec2 x){return vec2(1.0-x.x, 1.0-x.y);}\nvec3 complement(vec3 x){return vec3(1.0-x.x, 1.0-x.y, 1.0-x.z);}\nvec4 complement(vec4 x){return vec4(1.0-x.x, 1.0-x.y, 1.0-x.z, 1.0-x.w);}\n\n\n// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/rotate1\n\n\n// https://stackoverflow.com/questions/23793698/how-to-implement-slerp-in-glsl-hlsl\n// vec4 quatSlerp(vec4 p0, vec4 p1, float t)\n// {\n// \tfloat dotp = dot(normalize(p0), normalize(p1));\n// \tif ((dotp > 0.9999) || (dotp < -0.9999))\n// \t{\n// \t\tif (t<=0.5)\n// \t\t\treturn p0;\n// \t\treturn p1;\n// \t}\n// \tfloat theta = acos(dotp);\n// \tvec4 P = ((p0*sin((1.0-t)*theta) + p1*sin(t*theta)) / sin(theta));\n// \tP.w = 1.0;\n// \treturn P;\n// }\n\n// https://devcry.heiho.net/html/2017/20170521-slerp.html\n// float lerp(float a, float b, float t) {\n// \treturn (1.0 - t) * a + t * b;\n// }\n// vec4 quatSlerp(vec4 p0, vec4 p1, float t){\n// \tvec4 qb = p1;\n\n// \t// cos(a) = dot product\n// \tfloat cos_a = p0.x * qb.x + p0.y * qb.y + p0.z * qb.z + p0.w * qb.w;\n// \tif (cos_a < 0.0f) {\n// \t\tcos_a = -cos_a;\n// \t\tqb = -qb;\n// \t}\n\n// \t// close to zero, cos(a) ~= 1\n// \t// do linear interpolation\n// \tif (cos_a > 0.999) {\n// \t\treturn vec4(\n// \t\t\tlerp(p0.x, qb.x, t),\n// \t\t\tlerp(p0.y, qb.y, t),\n// \t\t\tlerp(p0.z, qb.z, t),\n// \t\t\tlerp(p0.w, qb.w, t)\n// \t\t);\n// \t}\n\n// \tfloat alpha = acos(cos_a);\n// \treturn (p0 * sin(1.0 - t) + p1 * sin(t * alpha)) / sin(alpha);\n// }\n\n// https://stackoverflow.com/questions/62943083/interpolate-between-two-quaternions-the-long-way\nvec4 quatSlerp(vec4 q1, vec4 q2, float t){\n\tfloat angle = acos(dot(q1, q2));\n\tfloat denom = sin(angle);\n\t//check if denom is zero\n\treturn (q1*sin((1.0-t)*angle)+q2*sin(t*angle))/denom;\n}\n// TO CHECK:\n// this page https://www.reddit.com/r/opengl/comments/704la7/glsl_quaternion_library/\n// has a link to a potentially nice pdf:\n// http://web.mit.edu/2.998/www/QuaternionReport1.pdf\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/meshPhysicalBuilder1/param1\nuniform vec3 v_POLY_param_cursor;\n\n// /geo1/MAT/meshPhysicalBuilder1/globals1\nvarying vec3 v_POLY_globals1_position;\nvarying vec3 v_POLY_globals1_normal;\n\n// /geo1/MAT/meshPhysicalBuilder1/attribute3\nvarying float v_POLY_attribute_inside;\n\n// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/attribute4\nvarying vec3 v_POLY_attribute_piececentroid;\n\n// /geo1/MAT/meshPhysicalBuilder1/attribute1\nattribute vec3 piececentroid;\n\n// /geo1/MAT/meshPhysicalBuilder1/attribute2\nattribute vec3 objectcentroid;\n\n// /geo1/MAT/meshPhysicalBuilder1/attribute3\nattribute float inside;\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>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n// removed:\n//\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n// removed:\n//\t#include <begin_vertex>\n\n\n\n\t// /geo1/MAT/meshPhysicalBuilder1/attribute1\n\tvec3 v_POLY_attribute1_val = piececentroid;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/attribute2\n\tvec3 v_POLY_attribute2_val = objectcentroid;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/param1\n\tvec3 v_POLY_param1_val = v_POLY_param_cursor;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/globals1\n\tv_POLY_globals1_position = vec3(position);\n\tv_POLY_globals1_normal = vec3(normal);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/attribute4\n\tvec3 v_POLY_attribute4_val = piececentroid;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/attribute3\n\tv_POLY_attribute_inside = float(inside);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/vec3ToFloat4\n\tfloat v_POLY_vec3ToFloat4_x = v_POLY_attribute1_val.x;\n\tfloat v_POLY_vec3ToFloat4_y = v_POLY_attribute1_val.y;\n\tfloat v_POLY_vec3ToFloat4_z = v_POLY_attribute1_val.z;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/vec3ToFloat3\n\tfloat v_POLY_vec3ToFloat3_x = v_POLY_attribute2_val.x;\n\tfloat v_POLY_vec3ToFloat3_z = v_POLY_attribute2_val.z;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/vec3ToFloat1\n\tfloat v_POLY_vec3ToFloat1_x = v_POLY_param1_val.x;\n\tfloat v_POLY_vec3ToFloat1_y = v_POLY_param1_val.y;\n\tfloat v_POLY_vec3ToFloat1_z = v_POLY_param1_val.z;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/subtract5\n\tvec3 v_POLY_subtract5_subtract = (v_POLY_globals1_position - v_POLY_attribute4_val - vec3(0.0, 0.0, 0.0));\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/floatToVec3_4\n\tvec3 v_POLY_floatToVec3_4_vec3 = vec3(v_POLY_vec3ToFloat4_x, v_POLY_vec3ToFloat4_y, v_POLY_vec3ToFloat4_z);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/floatToVec3_3\n\tvec3 v_POLY_floatToVec3_3_vec3 = vec3(v_POLY_vec3ToFloat3_x, 1.8, v_POLY_vec3ToFloat3_z);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/floatToVec3_1\n\tvec3 v_POLY_floatToVec3_1_vec3 = vec3(v_POLY_vec3ToFloat1_x, v_POLY_vec3ToFloat1_y, v_POLY_vec3ToFloat1_z);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/null1\n\tvec3 v_POLY_null1_val = v_POLY_floatToVec3_4_vec3;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/distance1\n\tfloat v_POLY_distance1_val = distance(v_POLY_floatToVec3_1_vec3, v_POLY_attribute1_val);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/subtract2\n\tvec3 v_POLY_subtract2_subtract = (v_POLY_null1_val - v_POLY_floatToVec3_3_vec3 - vec3(0.0, 0.0, 0.0));\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/complement1\n\tfloat v_POLY_complement1_val = complement(v_POLY_distance1_val);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/mult1\n\tvec3 v_POLY_mult1_product = (v_POLY_subtract2_subtract * vec3(1.0, 0.30000000000000004, 1.0));\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/clamp1\n\tfloat v_POLY_clamp1_val = clamp(v_POLY_complement1_val, 0.0, 1.0);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/vec3ToFloat5\n\tfloat v_POLY_vec3ToFloat5_x = v_POLY_mult1_product.x;\n\tfloat v_POLY_vec3ToFloat5_z = v_POLY_mult1_product.z;\n\tfloat v_POLY_vec3ToFloat5_y = v_POLY_mult1_product.y;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/multAdd1\n\tfloat v_POLY_multAdd1_val = (1.0*(v_POLY_clamp1_val + 0.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/max1\n\tfloat v_POLY_max1_val = max(v_POLY_vec3ToFloat5_y, 0.0);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/multAdd3\n\tfloat v_POLY_multAdd3_val = (3.0*(v_POLY_multAdd1_val + 0.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation\n\tfloat v_POLY_subnet_rotation_input0 = v_POLY_multAdd1_val;\n\tvec3 v_POLY_subnet_rotation_input1 = v_POLY_subtract5_subtract;\n\tvec3 v_POLY_subnet_rotation_input2 = v_POLY_globals1_normal;\n\tif(true){\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/subnetInput1\n\t\tfloat v_POLY_subnet_rotation_subnetInput1_input0 = v_POLY_multAdd1_val;\n\t\tvec3 v_POLY_subnet_rotation_subnetInput1_input1 = v_POLY_subtract5_subtract;\n\t\tvec3 v_POLY_subnet_rotation_subnetInput1_input2 = v_POLY_globals1_normal;\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/constant_UP\n\t\tvec3 v_POLY_subnet_rotation_constant_UP_val = vec3(0.0, 1.0, 0.0);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/attribute4\n\t\tvec3 v_POLY_subnet_rotation_attribute4_val = piececentroid;\n\t\tv_POLY_attribute_piececentroid = vec3(piececentroid);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/normalize3\n\t\tvec3 v_POLY_subnet_rotation_normalize3_normalized = normalize(v_POLY_subnet_rotation_subnetInput1_input1);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/multAdd3\n\t\tfloat v_POLY_subnet_rotation_multAdd3_val = (4.0*(v_POLY_subnet_rotation_subnetInput1_input0 + 0.0)) + -0.5;\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/length1\n\t\tfloat v_POLY_subnet_rotation_length1_val = length(v_POLY_subnet_rotation_subnetInput1_input1);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/normalize1\n\t\tvec3 v_POLY_subnet_rotation_normalize1_normalized = normalize(v_POLY_subnet_rotation_attribute4_val);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/max1\n\t\tfloat v_POLY_subnet_rotation_max1_val = max(v_POLY_subnet_rotation_multAdd3_val, 0.0);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/cross1\n\t\tvec3 v_POLY_subnet_rotation_cross1_cross = cross(v_POLY_subnet_rotation_constant_UP_val, v_POLY_subnet_rotation_normalize1_normalized);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/normalize2\n\t\tvec3 v_POLY_subnet_rotation_normalize2_normalized = normalize(v_POLY_subnet_rotation_cross1_cross);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/rotate1\n\t\tvec3 v_POLY_subnet_rotation_rotate1_val = rotateWithAxisAngle(v_POLY_subnet_rotation_normalize3_normalized, v_POLY_subnet_rotation_normalize2_normalized, v_POLY_subnet_rotation_max1_val);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/rotate2\n\t\tvec3 v_POLY_subnet_rotation_rotate2_val = rotateWithAxisAngle(v_POLY_subnet_rotation_subnetInput1_input2, v_POLY_subnet_rotation_normalize2_normalized, v_POLY_subnet_rotation_max1_val);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/multScalar1\n\t\tvec3 v_POLY_subnet_rotation_multScalar1_val = (v_POLY_subnet_rotation_length1_val*v_POLY_subnet_rotation_rotate1_val);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/subnetOutput1\n\t\tv_POLY_subnet_rotation_input1 = v_POLY_subnet_rotation_multScalar1_val;\n\t\tv_POLY_subnet_rotation_input2 = v_POLY_subnet_rotation_rotate2_val;\n\t}\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/floatToVec3_5\n\tvec3 v_POLY_floatToVec3_5_vec3 = vec3(v_POLY_vec3ToFloat5_x, v_POLY_max1_val, v_POLY_vec3ToFloat5_z);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/multScalar2\n\tvec3 v_POLY_multScalar2_val = (v_POLY_multAdd3_val*v_POLY_floatToVec3_5_vec3);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/add4\n\tvec3 v_POLY_add4_sum = (v_POLY_multScalar2_val + v_POLY_subnet_rotation_input1 + vec3(0.0, 0.0, 0.0));\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/add3\n\tvec3 v_POLY_add3_sum = (v_POLY_add4_sum + v_POLY_attribute4_val + vec3(0.0, 0.0, 0.0));\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/output1\n\tvec3 transformed = v_POLY_add3_sum;\n\tvec3 objectNormal = v_POLY_subnet_rotation_input2;\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\tvHighPrecisionZW = gl_Position.zw;\n}","fragmentShader":"\n// INSERT DEFINES\n\n\n#if DEPTH_PACKING == 3200\n\n\tuniform float opacity;\n\n#endif\n\n#include <common>\n\n\n\n// /geo1/MAT/meshPhysicalBuilder1/attribute3\nvarying float v_POLY_attribute_inside;\n\n// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/attribute4\nvarying vec3 v_POLY_attribute_piececentroid;\n\n\n\n\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvarying vec2 vHighPrecisionZW;\n\nstruct SSSModel {\n\tbool isActive;\n\tvec3 color;\n\tfloat thickness;\n\tfloat power;\n\tfloat scale;\n\tfloat distortion;\n\tfloat ambient;\n\tfloat attenuation;\n};\n\nvoid RE_Direct_Scattering(\n\tconst in IncidentLight directLight,\n\tconst in GeometricContext geometry,\n\tconst in SSSModel sssModel,\n\tinout ReflectedLight reflectedLight\n\t){\n\tvec3 scatteringHalf = normalize(directLight.direction + (geometry.normal * sssModel.distortion));\n\tfloat scatteringDot = pow(saturate(dot(geometry.viewDir, -scatteringHalf)), sssModel.power) * sssModel.scale;\n\tvec3 scatteringIllu = (scatteringDot + sssModel.ambient) * (sssModel.color * (1.0-sssModel.thickness));\n\treflectedLight.directDiffuse += scatteringIllu * sssModel.attenuation * directLight.color;\n}\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( 1.0 );\n\n\t#if DEPTH_PACKING == 3200\n\n\t\tdiffuseColor.a = opacity;\n\n\t#endif\n\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\n\n\n\t// /geo1/MAT/meshPhysicalBuilder1/attribute3\n\tfloat v_POLY_attribute3_val = v_POLY_attribute_inside;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/smoothstep1\n\tfloat v_POLY_smoothstep1_val = smoothstep(0.0, 0.46, v_POLY_attribute3_val);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/output1\n\tfloat POLY_metalness = v_POLY_smoothstep1_val;\n\tfloat POLY_roughness = 1.0;\n\tvec3 POLY_emissive = vec3(1.0, 1.0, 1.0);\n\tSSSModel POLY_SSSModel = SSSModel(/*isActive*/false,/*color*/vec3(1.0, 1.0, 1.0), /*thickness*/0.1, /*power*/2.0, /*scale*/16.0, /*distortion*/0.1,/*ambient*/0.4,/*attenuation*/0.8 );\n\tfloat POLY_transmission = 1.0;\n\tfloat POLY_thickness = 1.0;\n\n\n\n\n\t// INSERT BODY\n\t// the new body lines should be added before the alphatest_fragment\n\t// so that alpha is set before (which is really how it would be set if the alphamap_fragment above was used by the material node parameters)\n\n\t#include <alphatest_fragment>\n\n\t#include <logdepthbuf_fragment>\n\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 ), diffuseColor.a );\n\n\t#elif DEPTH_PACKING == 3201\n\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\n\t#endif\n\n}\n","timeDependent":false,"resolutionDependent":false,"paramConfigs":[{"type":"vector3","name":"cursor","defaultValue":[0,0,0],"uniformName":"v_POLY_param_cursor"}]}},"customDistanceMaterial":{"material":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/geo1/MAT/meshPhysicalBuilder1-customDistanceMaterial","type":"MeshDistanceMaterial","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},"onBeforeCompileDataJSON":{"vertexShader":"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n\n\n\n// /geo1/MAT/meshPhysicalBuilder1/complement1\nfloat complement(float x){return 1.0-x;}\nvec2 complement(vec2 x){return vec2(1.0-x.x, 1.0-x.y);}\nvec3 complement(vec3 x){return vec3(1.0-x.x, 1.0-x.y, 1.0-x.z);}\nvec4 complement(vec4 x){return vec4(1.0-x.x, 1.0-x.y, 1.0-x.z, 1.0-x.w);}\n\n\n// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/rotate1\n\n\n// https://stackoverflow.com/questions/23793698/how-to-implement-slerp-in-glsl-hlsl\n// vec4 quatSlerp(vec4 p0, vec4 p1, float t)\n// {\n// \tfloat dotp = dot(normalize(p0), normalize(p1));\n// \tif ((dotp > 0.9999) || (dotp < -0.9999))\n// \t{\n// \t\tif (t<=0.5)\n// \t\t\treturn p0;\n// \t\treturn p1;\n// \t}\n// \tfloat theta = acos(dotp);\n// \tvec4 P = ((p0*sin((1.0-t)*theta) + p1*sin(t*theta)) / sin(theta));\n// \tP.w = 1.0;\n// \treturn P;\n// }\n\n// https://devcry.heiho.net/html/2017/20170521-slerp.html\n// float lerp(float a, float b, float t) {\n// \treturn (1.0 - t) * a + t * b;\n// }\n// vec4 quatSlerp(vec4 p0, vec4 p1, float t){\n// \tvec4 qb = p1;\n\n// \t// cos(a) = dot product\n// \tfloat cos_a = p0.x * qb.x + p0.y * qb.y + p0.z * qb.z + p0.w * qb.w;\n// \tif (cos_a < 0.0f) {\n// \t\tcos_a = -cos_a;\n// \t\tqb = -qb;\n// \t}\n\n// \t// close to zero, cos(a) ~= 1\n// \t// do linear interpolation\n// \tif (cos_a > 0.999) {\n// \t\treturn vec4(\n// \t\t\tlerp(p0.x, qb.x, t),\n// \t\t\tlerp(p0.y, qb.y, t),\n// \t\t\tlerp(p0.z, qb.z, t),\n// \t\t\tlerp(p0.w, qb.w, t)\n// \t\t);\n// \t}\n\n// \tfloat alpha = acos(cos_a);\n// \treturn (p0 * sin(1.0 - t) + p1 * sin(t * alpha)) / sin(alpha);\n// }\n\n// https://stackoverflow.com/questions/62943083/interpolate-between-two-quaternions-the-long-way\nvec4 quatSlerp(vec4 q1, vec4 q2, float t){\n\tfloat angle = acos(dot(q1, q2));\n\tfloat denom = sin(angle);\n\t//check if denom is zero\n\treturn (q1*sin((1.0-t)*angle)+q2*sin(t*angle))/denom;\n}\n// TO CHECK:\n// this page https://www.reddit.com/r/opengl/comments/704la7/glsl_quaternion_library/\n// has a link to a potentially nice pdf:\n// http://web.mit.edu/2.998/www/QuaternionReport1.pdf\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/meshPhysicalBuilder1/param1\nuniform vec3 v_POLY_param_cursor;\n\n// /geo1/MAT/meshPhysicalBuilder1/globals1\nvarying vec3 v_POLY_globals1_position;\nvarying vec3 v_POLY_globals1_normal;\n\n// /geo1/MAT/meshPhysicalBuilder1/attribute3\nvarying float v_POLY_attribute_inside;\n\n// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/attribute4\nvarying vec3 v_POLY_attribute_piececentroid;\n\n// /geo1/MAT/meshPhysicalBuilder1/attribute1\nattribute vec3 piececentroid;\n\n// /geo1/MAT/meshPhysicalBuilder1/attribute2\nattribute vec3 objectcentroid;\n\n// /geo1/MAT/meshPhysicalBuilder1/attribute3\nattribute float inside;\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>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n// removed:\n//\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n// removed:\n//\t#include <begin_vertex>\n\n\n\n\t// /geo1/MAT/meshPhysicalBuilder1/attribute1\n\tvec3 v_POLY_attribute1_val = piececentroid;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/attribute2\n\tvec3 v_POLY_attribute2_val = objectcentroid;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/param1\n\tvec3 v_POLY_param1_val = v_POLY_param_cursor;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/globals1\n\tv_POLY_globals1_position = vec3(position);\n\tv_POLY_globals1_normal = vec3(normal);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/attribute4\n\tvec3 v_POLY_attribute4_val = piececentroid;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/attribute3\n\tv_POLY_attribute_inside = float(inside);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/vec3ToFloat4\n\tfloat v_POLY_vec3ToFloat4_x = v_POLY_attribute1_val.x;\n\tfloat v_POLY_vec3ToFloat4_y = v_POLY_attribute1_val.y;\n\tfloat v_POLY_vec3ToFloat4_z = v_POLY_attribute1_val.z;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/vec3ToFloat3\n\tfloat v_POLY_vec3ToFloat3_x = v_POLY_attribute2_val.x;\n\tfloat v_POLY_vec3ToFloat3_z = v_POLY_attribute2_val.z;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/vec3ToFloat1\n\tfloat v_POLY_vec3ToFloat1_x = v_POLY_param1_val.x;\n\tfloat v_POLY_vec3ToFloat1_y = v_POLY_param1_val.y;\n\tfloat v_POLY_vec3ToFloat1_z = v_POLY_param1_val.z;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/subtract5\n\tvec3 v_POLY_subtract5_subtract = (v_POLY_globals1_position - v_POLY_attribute4_val - vec3(0.0, 0.0, 0.0));\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/floatToVec3_4\n\tvec3 v_POLY_floatToVec3_4_vec3 = vec3(v_POLY_vec3ToFloat4_x, v_POLY_vec3ToFloat4_y, v_POLY_vec3ToFloat4_z);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/floatToVec3_3\n\tvec3 v_POLY_floatToVec3_3_vec3 = vec3(v_POLY_vec3ToFloat3_x, 1.8, v_POLY_vec3ToFloat3_z);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/floatToVec3_1\n\tvec3 v_POLY_floatToVec3_1_vec3 = vec3(v_POLY_vec3ToFloat1_x, v_POLY_vec3ToFloat1_y, v_POLY_vec3ToFloat1_z);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/null1\n\tvec3 v_POLY_null1_val = v_POLY_floatToVec3_4_vec3;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/distance1\n\tfloat v_POLY_distance1_val = distance(v_POLY_floatToVec3_1_vec3, v_POLY_attribute1_val);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/subtract2\n\tvec3 v_POLY_subtract2_subtract = (v_POLY_null1_val - v_POLY_floatToVec3_3_vec3 - vec3(0.0, 0.0, 0.0));\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/complement1\n\tfloat v_POLY_complement1_val = complement(v_POLY_distance1_val);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/mult1\n\tvec3 v_POLY_mult1_product = (v_POLY_subtract2_subtract * vec3(1.0, 0.30000000000000004, 1.0));\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/clamp1\n\tfloat v_POLY_clamp1_val = clamp(v_POLY_complement1_val, 0.0, 1.0);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/vec3ToFloat5\n\tfloat v_POLY_vec3ToFloat5_x = v_POLY_mult1_product.x;\n\tfloat v_POLY_vec3ToFloat5_z = v_POLY_mult1_product.z;\n\tfloat v_POLY_vec3ToFloat5_y = v_POLY_mult1_product.y;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/multAdd1\n\tfloat v_POLY_multAdd1_val = (1.0*(v_POLY_clamp1_val + 0.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/max1\n\tfloat v_POLY_max1_val = max(v_POLY_vec3ToFloat5_y, 0.0);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/multAdd3\n\tfloat v_POLY_multAdd3_val = (3.0*(v_POLY_multAdd1_val + 0.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation\n\tfloat v_POLY_subnet_rotation_input0 = v_POLY_multAdd1_val;\n\tvec3 v_POLY_subnet_rotation_input1 = v_POLY_subtract5_subtract;\n\tvec3 v_POLY_subnet_rotation_input2 = v_POLY_globals1_normal;\n\tif(true){\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/subnetInput1\n\t\tfloat v_POLY_subnet_rotation_subnetInput1_input0 = v_POLY_multAdd1_val;\n\t\tvec3 v_POLY_subnet_rotation_subnetInput1_input1 = v_POLY_subtract5_subtract;\n\t\tvec3 v_POLY_subnet_rotation_subnetInput1_input2 = v_POLY_globals1_normal;\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/constant_UP\n\t\tvec3 v_POLY_subnet_rotation_constant_UP_val = vec3(0.0, 1.0, 0.0);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/attribute4\n\t\tvec3 v_POLY_subnet_rotation_attribute4_val = piececentroid;\n\t\tv_POLY_attribute_piececentroid = vec3(piececentroid);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/normalize3\n\t\tvec3 v_POLY_subnet_rotation_normalize3_normalized = normalize(v_POLY_subnet_rotation_subnetInput1_input1);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/multAdd3\n\t\tfloat v_POLY_subnet_rotation_multAdd3_val = (4.0*(v_POLY_subnet_rotation_subnetInput1_input0 + 0.0)) + -0.5;\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/length1\n\t\tfloat v_POLY_subnet_rotation_length1_val = length(v_POLY_subnet_rotation_subnetInput1_input1);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/normalize1\n\t\tvec3 v_POLY_subnet_rotation_normalize1_normalized = normalize(v_POLY_subnet_rotation_attribute4_val);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/max1\n\t\tfloat v_POLY_subnet_rotation_max1_val = max(v_POLY_subnet_rotation_multAdd3_val, 0.0);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/cross1\n\t\tvec3 v_POLY_subnet_rotation_cross1_cross = cross(v_POLY_subnet_rotation_constant_UP_val, v_POLY_subnet_rotation_normalize1_normalized);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/normalize2\n\t\tvec3 v_POLY_subnet_rotation_normalize2_normalized = normalize(v_POLY_subnet_rotation_cross1_cross);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/rotate1\n\t\tvec3 v_POLY_subnet_rotation_rotate1_val = rotateWithAxisAngle(v_POLY_subnet_rotation_normalize3_normalized, v_POLY_subnet_rotation_normalize2_normalized, v_POLY_subnet_rotation_max1_val);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/rotate2\n\t\tvec3 v_POLY_subnet_rotation_rotate2_val = rotateWithAxisAngle(v_POLY_subnet_rotation_subnetInput1_input2, v_POLY_subnet_rotation_normalize2_normalized, v_POLY_subnet_rotation_max1_val);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/multScalar1\n\t\tvec3 v_POLY_subnet_rotation_multScalar1_val = (v_POLY_subnet_rotation_length1_val*v_POLY_subnet_rotation_rotate1_val);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/subnetOutput1\n\t\tv_POLY_subnet_rotation_input1 = v_POLY_subnet_rotation_multScalar1_val;\n\t\tv_POLY_subnet_rotation_input2 = v_POLY_subnet_rotation_rotate2_val;\n\t}\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/floatToVec3_5\n\tvec3 v_POLY_floatToVec3_5_vec3 = vec3(v_POLY_vec3ToFloat5_x, v_POLY_max1_val, v_POLY_vec3ToFloat5_z);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/multScalar2\n\tvec3 v_POLY_multScalar2_val = (v_POLY_multAdd3_val*v_POLY_floatToVec3_5_vec3);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/add4\n\tvec3 v_POLY_add4_sum = (v_POLY_multScalar2_val + v_POLY_subnet_rotation_input1 + vec3(0.0, 0.0, 0.0));\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/add3\n\tvec3 v_POLY_add3_sum = (v_POLY_add4_sum + v_POLY_attribute4_val + vec3(0.0, 0.0, 0.0));\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/output1\n\tvec3 transformed = v_POLY_add3_sum;\n\tvec3 objectNormal = v_POLY_subnet_rotation_input2;\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\tvWorldPosition = worldPosition.xyz;\n}","fragmentShader":"\n// INSERT DEFINES\n\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/meshPhysicalBuilder1/attribute3\nvarying float v_POLY_attribute_inside;\n\n// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/attribute4\nvarying vec3 v_POLY_attribute_piececentroid;\n\n\n\n\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nstruct SSSModel {\n\tbool isActive;\n\tvec3 color;\n\tfloat thickness;\n\tfloat power;\n\tfloat scale;\n\tfloat distortion;\n\tfloat ambient;\n\tfloat attenuation;\n};\n\nvoid RE_Direct_Scattering(\n\tconst in IncidentLight directLight,\n\tconst in GeometricContext geometry,\n\tconst in SSSModel sssModel,\n\tinout ReflectedLight reflectedLight\n\t){\n\tvec3 scatteringHalf = normalize(directLight.direction + (geometry.normal * sssModel.distortion));\n\tfloat scatteringDot = pow(saturate(dot(geometry.viewDir, -scatteringHalf)), sssModel.power) * sssModel.scale;\n\tvec3 scatteringIllu = (scatteringDot + sssModel.ambient) * (sssModel.color * (1.0-sssModel.thickness));\n\treflectedLight.directDiffuse += scatteringIllu * sssModel.attenuation * directLight.color;\n}\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( 1.0 );\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\n\n\n\t// /geo1/MAT/meshPhysicalBuilder1/attribute3\n\tfloat v_POLY_attribute3_val = v_POLY_attribute_inside;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/smoothstep1\n\tfloat v_POLY_smoothstep1_val = smoothstep(0.0, 0.46, v_POLY_attribute3_val);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/output1\n\tfloat POLY_metalness = v_POLY_smoothstep1_val;\n\tfloat POLY_roughness = 1.0;\n\tvec3 POLY_emissive = vec3(1.0, 1.0, 1.0);\n\tSSSModel POLY_SSSModel = SSSModel(/*isActive*/false,/*color*/vec3(1.0, 1.0, 1.0), /*thickness*/0.1, /*power*/2.0, /*scale*/16.0, /*distortion*/0.1,/*ambient*/0.4,/*attenuation*/0.8 );\n\tfloat POLY_transmission = 1.0;\n\tfloat POLY_thickness = 1.0;\n\n\n\n\n\t// INSERT BODY\n\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","timeDependent":false,"resolutionDependent":false,"paramConfigs":[{"type":"vector3","name":"cursor","defaultValue":[0,0,0],"uniformName":"v_POLY_param_cursor"}]}},"customDepthDOFMaterial":{"material":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/geo1/MAT/meshPhysicalBuilder1-customDepthDOFMaterial","type":"MeshDepthMaterial","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,"depthPacking":3200},"onBeforeCompileDataJSON":{"vertexShader":"#include <common>\n\n\n\n// /geo1/MAT/meshPhysicalBuilder1/complement1\nfloat complement(float x){return 1.0-x;}\nvec2 complement(vec2 x){return vec2(1.0-x.x, 1.0-x.y);}\nvec3 complement(vec3 x){return vec3(1.0-x.x, 1.0-x.y, 1.0-x.z);}\nvec4 complement(vec4 x){return vec4(1.0-x.x, 1.0-x.y, 1.0-x.z, 1.0-x.w);}\n\n\n// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/rotate1\n\n\n// https://stackoverflow.com/questions/23793698/how-to-implement-slerp-in-glsl-hlsl\n// vec4 quatSlerp(vec4 p0, vec4 p1, float t)\n// {\n// \tfloat dotp = dot(normalize(p0), normalize(p1));\n// \tif ((dotp > 0.9999) || (dotp < -0.9999))\n// \t{\n// \t\tif (t<=0.5)\n// \t\t\treturn p0;\n// \t\treturn p1;\n// \t}\n// \tfloat theta = acos(dotp);\n// \tvec4 P = ((p0*sin((1.0-t)*theta) + p1*sin(t*theta)) / sin(theta));\n// \tP.w = 1.0;\n// \treturn P;\n// }\n\n// https://devcry.heiho.net/html/2017/20170521-slerp.html\n// float lerp(float a, float b, float t) {\n// \treturn (1.0 - t) * a + t * b;\n// }\n// vec4 quatSlerp(vec4 p0, vec4 p1, float t){\n// \tvec4 qb = p1;\n\n// \t// cos(a) = dot product\n// \tfloat cos_a = p0.x * qb.x + p0.y * qb.y + p0.z * qb.z + p0.w * qb.w;\n// \tif (cos_a < 0.0f) {\n// \t\tcos_a = -cos_a;\n// \t\tqb = -qb;\n// \t}\n\n// \t// close to zero, cos(a) ~= 1\n// \t// do linear interpolation\n// \tif (cos_a > 0.999) {\n// \t\treturn vec4(\n// \t\t\tlerp(p0.x, qb.x, t),\n// \t\t\tlerp(p0.y, qb.y, t),\n// \t\t\tlerp(p0.z, qb.z, t),\n// \t\t\tlerp(p0.w, qb.w, t)\n// \t\t);\n// \t}\n\n// \tfloat alpha = acos(cos_a);\n// \treturn (p0 * sin(1.0 - t) + p1 * sin(t * alpha)) / sin(alpha);\n// }\n\n// https://stackoverflow.com/questions/62943083/interpolate-between-two-quaternions-the-long-way\nvec4 quatSlerp(vec4 q1, vec4 q2, float t){\n\tfloat angle = acos(dot(q1, q2));\n\tfloat denom = sin(angle);\n\t//check if denom is zero\n\treturn (q1*sin((1.0-t)*angle)+q2*sin(t*angle))/denom;\n}\n// TO CHECK:\n// this page https://www.reddit.com/r/opengl/comments/704la7/glsl_quaternion_library/\n// has a link to a potentially nice pdf:\n// http://web.mit.edu/2.998/www/QuaternionReport1.pdf\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/meshPhysicalBuilder1/param1\nuniform vec3 v_POLY_param_cursor;\n\n// /geo1/MAT/meshPhysicalBuilder1/globals1\nvarying vec3 v_POLY_globals1_position;\nvarying vec3 v_POLY_globals1_normal;\n\n// /geo1/MAT/meshPhysicalBuilder1/attribute3\nvarying float v_POLY_attribute_inside;\n\n// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/attribute4\nvarying vec3 v_POLY_attribute_piececentroid;\n\n// /geo1/MAT/meshPhysicalBuilder1/attribute1\nattribute vec3 piececentroid;\n\n// /geo1/MAT/meshPhysicalBuilder1/attribute2\nattribute vec3 objectcentroid;\n\n// /geo1/MAT/meshPhysicalBuilder1/attribute3\nattribute float inside;\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>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n// removed:\n//\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n// removed:\n//\t#include <begin_vertex>\n\n\n\n\t// /geo1/MAT/meshPhysicalBuilder1/attribute1\n\tvec3 v_POLY_attribute1_val = piececentroid;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/attribute2\n\tvec3 v_POLY_attribute2_val = objectcentroid;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/param1\n\tvec3 v_POLY_param1_val = v_POLY_param_cursor;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/globals1\n\tv_POLY_globals1_position = vec3(position);\n\tv_POLY_globals1_normal = vec3(normal);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/attribute4\n\tvec3 v_POLY_attribute4_val = piececentroid;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/attribute3\n\tv_POLY_attribute_inside = float(inside);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/vec3ToFloat4\n\tfloat v_POLY_vec3ToFloat4_x = v_POLY_attribute1_val.x;\n\tfloat v_POLY_vec3ToFloat4_y = v_POLY_attribute1_val.y;\n\tfloat v_POLY_vec3ToFloat4_z = v_POLY_attribute1_val.z;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/vec3ToFloat3\n\tfloat v_POLY_vec3ToFloat3_x = v_POLY_attribute2_val.x;\n\tfloat v_POLY_vec3ToFloat3_z = v_POLY_attribute2_val.z;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/vec3ToFloat1\n\tfloat v_POLY_vec3ToFloat1_x = v_POLY_param1_val.x;\n\tfloat v_POLY_vec3ToFloat1_y = v_POLY_param1_val.y;\n\tfloat v_POLY_vec3ToFloat1_z = v_POLY_param1_val.z;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/subtract5\n\tvec3 v_POLY_subtract5_subtract = (v_POLY_globals1_position - v_POLY_attribute4_val - vec3(0.0, 0.0, 0.0));\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/floatToVec3_4\n\tvec3 v_POLY_floatToVec3_4_vec3 = vec3(v_POLY_vec3ToFloat4_x, v_POLY_vec3ToFloat4_y, v_POLY_vec3ToFloat4_z);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/floatToVec3_3\n\tvec3 v_POLY_floatToVec3_3_vec3 = vec3(v_POLY_vec3ToFloat3_x, 1.8, v_POLY_vec3ToFloat3_z);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/floatToVec3_1\n\tvec3 v_POLY_floatToVec3_1_vec3 = vec3(v_POLY_vec3ToFloat1_x, v_POLY_vec3ToFloat1_y, v_POLY_vec3ToFloat1_z);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/null1\n\tvec3 v_POLY_null1_val = v_POLY_floatToVec3_4_vec3;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/distance1\n\tfloat v_POLY_distance1_val = distance(v_POLY_floatToVec3_1_vec3, v_POLY_attribute1_val);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/subtract2\n\tvec3 v_POLY_subtract2_subtract = (v_POLY_null1_val - v_POLY_floatToVec3_3_vec3 - vec3(0.0, 0.0, 0.0));\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/complement1\n\tfloat v_POLY_complement1_val = complement(v_POLY_distance1_val);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/mult1\n\tvec3 v_POLY_mult1_product = (v_POLY_subtract2_subtract * vec3(1.0, 0.30000000000000004, 1.0));\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/clamp1\n\tfloat v_POLY_clamp1_val = clamp(v_POLY_complement1_val, 0.0, 1.0);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/vec3ToFloat5\n\tfloat v_POLY_vec3ToFloat5_x = v_POLY_mult1_product.x;\n\tfloat v_POLY_vec3ToFloat5_z = v_POLY_mult1_product.z;\n\tfloat v_POLY_vec3ToFloat5_y = v_POLY_mult1_product.y;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/multAdd1\n\tfloat v_POLY_multAdd1_val = (1.0*(v_POLY_clamp1_val + 0.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/max1\n\tfloat v_POLY_max1_val = max(v_POLY_vec3ToFloat5_y, 0.0);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/multAdd3\n\tfloat v_POLY_multAdd3_val = (3.0*(v_POLY_multAdd1_val + 0.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation\n\tfloat v_POLY_subnet_rotation_input0 = v_POLY_multAdd1_val;\n\tvec3 v_POLY_subnet_rotation_input1 = v_POLY_subtract5_subtract;\n\tvec3 v_POLY_subnet_rotation_input2 = v_POLY_globals1_normal;\n\tif(true){\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/subnetInput1\n\t\tfloat v_POLY_subnet_rotation_subnetInput1_input0 = v_POLY_multAdd1_val;\n\t\tvec3 v_POLY_subnet_rotation_subnetInput1_input1 = v_POLY_subtract5_subtract;\n\t\tvec3 v_POLY_subnet_rotation_subnetInput1_input2 = v_POLY_globals1_normal;\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/constant_UP\n\t\tvec3 v_POLY_subnet_rotation_constant_UP_val = vec3(0.0, 1.0, 0.0);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/attribute4\n\t\tvec3 v_POLY_subnet_rotation_attribute4_val = piececentroid;\n\t\tv_POLY_attribute_piececentroid = vec3(piececentroid);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/normalize3\n\t\tvec3 v_POLY_subnet_rotation_normalize3_normalized = normalize(v_POLY_subnet_rotation_subnetInput1_input1);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/multAdd3\n\t\tfloat v_POLY_subnet_rotation_multAdd3_val = (4.0*(v_POLY_subnet_rotation_subnetInput1_input0 + 0.0)) + -0.5;\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/length1\n\t\tfloat v_POLY_subnet_rotation_length1_val = length(v_POLY_subnet_rotation_subnetInput1_input1);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/normalize1\n\t\tvec3 v_POLY_subnet_rotation_normalize1_normalized = normalize(v_POLY_subnet_rotation_attribute4_val);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/max1\n\t\tfloat v_POLY_subnet_rotation_max1_val = max(v_POLY_subnet_rotation_multAdd3_val, 0.0);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/cross1\n\t\tvec3 v_POLY_subnet_rotation_cross1_cross = cross(v_POLY_subnet_rotation_constant_UP_val, v_POLY_subnet_rotation_normalize1_normalized);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/normalize2\n\t\tvec3 v_POLY_subnet_rotation_normalize2_normalized = normalize(v_POLY_subnet_rotation_cross1_cross);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/rotate1\n\t\tvec3 v_POLY_subnet_rotation_rotate1_val = rotateWithAxisAngle(v_POLY_subnet_rotation_normalize3_normalized, v_POLY_subnet_rotation_normalize2_normalized, v_POLY_subnet_rotation_max1_val);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/rotate2\n\t\tvec3 v_POLY_subnet_rotation_rotate2_val = rotateWithAxisAngle(v_POLY_subnet_rotation_subnetInput1_input2, v_POLY_subnet_rotation_normalize2_normalized, v_POLY_subnet_rotation_max1_val);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/multScalar1\n\t\tvec3 v_POLY_subnet_rotation_multScalar1_val = (v_POLY_subnet_rotation_length1_val*v_POLY_subnet_rotation_rotate1_val);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/subnetOutput1\n\t\tv_POLY_subnet_rotation_input1 = v_POLY_subnet_rotation_multScalar1_val;\n\t\tv_POLY_subnet_rotation_input2 = v_POLY_subnet_rotation_rotate2_val;\n\t}\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/floatToVec3_5\n\tvec3 v_POLY_floatToVec3_5_vec3 = vec3(v_POLY_vec3ToFloat5_x, v_POLY_max1_val, v_POLY_vec3ToFloat5_z);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/multScalar2\n\tvec3 v_POLY_multScalar2_val = (v_POLY_multAdd3_val*v_POLY_floatToVec3_5_vec3);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/add4\n\tvec3 v_POLY_add4_sum = (v_POLY_multScalar2_val + v_POLY_subnet_rotation_input1 + vec3(0.0, 0.0, 0.0));\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/add3\n\tvec3 v_POLY_add3_sum = (v_POLY_add4_sum + v_POLY_attribute4_val + vec3(0.0, 0.0, 0.0));\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/output1\n\tvec3 transformed = v_POLY_add3_sum;\n\tvec3 objectNormal = v_POLY_subnet_rotation_input2;\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\tvHighPrecisionZW = gl_Position.zw;\n}","fragmentShader":"\n// INSERT DEFINES\n\n\n#if DEPTH_PACKING == 3200\n\n\tuniform float opacity;\n\n#endif\n\n#include <common>\n\n\n\n// /geo1/MAT/meshPhysicalBuilder1/attribute3\nvarying float v_POLY_attribute_inside;\n\n// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/attribute4\nvarying vec3 v_POLY_attribute_piececentroid;\n\n\n\n\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvarying vec2 vHighPrecisionZW;\n\nstruct SSSModel {\n\tbool isActive;\n\tvec3 color;\n\tfloat thickness;\n\tfloat power;\n\tfloat scale;\n\tfloat distortion;\n\tfloat ambient;\n\tfloat attenuation;\n};\n\nvoid RE_Direct_Scattering(\n\tconst in IncidentLight directLight,\n\tconst in GeometricContext geometry,\n\tconst in SSSModel sssModel,\n\tinout ReflectedLight reflectedLight\n\t){\n\tvec3 scatteringHalf = normalize(directLight.direction + (geometry.normal * sssModel.distortion));\n\tfloat scatteringDot = pow(saturate(dot(geometry.viewDir, -scatteringHalf)), sssModel.power) * sssModel.scale;\n\tvec3 scatteringIllu = (scatteringDot + sssModel.ambient) * (sssModel.color * (1.0-sssModel.thickness));\n\treflectedLight.directDiffuse += scatteringIllu * sssModel.attenuation * directLight.color;\n}\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( 1.0 );\n\n\t#if DEPTH_PACKING == 3200\n\n\t\tdiffuseColor.a = opacity;\n\n\t#endif\n\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\n\n\n\t// /geo1/MAT/meshPhysicalBuilder1/attribute3\n\tfloat v_POLY_attribute3_val = v_POLY_attribute_inside;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/smoothstep1\n\tfloat v_POLY_smoothstep1_val = smoothstep(0.0, 0.46, v_POLY_attribute3_val);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/output1\n\tfloat POLY_metalness = v_POLY_smoothstep1_val;\n\tfloat POLY_roughness = 1.0;\n\tvec3 POLY_emissive = vec3(1.0, 1.0, 1.0);\n\tSSSModel POLY_SSSModel = SSSModel(/*isActive*/false,/*color*/vec3(1.0, 1.0, 1.0), /*thickness*/0.1, /*power*/2.0, /*scale*/16.0, /*distortion*/0.1,/*ambient*/0.4,/*attenuation*/0.8 );\n\tfloat POLY_transmission = 1.0;\n\tfloat POLY_thickness = 1.0;\n\n\n\n\n\t// INSERT BODY\n\t// the new body lines should be added before the alphatest_fragment\n\t// so that alpha is set before (which is really how it would be set if the alphamap_fragment above was used by the material node parameters)\n\n\t#include <alphatest_fragment>\n\n\t#include <logdepthbuf_fragment>\n\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 ), diffuseColor.a );\n\n\t#elif DEPTH_PACKING == 3201\n\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\n\t#endif\n\n}\n","timeDependent":false,"resolutionDependent":false,"paramConfigs":[{"type":"vector3","name":"cursor","defaultValue":[0,0,0],"uniformName":"v_POLY_param_cursor"}]}}}}},"meshPhysicalBuilder2":{"type":"meshPhysicalBuilder","nodes":{"add1":{"type":"add","params":{"add0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"add1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"add2":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":true}}},"maxInputsCount":3,"inputs":[{"index":0,"node":"multScalar1","output":"val"},{"index":1,"node":"add2","output":"sum"}],"connection_points":{"in":[{"name":"add0","type":"vec3"},{"name":"add1","type":"vec3"},{"name":"add2","type":"vec3"}],"out":[{"name":"sum","type":"vec3"}]}},"add2":{"type":"add","params":{"add0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"add1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"add2":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":true}}},"maxInputsCount":3,"inputs":[{"index":0,"node":"subtract2","output":"subtract"},{"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"}]}},"add3":{"type":"add","params":{"add0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"add1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"add2":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":true}}},"maxInputsCount":3,"inputs":[{"index":0,"node":"add4","output":"sum"},{"index":1,"node":"attribute4","output":"val"}],"connection_points":{"in":[{"name":"add0","type":"vec3"},{"name":"add1","type":"vec3"},{"name":"add2","type":"vec3"}],"out":[{"name":"sum","type":"vec3"}]}},"add4":{"type":"add","params":{"add0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"add1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"add2":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":true}}},"maxInputsCount":3,"inputs":[{"index":0,"node":"multScalar2","output":"val"},{"index":1,"node":"subnet_rotation","output":"input1"}],"connection_points":{"in":[{"name":"add0","type":"vec3"},{"name":"add1","type":"vec3"},{"name":"add2","type":"vec3"}],"out":[{"name":"sum","type":"vec3"}]}},"attribute1":{"type":"attribute","params":{"name":"piececentroid","type":2},"connection_points":{"in":[],"out":[{"name":"val","type":"vec3"}]}},"attribute2":{"type":"attribute","params":{"name":"objectcentroid","type":2},"connection_points":{"in":[],"out":[{"name":"val","type":"vec3"}]}},"attribute3":{"type":"attribute","params":{"name":"inside"},"connection_points":{"in":[],"out":[{"name":"val","type":"float"}]}},"attribute4":{"type":"attribute","params":{"name":"piececentroid","type":2},"connection_points":{"in":[],"out":[{"name":"val","type":"vec3"}]}},"attribute5":{"type":"attribute","params":{"name":"objectcentroid","type":2},"connection_points":{"in":[],"out":[{"name":"val","type":"vec3"}]}},"clamp1":{"type":"clamp","params":{"value":{"type":"float","default_value":0,"options":{"spare":true,"editable":false}},"min":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}},"max":{"type":"float","default_value":1,"options":{"spare":true,"editable":true}}},"inputs":[{"index":0,"node":"complement1","output":"val"}],"connection_points":{"in":[{"name":"value","type":"float"},{"name":"min","type":"float"},{"name":"max","type":"float"}],"out":[{"name":"val","type":"float"}]}},"complement1":{"type":"complement","params":{"in":{"type":"float","default_value":0,"options":{"spare":true,"editable":false}}},"inputs":[{"index":0,"node":"distance1","output":"val"}],"connection_points":{"in":[{"name":"in","type":"float"}],"out":[{"name":"val","type":"float"}]}},"constant1":{"type":"constant","connection_points":{"in":[],"out":[{"name":"val","type":"float"}]}},"distance1":{"type":"distance","params":{"p0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"p1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}}},"inputs":[{"index":0,"node":"floatToVec3_1","output":"vec3"},{"index":1,"node":"attribute1","output":"val"}],"connection_points":{"in":[{"name":"p0","type":"vec3"},{"name":"p1","type":"vec3"}],"out":[{"name":"val","type":"float"}]}},"floatToVec3_1":{"type":"floatToVec3","params":{"x":{"overriden_options":{}},"y":{"overriden_options":{}},"z":{"overriden_options":{}}},"inputs":[{"index":0,"node":"vec3ToFloat1","output":"x"},{"index":1,"node":"vec3ToFloat1","output":"y"},{"index":2,"node":"vec3ToFloat1","output":"z"}]},"floatToVec3_2":{"type":"floatToVec3","params":{"x":{"overriden_options":{}},"y":{"overriden_options":{}},"z":{"overriden_options":{}}},"inputs":[null,{"index":1,"node":"vec3ToFloat2","output":"y"}]},"floatToVec3_3":{"type":"floatToVec3","params":{"x":{"overriden_options":{}},"y":{"raw_input":1.8,"overriden_options":{}},"z":{"overriden_options":{}}},"inputs":[{"index":0,"node":"vec3ToFloat3","output":"x"},null,{"index":2,"node":"vec3ToFloat3","output":"z"}]},"floatToVec3_4":{"type":"floatToVec3","params":{"x":{"overriden_options":{}},"y":{"overriden_options":{}},"z":{"overriden_options":{}}},"inputs":[{"index":0,"node":"vec3ToFloat4","output":"x"},{"index":1,"node":"vec3ToFloat4","output":"y"},{"index":2,"node":"vec3ToFloat4","output":"z"}]},"floatToVec3_5":{"type":"floatToVec3","params":{"x":{"overriden_options":{}},"y":{"overriden_options":{}},"z":{"overriden_options":{}}},"inputs":[{"index":0,"node":"vec3ToFloat5","output":"x"},{"index":1,"node":"max1","output":"val"},{"index":2,"node":"vec3ToFloat5","output":"z"}]},"globals1":{"type":"globals"},"max1":{"type":"max","params":{"in0":{"type":"float","default_value":0,"options":{"spare":true,"editable":false}},"in1":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}}},"inputs":[{"index":0,"node":"vec3ToFloat5","output":"y"}],"connection_points":{"in":[{"name":"in0","type":"float"},{"name":"in1","type":"float"}],"out":[{"name":"val","type":"float"}]}},"mult1":{"type":"mult","params":{"mult0":{"type":"vector3","default_value":[1,1,1],"options":{"spare":true,"editable":false}},"mult1":{"type":"vector3","default_value":[1,1,1],"options":{"spare":true,"editable":true},"raw_input":[1,0.30000000000000004,1]}},"inputs":[{"index":0,"node":"subtract2","output":"subtract"}],"connection_points":{"in":[{"name":"mult0","type":"vec3"},{"name":"mult1","type":"vec3"}],"out":[{"name":"product","type":"vec3"}]}},"multAdd1":{"type":"multAdd","params":{"value":{"type":"float","default_value":0,"options":{"spare":true,"editable":false}},"preAdd":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}},"mult":{"type":"float","default_value":1,"options":{"spare":true,"editable":true}},"postAdd":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}}},"inputs":[{"index":0,"node":"clamp1","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"}]}},"multAdd2":{"type":"multAdd","params":{"value":{"type":"float","default_value":0,"options":{"spare":true,"editable":false}},"preAdd":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}},"mult":{"type":"float","default_value":1,"options":{"spare":true,"editable":true}},"postAdd":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}}},"inputs":[{"index":0,"node":"multAdd1","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"}]}},"multAdd3":{"type":"multAdd","params":{"value":{"type":"float","default_value":0,"options":{"spare":true,"editable":false}},"preAdd":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}},"mult":{"type":"float","default_value":1,"options":{"spare":true,"editable":true},"raw_input":3},"postAdd":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}}},"inputs":[{"index":0,"node":"multAdd1","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"}]}},"multScalar1":{"type":"multScalar","params":{"value":{"type":"vector3","default_value":[1,1,1],"options":{"spare":true,"editable":false}},"mult":{"type":"float","default_value":1,"options":{"spare":true,"editable":false},"raw_input":1.5}},"inputs":[{"index":0,"node":"subtract2","output":"subtract"},{"index":1,"node":"multAdd2","output":"val"}],"connection_points":{"in":[{"name":"value","type":"vec3"},{"name":"mult","type":"float"}],"out":[{"name":"val","type":"vec3"}]}},"multScalar2":{"type":"multScalar","params":{"value":{"type":"vector3","default_value":[1,1,1],"options":{"spare":true,"editable":false}},"mult":{"type":"float","default_value":1,"options":{"spare":true,"editable":false}}},"inputs":[{"index":0,"node":"floatToVec3_5","output":"vec3"},{"index":1,"node":"multAdd3","output":"val"}],"connection_points":{"in":[{"name":"value","type":"vec3"},{"name":"mult","type":"float"}],"out":[{"name":"val","type":"vec3"}]}},"normalize1":{"type":"normalize","params":{"in":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}}},"inputs":[{"index":0,"node":"subtract2","output":"subtract"}],"connection_points":{"in":[{"name":"in","type":"vec3"}],"out":[{"name":"normalized","type":"vec3"}]}},"null1":{"type":"null","params":{"in":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}}},"inputs":[{"index":0,"node":"floatToVec3_4","output":"vec3"}],"connection_points":{"in":[{"name":"in","type":"vec3"}],"out":[{"name":"val","type":"vec3"}]}},"output1":{"type":"output","inputs":[null,null,null,null,null,{"index":5,"node":"constant1","output":"val"}]},"param1":{"type":"param","params":{"name":"cursor","type":4},"connection_points":{"in":[],"out":[{"name":"val","type":"vec3"}]}},"smoothstep1":{"type":"smoothstep","params":{"edge0":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}},"edge1":{"type":"float","default_value":1,"options":{"spare":true,"editable":true},"raw_input":0.46},"x":{"type":"float","default_value":0,"options":{"spare":true,"editable":false}}},"inputs":[null,null,{"index":2,"node":"attribute3","output":"val"}],"connection_points":{"in":[{"name":"edge0","type":"float"},{"name":"edge1","type":"float"},{"name":"x","type":"float"}],"out":[{"name":"val","type":"float"}]}},"subnet_rotation":{"type":"subnet","nodes":{"attribute4":{"type":"attribute","params":{"name":"piececentroid","type":2},"connection_points":{"in":[],"out":[{"name":"val","type":"vec3"}]}},"constant_UP":{"type":"constant","params":{"type":4,"vec3":[0,1,0]},"connection_points":{"in":[],"out":[{"name":"val","type":"vec3"}]}},"cross1":{"type":"cross","params":{"x":{"overriden_options":{}},"y":{"overriden_options":{}}},"inputs":[{"index":0,"node":"constant_UP","output":"val"},{"index":1,"node":"normalize1","output":"normalized"}]},"length1":{"type":"length","params":{"x":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}}},"inputs":[{"index":0,"node":"subnetInput1","output":"input1"}],"connection_points":{"in":[{"name":"x","type":"vec3"}],"out":[{"name":"val","type":"float"}]}},"max1":{"type":"max","params":{"in0":{"type":"float","default_value":0,"options":{"spare":true,"editable":false}},"in1":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}}},"inputs":[{"index":0,"node":"multAdd3","output":"val"}],"connection_points":{"in":[{"name":"in0","type":"float"},{"name":"in1","type":"float"}],"out":[{"name":"val","type":"float"}]}},"multAdd3":{"type":"multAdd","params":{"value":{"type":"float","default_value":0,"options":{"spare":true,"editable":false}},"preAdd":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}},"mult":{"type":"float","default_value":1,"options":{"spare":true,"editable":true},"raw_input":4},"postAdd":{"type":"float","default_value":0,"options":{"spare":true,"editable":true},"raw_input":-0.5}},"inputs":[{"index":0,"node":"subnetInput1","output":"input0"}],"connection_points":{"in":[{"name":"value","type":"float"},{"name":"preAdd","type":"float"},{"name":"mult","type":"float"},{"name":"postAdd","type":"float"}],"out":[{"name":"val","type":"float"}]}},"multScalar1":{"type":"multScalar","params":{"value":{"type":"vector3","default_value":[1,1,1],"options":{"spare":true,"editable":false}},"mult":{"type":"float","default_value":1,"options":{"spare":true,"editable":false}}},"inputs":[{"index":0,"node":"rotate1","output":"val"},{"index":1,"node":"length1","output":"val"}],"connection_points":{"in":[{"name":"value","type":"vec3"},{"name":"mult","type":"float"}],"out":[{"name":"val","type":"vec3"}]}},"normalize1":{"type":"normalize","params":{"in":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}}},"inputs":[{"index":0,"node":"attribute4","output":"val"}],"connection_points":{"in":[{"name":"in","type":"vec3"}],"out":[{"name":"normalized","type":"vec3"}]}},"normalize2":{"type":"normalize","params":{"in":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}}},"inputs":[{"index":0,"node":"cross1","output":"cross"}],"connection_points":{"in":[{"name":"in","type":"vec3"}],"out":[{"name":"normalized","type":"vec3"}]}},"normalize3":{"type":"normalize","params":{"in":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}}},"inputs":[{"index":0,"node":"subnetInput1","output":"input1"}],"connection_points":{"in":[{"name":"in","type":"vec3"}],"out":[{"name":"normalized","type":"vec3"}]}},"rotate1":{"type":"rotate","params":{"vector":{"type":"vector3","default_value":[0,0,1],"options":{"spare":true,"editable":false}},"axis":{"type":"vector3","default_value":[0,1,0],"options":{"spare":true,"editable":false},"raw_input":[0,0,1]},"angle":{"type":"float","default_value":0,"options":{"spare":true,"editable":false},"raw_input":-3.2}},"maxInputsCount":3,"inputs":[{"index":0,"node":"normalize3","output":"normalized"},{"index":1,"node":"normalize2","output":"normalized"},{"index":2,"node":"max1","output":"val"}],"connection_points":{"in":[{"name":"vector","type":"vec3"},{"name":"axis","type":"vec3"},{"name":"angle","type":"float"}],"out":[{"name":"val","type":"vec3"}]}},"rotate2":{"type":"rotate","params":{"vector":{"type":"vector3","default_value":[0,0,1],"options":{"spare":true,"editable":false}},"axis":{"type":"vector3","default_value":[0,1,0],"options":{"spare":true,"editable":false},"raw_input":[0,0,1]},"angle":{"type":"float","default_value":0,"options":{"spare":true,"editable":false},"raw_input":-3.2}},"maxInputsCount":3,"inputs":[{"index":0,"node":"subnetInput1","output":"input2"},{"index":1,"node":"normalize2","output":"normalized"},{"index":2,"node":"max1","output":"val"}],"connection_points":{"in":[{"name":"vector","type":"vec3"},{"name":"axis","type":"vec3"},{"name":"angle","type":"float"}],"out":[{"name":"val","type":"vec3"}]}},"subnetInput1":{"type":"subnetInput","connection_points":{"in":[],"out":[{"name":"input0","type":"float"},{"name":"input1","type":"vec3"},{"name":"input2","type":"vec3"}]}},"subnetOutput1":{"type":"subnetOutput","inputs":[null,{"index":1,"node":"multScalar1","output":"val"},{"index":2,"node":"rotate2","output":"val"}],"connection_points":{"in":[{"name":"input0","type":"float"},{"name":"input1","type":"vec3"},{"name":"input2","type":"vec3"}],"out":[]}}},"params":{"inputsCount":3,"inputType1":4,"inputType2":4,"input0":{"type":"float","default_value":0,"options":{"spare":true,"editable":false}},"input1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"input2":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}}},"maxInputsCount":3,"inputs":[{"index":0,"node":"multAdd1","output":"val"},{"index":1,"node":"subtract5","output":"subtract"},{"index":2,"node":"globals1","output":"normal"}],"connection_points":{"in":[{"name":"input0","type":"float"},{"name":"input1","type":"vec3"},{"name":"input2","type":"vec3"}],"out":[{"name":"input0","type":"float"},{"name":"input1","type":"vec3"},{"name":"input2","type":"vec3"}]}},"subtract1":{"type":"subtract","params":{"sub0":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}},"sub1":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}}},"connection_points":{"in":[{"name":"sub0","type":"float"},{"name":"sub1","type":"float"}],"out":[{"name":"subtract","type":"float"}]}},"subtract2":{"type":"subtract","params":{"sub0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"sub1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"sub2":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":true}}},"maxInputsCount":3,"inputs":[{"index":0,"node":"null1","output":"val"},{"index":1,"node":"floatToVec3_3","output":"vec3"}],"connection_points":{"in":[{"name":"sub0","type":"vec3"},{"name":"sub1","type":"vec3"},{"name":"sub2","type":"vec3"}],"out":[{"name":"subtract","type":"vec3"}]}},"subtract3":{"type":"subtract","params":{"sub0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"sub1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"sub2":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":true}}},"maxInputsCount":3,"inputs":[{"index":0,"node":"globals1","output":"position"},{"index":1,"node":"null1","output":"val"}],"connection_points":{"in":[{"name":"sub0","type":"vec3"},{"name":"sub1","type":"vec3"},{"name":"sub2","type":"vec3"}],"out":[{"name":"subtract","type":"vec3"}]}},"subtract4":{"type":"subtract","params":{"sub0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"sub1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"sub2":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":true}}},"maxInputsCount":3,"inputs":[{"index":0,"node":"floatToVec3_2","output":"vec3"},{"index":1,"node":"subtract2","output":"subtract"}],"connection_points":{"in":[{"name":"sub0","type":"vec3"},{"name":"sub1","type":"vec3"},{"name":"sub2","type":"vec3"}],"out":[{"name":"subtract","type":"vec3"}]}},"subtract5":{"type":"subtract","params":{"sub0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"sub1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"sub2":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":true}}},"maxInputsCount":3,"inputs":[{"index":0,"node":"globals1","output":"position"},{"index":1,"node":"attribute4","output":"val"}],"connection_points":{"in":[{"name":"sub0","type":"vec3"},{"name":"sub1","type":"vec3"},{"name":"sub2","type":"vec3"}],"out":[{"name":"subtract","type":"vec3"}]}},"vec3ToFloat1":{"type":"vec3ToFloat","params":{"vec":{"overriden_options":{}}},"inputs":[{"index":0,"node":"param1","output":"val"}]},"vec3ToFloat2":{"type":"vec3ToFloat","params":{"vec":{"overriden_options":{}}},"inputs":[{"index":0,"node":"attribute1","output":"val"}]},"vec3ToFloat3":{"type":"vec3ToFloat","params":{"vec":{"overriden_options":{}}},"inputs":[{"index":0,"node":"attribute2","output":"val"}]},"vec3ToFloat4":{"type":"vec3ToFloat","params":{"vec":{"overriden_options":{}}},"inputs":[{"index":0,"node":"attribute1","output":"val"}]},"vec3ToFloat5":{"type":"vec3ToFloat","params":{"vec":{"overriden_options":{}}},"inputs":[{"index":0,"node":"mult1","output":"product"}]}},"params":{"useEnvMap":true,"envMap":"../../../COP/envMap","roughness":0,"cursor":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"computeOnDirty":true,"cook":false,"dependentOnFoundNode":true},"raw_input":[6.570691958160555,-3.5966340156836747,0],"overriden_options":{"callback":"{}"}}},"persisted_config":{"material":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/geo1/MAT/meshPhysicalBuilder2-main","type":"MeshPhysicalMaterial","name":"/geo1/MAT/meshPhysicalBuilder2","color":16777215,"roughness":0,"metalness":1,"sheen":0,"sheenColor":0,"sheenRoughness":1,"emissive":0,"specularIntensity":1,"specularColor":16777215,"clearcoat":0,"clearcoatRoughness":0,"envMapIntensity":1,"reflectivity":0.49999999999999983,"transmission":0,"thickness":0.01,"attenuationDistance":0,"attenuationColor":16777215,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},"onBeforeCompileDataJSON":{"vertexShader":"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\n\n\n\t// /geo1/MAT/meshPhysicalBuilder2/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 <morphcolor_vertex>\n// removed:\n//\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n// removed:\n//\t#include <begin_vertex>\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\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}","fragmentShader":"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULARINTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n\t#ifdef USE_SPECULARCOLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEENCOLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\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 <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nstruct SSSModel {\n\tbool isActive;\n\tvec3 color;\n\tfloat thickness;\n\tfloat power;\n\tfloat scale;\n\tfloat distortion;\n\tfloat ambient;\n\tfloat attenuation;\n};\n\nvoid RE_Direct_Scattering(\n\tconst in IncidentLight directLight,\n\tconst in GeometricContext geometry,\n\tconst in SSSModel sssModel,\n\tinout ReflectedLight reflectedLight\n\t){\n\tvec3 scatteringHalf = normalize(directLight.direction + (geometry.normal * sssModel.distortion));\n\tfloat scatteringDot = pow(saturate(dot(geometry.viewDir, -scatteringHalf)), sssModel.power) * sssModel.scale;\n\tvec3 scatteringIllu = (scatteringDot + sssModel.ambient) * (sssModel.color * (1.0-sssModel.thickness));\n\treflectedLight.directDiffuse += scatteringIllu * sssModel.attenuation * directLight.color;\n}\n\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\n\n\t// /geo1/MAT/meshPhysicalBuilder2/constant1\n\tfloat v_POLY_constant1_val = 0.0;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder2/output1\n\tfloat POLY_metalness = v_POLY_constant1_val;\n\tfloat POLY_roughness = 1.0;\n\tvec3 POLY_emissive = vec3(1.0, 1.0, 1.0);\n\tSSSModel POLY_SSSModel = SSSModel(/*isActive*/false,/*color*/vec3(1.0, 1.0, 1.0), /*thickness*/0.1, /*power*/2.0, /*scale*/16.0, /*distortion*/0.1,/*ambient*/0.4,/*attenuation*/0.8 );\n\tfloat POLY_transmission = 1.0;\n\tfloat POLY_thickness = 1.0;\n\n\n\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive * POLY_emissive;\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\tfloat roughnessFactor = roughness * POLY_roughness;\n\n#ifdef USE_ROUGHNESSMAP\n\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\n\t// reads channel G, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\n\troughnessFactor *= texelRoughness.g;\n\n#endif\n\n\tfloat metalnessFactor = metalness * POLY_metalness;\n\n#ifdef USE_METALNESSMAP\n\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\n\t// reads channel B, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\n\tmetalnessFactor *= texelMetalness.b;\n\n#endif\n\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\nif(POLY_SSSModel.isActive){\n\tRE_Direct_Scattering(directLight, geometry, POLY_SSSModel, reflectedLight);\n}\n\n\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t\n#ifdef USE_TRANSMISSION\n\n\tfloat transmissionAlpha = 1.0;\nfloat transmissionFactor = transmission * POLY_transmission;\nfloat thicknessFactor = thickness * POLY_thickness;\n\n\t#ifdef USE_TRANSMISSIONMAP\n\n\t\ttransmissionFactor *= texture2D( transmissionMap, vUv ).r;\n\n\t#endif\n\n\t#ifdef USE_THICKNESSMAP\n\n\t\tthicknessFactor *= texture2D( thicknessMap, vUv ).g;\n\n\t#endif\n\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\n\tvec4 transmission = getIBLVolumeRefraction(\n\t\tn, v, roughnessFactor, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor,\n\t\tattenuationColor, attenuationDistance );\n\n\ttotalDiffuse = mix( totalDiffuse, transmission.rgb, transmissionFactor );\n\ttransmissionAlpha = mix( transmissionAlpha, transmission.a, transmissionFactor );\n#endif\n\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;\n\t#endif\n\t#include <output_fragment>\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}","timeDependent":false,"resolutionDependent":false,"paramConfigs":[{"type":"vector3","name":"cursor","defaultValue":[0,0,0],"uniformName":"v_POLY_param_cursor"}]},"customMaterials":{"customDepthMaterial":{"material":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/geo1/MAT/meshPhysicalBuilder2-customDepthMaterial","type":"MeshDepthMaterial","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,"depthPacking":3201},"onBeforeCompileDataJSON":{"vertexShader":"#include <common>\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>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n// removed:\n//\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n// removed:\n//\t#include <begin_vertex>\n\n\n\n\t// /geo1/MAT/meshPhysicalBuilder2/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\tvHighPrecisionZW = gl_Position.zw;\n}","fragmentShader":"\n// INSERT DEFINES\n\n\n#if DEPTH_PACKING == 3200\n\n\tuniform float opacity;\n\n#endif\n\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvarying vec2 vHighPrecisionZW;\n\nstruct SSSModel {\n\tbool isActive;\n\tvec3 color;\n\tfloat thickness;\n\tfloat power;\n\tfloat scale;\n\tfloat distortion;\n\tfloat ambient;\n\tfloat attenuation;\n};\n\nvoid RE_Direct_Scattering(\n\tconst in IncidentLight directLight,\n\tconst in GeometricContext geometry,\n\tconst in SSSModel sssModel,\n\tinout ReflectedLight reflectedLight\n\t){\n\tvec3 scatteringHalf = normalize(directLight.direction + (geometry.normal * sssModel.distortion));\n\tfloat scatteringDot = pow(saturate(dot(geometry.viewDir, -scatteringHalf)), sssModel.power) * sssModel.scale;\n\tvec3 scatteringIllu = (scatteringDot + sssModel.ambient) * (sssModel.color * (1.0-sssModel.thickness));\n\treflectedLight.directDiffuse += scatteringIllu * sssModel.attenuation * directLight.color;\n}\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( 1.0 );\n\n\t#if DEPTH_PACKING == 3200\n\n\t\tdiffuseColor.a = opacity;\n\n\t#endif\n\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\n\n\n\t// /geo1/MAT/meshPhysicalBuilder2/constant1\n\tfloat v_POLY_constant1_val = 0.0;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder2/output1\n\tfloat POLY_metalness = v_POLY_constant1_val;\n\tfloat POLY_roughness = 1.0;\n\tvec3 POLY_emissive = vec3(1.0, 1.0, 1.0);\n\tSSSModel POLY_SSSModel = SSSModel(/*isActive*/false,/*color*/vec3(1.0, 1.0, 1.0), /*thickness*/0.1, /*power*/2.0, /*scale*/16.0, /*distortion*/0.1,/*ambient*/0.4,/*attenuation*/0.8 );\n\tfloat POLY_transmission = 1.0;\n\tfloat POLY_thickness = 1.0;\n\n\n\n\n\t// INSERT BODY\n\t// the new body lines should be added before the alphatest_fragment\n\t// so that alpha is set before (which is really how it would be set if the alphamap_fragment above was used by the material node parameters)\n\n\t#include <alphatest_fragment>\n\n\t#include <logdepthbuf_fragment>\n\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 ), diffuseColor.a );\n\n\t#elif DEPTH_PACKING == 3201\n\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\n\t#endif\n\n}\n","timeDependent":false,"resolutionDependent":false,"paramConfigs":[{"type":"vector3","name":"cursor","defaultValue":[0,0,0],"uniformName":"v_POLY_param_cursor"}]}},"customDistanceMaterial":{"material":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/geo1/MAT/meshPhysicalBuilder2-customDistanceMaterial","type":"MeshDistanceMaterial","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},"onBeforeCompileDataJSON":{"vertexShader":"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\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>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n// removed:\n//\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n// removed:\n//\t#include <begin_vertex>\n\n\n\n\t// /geo1/MAT/meshPhysicalBuilder2/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\tvWorldPosition = worldPosition.xyz;\n}","fragmentShader":"\n// INSERT DEFINES\n\n#define DISTANCE\n\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nstruct SSSModel {\n\tbool isActive;\n\tvec3 color;\n\tfloat thickness;\n\tfloat power;\n\tfloat scale;\n\tfloat distortion;\n\tfloat ambient;\n\tfloat attenuation;\n};\n\nvoid RE_Direct_Scattering(\n\tconst in IncidentLight directLight,\n\tconst in GeometricContext geometry,\n\tconst in SSSModel sssModel,\n\tinout ReflectedLight reflectedLight\n\t){\n\tvec3 scatteringHalf = normalize(directLight.direction + (geometry.normal * sssModel.distortion));\n\tfloat scatteringDot = pow(saturate(dot(geometry.viewDir, -scatteringHalf)), sssModel.power) * sssModel.scale;\n\tvec3 scatteringIllu = (scatteringDot + sssModel.ambient) * (sssModel.color * (1.0-sssModel.thickness));\n\treflectedLight.directDiffuse += scatteringIllu * sssModel.attenuation * directLight.color;\n}\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( 1.0 );\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\n\n\n\t// /geo1/MAT/meshPhysicalBuilder2/constant1\n\tfloat v_POLY_constant1_val = 0.0;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder2/output1\n\tfloat POLY_metalness = v_POLY_constant1_val;\n\tfloat POLY_roughness = 1.0;\n\tvec3 POLY_emissive = vec3(1.0, 1.0, 1.0);\n\tSSSModel POLY_SSSModel = SSSModel(/*isActive*/false,/*color*/vec3(1.0, 1.0, 1.0), /*thickness*/0.1, /*power*/2.0, /*scale*/16.0, /*distortion*/0.1,/*ambient*/0.4,/*attenuation*/0.8 );\n\tfloat POLY_transmission = 1.0;\n\tfloat POLY_thickness = 1.0;\n\n\n\n\n\t// INSERT BODY\n\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","timeDependent":false,"resolutionDependent":false,"paramConfigs":[{"type":"vector3","name":"cursor","defaultValue":[0,0,0],"uniformName":"v_POLY_param_cursor"}]}},"customDepthDOFMaterial":{"material":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/geo1/MAT/meshPhysicalBuilder2-customDepthDOFMaterial","type":"MeshDepthMaterial","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,"depthPacking":3200},"onBeforeCompileDataJSON":{"vertexShader":"#include <common>\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>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n// removed:\n//\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n// removed:\n//\t#include <begin_vertex>\n\n\n\n\t// /geo1/MAT/meshPhysicalBuilder2/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\tvHighPrecisionZW = gl_Position.zw;\n}","fragmentShader":"\n// INSERT DEFINES\n\n\n#if DEPTH_PACKING == 3200\n\n\tuniform float opacity;\n\n#endif\n\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvarying vec2 vHighPrecisionZW;\n\nstruct SSSModel {\n\tbool isActive;\n\tvec3 color;\n\tfloat thickness;\n\tfloat power;\n\tfloat scale;\n\tfloat distortion;\n\tfloat ambient;\n\tfloat attenuation;\n};\n\nvoid RE_Direct_Scattering(\n\tconst in IncidentLight directLight,\n\tconst in GeometricContext geometry,\n\tconst in SSSModel sssModel,\n\tinout ReflectedLight reflectedLight\n\t){\n\tvec3 scatteringHalf = normalize(directLight.direction + (geometry.normal * sssModel.distortion));\n\tfloat scatteringDot = pow(saturate(dot(geometry.viewDir, -scatteringHalf)), sssModel.power) * sssModel.scale;\n\tvec3 scatteringIllu = (scatteringDot + sssModel.ambient) * (sssModel.color * (1.0-sssModel.thickness));\n\treflectedLight.directDiffuse += scatteringIllu * sssModel.attenuation * directLight.color;\n}\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( 1.0 );\n\n\t#if DEPTH_PACKING == 3200\n\n\t\tdiffuseColor.a = opacity;\n\n\t#endif\n\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\n\n\n\t// /geo1/MAT/meshPhysicalBuilder2/constant1\n\tfloat v_POLY_constant1_val = 0.0;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder2/output1\n\tfloat POLY_metalness = v_POLY_constant1_val;\n\tfloat POLY_roughness = 1.0;\n\tvec3 POLY_emissive = vec3(1.0, 1.0, 1.0);\n\tSSSModel POLY_SSSModel = SSSModel(/*isActive*/false,/*color*/vec3(1.0, 1.0, 1.0), /*thickness*/0.1, /*power*/2.0, /*scale*/16.0, /*distortion*/0.1,/*ambient*/0.4,/*attenuation*/0.8 );\n\tfloat POLY_transmission = 1.0;\n\tfloat POLY_thickness = 1.0;\n\n\n\n\n\t// INSERT BODY\n\t// the new body lines should be added before the alphatest_fragment\n\t// so that alpha is set before (which is really how it would be set if the alphamap_fragment above was used by the material node parameters)\n\n\t#include <alphatest_fragment>\n\n\t#include <logdepthbuf_fragment>\n\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 ), diffuseColor.a );\n\n\t#elif DEPTH_PACKING == 3201\n\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\n\t#endif\n\n}\n","timeDependent":false,"resolutionDependent":false,"paramConfigs":[{"type":"vector3","name":"cursor","defaultValue":[0,0,0],"uniformName":"v_POLY_param_cursor"}]}}}}},"meshStandard1":{"type":"meshStandard","params":{"useMap":true,"map":"../../../COP/imageUv","useEnvMap":true,"envMap":"../../../COP/envMap","roughness":0.07}},"meshStandard2":{"type":"meshStandard","params":{"useEnvMap":true,"envMap":"../../../COP/envMap","metalness":0,"roughness":0}}}},"attribRename1":{"type":"attribRename","params":{"oldName":"_piececentroid","newName":"piececentroid"},"inputs":["attribRename3"]},"attribRename2":{"type":"attribRename","params":{"oldName":"_inside","newName":"inside"},"inputs":["attribRename1"]},"attribRename3":{"type":"attribRename","params":{"oldName":"_objectcentroid","newName":"objectcentroid_"},"inputs":["hierarchy1"]},"fileGLTF1":{"type":"fileGLTF","params":{"url":"https://raw.githubusercontent.com/polygonjs/polygonjs-assets/master/models/einstein.glb?timestamp=1648249174134","draco":false}},"fileGLTF2":{"type":"fileGLTF","params":{"url":"https://raw.githubusercontent.com/polygonjs/polygonjs-assets/master/models/beethoven.glb?timestamp=1648249174342","draco":false}},"fileGLTF3":{"type":"fileGLTF","params":{"url":"https://raw.githubusercontent.com/polygonjs/polygonjs-assets/master/models/tennyson.glb?timestamp=1648249174366","draco":false}},"hierarchy1":{"type":"hierarchy","params":{"mode":1},"inputs":["fileGLTF1"]},"hierarchy2":{"type":"hierarchy","params":{"mode":1},"inputs":["fileGLTF2"]},"hierarchy3":{"type":"hierarchy","params":{"mode":1},"inputs":["fileGLTF3"]},"material2":{"type":"material","params":{"material":"../MAT/meshPhysicalBuilder1"},"inputs":["attribRename2"]},"material3":{"type":"material","params":{"material":"../MAT/meshStandard2"},"inputs":["objectProperties2"]},"merge1":{"type":"merge","inputs":["objectProperties1","material3"],"flags":{"display":true}},"merge2":{"type":"merge","inputs":["transform1","transform2"]},"objectProperties1":{"type":"objectProperties","params":{"tname":true,"name":"target"},"inputs":["BVH1"]},"objectProperties2":{"type":"objectProperties","params":{"tcastShadow":true,"treceiveShadow":true},"inputs":["merge2"]},"transform1":{"type":"transform","params":{"applyOn":1,"t":[-3.1023148516872814,0,0],"r":[0,90,0]},"inputs":["hierarchy2"]},"transform2":{"type":"transform","params":{"applyOn":1,"t":[3.1023148516872814,0,0]},"inputs":["hierarchy3"]}},"flags":{"display":true}},"perspectiveCamera1":{"type":"perspectiveCamera","nodes":{"events1":{"type":"eventsNetwork","nodes":{"cameraOrbitControls1":{"type":"cameraOrbitControls","params":{"target":[0.13783518922519142,0.6678109158362788,-6.751451046142794]}}},"selection":["cameraOrbitControls1"]}},"params":{"t":[-1.6426999530838144,1.7024390417199675,8.60364153510559],"r":[-3.854770428936801,-6.599492375593426,-0.44368317716129085],"controls":"./events1/cameraOrbitControls1"},"flags":{"display":true}},"COP":{"type":"copNetwork","nodes":{"envMap":{"type":"envMap","inputs":["imageEnv"]},"image1":{"type":"image","params":{"url":"https://raw.githubusercontent.com/polygonjs/polygonjs-assets/master/textures/resources/polyhaven.com/concrete_floor_painted/2k/diffuse.jpg","tencoding":true,"encoding":3001,"tminFilter":true,"tmagFilter":true,"tanisotropy":true,"useRendererMaxAnisotropy":true}},"imageEnv":{"type":"imageEXR","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}}}},"eventsNetwork1":{"type":"eventsNetwork","nodes":{"animation1":{"type":"animation","params":{"animation":"../../ANIM_cam_left_right/PLAY"},"inputs":[{"index":0,"node":"throttle1","output":"output"}]},"animation2":{"type":"animation","params":{"animation":"../../ANIM_intro/PLAY"},"inputs":[{"index":0,"node":"keyboard1","output":"keypress"}]},"animation3":{"type":"animation","params":{"animation":"../../ANIM_intro/RESET"},"inputs":[{"index":0,"node":"keyboard2","output":"keypress"}]},"keyboard1":{"type":"keyboard","params":{"keydown":false,"keypress":true,"keyCodes":"Digit8"}},"keyboard2":{"type":"keyboard","params":{"keydown":false,"keypress":true,"keyCodes":"Digit9"}},"pointer1":{"type":"pointer","params":{"pointerdown":false,"pointermove":true}},"raycast1":{"type":"raycast","params":{"mouse":[0.9635416666666667,0.9906976744186047],"intersectWith":1,"planeDirection":[0,0,1],"objectMask":"*target","tpositionTarget":true,"position":[-0.051238187307887983,2.42731378064116,0.7774952236311199],"positionTarget":"/geo1/MAT/meshPhysicalBuilder1/cursor"},"inputs":[{"index":0,"node":"pointer1","output":"pointermove"}]},"throttle1":{"type":"throttle","inputs":[{"index":0,"node":"pointer1","output":"pointermove"}]}}},"background":{"type":"geo","nodes":{"COP":{"type":"copNetwork","nodes":{"image_diffuse":{"type":"image","params":{"url":"https://raw.githubusercontent.com/polygonjs/polygonjs-assets/master/textures/stone_brick_wall_001_2k.blend/textures/stone_brick_wall_001_diff_2k.jpg?timestamp=1648248012528","ttransform":true,"repeat":[1.6,1.6]}},"image_displacement":{"type":"image","params":{"url":"https://raw.githubusercontent.com/polygonjs/polygonjs-assets/master/textures/stone_brick_wall_001_2k.blend/textures/stone_brick_wall_001_disp_2k.png?timestamp=1648248012528","ttransform":true,"repeat":[1.6,1.6]}},"image_roughness":{"type":"image","params":{"url":"https://raw.githubusercontent.com/polygonjs/polygonjs-assets/master/textures/stone_brick_wall_001_2k.blend/textures/stone_brick_wall_001_rough_2k.jpg?timestamp=1648248012520","ttransform":true,"repeat":[1.6,1.6]}}}},"MAT":{"type":"materialsNetwork","nodes":{"meshStandard1":{"type":"meshStandard","params":{"useMap":true,"map":"../../COP/image_diffuse","useDisplacementMap":true,"displacementMap":"../../COP/image_displacement","useEnvMap":true,"envMap":"../../../COP/envMap","metalness":0.07,"useRoughnessMap":true,"roughnessMap":"../../COP/image_roughness","useFog":true}}},"selection":["meshStandard1"]},"copy1":{"type":"copy","params":{"count":2,"t":[25,0,0]},"inputs":["transform1"]},"material1":{"type":"material","params":{"material":"../MAT/meshStandard1"},"inputs":["merge2"],"flags":{"display":true}},"merge1":{"type":"merge","inputs":["transform1","uvTransform1","uvTransform3","transform6"]},"merge2":{"type":"merge","params":{"compact":true},"inputs":["transform4","merge1","uvTransform2"]},"plane1":{"type":"plane","params":{"size":[25,25],"stepSize":5,"direction":[0,0,1]}},"transform1":{"type":"transform","params":{"t":[0,0,-2.2033764199496173]},"inputs":["plane1"]},"transform2":{"type":"transform","params":{"t":[25,0,0]},"inputs":["transform1"]},"transform3":{"type":"transform","params":{"t":[0,-25,0]},"inputs":["merge1"]},"transform4":{"type":"transform","params":{"t":[0,25,0]},"inputs":["merge1"]},"transform5":{"type":"transform","params":{"t":[-25,0,0]},"inputs":["transform1"]},"transform6":{"type":"transform","params":{"t":[50,0,0]},"inputs":["transform1"]},"uvTransform1":{"type":"uvTransform","params":{"t":[1,0],"s":[-1,1]},"inputs":["transform2"]},"uvTransform2":{"type":"uvTransform","params":{"t":[1,1],"s":[-1,-1]},"inputs":["transform3"]},"uvTransform3":{"type":"uvTransform","params":{"t":[1,0],"s":[-1,1]},"inputs":["transform5"]}},"flags":{"display":true}},"lights":{"type":"geo","nodes":{"merge1":{"type":"merge","inputs":["polarTransform3","polarTransform2"],"flags":{"display":true}},"polarTransform1":{"type":"polarTransform","params":{"longitude":32.4,"latitude":54,"depth":8.4},"inputs":["spotLight1"]},"polarTransform2":{"type":"polarTransform","params":{"longitude":298.8,"latitude":54,"depth":8.4},"inputs":["spotLight2"]},"polarTransform3":{"type":"polarTransform","params":{"center":[0.1,0,0],"longitude":360,"latitude":54,"depth":8.4},"inputs":["spotLight1"]},"spotLight1":{"type":"spotLight","params":{"penumbra":0.34,"castShadow":true,"shadowBias":0,"tvolumetric":true,"volAttenuation":7.899999999999999,"volAnglePower":42.1}},"spotLight2":{"type":"spotLight","params":{"color":[0.5411764705882353,0.5411764705882353,0.5411764705882353],"penumbra":0.34,"castShadow":true}}},"flags":{"display":true}},"particles":{"type":"geo","nodes":{"MAT":{"type":"materialsNetwork","nodes":{"COP":{"type":"copNetwork","nodes":{"image1":{"type":"image","params":{"url":"https://raw.githubusercontent.com/polygonjs/polygonjs-assets/master/textures/disk.png"}}},"selection":["image1"]},"meshStandard1":{"type":"meshStandard"},"points1":{"type":"points","params":{"transparent":true,"opacity":0.16,"alphaTest":0.08,"useAlphaMap":true,"alphaMap":"../COP/image1"}},"pointsBuilder1":{"type":"pointsBuilder","nodes":{"constant1":{"type":"constant","params":{"float":0.02},"connection_points":{"in":[],"out":[{"name":"val","type":"float"}]}},"disk1":{"type":"disk","params":{"position":{"overriden_options":{}},"center":{"raw_input":[0.5,0.5],"overriden_options":{}},"radius":{"raw_input":0.25,"overriden_options":{}},"feather":{"overriden_options":{}}},"inputs":[{"index":0,"node":"globals1","output":"gl_PointCoord"}]},"globals1":{"type":"globals"},"multAdd1":{"type":"multAdd","params":{"value":{"type":"float","default_value":0,"options":{"spare":true,"editable":false}},"preAdd":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}},"mult":{"type":"float","default_value":1,"options":{"spare":true,"editable":true},"raw_input":0.37},"postAdd":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}}},"inputs":[{"index":0,"node":"disk1","output":"float"}],"connection_points":{"in":[{"name":"value","type":"float"},{"name":"preAdd","type":"float"},{"name":"mult","type":"float"},{"name":"postAdd","type":"float"}],"out":[{"name":"val","type":"float"}]}},"output1":{"type":"output","inputs":[null,null,null,{"index":3,"node":"multAdd1","output":"val"},null,{"index":5,"node":"constant1","output":"val"}]}},"params":{"transparent":true,"depthWrite":false},"persisted_config":{"material":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/particles/MAT/pointsBuilder1-main","type":"PointsMaterial","name":"/particles/MAT/pointsBuilder1","color":16777215,"size":1,"sizeAttenuation":true,"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":false,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},"onBeforeCompileDataJSON":{"vertexShader":"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\n\n\n\t// /particles/MAT/pointsBuilder1/constant1\n\tfloat v_POLY_constant1_val = 0.02;\n\t\n\t// /particles/MAT/pointsBuilder1/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\tgl_PointSize = v_POLY_constant1_val * size * 10.0;\n\n\n\n\t#include <morphcolor_vertex>\n// removed:\n//\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n// removed:\n//\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}","fragmentShader":"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n\n\n\n// /particles/MAT/pointsBuilder1/disk1\nfloat disk_feather(float dist, float radius, float feather){\n\tif(feather <= 0.0){\n\t\tif(dist < radius){return 1.0;}else{return 0.0;}\n\t} else {\n\t\tfloat half_feather = feather * 0.5;\n\t\tif(dist < (radius - half_feather)){\n\t\t\treturn 1.0;\n\t\t} else {\n\t\t\tif(dist > (radius + half_feather)){\n\t\t\t\treturn 0.0;\n\t\t\t} else {\n\t\t\t\tfloat feather_start = (radius - half_feather);\n\t\t\t\tfloat blend = 1.0 - (dist - feather_start) / feather;\n\t\t\t\treturn blend;\n\t\t\t}\n\t\t}\n\t}\n}\n\nfloat disk2d(vec2 pos, vec2 center, float radius, float feather){\n\tfloat dist = distance(pos, center);\n\treturn disk_feather(dist, radius, feather);\n}\n\n// function could be called sphere, but is an overload of disk, and is the same\nfloat disk3d(vec3 pos, vec3 center, float radius, float feather){\n\tfloat dist = distance(pos, center);\n\treturn disk_feather(dist, radius, feather);\n}\n\n\n\n\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\n\n\t// /particles/MAT/pointsBuilder1/globals1\n\tvec2 v_POLY_globals1_gl_PointCoord = gl_PointCoord;\n\t\n\t// /particles/MAT/pointsBuilder1/disk1\n\tfloat v_POLY_disk1_float = disk2d(v_POLY_globals1_gl_PointCoord, vec2(0.5, 0.5), 0.25, 0.1);\n\t\n\t// /particles/MAT/pointsBuilder1/multAdd1\n\tfloat v_POLY_multAdd1_val = (0.37*(v_POLY_disk1_float + 0.0)) + 0.0;\n\t\n\t// /particles/MAT/pointsBuilder1/output1\n\tdiffuseColor.a = v_POLY_multAdd1_val;\n\n\n\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}","timeDependent":false,"resolutionDependent":false,"paramConfigs":[]},"customMaterials":{"customDistanceMaterial":{"material":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/particles/MAT/pointsBuilder1-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":16777215},"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},"alphaTest":{"value":0},"displacementMap":{"value":null},"displacementScale":{"value":1},"displacementBias":{"value":0},"size":{"value":1},"scale":{"value":1}},"defines":{"USE_SIZEATTENUATION":1,"DEPTH_PACKING":3200},"vertexShader":"\nuniform float size;\nuniform float scale;\n#include <common>\n#include <clipping_planes_pars_vertex>\nvarying float vViewZDepth;\n\n// INSERT DEFINES\n\n\n// vHighPrecisionZW is added to match CustomMeshDepth.frag\n// which is itself taken from threejs\nvarying vec2 vHighPrecisionZW;\n\nvoid main() {\n\n\t// INSERT BODY\n\n\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\n\tvViewZDepth = - mvPosition.z;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\n\tvHighPrecisionZW = gl_Position.zw;\n\n}\n","fragmentShader":"\n// INSERT DEFINES\n\n\n#if DEPTH_PACKING == 3200\n\n\tuniform float opacity;\n\n#endif\n\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_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\t#if DEPTH_PACKING == 3200\n\n\t\tdiffuseColor.a = opacity;\n\n\t#endif\n\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\n\t// INSERT BODY\n\t// the new body lines should be added before the alphatest_fragment\n\t// so that alpha is set before (which is really how it would be set if the alphamap_fragment above was used by the material node parameters)\n\n\t#include <alphatest_fragment>\n\n\t#include <logdepthbuf_fragment>\n\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 ), diffuseColor.a );\n\n\t#elif DEPTH_PACKING == 3201\n\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\n\t#endif\n\n}\n","lights":false},"onBeforeCompileDataJSON":{"vertexShader":"\nuniform float size;\nuniform float scale;\n#include <common>\n#include <clipping_planes_pars_vertex>\nvarying float vViewZDepth;\n\n// INSERT DEFINES\n\n\n// vHighPrecisionZW is added to match CustomMeshDepth.frag\n// which is itself taken from threejs\nvarying vec2 vHighPrecisionZW;\n\nvoid main() {\n\n\t// INSERT BODY\n\n\n\n\t// /particles/MAT/pointsBuilder1/constant1\n\tfloat v_POLY_constant1_val = 0.02;\n\t\n\t// /particles/MAT/pointsBuilder1/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\tgl_PointSize = v_POLY_constant1_val * size * 10.0;\n\n\n\n\n\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\n\tvViewZDepth = - mvPosition.z;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\n\tvHighPrecisionZW = gl_Position.zw;\n\n}\n","fragmentShader":"\n// INSERT DEFINES\n\n\n\n// /particles/MAT/pointsBuilder1/disk1\nfloat disk_feather(float dist, float radius, float feather){\n\tif(feather <= 0.0){\n\t\tif(dist < radius){return 1.0;}else{return 0.0;}\n\t} else {\n\t\tfloat half_feather = feather * 0.5;\n\t\tif(dist < (radius - half_feather)){\n\t\t\treturn 1.0;\n\t\t} else {\n\t\t\tif(dist > (radius + half_feather)){\n\t\t\t\treturn 0.0;\n\t\t\t} else {\n\t\t\t\tfloat feather_start = (radius - half_feather);\n\t\t\t\tfloat blend = 1.0 - (dist - feather_start) / feather;\n\t\t\t\treturn blend;\n\t\t\t}\n\t\t}\n\t}\n}\n\nfloat disk2d(vec2 pos, vec2 center, float radius, float feather){\n\tfloat dist = distance(pos, center);\n\treturn disk_feather(dist, radius, feather);\n}\n\n// function could be called sphere, but is an overload of disk, and is the same\nfloat disk3d(vec3 pos, vec3 center, float radius, float feather){\n\tfloat dist = distance(pos, center);\n\treturn disk_feather(dist, radius, feather);\n}\n\n\n\n\n\n\n#if DEPTH_PACKING == 3200\n\n\tuniform float opacity;\n\n#endif\n\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_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\t#if DEPTH_PACKING == 3200\n\n\t\tdiffuseColor.a = opacity;\n\n\t#endif\n\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\n\t// INSERT BODY\n\n\n\n\t// /particles/MAT/pointsBuilder1/globals1\n\tvec2 v_POLY_globals1_gl_PointCoord = gl_PointCoord;\n\t\n\t// /particles/MAT/pointsBuilder1/disk1\n\tfloat v_POLY_disk1_float = disk2d(v_POLY_globals1_gl_PointCoord, vec2(0.5, 0.5), 0.25, 0.1);\n\t\n\t// /particles/MAT/pointsBuilder1/multAdd1\n\tfloat v_POLY_multAdd1_val = (0.37*(v_POLY_disk1_float + 0.0)) + 0.0;\n\t\n\t// /particles/MAT/pointsBuilder1/output1\n\tdiffuseColor.a = v_POLY_multAdd1_val;\n\n\n\n\t// the new body lines should be added before the alphatest_fragment\n\t// so that alpha is set before (which is really how it would be set if the alphamap_fragment above was used by the material node parameters)\n\n\t#include <alphatest_fragment>\n\n\t#include <logdepthbuf_fragment>\n\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 ), diffuseColor.a );\n\n\t#elif DEPTH_PACKING == 3201\n\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\n\t#endif\n\n}\n","timeDependent":false,"resolutionDependent":false,"paramConfigs":[]}},"customDepthMaterial":{"material":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/particles/MAT/pointsBuilder1-customDepthMaterial","type":"ShaderMaterial","name":"customDepthMaterial","side":1,"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":16777215},"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},"alphaTest":{"value":0},"displacementMap":{"value":null},"displacementScale":{"value":1},"displacementBias":{"value":0},"size":{"value":1},"scale":{"value":1}},"defines":{"USE_SIZEATTENUATION":1,"DEPTH_PACKING":3201},"vertexShader":"\nuniform float size;\nuniform float scale;\n#include <common>\n#include <clipping_planes_pars_vertex>\nvarying float vViewZDepth;\n\n// INSERT DEFINES\n\n\n// vHighPrecisionZW is added to match CustomMeshDepth.frag\n// which is itself taken from threejs\nvarying vec2 vHighPrecisionZW;\n\nvoid main() {\n\n\t// INSERT BODY\n\n\n\n\t// /particles/MAT/pointsBuilder1/constant1\n\tfloat v_POLY_constant1_val = 0.02;\n\t\n\t// /particles/MAT/pointsBuilder1/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\tgl_PointSize = v_POLY_constant1_val * size * 10.0;\n\n\n\n\n\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\n\tvViewZDepth = - mvPosition.z;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\n\tvHighPrecisionZW = gl_Position.zw;\n\n}\n","fragmentShader":"\n// INSERT DEFINES\n\n\n\n// /particles/MAT/pointsBuilder1/disk1\nfloat disk_feather(float dist, float radius, float feather){\n\tif(feather <= 0.0){\n\t\tif(dist < radius){return 1.0;}else{return 0.0;}\n\t} else {\n\t\tfloat half_feather = feather * 0.5;\n\t\tif(dist < (radius - half_feather)){\n\t\t\treturn 1.0;\n\t\t} else {\n\t\t\tif(dist > (radius + half_feather)){\n\t\t\t\treturn 0.0;\n\t\t\t} else {\n\t\t\t\tfloat feather_start = (radius - half_feather);\n\t\t\t\tfloat blend = 1.0 - (dist - feather_start) / feather;\n\t\t\t\treturn blend;\n\t\t\t}\n\t\t}\n\t}\n}\n\nfloat disk2d(vec2 pos, vec2 center, float radius, float feather){\n\tfloat dist = distance(pos, center);\n\treturn disk_feather(dist, radius, feather);\n}\n\n// function could be called sphere, but is an overload of disk, and is the same\nfloat disk3d(vec3 pos, vec3 center, float radius, float feather){\n\tfloat dist = distance(pos, center);\n\treturn disk_feather(dist, radius, feather);\n}\n\n\n\n\n\n\n#if DEPTH_PACKING == 3200\n\n\tuniform float opacity;\n\n#endif\n\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_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\t#if DEPTH_PACKING == 3200\n\n\t\tdiffuseColor.a = opacity;\n\n\t#endif\n\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\n\t// INSERT BODY\n\n\n\n\t// /particles/MAT/pointsBuilder1/globals1\n\tvec2 v_POLY_globals1_gl_PointCoord = gl_PointCoord;\n\t\n\t// /particles/MAT/pointsBuilder1/disk1\n\tfloat v_POLY_disk1_float = disk2d(v_POLY_globals1_gl_PointCoord, vec2(0.5, 0.5), 0.25, 0.1);\n\t\n\t// /particles/MAT/pointsBuilder1/multAdd1\n\tfloat v_POLY_multAdd1_val = (0.37*(v_POLY_disk1_float + 0.0)) + 0.0;\n\t\n\t// /particles/MAT/pointsBuilder1/output1\n\tdiffuseColor.a = v_POLY_multAdd1_val;\n\n\n\n\t// the new body lines should be added before the alphatest_fragment\n\t// so that alpha is set before (which is really how it would be set if the alphamap_fragment above was used by the material node parameters)\n\n\t#include <alphatest_fragment>\n\n\t#include <logdepthbuf_fragment>\n\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 ), diffuseColor.a );\n\n\t#elif DEPTH_PACKING == 3201\n\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\n\t#endif\n\n}\n","lights":false},"onBeforeCompileDataJSON":{"vertexShader":"\nuniform float size;\nuniform float scale;\n#include <common>\n#include <clipping_planes_pars_vertex>\nvarying float vViewZDepth;\n\n// INSERT DEFINES\n\n\n// vHighPrecisionZW is added to match CustomMeshDepth.frag\n// which is itself taken from threejs\nvarying vec2 vHighPrecisionZW;\n\nvoid main() {\n\n\t// INSERT BODY\n\n\n\n\t// /particles/MAT/pointsBuilder1/constant1\n\tfloat v_POLY_constant1_val = 0.02;\n\t\n\t// /particles/MAT/pointsBuilder1/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\tgl_PointSize = v_POLY_constant1_val * size * 10.0;\n\n\n\n\n\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\n\tvViewZDepth = - mvPosition.z;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\n\tvHighPrecisionZW = gl_Position.zw;\n\n}\n","fragmentShader":"\n// INSERT DEFINES\n\n\n\n// /particles/MAT/pointsBuilder1/disk1\nfloat disk_feather(float dist, float radius, float feather){\n\tif(feather <= 0.0){\n\t\tif(dist < radius){return 1.0;}else{return 0.0;}\n\t} else {\n\t\tfloat half_feather = feather * 0.5;\n\t\tif(dist < (radius - half_feather)){\n\t\t\treturn 1.0;\n\t\t} else {\n\t\t\tif(dist > (radius + half_feather)){\n\t\t\t\treturn 0.0;\n\t\t\t} else {\n\t\t\t\tfloat feather_start = (radius - half_feather);\n\t\t\t\tfloat blend = 1.0 - (dist - feather_start) / feather;\n\t\t\t\treturn blend;\n\t\t\t}\n\t\t}\n\t}\n}\n\nfloat disk2d(vec2 pos, vec2 center, float radius, float feather){\n\tfloat dist = distance(pos, center);\n\treturn disk_feather(dist, radius, feather);\n}\n\n// function could be called sphere, but is an overload of disk, and is the same\nfloat disk3d(vec3 pos, vec3 center, float radius, float feather){\n\tfloat dist = distance(pos, center);\n\treturn disk_feather(dist, radius, feather);\n}\n\n\n\n\n\n\n#if DEPTH_PACKING == 3200\n\n\tuniform float opacity;\n\n#endif\n\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_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\t#if DEPTH_PACKING == 3200\n\n\t\tdiffuseColor.a = opacity;\n\n\t#endif\n\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\n\t// INSERT BODY\n\n\n\n\t// /particles/MAT/pointsBuilder1/globals1\n\tvec2 v_POLY_globals1_gl_PointCoord = gl_PointCoord;\n\t\n\t// /particles/MAT/pointsBuilder1/disk1\n\tfloat v_POLY_disk1_float = disk2d(v_POLY_globals1_gl_PointCoord, vec2(0.5, 0.5), 0.25, 0.1);\n\t\n\t// /particles/MAT/pointsBuilder1/multAdd1\n\tfloat v_POLY_multAdd1_val = (0.37*(v_POLY_disk1_float + 0.0)) + 0.0;\n\t\n\t// /particles/MAT/pointsBuilder1/output1\n\tdiffuseColor.a = v_POLY_multAdd1_val;\n\n\n\n\t// the new body lines should be added before the alphatest_fragment\n\t// so that alpha is set before (which is really how it would be set if the alphamap_fragment above was used by the material node parameters)\n\n\t#include <alphatest_fragment>\n\n\t#include <logdepthbuf_fragment>\n\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 ), diffuseColor.a );\n\n\t#elif DEPTH_PACKING == 3201\n\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\n\t#endif\n\n}\n","timeDependent":false,"resolutionDependent":false,"paramConfigs":[]}},"customDepthDOFMaterial":{"material":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/particles/MAT/pointsBuilder1-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":{"size":{"value":1},"scale":{"value":1},"mNear":{"value":0},"mFar":{"value":10}},"defines":{"USE_SIZEATTENUATION":1},"vertexShader":"\nuniform float size;\nuniform float scale;\n#include <common>\n\nvarying float vViewZDepth;\n\n// INSERT DEFINES\n\n\n\nvoid main() {\n\n\t// INSERT BODY\n\n\n\t#include <project_vertex>\n\n\tvViewZDepth = - mvPosition.z;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\n}\n","fragmentShader":"\nuniform float mNear;\nuniform float mFar;\n\nvarying float vViewZDepth;\n\n// INSERT DEFINES\n\nvoid main() {\n\n\tfloat color = 1.0 - smoothstep( mNear, mFar, vViewZDepth );\n\tgl_FragColor = vec4( vec3( color ), 1.0 );\n\tvec4 diffuseColor = gl_FragColor;\n\n\t// INSERT BODY\n\n\tgl_FragColor.a = diffuseColor.a;\n}\n","lights":false},"onBeforeCompileDataJSON":{"vertexShader":"\nuniform float size;\nuniform float scale;\n#include <common>\n\nvarying float vViewZDepth;\n\n// INSERT DEFINES\n\n\n\nvoid main() {\n\n\t// INSERT BODY\n\n\n\n\t// /particles/MAT/pointsBuilder1/constant1\n\tfloat v_POLY_constant1_val = 0.02;\n\t\n\t// /particles/MAT/pointsBuilder1/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\tgl_PointSize = v_POLY_constant1_val * size * 10.0;\n\n\n\n\n\n\t#include <project_vertex>\n\n\tvViewZDepth = - mvPosition.z;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\n}\n","fragmentShader":"\nuniform float mNear;\nuniform float mFar;\n\nvarying float vViewZDepth;\n\n// INSERT DEFINES\n\nvoid main() {\n\n\tfloat color = 1.0 - smoothstep( mNear, mFar, vViewZDepth );\n\tgl_FragColor = vec4( vec3( color ), 1.0 );\n\tvec4 diffuseColor = gl_FragColor;\n\n\t// INSERT BODY\n\n\tgl_FragColor.a = diffuseColor.a;\n}\n","timeDependent":false,"resolutionDependent":false,"paramConfigs":[]}}}}}},"selection":["pointsBuilder1"]},"bboxScatter1":{"type":"bboxScatter","params":{"stepSize":2.1},"inputs":["transform1"]},"box1":{"type":"box"},"box2":{"type":"box","params":{"center":[0,0,0.5]}},"jitter1":{"type":"jitter","params":{"amount":2.9},"inputs":["bboxScatter1"]},"material1":{"type":"material","params":{"material":"../MAT/pointsBuilder1"},"inputs":["jitter1"],"flags":{"display":true}},"transform1":{"type":"transform","params":{"s":[25,18.4,17]},"inputs":["box2"]}},"flags":{"display":true}},"ANIM_intro":{"type":"animationsNetwork","nodes":{"CONTROLS":{"type":"play","inputs":["RESET","PLAY"]},"PLAY":{"type":"null","inputs":["merge2"]},"RESET":{"type":"null","inputs":["merge1"]},"duration1":{"type":"duration","params":{"duration":9}},"duration2":{"type":"duration","inputs":["propertyValue2"]},"duration3":{"type":"duration","params":{"duration":0.8},"inputs":["propertyValue3"]},"easing1":{"type":"easing","params":{"name":1,"inOut":2},"inputs":["duration1"]},"merge1":{"type":"merge","inputs":["duration2","duration3"]},"merge2":{"type":"merge","inputs":["propertyValue1","propertyValue4"]},"propertyName1":{"type":"propertyName","params":{"name":"rx"},"inputs":["target1"]},"propertyName2":{"type":"propertyName","params":{"name":"depth"},"inputs":["target2"]},"propertyValue1":{"type":"propertyValue","params":{"size":1,"value3":[0,1,0]},"inputs":["propertyName1"]},"propertyValue2":{"type":"propertyValue","params":{"size":1,"value1":-21.5},"inputs":["propertyName1"]},"propertyValue3":{"type":"propertyValue","params":{"size":1,"value1":16},"inputs":["propertyName2"]},"propertyValue4":{"type":"propertyValue","params":{"size":1,"value1":8},"inputs":["propertyName2"]},"target1":{"type":"target","params":{"type":1,"nodePath":"../../null_camRot"},"inputs":["easing1"]},"target2":{"type":"target","params":{"type":1,"nodePath":"../../polarTransform1"},"inputs":["easing1"]}}},"ANIM_cam_left_right":{"type":"animationsNetwork","nodes":{"CONTROLS":{"type":"play","inputs":["RESET","PLAY"]},"PLAY":{"type":"null","inputs":["propertyValue1"]},"RESET":{"type":"null","inputs":["propertyValue2"]},"duration1":{"type":"duration"},"easing1":{"type":"easing","inputs":["duration1"]},"propertyName1":{"type":"propertyName","inputs":["target1"]},"propertyValue1":{"type":"propertyValue","params":{"value3":["ch(\"/eventsNetwork1/raycast1/mousex\")","ch(\"/eventsNetwork1/raycast1/mousey\")",0]},"inputs":["propertyName1"]},"propertyValue2":{"type":"propertyValue","inputs":["propertyName1"]},"target1":{"type":"target","params":{"objectMask":"*/persp*MAIN"}}}}},"params":{"mainCameraPath":"/perspectiveCamera1"},"selection":["geo1"]},"ui":{"nodes":{"hemisphereLight1":{"pos":[250,50]},"polarTransform1":{"pos":[50,0]},"perspectiveCamera_MAIN":{"pos":[50,300]},"null_camRot":{"pos":[50,150]},"geo1":{"pos":[-50,-300],"nodes":{"BVH1":{"pos":[-450,450]},"BVHVisualizer1":{"pos":[-600,550]},"MAT":{"pos":[-750,350],"nodes":{"meshPhysicalBuilder1":{"pos":[0,0],"nodes":{"add1":{"pos":[750,-550]},"add2":{"pos":[250,-550]},"add3":{"pos":[850,250]},"add4":{"pos":[750,-100]},"attribute1":{"pos":[-1800,-450]},"attribute2":{"pos":[-1650,-150]},"attribute3":{"pos":[1000,400]},"attribute4":{"pos":[-250,200]},"attribute5":{"pos":[-700,0]},"clamp1":{"pos":[-650,-800]},"complement1":{"pos":[-800,-800]},"distance1":{"pos":[-950,-800]},"floatToVec3_1":{"pos":[-1250,-900]},"floatToVec3_2":{"pos":[-600,-600]},"floatToVec3_3":{"pos":[-1400,-150]},"floatToVec3_4":{"pos":[-1350,-450]},"floatToVec3_5":{"pos":[-400,-200]},"globals1":{"pos":[-600,200]},"max1":{"pos":[-550,-150]},"mult1":{"pos":[-800,-200]},"multAdd1":{"pos":[-500,-800]},"multAdd2":{"pos":[50,-350]},"multAdd3":{"pos":[-100,-350]},"multScalar1":{"pos":[150,-400]},"multScalar2":{"pos":[50,-200]},"normalize1":{"pos":[-900,0]},"null1":{"pos":[-1250,-450]},"output1":{"pos":[1400,300]},"param1":{"pos":[-1600,-900]},"smoothstep1":{"pos":[1150,400]},"subnet_rotation":{"pos":[100,0],"nodes":{"attribute4":{"pos":[-450,-1050]},"constant_UP":{"pos":[-300,-1250]},"cross1":{"pos":[-50,-1250]},"length1":{"pos":[-50,-550]},"max1":{"pos":[-150,-850]},"multAdd3":{"pos":[-250,-850]},"multScalar1":{"pos":[600,-900]},"normalize1":{"pos":[-250,-1050]},"normalize2":{"pos":[50,-1150]},"normalize3":{"pos":[-100,-950]},"rotate1":{"pos":[200,-1000]},"rotate2":{"pos":[250,-850]},"subnetInput1":{"pos":[-750,-800]},"subnetOutput1":{"pos":[800,-900]}}},"subtract1":{"pos":[-50,-600]},"subtract2":{"pos":[-1100,-300]},"subtract3":{"pos":[-100,-150]},"subtract4":{"pos":[-350,-550]},"subtract5":{"pos":[-100,0]},"vec3ToFloat1":{"pos":[-1450,-900]},"vec3ToFloat2":{"pos":[-800,-600]},"vec3ToFloat3":{"pos":[-1550,-150]},"vec3ToFloat4":{"pos":[-1500,-450]},"vec3ToFloat5":{"pos":[-700,-200]}}},"meshPhysicalBuilder2":{"pos":[0,100],"nodes":{"add1":{"pos":[750,-550]},"add2":{"pos":[250,-550]},"add3":{"pos":[850,250]},"add4":{"pos":[750,-100]},"attribute1":{"pos":[-1800,-450]},"attribute2":{"pos":[-1650,-150]},"attribute3":{"pos":[1000,400]},"attribute4":{"pos":[-250,200]},"attribute5":{"pos":[-700,0]},"clamp1":{"pos":[-650,-800]},"complement1":{"pos":[-800,-800]},"constant1":{"pos":[1100,300]},"distance1":{"pos":[-950,-800]},"floatToVec3_1":{"pos":[-1250,-900]},"floatToVec3_2":{"pos":[-600,-600]},"floatToVec3_3":{"pos":[-1400,-150]},"floatToVec3_4":{"pos":[-1350,-450]},"floatToVec3_5":{"pos":[-400,-200]},"globals1":{"pos":[-600,200]},"max1":{"pos":[-550,-150]},"mult1":{"pos":[-800,-200]},"multAdd1":{"pos":[-500,-800]},"multAdd2":{"pos":[50,-350]},"multAdd3":{"pos":[-100,-350]},"multScalar1":{"pos":[150,-400]},"multScalar2":{"pos":[50,-200]},"normalize1":{"pos":[-900,0]},"null1":{"pos":[-1250,-450]},"output1":{"pos":[1400,300]},"param1":{"pos":[-1600,-900]},"smoothstep1":{"pos":[1150,400]},"subnet_rotation":{"pos":[100,0],"nodes":{"attribute4":{"pos":[-450,-1050]},"constant_UP":{"pos":[-300,-1250]},"cross1":{"pos":[-50,-1250]},"length1":{"pos":[-50,-550]},"max1":{"pos":[-150,-850]},"multAdd3":{"pos":[-250,-850]},"multScalar1":{"pos":[600,-900]},"normalize1":{"pos":[-250,-1050]},"normalize2":{"pos":[50,-1150]},"normalize3":{"pos":[-100,-950]},"rotate1":{"pos":[200,-1000]},"rotate2":{"pos":[250,-850]},"subnetInput1":{"pos":[-750,-800]},"subnetOutput1":{"pos":[800,-900]}}},"subtract1":{"pos":[-50,-600]},"subtract2":{"pos":[-1100,-300]},"subtract3":{"pos":[-100,-150]},"subtract4":{"pos":[-350,-550]},"subtract5":{"pos":[-100,0]},"vec3ToFloat1":{"pos":[-1450,-900]},"vec3ToFloat2":{"pos":[-800,-600]},"vec3ToFloat3":{"pos":[-1550,-150]},"vec3ToFloat4":{"pos":[-1500,-450]},"vec3ToFloat5":{"pos":[-700,-200]}}},"meshStandard1":{"pos":[0,-100]},"meshStandard2":{"pos":[0,250]}}},"attribRename1":{"pos":[-450,150]},"attribRename2":{"pos":[-450,250]},"attribRename3":{"pos":[-450,0]},"fileGLTF1":{"pos":[-450,-400]},"fileGLTF2":{"pos":[-150,-400]},"fileGLTF3":{"pos":[100,-400]},"hierarchy1":{"pos":[-450,-300]},"hierarchy2":{"pos":[-150,-300]},"hierarchy3":{"pos":[100,-300]},"material2":{"pos":[-450,350]},"material3":{"pos":[-150,350]},"merge1":{"pos":[-250,700]},"merge2":{"pos":[-150,150]},"objectProperties1":{"pos":[-450,600]},"objectProperties2":{"pos":[-150,250]},"transform1":{"pos":[-150,-150]},"transform2":{"pos":[100,-150]}}},"perspectiveCamera1":{"pos":[-200,50],"nodes":{"events1":{"pos":[-200,50],"nodes":{"cameraOrbitControls1":{"pos":[150,50]}}}}},"COP":{"pos":[-200,150],"nodes":{"envMap":{"pos":[50,200]},"image1":{"pos":[-350,100]},"imageEnv":{"pos":[50,100]},"imageUv":{"pos":[-100,100]}}},"eventsNetwork1":{"pos":[-200,-50],"nodes":{"animation1":{"pos":[-100,-200]},"animation2":{"pos":[-150,300]},"animation3":{"pos":[-150,450]},"keyboard1":{"pos":[-450,300]},"keyboard2":{"pos":[-450,450]},"pointer1":{"pos":[-400,-50]},"raycast1":{"pos":[-100,-50]},"throttle1":{"pos":[-250,-200]}}},"background":{"pos":[300,-300],"nodes":{"COP":{"pos":[-750,500],"nodes":{"image_diffuse":{"pos":[-550,100]},"image_displacement":{"pos":[-550,300]},"image_roughness":{"pos":[-550,200]}}},"MAT":{"pos":[-750,600],"nodes":{"meshStandard1":{"pos":[0,0]}}},"copy1":{"pos":[-500,250]},"material1":{"pos":[-250,1150]},"merge1":{"pos":[-250,500]},"merge2":{"pos":[-250,950]},"plane1":{"pos":[-250,0]},"transform1":{"pos":[-250,150]},"transform2":{"pos":[-100,250]},"transform3":{"pos":[-100,650]},"transform4":{"pos":[-400,650]},"transform5":{"pos":[150,250]},"transform6":{"pos":[-300,300]},"uvTransform1":{"pos":[-100,350]},"uvTransform2":{"pos":[-100,750]},"uvTransform3":{"pos":[150,350]}}},"lights":{"pos":[300,-200],"nodes":{"merge1":{"pos":[-50,400]},"polarTransform1":{"pos":[-150,200]},"polarTransform2":{"pos":[100,200]},"polarTransform3":{"pos":[-300,200]},"spotLight1":{"pos":[-150,50]},"spotLight2":{"pos":[100,50]}}},"particles":{"pos":[-50,-200],"nodes":{"MAT":{"pos":[-400,400],"nodes":{"COP":{"pos":[-250,250],"nodes":{"image1":{"pos":[-200,200]}}},"meshStandard1":{"pos":[0,0]},"points1":{"pos":[0,250]},"pointsBuilder1":{"pos":[0,150],"nodes":{"constant1":{"pos":[50,250]},"disk1":{"pos":[-200,50]},"globals1":{"pos":[-450,-150]},"multAdd1":{"pos":[-50,50]},"output1":{"pos":[200,0]}}}}},"bboxScatter1":{"pos":[-200,200]},"box1":{"pos":[0,0]},"box2":{"pos":[-200,-150]},"jitter1":{"pos":[-200,300]},"material1":{"pos":[-200,400]},"transform1":{"pos":[-200,50]}}},"ANIM_intro":{"pos":[-200,250],"nodes":{"CONTROLS":{"pos":[-150,1050]},"PLAY":{"pos":[350,850]},"RESET":{"pos":[-300,850]},"duration1":{"pos":[0,0]},"duration2":{"pos":[-350,600]},"duration3":{"pos":[-150,600]},"easing1":{"pos":[0,100]},"merge1":{"pos":[-300,700]},"merge2":{"pos":[350,700]},"propertyName1":{"pos":[0,400]},"propertyName2":{"pos":[250,400]},"propertyValue1":{"pos":[0,500]},"propertyValue2":{"pos":[-300,500]},"propertyValue3":{"pos":[250,500]},"propertyValue4":{"pos":[600,500]},"target1":{"pos":[0,300]},"target2":{"pos":[250,300]}}},"ANIM_cam_left_right":{"pos":[-200,350],"nodes":{"CONTROLS":{"pos":[-150,700]},"PLAY":{"pos":[0,600]},"RESET":{"pos":[-300,600]},"duration1":{"pos":[0,0]},"easing1":{"pos":[0,100]},"propertyName1":{"pos":[0,400]},"propertyValue1":{"pos":[0,500]},"propertyValue2":{"pos":[-300,500]},"target1":{"pos":[0,300]}}}}}}
Code editor
{"multiple_panel":{"split_ratio":0.5,"split_panel0":{"split_ratio":0.5,"split_panel0":{"panelTypes":["viewer"],"currentPanelIndex":0,"panel_data":{"camera":"/perspectiveCamera1","linkIndex":1}},"split_panel1":{"panelTypes":["params"],"currentPanelIndex":0,"panel_data":{"active_folder":137,"linkIndex":1}},"split_mode":"vertical"},"split_panel1":{"panelTypes":["network","params","viewer"],"currentPanelIndex":0,"panel_data":{"camera":{"position":{"x":296.1601750768211,"y":-180.6339539206353},"zoom":0.6127543904215144},"history":{"2":{"position":{"x":-64,"y":12},"zoom":0.5555555555555556},"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":296.1601750768211,"y":-180.6339539206353},"zoom":0.6127543904215144},"208":{"position":{"x":244.20000000000005,"y":-512.6},"zoom":0.5555555555555556},"455":{"position":{"x":144.99999999999997,"y":-124.80000000000001},"zoom":0.5555555555555556},"2587":{"position":{"x":400.6,"y":-282},"zoom":0.5555555555555556},"3461":{"position":{"x":250,"y":-950},"zoom":0.5555555555555556},"3487":{"position":{"x":400.6,"y":-285.6},"zoom":0.5555555555555556}},"linkIndex":1}},"split_mode":"horizontal"},"currentNodes":["/geo1","/","/","/","/","/","/","/"],"navigationHistory":{"nodePaths":{"1":["/","/geo1","/","/background","/background/COP","/background","/","/geo1"],"2":["/"],"3":["/"],"4":["/"],"5":["/"],"6":["/"],"7":["/"],"8":["/"]},"index":{"1":7,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0}},"fullscreenPanelId":null,"saveOptions":{"createExport":true,"skipExportSinceRemoteAssetsPresents":false,"compressJs":true,"createZip":false,"publishToIntegrations":false},"paramsModal":[]}
Used nodes
anim/duration;anim/easing;anim/merge;anim/null;anim/play;anim/propertyName;anim/propertyValue;anim/target;cop/envMap;cop/image;cop/imageEXR;event/animation;event/cameraOrbitControls;event/keyboard;event/pointer;event/raycast;event/throttle;mat/copNetwork;mat/meshPhysicalBuilder;mat/meshStandard;mat/points;mat/pointsBuilder;obj/animationsNetwork;obj/copNetwork;obj/eventsNetwork;obj/geo;obj/hemisphereLight;obj/null;obj/perspectiveCamera;obj/polarTransform;sop/BVH;sop/BVHVisualizer;sop/attribRename;sop/bboxScatter;sop/box;sop/copNetwork;sop/copy;sop/eventsNetwork;sop/fileGLTF;sop/hierarchy;sop/jitter;sop/material;sop/materialsNetwork;sop/merge;sop/objectProperties;sop/plane;sop/polarTransform;sop/spotLight;sop/transform;sop/uvTransform
Used operations
Used modules
Used assemblers
GL_MESH_PHYSICAL;GL_POINTS
Used integrations
[]
Used assets
Nodes map
{"/hemisphereLight1":"obj/hemisphereLight","/polarTransform1":"obj/polarTransform","/perspectiveCamera_MAIN":"obj/perspectiveCamera","/null_camRot":"obj/null","/geo1":"obj/geo","/geo1/BVH1":"sop/BVH","/geo1/BVHVisualizer1":"sop/BVHVisualizer","/geo1/MAT":"sop/materialsNetwork","/geo1/MAT/meshPhysicalBuilder1":"mat/meshPhysicalBuilder","/geo1/MAT/meshPhysicalBuilder2":"mat/meshPhysicalBuilder","/geo1/MAT/meshStandard1":"mat/meshStandard","/geo1/MAT/meshStandard2":"mat/meshStandard","/geo1/attribRename1":"sop/attribRename","/geo1/attribRename2":"sop/attribRename","/geo1/attribRename3":"sop/attribRename","/geo1/fileGLTF1":"sop/fileGLTF","/geo1/fileGLTF2":"sop/fileGLTF","/geo1/fileGLTF3":"sop/fileGLTF","/geo1/hierarchy1":"sop/hierarchy","/geo1/hierarchy2":"sop/hierarchy","/geo1/hierarchy3":"sop/hierarchy","/geo1/material2":"sop/material","/geo1/material3":"sop/material","/geo1/merge1":"sop/merge","/geo1/merge2":"sop/merge","/geo1/objectProperties1":"sop/objectProperties","/geo1/objectProperties2":"sop/objectProperties","/geo1/transform1":"sop/transform","/geo1/transform2":"sop/transform","/perspectiveCamera1":"obj/perspectiveCamera","/perspectiveCamera1/events1":"sop/eventsNetwork","/perspectiveCamera1/events1/cameraOrbitControls1":"event/cameraOrbitControls","/COP":"obj/copNetwork","/COP/envMap":"cop/envMap","/COP/image1":"cop/image","/COP/imageEnv":"cop/imageEXR","/COP/imageUv":"cop/image","/eventsNetwork1":"obj/eventsNetwork","/eventsNetwork1/animation1":"event/animation","/eventsNetwork1/animation2":"event/animation","/eventsNetwork1/animation3":"event/animation","/eventsNetwork1/keyboard1":"event/keyboard","/eventsNetwork1/keyboard2":"event/keyboard","/eventsNetwork1/pointer1":"event/pointer","/eventsNetwork1/raycast1":"event/raycast","/eventsNetwork1/throttle1":"event/throttle","/background":"obj/geo","/background/COP":"sop/copNetwork","/background/COP/image_diffuse":"cop/image","/background/COP/image_displacement":"cop/image","/background/COP/image_roughness":"cop/image","/background/MAT":"sop/materialsNetwork","/background/MAT/meshStandard1":"mat/meshStandard","/background/copy1":"sop/copy","/background/material1":"sop/material","/background/merge1":"sop/merge","/background/merge2":"sop/merge","/background/plane1":"sop/plane","/background/transform1":"sop/transform","/background/transform2":"sop/transform","/background/transform3":"sop/transform","/background/transform4":"sop/transform","/background/transform5":"sop/transform","/background/transform6":"sop/transform","/background/uvTransform1":"sop/uvTransform","/background/uvTransform2":"sop/uvTransform","/background/uvTransform3":"sop/uvTransform","/lights":"obj/geo","/lights/merge1":"sop/merge","/lights/polarTransform1":"sop/polarTransform","/lights/polarTransform2":"sop/polarTransform","/lights/polarTransform3":"sop/polarTransform","/lights/spotLight1":"sop/spotLight","/lights/spotLight2":"sop/spotLight","/particles":"obj/geo","/particles/MAT":"sop/materialsNetwork","/particles/MAT/COP":"mat/copNetwork","/particles/MAT/COP/image1":"cop/image","/particles/MAT/meshStandard1":"mat/meshStandard","/particles/MAT/points1":"mat/points","/particles/MAT/pointsBuilder1":"mat/pointsBuilder","/particles/bboxScatter1":"sop/bboxScatter","/particles/box1":"sop/box","/particles/box2":"sop/box","/particles/jitter1":"sop/jitter","/particles/material1":"sop/material","/particles/transform1":"sop/transform","/ANIM_intro":"obj/animationsNetwork","/ANIM_intro/CONTROLS":"anim/play","/ANIM_intro/PLAY":"anim/null","/ANIM_intro/RESET":"anim/null","/ANIM_intro/duration1":"anim/duration","/ANIM_intro/duration2":"anim/duration","/ANIM_intro/duration3":"anim/duration","/ANIM_intro/easing1":"anim/easing","/ANIM_intro/merge1":"anim/merge","/ANIM_intro/merge2":"anim/merge","/ANIM_intro/propertyName1":"anim/propertyName","/ANIM_intro/propertyName2":"anim/propertyName","/ANIM_intro/propertyValue1":"anim/propertyValue","/ANIM_intro/propertyValue2":"anim/propertyValue","/ANIM_intro/propertyValue3":"anim/propertyValue","/ANIM_intro/propertyValue4":"anim/propertyValue","/ANIM_intro/target1":"anim/target","/ANIM_intro/target2":"anim/target","/ANIM_cam_left_right":"obj/animationsNetwork","/ANIM_cam_left_right/CONTROLS":"anim/play","/ANIM_cam_left_right/PLAY":"anim/null","/ANIM_cam_left_right/RESET":"anim/null","/ANIM_cam_left_right/duration1":"anim/duration","/ANIM_cam_left_right/easing1":"anim/easing","/ANIM_cam_left_right/propertyName1":"anim/propertyName","/ANIM_cam_left_right/propertyValue1":"anim/propertyValue","/ANIM_cam_left_right/propertyValue2":"anim/propertyValue","/ANIM_cam_left_right/target1":"anim/target"}
Js version
Editor version
Engine version
Name
*
Code
{"properties":{"frame":0,"maxFrame":600,"maxFrameLocked":false,"realtimeState":true,"mainCameraPath":"/perspectiveCamera1","versions":{"polygonjs":"1.1.266"}},"root":{"type":"root","nodes":{"hemisphereLight1":{"type":"hemisphereLight","flags":{"display":true}},"polarTransform1":{"type":"polarTransform","params":{"center":[0,1.7,0],"longitude":327.6,"latitude":3.6,"depth":16},"flags":{"display":false}},"perspectiveCamera_MAIN":{"type":"perspectiveCamera","inputs":["null_camRot"],"flags":{"display":true}},"null_camRot":{"type":"null","params":{"r":[-21.5,0,0]},"inputs":["polarTransform1"],"flags":{"display":true}},"geo1":{"type":"geo","nodes":{"BVH1":{"type":"BVH","inputs":["material2"]},"BVHVisualizer1":{"type":"BVHVisualizer","inputs":["BVH1"]},"MAT":{"type":"materialsNetwork","nodes":{"meshPhysicalBuilder1":{"type":"meshPhysicalBuilder","nodes":{"add1":{"type":"add","params":{"add0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"add1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"add2":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":true}}},"maxInputsCount":3,"inputs":[{"index":0,"node":"multScalar1","output":"val"},{"index":1,"node":"add2","output":"sum"}],"connection_points":{"in":[{"name":"add0","type":"vec3"},{"name":"add1","type":"vec3"},{"name":"add2","type":"vec3"}],"out":[{"name":"sum","type":"vec3"}]}},"add2":{"type":"add","params":{"add0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"add1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"add2":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":true}}},"maxInputsCount":3,"inputs":[{"index":0,"node":"subtract2","output":"subtract"},{"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"}]}},"add3":{"type":"add","params":{"add0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"add1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"add2":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":true}}},"maxInputsCount":3,"inputs":[{"index":0,"node":"add4","output":"sum"},{"index":1,"node":"attribute4","output":"val"}],"connection_points":{"in":[{"name":"add0","type":"vec3"},{"name":"add1","type":"vec3"},{"name":"add2","type":"vec3"}],"out":[{"name":"sum","type":"vec3"}]}},"add4":{"type":"add","params":{"add0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"add1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"add2":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":true}}},"maxInputsCount":3,"inputs":[{"index":0,"node":"multScalar2","output":"val"},{"index":1,"node":"subnet_rotation","output":"input1"}],"connection_points":{"in":[{"name":"add0","type":"vec3"},{"name":"add1","type":"vec3"},{"name":"add2","type":"vec3"}],"out":[{"name":"sum","type":"vec3"}]}},"attribute1":{"type":"attribute","params":{"name":"piececentroid","type":2},"connection_points":{"in":[],"out":[{"name":"val","type":"vec3"}]}},"attribute2":{"type":"attribute","params":{"name":"objectcentroid","type":2},"connection_points":{"in":[],"out":[{"name":"val","type":"vec3"}]}},"attribute3":{"type":"attribute","params":{"name":"inside"},"connection_points":{"in":[],"out":[{"name":"val","type":"float"}]}},"attribute4":{"type":"attribute","params":{"name":"piececentroid","type":2},"connection_points":{"in":[],"out":[{"name":"val","type":"vec3"}]}},"attribute5":{"type":"attribute","params":{"name":"objectcentroid","type":2},"connection_points":{"in":[],"out":[{"name":"val","type":"vec3"}]}},"clamp1":{"type":"clamp","params":{"value":{"type":"float","default_value":0,"options":{"spare":true,"editable":false}},"min":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}},"max":{"type":"float","default_value":1,"options":{"spare":true,"editable":true}}},"inputs":[{"index":0,"node":"complement1","output":"val"}],"connection_points":{"in":[{"name":"value","type":"float"},{"name":"min","type":"float"},{"name":"max","type":"float"}],"out":[{"name":"val","type":"float"}]}},"complement1":{"type":"complement","params":{"in":{"type":"float","default_value":0,"options":{"spare":true,"editable":false}}},"inputs":[{"index":0,"node":"distance1","output":"val"}],"connection_points":{"in":[{"name":"in","type":"float"}],"out":[{"name":"val","type":"float"}]}},"distance1":{"type":"distance","params":{"p0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"p1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}}},"inputs":[{"index":0,"node":"floatToVec3_1","output":"vec3"},{"index":1,"node":"attribute1","output":"val"}],"connection_points":{"in":[{"name":"p0","type":"vec3"},{"name":"p1","type":"vec3"}],"out":[{"name":"val","type":"float"}]}},"floatToVec3_1":{"type":"floatToVec3","params":{"x":{"overriden_options":{}},"y":{"overriden_options":{}},"z":{"overriden_options":{}}},"inputs":[{"index":0,"node":"vec3ToFloat1","output":"x"},{"index":1,"node":"vec3ToFloat1","output":"y"},{"index":2,"node":"vec3ToFloat1","output":"z"}]},"floatToVec3_2":{"type":"floatToVec3","params":{"x":{"overriden_options":{}},"y":{"overriden_options":{}},"z":{"overriden_options":{}}},"inputs":[null,{"index":1,"node":"vec3ToFloat2","output":"y"}]},"floatToVec3_3":{"type":"floatToVec3","params":{"x":{"overriden_options":{}},"y":{"raw_input":1.8,"overriden_options":{}},"z":{"overriden_options":{}}},"inputs":[{"index":0,"node":"vec3ToFloat3","output":"x"},null,{"index":2,"node":"vec3ToFloat3","output":"z"}]},"floatToVec3_4":{"type":"floatToVec3","params":{"x":{"overriden_options":{}},"y":{"overriden_options":{}},"z":{"overriden_options":{}}},"inputs":[{"index":0,"node":"vec3ToFloat4","output":"x"},{"index":1,"node":"vec3ToFloat4","output":"y"},{"index":2,"node":"vec3ToFloat4","output":"z"}]},"floatToVec3_5":{"type":"floatToVec3","params":{"x":{"overriden_options":{}},"y":{"overriden_options":{}},"z":{"overriden_options":{}}},"inputs":[{"index":0,"node":"vec3ToFloat5","output":"x"},{"index":1,"node":"max1","output":"val"},{"index":2,"node":"vec3ToFloat5","output":"z"}]},"globals1":{"type":"globals"},"max1":{"type":"max","params":{"in0":{"type":"float","default_value":0,"options":{"spare":true,"editable":false}},"in1":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}}},"inputs":[{"index":0,"node":"vec3ToFloat5","output":"y"}],"connection_points":{"in":[{"name":"in0","type":"float"},{"name":"in1","type":"float"}],"out":[{"name":"val","type":"float"}]}},"mult1":{"type":"mult","params":{"mult0":{"type":"vector3","default_value":[1,1,1],"options":{"spare":true,"editable":false}},"mult1":{"type":"vector3","default_value":[1,1,1],"options":{"spare":true,"editable":true},"raw_input":[1,0.30000000000000004,1]}},"inputs":[{"index":0,"node":"subtract2","output":"subtract"}],"connection_points":{"in":[{"name":"mult0","type":"vec3"},{"name":"mult1","type":"vec3"}],"out":[{"name":"product","type":"vec3"}]}},"multAdd1":{"type":"multAdd","params":{"value":{"type":"float","default_value":0,"options":{"spare":true,"editable":false}},"preAdd":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}},"mult":{"type":"float","default_value":1,"options":{"spare":true,"editable":true}},"postAdd":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}}},"inputs":[{"index":0,"node":"clamp1","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"}]}},"multAdd2":{"type":"multAdd","params":{"value":{"type":"float","default_value":0,"options":{"spare":true,"editable":false}},"preAdd":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}},"mult":{"type":"float","default_value":1,"options":{"spare":true,"editable":true}},"postAdd":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}}},"inputs":[{"index":0,"node":"multAdd1","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"}]}},"multAdd3":{"type":"multAdd","params":{"value":{"type":"float","default_value":0,"options":{"spare":true,"editable":false}},"preAdd":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}},"mult":{"type":"float","default_value":1,"options":{"spare":true,"editable":true},"raw_input":3},"postAdd":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}}},"inputs":[{"index":0,"node":"multAdd1","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"}]}},"multScalar1":{"type":"multScalar","params":{"value":{"type":"vector3","default_value":[1,1,1],"options":{"spare":true,"editable":false}},"mult":{"type":"float","default_value":1,"options":{"spare":true,"editable":false},"raw_input":1.5}},"inputs":[{"index":0,"node":"subtract2","output":"subtract"},{"index":1,"node":"multAdd2","output":"val"}],"connection_points":{"in":[{"name":"value","type":"vec3"},{"name":"mult","type":"float"}],"out":[{"name":"val","type":"vec3"}]}},"multScalar2":{"type":"multScalar","params":{"value":{"type":"vector3","default_value":[1,1,1],"options":{"spare":true,"editable":false}},"mult":{"type":"float","default_value":1,"options":{"spare":true,"editable":false}}},"inputs":[{"index":0,"node":"floatToVec3_5","output":"vec3"},{"index":1,"node":"multAdd3","output":"val"}],"connection_points":{"in":[{"name":"value","type":"vec3"},{"name":"mult","type":"float"}],"out":[{"name":"val","type":"vec3"}]}},"normalize1":{"type":"normalize","params":{"in":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}}},"inputs":[{"index":0,"node":"subtract2","output":"subtract"}],"connection_points":{"in":[{"name":"in","type":"vec3"}],"out":[{"name":"normalized","type":"vec3"}]}},"null1":{"type":"null","params":{"in":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}}},"inputs":[{"index":0,"node":"floatToVec3_4","output":"vec3"}],"connection_points":{"in":[{"name":"in","type":"vec3"}],"out":[{"name":"val","type":"vec3"}]}},"output1":{"type":"output","inputs":[{"index":0,"node":"add3","output":"sum"},{"index":1,"node":"subnet_rotation","output":"input2"},null,null,null,{"index":5,"node":"smoothstep1","output":"val"}]},"param1":{"type":"param","params":{"name":"cursor","type":4},"connection_points":{"in":[],"out":[{"name":"val","type":"vec3"}]}},"smoothstep1":{"type":"smoothstep","params":{"edge0":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}},"edge1":{"type":"float","default_value":1,"options":{"spare":true,"editable":true},"raw_input":0.46},"x":{"type":"float","default_value":0,"options":{"spare":true,"editable":false}}},"inputs":[null,null,{"index":2,"node":"attribute3","output":"val"}],"connection_points":{"in":[{"name":"edge0","type":"float"},{"name":"edge1","type":"float"},{"name":"x","type":"float"}],"out":[{"name":"val","type":"float"}]}},"subnet_rotation":{"type":"subnet","nodes":{"attribute4":{"type":"attribute","params":{"name":"piececentroid","type":2},"connection_points":{"in":[],"out":[{"name":"val","type":"vec3"}]}},"constant_UP":{"type":"constant","params":{"type":4,"vec3":[0,1,0]},"connection_points":{"in":[],"out":[{"name":"val","type":"vec3"}]}},"cross1":{"type":"cross","params":{"x":{"overriden_options":{}},"y":{"overriden_options":{}}},"inputs":[{"index":0,"node":"constant_UP","output":"val"},{"index":1,"node":"normalize1","output":"normalized"}]},"length1":{"type":"length","params":{"x":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}}},"inputs":[{"index":0,"node":"subnetInput1","output":"input1"}],"connection_points":{"in":[{"name":"x","type":"vec3"}],"out":[{"name":"val","type":"float"}]}},"max1":{"type":"max","params":{"in0":{"type":"float","default_value":0,"options":{"spare":true,"editable":false}},"in1":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}}},"inputs":[{"index":0,"node":"multAdd3","output":"val"}],"connection_points":{"in":[{"name":"in0","type":"float"},{"name":"in1","type":"float"}],"out":[{"name":"val","type":"float"}]}},"multAdd3":{"type":"multAdd","params":{"value":{"type":"float","default_value":0,"options":{"spare":true,"editable":false}},"preAdd":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}},"mult":{"type":"float","default_value":1,"options":{"spare":true,"editable":true},"raw_input":4},"postAdd":{"type":"float","default_value":0,"options":{"spare":true,"editable":true},"raw_input":-0.5}},"inputs":[{"index":0,"node":"subnetInput1","output":"input0"}],"connection_points":{"in":[{"name":"value","type":"float"},{"name":"preAdd","type":"float"},{"name":"mult","type":"float"},{"name":"postAdd","type":"float"}],"out":[{"name":"val","type":"float"}]}},"multScalar1":{"type":"multScalar","params":{"value":{"type":"vector3","default_value":[1,1,1],"options":{"spare":true,"editable":false}},"mult":{"type":"float","default_value":1,"options":{"spare":true,"editable":false}}},"inputs":[{"index":0,"node":"rotate1","output":"val"},{"index":1,"node":"length1","output":"val"}],"connection_points":{"in":[{"name":"value","type":"vec3"},{"name":"mult","type":"float"}],"out":[{"name":"val","type":"vec3"}]}},"normalize1":{"type":"normalize","params":{"in":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}}},"inputs":[{"index":0,"node":"attribute4","output":"val"}],"connection_points":{"in":[{"name":"in","type":"vec3"}],"out":[{"name":"normalized","type":"vec3"}]}},"normalize2":{"type":"normalize","params":{"in":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}}},"inputs":[{"index":0,"node":"cross1","output":"cross"}],"connection_points":{"in":[{"name":"in","type":"vec3"}],"out":[{"name":"normalized","type":"vec3"}]}},"normalize3":{"type":"normalize","params":{"in":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}}},"inputs":[{"index":0,"node":"subnetInput1","output":"input1"}],"connection_points":{"in":[{"name":"in","type":"vec3"}],"out":[{"name":"normalized","type":"vec3"}]}},"rotate1":{"type":"rotate","params":{"vector":{"type":"vector3","default_value":[0,0,1],"options":{"spare":true,"editable":false}},"axis":{"type":"vector3","default_value":[0,1,0],"options":{"spare":true,"editable":false},"raw_input":[0,0,1]},"angle":{"type":"float","default_value":0,"options":{"spare":true,"editable":false},"raw_input":-3.2}},"maxInputsCount":3,"inputs":[{"index":0,"node":"normalize3","output":"normalized"},{"index":1,"node":"normalize2","output":"normalized"},{"index":2,"node":"max1","output":"val"}],"connection_points":{"in":[{"name":"vector","type":"vec3"},{"name":"axis","type":"vec3"},{"name":"angle","type":"float"}],"out":[{"name":"val","type":"vec3"}]}},"rotate2":{"type":"rotate","params":{"vector":{"type":"vector3","default_value":[0,0,1],"options":{"spare":true,"editable":false}},"axis":{"type":"vector3","default_value":[0,1,0],"options":{"spare":true,"editable":false},"raw_input":[0,0,1]},"angle":{"type":"float","default_value":0,"options":{"spare":true,"editable":false},"raw_input":-3.2}},"maxInputsCount":3,"inputs":[{"index":0,"node":"subnetInput1","output":"input2"},{"index":1,"node":"normalize2","output":"normalized"},{"index":2,"node":"max1","output":"val"}],"connection_points":{"in":[{"name":"vector","type":"vec3"},{"name":"axis","type":"vec3"},{"name":"angle","type":"float"}],"out":[{"name":"val","type":"vec3"}]}},"subnetInput1":{"type":"subnetInput","connection_points":{"in":[],"out":[{"name":"input0","type":"float"},{"name":"input1","type":"vec3"},{"name":"input2","type":"vec3"}]}},"subnetOutput1":{"type":"subnetOutput","inputs":[null,{"index":1,"node":"multScalar1","output":"val"},{"index":2,"node":"rotate2","output":"val"}],"connection_points":{"in":[{"name":"input0","type":"float"},{"name":"input1","type":"vec3"},{"name":"input2","type":"vec3"}],"out":[]}}},"params":{"inputsCount":3,"inputType1":4,"inputType2":4,"input0":{"type":"float","default_value":0,"options":{"spare":true,"editable":false}},"input1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"input2":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}}},"maxInputsCount":3,"inputs":[{"index":0,"node":"multAdd1","output":"val"},{"index":1,"node":"subtract5","output":"subtract"},{"index":2,"node":"globals1","output":"normal"}],"connection_points":{"in":[{"name":"input0","type":"float"},{"name":"input1","type":"vec3"},{"name":"input2","type":"vec3"}],"out":[{"name":"input0","type":"float"},{"name":"input1","type":"vec3"},{"name":"input2","type":"vec3"}]}},"subtract1":{"type":"subtract","params":{"sub0":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}},"sub1":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}}},"connection_points":{"in":[{"name":"sub0","type":"float"},{"name":"sub1","type":"float"}],"out":[{"name":"subtract","type":"float"}]}},"subtract2":{"type":"subtract","params":{"sub0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"sub1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"sub2":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":true}}},"maxInputsCount":3,"inputs":[{"index":0,"node":"null1","output":"val"},{"index":1,"node":"floatToVec3_3","output":"vec3"}],"connection_points":{"in":[{"name":"sub0","type":"vec3"},{"name":"sub1","type":"vec3"},{"name":"sub2","type":"vec3"}],"out":[{"name":"subtract","type":"vec3"}]}},"subtract3":{"type":"subtract","params":{"sub0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"sub1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"sub2":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":true}}},"maxInputsCount":3,"inputs":[{"index":0,"node":"globals1","output":"position"},{"index":1,"node":"null1","output":"val"}],"connection_points":{"in":[{"name":"sub0","type":"vec3"},{"name":"sub1","type":"vec3"},{"name":"sub2","type":"vec3"}],"out":[{"name":"subtract","type":"vec3"}]}},"subtract4":{"type":"subtract","params":{"sub0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"sub1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"sub2":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":true}}},"maxInputsCount":3,"inputs":[{"index":0,"node":"floatToVec3_2","output":"vec3"},{"index":1,"node":"subtract2","output":"subtract"}],"connection_points":{"in":[{"name":"sub0","type":"vec3"},{"name":"sub1","type":"vec3"},{"name":"sub2","type":"vec3"}],"out":[{"name":"subtract","type":"vec3"}]}},"subtract5":{"type":"subtract","params":{"sub0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"sub1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"sub2":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":true}}},"maxInputsCount":3,"inputs":[{"index":0,"node":"globals1","output":"position"},{"index":1,"node":"attribute4","output":"val"}],"connection_points":{"in":[{"name":"sub0","type":"vec3"},{"name":"sub1","type":"vec3"},{"name":"sub2","type":"vec3"}],"out":[{"name":"subtract","type":"vec3"}]}},"vec3ToFloat1":{"type":"vec3ToFloat","params":{"vec":{"overriden_options":{}}},"inputs":[{"index":0,"node":"param1","output":"val"}]},"vec3ToFloat2":{"type":"vec3ToFloat","params":{"vec":{"overriden_options":{}}},"inputs":[{"index":0,"node":"attribute1","output":"val"}]},"vec3ToFloat3":{"type":"vec3ToFloat","params":{"vec":{"overriden_options":{}}},"inputs":[{"index":0,"node":"attribute2","output":"val"}]},"vec3ToFloat4":{"type":"vec3ToFloat","params":{"vec":{"overriden_options":{}}},"inputs":[{"index":0,"node":"attribute1","output":"val"}]},"vec3ToFloat5":{"type":"vec3ToFloat","params":{"vec":{"overriden_options":{}}},"inputs":[{"index":0,"node":"mult1","output":"product"}]}},"params":{"useEnvMap":true,"envMap":"../../../COP/envMap","roughness":0,"cursor":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"computeOnDirty":true,"cook":false,"dependentOnFoundNode":true},"raw_input":[8.942121763008997,5.444515662415952,0],"overriden_options":{"callback":"{}"}}},"persisted_config":{"material":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/geo1/MAT/meshPhysicalBuilder1-main","type":"MeshPhysicalMaterial","name":"/geo1/MAT/meshPhysicalBuilder1","color":16777215,"roughness":0,"metalness":1,"sheen":0,"sheenColor":0,"sheenRoughness":1,"emissive":0,"specularIntensity":1,"specularColor":16777215,"clearcoat":0,"clearcoatRoughness":0,"envMapIntensity":1,"reflectivity":0.49999999999999983,"transmission":0,"thickness":0.01,"attenuationDistance":0,"attenuationColor":16777215,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},"onBeforeCompileDataJSON":{"vertexShader":"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n\n\n\n// /geo1/MAT/meshPhysicalBuilder1/complement1\nfloat complement(float x){return 1.0-x;}\nvec2 complement(vec2 x){return vec2(1.0-x.x, 1.0-x.y);}\nvec3 complement(vec3 x){return vec3(1.0-x.x, 1.0-x.y, 1.0-x.z);}\nvec4 complement(vec4 x){return vec4(1.0-x.x, 1.0-x.y, 1.0-x.z, 1.0-x.w);}\n\n\n// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/rotate1\n\n\n// https://stackoverflow.com/questions/23793698/how-to-implement-slerp-in-glsl-hlsl\n// vec4 quatSlerp(vec4 p0, vec4 p1, float t)\n// {\n// \tfloat dotp = dot(normalize(p0), normalize(p1));\n// \tif ((dotp > 0.9999) || (dotp < -0.9999))\n// \t{\n// \t\tif (t<=0.5)\n// \t\t\treturn p0;\n// \t\treturn p1;\n// \t}\n// \tfloat theta = acos(dotp);\n// \tvec4 P = ((p0*sin((1.0-t)*theta) + p1*sin(t*theta)) / sin(theta));\n// \tP.w = 1.0;\n// \treturn P;\n// }\n\n// https://devcry.heiho.net/html/2017/20170521-slerp.html\n// float lerp(float a, float b, float t) {\n// \treturn (1.0 - t) * a + t * b;\n// }\n// vec4 quatSlerp(vec4 p0, vec4 p1, float t){\n// \tvec4 qb = p1;\n\n// \t// cos(a) = dot product\n// \tfloat cos_a = p0.x * qb.x + p0.y * qb.y + p0.z * qb.z + p0.w * qb.w;\n// \tif (cos_a < 0.0f) {\n// \t\tcos_a = -cos_a;\n// \t\tqb = -qb;\n// \t}\n\n// \t// close to zero, cos(a) ~= 1\n// \t// do linear interpolation\n// \tif (cos_a > 0.999) {\n// \t\treturn vec4(\n// \t\t\tlerp(p0.x, qb.x, t),\n// \t\t\tlerp(p0.y, qb.y, t),\n// \t\t\tlerp(p0.z, qb.z, t),\n// \t\t\tlerp(p0.w, qb.w, t)\n// \t\t);\n// \t}\n\n// \tfloat alpha = acos(cos_a);\n// \treturn (p0 * sin(1.0 - t) + p1 * sin(t * alpha)) / sin(alpha);\n// }\n\n// https://stackoverflow.com/questions/62943083/interpolate-between-two-quaternions-the-long-way\nvec4 quatSlerp(vec4 q1, vec4 q2, float t){\n\tfloat angle = acos(dot(q1, q2));\n\tfloat denom = sin(angle);\n\t//check if denom is zero\n\treturn (q1*sin((1.0-t)*angle)+q2*sin(t*angle))/denom;\n}\n// TO CHECK:\n// this page https://www.reddit.com/r/opengl/comments/704la7/glsl_quaternion_library/\n// has a link to a potentially nice pdf:\n// http://web.mit.edu/2.998/www/QuaternionReport1.pdf\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/meshPhysicalBuilder1/param1\nuniform vec3 v_POLY_param_cursor;\n\n// /geo1/MAT/meshPhysicalBuilder1/globals1\nvarying vec3 v_POLY_globals1_position;\nvarying vec3 v_POLY_globals1_normal;\n\n// /geo1/MAT/meshPhysicalBuilder1/attribute3\nvarying float v_POLY_attribute_inside;\n\n// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/attribute4\nvarying vec3 v_POLY_attribute_piececentroid;\n\n// /geo1/MAT/meshPhysicalBuilder1/attribute1\nattribute vec3 piececentroid;\n\n// /geo1/MAT/meshPhysicalBuilder1/attribute2\nattribute vec3 objectcentroid;\n\n// /geo1/MAT/meshPhysicalBuilder1/attribute3\nattribute float inside;\n\n\n\n\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\n\n\n\t// /geo1/MAT/meshPhysicalBuilder1/attribute1\n\tvec3 v_POLY_attribute1_val = piececentroid;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/attribute2\n\tvec3 v_POLY_attribute2_val = objectcentroid;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/param1\n\tvec3 v_POLY_param1_val = v_POLY_param_cursor;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/globals1\n\tv_POLY_globals1_position = vec3(position);\n\tv_POLY_globals1_normal = vec3(normal);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/attribute4\n\tvec3 v_POLY_attribute4_val = piececentroid;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/attribute3\n\tv_POLY_attribute_inside = float(inside);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/vec3ToFloat4\n\tfloat v_POLY_vec3ToFloat4_x = v_POLY_attribute1_val.x;\n\tfloat v_POLY_vec3ToFloat4_y = v_POLY_attribute1_val.y;\n\tfloat v_POLY_vec3ToFloat4_z = v_POLY_attribute1_val.z;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/vec3ToFloat3\n\tfloat v_POLY_vec3ToFloat3_x = v_POLY_attribute2_val.x;\n\tfloat v_POLY_vec3ToFloat3_z = v_POLY_attribute2_val.z;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/vec3ToFloat1\n\tfloat v_POLY_vec3ToFloat1_x = v_POLY_param1_val.x;\n\tfloat v_POLY_vec3ToFloat1_y = v_POLY_param1_val.y;\n\tfloat v_POLY_vec3ToFloat1_z = v_POLY_param1_val.z;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/subtract5\n\tvec3 v_POLY_subtract5_subtract = (v_POLY_globals1_position - v_POLY_attribute4_val - vec3(0.0, 0.0, 0.0));\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/floatToVec3_4\n\tvec3 v_POLY_floatToVec3_4_vec3 = vec3(v_POLY_vec3ToFloat4_x, v_POLY_vec3ToFloat4_y, v_POLY_vec3ToFloat4_z);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/floatToVec3_3\n\tvec3 v_POLY_floatToVec3_3_vec3 = vec3(v_POLY_vec3ToFloat3_x, 1.8, v_POLY_vec3ToFloat3_z);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/floatToVec3_1\n\tvec3 v_POLY_floatToVec3_1_vec3 = vec3(v_POLY_vec3ToFloat1_x, v_POLY_vec3ToFloat1_y, v_POLY_vec3ToFloat1_z);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/null1\n\tvec3 v_POLY_null1_val = v_POLY_floatToVec3_4_vec3;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/distance1\n\tfloat v_POLY_distance1_val = distance(v_POLY_floatToVec3_1_vec3, v_POLY_attribute1_val);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/subtract2\n\tvec3 v_POLY_subtract2_subtract = (v_POLY_null1_val - v_POLY_floatToVec3_3_vec3 - vec3(0.0, 0.0, 0.0));\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/complement1\n\tfloat v_POLY_complement1_val = complement(v_POLY_distance1_val);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/mult1\n\tvec3 v_POLY_mult1_product = (v_POLY_subtract2_subtract * vec3(1.0, 0.30000000000000004, 1.0));\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/clamp1\n\tfloat v_POLY_clamp1_val = clamp(v_POLY_complement1_val, 0.0, 1.0);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/vec3ToFloat5\n\tfloat v_POLY_vec3ToFloat5_x = v_POLY_mult1_product.x;\n\tfloat v_POLY_vec3ToFloat5_z = v_POLY_mult1_product.z;\n\tfloat v_POLY_vec3ToFloat5_y = v_POLY_mult1_product.y;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/multAdd1\n\tfloat v_POLY_multAdd1_val = (1.0*(v_POLY_clamp1_val + 0.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/max1\n\tfloat v_POLY_max1_val = max(v_POLY_vec3ToFloat5_y, 0.0);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/multAdd3\n\tfloat v_POLY_multAdd3_val = (3.0*(v_POLY_multAdd1_val + 0.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation\n\tfloat v_POLY_subnet_rotation_input0 = v_POLY_multAdd1_val;\n\tvec3 v_POLY_subnet_rotation_input1 = v_POLY_subtract5_subtract;\n\tvec3 v_POLY_subnet_rotation_input2 = v_POLY_globals1_normal;\n\tif(true){\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/subnetInput1\n\t\tfloat v_POLY_subnet_rotation_subnetInput1_input0 = v_POLY_multAdd1_val;\n\t\tvec3 v_POLY_subnet_rotation_subnetInput1_input1 = v_POLY_subtract5_subtract;\n\t\tvec3 v_POLY_subnet_rotation_subnetInput1_input2 = v_POLY_globals1_normal;\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/constant_UP\n\t\tvec3 v_POLY_subnet_rotation_constant_UP_val = vec3(0.0, 1.0, 0.0);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/attribute4\n\t\tvec3 v_POLY_subnet_rotation_attribute4_val = piececentroid;\n\t\tv_POLY_attribute_piececentroid = vec3(piececentroid);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/normalize3\n\t\tvec3 v_POLY_subnet_rotation_normalize3_normalized = normalize(v_POLY_subnet_rotation_subnetInput1_input1);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/multAdd3\n\t\tfloat v_POLY_subnet_rotation_multAdd3_val = (4.0*(v_POLY_subnet_rotation_subnetInput1_input0 + 0.0)) + -0.5;\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/length1\n\t\tfloat v_POLY_subnet_rotation_length1_val = length(v_POLY_subnet_rotation_subnetInput1_input1);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/normalize1\n\t\tvec3 v_POLY_subnet_rotation_normalize1_normalized = normalize(v_POLY_subnet_rotation_attribute4_val);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/max1\n\t\tfloat v_POLY_subnet_rotation_max1_val = max(v_POLY_subnet_rotation_multAdd3_val, 0.0);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/cross1\n\t\tvec3 v_POLY_subnet_rotation_cross1_cross = cross(v_POLY_subnet_rotation_constant_UP_val, v_POLY_subnet_rotation_normalize1_normalized);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/normalize2\n\t\tvec3 v_POLY_subnet_rotation_normalize2_normalized = normalize(v_POLY_subnet_rotation_cross1_cross);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/rotate1\n\t\tvec3 v_POLY_subnet_rotation_rotate1_val = rotateWithAxisAngle(v_POLY_subnet_rotation_normalize3_normalized, v_POLY_subnet_rotation_normalize2_normalized, v_POLY_subnet_rotation_max1_val);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/rotate2\n\t\tvec3 v_POLY_subnet_rotation_rotate2_val = rotateWithAxisAngle(v_POLY_subnet_rotation_subnetInput1_input2, v_POLY_subnet_rotation_normalize2_normalized, v_POLY_subnet_rotation_max1_val);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/multScalar1\n\t\tvec3 v_POLY_subnet_rotation_multScalar1_val = (v_POLY_subnet_rotation_length1_val*v_POLY_subnet_rotation_rotate1_val);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/subnetOutput1\n\t\tv_POLY_subnet_rotation_input1 = v_POLY_subnet_rotation_multScalar1_val;\n\t\tv_POLY_subnet_rotation_input2 = v_POLY_subnet_rotation_rotate2_val;\n\t}\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/floatToVec3_5\n\tvec3 v_POLY_floatToVec3_5_vec3 = vec3(v_POLY_vec3ToFloat5_x, v_POLY_max1_val, v_POLY_vec3ToFloat5_z);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/multScalar2\n\tvec3 v_POLY_multScalar2_val = (v_POLY_multAdd3_val*v_POLY_floatToVec3_5_vec3);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/add4\n\tvec3 v_POLY_add4_sum = (v_POLY_multScalar2_val + v_POLY_subnet_rotation_input1 + vec3(0.0, 0.0, 0.0));\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/add3\n\tvec3 v_POLY_add3_sum = (v_POLY_add4_sum + v_POLY_attribute4_val + vec3(0.0, 0.0, 0.0));\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/output1\n\tvec3 transformed = v_POLY_add3_sum;\n\tvec3 objectNormal = v_POLY_subnet_rotation_input2;\n\t#ifdef USE_TANGENT\n\t\tvec3 objectTangent = vec3( tangent.xyz );\n\t#endif\n\n\n\n\t#include <morphcolor_vertex>\n// removed:\n//\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n// removed:\n//\t#include <begin_vertex>\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\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}","fragmentShader":"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULARINTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n\t#ifdef USE_SPECULARCOLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEENCOLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n\n\n\n// /geo1/MAT/meshPhysicalBuilder1/attribute3\nvarying float v_POLY_attribute_inside;\n\n// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/attribute4\nvarying vec3 v_POLY_attribute_piececentroid;\n\n\n\n\n#include <packing>\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 <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nstruct SSSModel {\n\tbool isActive;\n\tvec3 color;\n\tfloat thickness;\n\tfloat power;\n\tfloat scale;\n\tfloat distortion;\n\tfloat ambient;\n\tfloat attenuation;\n};\n\nvoid RE_Direct_Scattering(\n\tconst in IncidentLight directLight,\n\tconst in GeometricContext geometry,\n\tconst in SSSModel sssModel,\n\tinout ReflectedLight reflectedLight\n\t){\n\tvec3 scatteringHalf = normalize(directLight.direction + (geometry.normal * sssModel.distortion));\n\tfloat scatteringDot = pow(saturate(dot(geometry.viewDir, -scatteringHalf)), sssModel.power) * sssModel.scale;\n\tvec3 scatteringIllu = (scatteringDot + sssModel.ambient) * (sssModel.color * (1.0-sssModel.thickness));\n\treflectedLight.directDiffuse += scatteringIllu * sssModel.attenuation * directLight.color;\n}\n\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\n\n\t// /geo1/MAT/meshPhysicalBuilder1/attribute3\n\tfloat v_POLY_attribute3_val = v_POLY_attribute_inside;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/smoothstep1\n\tfloat v_POLY_smoothstep1_val = smoothstep(0.0, 0.46, v_POLY_attribute3_val);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/output1\n\tfloat POLY_metalness = v_POLY_smoothstep1_val;\n\tfloat POLY_roughness = 1.0;\n\tvec3 POLY_emissive = vec3(1.0, 1.0, 1.0);\n\tSSSModel POLY_SSSModel = SSSModel(/*isActive*/false,/*color*/vec3(1.0, 1.0, 1.0), /*thickness*/0.1, /*power*/2.0, /*scale*/16.0, /*distortion*/0.1,/*ambient*/0.4,/*attenuation*/0.8 );\n\tfloat POLY_transmission = 1.0;\n\tfloat POLY_thickness = 1.0;\n\n\n\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive * POLY_emissive;\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\tfloat roughnessFactor = roughness * POLY_roughness;\n\n#ifdef USE_ROUGHNESSMAP\n\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\n\t// reads channel G, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\n\troughnessFactor *= texelRoughness.g;\n\n#endif\n\n\tfloat metalnessFactor = metalness * POLY_metalness;\n\n#ifdef USE_METALNESSMAP\n\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\n\t// reads channel B, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\n\tmetalnessFactor *= texelMetalness.b;\n\n#endif\n\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\nif(POLY_SSSModel.isActive){\n\tRE_Direct_Scattering(directLight, geometry, POLY_SSSModel, reflectedLight);\n}\n\n\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t\n#ifdef USE_TRANSMISSION\n\n\tfloat transmissionAlpha = 1.0;\nfloat transmissionFactor = transmission * POLY_transmission;\nfloat thicknessFactor = thickness * POLY_thickness;\n\n\t#ifdef USE_TRANSMISSIONMAP\n\n\t\ttransmissionFactor *= texture2D( transmissionMap, vUv ).r;\n\n\t#endif\n\n\t#ifdef USE_THICKNESSMAP\n\n\t\tthicknessFactor *= texture2D( thicknessMap, vUv ).g;\n\n\t#endif\n\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\n\tvec4 transmission = getIBLVolumeRefraction(\n\t\tn, v, roughnessFactor, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor,\n\t\tattenuationColor, attenuationDistance );\n\n\ttotalDiffuse = mix( totalDiffuse, transmission.rgb, transmissionFactor );\n\ttransmissionAlpha = mix( transmissionAlpha, transmission.a, transmissionFactor );\n#endif\n\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;\n\t#endif\n\t#include <output_fragment>\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}","timeDependent":false,"resolutionDependent":false,"paramConfigs":[{"type":"vector3","name":"cursor","defaultValue":[0,0,0],"uniformName":"v_POLY_param_cursor"}]},"customMaterials":{"customDepthMaterial":{"material":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/geo1/MAT/meshPhysicalBuilder1-customDepthMaterial","type":"MeshDepthMaterial","name":"customDepthMaterial","side":1,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"depthPacking":3201},"onBeforeCompileDataJSON":{"vertexShader":"#include <common>\n\n\n\n// /geo1/MAT/meshPhysicalBuilder1/complement1\nfloat complement(float x){return 1.0-x;}\nvec2 complement(vec2 x){return vec2(1.0-x.x, 1.0-x.y);}\nvec3 complement(vec3 x){return vec3(1.0-x.x, 1.0-x.y, 1.0-x.z);}\nvec4 complement(vec4 x){return vec4(1.0-x.x, 1.0-x.y, 1.0-x.z, 1.0-x.w);}\n\n\n// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/rotate1\n\n\n// https://stackoverflow.com/questions/23793698/how-to-implement-slerp-in-glsl-hlsl\n// vec4 quatSlerp(vec4 p0, vec4 p1, float t)\n// {\n// \tfloat dotp = dot(normalize(p0), normalize(p1));\n// \tif ((dotp > 0.9999) || (dotp < -0.9999))\n// \t{\n// \t\tif (t<=0.5)\n// \t\t\treturn p0;\n// \t\treturn p1;\n// \t}\n// \tfloat theta = acos(dotp);\n// \tvec4 P = ((p0*sin((1.0-t)*theta) + p1*sin(t*theta)) / sin(theta));\n// \tP.w = 1.0;\n// \treturn P;\n// }\n\n// https://devcry.heiho.net/html/2017/20170521-slerp.html\n// float lerp(float a, float b, float t) {\n// \treturn (1.0 - t) * a + t * b;\n// }\n// vec4 quatSlerp(vec4 p0, vec4 p1, float t){\n// \tvec4 qb = p1;\n\n// \t// cos(a) = dot product\n// \tfloat cos_a = p0.x * qb.x + p0.y * qb.y + p0.z * qb.z + p0.w * qb.w;\n// \tif (cos_a < 0.0f) {\n// \t\tcos_a = -cos_a;\n// \t\tqb = -qb;\n// \t}\n\n// \t// close to zero, cos(a) ~= 1\n// \t// do linear interpolation\n// \tif (cos_a > 0.999) {\n// \t\treturn vec4(\n// \t\t\tlerp(p0.x, qb.x, t),\n// \t\t\tlerp(p0.y, qb.y, t),\n// \t\t\tlerp(p0.z, qb.z, t),\n// \t\t\tlerp(p0.w, qb.w, t)\n// \t\t);\n// \t}\n\n// \tfloat alpha = acos(cos_a);\n// \treturn (p0 * sin(1.0 - t) + p1 * sin(t * alpha)) / sin(alpha);\n// }\n\n// https://stackoverflow.com/questions/62943083/interpolate-between-two-quaternions-the-long-way\nvec4 quatSlerp(vec4 q1, vec4 q2, float t){\n\tfloat angle = acos(dot(q1, q2));\n\tfloat denom = sin(angle);\n\t//check if denom is zero\n\treturn (q1*sin((1.0-t)*angle)+q2*sin(t*angle))/denom;\n}\n// TO CHECK:\n// this page https://www.reddit.com/r/opengl/comments/704la7/glsl_quaternion_library/\n// has a link to a potentially nice pdf:\n// http://web.mit.edu/2.998/www/QuaternionReport1.pdf\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/meshPhysicalBuilder1/param1\nuniform vec3 v_POLY_param_cursor;\n\n// /geo1/MAT/meshPhysicalBuilder1/globals1\nvarying vec3 v_POLY_globals1_position;\nvarying vec3 v_POLY_globals1_normal;\n\n// /geo1/MAT/meshPhysicalBuilder1/attribute3\nvarying float v_POLY_attribute_inside;\n\n// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/attribute4\nvarying vec3 v_POLY_attribute_piececentroid;\n\n// /geo1/MAT/meshPhysicalBuilder1/attribute1\nattribute vec3 piececentroid;\n\n// /geo1/MAT/meshPhysicalBuilder1/attribute2\nattribute vec3 objectcentroid;\n\n// /geo1/MAT/meshPhysicalBuilder1/attribute3\nattribute float inside;\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>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n// removed:\n//\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n// removed:\n//\t#include <begin_vertex>\n\n\n\n\t// /geo1/MAT/meshPhysicalBuilder1/attribute1\n\tvec3 v_POLY_attribute1_val = piececentroid;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/attribute2\n\tvec3 v_POLY_attribute2_val = objectcentroid;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/param1\n\tvec3 v_POLY_param1_val = v_POLY_param_cursor;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/globals1\n\tv_POLY_globals1_position = vec3(position);\n\tv_POLY_globals1_normal = vec3(normal);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/attribute4\n\tvec3 v_POLY_attribute4_val = piececentroid;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/attribute3\n\tv_POLY_attribute_inside = float(inside);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/vec3ToFloat4\n\tfloat v_POLY_vec3ToFloat4_x = v_POLY_attribute1_val.x;\n\tfloat v_POLY_vec3ToFloat4_y = v_POLY_attribute1_val.y;\n\tfloat v_POLY_vec3ToFloat4_z = v_POLY_attribute1_val.z;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/vec3ToFloat3\n\tfloat v_POLY_vec3ToFloat3_x = v_POLY_attribute2_val.x;\n\tfloat v_POLY_vec3ToFloat3_z = v_POLY_attribute2_val.z;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/vec3ToFloat1\n\tfloat v_POLY_vec3ToFloat1_x = v_POLY_param1_val.x;\n\tfloat v_POLY_vec3ToFloat1_y = v_POLY_param1_val.y;\n\tfloat v_POLY_vec3ToFloat1_z = v_POLY_param1_val.z;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/subtract5\n\tvec3 v_POLY_subtract5_subtract = (v_POLY_globals1_position - v_POLY_attribute4_val - vec3(0.0, 0.0, 0.0));\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/floatToVec3_4\n\tvec3 v_POLY_floatToVec3_4_vec3 = vec3(v_POLY_vec3ToFloat4_x, v_POLY_vec3ToFloat4_y, v_POLY_vec3ToFloat4_z);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/floatToVec3_3\n\tvec3 v_POLY_floatToVec3_3_vec3 = vec3(v_POLY_vec3ToFloat3_x, 1.8, v_POLY_vec3ToFloat3_z);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/floatToVec3_1\n\tvec3 v_POLY_floatToVec3_1_vec3 = vec3(v_POLY_vec3ToFloat1_x, v_POLY_vec3ToFloat1_y, v_POLY_vec3ToFloat1_z);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/null1\n\tvec3 v_POLY_null1_val = v_POLY_floatToVec3_4_vec3;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/distance1\n\tfloat v_POLY_distance1_val = distance(v_POLY_floatToVec3_1_vec3, v_POLY_attribute1_val);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/subtract2\n\tvec3 v_POLY_subtract2_subtract = (v_POLY_null1_val - v_POLY_floatToVec3_3_vec3 - vec3(0.0, 0.0, 0.0));\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/complement1\n\tfloat v_POLY_complement1_val = complement(v_POLY_distance1_val);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/mult1\n\tvec3 v_POLY_mult1_product = (v_POLY_subtract2_subtract * vec3(1.0, 0.30000000000000004, 1.0));\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/clamp1\n\tfloat v_POLY_clamp1_val = clamp(v_POLY_complement1_val, 0.0, 1.0);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/vec3ToFloat5\n\tfloat v_POLY_vec3ToFloat5_x = v_POLY_mult1_product.x;\n\tfloat v_POLY_vec3ToFloat5_z = v_POLY_mult1_product.z;\n\tfloat v_POLY_vec3ToFloat5_y = v_POLY_mult1_product.y;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/multAdd1\n\tfloat v_POLY_multAdd1_val = (1.0*(v_POLY_clamp1_val + 0.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/max1\n\tfloat v_POLY_max1_val = max(v_POLY_vec3ToFloat5_y, 0.0);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/multAdd3\n\tfloat v_POLY_multAdd3_val = (3.0*(v_POLY_multAdd1_val + 0.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation\n\tfloat v_POLY_subnet_rotation_input0 = v_POLY_multAdd1_val;\n\tvec3 v_POLY_subnet_rotation_input1 = v_POLY_subtract5_subtract;\n\tvec3 v_POLY_subnet_rotation_input2 = v_POLY_globals1_normal;\n\tif(true){\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/subnetInput1\n\t\tfloat v_POLY_subnet_rotation_subnetInput1_input0 = v_POLY_multAdd1_val;\n\t\tvec3 v_POLY_subnet_rotation_subnetInput1_input1 = v_POLY_subtract5_subtract;\n\t\tvec3 v_POLY_subnet_rotation_subnetInput1_input2 = v_POLY_globals1_normal;\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/constant_UP\n\t\tvec3 v_POLY_subnet_rotation_constant_UP_val = vec3(0.0, 1.0, 0.0);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/attribute4\n\t\tvec3 v_POLY_subnet_rotation_attribute4_val = piececentroid;\n\t\tv_POLY_attribute_piececentroid = vec3(piececentroid);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/normalize3\n\t\tvec3 v_POLY_subnet_rotation_normalize3_normalized = normalize(v_POLY_subnet_rotation_subnetInput1_input1);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/multAdd3\n\t\tfloat v_POLY_subnet_rotation_multAdd3_val = (4.0*(v_POLY_subnet_rotation_subnetInput1_input0 + 0.0)) + -0.5;\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/length1\n\t\tfloat v_POLY_subnet_rotation_length1_val = length(v_POLY_subnet_rotation_subnetInput1_input1);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/normalize1\n\t\tvec3 v_POLY_subnet_rotation_normalize1_normalized = normalize(v_POLY_subnet_rotation_attribute4_val);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/max1\n\t\tfloat v_POLY_subnet_rotation_max1_val = max(v_POLY_subnet_rotation_multAdd3_val, 0.0);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/cross1\n\t\tvec3 v_POLY_subnet_rotation_cross1_cross = cross(v_POLY_subnet_rotation_constant_UP_val, v_POLY_subnet_rotation_normalize1_normalized);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/normalize2\n\t\tvec3 v_POLY_subnet_rotation_normalize2_normalized = normalize(v_POLY_subnet_rotation_cross1_cross);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/rotate1\n\t\tvec3 v_POLY_subnet_rotation_rotate1_val = rotateWithAxisAngle(v_POLY_subnet_rotation_normalize3_normalized, v_POLY_subnet_rotation_normalize2_normalized, v_POLY_subnet_rotation_max1_val);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/rotate2\n\t\tvec3 v_POLY_subnet_rotation_rotate2_val = rotateWithAxisAngle(v_POLY_subnet_rotation_subnetInput1_input2, v_POLY_subnet_rotation_normalize2_normalized, v_POLY_subnet_rotation_max1_val);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/multScalar1\n\t\tvec3 v_POLY_subnet_rotation_multScalar1_val = (v_POLY_subnet_rotation_length1_val*v_POLY_subnet_rotation_rotate1_val);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/subnetOutput1\n\t\tv_POLY_subnet_rotation_input1 = v_POLY_subnet_rotation_multScalar1_val;\n\t\tv_POLY_subnet_rotation_input2 = v_POLY_subnet_rotation_rotate2_val;\n\t}\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/floatToVec3_5\n\tvec3 v_POLY_floatToVec3_5_vec3 = vec3(v_POLY_vec3ToFloat5_x, v_POLY_max1_val, v_POLY_vec3ToFloat5_z);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/multScalar2\n\tvec3 v_POLY_multScalar2_val = (v_POLY_multAdd3_val*v_POLY_floatToVec3_5_vec3);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/add4\n\tvec3 v_POLY_add4_sum = (v_POLY_multScalar2_val + v_POLY_subnet_rotation_input1 + vec3(0.0, 0.0, 0.0));\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/add3\n\tvec3 v_POLY_add3_sum = (v_POLY_add4_sum + v_POLY_attribute4_val + vec3(0.0, 0.0, 0.0));\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/output1\n\tvec3 transformed = v_POLY_add3_sum;\n\tvec3 objectNormal = v_POLY_subnet_rotation_input2;\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\tvHighPrecisionZW = gl_Position.zw;\n}","fragmentShader":"\n// INSERT DEFINES\n\n\n#if DEPTH_PACKING == 3200\n\n\tuniform float opacity;\n\n#endif\n\n#include <common>\n\n\n\n// /geo1/MAT/meshPhysicalBuilder1/attribute3\nvarying float v_POLY_attribute_inside;\n\n// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/attribute4\nvarying vec3 v_POLY_attribute_piececentroid;\n\n\n\n\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvarying vec2 vHighPrecisionZW;\n\nstruct SSSModel {\n\tbool isActive;\n\tvec3 color;\n\tfloat thickness;\n\tfloat power;\n\tfloat scale;\n\tfloat distortion;\n\tfloat ambient;\n\tfloat attenuation;\n};\n\nvoid RE_Direct_Scattering(\n\tconst in IncidentLight directLight,\n\tconst in GeometricContext geometry,\n\tconst in SSSModel sssModel,\n\tinout ReflectedLight reflectedLight\n\t){\n\tvec3 scatteringHalf = normalize(directLight.direction + (geometry.normal * sssModel.distortion));\n\tfloat scatteringDot = pow(saturate(dot(geometry.viewDir, -scatteringHalf)), sssModel.power) * sssModel.scale;\n\tvec3 scatteringIllu = (scatteringDot + sssModel.ambient) * (sssModel.color * (1.0-sssModel.thickness));\n\treflectedLight.directDiffuse += scatteringIllu * sssModel.attenuation * directLight.color;\n}\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( 1.0 );\n\n\t#if DEPTH_PACKING == 3200\n\n\t\tdiffuseColor.a = opacity;\n\n\t#endif\n\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\n\n\n\t// /geo1/MAT/meshPhysicalBuilder1/attribute3\n\tfloat v_POLY_attribute3_val = v_POLY_attribute_inside;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/smoothstep1\n\tfloat v_POLY_smoothstep1_val = smoothstep(0.0, 0.46, v_POLY_attribute3_val);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/output1\n\tfloat POLY_metalness = v_POLY_smoothstep1_val;\n\tfloat POLY_roughness = 1.0;\n\tvec3 POLY_emissive = vec3(1.0, 1.0, 1.0);\n\tSSSModel POLY_SSSModel = SSSModel(/*isActive*/false,/*color*/vec3(1.0, 1.0, 1.0), /*thickness*/0.1, /*power*/2.0, /*scale*/16.0, /*distortion*/0.1,/*ambient*/0.4,/*attenuation*/0.8 );\n\tfloat POLY_transmission = 1.0;\n\tfloat POLY_thickness = 1.0;\n\n\n\n\n\t// INSERT BODY\n\t// the new body lines should be added before the alphatest_fragment\n\t// so that alpha is set before (which is really how it would be set if the alphamap_fragment above was used by the material node parameters)\n\n\t#include <alphatest_fragment>\n\n\t#include <logdepthbuf_fragment>\n\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 ), diffuseColor.a );\n\n\t#elif DEPTH_PACKING == 3201\n\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\n\t#endif\n\n}\n","timeDependent":false,"resolutionDependent":false,"paramConfigs":[{"type":"vector3","name":"cursor","defaultValue":[0,0,0],"uniformName":"v_POLY_param_cursor"}]}},"customDistanceMaterial":{"material":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/geo1/MAT/meshPhysicalBuilder1-customDistanceMaterial","type":"MeshDistanceMaterial","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},"onBeforeCompileDataJSON":{"vertexShader":"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n\n\n\n// /geo1/MAT/meshPhysicalBuilder1/complement1\nfloat complement(float x){return 1.0-x;}\nvec2 complement(vec2 x){return vec2(1.0-x.x, 1.0-x.y);}\nvec3 complement(vec3 x){return vec3(1.0-x.x, 1.0-x.y, 1.0-x.z);}\nvec4 complement(vec4 x){return vec4(1.0-x.x, 1.0-x.y, 1.0-x.z, 1.0-x.w);}\n\n\n// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/rotate1\n\n\n// https://stackoverflow.com/questions/23793698/how-to-implement-slerp-in-glsl-hlsl\n// vec4 quatSlerp(vec4 p0, vec4 p1, float t)\n// {\n// \tfloat dotp = dot(normalize(p0), normalize(p1));\n// \tif ((dotp > 0.9999) || (dotp < -0.9999))\n// \t{\n// \t\tif (t<=0.5)\n// \t\t\treturn p0;\n// \t\treturn p1;\n// \t}\n// \tfloat theta = acos(dotp);\n// \tvec4 P = ((p0*sin((1.0-t)*theta) + p1*sin(t*theta)) / sin(theta));\n// \tP.w = 1.0;\n// \treturn P;\n// }\n\n// https://devcry.heiho.net/html/2017/20170521-slerp.html\n// float lerp(float a, float b, float t) {\n// \treturn (1.0 - t) * a + t * b;\n// }\n// vec4 quatSlerp(vec4 p0, vec4 p1, float t){\n// \tvec4 qb = p1;\n\n// \t// cos(a) = dot product\n// \tfloat cos_a = p0.x * qb.x + p0.y * qb.y + p0.z * qb.z + p0.w * qb.w;\n// \tif (cos_a < 0.0f) {\n// \t\tcos_a = -cos_a;\n// \t\tqb = -qb;\n// \t}\n\n// \t// close to zero, cos(a) ~= 1\n// \t// do linear interpolation\n// \tif (cos_a > 0.999) {\n// \t\treturn vec4(\n// \t\t\tlerp(p0.x, qb.x, t),\n// \t\t\tlerp(p0.y, qb.y, t),\n// \t\t\tlerp(p0.z, qb.z, t),\n// \t\t\tlerp(p0.w, qb.w, t)\n// \t\t);\n// \t}\n\n// \tfloat alpha = acos(cos_a);\n// \treturn (p0 * sin(1.0 - t) + p1 * sin(t * alpha)) / sin(alpha);\n// }\n\n// https://stackoverflow.com/questions/62943083/interpolate-between-two-quaternions-the-long-way\nvec4 quatSlerp(vec4 q1, vec4 q2, float t){\n\tfloat angle = acos(dot(q1, q2));\n\tfloat denom = sin(angle);\n\t//check if denom is zero\n\treturn (q1*sin((1.0-t)*angle)+q2*sin(t*angle))/denom;\n}\n// TO CHECK:\n// this page https://www.reddit.com/r/opengl/comments/704la7/glsl_quaternion_library/\n// has a link to a potentially nice pdf:\n// http://web.mit.edu/2.998/www/QuaternionReport1.pdf\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/meshPhysicalBuilder1/param1\nuniform vec3 v_POLY_param_cursor;\n\n// /geo1/MAT/meshPhysicalBuilder1/globals1\nvarying vec3 v_POLY_globals1_position;\nvarying vec3 v_POLY_globals1_normal;\n\n// /geo1/MAT/meshPhysicalBuilder1/attribute3\nvarying float v_POLY_attribute_inside;\n\n// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/attribute4\nvarying vec3 v_POLY_attribute_piececentroid;\n\n// /geo1/MAT/meshPhysicalBuilder1/attribute1\nattribute vec3 piececentroid;\n\n// /geo1/MAT/meshPhysicalBuilder1/attribute2\nattribute vec3 objectcentroid;\n\n// /geo1/MAT/meshPhysicalBuilder1/attribute3\nattribute float inside;\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>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n// removed:\n//\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n// removed:\n//\t#include <begin_vertex>\n\n\n\n\t// /geo1/MAT/meshPhysicalBuilder1/attribute1\n\tvec3 v_POLY_attribute1_val = piececentroid;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/attribute2\n\tvec3 v_POLY_attribute2_val = objectcentroid;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/param1\n\tvec3 v_POLY_param1_val = v_POLY_param_cursor;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/globals1\n\tv_POLY_globals1_position = vec3(position);\n\tv_POLY_globals1_normal = vec3(normal);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/attribute4\n\tvec3 v_POLY_attribute4_val = piececentroid;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/attribute3\n\tv_POLY_attribute_inside = float(inside);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/vec3ToFloat4\n\tfloat v_POLY_vec3ToFloat4_x = v_POLY_attribute1_val.x;\n\tfloat v_POLY_vec3ToFloat4_y = v_POLY_attribute1_val.y;\n\tfloat v_POLY_vec3ToFloat4_z = v_POLY_attribute1_val.z;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/vec3ToFloat3\n\tfloat v_POLY_vec3ToFloat3_x = v_POLY_attribute2_val.x;\n\tfloat v_POLY_vec3ToFloat3_z = v_POLY_attribute2_val.z;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/vec3ToFloat1\n\tfloat v_POLY_vec3ToFloat1_x = v_POLY_param1_val.x;\n\tfloat v_POLY_vec3ToFloat1_y = v_POLY_param1_val.y;\n\tfloat v_POLY_vec3ToFloat1_z = v_POLY_param1_val.z;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/subtract5\n\tvec3 v_POLY_subtract5_subtract = (v_POLY_globals1_position - v_POLY_attribute4_val - vec3(0.0, 0.0, 0.0));\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/floatToVec3_4\n\tvec3 v_POLY_floatToVec3_4_vec3 = vec3(v_POLY_vec3ToFloat4_x, v_POLY_vec3ToFloat4_y, v_POLY_vec3ToFloat4_z);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/floatToVec3_3\n\tvec3 v_POLY_floatToVec3_3_vec3 = vec3(v_POLY_vec3ToFloat3_x, 1.8, v_POLY_vec3ToFloat3_z);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/floatToVec3_1\n\tvec3 v_POLY_floatToVec3_1_vec3 = vec3(v_POLY_vec3ToFloat1_x, v_POLY_vec3ToFloat1_y, v_POLY_vec3ToFloat1_z);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/null1\n\tvec3 v_POLY_null1_val = v_POLY_floatToVec3_4_vec3;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/distance1\n\tfloat v_POLY_distance1_val = distance(v_POLY_floatToVec3_1_vec3, v_POLY_attribute1_val);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/subtract2\n\tvec3 v_POLY_subtract2_subtract = (v_POLY_null1_val - v_POLY_floatToVec3_3_vec3 - vec3(0.0, 0.0, 0.0));\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/complement1\n\tfloat v_POLY_complement1_val = complement(v_POLY_distance1_val);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/mult1\n\tvec3 v_POLY_mult1_product = (v_POLY_subtract2_subtract * vec3(1.0, 0.30000000000000004, 1.0));\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/clamp1\n\tfloat v_POLY_clamp1_val = clamp(v_POLY_complement1_val, 0.0, 1.0);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/vec3ToFloat5\n\tfloat v_POLY_vec3ToFloat5_x = v_POLY_mult1_product.x;\n\tfloat v_POLY_vec3ToFloat5_z = v_POLY_mult1_product.z;\n\tfloat v_POLY_vec3ToFloat5_y = v_POLY_mult1_product.y;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/multAdd1\n\tfloat v_POLY_multAdd1_val = (1.0*(v_POLY_clamp1_val + 0.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/max1\n\tfloat v_POLY_max1_val = max(v_POLY_vec3ToFloat5_y, 0.0);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/multAdd3\n\tfloat v_POLY_multAdd3_val = (3.0*(v_POLY_multAdd1_val + 0.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation\n\tfloat v_POLY_subnet_rotation_input0 = v_POLY_multAdd1_val;\n\tvec3 v_POLY_subnet_rotation_input1 = v_POLY_subtract5_subtract;\n\tvec3 v_POLY_subnet_rotation_input2 = v_POLY_globals1_normal;\n\tif(true){\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/subnetInput1\n\t\tfloat v_POLY_subnet_rotation_subnetInput1_input0 = v_POLY_multAdd1_val;\n\t\tvec3 v_POLY_subnet_rotation_subnetInput1_input1 = v_POLY_subtract5_subtract;\n\t\tvec3 v_POLY_subnet_rotation_subnetInput1_input2 = v_POLY_globals1_normal;\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/constant_UP\n\t\tvec3 v_POLY_subnet_rotation_constant_UP_val = vec3(0.0, 1.0, 0.0);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/attribute4\n\t\tvec3 v_POLY_subnet_rotation_attribute4_val = piececentroid;\n\t\tv_POLY_attribute_piececentroid = vec3(piececentroid);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/normalize3\n\t\tvec3 v_POLY_subnet_rotation_normalize3_normalized = normalize(v_POLY_subnet_rotation_subnetInput1_input1);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/multAdd3\n\t\tfloat v_POLY_subnet_rotation_multAdd3_val = (4.0*(v_POLY_subnet_rotation_subnetInput1_input0 + 0.0)) + -0.5;\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/length1\n\t\tfloat v_POLY_subnet_rotation_length1_val = length(v_POLY_subnet_rotation_subnetInput1_input1);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/normalize1\n\t\tvec3 v_POLY_subnet_rotation_normalize1_normalized = normalize(v_POLY_subnet_rotation_attribute4_val);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/max1\n\t\tfloat v_POLY_subnet_rotation_max1_val = max(v_POLY_subnet_rotation_multAdd3_val, 0.0);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/cross1\n\t\tvec3 v_POLY_subnet_rotation_cross1_cross = cross(v_POLY_subnet_rotation_constant_UP_val, v_POLY_subnet_rotation_normalize1_normalized);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/normalize2\n\t\tvec3 v_POLY_subnet_rotation_normalize2_normalized = normalize(v_POLY_subnet_rotation_cross1_cross);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/rotate1\n\t\tvec3 v_POLY_subnet_rotation_rotate1_val = rotateWithAxisAngle(v_POLY_subnet_rotation_normalize3_normalized, v_POLY_subnet_rotation_normalize2_normalized, v_POLY_subnet_rotation_max1_val);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/rotate2\n\t\tvec3 v_POLY_subnet_rotation_rotate2_val = rotateWithAxisAngle(v_POLY_subnet_rotation_subnetInput1_input2, v_POLY_subnet_rotation_normalize2_normalized, v_POLY_subnet_rotation_max1_val);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/multScalar1\n\t\tvec3 v_POLY_subnet_rotation_multScalar1_val = (v_POLY_subnet_rotation_length1_val*v_POLY_subnet_rotation_rotate1_val);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/subnetOutput1\n\t\tv_POLY_subnet_rotation_input1 = v_POLY_subnet_rotation_multScalar1_val;\n\t\tv_POLY_subnet_rotation_input2 = v_POLY_subnet_rotation_rotate2_val;\n\t}\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/floatToVec3_5\n\tvec3 v_POLY_floatToVec3_5_vec3 = vec3(v_POLY_vec3ToFloat5_x, v_POLY_max1_val, v_POLY_vec3ToFloat5_z);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/multScalar2\n\tvec3 v_POLY_multScalar2_val = (v_POLY_multAdd3_val*v_POLY_floatToVec3_5_vec3);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/add4\n\tvec3 v_POLY_add4_sum = (v_POLY_multScalar2_val + v_POLY_subnet_rotation_input1 + vec3(0.0, 0.0, 0.0));\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/add3\n\tvec3 v_POLY_add3_sum = (v_POLY_add4_sum + v_POLY_attribute4_val + vec3(0.0, 0.0, 0.0));\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/output1\n\tvec3 transformed = v_POLY_add3_sum;\n\tvec3 objectNormal = v_POLY_subnet_rotation_input2;\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\tvWorldPosition = worldPosition.xyz;\n}","fragmentShader":"\n// INSERT DEFINES\n\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/meshPhysicalBuilder1/attribute3\nvarying float v_POLY_attribute_inside;\n\n// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/attribute4\nvarying vec3 v_POLY_attribute_piececentroid;\n\n\n\n\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nstruct SSSModel {\n\tbool isActive;\n\tvec3 color;\n\tfloat thickness;\n\tfloat power;\n\tfloat scale;\n\tfloat distortion;\n\tfloat ambient;\n\tfloat attenuation;\n};\n\nvoid RE_Direct_Scattering(\n\tconst in IncidentLight directLight,\n\tconst in GeometricContext geometry,\n\tconst in SSSModel sssModel,\n\tinout ReflectedLight reflectedLight\n\t){\n\tvec3 scatteringHalf = normalize(directLight.direction + (geometry.normal * sssModel.distortion));\n\tfloat scatteringDot = pow(saturate(dot(geometry.viewDir, -scatteringHalf)), sssModel.power) * sssModel.scale;\n\tvec3 scatteringIllu = (scatteringDot + sssModel.ambient) * (sssModel.color * (1.0-sssModel.thickness));\n\treflectedLight.directDiffuse += scatteringIllu * sssModel.attenuation * directLight.color;\n}\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( 1.0 );\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\n\n\n\t// /geo1/MAT/meshPhysicalBuilder1/attribute3\n\tfloat v_POLY_attribute3_val = v_POLY_attribute_inside;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/smoothstep1\n\tfloat v_POLY_smoothstep1_val = smoothstep(0.0, 0.46, v_POLY_attribute3_val);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/output1\n\tfloat POLY_metalness = v_POLY_smoothstep1_val;\n\tfloat POLY_roughness = 1.0;\n\tvec3 POLY_emissive = vec3(1.0, 1.0, 1.0);\n\tSSSModel POLY_SSSModel = SSSModel(/*isActive*/false,/*color*/vec3(1.0, 1.0, 1.0), /*thickness*/0.1, /*power*/2.0, /*scale*/16.0, /*distortion*/0.1,/*ambient*/0.4,/*attenuation*/0.8 );\n\tfloat POLY_transmission = 1.0;\n\tfloat POLY_thickness = 1.0;\n\n\n\n\n\t// INSERT BODY\n\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","timeDependent":false,"resolutionDependent":false,"paramConfigs":[{"type":"vector3","name":"cursor","defaultValue":[0,0,0],"uniformName":"v_POLY_param_cursor"}]}},"customDepthDOFMaterial":{"material":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/geo1/MAT/meshPhysicalBuilder1-customDepthDOFMaterial","type":"MeshDepthMaterial","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,"depthPacking":3200},"onBeforeCompileDataJSON":{"vertexShader":"#include <common>\n\n\n\n// /geo1/MAT/meshPhysicalBuilder1/complement1\nfloat complement(float x){return 1.0-x;}\nvec2 complement(vec2 x){return vec2(1.0-x.x, 1.0-x.y);}\nvec3 complement(vec3 x){return vec3(1.0-x.x, 1.0-x.y, 1.0-x.z);}\nvec4 complement(vec4 x){return vec4(1.0-x.x, 1.0-x.y, 1.0-x.z, 1.0-x.w);}\n\n\n// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/rotate1\n\n\n// https://stackoverflow.com/questions/23793698/how-to-implement-slerp-in-glsl-hlsl\n// vec4 quatSlerp(vec4 p0, vec4 p1, float t)\n// {\n// \tfloat dotp = dot(normalize(p0), normalize(p1));\n// \tif ((dotp > 0.9999) || (dotp < -0.9999))\n// \t{\n// \t\tif (t<=0.5)\n// \t\t\treturn p0;\n// \t\treturn p1;\n// \t}\n// \tfloat theta = acos(dotp);\n// \tvec4 P = ((p0*sin((1.0-t)*theta) + p1*sin(t*theta)) / sin(theta));\n// \tP.w = 1.0;\n// \treturn P;\n// }\n\n// https://devcry.heiho.net/html/2017/20170521-slerp.html\n// float lerp(float a, float b, float t) {\n// \treturn (1.0 - t) * a + t * b;\n// }\n// vec4 quatSlerp(vec4 p0, vec4 p1, float t){\n// \tvec4 qb = p1;\n\n// \t// cos(a) = dot product\n// \tfloat cos_a = p0.x * qb.x + p0.y * qb.y + p0.z * qb.z + p0.w * qb.w;\n// \tif (cos_a < 0.0f) {\n// \t\tcos_a = -cos_a;\n// \t\tqb = -qb;\n// \t}\n\n// \t// close to zero, cos(a) ~= 1\n// \t// do linear interpolation\n// \tif (cos_a > 0.999) {\n// \t\treturn vec4(\n// \t\t\tlerp(p0.x, qb.x, t),\n// \t\t\tlerp(p0.y, qb.y, t),\n// \t\t\tlerp(p0.z, qb.z, t),\n// \t\t\tlerp(p0.w, qb.w, t)\n// \t\t);\n// \t}\n\n// \tfloat alpha = acos(cos_a);\n// \treturn (p0 * sin(1.0 - t) + p1 * sin(t * alpha)) / sin(alpha);\n// }\n\n// https://stackoverflow.com/questions/62943083/interpolate-between-two-quaternions-the-long-way\nvec4 quatSlerp(vec4 q1, vec4 q2, float t){\n\tfloat angle = acos(dot(q1, q2));\n\tfloat denom = sin(angle);\n\t//check if denom is zero\n\treturn (q1*sin((1.0-t)*angle)+q2*sin(t*angle))/denom;\n}\n// TO CHECK:\n// this page https://www.reddit.com/r/opengl/comments/704la7/glsl_quaternion_library/\n// has a link to a potentially nice pdf:\n// http://web.mit.edu/2.998/www/QuaternionReport1.pdf\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/meshPhysicalBuilder1/param1\nuniform vec3 v_POLY_param_cursor;\n\n// /geo1/MAT/meshPhysicalBuilder1/globals1\nvarying vec3 v_POLY_globals1_position;\nvarying vec3 v_POLY_globals1_normal;\n\n// /geo1/MAT/meshPhysicalBuilder1/attribute3\nvarying float v_POLY_attribute_inside;\n\n// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/attribute4\nvarying vec3 v_POLY_attribute_piececentroid;\n\n// /geo1/MAT/meshPhysicalBuilder1/attribute1\nattribute vec3 piececentroid;\n\n// /geo1/MAT/meshPhysicalBuilder1/attribute2\nattribute vec3 objectcentroid;\n\n// /geo1/MAT/meshPhysicalBuilder1/attribute3\nattribute float inside;\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>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n// removed:\n//\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n// removed:\n//\t#include <begin_vertex>\n\n\n\n\t// /geo1/MAT/meshPhysicalBuilder1/attribute1\n\tvec3 v_POLY_attribute1_val = piececentroid;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/attribute2\n\tvec3 v_POLY_attribute2_val = objectcentroid;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/param1\n\tvec3 v_POLY_param1_val = v_POLY_param_cursor;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/globals1\n\tv_POLY_globals1_position = vec3(position);\n\tv_POLY_globals1_normal = vec3(normal);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/attribute4\n\tvec3 v_POLY_attribute4_val = piececentroid;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/attribute3\n\tv_POLY_attribute_inside = float(inside);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/vec3ToFloat4\n\tfloat v_POLY_vec3ToFloat4_x = v_POLY_attribute1_val.x;\n\tfloat v_POLY_vec3ToFloat4_y = v_POLY_attribute1_val.y;\n\tfloat v_POLY_vec3ToFloat4_z = v_POLY_attribute1_val.z;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/vec3ToFloat3\n\tfloat v_POLY_vec3ToFloat3_x = v_POLY_attribute2_val.x;\n\tfloat v_POLY_vec3ToFloat3_z = v_POLY_attribute2_val.z;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/vec3ToFloat1\n\tfloat v_POLY_vec3ToFloat1_x = v_POLY_param1_val.x;\n\tfloat v_POLY_vec3ToFloat1_y = v_POLY_param1_val.y;\n\tfloat v_POLY_vec3ToFloat1_z = v_POLY_param1_val.z;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/subtract5\n\tvec3 v_POLY_subtract5_subtract = (v_POLY_globals1_position - v_POLY_attribute4_val - vec3(0.0, 0.0, 0.0));\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/floatToVec3_4\n\tvec3 v_POLY_floatToVec3_4_vec3 = vec3(v_POLY_vec3ToFloat4_x, v_POLY_vec3ToFloat4_y, v_POLY_vec3ToFloat4_z);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/floatToVec3_3\n\tvec3 v_POLY_floatToVec3_3_vec3 = vec3(v_POLY_vec3ToFloat3_x, 1.8, v_POLY_vec3ToFloat3_z);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/floatToVec3_1\n\tvec3 v_POLY_floatToVec3_1_vec3 = vec3(v_POLY_vec3ToFloat1_x, v_POLY_vec3ToFloat1_y, v_POLY_vec3ToFloat1_z);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/null1\n\tvec3 v_POLY_null1_val = v_POLY_floatToVec3_4_vec3;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/distance1\n\tfloat v_POLY_distance1_val = distance(v_POLY_floatToVec3_1_vec3, v_POLY_attribute1_val);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/subtract2\n\tvec3 v_POLY_subtract2_subtract = (v_POLY_null1_val - v_POLY_floatToVec3_3_vec3 - vec3(0.0, 0.0, 0.0));\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/complement1\n\tfloat v_POLY_complement1_val = complement(v_POLY_distance1_val);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/mult1\n\tvec3 v_POLY_mult1_product = (v_POLY_subtract2_subtract * vec3(1.0, 0.30000000000000004, 1.0));\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/clamp1\n\tfloat v_POLY_clamp1_val = clamp(v_POLY_complement1_val, 0.0, 1.0);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/vec3ToFloat5\n\tfloat v_POLY_vec3ToFloat5_x = v_POLY_mult1_product.x;\n\tfloat v_POLY_vec3ToFloat5_z = v_POLY_mult1_product.z;\n\tfloat v_POLY_vec3ToFloat5_y = v_POLY_mult1_product.y;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/multAdd1\n\tfloat v_POLY_multAdd1_val = (1.0*(v_POLY_clamp1_val + 0.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/max1\n\tfloat v_POLY_max1_val = max(v_POLY_vec3ToFloat5_y, 0.0);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/multAdd3\n\tfloat v_POLY_multAdd3_val = (3.0*(v_POLY_multAdd1_val + 0.0)) + 0.0;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation\n\tfloat v_POLY_subnet_rotation_input0 = v_POLY_multAdd1_val;\n\tvec3 v_POLY_subnet_rotation_input1 = v_POLY_subtract5_subtract;\n\tvec3 v_POLY_subnet_rotation_input2 = v_POLY_globals1_normal;\n\tif(true){\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/subnetInput1\n\t\tfloat v_POLY_subnet_rotation_subnetInput1_input0 = v_POLY_multAdd1_val;\n\t\tvec3 v_POLY_subnet_rotation_subnetInput1_input1 = v_POLY_subtract5_subtract;\n\t\tvec3 v_POLY_subnet_rotation_subnetInput1_input2 = v_POLY_globals1_normal;\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/constant_UP\n\t\tvec3 v_POLY_subnet_rotation_constant_UP_val = vec3(0.0, 1.0, 0.0);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/attribute4\n\t\tvec3 v_POLY_subnet_rotation_attribute4_val = piececentroid;\n\t\tv_POLY_attribute_piececentroid = vec3(piececentroid);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/normalize3\n\t\tvec3 v_POLY_subnet_rotation_normalize3_normalized = normalize(v_POLY_subnet_rotation_subnetInput1_input1);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/multAdd3\n\t\tfloat v_POLY_subnet_rotation_multAdd3_val = (4.0*(v_POLY_subnet_rotation_subnetInput1_input0 + 0.0)) + -0.5;\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/length1\n\t\tfloat v_POLY_subnet_rotation_length1_val = length(v_POLY_subnet_rotation_subnetInput1_input1);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/normalize1\n\t\tvec3 v_POLY_subnet_rotation_normalize1_normalized = normalize(v_POLY_subnet_rotation_attribute4_val);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/max1\n\t\tfloat v_POLY_subnet_rotation_max1_val = max(v_POLY_subnet_rotation_multAdd3_val, 0.0);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/cross1\n\t\tvec3 v_POLY_subnet_rotation_cross1_cross = cross(v_POLY_subnet_rotation_constant_UP_val, v_POLY_subnet_rotation_normalize1_normalized);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/normalize2\n\t\tvec3 v_POLY_subnet_rotation_normalize2_normalized = normalize(v_POLY_subnet_rotation_cross1_cross);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/rotate1\n\t\tvec3 v_POLY_subnet_rotation_rotate1_val = rotateWithAxisAngle(v_POLY_subnet_rotation_normalize3_normalized, v_POLY_subnet_rotation_normalize2_normalized, v_POLY_subnet_rotation_max1_val);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/rotate2\n\t\tvec3 v_POLY_subnet_rotation_rotate2_val = rotateWithAxisAngle(v_POLY_subnet_rotation_subnetInput1_input2, v_POLY_subnet_rotation_normalize2_normalized, v_POLY_subnet_rotation_max1_val);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/multScalar1\n\t\tvec3 v_POLY_subnet_rotation_multScalar1_val = (v_POLY_subnet_rotation_length1_val*v_POLY_subnet_rotation_rotate1_val);\n\t\n\t\t// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/subnetOutput1\n\t\tv_POLY_subnet_rotation_input1 = v_POLY_subnet_rotation_multScalar1_val;\n\t\tv_POLY_subnet_rotation_input2 = v_POLY_subnet_rotation_rotate2_val;\n\t}\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/floatToVec3_5\n\tvec3 v_POLY_floatToVec3_5_vec3 = vec3(v_POLY_vec3ToFloat5_x, v_POLY_max1_val, v_POLY_vec3ToFloat5_z);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/multScalar2\n\tvec3 v_POLY_multScalar2_val = (v_POLY_multAdd3_val*v_POLY_floatToVec3_5_vec3);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/add4\n\tvec3 v_POLY_add4_sum = (v_POLY_multScalar2_val + v_POLY_subnet_rotation_input1 + vec3(0.0, 0.0, 0.0));\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/add3\n\tvec3 v_POLY_add3_sum = (v_POLY_add4_sum + v_POLY_attribute4_val + vec3(0.0, 0.0, 0.0));\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/output1\n\tvec3 transformed = v_POLY_add3_sum;\n\tvec3 objectNormal = v_POLY_subnet_rotation_input2;\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\tvHighPrecisionZW = gl_Position.zw;\n}","fragmentShader":"\n// INSERT DEFINES\n\n\n#if DEPTH_PACKING == 3200\n\n\tuniform float opacity;\n\n#endif\n\n#include <common>\n\n\n\n// /geo1/MAT/meshPhysicalBuilder1/attribute3\nvarying float v_POLY_attribute_inside;\n\n// /geo1/MAT/meshPhysicalBuilder1/subnet_rotation/attribute4\nvarying vec3 v_POLY_attribute_piececentroid;\n\n\n\n\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvarying vec2 vHighPrecisionZW;\n\nstruct SSSModel {\n\tbool isActive;\n\tvec3 color;\n\tfloat thickness;\n\tfloat power;\n\tfloat scale;\n\tfloat distortion;\n\tfloat ambient;\n\tfloat attenuation;\n};\n\nvoid RE_Direct_Scattering(\n\tconst in IncidentLight directLight,\n\tconst in GeometricContext geometry,\n\tconst in SSSModel sssModel,\n\tinout ReflectedLight reflectedLight\n\t){\n\tvec3 scatteringHalf = normalize(directLight.direction + (geometry.normal * sssModel.distortion));\n\tfloat scatteringDot = pow(saturate(dot(geometry.viewDir, -scatteringHalf)), sssModel.power) * sssModel.scale;\n\tvec3 scatteringIllu = (scatteringDot + sssModel.ambient) * (sssModel.color * (1.0-sssModel.thickness));\n\treflectedLight.directDiffuse += scatteringIllu * sssModel.attenuation * directLight.color;\n}\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( 1.0 );\n\n\t#if DEPTH_PACKING == 3200\n\n\t\tdiffuseColor.a = opacity;\n\n\t#endif\n\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\n\n\n\t// /geo1/MAT/meshPhysicalBuilder1/attribute3\n\tfloat v_POLY_attribute3_val = v_POLY_attribute_inside;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/smoothstep1\n\tfloat v_POLY_smoothstep1_val = smoothstep(0.0, 0.46, v_POLY_attribute3_val);\n\t\n\t// /geo1/MAT/meshPhysicalBuilder1/output1\n\tfloat POLY_metalness = v_POLY_smoothstep1_val;\n\tfloat POLY_roughness = 1.0;\n\tvec3 POLY_emissive = vec3(1.0, 1.0, 1.0);\n\tSSSModel POLY_SSSModel = SSSModel(/*isActive*/false,/*color*/vec3(1.0, 1.0, 1.0), /*thickness*/0.1, /*power*/2.0, /*scale*/16.0, /*distortion*/0.1,/*ambient*/0.4,/*attenuation*/0.8 );\n\tfloat POLY_transmission = 1.0;\n\tfloat POLY_thickness = 1.0;\n\n\n\n\n\t// INSERT BODY\n\t// the new body lines should be added before the alphatest_fragment\n\t// so that alpha is set before (which is really how it would be set if the alphamap_fragment above was used by the material node parameters)\n\n\t#include <alphatest_fragment>\n\n\t#include <logdepthbuf_fragment>\n\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 ), diffuseColor.a );\n\n\t#elif DEPTH_PACKING == 3201\n\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\n\t#endif\n\n}\n","timeDependent":false,"resolutionDependent":false,"paramConfigs":[{"type":"vector3","name":"cursor","defaultValue":[0,0,0],"uniformName":"v_POLY_param_cursor"}]}}}}},"meshPhysicalBuilder2":{"type":"meshPhysicalBuilder","nodes":{"add1":{"type":"add","params":{"add0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"add1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"add2":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":true}}},"maxInputsCount":3,"inputs":[{"index":0,"node":"multScalar1","output":"val"},{"index":1,"node":"add2","output":"sum"}],"connection_points":{"in":[{"name":"add0","type":"vec3"},{"name":"add1","type":"vec3"},{"name":"add2","type":"vec3"}],"out":[{"name":"sum","type":"vec3"}]}},"add2":{"type":"add","params":{"add0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"add1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"add2":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":true}}},"maxInputsCount":3,"inputs":[{"index":0,"node":"subtract2","output":"subtract"},{"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"}]}},"add3":{"type":"add","params":{"add0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"add1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"add2":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":true}}},"maxInputsCount":3,"inputs":[{"index":0,"node":"add4","output":"sum"},{"index":1,"node":"attribute4","output":"val"}],"connection_points":{"in":[{"name":"add0","type":"vec3"},{"name":"add1","type":"vec3"},{"name":"add2","type":"vec3"}],"out":[{"name":"sum","type":"vec3"}]}},"add4":{"type":"add","params":{"add0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"add1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"add2":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":true}}},"maxInputsCount":3,"inputs":[{"index":0,"node":"multScalar2","output":"val"},{"index":1,"node":"subnet_rotation","output":"input1"}],"connection_points":{"in":[{"name":"add0","type":"vec3"},{"name":"add1","type":"vec3"},{"name":"add2","type":"vec3"}],"out":[{"name":"sum","type":"vec3"}]}},"attribute1":{"type":"attribute","params":{"name":"piececentroid","type":2},"connection_points":{"in":[],"out":[{"name":"val","type":"vec3"}]}},"attribute2":{"type":"attribute","params":{"name":"objectcentroid","type":2},"connection_points":{"in":[],"out":[{"name":"val","type":"vec3"}]}},"attribute3":{"type":"attribute","params":{"name":"inside"},"connection_points":{"in":[],"out":[{"name":"val","type":"float"}]}},"attribute4":{"type":"attribute","params":{"name":"piececentroid","type":2},"connection_points":{"in":[],"out":[{"name":"val","type":"vec3"}]}},"attribute5":{"type":"attribute","params":{"name":"objectcentroid","type":2},"connection_points":{"in":[],"out":[{"name":"val","type":"vec3"}]}},"clamp1":{"type":"clamp","params":{"value":{"type":"float","default_value":0,"options":{"spare":true,"editable":false}},"min":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}},"max":{"type":"float","default_value":1,"options":{"spare":true,"editable":true}}},"inputs":[{"index":0,"node":"complement1","output":"val"}],"connection_points":{"in":[{"name":"value","type":"float"},{"name":"min","type":"float"},{"name":"max","type":"float"}],"out":[{"name":"val","type":"float"}]}},"complement1":{"type":"complement","params":{"in":{"type":"float","default_value":0,"options":{"spare":true,"editable":false}}},"inputs":[{"index":0,"node":"distance1","output":"val"}],"connection_points":{"in":[{"name":"in","type":"float"}],"out":[{"name":"val","type":"float"}]}},"constant1":{"type":"constant","connection_points":{"in":[],"out":[{"name":"val","type":"float"}]}},"distance1":{"type":"distance","params":{"p0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"p1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}}},"inputs":[{"index":0,"node":"floatToVec3_1","output":"vec3"},{"index":1,"node":"attribute1","output":"val"}],"connection_points":{"in":[{"name":"p0","type":"vec3"},{"name":"p1","type":"vec3"}],"out":[{"name":"val","type":"float"}]}},"floatToVec3_1":{"type":"floatToVec3","params":{"x":{"overriden_options":{}},"y":{"overriden_options":{}},"z":{"overriden_options":{}}},"inputs":[{"index":0,"node":"vec3ToFloat1","output":"x"},{"index":1,"node":"vec3ToFloat1","output":"y"},{"index":2,"node":"vec3ToFloat1","output":"z"}]},"floatToVec3_2":{"type":"floatToVec3","params":{"x":{"overriden_options":{}},"y":{"overriden_options":{}},"z":{"overriden_options":{}}},"inputs":[null,{"index":1,"node":"vec3ToFloat2","output":"y"}]},"floatToVec3_3":{"type":"floatToVec3","params":{"x":{"overriden_options":{}},"y":{"raw_input":1.8,"overriden_options":{}},"z":{"overriden_options":{}}},"inputs":[{"index":0,"node":"vec3ToFloat3","output":"x"},null,{"index":2,"node":"vec3ToFloat3","output":"z"}]},"floatToVec3_4":{"type":"floatToVec3","params":{"x":{"overriden_options":{}},"y":{"overriden_options":{}},"z":{"overriden_options":{}}},"inputs":[{"index":0,"node":"vec3ToFloat4","output":"x"},{"index":1,"node":"vec3ToFloat4","output":"y"},{"index":2,"node":"vec3ToFloat4","output":"z"}]},"floatToVec3_5":{"type":"floatToVec3","params":{"x":{"overriden_options":{}},"y":{"overriden_options":{}},"z":{"overriden_options":{}}},"inputs":[{"index":0,"node":"vec3ToFloat5","output":"x"},{"index":1,"node":"max1","output":"val"},{"index":2,"node":"vec3ToFloat5","output":"z"}]},"globals1":{"type":"globals"},"max1":{"type":"max","params":{"in0":{"type":"float","default_value":0,"options":{"spare":true,"editable":false}},"in1":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}}},"inputs":[{"index":0,"node":"vec3ToFloat5","output":"y"}],"connection_points":{"in":[{"name":"in0","type":"float"},{"name":"in1","type":"float"}],"out":[{"name":"val","type":"float"}]}},"mult1":{"type":"mult","params":{"mult0":{"type":"vector3","default_value":[1,1,1],"options":{"spare":true,"editable":false}},"mult1":{"type":"vector3","default_value":[1,1,1],"options":{"spare":true,"editable":true},"raw_input":[1,0.30000000000000004,1]}},"inputs":[{"index":0,"node":"subtract2","output":"subtract"}],"connection_points":{"in":[{"name":"mult0","type":"vec3"},{"name":"mult1","type":"vec3"}],"out":[{"name":"product","type":"vec3"}]}},"multAdd1":{"type":"multAdd","params":{"value":{"type":"float","default_value":0,"options":{"spare":true,"editable":false}},"preAdd":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}},"mult":{"type":"float","default_value":1,"options":{"spare":true,"editable":true}},"postAdd":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}}},"inputs":[{"index":0,"node":"clamp1","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"}]}},"multAdd2":{"type":"multAdd","params":{"value":{"type":"float","default_value":0,"options":{"spare":true,"editable":false}},"preAdd":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}},"mult":{"type":"float","default_value":1,"options":{"spare":true,"editable":true}},"postAdd":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}}},"inputs":[{"index":0,"node":"multAdd1","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"}]}},"multAdd3":{"type":"multAdd","params":{"value":{"type":"float","default_value":0,"options":{"spare":true,"editable":false}},"preAdd":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}},"mult":{"type":"float","default_value":1,"options":{"spare":true,"editable":true},"raw_input":3},"postAdd":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}}},"inputs":[{"index":0,"node":"multAdd1","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"}]}},"multScalar1":{"type":"multScalar","params":{"value":{"type":"vector3","default_value":[1,1,1],"options":{"spare":true,"editable":false}},"mult":{"type":"float","default_value":1,"options":{"spare":true,"editable":false},"raw_input":1.5}},"inputs":[{"index":0,"node":"subtract2","output":"subtract"},{"index":1,"node":"multAdd2","output":"val"}],"connection_points":{"in":[{"name":"value","type":"vec3"},{"name":"mult","type":"float"}],"out":[{"name":"val","type":"vec3"}]}},"multScalar2":{"type":"multScalar","params":{"value":{"type":"vector3","default_value":[1,1,1],"options":{"spare":true,"editable":false}},"mult":{"type":"float","default_value":1,"options":{"spare":true,"editable":false}}},"inputs":[{"index":0,"node":"floatToVec3_5","output":"vec3"},{"index":1,"node":"multAdd3","output":"val"}],"connection_points":{"in":[{"name":"value","type":"vec3"},{"name":"mult","type":"float"}],"out":[{"name":"val","type":"vec3"}]}},"normalize1":{"type":"normalize","params":{"in":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}}},"inputs":[{"index":0,"node":"subtract2","output":"subtract"}],"connection_points":{"in":[{"name":"in","type":"vec3"}],"out":[{"name":"normalized","type":"vec3"}]}},"null1":{"type":"null","params":{"in":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}}},"inputs":[{"index":0,"node":"floatToVec3_4","output":"vec3"}],"connection_points":{"in":[{"name":"in","type":"vec3"}],"out":[{"name":"val","type":"vec3"}]}},"output1":{"type":"output","inputs":[null,null,null,null,null,{"index":5,"node":"constant1","output":"val"}]},"param1":{"type":"param","params":{"name":"cursor","type":4},"connection_points":{"in":[],"out":[{"name":"val","type":"vec3"}]}},"smoothstep1":{"type":"smoothstep","params":{"edge0":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}},"edge1":{"type":"float","default_value":1,"options":{"spare":true,"editable":true},"raw_input":0.46},"x":{"type":"float","default_value":0,"options":{"spare":true,"editable":false}}},"inputs":[null,null,{"index":2,"node":"attribute3","output":"val"}],"connection_points":{"in":[{"name":"edge0","type":"float"},{"name":"edge1","type":"float"},{"name":"x","type":"float"}],"out":[{"name":"val","type":"float"}]}},"subnet_rotation":{"type":"subnet","nodes":{"attribute4":{"type":"attribute","params":{"name":"piececentroid","type":2},"connection_points":{"in":[],"out":[{"name":"val","type":"vec3"}]}},"constant_UP":{"type":"constant","params":{"type":4,"vec3":[0,1,0]},"connection_points":{"in":[],"out":[{"name":"val","type":"vec3"}]}},"cross1":{"type":"cross","params":{"x":{"overriden_options":{}},"y":{"overriden_options":{}}},"inputs":[{"index":0,"node":"constant_UP","output":"val"},{"index":1,"node":"normalize1","output":"normalized"}]},"length1":{"type":"length","params":{"x":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}}},"inputs":[{"index":0,"node":"subnetInput1","output":"input1"}],"connection_points":{"in":[{"name":"x","type":"vec3"}],"out":[{"name":"val","type":"float"}]}},"max1":{"type":"max","params":{"in0":{"type":"float","default_value":0,"options":{"spare":true,"editable":false}},"in1":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}}},"inputs":[{"index":0,"node":"multAdd3","output":"val"}],"connection_points":{"in":[{"name":"in0","type":"float"},{"name":"in1","type":"float"}],"out":[{"name":"val","type":"float"}]}},"multAdd3":{"type":"multAdd","params":{"value":{"type":"float","default_value":0,"options":{"spare":true,"editable":false}},"preAdd":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}},"mult":{"type":"float","default_value":1,"options":{"spare":true,"editable":true},"raw_input":4},"postAdd":{"type":"float","default_value":0,"options":{"spare":true,"editable":true},"raw_input":-0.5}},"inputs":[{"index":0,"node":"subnetInput1","output":"input0"}],"connection_points":{"in":[{"name":"value","type":"float"},{"name":"preAdd","type":"float"},{"name":"mult","type":"float"},{"name":"postAdd","type":"float"}],"out":[{"name":"val","type":"float"}]}},"multScalar1":{"type":"multScalar","params":{"value":{"type":"vector3","default_value":[1,1,1],"options":{"spare":true,"editable":false}},"mult":{"type":"float","default_value":1,"options":{"spare":true,"editable":false}}},"inputs":[{"index":0,"node":"rotate1","output":"val"},{"index":1,"node":"length1","output":"val"}],"connection_points":{"in":[{"name":"value","type":"vec3"},{"name":"mult","type":"float"}],"out":[{"name":"val","type":"vec3"}]}},"normalize1":{"type":"normalize","params":{"in":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}}},"inputs":[{"index":0,"node":"attribute4","output":"val"}],"connection_points":{"in":[{"name":"in","type":"vec3"}],"out":[{"name":"normalized","type":"vec3"}]}},"normalize2":{"type":"normalize","params":{"in":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}}},"inputs":[{"index":0,"node":"cross1","output":"cross"}],"connection_points":{"in":[{"name":"in","type":"vec3"}],"out":[{"name":"normalized","type":"vec3"}]}},"normalize3":{"type":"normalize","params":{"in":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}}},"inputs":[{"index":0,"node":"subnetInput1","output":"input1"}],"connection_points":{"in":[{"name":"in","type":"vec3"}],"out":[{"name":"normalized","type":"vec3"}]}},"rotate1":{"type":"rotate","params":{"vector":{"type":"vector3","default_value":[0,0,1],"options":{"spare":true,"editable":false}},"axis":{"type":"vector3","default_value":[0,1,0],"options":{"spare":true,"editable":false},"raw_input":[0,0,1]},"angle":{"type":"float","default_value":0,"options":{"spare":true,"editable":false},"raw_input":-3.2}},"maxInputsCount":3,"inputs":[{"index":0,"node":"normalize3","output":"normalized"},{"index":1,"node":"normalize2","output":"normalized"},{"index":2,"node":"max1","output":"val"}],"connection_points":{"in":[{"name":"vector","type":"vec3"},{"name":"axis","type":"vec3"},{"name":"angle","type":"float"}],"out":[{"name":"val","type":"vec3"}]}},"rotate2":{"type":"rotate","params":{"vector":{"type":"vector3","default_value":[0,0,1],"options":{"spare":true,"editable":false}},"axis":{"type":"vector3","default_value":[0,1,0],"options":{"spare":true,"editable":false},"raw_input":[0,0,1]},"angle":{"type":"float","default_value":0,"options":{"spare":true,"editable":false},"raw_input":-3.2}},"maxInputsCount":3,"inputs":[{"index":0,"node":"subnetInput1","output":"input2"},{"index":1,"node":"normalize2","output":"normalized"},{"index":2,"node":"max1","output":"val"}],"connection_points":{"in":[{"name":"vector","type":"vec3"},{"name":"axis","type":"vec3"},{"name":"angle","type":"float"}],"out":[{"name":"val","type":"vec3"}]}},"subnetInput1":{"type":"subnetInput","connection_points":{"in":[],"out":[{"name":"input0","type":"float"},{"name":"input1","type":"vec3"},{"name":"input2","type":"vec3"}]}},"subnetOutput1":{"type":"subnetOutput","inputs":[null,{"index":1,"node":"multScalar1","output":"val"},{"index":2,"node":"rotate2","output":"val"}],"connection_points":{"in":[{"name":"input0","type":"float"},{"name":"input1","type":"vec3"},{"name":"input2","type":"vec3"}],"out":[]}}},"params":{"inputsCount":3,"inputType1":4,"inputType2":4,"input0":{"type":"float","default_value":0,"options":{"spare":true,"editable":false}},"input1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"input2":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}}},"maxInputsCount":3,"inputs":[{"index":0,"node":"multAdd1","output":"val"},{"index":1,"node":"subtract5","output":"subtract"},{"index":2,"node":"globals1","output":"normal"}],"connection_points":{"in":[{"name":"input0","type":"float"},{"name":"input1","type":"vec3"},{"name":"input2","type":"vec3"}],"out":[{"name":"input0","type":"float"},{"name":"input1","type":"vec3"},{"name":"input2","type":"vec3"}]}},"subtract1":{"type":"subtract","params":{"sub0":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}},"sub1":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}}},"connection_points":{"in":[{"name":"sub0","type":"float"},{"name":"sub1","type":"float"}],"out":[{"name":"subtract","type":"float"}]}},"subtract2":{"type":"subtract","params":{"sub0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"sub1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"sub2":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":true}}},"maxInputsCount":3,"inputs":[{"index":0,"node":"null1","output":"val"},{"index":1,"node":"floatToVec3_3","output":"vec3"}],"connection_points":{"in":[{"name":"sub0","type":"vec3"},{"name":"sub1","type":"vec3"},{"name":"sub2","type":"vec3"}],"out":[{"name":"subtract","type":"vec3"}]}},"subtract3":{"type":"subtract","params":{"sub0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"sub1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"sub2":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":true}}},"maxInputsCount":3,"inputs":[{"index":0,"node":"globals1","output":"position"},{"index":1,"node":"null1","output":"val"}],"connection_points":{"in":[{"name":"sub0","type":"vec3"},{"name":"sub1","type":"vec3"},{"name":"sub2","type":"vec3"}],"out":[{"name":"subtract","type":"vec3"}]}},"subtract4":{"type":"subtract","params":{"sub0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"sub1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"sub2":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":true}}},"maxInputsCount":3,"inputs":[{"index":0,"node":"floatToVec3_2","output":"vec3"},{"index":1,"node":"subtract2","output":"subtract"}],"connection_points":{"in":[{"name":"sub0","type":"vec3"},{"name":"sub1","type":"vec3"},{"name":"sub2","type":"vec3"}],"out":[{"name":"subtract","type":"vec3"}]}},"subtract5":{"type":"subtract","params":{"sub0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"sub1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"sub2":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":true}}},"maxInputsCount":3,"inputs":[{"index":0,"node":"globals1","output":"position"},{"index":1,"node":"attribute4","output":"val"}],"connection_points":{"in":[{"name":"sub0","type":"vec3"},{"name":"sub1","type":"vec3"},{"name":"sub2","type":"vec3"}],"out":[{"name":"subtract","type":"vec3"}]}},"vec3ToFloat1":{"type":"vec3ToFloat","params":{"vec":{"overriden_options":{}}},"inputs":[{"index":0,"node":"param1","output":"val"}]},"vec3ToFloat2":{"type":"vec3ToFloat","params":{"vec":{"overriden_options":{}}},"inputs":[{"index":0,"node":"attribute1","output":"val"}]},"vec3ToFloat3":{"type":"vec3ToFloat","params":{"vec":{"overriden_options":{}}},"inputs":[{"index":0,"node":"attribute2","output":"val"}]},"vec3ToFloat4":{"type":"vec3ToFloat","params":{"vec":{"overriden_options":{}}},"inputs":[{"index":0,"node":"attribute1","output":"val"}]},"vec3ToFloat5":{"type":"vec3ToFloat","params":{"vec":{"overriden_options":{}}},"inputs":[{"index":0,"node":"mult1","output":"product"}]}},"params":{"useEnvMap":true,"envMap":"../../../COP/envMap","roughness":0,"cursor":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"computeOnDirty":true,"cook":false,"dependentOnFoundNode":true},"raw_input":[6.570691958160555,-3.5966340156836747,0],"overriden_options":{"callback":"{}"}}},"persisted_config":{"material":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/geo1/MAT/meshPhysicalBuilder2-main","type":"MeshPhysicalMaterial","name":"/geo1/MAT/meshPhysicalBuilder2","color":16777215,"roughness":0,"metalness":1,"sheen":0,"sheenColor":0,"sheenRoughness":1,"emissive":0,"specularIntensity":1,"specularColor":16777215,"clearcoat":0,"clearcoatRoughness":0,"envMapIntensity":1,"reflectivity":0.49999999999999983,"transmission":0,"thickness":0.01,"attenuationDistance":0,"attenuationColor":16777215,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},"onBeforeCompileDataJSON":{"vertexShader":"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\n\n\n\t// /geo1/MAT/meshPhysicalBuilder2/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 <morphcolor_vertex>\n// removed:\n//\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n// removed:\n//\t#include <begin_vertex>\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\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}","fragmentShader":"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULARINTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n\t#ifdef USE_SPECULARCOLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEENCOLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\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 <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nstruct SSSModel {\n\tbool isActive;\n\tvec3 color;\n\tfloat thickness;\n\tfloat power;\n\tfloat scale;\n\tfloat distortion;\n\tfloat ambient;\n\tfloat attenuation;\n};\n\nvoid RE_Direct_Scattering(\n\tconst in IncidentLight directLight,\n\tconst in GeometricContext geometry,\n\tconst in SSSModel sssModel,\n\tinout ReflectedLight reflectedLight\n\t){\n\tvec3 scatteringHalf = normalize(directLight.direction + (geometry.normal * sssModel.distortion));\n\tfloat scatteringDot = pow(saturate(dot(geometry.viewDir, -scatteringHalf)), sssModel.power) * sssModel.scale;\n\tvec3 scatteringIllu = (scatteringDot + sssModel.ambient) * (sssModel.color * (1.0-sssModel.thickness));\n\treflectedLight.directDiffuse += scatteringIllu * sssModel.attenuation * directLight.color;\n}\n\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\n\n\t// /geo1/MAT/meshPhysicalBuilder2/constant1\n\tfloat v_POLY_constant1_val = 0.0;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder2/output1\n\tfloat POLY_metalness = v_POLY_constant1_val;\n\tfloat POLY_roughness = 1.0;\n\tvec3 POLY_emissive = vec3(1.0, 1.0, 1.0);\n\tSSSModel POLY_SSSModel = SSSModel(/*isActive*/false,/*color*/vec3(1.0, 1.0, 1.0), /*thickness*/0.1, /*power*/2.0, /*scale*/16.0, /*distortion*/0.1,/*ambient*/0.4,/*attenuation*/0.8 );\n\tfloat POLY_transmission = 1.0;\n\tfloat POLY_thickness = 1.0;\n\n\n\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive * POLY_emissive;\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\tfloat roughnessFactor = roughness * POLY_roughness;\n\n#ifdef USE_ROUGHNESSMAP\n\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\n\t// reads channel G, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\n\troughnessFactor *= texelRoughness.g;\n\n#endif\n\n\tfloat metalnessFactor = metalness * POLY_metalness;\n\n#ifdef USE_METALNESSMAP\n\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\n\t// reads channel B, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\n\tmetalnessFactor *= texelMetalness.b;\n\n#endif\n\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\nif(POLY_SSSModel.isActive){\n\tRE_Direct_Scattering(directLight, geometry, POLY_SSSModel, reflectedLight);\n}\n\n\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t\n#ifdef USE_TRANSMISSION\n\n\tfloat transmissionAlpha = 1.0;\nfloat transmissionFactor = transmission * POLY_transmission;\nfloat thicknessFactor = thickness * POLY_thickness;\n\n\t#ifdef USE_TRANSMISSIONMAP\n\n\t\ttransmissionFactor *= texture2D( transmissionMap, vUv ).r;\n\n\t#endif\n\n\t#ifdef USE_THICKNESSMAP\n\n\t\tthicknessFactor *= texture2D( thicknessMap, vUv ).g;\n\n\t#endif\n\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\n\tvec4 transmission = getIBLVolumeRefraction(\n\t\tn, v, roughnessFactor, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor,\n\t\tattenuationColor, attenuationDistance );\n\n\ttotalDiffuse = mix( totalDiffuse, transmission.rgb, transmissionFactor );\n\ttransmissionAlpha = mix( transmissionAlpha, transmission.a, transmissionFactor );\n#endif\n\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;\n\t#endif\n\t#include <output_fragment>\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}","timeDependent":false,"resolutionDependent":false,"paramConfigs":[{"type":"vector3","name":"cursor","defaultValue":[0,0,0],"uniformName":"v_POLY_param_cursor"}]},"customMaterials":{"customDepthMaterial":{"material":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/geo1/MAT/meshPhysicalBuilder2-customDepthMaterial","type":"MeshDepthMaterial","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,"depthPacking":3201},"onBeforeCompileDataJSON":{"vertexShader":"#include <common>\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>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n// removed:\n//\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n// removed:\n//\t#include <begin_vertex>\n\n\n\n\t// /geo1/MAT/meshPhysicalBuilder2/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\tvHighPrecisionZW = gl_Position.zw;\n}","fragmentShader":"\n// INSERT DEFINES\n\n\n#if DEPTH_PACKING == 3200\n\n\tuniform float opacity;\n\n#endif\n\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvarying vec2 vHighPrecisionZW;\n\nstruct SSSModel {\n\tbool isActive;\n\tvec3 color;\n\tfloat thickness;\n\tfloat power;\n\tfloat scale;\n\tfloat distortion;\n\tfloat ambient;\n\tfloat attenuation;\n};\n\nvoid RE_Direct_Scattering(\n\tconst in IncidentLight directLight,\n\tconst in GeometricContext geometry,\n\tconst in SSSModel sssModel,\n\tinout ReflectedLight reflectedLight\n\t){\n\tvec3 scatteringHalf = normalize(directLight.direction + (geometry.normal * sssModel.distortion));\n\tfloat scatteringDot = pow(saturate(dot(geometry.viewDir, -scatteringHalf)), sssModel.power) * sssModel.scale;\n\tvec3 scatteringIllu = (scatteringDot + sssModel.ambient) * (sssModel.color * (1.0-sssModel.thickness));\n\treflectedLight.directDiffuse += scatteringIllu * sssModel.attenuation * directLight.color;\n}\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( 1.0 );\n\n\t#if DEPTH_PACKING == 3200\n\n\t\tdiffuseColor.a = opacity;\n\n\t#endif\n\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\n\n\n\t// /geo1/MAT/meshPhysicalBuilder2/constant1\n\tfloat v_POLY_constant1_val = 0.0;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder2/output1\n\tfloat POLY_metalness = v_POLY_constant1_val;\n\tfloat POLY_roughness = 1.0;\n\tvec3 POLY_emissive = vec3(1.0, 1.0, 1.0);\n\tSSSModel POLY_SSSModel = SSSModel(/*isActive*/false,/*color*/vec3(1.0, 1.0, 1.0), /*thickness*/0.1, /*power*/2.0, /*scale*/16.0, /*distortion*/0.1,/*ambient*/0.4,/*attenuation*/0.8 );\n\tfloat POLY_transmission = 1.0;\n\tfloat POLY_thickness = 1.0;\n\n\n\n\n\t// INSERT BODY\n\t// the new body lines should be added before the alphatest_fragment\n\t// so that alpha is set before (which is really how it would be set if the alphamap_fragment above was used by the material node parameters)\n\n\t#include <alphatest_fragment>\n\n\t#include <logdepthbuf_fragment>\n\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 ), diffuseColor.a );\n\n\t#elif DEPTH_PACKING == 3201\n\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\n\t#endif\n\n}\n","timeDependent":false,"resolutionDependent":false,"paramConfigs":[{"type":"vector3","name":"cursor","defaultValue":[0,0,0],"uniformName":"v_POLY_param_cursor"}]}},"customDistanceMaterial":{"material":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/geo1/MAT/meshPhysicalBuilder2-customDistanceMaterial","type":"MeshDistanceMaterial","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},"onBeforeCompileDataJSON":{"vertexShader":"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\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>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n// removed:\n//\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n// removed:\n//\t#include <begin_vertex>\n\n\n\n\t// /geo1/MAT/meshPhysicalBuilder2/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\tvWorldPosition = worldPosition.xyz;\n}","fragmentShader":"\n// INSERT DEFINES\n\n#define DISTANCE\n\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nstruct SSSModel {\n\tbool isActive;\n\tvec3 color;\n\tfloat thickness;\n\tfloat power;\n\tfloat scale;\n\tfloat distortion;\n\tfloat ambient;\n\tfloat attenuation;\n};\n\nvoid RE_Direct_Scattering(\n\tconst in IncidentLight directLight,\n\tconst in GeometricContext geometry,\n\tconst in SSSModel sssModel,\n\tinout ReflectedLight reflectedLight\n\t){\n\tvec3 scatteringHalf = normalize(directLight.direction + (geometry.normal * sssModel.distortion));\n\tfloat scatteringDot = pow(saturate(dot(geometry.viewDir, -scatteringHalf)), sssModel.power) * sssModel.scale;\n\tvec3 scatteringIllu = (scatteringDot + sssModel.ambient) * (sssModel.color * (1.0-sssModel.thickness));\n\treflectedLight.directDiffuse += scatteringIllu * sssModel.attenuation * directLight.color;\n}\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( 1.0 );\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\n\n\n\t// /geo1/MAT/meshPhysicalBuilder2/constant1\n\tfloat v_POLY_constant1_val = 0.0;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder2/output1\n\tfloat POLY_metalness = v_POLY_constant1_val;\n\tfloat POLY_roughness = 1.0;\n\tvec3 POLY_emissive = vec3(1.0, 1.0, 1.0);\n\tSSSModel POLY_SSSModel = SSSModel(/*isActive*/false,/*color*/vec3(1.0, 1.0, 1.0), /*thickness*/0.1, /*power*/2.0, /*scale*/16.0, /*distortion*/0.1,/*ambient*/0.4,/*attenuation*/0.8 );\n\tfloat POLY_transmission = 1.0;\n\tfloat POLY_thickness = 1.0;\n\n\n\n\n\t// INSERT BODY\n\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","timeDependent":false,"resolutionDependent":false,"paramConfigs":[{"type":"vector3","name":"cursor","defaultValue":[0,0,0],"uniformName":"v_POLY_param_cursor"}]}},"customDepthDOFMaterial":{"material":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/geo1/MAT/meshPhysicalBuilder2-customDepthDOFMaterial","type":"MeshDepthMaterial","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,"depthPacking":3200},"onBeforeCompileDataJSON":{"vertexShader":"#include <common>\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>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n// removed:\n//\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n// removed:\n//\t#include <begin_vertex>\n\n\n\n\t// /geo1/MAT/meshPhysicalBuilder2/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\tvHighPrecisionZW = gl_Position.zw;\n}","fragmentShader":"\n// INSERT DEFINES\n\n\n#if DEPTH_PACKING == 3200\n\n\tuniform float opacity;\n\n#endif\n\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvarying vec2 vHighPrecisionZW;\n\nstruct SSSModel {\n\tbool isActive;\n\tvec3 color;\n\tfloat thickness;\n\tfloat power;\n\tfloat scale;\n\tfloat distortion;\n\tfloat ambient;\n\tfloat attenuation;\n};\n\nvoid RE_Direct_Scattering(\n\tconst in IncidentLight directLight,\n\tconst in GeometricContext geometry,\n\tconst in SSSModel sssModel,\n\tinout ReflectedLight reflectedLight\n\t){\n\tvec3 scatteringHalf = normalize(directLight.direction + (geometry.normal * sssModel.distortion));\n\tfloat scatteringDot = pow(saturate(dot(geometry.viewDir, -scatteringHalf)), sssModel.power) * sssModel.scale;\n\tvec3 scatteringIllu = (scatteringDot + sssModel.ambient) * (sssModel.color * (1.0-sssModel.thickness));\n\treflectedLight.directDiffuse += scatteringIllu * sssModel.attenuation * directLight.color;\n}\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( 1.0 );\n\n\t#if DEPTH_PACKING == 3200\n\n\t\tdiffuseColor.a = opacity;\n\n\t#endif\n\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\n\n\n\t// /geo1/MAT/meshPhysicalBuilder2/constant1\n\tfloat v_POLY_constant1_val = 0.0;\n\t\n\t// /geo1/MAT/meshPhysicalBuilder2/output1\n\tfloat POLY_metalness = v_POLY_constant1_val;\n\tfloat POLY_roughness = 1.0;\n\tvec3 POLY_emissive = vec3(1.0, 1.0, 1.0);\n\tSSSModel POLY_SSSModel = SSSModel(/*isActive*/false,/*color*/vec3(1.0, 1.0, 1.0), /*thickness*/0.1, /*power*/2.0, /*scale*/16.0, /*distortion*/0.1,/*ambient*/0.4,/*attenuation*/0.8 );\n\tfloat POLY_transmission = 1.0;\n\tfloat POLY_thickness = 1.0;\n\n\n\n\n\t// INSERT BODY\n\t// the new body lines should be added before the alphatest_fragment\n\t// so that alpha is set before (which is really how it would be set if the alphamap_fragment above was used by the material node parameters)\n\n\t#include <alphatest_fragment>\n\n\t#include <logdepthbuf_fragment>\n\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 ), diffuseColor.a );\n\n\t#elif DEPTH_PACKING == 3201\n\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\n\t#endif\n\n}\n","timeDependent":false,"resolutionDependent":false,"paramConfigs":[{"type":"vector3","name":"cursor","defaultValue":[0,0,0],"uniformName":"v_POLY_param_cursor"}]}}}}},"meshStandard1":{"type":"meshStandard","params":{"useMap":true,"map":"../../../COP/imageUv","useEnvMap":true,"envMap":"../../../COP/envMap","roughness":0.07}},"meshStandard2":{"type":"meshStandard","params":{"useEnvMap":true,"envMap":"../../../COP/envMap","metalness":0,"roughness":0}}}},"attribRename1":{"type":"attribRename","params":{"oldName":"_piececentroid","newName":"piececentroid"},"inputs":["attribRename3"]},"attribRename2":{"type":"attribRename","params":{"oldName":"_inside","newName":"inside"},"inputs":["attribRename1"]},"attribRename3":{"type":"attribRename","params":{"oldName":"_objectcentroid","newName":"objectcentroid_"},"inputs":["hierarchy1"]},"fileGLTF1":{"type":"fileGLTF","params":{"url":"https://raw.githubusercontent.com/polygonjs/polygonjs-assets/master/models/einstein.glb?timestamp=1648249174134","draco":false}},"fileGLTF2":{"type":"fileGLTF","params":{"url":"https://raw.githubusercontent.com/polygonjs/polygonjs-assets/master/models/beethoven.glb?timestamp=1648249174342","draco":false}},"fileGLTF3":{"type":"fileGLTF","params":{"url":"https://raw.githubusercontent.com/polygonjs/polygonjs-assets/master/models/tennyson.glb?timestamp=1648249174366","draco":false}},"hierarchy1":{"type":"hierarchy","params":{"mode":1},"inputs":["fileGLTF1"]},"hierarchy2":{"type":"hierarchy","params":{"mode":1},"inputs":["fileGLTF2"]},"hierarchy3":{"type":"hierarchy","params":{"mode":1},"inputs":["fileGLTF3"]},"material2":{"type":"material","params":{"material":"../MAT/meshPhysicalBuilder1"},"inputs":["attribRename2"]},"material3":{"type":"material","params":{"material":"../MAT/meshStandard2"},"inputs":["objectProperties2"]},"merge1":{"type":"merge","inputs":["objectProperties1","material3"],"flags":{"display":true}},"merge2":{"type":"merge","inputs":["transform1","transform2"]},"objectProperties1":{"type":"objectProperties","params":{"tname":true,"name":"target"},"inputs":["BVH1"]},"objectProperties2":{"type":"objectProperties","params":{"tcastShadow":true,"treceiveShadow":true},"inputs":["merge2"]},"transform1":{"type":"transform","params":{"applyOn":1,"t":[-3.1023148516872814,0,0],"r":[0,90,0]},"inputs":["hierarchy2"]},"transform2":{"type":"transform","params":{"applyOn":1,"t":[3.1023148516872814,0,0]},"inputs":["hierarchy3"]}},"flags":{"display":true}},"perspectiveCamera1":{"type":"perspectiveCamera","nodes":{"events1":{"type":"eventsNetwork","nodes":{"cameraOrbitControls1":{"type":"cameraOrbitControls","params":{"target":[0.13783518922519142,0.6678109158362788,-6.751451046142794]}}},"selection":["cameraOrbitControls1"]}},"params":{"t":[-1.6426999530838144,1.7024390417199675,8.60364153510559],"r":[-3.854770428936801,-6.599492375593426,-0.44368317716129085],"controls":"./events1/cameraOrbitControls1"},"flags":{"display":true}},"COP":{"type":"copNetwork","nodes":{"envMap":{"type":"envMap","inputs":["imageEnv"]},"image1":{"type":"image","params":{"url":"https://raw.githubusercontent.com/polygonjs/polygonjs-assets/master/textures/resources/polyhaven.com/concrete_floor_painted/2k/diffuse.jpg","tencoding":true,"encoding":3001,"tminFilter":true,"tmagFilter":true,"tanisotropy":true,"useRendererMaxAnisotropy":true}},"imageEnv":{"type":"imageEXR","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}}}},"eventsNetwork1":{"type":"eventsNetwork","nodes":{"animation1":{"type":"animation","params":{"animation":"../../ANIM_cam_left_right/PLAY"},"inputs":[{"index":0,"node":"throttle1","output":"output"}]},"animation2":{"type":"animation","params":{"animation":"../../ANIM_intro/PLAY"},"inputs":[{"index":0,"node":"keyboard1","output":"keypress"}]},"animation3":{"type":"animation","params":{"animation":"../../ANIM_intro/RESET"},"inputs":[{"index":0,"node":"keyboard2","output":"keypress"}]},"keyboard1":{"type":"keyboard","params":{"keydown":false,"keypress":true,"keyCodes":"Digit8"}},"keyboard2":{"type":"keyboard","params":{"keydown":false,"keypress":true,"keyCodes":"Digit9"}},"pointer1":{"type":"pointer","params":{"pointerdown":false,"pointermove":true}},"raycast1":{"type":"raycast","params":{"mouse":[0.9635416666666667,0.9906976744186047],"intersectWith":1,"planeDirection":[0,0,1],"objectMask":"*target","tpositionTarget":true,"position":[-0.051238187307887983,2.42731378064116,0.7774952236311199],"positionTarget":"/geo1/MAT/meshPhysicalBuilder1/cursor"},"inputs":[{"index":0,"node":"pointer1","output":"pointermove"}]},"throttle1":{"type":"throttle","inputs":[{"index":0,"node":"pointer1","output":"pointermove"}]}}},"background":{"type":"geo","nodes":{"COP":{"type":"copNetwork","nodes":{"image_diffuse":{"type":"image","params":{"url":"https://raw.githubusercontent.com/polygonjs/polygonjs-assets/master/textures/stone_brick_wall_001_2k.blend/textures/stone_brick_wall_001_diff_2k.jpg?timestamp=1648248012528","ttransform":true,"repeat":[1.6,1.6]}},"image_displacement":{"type":"image","params":{"url":"https://raw.githubusercontent.com/polygonjs/polygonjs-assets/master/textures/stone_brick_wall_001_2k.blend/textures/stone_brick_wall_001_disp_2k.png?timestamp=1648248012528","ttransform":true,"repeat":[1.6,1.6]}},"image_roughness":{"type":"image","params":{"url":"https://raw.githubusercontent.com/polygonjs/polygonjs-assets/master/textures/stone_brick_wall_001_2k.blend/textures/stone_brick_wall_001_rough_2k.jpg?timestamp=1648248012520","ttransform":true,"repeat":[1.6,1.6]}}}},"MAT":{"type":"materialsNetwork","nodes":{"meshStandard1":{"type":"meshStandard","params":{"useMap":true,"map":"../../COP/image_diffuse","useDisplacementMap":true,"displacementMap":"../../COP/image_displacement","useEnvMap":true,"envMap":"../../../COP/envMap","metalness":0.07,"useRoughnessMap":true,"roughnessMap":"../../COP/image_roughness","useFog":true}}},"selection":["meshStandard1"]},"copy1":{"type":"copy","params":{"count":2,"t":[25,0,0]},"inputs":["transform1"]},"material1":{"type":"material","params":{"material":"../MAT/meshStandard1"},"inputs":["merge2"],"flags":{"display":true}},"merge1":{"type":"merge","inputs":["transform1","uvTransform1","uvTransform3","transform6"]},"merge2":{"type":"merge","params":{"compact":true},"inputs":["transform4","merge1","uvTransform2"]},"plane1":{"type":"plane","params":{"size":[25,25],"stepSize":5,"direction":[0,0,1]}},"transform1":{"type":"transform","params":{"t":[0,0,-2.2033764199496173]},"inputs":["plane1"]},"transform2":{"type":"transform","params":{"t":[25,0,0]},"inputs":["transform1"]},"transform3":{"type":"transform","params":{"t":[0,-25,0]},"inputs":["merge1"]},"transform4":{"type":"transform","params":{"t":[0,25,0]},"inputs":["merge1"]},"transform5":{"type":"transform","params":{"t":[-25,0,0]},"inputs":["transform1"]},"transform6":{"type":"transform","params":{"t":[50,0,0]},"inputs":["transform1"]},"uvTransform1":{"type":"uvTransform","params":{"t":[1,0],"s":[-1,1]},"inputs":["transform2"]},"uvTransform2":{"type":"uvTransform","params":{"t":[1,1],"s":[-1,-1]},"inputs":["transform3"]},"uvTransform3":{"type":"uvTransform","params":{"t":[1,0],"s":[-1,1]},"inputs":["transform5"]}},"flags":{"display":true}},"lights":{"type":"geo","nodes":{"merge1":{"type":"merge","inputs":["polarTransform3","polarTransform2"],"flags":{"display":true}},"polarTransform1":{"type":"polarTransform","params":{"longitude":32.4,"latitude":54,"depth":8.4},"inputs":["spotLight1"]},"polarTransform2":{"type":"polarTransform","params":{"longitude":298.8,"latitude":54,"depth":8.4},"inputs":["spotLight2"]},"polarTransform3":{"type":"polarTransform","params":{"center":[0.1,0,0],"longitude":360,"latitude":54,"depth":8.4},"inputs":["spotLight1"]},"spotLight1":{"type":"spotLight","params":{"penumbra":0.34,"castShadow":true,"shadowBias":0,"tvolumetric":true,"volAttenuation":7.899999999999999,"volAnglePower":42.1}},"spotLight2":{"type":"spotLight","params":{"color":[0.5411764705882353,0.5411764705882353,0.5411764705882353],"penumbra":0.34,"castShadow":true}}},"flags":{"display":true}},"particles":{"type":"geo","nodes":{"MAT":{"type":"materialsNetwork","nodes":{"COP":{"type":"copNetwork","nodes":{"image1":{"type":"image","params":{"url":"https://raw.githubusercontent.com/polygonjs/polygonjs-assets/master/textures/disk.png"}}},"selection":["image1"]},"meshStandard1":{"type":"meshStandard"},"points1":{"type":"points","params":{"transparent":true,"opacity":0.16,"alphaTest":0.08,"useAlphaMap":true,"alphaMap":"../COP/image1"}},"pointsBuilder1":{"type":"pointsBuilder","nodes":{"constant1":{"type":"constant","params":{"float":0.02},"connection_points":{"in":[],"out":[{"name":"val","type":"float"}]}},"disk1":{"type":"disk","params":{"position":{"overriden_options":{}},"center":{"raw_input":[0.5,0.5],"overriden_options":{}},"radius":{"raw_input":0.25,"overriden_options":{}},"feather":{"overriden_options":{}}},"inputs":[{"index":0,"node":"globals1","output":"gl_PointCoord"}]},"globals1":{"type":"globals"},"multAdd1":{"type":"multAdd","params":{"value":{"type":"float","default_value":0,"options":{"spare":true,"editable":false}},"preAdd":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}},"mult":{"type":"float","default_value":1,"options":{"spare":true,"editable":true},"raw_input":0.37},"postAdd":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}}},"inputs":[{"index":0,"node":"disk1","output":"float"}],"connection_points":{"in":[{"name":"value","type":"float"},{"name":"preAdd","type":"float"},{"name":"mult","type":"float"},{"name":"postAdd","type":"float"}],"out":[{"name":"val","type":"float"}]}},"output1":{"type":"output","inputs":[null,null,null,{"index":3,"node":"multAdd1","output":"val"},null,{"index":5,"node":"constant1","output":"val"}]}},"params":{"transparent":true,"depthWrite":false},"persisted_config":{"material":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/particles/MAT/pointsBuilder1-main","type":"PointsMaterial","name":"/particles/MAT/pointsBuilder1","color":16777215,"size":1,"sizeAttenuation":true,"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":false,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},"onBeforeCompileDataJSON":{"vertexShader":"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\n\n\n\t// /particles/MAT/pointsBuilder1/constant1\n\tfloat v_POLY_constant1_val = 0.02;\n\t\n\t// /particles/MAT/pointsBuilder1/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\tgl_PointSize = v_POLY_constant1_val * size * 10.0;\n\n\n\n\t#include <morphcolor_vertex>\n// removed:\n//\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n// removed:\n//\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}","fragmentShader":"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n\n\n\n// /particles/MAT/pointsBuilder1/disk1\nfloat disk_feather(float dist, float radius, float feather){\n\tif(feather <= 0.0){\n\t\tif(dist < radius){return 1.0;}else{return 0.0;}\n\t} else {\n\t\tfloat half_feather = feather * 0.5;\n\t\tif(dist < (radius - half_feather)){\n\t\t\treturn 1.0;\n\t\t} else {\n\t\t\tif(dist > (radius + half_feather)){\n\t\t\t\treturn 0.0;\n\t\t\t} else {\n\t\t\t\tfloat feather_start = (radius - half_feather);\n\t\t\t\tfloat blend = 1.0 - (dist - feather_start) / feather;\n\t\t\t\treturn blend;\n\t\t\t}\n\t\t}\n\t}\n}\n\nfloat disk2d(vec2 pos, vec2 center, float radius, float feather){\n\tfloat dist = distance(pos, center);\n\treturn disk_feather(dist, radius, feather);\n}\n\n// function could be called sphere, but is an overload of disk, and is the same\nfloat disk3d(vec3 pos, vec3 center, float radius, float feather){\n\tfloat dist = distance(pos, center);\n\treturn disk_feather(dist, radius, feather);\n}\n\n\n\n\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\n\n\t// /particles/MAT/pointsBuilder1/globals1\n\tvec2 v_POLY_globals1_gl_PointCoord = gl_PointCoord;\n\t\n\t// /particles/MAT/pointsBuilder1/disk1\n\tfloat v_POLY_disk1_float = disk2d(v_POLY_globals1_gl_PointCoord, vec2(0.5, 0.5), 0.25, 0.1);\n\t\n\t// /particles/MAT/pointsBuilder1/multAdd1\n\tfloat v_POLY_multAdd1_val = (0.37*(v_POLY_disk1_float + 0.0)) + 0.0;\n\t\n\t// /particles/MAT/pointsBuilder1/output1\n\tdiffuseColor.a = v_POLY_multAdd1_val;\n\n\n\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}","timeDependent":false,"resolutionDependent":false,"paramConfigs":[]},"customMaterials":{"customDistanceMaterial":{"material":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/particles/MAT/pointsBuilder1-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":16777215},"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},"alphaTest":{"value":0},"displacementMap":{"value":null},"displacementScale":{"value":1},"displacementBias":{"value":0},"size":{"value":1},"scale":{"value":1}},"defines":{"USE_SIZEATTENUATION":1,"DEPTH_PACKING":3200},"vertexShader":"\nuniform float size;\nuniform float scale;\n#include <common>\n#include <clipping_planes_pars_vertex>\nvarying float vViewZDepth;\n\n// INSERT DEFINES\n\n\n// vHighPrecisionZW is added to match CustomMeshDepth.frag\n// which is itself taken from threejs\nvarying vec2 vHighPrecisionZW;\n\nvoid main() {\n\n\t// INSERT BODY\n\n\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\n\tvViewZDepth = - mvPosition.z;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\n\tvHighPrecisionZW = gl_Position.zw;\n\n}\n","fragmentShader":"\n// INSERT DEFINES\n\n\n#if DEPTH_PACKING == 3200\n\n\tuniform float opacity;\n\n#endif\n\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_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\t#if DEPTH_PACKING == 3200\n\n\t\tdiffuseColor.a = opacity;\n\n\t#endif\n\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\n\t// INSERT BODY\n\t// the new body lines should be added before the alphatest_fragment\n\t// so that alpha is set before (which is really how it would be set if the alphamap_fragment above was used by the material node parameters)\n\n\t#include <alphatest_fragment>\n\n\t#include <logdepthbuf_fragment>\n\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 ), diffuseColor.a );\n\n\t#elif DEPTH_PACKING == 3201\n\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\n\t#endif\n\n}\n","lights":false},"onBeforeCompileDataJSON":{"vertexShader":"\nuniform float size;\nuniform float scale;\n#include <common>\n#include <clipping_planes_pars_vertex>\nvarying float vViewZDepth;\n\n// INSERT DEFINES\n\n\n// vHighPrecisionZW is added to match CustomMeshDepth.frag\n// which is itself taken from threejs\nvarying vec2 vHighPrecisionZW;\n\nvoid main() {\n\n\t// INSERT BODY\n\n\n\n\t// /particles/MAT/pointsBuilder1/constant1\n\tfloat v_POLY_constant1_val = 0.02;\n\t\n\t// /particles/MAT/pointsBuilder1/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\tgl_PointSize = v_POLY_constant1_val * size * 10.0;\n\n\n\n\n\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\n\tvViewZDepth = - mvPosition.z;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\n\tvHighPrecisionZW = gl_Position.zw;\n\n}\n","fragmentShader":"\n// INSERT DEFINES\n\n\n\n// /particles/MAT/pointsBuilder1/disk1\nfloat disk_feather(float dist, float radius, float feather){\n\tif(feather <= 0.0){\n\t\tif(dist < radius){return 1.0;}else{return 0.0;}\n\t} else {\n\t\tfloat half_feather = feather * 0.5;\n\t\tif(dist < (radius - half_feather)){\n\t\t\treturn 1.0;\n\t\t} else {\n\t\t\tif(dist > (radius + half_feather)){\n\t\t\t\treturn 0.0;\n\t\t\t} else {\n\t\t\t\tfloat feather_start = (radius - half_feather);\n\t\t\t\tfloat blend = 1.0 - (dist - feather_start) / feather;\n\t\t\t\treturn blend;\n\t\t\t}\n\t\t}\n\t}\n}\n\nfloat disk2d(vec2 pos, vec2 center, float radius, float feather){\n\tfloat dist = distance(pos, center);\n\treturn disk_feather(dist, radius, feather);\n}\n\n// function could be called sphere, but is an overload of disk, and is the same\nfloat disk3d(vec3 pos, vec3 center, float radius, float feather){\n\tfloat dist = distance(pos, center);\n\treturn disk_feather(dist, radius, feather);\n}\n\n\n\n\n\n\n#if DEPTH_PACKING == 3200\n\n\tuniform float opacity;\n\n#endif\n\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_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\t#if DEPTH_PACKING == 3200\n\n\t\tdiffuseColor.a = opacity;\n\n\t#endif\n\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\n\t// INSERT BODY\n\n\n\n\t// /particles/MAT/pointsBuilder1/globals1\n\tvec2 v_POLY_globals1_gl_PointCoord = gl_PointCoord;\n\t\n\t// /particles/MAT/pointsBuilder1/disk1\n\tfloat v_POLY_disk1_float = disk2d(v_POLY_globals1_gl_PointCoord, vec2(0.5, 0.5), 0.25, 0.1);\n\t\n\t// /particles/MAT/pointsBuilder1/multAdd1\n\tfloat v_POLY_multAdd1_val = (0.37*(v_POLY_disk1_float + 0.0)) + 0.0;\n\t\n\t// /particles/MAT/pointsBuilder1/output1\n\tdiffuseColor.a = v_POLY_multAdd1_val;\n\n\n\n\t// the new body lines should be added before the alphatest_fragment\n\t// so that alpha is set before (which is really how it would be set if the alphamap_fragment above was used by the material node parameters)\n\n\t#include <alphatest_fragment>\n\n\t#include <logdepthbuf_fragment>\n\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 ), diffuseColor.a );\n\n\t#elif DEPTH_PACKING == 3201\n\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\n\t#endif\n\n}\n","timeDependent":false,"resolutionDependent":false,"paramConfigs":[]}},"customDepthMaterial":{"material":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/particles/MAT/pointsBuilder1-customDepthMaterial","type":"ShaderMaterial","name":"customDepthMaterial","side":1,"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":16777215},"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},"alphaTest":{"value":0},"displacementMap":{"value":null},"displacementScale":{"value":1},"displacementBias":{"value":0},"size":{"value":1},"scale":{"value":1}},"defines":{"USE_SIZEATTENUATION":1,"DEPTH_PACKING":3201},"vertexShader":"\nuniform float size;\nuniform float scale;\n#include <common>\n#include <clipping_planes_pars_vertex>\nvarying float vViewZDepth;\n\n// INSERT DEFINES\n\n\n// vHighPrecisionZW is added to match CustomMeshDepth.frag\n// which is itself taken from threejs\nvarying vec2 vHighPrecisionZW;\n\nvoid main() {\n\n\t// INSERT BODY\n\n\n\n\t// /particles/MAT/pointsBuilder1/constant1\n\tfloat v_POLY_constant1_val = 0.02;\n\t\n\t// /particles/MAT/pointsBuilder1/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\tgl_PointSize = v_POLY_constant1_val * size * 10.0;\n\n\n\n\n\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\n\tvViewZDepth = - mvPosition.z;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\n\tvHighPrecisionZW = gl_Position.zw;\n\n}\n","fragmentShader":"\n// INSERT DEFINES\n\n\n\n// /particles/MAT/pointsBuilder1/disk1\nfloat disk_feather(float dist, float radius, float feather){\n\tif(feather <= 0.0){\n\t\tif(dist < radius){return 1.0;}else{return 0.0;}\n\t} else {\n\t\tfloat half_feather = feather * 0.5;\n\t\tif(dist < (radius - half_feather)){\n\t\t\treturn 1.0;\n\t\t} else {\n\t\t\tif(dist > (radius + half_feather)){\n\t\t\t\treturn 0.0;\n\t\t\t} else {\n\t\t\t\tfloat feather_start = (radius - half_feather);\n\t\t\t\tfloat blend = 1.0 - (dist - feather_start) / feather;\n\t\t\t\treturn blend;\n\t\t\t}\n\t\t}\n\t}\n}\n\nfloat disk2d(vec2 pos, vec2 center, float radius, float feather){\n\tfloat dist = distance(pos, center);\n\treturn disk_feather(dist, radius, feather);\n}\n\n// function could be called sphere, but is an overload of disk, and is the same\nfloat disk3d(vec3 pos, vec3 center, float radius, float feather){\n\tfloat dist = distance(pos, center);\n\treturn disk_feather(dist, radius, feather);\n}\n\n\n\n\n\n\n#if DEPTH_PACKING == 3200\n\n\tuniform float opacity;\n\n#endif\n\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_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\t#if DEPTH_PACKING == 3200\n\n\t\tdiffuseColor.a = opacity;\n\n\t#endif\n\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\n\t// INSERT BODY\n\n\n\n\t// /particles/MAT/pointsBuilder1/globals1\n\tvec2 v_POLY_globals1_gl_PointCoord = gl_PointCoord;\n\t\n\t// /particles/MAT/pointsBuilder1/disk1\n\tfloat v_POLY_disk1_float = disk2d(v_POLY_globals1_gl_PointCoord, vec2(0.5, 0.5), 0.25, 0.1);\n\t\n\t// /particles/MAT/pointsBuilder1/multAdd1\n\tfloat v_POLY_multAdd1_val = (0.37*(v_POLY_disk1_float + 0.0)) + 0.0;\n\t\n\t// /particles/MAT/pointsBuilder1/output1\n\tdiffuseColor.a = v_POLY_multAdd1_val;\n\n\n\n\t// the new body lines should be added before the alphatest_fragment\n\t// so that alpha is set before (which is really how it would be set if the alphamap_fragment above was used by the material node parameters)\n\n\t#include <alphatest_fragment>\n\n\t#include <logdepthbuf_fragment>\n\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 ), diffuseColor.a );\n\n\t#elif DEPTH_PACKING == 3201\n\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\n\t#endif\n\n}\n","lights":false},"onBeforeCompileDataJSON":{"vertexShader":"\nuniform float size;\nuniform float scale;\n#include <common>\n#include <clipping_planes_pars_vertex>\nvarying float vViewZDepth;\n\n// INSERT DEFINES\n\n\n// vHighPrecisionZW is added to match CustomMeshDepth.frag\n// which is itself taken from threejs\nvarying vec2 vHighPrecisionZW;\n\nvoid main() {\n\n\t// INSERT BODY\n\n\n\n\t// /particles/MAT/pointsBuilder1/constant1\n\tfloat v_POLY_constant1_val = 0.02;\n\t\n\t// /particles/MAT/pointsBuilder1/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\tgl_PointSize = v_POLY_constant1_val * size * 10.0;\n\n\n\n\n\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\n\tvViewZDepth = - mvPosition.z;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\n\tvHighPrecisionZW = gl_Position.zw;\n\n}\n","fragmentShader":"\n// INSERT DEFINES\n\n\n\n// /particles/MAT/pointsBuilder1/disk1\nfloat disk_feather(float dist, float radius, float feather){\n\tif(feather <= 0.0){\n\t\tif(dist < radius){return 1.0;}else{return 0.0;}\n\t} else {\n\t\tfloat half_feather = feather * 0.5;\n\t\tif(dist < (radius - half_feather)){\n\t\t\treturn 1.0;\n\t\t} else {\n\t\t\tif(dist > (radius + half_feather)){\n\t\t\t\treturn 0.0;\n\t\t\t} else {\n\t\t\t\tfloat feather_start = (radius - half_feather);\n\t\t\t\tfloat blend = 1.0 - (dist - feather_start) / feather;\n\t\t\t\treturn blend;\n\t\t\t}\n\t\t}\n\t}\n}\n\nfloat disk2d(vec2 pos, vec2 center, float radius, float feather){\n\tfloat dist = distance(pos, center);\n\treturn disk_feather(dist, radius, feather);\n}\n\n// function could be called sphere, but is an overload of disk, and is the same\nfloat disk3d(vec3 pos, vec3 center, float radius, float feather){\n\tfloat dist = distance(pos, center);\n\treturn disk_feather(dist, radius, feather);\n}\n\n\n\n\n\n\n#if DEPTH_PACKING == 3200\n\n\tuniform float opacity;\n\n#endif\n\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_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\t#if DEPTH_PACKING == 3200\n\n\t\tdiffuseColor.a = opacity;\n\n\t#endif\n\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\n\t// INSERT BODY\n\n\n\n\t// /particles/MAT/pointsBuilder1/globals1\n\tvec2 v_POLY_globals1_gl_PointCoord = gl_PointCoord;\n\t\n\t// /particles/MAT/pointsBuilder1/disk1\n\tfloat v_POLY_disk1_float = disk2d(v_POLY_globals1_gl_PointCoord, vec2(0.5, 0.5), 0.25, 0.1);\n\t\n\t// /particles/MAT/pointsBuilder1/multAdd1\n\tfloat v_POLY_multAdd1_val = (0.37*(v_POLY_disk1_float + 0.0)) + 0.0;\n\t\n\t// /particles/MAT/pointsBuilder1/output1\n\tdiffuseColor.a = v_POLY_multAdd1_val;\n\n\n\n\t// the new body lines should be added before the alphatest_fragment\n\t// so that alpha is set before (which is really how it would be set if the alphamap_fragment above was used by the material node parameters)\n\n\t#include <alphatest_fragment>\n\n\t#include <logdepthbuf_fragment>\n\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 ), diffuseColor.a );\n\n\t#elif DEPTH_PACKING == 3201\n\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\n\t#endif\n\n}\n","timeDependent":false,"resolutionDependent":false,"paramConfigs":[]}},"customDepthDOFMaterial":{"material":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/particles/MAT/pointsBuilder1-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":{"size":{"value":1},"scale":{"value":1},"mNear":{"value":0},"mFar":{"value":10}},"defines":{"USE_SIZEATTENUATION":1},"vertexShader":"\nuniform float size;\nuniform float scale;\n#include <common>\n\nvarying float vViewZDepth;\n\n// INSERT DEFINES\n\n\n\nvoid main() {\n\n\t// INSERT BODY\n\n\n\t#include <project_vertex>\n\n\tvViewZDepth = - mvPosition.z;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\n}\n","fragmentShader":"\nuniform float mNear;\nuniform float mFar;\n\nvarying float vViewZDepth;\n\n// INSERT DEFINES\n\nvoid main() {\n\n\tfloat color = 1.0 - smoothstep( mNear, mFar, vViewZDepth );\n\tgl_FragColor = vec4( vec3( color ), 1.0 );\n\tvec4 diffuseColor = gl_FragColor;\n\n\t// INSERT BODY\n\n\tgl_FragColor.a = diffuseColor.a;\n}\n","lights":false},"onBeforeCompileDataJSON":{"vertexShader":"\nuniform float size;\nuniform float scale;\n#include <common>\n\nvarying float vViewZDepth;\n\n// INSERT DEFINES\n\n\n\nvoid main() {\n\n\t// INSERT BODY\n\n\n\n\t// /particles/MAT/pointsBuilder1/constant1\n\tfloat v_POLY_constant1_val = 0.02;\n\t\n\t// /particles/MAT/pointsBuilder1/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\tgl_PointSize = v_POLY_constant1_val * size * 10.0;\n\n\n\n\n\n\t#include <project_vertex>\n\n\tvViewZDepth = - mvPosition.z;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\n}\n","fragmentShader":"\nuniform float mNear;\nuniform float mFar;\n\nvarying float vViewZDepth;\n\n// INSERT DEFINES\n\nvoid main() {\n\n\tfloat color = 1.0 - smoothstep( mNear, mFar, vViewZDepth );\n\tgl_FragColor = vec4( vec3( color ), 1.0 );\n\tvec4 diffuseColor = gl_FragColor;\n\n\t// INSERT BODY\n\n\tgl_FragColor.a = diffuseColor.a;\n}\n","timeDependent":false,"resolutionDependent":false,"paramConfigs":[]}}}}}},"selection":["pointsBuilder1"]},"bboxScatter1":{"type":"bboxScatter","params":{"stepSize":2.1},"inputs":["transform1"]},"box1":{"type":"box"},"box2":{"type":"box","params":{"center":[0,0,0.5]}},"jitter1":{"type":"jitter","params":{"amount":2.9},"inputs":["bboxScatter1"]},"material1":{"type":"material","params":{"material":"../MAT/pointsBuilder1"},"inputs":["jitter1"],"flags":{"display":true}},"transform1":{"type":"transform","params":{"s":[25,18.4,17]},"inputs":["box2"]}},"flags":{"display":true}},"ANIM_intro":{"type":"animationsNetwork","nodes":{"CONTROLS":{"type":"play","inputs":["RESET","PLAY"]},"PLAY":{"type":"null","inputs":["merge2"]},"RESET":{"type":"null","inputs":["merge1"]},"duration1":{"type":"duration","params":{"duration":9}},"duration2":{"type":"duration","inputs":["propertyValue2"]},"duration3":{"type":"duration","params":{"duration":0.8},"inputs":["propertyValue3"]},"easing1":{"type":"easing","params":{"name":1,"inOut":2},"inputs":["duration1"]},"merge1":{"type":"merge","inputs":["duration2","duration3"]},"merge2":{"type":"merge","inputs":["propertyValue1","propertyValue4"]},"propertyName1":{"type":"propertyName","params":{"name":"rx"},"inputs":["target1"]},"propertyName2":{"type":"propertyName","params":{"name":"depth"},"inputs":["target2"]},"propertyValue1":{"type":"propertyValue","params":{"size":1,"value3":[0,1,0]},"inputs":["propertyName1"]},"propertyValue2":{"type":"propertyValue","params":{"size":1,"value1":-21.5},"inputs":["propertyName1"]},"propertyValue3":{"type":"propertyValue","params":{"size":1,"value1":16},"inputs":["propertyName2"]},"propertyValue4":{"type":"propertyValue","params":{"size":1,"value1":8},"inputs":["propertyName2"]},"target1":{"type":"target","params":{"type":1,"nodePath":"../../null_camRot"},"inputs":["easing1"]},"target2":{"type":"target","params":{"type":1,"nodePath":"../../polarTransform1"},"inputs":["easing1"]}}},"ANIM_cam_left_right":{"type":"animationsNetwork","nodes":{"CONTROLS":{"type":"play","inputs":["RESET","PLAY"]},"PLAY":{"type":"null","inputs":["propertyValue1"]},"RESET":{"type":"null","inputs":["propertyValue2"]},"duration1":{"type":"duration"},"easing1":{"type":"easing","inputs":["duration1"]},"propertyName1":{"type":"propertyName","inputs":["target1"]},"propertyValue1":{"type":"propertyValue","params":{"value3":["ch(\"/eventsNetwork1/raycast1/mousex\")","ch(\"/eventsNetwork1/raycast1/mousey\")",0]},"inputs":["propertyName1"]},"propertyValue2":{"type":"propertyValue","inputs":["propertyName1"]},"target1":{"type":"target","params":{"objectMask":"*/persp*MAIN"}}}}},"params":{"mainCameraPath":"/perspectiveCamera1"},"selection":["geo1"]},"ui":{"nodes":{"hemisphereLight1":{"pos":[250,50]},"polarTransform1":{"pos":[50,0]},"perspectiveCamera_MAIN":{"pos":[50,300]},"null_camRot":{"pos":[50,150]},"geo1":{"pos":[-50,-300],"nodes":{"BVH1":{"pos":[-450,450]},"BVHVisualizer1":{"pos":[-600,550]},"MAT":{"pos":[-750,350],"nodes":{"meshPhysicalBuilder1":{"pos":[0,0],"nodes":{"add1":{"pos":[750,-550]},"add2":{"pos":[250,-550]},"add3":{"pos":[850,250]},"add4":{"pos":[750,-100]},"attribute1":{"pos":[-1800,-450]},"attribute2":{"pos":[-1650,-150]},"attribute3":{"pos":[1000,400]},"attribute4":{"pos":[-250,200]},"attribute5":{"pos":[-700,0]},"clamp1":{"pos":[-650,-800]},"complement1":{"pos":[-800,-800]},"distance1":{"pos":[-950,-800]},"floatToVec3_1":{"pos":[-1250,-900]},"floatToVec3_2":{"pos":[-600,-600]},"floatToVec3_3":{"pos":[-1400,-150]},"floatToVec3_4":{"pos":[-1350,-450]},"floatToVec3_5":{"pos":[-400,-200]},"globals1":{"pos":[-600,200]},"max1":{"pos":[-550,-150]},"mult1":{"pos":[-800,-200]},"multAdd1":{"pos":[-500,-800]},"multAdd2":{"pos":[50,-350]},"multAdd3":{"pos":[-100,-350]},"multScalar1":{"pos":[150,-400]},"multScalar2":{"pos":[50,-200]},"normalize1":{"pos":[-900,0]},"null1":{"pos":[-1250,-450]},"output1":{"pos":[1400,300]},"param1":{"pos":[-1600,-900]},"smoothstep1":{"pos":[1150,400]},"subnet_rotation":{"pos":[100,0],"nodes":{"attribute4":{"pos":[-450,-1050]},"constant_UP":{"pos":[-300,-1250]},"cross1":{"pos":[-50,-1250]},"length1":{"pos":[-50,-550]},"max1":{"pos":[-150,-850]},"multAdd3":{"pos":[-250,-850]},"multScalar1":{"pos":[600,-900]},"normalize1":{"pos":[-250,-1050]},"normalize2":{"pos":[50,-1150]},"normalize3":{"pos":[-100,-950]},"rotate1":{"pos":[200,-1000]},"rotate2":{"pos":[250,-850]},"subnetInput1":{"pos":[-750,-800]},"subnetOutput1":{"pos":[800,-900]}}},"subtract1":{"pos":[-50,-600]},"subtract2":{"pos":[-1100,-300]},"subtract3":{"pos":[-100,-150]},"subtract4":{"pos":[-350,-550]},"subtract5":{"pos":[-100,0]},"vec3ToFloat1":{"pos":[-1450,-900]},"vec3ToFloat2":{"pos":[-800,-600]},"vec3ToFloat3":{"pos":[-1550,-150]},"vec3ToFloat4":{"pos":[-1500,-450]},"vec3ToFloat5":{"pos":[-700,-200]}}},"meshPhysicalBuilder2":{"pos":[0,100],"nodes":{"add1":{"pos":[750,-550]},"add2":{"pos":[250,-550]},"add3":{"pos":[850,250]},"add4":{"pos":[750,-100]},"attribute1":{"pos":[-1800,-450]},"attribute2":{"pos":[-1650,-150]},"attribute3":{"pos":[1000,400]},"attribute4":{"pos":[-250,200]},"attribute5":{"pos":[-700,0]},"clamp1":{"pos":[-650,-800]},"complement1":{"pos":[-800,-800]},"constant1":{"pos":[1100,300]},"distance1":{"pos":[-950,-800]},"floatToVec3_1":{"pos":[-1250,-900]},"floatToVec3_2":{"pos":[-600,-600]},"floatToVec3_3":{"pos":[-1400,-150]},"floatToVec3_4":{"pos":[-1350,-450]},"floatToVec3_5":{"pos":[-400,-200]},"globals1":{"pos":[-600,200]},"max1":{"pos":[-550,-150]},"mult1":{"pos":[-800,-200]},"multAdd1":{"pos":[-500,-800]},"multAdd2":{"pos":[50,-350]},"multAdd3":{"pos":[-100,-350]},"multScalar1":{"pos":[150,-400]},"multScalar2":{"pos":[50,-200]},"normalize1":{"pos":[-900,0]},"null1":{"pos":[-1250,-450]},"output1":{"pos":[1400,300]},"param1":{"pos":[-1600,-900]},"smoothstep1":{"pos":[1150,400]},"subnet_rotation":{"pos":[100,0],"nodes":{"attribute4":{"pos":[-450,-1050]},"constant_UP":{"pos":[-300,-1250]},"cross1":{"pos":[-50,-1250]},"length1":{"pos":[-50,-550]},"max1":{"pos":[-150,-850]},"multAdd3":{"pos":[-250,-850]},"multScalar1":{"pos":[600,-900]},"normalize1":{"pos":[-250,-1050]},"normalize2":{"pos":[50,-1150]},"normalize3":{"pos":[-100,-950]},"rotate1":{"pos":[200,-1000]},"rotate2":{"pos":[250,-850]},"subnetInput1":{"pos":[-750,-800]},"subnetOutput1":{"pos":[800,-900]}}},"subtract1":{"pos":[-50,-600]},"subtract2":{"pos":[-1100,-300]},"subtract3":{"pos":[-100,-150]},"subtract4":{"pos":[-350,-550]},"subtract5":{"pos":[-100,0]},"vec3ToFloat1":{"pos":[-1450,-900]},"vec3ToFloat2":{"pos":[-800,-600]},"vec3ToFloat3":{"pos":[-1550,-150]},"vec3ToFloat4":{"pos":[-1500,-450]},"vec3ToFloat5":{"pos":[-700,-200]}}},"meshStandard1":{"pos":[0,-100]},"meshStandard2":{"pos":[0,250]}}},"attribRename1":{"pos":[-450,150]},"attribRename2":{"pos":[-450,250]},"attribRename3":{"pos":[-450,0]},"fileGLTF1":{"pos":[-450,-400]},"fileGLTF2":{"pos":[-150,-400]},"fileGLTF3":{"pos":[100,-400]},"hierarchy1":{"pos":[-450,-300]},"hierarchy2":{"pos":[-150,-300]},"hierarchy3":{"pos":[100,-300]},"material2":{"pos":[-450,350]},"material3":{"pos":[-150,350]},"merge1":{"pos":[-250,700]},"merge2":{"pos":[-150,150]},"objectProperties1":{"pos":[-450,600]},"objectProperties2":{"pos":[-150,250]},"transform1":{"pos":[-150,-150]},"transform2":{"pos":[100,-150]}}},"perspectiveCamera1":{"pos":[-200,50],"nodes":{"events1":{"pos":[-200,50],"nodes":{"cameraOrbitControls1":{"pos":[150,50]}}}}},"COP":{"pos":[-200,150],"nodes":{"envMap":{"pos":[50,200]},"image1":{"pos":[-350,100]},"imageEnv":{"pos":[50,100]},"imageUv":{"pos":[-100,100]}}},"eventsNetwork1":{"pos":[-200,-50],"nodes":{"animation1":{"pos":[-100,-200]},"animation2":{"pos":[-150,300]},"animation3":{"pos":[-150,450]},"keyboard1":{"pos":[-450,300]},"keyboard2":{"pos":[-450,450]},"pointer1":{"pos":[-400,-50]},"raycast1":{"pos":[-100,-50]},"throttle1":{"pos":[-250,-200]}}},"background":{"pos":[300,-300],"nodes":{"COP":{"pos":[-750,500],"nodes":{"image_diffuse":{"pos":[-550,100]},"image_displacement":{"pos":[-550,300]},"image_roughness":{"pos":[-550,200]}}},"MAT":{"pos":[-750,600],"nodes":{"meshStandard1":{"pos":[0,0]}}},"copy1":{"pos":[-500,250]},"material1":{"pos":[-250,1150]},"merge1":{"pos":[-250,500]},"merge2":{"pos":[-250,950]},"plane1":{"pos":[-250,0]},"transform1":{"pos":[-250,150]},"transform2":{"pos":[-100,250]},"transform3":{"pos":[-100,650]},"transform4":{"pos":[-400,650]},"transform5":{"pos":[150,250]},"transform6":{"pos":[-300,300]},"uvTransform1":{"pos":[-100,350]},"uvTransform2":{"pos":[-100,750]},"uvTransform3":{"pos":[150,350]}}},"lights":{"pos":[300,-200],"nodes":{"merge1":{"pos":[-50,400]},"polarTransform1":{"pos":[-150,200]},"polarTransform2":{"pos":[100,200]},"polarTransform3":{"pos":[-300,200]},"spotLight1":{"pos":[-150,50]},"spotLight2":{"pos":[100,50]}}},"particles":{"pos":[-50,-200],"nodes":{"MAT":{"pos":[-400,400],"nodes":{"COP":{"pos":[-250,250],"nodes":{"image1":{"pos":[-200,200]}}},"meshStandard1":{"pos":[0,0]},"points1":{"pos":[0,250]},"pointsBuilder1":{"pos":[0,150],"nodes":{"constant1":{"pos":[50,250]},"disk1":{"pos":[-200,50]},"globals1":{"pos":[-450,-150]},"multAdd1":{"pos":[-50,50]},"output1":{"pos":[200,0]}}}}},"bboxScatter1":{"pos":[-200,200]},"box1":{"pos":[0,0]},"box2":{"pos":[-200,-150]},"jitter1":{"pos":[-200,300]},"material1":{"pos":[-200,400]},"transform1":{"pos":[-200,50]}}},"ANIM_intro":{"pos":[-200,250],"nodes":{"CONTROLS":{"pos":[-150,1050]},"PLAY":{"pos":[350,850]},"RESET":{"pos":[-300,850]},"duration1":{"pos":[0,0]},"duration2":{"pos":[-350,600]},"duration3":{"pos":[-150,600]},"easing1":{"pos":[0,100]},"merge1":{"pos":[-300,700]},"merge2":{"pos":[350,700]},"propertyName1":{"pos":[0,400]},"propertyName2":{"pos":[250,400]},"propertyValue1":{"pos":[0,500]},"propertyValue2":{"pos":[-300,500]},"propertyValue3":{"pos":[250,500]},"propertyValue4":{"pos":[600,500]},"target1":{"pos":[0,300]},"target2":{"pos":[250,300]}}},"ANIM_cam_left_right":{"pos":[-200,350],"nodes":{"CONTROLS":{"pos":[-150,700]},"PLAY":{"pos":[0,600]},"RESET":{"pos":[-300,600]},"duration1":{"pos":[0,0]},"easing1":{"pos":[0,100]},"propertyName1":{"pos":[0,400]},"propertyValue1":{"pos":[0,500]},"propertyValue2":{"pos":[-300,500]},"target1":{"pos":[0,300]}}}}}}
Code editor
{"multiple_panel":{"split_ratio":0.5,"split_panel0":{"split_ratio":0.5,"split_panel0":{"panelTypes":["viewer"],"currentPanelIndex":0,"panel_data":{"camera":"/perspectiveCamera1","linkIndex":1}},"split_panel1":{"panelTypes":["params"],"currentPanelIndex":0,"panel_data":{"active_folder":137,"linkIndex":1}},"split_mode":"vertical"},"split_panel1":{"panelTypes":["network","params","viewer"],"currentPanelIndex":0,"panel_data":{"camera":{"position":{"x":296.1601750768211,"y":-180.6339539206353},"zoom":0.6127543904215144},"history":{"2":{"position":{"x":-64,"y":12},"zoom":0.5555555555555556},"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":296.1601750768211,"y":-180.6339539206353},"zoom":0.6127543904215144},"208":{"position":{"x":244.20000000000005,"y":-512.6},"zoom":0.5555555555555556},"455":{"position":{"x":144.99999999999997,"y":-124.80000000000001},"zoom":0.5555555555555556},"2587":{"position":{"x":400.6,"y":-282},"zoom":0.5555555555555556},"3461":{"position":{"x":250,"y":-950},"zoom":0.5555555555555556},"3487":{"position":{"x":400.6,"y":-285.6},"zoom":0.5555555555555556}},"linkIndex":1}},"split_mode":"horizontal"},"currentNodes":["/geo1","/","/","/","/","/","/","/"],"navigationHistory":{"nodePaths":{"1":["/","/geo1","/","/background","/background/COP","/background","/","/geo1"],"2":["/"],"3":["/"],"4":["/"],"5":["/"],"6":["/"],"7":["/"],"8":["/"]},"index":{"1":7,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0}},"fullscreenPanelId":null,"saveOptions":{"createExport":true,"skipExportSinceRemoteAssetsPresents":false,"compressJs":true,"createZip":false,"publishToIntegrations":false},"paramsModal":[]}
Used nodes
anim/duration;anim/easing;anim/merge;anim/null;anim/play;anim/propertyName;anim/propertyValue;anim/target;cop/envMap;cop/image;cop/imageEXR;event/animation;event/cameraOrbitControls;event/keyboard;event/pointer;event/raycast;event/throttle;mat/copNetwork;mat/meshPhysicalBuilder;mat/meshStandard;mat/points;mat/pointsBuilder;obj/animationsNetwork;obj/copNetwork;obj/eventsNetwork;obj/geo;obj/hemisphereLight;obj/null;obj/perspectiveCamera;obj/polarTransform;sop/BVH;sop/BVHVisualizer;sop/attribRename;sop/bboxScatter;sop/box;sop/copNetwork;sop/copy;sop/eventsNetwork;sop/fileGLTF;sop/hierarchy;sop/jitter;sop/material;sop/materialsNetwork;sop/merge;sop/objectProperties;sop/plane;sop/polarTransform;sop/spotLight;sop/transform;sop/uvTransform
Used operations
Used modules
Used assemblers
GL_MESH_PHYSICAL;GL_POINTS
Used integrations
[]
Used assets
Nodes map
{"/hemisphereLight1":"obj/hemisphereLight","/polarTransform1":"obj/polarTransform","/perspectiveCamera_MAIN":"obj/perspectiveCamera","/null_camRot":"obj/null","/geo1":"obj/geo","/geo1/BVH1":"sop/BVH","/geo1/BVHVisualizer1":"sop/BVHVisualizer","/geo1/MAT":"sop/materialsNetwork","/geo1/MAT/meshPhysicalBuilder1":"mat/meshPhysicalBuilder","/geo1/MAT/meshPhysicalBuilder2":"mat/meshPhysicalBuilder","/geo1/MAT/meshStandard1":"mat/meshStandard","/geo1/MAT/meshStandard2":"mat/meshStandard","/geo1/attribRename1":"sop/attribRename","/geo1/attribRename2":"sop/attribRename","/geo1/attribRename3":"sop/attribRename","/geo1/fileGLTF1":"sop/fileGLTF","/geo1/fileGLTF2":"sop/fileGLTF","/geo1/fileGLTF3":"sop/fileGLTF","/geo1/hierarchy1":"sop/hierarchy","/geo1/hierarchy2":"sop/hierarchy","/geo1/hierarchy3":"sop/hierarchy","/geo1/material2":"sop/material","/geo1/material3":"sop/material","/geo1/merge1":"sop/merge","/geo1/merge2":"sop/merge","/geo1/objectProperties1":"sop/objectProperties","/geo1/objectProperties2":"sop/objectProperties","/geo1/transform1":"sop/transform","/geo1/transform2":"sop/transform","/perspectiveCamera1":"obj/perspectiveCamera","/perspectiveCamera1/events1":"sop/eventsNetwork","/perspectiveCamera1/events1/cameraOrbitControls1":"event/cameraOrbitControls","/COP":"obj/copNetwork","/COP/envMap":"cop/envMap","/COP/image1":"cop/image","/COP/imageEnv":"cop/imageEXR","/COP/imageUv":"cop/image","/eventsNetwork1":"obj/eventsNetwork","/eventsNetwork1/animation1":"event/animation","/eventsNetwork1/animation2":"event/animation","/eventsNetwork1/animation3":"event/animation","/eventsNetwork1/keyboard1":"event/keyboard","/eventsNetwork1/keyboard2":"event/keyboard","/eventsNetwork1/pointer1":"event/pointer","/eventsNetwork1/raycast1":"event/raycast","/eventsNetwork1/throttle1":"event/throttle","/background":"obj/geo","/background/COP":"sop/copNetwork","/background/COP/image_diffuse":"cop/image","/background/COP/image_displacement":"cop/image","/background/COP/image_roughness":"cop/image","/background/MAT":"sop/materialsNetwork","/background/MAT/meshStandard1":"mat/meshStandard","/background/copy1":"sop/copy","/background/material1":"sop/material","/background/merge1":"sop/merge","/background/merge2":"sop/merge","/background/plane1":"sop/plane","/background/transform1":"sop/transform","/background/transform2":"sop/transform","/background/transform3":"sop/transform","/background/transform4":"sop/transform","/background/transform5":"sop/transform","/background/transform6":"sop/transform","/background/uvTransform1":"sop/uvTransform","/background/uvTransform2":"sop/uvTransform","/background/uvTransform3":"sop/uvTransform","/lights":"obj/geo","/lights/merge1":"sop/merge","/lights/polarTransform1":"sop/polarTransform","/lights/polarTransform2":"sop/polarTransform","/lights/polarTransform3":"sop/polarTransform","/lights/spotLight1":"sop/spotLight","/lights/spotLight2":"sop/spotLight","/particles":"obj/geo","/particles/MAT":"sop/materialsNetwork","/particles/MAT/COP":"mat/copNetwork","/particles/MAT/COP/image1":"cop/image","/particles/MAT/meshStandard1":"mat/meshStandard","/particles/MAT/points1":"mat/points","/particles/MAT/pointsBuilder1":"mat/pointsBuilder","/particles/bboxScatter1":"sop/bboxScatter","/particles/box1":"sop/box","/particles/box2":"sop/box","/particles/jitter1":"sop/jitter","/particles/material1":"sop/material","/particles/transform1":"sop/transform","/ANIM_intro":"obj/animationsNetwork","/ANIM_intro/CONTROLS":"anim/play","/ANIM_intro/PLAY":"anim/null","/ANIM_intro/RESET":"anim/null","/ANIM_intro/duration1":"anim/duration","/ANIM_intro/duration2":"anim/duration","/ANIM_intro/duration3":"anim/duration","/ANIM_intro/easing1":"anim/easing","/ANIM_intro/merge1":"anim/merge","/ANIM_intro/merge2":"anim/merge","/ANIM_intro/propertyName1":"anim/propertyName","/ANIM_intro/propertyName2":"anim/propertyName","/ANIM_intro/propertyValue1":"anim/propertyValue","/ANIM_intro/propertyValue2":"anim/propertyValue","/ANIM_intro/propertyValue3":"anim/propertyValue","/ANIM_intro/propertyValue4":"anim/propertyValue","/ANIM_intro/target1":"anim/target","/ANIM_intro/target2":"anim/target","/ANIM_cam_left_right":"obj/animationsNetwork","/ANIM_cam_left_right/CONTROLS":"anim/play","/ANIM_cam_left_right/PLAY":"anim/null","/ANIM_cam_left_right/RESET":"anim/null","/ANIM_cam_left_right/duration1":"anim/duration","/ANIM_cam_left_right/easing1":"anim/easing","/ANIM_cam_left_right/propertyName1":"anim/propertyName","/ANIM_cam_left_right/propertyValue1":"anim/propertyValue","/ANIM_cam_left_right/propertyValue2":"anim/propertyValue","/ANIM_cam_left_right/target1":"anim/target"}
Js version
Editor version
Engine version
Logout
0%
There was a problem displaying your scene:
view scene source