Name
*
Code
{"properties":{"frame":208,"maxFrame":600,"maxFrameLocked":false,"realtimeState":true,"mainCameraPath":"/cameras/cameras:sopGroup/perspectiveCamera_MAIN","versions":{"polygonjs":"1.5.82"}},"root":{"type":"root","nodes":{"geo1":{"type":"geo","nodes":{"icosahedron1":{"type":"icosahedron","params":{"detail":11}},"clothSolver1":{"type":"clothSolver","nodes":{"globals1":{"type":"globals"},"output1":{"type":"output","inputs":[{"index":0,"inputName":"position","node":"globals1","output":"position"}]}},"inputs":["actor_clothSolver1"],"persisted_config":{"texture_allocations":{"writable":[{"position":[{"name":"position","size":3,"nodes":["/geo1/clothSolver1/output1","/geo1/clothSolver1/globals1"]}]}],"readonly":[]},"param_uniform_pairs":[],"uniforms_owner":{"metadata":{"version":4.6,"type":"Material","generator":"Material.toJSON"},"uuid":"/geo1/clothSolver1-main","type":"ShaderMaterial","blendColor":0,"forceSinglePass":true,"fog":false,"glslVersion":null,"uniforms":{},"vertexShader":"void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}","fragmentShader":"void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}","lights":false,"clipping":false}}},"clothPrepare1":{"type":"clothPrepare","inputs":["restAttributes1"]},"material1":{"type":"material","params":{"material":"../MAT/meshPhysical_CLOTH"},"inputs":["clothSolver1"],"flags":{"display":true}},"MAT":{"type":"materialsNetwork","nodes":{"meshPhysical_CLOTH":{"type":"meshPhysicalBuilder","nodes":{"globals1":{"type":"globals"},"output1":{"type":"output","inputs":[{"index":0,"inputName":"position","node":"clothSolverPosition1","output":"position"},null,{"index":2,"inputName":"color","node":"mix1","output":"mix"}]},"clothSolverPosition1":{"type":"clothSolverPosition","params":{"id":{"overriden_options":{}}},"inputs":[{"index":0,"inputName":"id","node":"attribute1","output":"val"}]},"attribute1":{"type":"attribute","params":{"name":"id"},"connection_points":{"in":[],"out":[{"name":"val","type":"float"}]}},"attribute2":{"type":"attribute","params":{"name":"restP","type":2},"connection_points":{"in":[],"out":[{"name":"val","type":"vec3"}]}},"mix1":{"type":"mix","params":{"value0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false,"computeOnDirty":true,"dependentOnFoundParam":false}},"value1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false,"computeOnDirty":true,"dependentOnFoundParam":false}},"blend":{"type":"float","default_value":0.5,"options":{"spare":true,"editable":false,"computeOnDirty":true,"dependentOnFoundParam":false}}},"inputs":[{"index":0,"inputName":"value0","node":"constant2","output":"val"},{"index":1,"inputName":"value1","node":"constant1","output":"val"},{"index":2,"inputName":"blend","node":"mult2","output":"product"}],"connection_points":{"in":[{"name":"value0","type":"vec3"},{"name":"value1","type":"vec3"},{"name":"blend","type":"float"}],"out":[{"name":"mix","type":"vec3"}]}},"constant1":{"type":"constant","params":{"type":4,"color":[1,1,1],"asColor":true},"connection_points":{"in":[],"out":[{"name":"val","type":"vec3"}]}},"constant2":{"type":"constant","params":{"type":4,"color":[0.07036009568874305,0.5906188409113381,0.06662593863608139],"asColor":true},"connection_points":{"in":[],"out":[{"name":"val","type":"vec3"}]}},"vec3ToFloat1":{"type":"vec3ToFloat","params":{"vec":{"overriden_options":{}}},"inputs":[{"index":0,"inputName":"vec","node":"attribute2","output":"val"}]},"floatToVec2_1":{"type":"floatToVec2","params":{"x":{"overriden_options":{}},"y":{"overriden_options":{}}},"inputs":[{"index":0,"inputName":"x","node":"vec3ToFloat1","output":"y"},{"index":1,"inputName":"y","node":"vec3ToFloat1","output":"z"}]},"vec3ToFloat2":{"type":"vec3ToFloat","params":{"vec":{"overriden_options":{}}},"inputs":[{"index":0,"inputName":"vec","node":"attribute2","output":"val"}]},"floatToVec2_2":{"type":"floatToVec2","params":{"x":{"overriden_options":{}},"y":{"overriden_options":{}}},"inputs":[{"index":0,"inputName":"x","node":"vec3ToFloat2","output":"x"},{"index":1,"inputName":"y","node":"vec3ToFloat2","output":"y"}]},"grid1":{"type":"grid","params":{"uv":{"overriden_options":{}},"lineWidth":{"overriden_options":{}},"freq":{"overriden_options":{}},"freqMult":{"raw_input":5.9,"overriden_options":{}}},"inputs":[{"index":0,"inputName":"uv","node":"floatToVec2_1","output":"vec2"},null,null,{"index":3,"inputName":"freqMult","node":"constant3","output":"val"}]},"constant3":{"type":"constant","params":{"float":5},"connection_points":{"in":[],"out":[{"name":"val","type":"float"}]}},"grid2":{"type":"grid","params":{"uv":{"overriden_options":{}},"lineWidth":{"overriden_options":{}},"freq":{"overriden_options":{}},"freqMult":{"raw_input":5.9,"overriden_options":{}}},"inputs":[{"index":0,"inputName":"uv","node":"floatToVec2_2","output":"vec2"},null,null,{"index":3,"inputName":"freqMult","node":"constant3","output":"val"}]},"mult2":{"type":"mult","params":{"mult0":{"type":"float","default_value":1,"options":{"spare":true,"editable":false,"computeOnDirty":true,"dependentOnFoundParam":false}},"mult1":{"type":"float","default_value":1,"options":{"spare":true,"editable":false,"computeOnDirty":true,"dependentOnFoundParam":false}},"mult2":{"type":"float","default_value":1,"options":{"spare":true,"editable":true,"computeOnDirty":true,"dependentOnFoundParam":false}}},"maxInputsCount":3,"inputs":[{"index":0,"inputName":"mult0","node":"grid1","output":"grid"},{"index":1,"inputName":"mult1","node":"grid2","output":"grid"}],"connection_points":{"in":[{"name":"mult0","type":"float"},{"name":"mult1","type":"float"},{"name":"mult2","type":"float"}],"out":[{"name":"product","type":"float"}]}}},"params":{"tSize":{"type":"vector2","default_value":[1,1],"options":{"spare":true,"computeOnDirty":true,"cook":false,"dependentOnFoundNode":true},"overriden_options":{"callback":"{}"}},"tPosition0":{"type":"node_path","default_value":"","options":{"spare":true,"computeOnDirty":true,"cook":false,"dependentOnFoundNode":true,"nodeSelection":{"context":"cop"}},"overriden_options":{"callback":"{}"}},"tPosition1":{"type":"node_path","default_value":"","options":{"spare":true,"computeOnDirty":true,"cook":false,"dependentOnFoundNode":true,"nodeSelection":{"context":"cop"}},"overriden_options":{"callback":"{}"}},"tNormal":{"type":"node_path","default_value":"","options":{"spare":true,"computeOnDirty":true,"cook":false,"dependentOnFoundNode":true,"nodeSelection":{"context":"cop"}},"overriden_options":{"callback":"{}"}}},"persisted_config":{"material":{"metadata":{"version":4.6,"type":"Material","generator":"Material.toJSON"},"uuid":"/geo1/MAT/meshPhysical_CLOTH-main","type":"MeshPhysicalMaterial","color":16777215,"roughness":1,"metalness":0,"sheen":0,"sheenColor":0,"sheenRoughness":1,"emissive":0,"specularIntensity":1,"specularColor":16777215,"clearcoat":0,"clearcoatRoughness":0,"iridescence":0,"iridescenceIOR":1.3,"iridescenceThicknessRange":[100,400],"anisotropy":0,"anisotropyRotation":0,"envMapIntensity":1,"reflectivity":0.49999999999999983,"transmission":0,"thickness":0.01,"attenuationDistance":100,"attenuationColor":16777215,"blendColor":0,"fog":false},"onBeforeCompileDataJSONWithoutShaders":{"paramConfigs":[{"type":"vector2","name":"tSize","defaultValue":[1,1],"uniformName":"v_POLY_param_tSize"},{"type":"node_path","name":"tPosition0","defaultValue":"","uniformName":"v_POLY_texture_tPosition0"},{"type":"node_path","name":"tPosition1","defaultValue":"","uniformName":"v_POLY_texture_tPosition1"},{"type":"node_path","name":"tNormal","defaultValue":"","uniformName":"v_POLY_texture_tNormal"}],"timeDependent":false,"resolutionDependent":false,"raymarchingLightsWorldCoordsDependent":false},"customMaterials":{"customDepthMaterial":{"material":{"metadata":{"version":4.6,"type":"Material","generator":"Material.toJSON"},"uuid":"/geo1/MAT/meshPhysical_CLOTH-customDepthMaterial","type":"MeshDepthMaterial","name":"customDepthMaterial","side":1,"blendColor":0,"depthPacking":3201},"onBeforeCompileDataJSONWithoutShaders":{"paramConfigs":[{"type":"vector2","name":"tSize","defaultValue":[1,1],"uniformName":"v_POLY_param_tSize"},{"type":"node_path","name":"tPosition0","defaultValue":"","uniformName":"v_POLY_texture_tPosition0"},{"type":"node_path","name":"tPosition1","defaultValue":"","uniformName":"v_POLY_texture_tPosition1"},{"type":"node_path","name":"tNormal","defaultValue":"","uniformName":"v_POLY_texture_tNormal"}],"timeDependent":false,"resolutionDependent":false,"raymarchingLightsWorldCoordsDependent":false}},"customDistanceMaterial":{"material":{"metadata":{"version":4.6,"type":"Material","generator":"Material.toJSON"},"uuid":"/geo1/MAT/meshPhysical_CLOTH-customDistanceMaterial","type":"MeshDistanceMaterial","name":"customDistanceMaterial","blendColor":0},"onBeforeCompileDataJSONWithoutShaders":{"paramConfigs":[{"type":"vector2","name":"tSize","defaultValue":[1,1],"uniformName":"v_POLY_param_tSize"},{"type":"node_path","name":"tPosition0","defaultValue":"","uniformName":"v_POLY_texture_tPosition0"},{"type":"node_path","name":"tPosition1","defaultValue":"","uniformName":"v_POLY_texture_tPosition1"},{"type":"node_path","name":"tNormal","defaultValue":"","uniformName":"v_POLY_texture_tNormal"}],"timeDependent":false,"resolutionDependent":false,"raymarchingLightsWorldCoordsDependent":false}},"customDepthDOFMaterial":{"material":{"metadata":{"version":4.6,"type":"Material","generator":"Material.toJSON"},"uuid":"/geo1/MAT/meshPhysical_CLOTH-customDepthDOFMaterial","type":"MeshDepthMaterial","name":"customDepthDOFMaterial","blendColor":0,"depthPacking":3200},"onBeforeCompileDataJSONWithoutShaders":{"paramConfigs":[{"type":"vector2","name":"tSize","defaultValue":[1,1],"uniformName":"v_POLY_param_tSize"},{"type":"node_path","name":"tPosition0","defaultValue":"","uniformName":"v_POLY_texture_tPosition0"},{"type":"node_path","name":"tPosition1","defaultValue":"","uniformName":"v_POLY_texture_tPosition1"},{"type":"node_path","name":"tNormal","defaultValue":"","uniformName":"v_POLY_texture_tNormal"}],"timeDependent":false,"resolutionDependent":false,"raymarchingLightsWorldCoordsDependent":false}}}}}}},"actor_clothSolver1":{"type":"actor","nodes":{"onScenePause1":{"type":"onScenePause"},"onTick1":{"type":"onTick"},"clothSolverReset1":{"type":"clothSolverReset","inputs":[{"index":0,"inputName":"trigger","node":"onScenePause1","output":"trigger"}]},"clothSolverStepSimulation1":{"type":"clothSolverStepSimulation","maxInputsCount":6,"inputs":[{"index":0,"inputName":"trigger","node":"onTick1","output":"trigger"}]},"clothSolverUpdateMaterial1":{"type":"clothSolverUpdateMaterial","maxInputsCount":10,"inputs":[{"index":0,"inputName":"trigger","node":"clothSolverStepSimulation1","output":"trigger"},null,{"index":2,"inputName":"tSize","node":"clothSolverStepSimulation1","output":"tSize"},{"index":3,"inputName":"tPosition0","node":"clothSolverStepSimulation1","output":"tPosition0"},{"index":4,"inputName":"tPosition1","node":"clothSolverStepSimulation1","output":"tPosition1"},{"index":5,"inputName":"tNormal","node":"clothSolverStepSimulation1","output":"tNormal"}]},"onObjectPointerdown1":{"type":"onObjectPointerdown","params":{"traverseChildren":false},"maxInputsCount":10},"GetIntersectionAttribute1":{"type":"getIntersectionAttribute","params":{"type":3,"interpolated":false,"attribName":{"type":"string","default_value":"","options":{"spare":true,"editable":true,"computeOnDirty":true,"dependentOnFoundParam":false},"raw_input":"id"},"notFoundValue":{"type":"integer","default_value":-1,"options":{"spare":true,"editable":true,"computeOnDirty":true,"dependentOnFoundParam":false}}},"maxInputsCount":3,"inputs":[{"index":0,"inputName":"Intersection","node":"onObjectPointerdown1","output":"Intersection"}],"connection_points":{"in":[{"name":"Intersection","type":"Intersection","isArray":false},{"name":"attribName","type":"string","isArray":false},{"name":"notFoundValue","type":"int","isArray":false}],"out":[{"name":"val","type":"int","isArray":false}]}},"clothSolverSetSelectedVertexPosition1":{"type":"setClothConstraintPosition","params":{"position":{"overriden_options":{}},"lerp":{"overriden_options":{}}},"maxInputsCount":4,"inputs":[{"index":0,"inputName":"trigger","node":"anyTrigger1","output":"trigger"},null,{"index":2,"inputName":"position","node":"null1","output":"out"}]},"constant2":{"type":"constant","params":{"float":-0.68},"connection_points":{"in":[],"out":[{"name":"val","type":"float","isArray":false}]}},"null1":{"type":"null","params":{"in":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false,"computeOnDirty":true,"dependentOnFoundParam":false}}},"inputs":[{"index":0,"inputName":"in","node":"rayIntersectPlane1","output":"position"}],"connection_points":{"in":[{"name":"in","type":"Vector3","isArray":false}],"out":[{"name":"out","type":"Vector3","isArray":false}]}},"plane1":{"type":"plane","params":{"normal":{"raw_input":[0,0,1],"overriden_options":{}},"constant":{"overriden_options":{}}},"inputs":[null,{"index":1,"inputName":"constant","node":"constant2","output":"val"}]},"rayFromCursor1":{"type":"rayFromCursor","params":{"element":1}},"rayIntersectPlane1":{"type":"rayIntersectPlane","inputs":[{"index":0,"inputName":"Ray","node":"rayFromCursor1","output":"Ray"},{"index":1,"inputName":"Plane","node":"plane1","output":"Plane"}]},"anyTrigger1":{"type":"anyTrigger","maxInputsCount":3,"inputs":[{"index":0,"inputName":"trigger0","node":"onTick1","output":"trigger"},{"index":1,"inputName":"trigger1","node":"createClothConstraint1","output":"trigger"}],"connection_points":{"in":[{"name":"trigger0","type":"trigger","isArray":false},{"name":"trigger1","type":"trigger","isArray":false},{"name":"trigger2","type":"trigger","isArray":false}],"out":[{"name":"trigger","type":"trigger","isArray":false}]}},"onPointerup1":{"type":"onPointerup","params":{"element":1}},"createClothConstraint1":{"type":"createClothConstraint","params":{"index":{"overriden_options":{}}},"maxInputsCount":3,"inputs":[{"index":0,"inputName":"trigger","node":"onObjectPointerdown1","output":"trigger"},null,{"index":2,"inputName":"index","node":"GetIntersectionAttribute1","output":"val"}]},"deleteClothConstraint1":{"type":"deleteClothConstraint","inputs":[{"index":0,"inputName":"trigger","node":"onPointerup1","output":"trigger"}]}},"inputs":["clothPrepare1"],"persisted_config":{"variableNames":["VAR__plane1_normal","VAR__plane1__1","VAR__rayIntersectPlane1_","VAR__null1_in","VAR__clothSolverSetSelectedVertexPosition1_position"],"variables":[{"type":"Vector3","data":[0,0,0]},{"type":"Plane","data":{"normal":[1,0,0],"constant":0}},{"type":"Vector3","data":[0,0,0]},{"type":"Vector3","data":[0,0,0]},{"type":"Vector3","data":[0,0,0]}],"functionNames":["globalsRayFromCursor","getIntersectionAttributeNumberNearest","planeSet","rayIntersectPlane","globalsTime","globalsTimeDelta","addObjectToObjectPointerdownCheck","addObjectToPointerupCheck","clothSolverReset","clothSolverStepSimulation","clothSolverUpdateMaterial","clothConstraintSetPosition","clothCreateConstraint","clothDeleteConstraint"],"serializedParamConfigs":[],"eventDatas":[{"type":"pointerdown","emitter":"canvas","jsType":"onObjectPointerdown"},{"type":"pointermove","emitter":"document","jsType":"rayFromCursor"},{"type":"touchmove","emitter":"document","jsType":"rayFromCursor"},{"type":"touchend","emitter":"document","jsType":"onPointerup"}]}},"restAttributes1":{"type":"restAttributes","inputs":["switch_CHARACTER"]},"fileOBJ1":{"type":"fileOBJ","params":{"url":"https://raw.githubusercontent.com/polygonjs/polygonjs-assets/master/models/cloth/cloth_character_01.obj"}},"hierarchy1":{"type":"hierarchy","params":{"mode":1},"inputs":["fileOBJ1"]},"transform1":{"type":"transform","params":{"scale":2},"inputs":["hierarchy1"]},"objectProperties1":{"type":"objectProperties","params":{"tcastShadow":true},"inputs":["transform1"]},"switch_CHARACTER":{"type":"switch","inputs":["icosahedron1","objectProperties1"]}},"params":{"CADLinearTolerance":{"overriden_options":{"callback":"{}"}},"CADAngularTolerance":{"overriden_options":{"callback":"{}"}},"CADCurveAbscissa":{"overriden_options":{"callback":"{}"}},"CADCurveTolerance":{"overriden_options":{"callback":"{}"}},"CADDisplayEdges":{"overriden_options":{"callback":"{}"}},"CADEdgesColor":{"overriden_options":{"callback":"{}"}},"CADDisplayMeshes":{"overriden_options":{"callback":"{}"}},"CADMeshesColor":{"overriden_options":{"callback":"{}"}},"CADWireframe":{"overriden_options":{"callback":"{}"}},"CSGFacetAngle":{"overriden_options":{"callback":"{}"}},"CSGLinesColor":{"overriden_options":{"callback":"{}"}},"CSGMeshesColor":{"overriden_options":{"callback":"{}"}},"CSGWireframe":{"overriden_options":{"callback":"{}"}},"QUADTriangles":{"overriden_options":{"callback":"{}"}},"QUADWireframe":{"overriden_options":{"callback":"{}"}},"TetScale":{"overriden_options":{"callback":"{}"}},"TetDisplayLines":{"overriden_options":{"callback":"{}"}},"TetDisplaySharedFaces":{"overriden_options":{"callback":"{}"}},"TetDisplayPoints":{"overriden_options":{"callback":"{}"}},"TetDisplayCenter":{"overriden_options":{"callback":"{}"}},"TetDisplaySphere":{"overriden_options":{"callback":"{}"}}},"flags":{"display":true}},"ground":{"type":"geo","nodes":{"material1":{"type":"material","params":{"material":"../MAT/meshStandardBuilder1"},"inputs":["box1"],"flags":{"display":true}},"MAT":{"type":"materialsNetwork","nodes":{"meshStandardBuilder1":{"type":"meshStandardBuilder","nodes":{"globals1":{"type":"globals"},"output1":{"type":"output","inputs":[null,null,{"index":2,"inputName":"color","node":"mix1","output":"mix"}]},"vec3ToFloat1":{"type":"vec3ToFloat","params":{"vec":{"overriden_options":{}}},"inputs":[{"index":0,"inputName":"vec","node":"globals1","output":"position"}]},"floatToVec2_1":{"type":"floatToVec2","params":{"x":{"overriden_options":{}},"y":{"overriden_options":{}}},"inputs":[{"index":0,"inputName":"x","node":"vec3ToFloat1","output":"x"},{"index":1,"inputName":"y","node":"vec3ToFloat1","output":"z"}]},"checkers1":{"type":"checkers","params":{"uv":{"overriden_options":{}},"freq":{"overriden_options":{}},"freqMult":{"overriden_options":{}}},"inputs":[{"index":0,"inputName":"uv","node":"floatToVec2_1","output":"vec2"}]},"mix1":{"type":"mix","params":{"value0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"value1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"blend":{"type":"float","default_value":0.5,"options":{"spare":true,"editable":false}}},"inputs":[{"index":0,"inputName":"value0","node":"constant1","output":"val"},{"index":1,"inputName":"value1","node":"constant2","output":"val"},{"index":2,"inputName":"blend","node":"checkers1","output":"checker"}],"connection_points":{"in":[{"name":"value0","type":"vec3"},{"name":"value1","type":"vec3"},{"name":"blend","type":"float"}],"out":[{"name":"mix","type":"vec3"}]}},"constant1":{"type":"constant","params":{"type":4,"color":[0.24313725490196078,0.5098039215686274,0.8549019607843137],"asColor":true},"connection_points":{"in":[],"out":[{"name":"val","type":"vec3"}]}},"constant2":{"type":"constant","params":{"type":4,"color":[0.047058823529411764,0.10196078431372549,0.17647058823529413],"asColor":true},"connection_points":{"in":[],"out":[{"name":"val","type":"vec3"}]}}},"persisted_config":{"material":{"metadata":{"version":4.6,"type":"Material","generator":"Material.toJSON"},"uuid":"/ground/MAT/meshStandardBuilder1-main","type":"MeshStandardMaterial","color":16777215,"roughness":1,"metalness":0,"emissive":0,"envMapIntensity":1,"blendColor":0,"fog":false},"onBeforeCompileDataJSONWithoutShaders":{"paramConfigs":[],"timeDependent":false,"resolutionDependent":false,"raymarchingLightsWorldCoordsDependent":false},"customMaterials":{"customDepthMaterial":{"material":{"metadata":{"version":4.6,"type":"Material","generator":"Material.toJSON"},"uuid":"/ground/MAT/meshStandardBuilder1-customDepthMaterial","type":"MeshDepthMaterial","name":"customDepthMaterial","side":1,"blendColor":0,"depthPacking":3201},"onBeforeCompileDataJSONWithoutShaders":{"paramConfigs":[],"timeDependent":false,"resolutionDependent":false,"raymarchingLightsWorldCoordsDependent":false}},"customDistanceMaterial":{"material":{"metadata":{"version":4.6,"type":"Material","generator":"Material.toJSON"},"uuid":"/ground/MAT/meshStandardBuilder1-customDistanceMaterial","type":"MeshDistanceMaterial","name":"customDistanceMaterial","blendColor":0},"onBeforeCompileDataJSONWithoutShaders":{"paramConfigs":[],"timeDependent":false,"resolutionDependent":false,"raymarchingLightsWorldCoordsDependent":false}},"customDepthDOFMaterial":{"material":{"metadata":{"version":4.6,"type":"Material","generator":"Material.toJSON"},"uuid":"/ground/MAT/meshStandardBuilder1-customDepthDOFMaterial","type":"MeshDepthMaterial","name":"customDepthDOFMaterial","blendColor":0,"depthPacking":3200},"onBeforeCompileDataJSONWithoutShaders":{"paramConfigs":[],"timeDependent":false,"resolutionDependent":false,"raymarchingLightsWorldCoordsDependent":false}}}}}}},"box1":{"type":"box","params":{"sizes":[9.98,1,9.98],"center":[0,-1.5,0]}}},"params":{"CADLinearTolerance":{"overriden_options":{"callback":"{}"}},"CADAngularTolerance":{"overriden_options":{"callback":"{}"}},"CADCurveAbscissa":{"overriden_options":{"callback":"{}"}},"CADCurveTolerance":{"overriden_options":{"callback":"{}"}},"CADDisplayEdges":{"overriden_options":{"callback":"{}"}},"CADEdgesColor":{"overriden_options":{"callback":"{}"}},"CADDisplayMeshes":{"overriden_options":{"callback":"{}"}},"CADMeshesColor":{"overriden_options":{"callback":"{}"}},"CADWireframe":{"overriden_options":{"callback":"{}"}},"CSGFacetAngle":{"overriden_options":{"callback":"{}"}},"CSGLinesColor":{"overriden_options":{"callback":"{}"}},"CSGMeshesColor":{"overriden_options":{"callback":"{}"}},"CSGWireframe":{"overriden_options":{"callback":"{}"}},"QUADTriangles":{"overriden_options":{"callback":"{}"}},"QUADWireframe":{"overriden_options":{"callback":"{}"}},"TetScale":{"overriden_options":{"callback":"{}"}},"TetDisplayLines":{"overriden_options":{"callback":"{}"}},"TetDisplaySharedFaces":{"overriden_options":{"callback":"{}"}},"TetDisplayPoints":{"overriden_options":{"callback":"{}"}},"TetDisplayCenter":{"overriden_options":{"callback":"{}"}},"TetDisplaySphere":{"overriden_options":{"callback":"{}"}}},"flags":{"display":true}},"lights":{"type":"geo","nodes":{"hemisphereLight1":{"type":"hemisphereLight","params":{"intensity":0.52}},"spotLight1":{"type":"spotLight","params":{"decay":0.1,"distance":10,"castShadow":true}},"polarTransform1":{"type":"polarTransform","params":{"center":[0,0.7,0],"latitude":25.2,"depth":3},"inputs":["spotLight1"]},"merge1":{"type":"merge","inputs":["hemisphereLight1","polarTransform1"],"flags":{"display":true}}},"params":{"CADLinearTolerance":{"overriden_options":{"callback":"{}"}},"CADAngularTolerance":{"overriden_options":{"callback":"{}"}},"CADCurveAbscissa":{"overriden_options":{"callback":"{}"}},"CADCurveTolerance":{"overriden_options":{"callback":"{}"}},"CADDisplayEdges":{"overriden_options":{"callback":"{}"}},"CADEdgesColor":{"overriden_options":{"callback":"{}"}},"CADDisplayMeshes":{"overriden_options":{"callback":"{}"}},"CADMeshesColor":{"overriden_options":{"callback":"{}"}},"CADWireframe":{"overriden_options":{"callback":"{}"}},"CSGFacetAngle":{"overriden_options":{"callback":"{}"}},"CSGLinesColor":{"overriden_options":{"callback":"{}"}},"CSGMeshesColor":{"overriden_options":{"callback":"{}"}},"CSGWireframe":{"overriden_options":{"callback":"{}"}},"QUADTriangles":{"overriden_options":{"callback":"{}"}},"QUADWireframe":{"overriden_options":{"callback":"{}"}},"TetScale":{"overriden_options":{"callback":"{}"}},"TetDisplayLines":{"overriden_options":{"callback":"{}"}},"TetDisplaySharedFaces":{"overriden_options":{"callback":"{}"}},"TetDisplayPoints":{"overriden_options":{"callback":"{}"}},"TetDisplayCenter":{"overriden_options":{"callback":"{}"}},"TetDisplaySphere":{"overriden_options":{"callback":"{}"}}},"flags":{"display":true}},"cameras":{"type":"geo","nodes":{"cameraControls1":{"type":"cameraControls","nodes":{"cameraOrbitControls1":{"type":"cameraOrbitControls","params":{"target":[-0.48148989880391097,-0.29222906804685,0.3218829791777303]}}},"params":{"node":"cameraOrbitControls1"},"inputs":["perspectiveCamera_DEBUG"]},"perspectiveCamera_DEBUG":{"type":"perspectiveCamera","params":{"position":[1.608706467168788,1.554179582392217,5.848803064387538],"rotation":[-18.473177623517042,19.732503241606356,6.435389783988498]}},"perspectiveCamera_MAIN":{"type":"perspectiveCamera","params":{"position":[3.3,3.3,3.3]}},"polarTransform1":{"type":"polarTransform","params":{"latitude":7.2,"depth":5.7},"inputs":["perspectiveCamera_MAIN"]},"merge1":{"type":"merge","inputs":["cameraControls1","polarTransform1"],"flags":{"display":true}}},"params":{"CADLinearTolerance":{"overriden_options":{"callback":"{}"}},"CADAngularTolerance":{"overriden_options":{"callback":"{}"}},"CADCurveAbscissa":{"overriden_options":{"callback":"{}"}},"CADCurveTolerance":{"overriden_options":{"callback":"{}"}},"CADDisplayEdges":{"overriden_options":{"callback":"{}"}},"CADEdgesColor":{"overriden_options":{"callback":"{}"}},"CADDisplayMeshes":{"overriden_options":{"callback":"{}"}},"CADMeshesColor":{"overriden_options":{"callback":"{}"}},"CADWireframe":{"overriden_options":{"callback":"{}"}},"CSGFacetAngle":{"overriden_options":{"callback":"{}"}},"CSGLinesColor":{"overriden_options":{"callback":"{}"}},"CSGMeshesColor":{"overriden_options":{"callback":"{}"}},"CSGWireframe":{"overriden_options":{"callback":"{}"}},"QUADTriangles":{"overriden_options":{"callback":"{}"}},"QUADWireframe":{"overriden_options":{"callback":"{}"}},"TetScale":{"overriden_options":{"callback":"{}"}},"TetDisplayLines":{"overriden_options":{"callback":"{}"}},"TetDisplaySharedFaces":{"overriden_options":{"callback":"{}"}},"TetDisplayPoints":{"overriden_options":{"callback":"{}"}},"TetDisplayCenter":{"overriden_options":{"callback":"{}"}},"TetDisplaySphere":{"overriden_options":{"callback":"{}"}}},"flags":{"display":true}},"text":{"type":"geo","nodes":{"text1":{"type":"text","params":{"text":"PULL & STRETCH","type":1,"size":0.42,"justifyMode":2}},"transform1":{"type":"transform","params":{"t":[0,2.1263014458517997,-3]},"inputs":["text1"]},"material1":{"type":"material","params":{"material":"../MAT/meshBasic1"},"inputs":["transform1"],"flags":{"display":true}},"MAT":{"type":"materialsNetwork","nodes":{"meshBasic1":{"type":"meshBasic"}}}},"params":{"CADLinearTolerance":{"overriden_options":{"callback":"{}"}},"CADAngularTolerance":{"overriden_options":{"callback":"{}"}},"CADCurveAbscissa":{"overriden_options":{"callback":"{}"}},"CADCurveTolerance":{"overriden_options":{"callback":"{}"}},"CADDisplayEdges":{"overriden_options":{"callback":"{}"}},"CADEdgesColor":{"overriden_options":{"callback":"{}"}},"CADDisplayMeshes":{"overriden_options":{"callback":"{}"}},"CADMeshesColor":{"overriden_options":{"callback":"{}"}},"CADWireframe":{"overriden_options":{"callback":"{}"}},"CSGFacetAngle":{"overriden_options":{"callback":"{}"}},"CSGLinesColor":{"overriden_options":{"callback":"{}"}},"CSGMeshesColor":{"overriden_options":{"callback":"{}"}},"CSGWireframe":{"overriden_options":{"callback":"{}"}},"QUADTriangles":{"overriden_options":{"callback":"{}"}},"QUADWireframe":{"overriden_options":{"callback":"{}"}},"TetScale":{"overriden_options":{"callback":"{}"}},"TetDisplayLines":{"overriden_options":{"callback":"{}"}},"TetDisplaySharedFaces":{"overriden_options":{"callback":"{}"}},"TetDisplayPoints":{"overriden_options":{"callback":"{}"}},"TetDisplayCenter":{"overriden_options":{"callback":"{}"}},"TetDisplaySphere":{"overriden_options":{"callback":"{}"}}},"flags":{"display":true}}},"params":{"mainCameraPath":"/cameras/cameras:sopGroup/perspectiveCamera_MAIN"}},"ui":{"nodes":{"geo1":{"pos":[-50,-350],"selection":["icosahedron1","clothSolver1","clothPrepare1","material1","MAT","actor_clothSolver1","restAttributes1","fileOBJ1","hierarchy1","transform1","objectProperties1","switch_CHARACTER"],"nodes":{"icosahedron1":{"pos":[-50,-900]},"clothSolver1":{"pos":[50,650],"comment":"This is the solver. You can add more nodes inside it to add specific movements in area of the input geometry. This can be useful for more precise tweaking, like vibrations.","nodes":{"globals1":{"pos":[-400,0]},"output1":{"pos":[200,0]}}},"clothPrepare1":{"pos":[50,150],"comment":"the clothPrepare node adds some attributes, like id, to your geometry."},"material1":{"pos":[50,950],"comment":"This assigns the [material](../MAT/meshPhysical_CLOTH), which is necessary to display the result of the simulation."},"MAT":{"pos":[-150,650],"nodes":{"meshPhysical_CLOTH":{"pos":[0,0],"nodes":{"globals1":{"pos":[-400,0]},"output1":{"pos":[400,0]},"clothSolverPosition1":{"pos":[100,0]},"attribute1":{"pos":[-100,0]},"attribute2":{"pos":[-900,550]},"mix1":{"pos":[250,300]},"constant1":{"pos":[-100,300]},"constant2":{"pos":[-100,200]},"vec3ToFloat1":{"pos":[-750,450]},"floatToVec2_1":{"pos":[-550,450]},"vec3ToFloat2":{"pos":[-750,650]},"floatToVec2_2":{"pos":[-550,650]},"grid1":{"pos":[-250,500]},"constant3":{"pos":[-550,800]},"grid2":{"pos":[-250,650]},"mult2":{"pos":[-100,550]}}}}},"actor_clothSolver1":{"pos":[50,400],"comment":"most of the logic of how the cloth solver will behave is inside [this node](.)","selection":["deleteClothConstraint1"],"nodes":{"onScenePause1":{"pos":[-100,-300]},"onTick1":{"pos":[-100,0]},"clothSolverReset1":{"pos":[100,-300],"comment":"when the scene pauses, the cloth solver will reset. Unplug the onScenePause node if you do not want this behavior."},"clothSolverStepSimulation1":{"pos":[100,0],"comment":"this needs to be triggered every frame, using the onTick node, in order to simulate the cloth"},"clothSolverUpdateMaterial1":{"pos":[450,0],"comment":"The result of the simulation is stored in textures. This node makes sure that the material is given those textures, so that we can display the result of the sim."},"onObjectPointerdown1":{"pos":[-600,650],"comment":"when we click on the object, we create a constraint used by the cloth solver.\\n\\nThe constraint is created using the `id` attribute found under the cursor."},"GetIntersectionAttribute1":{"pos":[-300,800]},"clothSolverSetSelectedVertexPosition1":{"pos":[1400,400],"comment":"Here we set the position of the constraint created by the nodes on the left.\\nThe position is set by sending a ray from the camera to the cursor, and seeing where it intersects on a plane."},"constant2":{"pos":[550,900]},"null1":{"pos":[1150,800]},"plane1":{"pos":[750,900]},"rayFromCursor1":{"pos":[750,750]},"rayIntersectPlane1":{"pos":[900,800]},"anyTrigger1":{"pos":[100,400]},"onPointerup1":{"pos":[-600,1050],"comment":"when the user releases the cursor, we delete the contraint"},"createClothConstraint1":{"pos":[-100,650]},"deleteClothConstraint1":{"pos":[-50,1050]}}},"restAttributes1":{"pos":[50,-50],"comment":"the rest attribute is only used in the [material](../MAT/meshPhysical_CLOTH), and is not necessary for the simulation itself."},"fileOBJ1":{"pos":[250,-1150],"comment":"the geometry imported in this node has been created with Houdini. You can use any modeling tool in Houdini to create your character, as long as you make sure to use a remesh node at the end, to have evenly spread out triangles.\\n\\nYou can look at [the houdini scene used for this character](https://github.com/polygonjs/polygonjs-assets/tree/master/houdini/scenes)"},"hierarchy1":{"pos":[250,-800]},"transform1":{"pos":[250,-700]},"objectProperties1":{"pos":[250,-600]},"switch_CHARACTER":{"pos":[50,-450],"comment":"The switch allows to test different inputs for the cloth solver.\\n- left input is a simple icosahedron (which is like a sphere, but with the triangles laid out evenly, which is necessary for the cloth solver)\\n- right input is an imported geometry, created with Houdini"}}},"ground":{"pos":[-50,-450],"nodes":{"material1":{"pos":[0,300]},"MAT":{"pos":[-200,300],"nodes":{"meshStandardBuilder1":{"pos":[0,200],"nodes":{"globals1":{"pos":[-450,0]},"output1":{"pos":[400,0]},"vec3ToFloat1":{"pos":[-200,200]},"floatToVec2_1":{"pos":[-100,200]},"checkers1":{"pos":[50,200]},"mix1":{"pos":[250,0]},"constant1":{"pos":[50,-150]},"constant2":{"pos":[0,0]}}}}},"box1":{"pos":[0,100]}}},"lights":{"pos":[-50,-250],"selection":["hemisphereLight1"],"nodes":{"hemisphereLight1":{"pos":[50,-50]},"spotLight1":{"pos":[300,-50]},"polarTransform1":{"pos":[300,150]},"merge1":{"pos":[100,300]}}},"cameras":{"pos":[-50,-150],"selection":["polarTransform1"],"nodes":{"cameraControls1":{"pos":[0,150],"nodes":{"cameraOrbitControls1":{"pos":[0,0]}}},"perspectiveCamera_DEBUG":{"pos":[0,-50]},"perspectiveCamera_MAIN":{"pos":[350,-50]},"polarTransform1":{"pos":[350,150]},"merge1":{"pos":[150,350]}}},"text":{"pos":[100,-350],"selection":["text1"],"nodes":{"text1":{"pos":[-200,-100]},"transform1":{"pos":[-200,50]},"material1":{"pos":[-200,200]},"MAT":{"pos":[-400,200],"nodes":{"meshBasic1":{"pos":[-150,0]}}}}}}},"shaders":{"/geo1/clothSolver1":{"position":"precision highp float;\nprecision highp sampler2D;\n\nuniform vec2 tSize;\nuniform float order;\nuniform sampler2D tOriginal;\nuniform sampler2D tPrevious0;\nuniform sampler2D tPrevious1;\nuniform sampler2D tPosition0;\nuniform sampler2D tPosition1;\nuniform sampler2D tViscositySpring;\nuniform float time;\nuniform float timeDelta;\nuniform float viscosity;\nuniform float spring;\n\n// removed:\n//// INSERT DEFINE\n\n// *** ADD COMMON ***\n\nvoid main() {\n\n\tvec2 particleUv = gl_FragCoord.xy / tSize.xy;\n\n\tvec3 original = texture2D( tOriginal, particleUv ).xyz;\n\tvec3 previous = ( texture2D( tPrevious0, particleUv ).xyz + texture2D( tPrevious1, particleUv ).xyz ) / 1024.0;\n\tvec3 position = ( texture2D( tPosition0, particleUv ).xyz + texture2D( tPosition1, particleUv ).xyz ) / 1024.0;\n\tvec3 viscositySpring = texture2D( tViscositySpring, particleUv ).xyz;\n\tfloat viscosityMult = viscosity * viscositySpring.x;\n\tfloat springMult = spring * viscositySpring.y;\n\n// removed:\n//\t// INSERT BODY\n\n\n\n\t// /geo1/clothSolver1/globals1\n\tvec3 v_POLY_globals1_position = position;\n\t\n\t// /geo1/clothSolver1/output1\n\tposition.xyz = v_POLY_globals1_position;\n\n\n\n\n\tvec3 offset = ( original - position ) * timeDelta * springMult;\n\tvec3 disp = ( position - previous ) * ( 1.0 - viscosityMult ) + position;\n\n\tgl_FragColor = vec4( unpackPosition( disp + offset, order ), 1.0 );\n\n}\n"},"/geo1/MAT/meshPhysical_CLOTH":{"vertex":"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_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\n\n\n// /geo1/MAT/meshPhysical_CLOTH/clothSolverPosition1\n// get vec2 tex coordinate from index\nvec2 getClothSolverUV( float id, vec2 textureSize ) { \n\n\tvec2 coords = vec2(\n\t\tfloor( mod( ( id + 0.5 ), textureSize.x ) ),\n\t\tfloor( ( id + 0.5 ) / textureSize.x )\n\t) + 0.5;\n\n\treturn coords / textureSize;\n\n}\n\n\nvec3 clothSolverPosition(sampler2D tPosition0, sampler2D tPosition1, vec2 clothSolverUv) {\n\treturn ( texture2D( tPosition0, clothSolverUv ).xyz + texture2D( tPosition1, clothSolverUv ).xyz ) / 1024.0;\n}\nvec3 clothSolverNormal(sampler2D tNormal, vec2 clothSolverUv) {\n\treturn normalize( texture2D( tNormal, clothSolverUv ).xyz );\n}\n\n\n\n\n\n\n\n// /geo1/MAT/meshPhysical_CLOTH/clothSolverPosition1\nuniform vec2 v_POLY_param_tSize;\nuniform sampler2D v_POLY_texture_tPosition0;\nuniform sampler2D v_POLY_texture_tPosition1;\nuniform sampler2D v_POLY_texture_tNormal;\n\n// /geo1/MAT/meshPhysical_CLOTH/attribute2\nvarying vec3 v_POLY_attribute_restP;\n\n// /geo1/MAT/meshPhysical_CLOTH/attribute1\nattribute float id;\n\n// /geo1/MAT/meshPhysical_CLOTH/attribute2\nattribute vec3 restP;\n\n\n\n\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 <color_vertex>\n\n\n\n\t// /geo1/MAT/meshPhysical_CLOTH/attribute1\n\tfloat v_POLY_attribute1_val = id;\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/attribute2\n\tv_POLY_attribute_restP = vec3(restP);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/clothSolverPosition1\n\tvec2 v_POLY_clothSolverPosition1_clothSolverUv = getClothSolverUV(v_POLY_attribute1_val, v_POLY_param_tSize);\n\tvec3 v_POLY_clothSolverPosition1_position = clothSolverPosition(v_POLY_texture_tPosition0, v_POLY_texture_tPosition1, v_POLY_clothSolverPosition1_clothSolverUv);\n\tvec3 v_POLY_clothSolverPosition1_normal = clothSolverNormal(v_POLY_texture_tNormal, v_POLY_clothSolverPosition1_clothSolverUv);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/output1\n\tvec3 transformed = v_POLY_clothSolverPosition1_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\t#include <batching_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}","fragment":"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_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 USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n\n\n\n// /geo1/MAT/meshPhysical_CLOTH/grid1\n// https://www.shadertoy.com/view/XtBfzz\n// https://iquilezles.org/articles/checkerfiltering/\n\nfloat gridTextureGradBox( in vec2 p, in float lineWidth, in vec2 ddx, in vec2 ddy )\n{\n\t// filter kernel\n\tvec2 w = max(abs(ddx), abs(ddy)) + 0.01;\n\n\t// analytic (box) filtering\n\tvec2 a = p + 0.5*w;\n\tvec2 b = p - 0.5*w;\n\tvec2 i = (floor(a)+min(fract(a)/lineWidth,1.0)-\n\t\t\t\tfloor(b)-min(fract(b)/lineWidth,1.0))/(w/lineWidth);\n\t//pattern\n\treturn (1.0-i.x)*(1.0-i.y);\n}\n\nfloat grid( in vec2 p, in float lineWidth )\n{\n // coordinates\n vec2 i = step( fract(p), vec2(1.0*lineWidth) );\n //pattern\n return (1.0-i.x)*(1.0-i.y); // grid (N=10)\n \n // other possible patterns are these\n //return 1.0-i.x*i.y; // squares (N=4)\n //return 1.0-i.x-i.y+2.0*i.x*i.y; // checker (N=2)\n}\n\n\n\n\n\n\n\n// /geo1/MAT/meshPhysical_CLOTH/attribute2\nvarying vec3 v_POLY_attribute_restP;\n\n\n\n\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <iridescence_fragment>\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 <iridescence_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 vec3 geometryNormal,\n\tconst in vec3 geometryViewDir,\n\tconst in SSSModel sssModel,\n\tinout ReflectedLight reflectedLight\n\t){\n\tvec3 scatteringHalf = normalize(directLight.direction + (geometryNormal * sssModel.distortion));\n\tfloat scatteringDot = pow(saturate(dot(geometryViewDir, -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/meshPhysical_CLOTH/constant2\n\tvec3 v_POLY_constant2_val = vec3(0.07036009568874305, 0.5906188409113381, 0.06662593863608139);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/constant1\n\tvec3 v_POLY_constant1_val = vec3(1.0, 1.0, 1.0);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/attribute2\n\tvec3 v_POLY_attribute2_val = v_POLY_attribute_restP;\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/constant3\n\tfloat v_POLY_constant3_val = 5.0;\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/vec3ToFloat1\n\tfloat v_POLY_vec3ToFloat1_y = v_POLY_attribute2_val.y;\n\tfloat v_POLY_vec3ToFloat1_z = v_POLY_attribute2_val.z;\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/vec3ToFloat2\n\tfloat v_POLY_vec3ToFloat2_x = v_POLY_attribute2_val.x;\n\tfloat v_POLY_vec3ToFloat2_y = v_POLY_attribute2_val.y;\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/floatToVec2_1\n\tvec2 v_POLY_floatToVec2_1_vec2 = vec2(v_POLY_vec3ToFloat1_y, v_POLY_vec3ToFloat1_z);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/floatToVec2_2\n\tvec2 v_POLY_floatToVec2_2_vec2 = vec2(v_POLY_vec3ToFloat2_x, v_POLY_vec3ToFloat2_y);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/grid1\n\tvec2 v_POLY_grid1_coord = v_POLY_floatToVec2_1_vec2*vec2(1.0, 1.0)*v_POLY_constant3_val;\n\tfloat v_POLY_grid1_grid = gridTextureGradBox(v_POLY_grid1_coord, 0.1, dFdx(v_POLY_grid1_coord), dFdy(v_POLY_grid1_coord));\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/grid2\n\tvec2 v_POLY_grid2_coord = v_POLY_floatToVec2_2_vec2*vec2(1.0, 1.0)*v_POLY_constant3_val;\n\tfloat v_POLY_grid2_grid = gridTextureGradBox(v_POLY_grid2_coord, 0.1, dFdx(v_POLY_grid2_coord), dFdy(v_POLY_grid2_coord));\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/mult2\n\tfloat v_POLY_mult2_product = (v_POLY_grid1_grid * v_POLY_grid2_grid * 1.0);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/mix1\n\tvec3 v_POLY_mix1_mix = mix(v_POLY_constant2_val, v_POLY_constant1_val, v_POLY_mult2_product);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/output1\n\tdiffuseColor.xyz = v_POLY_mix1_mix;\n\tfloat POLY_metalness = 1.0;\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\t#include <alphahash_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, geometryNormal, geometryViewDir, 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\tmaterial.transmission = transmission * POLY_transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness * POLY_thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\n\t#ifdef USE_TRANSMISSIONMAP\n\n\t\tmaterial.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n\n\t#endif\n\n\t#ifdef USE_THICKNESSMAP\n\n\t\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).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 transmitted = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n\n\ttotalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n\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 + sheenSpecularDirect + sheenSpecularIndirect;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\n\t#endif\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}","customDepthMaterial.vertex":"#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n\n\n\n// /geo1/MAT/meshPhysical_CLOTH/clothSolverPosition1\n// get vec2 tex coordinate from index\nvec2 getClothSolverUV( float id, vec2 textureSize ) { \n\n\tvec2 coords = vec2(\n\t\tfloor( mod( ( id + 0.5 ), textureSize.x ) ),\n\t\tfloor( ( id + 0.5 ) / textureSize.x )\n\t) + 0.5;\n\n\treturn coords / textureSize;\n\n}\n\n\nvec3 clothSolverPosition(sampler2D tPosition0, sampler2D tPosition1, vec2 clothSolverUv) {\n\treturn ( texture2D( tPosition0, clothSolverUv ).xyz + texture2D( tPosition1, clothSolverUv ).xyz ) / 1024.0;\n}\nvec3 clothSolverNormal(sampler2D tNormal, vec2 clothSolverUv) {\n\treturn normalize( texture2D( tNormal, clothSolverUv ).xyz );\n}\n\n\n\n\n\n\n\n// /geo1/MAT/meshPhysical_CLOTH/clothSolverPosition1\nuniform vec2 v_POLY_param_tSize;\nuniform sampler2D v_POLY_texture_tPosition0;\nuniform sampler2D v_POLY_texture_tPosition1;\nuniform sampler2D v_POLY_texture_tNormal;\n\n// /geo1/MAT/meshPhysical_CLOTH/attribute2\nvarying vec3 v_POLY_attribute_restP;\n\n// /geo1/MAT/meshPhysical_CLOTH/attribute1\nattribute float id;\n\n// /geo1/MAT/meshPhysical_CLOTH/attribute2\nattribute vec3 restP;\n\n\n\n\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_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/meshPhysical_CLOTH/attribute1\n\tfloat v_POLY_attribute1_val = id;\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/attribute2\n\tv_POLY_attribute_restP = vec3(restP);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/clothSolverPosition1\n\tvec2 v_POLY_clothSolverPosition1_clothSolverUv = getClothSolverUV(v_POLY_attribute1_val, v_POLY_param_tSize);\n\tvec3 v_POLY_clothSolverPosition1_position = clothSolverPosition(v_POLY_texture_tPosition0, v_POLY_texture_tPosition1, v_POLY_clothSolverPosition1_clothSolverUv);\n\tvec3 v_POLY_clothSolverPosition1_normal = clothSolverNormal(v_POLY_texture_tNormal, v_POLY_clothSolverPosition1_clothSolverUv);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/output1\n\tvec3 transformed = v_POLY_clothSolverPosition1_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}","customDepthMaterial.fragment":"\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/meshPhysical_CLOTH/grid1\n// https://www.shadertoy.com/view/XtBfzz\n// https://iquilezles.org/articles/checkerfiltering/\n\nfloat gridTextureGradBox( in vec2 p, in float lineWidth, in vec2 ddx, in vec2 ddy )\n{\n\t// filter kernel\n\tvec2 w = max(abs(ddx), abs(ddy)) + 0.01;\n\n\t// analytic (box) filtering\n\tvec2 a = p + 0.5*w;\n\tvec2 b = p - 0.5*w;\n\tvec2 i = (floor(a)+min(fract(a)/lineWidth,1.0)-\n\t\t\t\tfloor(b)-min(fract(b)/lineWidth,1.0))/(w/lineWidth);\n\t//pattern\n\treturn (1.0-i.x)*(1.0-i.y);\n}\n\nfloat grid( in vec2 p, in float lineWidth )\n{\n // coordinates\n vec2 i = step( fract(p), vec2(1.0*lineWidth) );\n //pattern\n return (1.0-i.x)*(1.0-i.y); // grid (N=10)\n \n // other possible patterns are these\n //return 1.0-i.x*i.y; // squares (N=4)\n //return 1.0-i.x-i.y+2.0*i.x*i.y; // checker (N=2)\n}\n\n\n\n\n\n\n\n// /geo1/MAT/meshPhysical_CLOTH/attribute2\nvarying vec3 v_POLY_attribute_restP;\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 vec3 geometryNormal,\n\tconst in vec3 geometryViewDir,\n\tconst in SSSModel sssModel,\n\tinout ReflectedLight reflectedLight\n\t){\n\tvec3 scatteringHalf = normalize(directLight.direction + (geometryNormal * sssModel.distortion));\n\tfloat scatteringDot = pow(saturate(dot(geometryViewDir, -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/meshPhysical_CLOTH/constant2\n\tvec3 v_POLY_constant2_val = vec3(0.07036009568874305, 0.5906188409113381, 0.06662593863608139);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/constant1\n\tvec3 v_POLY_constant1_val = vec3(1.0, 1.0, 1.0);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/attribute2\n\tvec3 v_POLY_attribute2_val = v_POLY_attribute_restP;\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/constant3\n\tfloat v_POLY_constant3_val = 5.0;\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/vec3ToFloat1\n\tfloat v_POLY_vec3ToFloat1_y = v_POLY_attribute2_val.y;\n\tfloat v_POLY_vec3ToFloat1_z = v_POLY_attribute2_val.z;\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/vec3ToFloat2\n\tfloat v_POLY_vec3ToFloat2_x = v_POLY_attribute2_val.x;\n\tfloat v_POLY_vec3ToFloat2_y = v_POLY_attribute2_val.y;\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/floatToVec2_1\n\tvec2 v_POLY_floatToVec2_1_vec2 = vec2(v_POLY_vec3ToFloat1_y, v_POLY_vec3ToFloat1_z);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/floatToVec2_2\n\tvec2 v_POLY_floatToVec2_2_vec2 = vec2(v_POLY_vec3ToFloat2_x, v_POLY_vec3ToFloat2_y);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/grid1\n\tvec2 v_POLY_grid1_coord = v_POLY_floatToVec2_1_vec2*vec2(1.0, 1.0)*v_POLY_constant3_val;\n\tfloat v_POLY_grid1_grid = gridTextureGradBox(v_POLY_grid1_coord, 0.1, dFdx(v_POLY_grid1_coord), dFdy(v_POLY_grid1_coord));\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/grid2\n\tvec2 v_POLY_grid2_coord = v_POLY_floatToVec2_2_vec2*vec2(1.0, 1.0)*v_POLY_constant3_val;\n\tfloat v_POLY_grid2_grid = gridTextureGradBox(v_POLY_grid2_coord, 0.1, dFdx(v_POLY_grid2_coord), dFdy(v_POLY_grid2_coord));\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/mult2\n\tfloat v_POLY_mult2_product = (v_POLY_grid1_grid * v_POLY_grid2_grid * 1.0);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/mix1\n\tvec3 v_POLY_mix1_mix = mix(v_POLY_constant2_val, v_POLY_constant1_val, v_POLY_mult2_product);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/output1\n\tdiffuseColor.xyz = v_POLY_mix1_mix;\n\tfloat POLY_metalness = 1.0;\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","customDistanceMaterial.vertex":"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n\n\n\n// /geo1/MAT/meshPhysical_CLOTH/clothSolverPosition1\n// get vec2 tex coordinate from index\nvec2 getClothSolverUV( float id, vec2 textureSize ) { \n\n\tvec2 coords = vec2(\n\t\tfloor( mod( ( id + 0.5 ), textureSize.x ) ),\n\t\tfloor( ( id + 0.5 ) / textureSize.x )\n\t) + 0.5;\n\n\treturn coords / textureSize;\n\n}\n\n\nvec3 clothSolverPosition(sampler2D tPosition0, sampler2D tPosition1, vec2 clothSolverUv) {\n\treturn ( texture2D( tPosition0, clothSolverUv ).xyz + texture2D( tPosition1, clothSolverUv ).xyz ) / 1024.0;\n}\nvec3 clothSolverNormal(sampler2D tNormal, vec2 clothSolverUv) {\n\treturn normalize( texture2D( tNormal, clothSolverUv ).xyz );\n}\n\n\n\n\n\n\n\n// /geo1/MAT/meshPhysical_CLOTH/clothSolverPosition1\nuniform vec2 v_POLY_param_tSize;\nuniform sampler2D v_POLY_texture_tPosition0;\nuniform sampler2D v_POLY_texture_tPosition1;\nuniform sampler2D v_POLY_texture_tNormal;\n\n// /geo1/MAT/meshPhysical_CLOTH/attribute2\nvarying vec3 v_POLY_attribute_restP;\n\n// /geo1/MAT/meshPhysical_CLOTH/attribute1\nattribute float id;\n\n// /geo1/MAT/meshPhysical_CLOTH/attribute2\nattribute vec3 restP;\n\n\n\n\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_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/meshPhysical_CLOTH/attribute1\n\tfloat v_POLY_attribute1_val = id;\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/attribute2\n\tv_POLY_attribute_restP = vec3(restP);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/clothSolverPosition1\n\tvec2 v_POLY_clothSolverPosition1_clothSolverUv = getClothSolverUV(v_POLY_attribute1_val, v_POLY_param_tSize);\n\tvec3 v_POLY_clothSolverPosition1_position = clothSolverPosition(v_POLY_texture_tPosition0, v_POLY_texture_tPosition1, v_POLY_clothSolverPosition1_clothSolverUv);\n\tvec3 v_POLY_clothSolverPosition1_normal = clothSolverNormal(v_POLY_texture_tNormal, v_POLY_clothSolverPosition1_clothSolverUv);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/output1\n\tvec3 transformed = v_POLY_clothSolverPosition1_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}","customDistanceMaterial.fragment":"\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/meshPhysical_CLOTH/grid1\n// https://www.shadertoy.com/view/XtBfzz\n// https://iquilezles.org/articles/checkerfiltering/\n\nfloat gridTextureGradBox( in vec2 p, in float lineWidth, in vec2 ddx, in vec2 ddy )\n{\n\t// filter kernel\n\tvec2 w = max(abs(ddx), abs(ddy)) + 0.01;\n\n\t// analytic (box) filtering\n\tvec2 a = p + 0.5*w;\n\tvec2 b = p - 0.5*w;\n\tvec2 i = (floor(a)+min(fract(a)/lineWidth,1.0)-\n\t\t\t\tfloor(b)-min(fract(b)/lineWidth,1.0))/(w/lineWidth);\n\t//pattern\n\treturn (1.0-i.x)*(1.0-i.y);\n}\n\nfloat grid( in vec2 p, in float lineWidth )\n{\n // coordinates\n vec2 i = step( fract(p), vec2(1.0*lineWidth) );\n //pattern\n return (1.0-i.x)*(1.0-i.y); // grid (N=10)\n \n // other possible patterns are these\n //return 1.0-i.x*i.y; // squares (N=4)\n //return 1.0-i.x-i.y+2.0*i.x*i.y; // checker (N=2)\n}\n\n\n\n\n\n\n\n// /geo1/MAT/meshPhysical_CLOTH/attribute2\nvarying vec3 v_POLY_attribute_restP;\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 vec3 geometryNormal,\n\tconst in vec3 geometryViewDir,\n\tconst in SSSModel sssModel,\n\tinout ReflectedLight reflectedLight\n\t){\n\tvec3 scatteringHalf = normalize(directLight.direction + (geometryNormal * sssModel.distortion));\n\tfloat scatteringDot = pow(saturate(dot(geometryViewDir, -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/meshPhysical_CLOTH/constant2\n\tvec3 v_POLY_constant2_val = vec3(0.07036009568874305, 0.5906188409113381, 0.06662593863608139);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/constant1\n\tvec3 v_POLY_constant1_val = vec3(1.0, 1.0, 1.0);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/attribute2\n\tvec3 v_POLY_attribute2_val = v_POLY_attribute_restP;\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/constant3\n\tfloat v_POLY_constant3_val = 5.0;\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/vec3ToFloat1\n\tfloat v_POLY_vec3ToFloat1_y = v_POLY_attribute2_val.y;\n\tfloat v_POLY_vec3ToFloat1_z = v_POLY_attribute2_val.z;\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/vec3ToFloat2\n\tfloat v_POLY_vec3ToFloat2_x = v_POLY_attribute2_val.x;\n\tfloat v_POLY_vec3ToFloat2_y = v_POLY_attribute2_val.y;\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/floatToVec2_1\n\tvec2 v_POLY_floatToVec2_1_vec2 = vec2(v_POLY_vec3ToFloat1_y, v_POLY_vec3ToFloat1_z);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/floatToVec2_2\n\tvec2 v_POLY_floatToVec2_2_vec2 = vec2(v_POLY_vec3ToFloat2_x, v_POLY_vec3ToFloat2_y);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/grid1\n\tvec2 v_POLY_grid1_coord = v_POLY_floatToVec2_1_vec2*vec2(1.0, 1.0)*v_POLY_constant3_val;\n\tfloat v_POLY_grid1_grid = gridTextureGradBox(v_POLY_grid1_coord, 0.1, dFdx(v_POLY_grid1_coord), dFdy(v_POLY_grid1_coord));\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/grid2\n\tvec2 v_POLY_grid2_coord = v_POLY_floatToVec2_2_vec2*vec2(1.0, 1.0)*v_POLY_constant3_val;\n\tfloat v_POLY_grid2_grid = gridTextureGradBox(v_POLY_grid2_coord, 0.1, dFdx(v_POLY_grid2_coord), dFdy(v_POLY_grid2_coord));\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/mult2\n\tfloat v_POLY_mult2_product = (v_POLY_grid1_grid * v_POLY_grid2_grid * 1.0);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/mix1\n\tvec3 v_POLY_mix1_mix = mix(v_POLY_constant2_val, v_POLY_constant1_val, v_POLY_mult2_product);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/output1\n\tdiffuseColor.xyz = v_POLY_mix1_mix;\n\tfloat POLY_metalness = 1.0;\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","customDepthDOFMaterial.vertex":"#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n\n\n\n// /geo1/MAT/meshPhysical_CLOTH/clothSolverPosition1\n// get vec2 tex coordinate from index\nvec2 getClothSolverUV( float id, vec2 textureSize ) { \n\n\tvec2 coords = vec2(\n\t\tfloor( mod( ( id + 0.5 ), textureSize.x ) ),\n\t\tfloor( ( id + 0.5 ) / textureSize.x )\n\t) + 0.5;\n\n\treturn coords / textureSize;\n\n}\n\n\nvec3 clothSolverPosition(sampler2D tPosition0, sampler2D tPosition1, vec2 clothSolverUv) {\n\treturn ( texture2D( tPosition0, clothSolverUv ).xyz + texture2D( tPosition1, clothSolverUv ).xyz ) / 1024.0;\n}\nvec3 clothSolverNormal(sampler2D tNormal, vec2 clothSolverUv) {\n\treturn normalize( texture2D( tNormal, clothSolverUv ).xyz );\n}\n\n\n\n\n\n\n\n// /geo1/MAT/meshPhysical_CLOTH/clothSolverPosition1\nuniform vec2 v_POLY_param_tSize;\nuniform sampler2D v_POLY_texture_tPosition0;\nuniform sampler2D v_POLY_texture_tPosition1;\nuniform sampler2D v_POLY_texture_tNormal;\n\n// /geo1/MAT/meshPhysical_CLOTH/attribute2\nvarying vec3 v_POLY_attribute_restP;\n\n// /geo1/MAT/meshPhysical_CLOTH/attribute1\nattribute float id;\n\n// /geo1/MAT/meshPhysical_CLOTH/attribute2\nattribute vec3 restP;\n\n\n\n\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_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/meshPhysical_CLOTH/attribute1\n\tfloat v_POLY_attribute1_val = id;\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/attribute2\n\tv_POLY_attribute_restP = vec3(restP);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/clothSolverPosition1\n\tvec2 v_POLY_clothSolverPosition1_clothSolverUv = getClothSolverUV(v_POLY_attribute1_val, v_POLY_param_tSize);\n\tvec3 v_POLY_clothSolverPosition1_position = clothSolverPosition(v_POLY_texture_tPosition0, v_POLY_texture_tPosition1, v_POLY_clothSolverPosition1_clothSolverUv);\n\tvec3 v_POLY_clothSolverPosition1_normal = clothSolverNormal(v_POLY_texture_tNormal, v_POLY_clothSolverPosition1_clothSolverUv);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/output1\n\tvec3 transformed = v_POLY_clothSolverPosition1_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}","customDepthDOFMaterial.fragment":"\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/meshPhysical_CLOTH/grid1\n// https://www.shadertoy.com/view/XtBfzz\n// https://iquilezles.org/articles/checkerfiltering/\n\nfloat gridTextureGradBox( in vec2 p, in float lineWidth, in vec2 ddx, in vec2 ddy )\n{\n\t// filter kernel\n\tvec2 w = max(abs(ddx), abs(ddy)) + 0.01;\n\n\t// analytic (box) filtering\n\tvec2 a = p + 0.5*w;\n\tvec2 b = p - 0.5*w;\n\tvec2 i = (floor(a)+min(fract(a)/lineWidth,1.0)-\n\t\t\t\tfloor(b)-min(fract(b)/lineWidth,1.0))/(w/lineWidth);\n\t//pattern\n\treturn (1.0-i.x)*(1.0-i.y);\n}\n\nfloat grid( in vec2 p, in float lineWidth )\n{\n // coordinates\n vec2 i = step( fract(p), vec2(1.0*lineWidth) );\n //pattern\n return (1.0-i.x)*(1.0-i.y); // grid (N=10)\n \n // other possible patterns are these\n //return 1.0-i.x*i.y; // squares (N=4)\n //return 1.0-i.x-i.y+2.0*i.x*i.y; // checker (N=2)\n}\n\n\n\n\n\n\n\n// /geo1/MAT/meshPhysical_CLOTH/attribute2\nvarying vec3 v_POLY_attribute_restP;\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 vec3 geometryNormal,\n\tconst in vec3 geometryViewDir,\n\tconst in SSSModel sssModel,\n\tinout ReflectedLight reflectedLight\n\t){\n\tvec3 scatteringHalf = normalize(directLight.direction + (geometryNormal * sssModel.distortion));\n\tfloat scatteringDot = pow(saturate(dot(geometryViewDir, -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/meshPhysical_CLOTH/constant2\n\tvec3 v_POLY_constant2_val = vec3(0.07036009568874305, 0.5906188409113381, 0.06662593863608139);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/constant1\n\tvec3 v_POLY_constant1_val = vec3(1.0, 1.0, 1.0);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/attribute2\n\tvec3 v_POLY_attribute2_val = v_POLY_attribute_restP;\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/constant3\n\tfloat v_POLY_constant3_val = 5.0;\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/vec3ToFloat1\n\tfloat v_POLY_vec3ToFloat1_y = v_POLY_attribute2_val.y;\n\tfloat v_POLY_vec3ToFloat1_z = v_POLY_attribute2_val.z;\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/vec3ToFloat2\n\tfloat v_POLY_vec3ToFloat2_x = v_POLY_attribute2_val.x;\n\tfloat v_POLY_vec3ToFloat2_y = v_POLY_attribute2_val.y;\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/floatToVec2_1\n\tvec2 v_POLY_floatToVec2_1_vec2 = vec2(v_POLY_vec3ToFloat1_y, v_POLY_vec3ToFloat1_z);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/floatToVec2_2\n\tvec2 v_POLY_floatToVec2_2_vec2 = vec2(v_POLY_vec3ToFloat2_x, v_POLY_vec3ToFloat2_y);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/grid1\n\tvec2 v_POLY_grid1_coord = v_POLY_floatToVec2_1_vec2*vec2(1.0, 1.0)*v_POLY_constant3_val;\n\tfloat v_POLY_grid1_grid = gridTextureGradBox(v_POLY_grid1_coord, 0.1, dFdx(v_POLY_grid1_coord), dFdy(v_POLY_grid1_coord));\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/grid2\n\tvec2 v_POLY_grid2_coord = v_POLY_floatToVec2_2_vec2*vec2(1.0, 1.0)*v_POLY_constant3_val;\n\tfloat v_POLY_grid2_grid = gridTextureGradBox(v_POLY_grid2_coord, 0.1, dFdx(v_POLY_grid2_coord), dFdy(v_POLY_grid2_coord));\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/mult2\n\tfloat v_POLY_mult2_product = (v_POLY_grid1_grid * v_POLY_grid2_grid * 1.0);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/mix1\n\tvec3 v_POLY_mix1_mix = mix(v_POLY_constant2_val, v_POLY_constant1_val, v_POLY_mult2_product);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/output1\n\tdiffuseColor.xyz = v_POLY_mix1_mix;\n\tfloat POLY_metalness = 1.0;\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"},"/ground/MAT/meshStandardBuilder1":{"vertex":"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_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\n\n\n// /ground/MAT/meshStandardBuilder1/globals1\nvarying vec3 v_POLY_globals1_position;\n\n\n\n\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 <color_vertex>\n\n\n\n\t// /ground/MAT/meshStandardBuilder1/globals1\n\tv_POLY_globals1_position = vec3(position);\n\t\n\t// /ground/MAT/meshStandardBuilder1/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\t#include <batching_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}","fragment":"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_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 USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n\n\n\n// /ground/MAT/meshStandardBuilder1/checkers1\n// https://iquilezles.org/articles/checkerfiltering/\nfloat checkers(vec2 p) {\n\tvec2 s = sign(fract(p*.5)-.5);\n\treturn .5 - .5*s.x*s.y;\n}\nfloat checkersGrad( in vec2 p, in vec2 ddx, in vec2 ddy )\n{\n // filter kernel\n vec2 w = max(abs(ddx), abs(ddy)) + 0.01;\n // analytical integral (box filter)\n vec2 i = 2.0*(abs(fract((p-0.5*w)/2.0)-0.5)-abs(fract((p+0.5*w)/2.0)-0.5))/w;\n // xor pattern\n return 0.5 - 0.5*i.x*i.y;\n}\n\n\n\n\n\n\n\n\n// /ground/MAT/meshStandardBuilder1/globals1\nvarying vec3 v_POLY_globals1_position;\n\n\n\n\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <iridescence_fragment>\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 <iridescence_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 vec3 geometryNormal,\n\tconst in vec3 geometryViewDir,\n\tconst in SSSModel sssModel,\n\tinout ReflectedLight reflectedLight\n\t){\n\tvec3 scatteringHalf = normalize(directLight.direction + (geometryNormal * sssModel.distortion));\n\tfloat scatteringDot = pow(saturate(dot(geometryViewDir, -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// /ground/MAT/meshStandardBuilder1/constant1\n\tvec3 v_POLY_constant1_val = vec3(0.24313725490196078, 0.5098039215686274, 0.8549019607843137);\n\t\n\t// /ground/MAT/meshStandardBuilder1/constant2\n\tvec3 v_POLY_constant2_val = vec3(0.047058823529411764, 0.10196078431372549, 0.17647058823529413);\n\t\n\t// /ground/MAT/meshStandardBuilder1/vec3ToFloat1\n\tfloat v_POLY_vec3ToFloat1_x = v_POLY_globals1_position.x;\n\tfloat v_POLY_vec3ToFloat1_z = v_POLY_globals1_position.z;\n\t\n\t// /ground/MAT/meshStandardBuilder1/floatToVec2_1\n\tvec2 v_POLY_floatToVec2_1_vec2 = vec2(v_POLY_vec3ToFloat1_x, v_POLY_vec3ToFloat1_z);\n\t\n\t// /ground/MAT/meshStandardBuilder1/checkers1\n\tvec2 v_POLY_checkers1_coord = v_POLY_floatToVec2_1_vec2*vec2(1.0, 1.0)*1.0;\n\tfloat v_POLY_checkers1_checker = checkersGrad(v_POLY_checkers1_coord, dFdx(v_POLY_checkers1_coord), dFdy(v_POLY_checkers1_coord));\n\t\n\t// /ground/MAT/meshStandardBuilder1/mix1\n\tvec3 v_POLY_mix1_mix = mix(v_POLY_constant1_val, v_POLY_constant2_val, v_POLY_checkers1_checker);\n\t\n\t// /ground/MAT/meshStandardBuilder1/output1\n\tdiffuseColor.xyz = v_POLY_mix1_mix;\n\tfloat POLY_metalness = 1.0;\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\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\t#include <alphahash_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, geometryNormal, geometryViewDir, 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#include <transmission_fragment>\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 + sheenSpecularDirect + sheenSpecularIndirect;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\n\t#endif\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}","customDepthMaterial.vertex":"#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n\n\n\n// /ground/MAT/meshStandardBuilder1/globals1\nvarying vec3 v_POLY_globals1_position;\n\n\n\n\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_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// /ground/MAT/meshStandardBuilder1/globals1\n\tv_POLY_globals1_position = vec3(position);\n\t\n\t// /ground/MAT/meshStandardBuilder1/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}","customDepthMaterial.fragment":"\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// /ground/MAT/meshStandardBuilder1/checkers1\n// https://iquilezles.org/articles/checkerfiltering/\nfloat checkers(vec2 p) {\n\tvec2 s = sign(fract(p*.5)-.5);\n\treturn .5 - .5*s.x*s.y;\n}\nfloat checkersGrad( in vec2 p, in vec2 ddx, in vec2 ddy )\n{\n // filter kernel\n vec2 w = max(abs(ddx), abs(ddy)) + 0.01;\n // analytical integral (box filter)\n vec2 i = 2.0*(abs(fract((p-0.5*w)/2.0)-0.5)-abs(fract((p+0.5*w)/2.0)-0.5))/w;\n // xor pattern\n return 0.5 - 0.5*i.x*i.y;\n}\n\n\n\n\n\n\n\n\n// /ground/MAT/meshStandardBuilder1/globals1\nvarying vec3 v_POLY_globals1_position;\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 vec3 geometryNormal,\n\tconst in vec3 geometryViewDir,\n\tconst in SSSModel sssModel,\n\tinout ReflectedLight reflectedLight\n\t){\n\tvec3 scatteringHalf = normalize(directLight.direction + (geometryNormal * sssModel.distortion));\n\tfloat scatteringDot = pow(saturate(dot(geometryViewDir, -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// /ground/MAT/meshStandardBuilder1/constant1\n\tvec3 v_POLY_constant1_val = vec3(0.24313725490196078, 0.5098039215686274, 0.8549019607843137);\n\t\n\t// /ground/MAT/meshStandardBuilder1/constant2\n\tvec3 v_POLY_constant2_val = vec3(0.047058823529411764, 0.10196078431372549, 0.17647058823529413);\n\t\n\t// /ground/MAT/meshStandardBuilder1/vec3ToFloat1\n\tfloat v_POLY_vec3ToFloat1_x = v_POLY_globals1_position.x;\n\tfloat v_POLY_vec3ToFloat1_z = v_POLY_globals1_position.z;\n\t\n\t// /ground/MAT/meshStandardBuilder1/floatToVec2_1\n\tvec2 v_POLY_floatToVec2_1_vec2 = vec2(v_POLY_vec3ToFloat1_x, v_POLY_vec3ToFloat1_z);\n\t\n\t// /ground/MAT/meshStandardBuilder1/checkers1\n\tvec2 v_POLY_checkers1_coord = v_POLY_floatToVec2_1_vec2*vec2(1.0, 1.0)*1.0;\n\tfloat v_POLY_checkers1_checker = checkersGrad(v_POLY_checkers1_coord, dFdx(v_POLY_checkers1_coord), dFdy(v_POLY_checkers1_coord));\n\t\n\t// /ground/MAT/meshStandardBuilder1/mix1\n\tvec3 v_POLY_mix1_mix = mix(v_POLY_constant1_val, v_POLY_constant2_val, v_POLY_checkers1_checker);\n\t\n\t// /ground/MAT/meshStandardBuilder1/output1\n\tdiffuseColor.xyz = v_POLY_mix1_mix;\n\tfloat POLY_metalness = 1.0;\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\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","customDistanceMaterial.vertex":"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n\n\n\n// /ground/MAT/meshStandardBuilder1/globals1\nvarying vec3 v_POLY_globals1_position;\n\n\n\n\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_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// /ground/MAT/meshStandardBuilder1/globals1\n\tv_POLY_globals1_position = vec3(position);\n\t\n\t// /ground/MAT/meshStandardBuilder1/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}","customDistanceMaterial.fragment":"\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// /ground/MAT/meshStandardBuilder1/checkers1\n// https://iquilezles.org/articles/checkerfiltering/\nfloat checkers(vec2 p) {\n\tvec2 s = sign(fract(p*.5)-.5);\n\treturn .5 - .5*s.x*s.y;\n}\nfloat checkersGrad( in vec2 p, in vec2 ddx, in vec2 ddy )\n{\n // filter kernel\n vec2 w = max(abs(ddx), abs(ddy)) + 0.01;\n // analytical integral (box filter)\n vec2 i = 2.0*(abs(fract((p-0.5*w)/2.0)-0.5)-abs(fract((p+0.5*w)/2.0)-0.5))/w;\n // xor pattern\n return 0.5 - 0.5*i.x*i.y;\n}\n\n\n\n\n\n\n\n\n// /ground/MAT/meshStandardBuilder1/globals1\nvarying vec3 v_POLY_globals1_position;\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 vec3 geometryNormal,\n\tconst in vec3 geometryViewDir,\n\tconst in SSSModel sssModel,\n\tinout ReflectedLight reflectedLight\n\t){\n\tvec3 scatteringHalf = normalize(directLight.direction + (geometryNormal * sssModel.distortion));\n\tfloat scatteringDot = pow(saturate(dot(geometryViewDir, -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// /ground/MAT/meshStandardBuilder1/constant1\n\tvec3 v_POLY_constant1_val = vec3(0.24313725490196078, 0.5098039215686274, 0.8549019607843137);\n\t\n\t// /ground/MAT/meshStandardBuilder1/constant2\n\tvec3 v_POLY_constant2_val = vec3(0.047058823529411764, 0.10196078431372549, 0.17647058823529413);\n\t\n\t// /ground/MAT/meshStandardBuilder1/vec3ToFloat1\n\tfloat v_POLY_vec3ToFloat1_x = v_POLY_globals1_position.x;\n\tfloat v_POLY_vec3ToFloat1_z = v_POLY_globals1_position.z;\n\t\n\t// /ground/MAT/meshStandardBuilder1/floatToVec2_1\n\tvec2 v_POLY_floatToVec2_1_vec2 = vec2(v_POLY_vec3ToFloat1_x, v_POLY_vec3ToFloat1_z);\n\t\n\t// /ground/MAT/meshStandardBuilder1/checkers1\n\tvec2 v_POLY_checkers1_coord = v_POLY_floatToVec2_1_vec2*vec2(1.0, 1.0)*1.0;\n\tfloat v_POLY_checkers1_checker = checkersGrad(v_POLY_checkers1_coord, dFdx(v_POLY_checkers1_coord), dFdy(v_POLY_checkers1_coord));\n\t\n\t// /ground/MAT/meshStandardBuilder1/mix1\n\tvec3 v_POLY_mix1_mix = mix(v_POLY_constant1_val, v_POLY_constant2_val, v_POLY_checkers1_checker);\n\t\n\t// /ground/MAT/meshStandardBuilder1/output1\n\tdiffuseColor.xyz = v_POLY_mix1_mix;\n\tfloat POLY_metalness = 1.0;\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\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","customDepthDOFMaterial.vertex":"#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n\n\n\n// /ground/MAT/meshStandardBuilder1/globals1\nvarying vec3 v_POLY_globals1_position;\n\n\n\n\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_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// /ground/MAT/meshStandardBuilder1/globals1\n\tv_POLY_globals1_position = vec3(position);\n\t\n\t// /ground/MAT/meshStandardBuilder1/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}","customDepthDOFMaterial.fragment":"\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// /ground/MAT/meshStandardBuilder1/checkers1\n// https://iquilezles.org/articles/checkerfiltering/\nfloat checkers(vec2 p) {\n\tvec2 s = sign(fract(p*.5)-.5);\n\treturn .5 - .5*s.x*s.y;\n}\nfloat checkersGrad( in vec2 p, in vec2 ddx, in vec2 ddy )\n{\n // filter kernel\n vec2 w = max(abs(ddx), abs(ddy)) + 0.01;\n // analytical integral (box filter)\n vec2 i = 2.0*(abs(fract((p-0.5*w)/2.0)-0.5)-abs(fract((p+0.5*w)/2.0)-0.5))/w;\n // xor pattern\n return 0.5 - 0.5*i.x*i.y;\n}\n\n\n\n\n\n\n\n\n// /ground/MAT/meshStandardBuilder1/globals1\nvarying vec3 v_POLY_globals1_position;\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 vec3 geometryNormal,\n\tconst in vec3 geometryViewDir,\n\tconst in SSSModel sssModel,\n\tinout ReflectedLight reflectedLight\n\t){\n\tvec3 scatteringHalf = normalize(directLight.direction + (geometryNormal * sssModel.distortion));\n\tfloat scatteringDot = pow(saturate(dot(geometryViewDir, -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// /ground/MAT/meshStandardBuilder1/constant1\n\tvec3 v_POLY_constant1_val = vec3(0.24313725490196078, 0.5098039215686274, 0.8549019607843137);\n\t\n\t// /ground/MAT/meshStandardBuilder1/constant2\n\tvec3 v_POLY_constant2_val = vec3(0.047058823529411764, 0.10196078431372549, 0.17647058823529413);\n\t\n\t// /ground/MAT/meshStandardBuilder1/vec3ToFloat1\n\tfloat v_POLY_vec3ToFloat1_x = v_POLY_globals1_position.x;\n\tfloat v_POLY_vec3ToFloat1_z = v_POLY_globals1_position.z;\n\t\n\t// /ground/MAT/meshStandardBuilder1/floatToVec2_1\n\tvec2 v_POLY_floatToVec2_1_vec2 = vec2(v_POLY_vec3ToFloat1_x, v_POLY_vec3ToFloat1_z);\n\t\n\t// /ground/MAT/meshStandardBuilder1/checkers1\n\tvec2 v_POLY_checkers1_coord = v_POLY_floatToVec2_1_vec2*vec2(1.0, 1.0)*1.0;\n\tfloat v_POLY_checkers1_checker = checkersGrad(v_POLY_checkers1_coord, dFdx(v_POLY_checkers1_coord), dFdy(v_POLY_checkers1_coord));\n\t\n\t// /ground/MAT/meshStandardBuilder1/mix1\n\tvec3 v_POLY_mix1_mix = mix(v_POLY_constant1_val, v_POLY_constant2_val, v_POLY_checkers1_checker);\n\t\n\t// /ground/MAT/meshStandardBuilder1/output1\n\tdiffuseColor.xyz = v_POLY_mix1_mix;\n\tfloat POLY_metalness = 1.0;\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\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"}},"jsFunctionBodies":{"/geo1/actor_clothSolver1":"// insert defines\nclass CustomActorEvaluator extends ActorEvaluator {\n\t// insert members\n\n\t// /geo1/actor_clothSolver1/rayFromCursor1\n\tv_POLY_rayFromCursor1_Ray = computed(() => globalsRayFromCursor());\n\n\t// /geo1/actor_clothSolver1/GetIntersectionAttribute1\n\tv_POLY_GetIntersectionAttribute1_val = computed(() =>\n\t\tgetIntersectionAttributeNumberNearest(this.v_POLY_onObjectPointerdown1_Intersection.value, \"id\", -1.0)\n\t);\n\n\t// /geo1/actor_clothSolver1/plane1\n\tv_POLY_plane1_Plane = computed(() =>\n\t\tplaneSet(VAR__plane1_normal.set(0, 0, 1), this.v_POLY_constant2_val.value, VAR__plane1__1)\n\t);\n\n\t// /geo1/actor_clothSolver1/rayIntersectPlane1\n\tv_POLY_rayIntersectPlane1_position = computed(() =>\n\t\trayIntersectPlane(this.v_POLY_rayFromCursor1_Ray.value, this.v_POLY_plane1_Plane.value, VAR__rayIntersectPlane1_)\n\t);\n\n\t// /geo1/actor_clothSolver1/null1\n\tv_POLY_null1_out = computed(() => VAR__null1_in.copy(this.v_POLY_rayIntersectPlane1_position.value));\n\n\t// /geo1/actor_clothSolver1/onTick1\n\tv_POLY_onTick1_time = computed(() => globalsTime());\n\tv_POLY_onTick1_delta = computed(() => globalsTimeDelta());\n\n\t// /geo1/actor_clothSolver1/constant2\n\tv_POLY_constant2_val = { value: -0.68 };\n\n\t// /geo1/actor_clothSolver1/clothSolverStepSimulation1\n\tv_POLY_clothSolverStepSimulation1_tSize = { value: null };\n\tv_POLY_clothSolverStepSimulation1_tPosition0 = { value: null };\n\tv_POLY_clothSolverStepSimulation1_tPosition1 = { value: null };\n\tv_POLY_clothSolverStepSimulation1_tNormal = { value: null };\n\tv_POLY_clothSolverStepSimulation1_tOriginalRT = { value: null };\n\tv_POLY_clothSolverStepSimulation1_tViscositySpringT = { value: null };\n\tv_POLY_clothSolverStepSimulation1_tPreviousRT0 = { value: null };\n\tv_POLY_clothSolverStepSimulation1_tPreviousRT1 = { value: null };\n\tv_POLY_clothSolverStepSimulation1_targetRT0 = { value: null };\n\tv_POLY_clothSolverStepSimulation1_targetRT1 = { value: null };\n\tv_POLY_clothSolverStepSimulation1_tNormalsRT = { value: null };\n\tv_POLY_clothSolverStepSimulation1_tPositionRT0 = { value: null };\n\tv_POLY_clothSolverStepSimulation1_tPositionRT1 = { value: null };\n\tv_POLY_clothSolverStepSimulation1_tAdjacentsRT0 = { value: null };\n\tv_POLY_clothSolverStepSimulation1_tAdjacentsRT1 = { value: null };\n\tv_POLY_clothSolverStepSimulation1_tDistanceRT0 = { value: null };\n\tv_POLY_clothSolverStepSimulation1_tDistanceRT1 = { value: null };\n\tv_POLY_clothSolverStepSimulation1_integrationMat = { value: null };\n\n\t// /geo1/actor_clothSolver1/onObjectPointerdown1\n\tv_POLY_onObjectPointerdown1_Intersection = ref(null);\n\n\tconstructor(node, object3D) {\n\t\tsuper(node, object3D);\n\t\t// insert after constructor\n\n\t\t// /geo1/actor_clothSolver1/onObjectPointerdown1\n\t\taddObjectToObjectPointerdownCheck(this.object3D, this, {\n\t\t\tpriority: { blockObjectsBehind: true, skipIfObjectsInFront: false },\n\t\t\tcpu: {\n\t\t\t\ttraverseChildren: false,\n\t\t\t\tpointsThreshold: 0.1,\n\t\t\t\tlineThreshold: 0.1,\n\t\t\t\tintersectionRef: this.v_POLY_onObjectPointerdown1_Intersection,\n\t\t\t},\n\t\t\tpointerdown: { callback: this.onObjectPointerdown1.bind(this) },\n\t\t\tconfig: { button: { left: true, middle: true, right: true }, modifier: { ctrl: 1.0, shift: 1.0, alt: 1.0 } },\n\t\t});\n\n\t\t// /geo1/actor_clothSolver1/onPointerup1\n\t\taddObjectToPointerupCheck(this.object3D, this, { pointerup: { callback: this.onPointerup1.bind(this) } });\n\t}\n\t// insert body\n\n\tonObjectPointerdown() {\n\t\tthis.onObjectPointerdown1();\n\t}\n\tonScenePause() {\n\t\tthis.onScenePause1();\n\t}\n\tonTick() {\n\t\tthis.onTick1();\n\t}\n\tonPointerup() {\n\t\tthis.onPointerup1();\n\t}\n\t// /geo1/actor_clothSolver1/onObjectPointerdown1\n\tonObjectPointerdown1() {\n\t\tthis.createClothConstraint1(0);\n\t}\n\n\t// /geo1/actor_clothSolver1/onScenePause1\n\tonScenePause1() {\n\t\tthis.clothSolverReset1(0);\n\t}\n\n\t// /geo1/actor_clothSolver1/onTick1\n\tonTick1() {\n\t\tthis.clothSolverStepSimulation1(0);\n\t\tthis.anyTrigger1(0);\n\t}\n\n\t// /geo1/actor_clothSolver1/onPointerup1\n\tonPointerup1() {\n\t\tthis.deleteClothConstraint1(0);\n\t}\n\n\t// /geo1/actor_clothSolver1/clothSolverReset1\n\tclothSolverReset1() {\n\t\tclothSolverReset(this.object3D);\n\t}\n\n\t// /geo1/actor_clothSolver1/clothSolverStepSimulation1\n\tclothSolverStepSimulation1() {\n\t\tclothSolverStepSimulation(this.object3D, 40.0, 0.1, 0.1, 1.0, {\n\t\t\ttSize: this.v_POLY_clothSolverStepSimulation1_tSize,\n\t\t\ttPosition0: this.v_POLY_clothSolverStepSimulation1_tPosition0,\n\t\t\ttPosition1: this.v_POLY_clothSolverStepSimulation1_tPosition1,\n\t\t\ttNormal: this.v_POLY_clothSolverStepSimulation1_tNormal,\n\t\t\ttOriginalRT: this.v_POLY_clothSolverStepSimulation1_tOriginalRT,\n\t\t\ttViscositySpringT: this.v_POLY_clothSolverStepSimulation1_tViscositySpringT,\n\t\t\ttPreviousRT0: this.v_POLY_clothSolverStepSimulation1_tPreviousRT0,\n\t\t\ttPreviousRT1: this.v_POLY_clothSolverStepSimulation1_tPreviousRT1,\n\t\t\ttTargetRT0: this.v_POLY_clothSolverStepSimulation1_targetRT0,\n\t\t\ttTargetRT1: this.v_POLY_clothSolverStepSimulation1_targetRT1,\n\t\t\ttNormalsRT: this.v_POLY_clothSolverStepSimulation1_tNormalsRT,\n\t\t\ttPositionRT0: this.v_POLY_clothSolverStepSimulation1_tPositionRT0,\n\t\t\ttPositionRT1: this.v_POLY_clothSolverStepSimulation1_tPositionRT1,\n\t\t\ttAdjacentsRT0: this.v_POLY_clothSolverStepSimulation1_tAdjacentsRT0,\n\t\t\ttAdjacentsRT1: this.v_POLY_clothSolverStepSimulation1_tAdjacentsRT1,\n\t\t\ttDistanceRT0: this.v_POLY_clothSolverStepSimulation1_tDistanceRT0,\n\t\t\ttDistanceRT1: this.v_POLY_clothSolverStepSimulation1_tDistanceRT1,\n\t\t\tintegrationMat: this.v_POLY_clothSolverStepSimulation1_integrationMat,\n\t\t});\n\t\tthis.clothSolverUpdateMaterial1(0);\n\t}\n\n\t// /geo1/actor_clothSolver1/clothSolverUpdateMaterial1\n\tclothSolverUpdateMaterial1() {\n\t\tclothSolverUpdateMaterial(\n\t\t\tthis.object3D.material,\n\t\t\t\"tSize\",\n\t\t\t\"tPosition0\",\n\t\t\t\"tPosition1\",\n\t\t\t\"tNormal\",\n\t\t\tthis.v_POLY_clothSolverStepSimulation1_tSize.value,\n\t\t\tthis.v_POLY_clothSolverStepSimulation1_tPosition0.value,\n\t\t\tthis.v_POLY_clothSolverStepSimulation1_tPosition1.value,\n\t\t\tthis.v_POLY_clothSolverStepSimulation1_tNormal.value\n\t\t);\n\t}\n\n\t// /geo1/actor_clothSolver1/anyTrigger1\n\tanyTrigger1() {\n\t\tthis.clothSolverSetSelectedVertexPosition1(0);\n\t}\n\n\t// /geo1/actor_clothSolver1/clothSolverSetSelectedVertexPosition1\n\tclothSolverSetSelectedVertexPosition1() {\n\t\tclothConstraintSetPosition(\n\t\t\tthis.object3D,\n\t\t\tVAR__clothSolverSetSelectedVertexPosition1_position.copy(this.v_POLY_null1_out.value),\n\t\t\t1.0\n\t\t);\n\t}\n\n\t// /geo1/actor_clothSolver1/createClothConstraint1\n\tcreateClothConstraint1() {\n\t\tclothCreateConstraint(this.object3D, this.v_POLY_GetIntersectionAttribute1_val.value);\n\t\tthis.anyTrigger1(1);\n\t}\n\n\t// /geo1/actor_clothSolver1/deleteClothConstraint1\n\tdeleteClothConstraint1() {\n\t\tclothDeleteConstraint(this.object3D);\n\t}\n}\nreturn CustomActorEvaluator;\n"}}
Code editor
{"multiple_panel":{"split_ratio":0.5,"split_panel0":{"split_ratio":0.5,"split_panel0":{"panelTypes":["viewer","params","network"],"currentPanelIndex":0,"panel_data":{"camera":"/cameras/cameras:sopGroup/perspectiveCamera_MAIN","isViewerInitLayoutData":true,"linkIndex":1,"overlayedNetwork":{"allowed":false,"displayed":false}}},"split_panel1":{"panelTypes":["viewer","params","network"],"currentPanelIndex":1,"panel_data":{"active_folder":null,"linkIndex":1}},"split_mode":"vertical"},"split_panel1":{"panelTypes":["viewer","params","network"],"currentPanelIndex":2,"panel_data":{"camera":{"position":{"x":0,"y":0},"zoom":0.5},"history":{},"paramsDisplayed":false,"linkIndex":1}},"split_mode":"horizontal"},"currentNodes":["/geo1","/geo1","/geo1","/geo1","/geo1","/geo1","/geo1","/geo1"],"navigationHistory":{"nodePaths":{"1":["/geo1"],"2":["/geo1"],"3":["/geo1"],"4":["/geo1"],"5":["/geo1"],"6":["/geo1"],"7":["/geo1"],"8":["/geo1"]},"index":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0}},"fullscreenPanelId":null,"saveOptions":{"checkRemoteAssetsUse":true,"minimizeFilesCount":false},"paramsModal":[]}
Used nodes
event/cameraOrbitControls;mat/meshBasic;mat/meshPhysicalBuilder;mat/meshStandardBuilder;obj/geo;sop/actor;sop/box;sop/cameraControls;sop/clothPrepare;sop/clothSolver;sop/fileOBJ;sop/hemisphereLight;sop/hierarchy;sop/icosahedron;sop/material;sop/materialsNetwork;sop/merge;sop/objectProperties;sop/perspectiveCamera;sop/polarTransform;sop/restAttributes;sop/spotLight;sop/switch;sop/text;sop/transform
Used operations
Used modules
Used assemblers
GL_CLOTH;GL_MESH_PHYSICAL;GL_MESH_STANDARD;JS_ACTOR
Used integrations
[]
Used assets
Nodes map
{"/geo1":"obj/geo","/geo1/icosahedron1":"sop/icosahedron","/geo1/clothSolver1":"sop/clothSolver","/geo1/clothPrepare1":"sop/clothPrepare","/geo1/material1":"sop/material","/geo1/MAT":"sop/materialsNetwork","/geo1/MAT/meshPhysical_CLOTH":"mat/meshPhysicalBuilder","/geo1/actor_clothSolver1":"sop/actor","/geo1/restAttributes1":"sop/restAttributes","/geo1/fileOBJ1":"sop/fileOBJ","/geo1/hierarchy1":"sop/hierarchy","/geo1/transform1":"sop/transform","/geo1/objectProperties1":"sop/objectProperties","/geo1/switch_CHARACTER":"sop/switch","/ground":"obj/geo","/ground/material1":"sop/material","/ground/MAT":"sop/materialsNetwork","/ground/MAT/meshStandardBuilder1":"mat/meshStandardBuilder","/ground/box1":"sop/box","/lights":"obj/geo","/lights/hemisphereLight1":"sop/hemisphereLight","/lights/spotLight1":"sop/spotLight","/lights/polarTransform1":"sop/polarTransform","/lights/merge1":"sop/merge","/cameras":"obj/geo","/cameras/cameraControls1":"sop/cameraControls","/cameras/cameraControls1/cameraOrbitControls1":"event/cameraOrbitControls","/cameras/perspectiveCamera_DEBUG":"sop/perspectiveCamera","/cameras/perspectiveCamera_MAIN":"sop/perspectiveCamera","/cameras/polarTransform1":"sop/polarTransform","/cameras/merge1":"sop/merge","/text":"obj/geo","/text/text1":"sop/text","/text/transform1":"sop/transform","/text/material1":"sop/material","/text/MAT":"sop/materialsNetwork","/text/MAT/meshBasic1":"mat/meshBasic"}
Js version
Editor version
Engine version
Name
*
Code
{"properties":{"frame":208,"maxFrame":600,"maxFrameLocked":false,"realtimeState":true,"mainCameraPath":"/cameras/cameras:sopGroup/perspectiveCamera_MAIN","versions":{"polygonjs":"1.5.82"}},"root":{"type":"root","nodes":{"geo1":{"type":"geo","nodes":{"icosahedron1":{"type":"icosahedron","params":{"detail":11}},"clothSolver1":{"type":"clothSolver","nodes":{"globals1":{"type":"globals"},"output1":{"type":"output","inputs":[{"index":0,"inputName":"position","node":"globals1","output":"position"}]}},"inputs":["actor_clothSolver1"],"persisted_config":{"texture_allocations":{"writable":[{"position":[{"name":"position","size":3,"nodes":["/geo1/clothSolver1/output1","/geo1/clothSolver1/globals1"]}]}],"readonly":[]},"param_uniform_pairs":[],"uniforms_owner":{"metadata":{"version":4.6,"type":"Material","generator":"Material.toJSON"},"uuid":"/geo1/clothSolver1-main","type":"ShaderMaterial","blendColor":0,"forceSinglePass":true,"fog":false,"glslVersion":null,"uniforms":{},"vertexShader":"void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}","fragmentShader":"void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}","lights":false,"clipping":false}}},"clothPrepare1":{"type":"clothPrepare","inputs":["restAttributes1"]},"material1":{"type":"material","params":{"material":"../MAT/meshPhysical_CLOTH"},"inputs":["clothSolver1"],"flags":{"display":true}},"MAT":{"type":"materialsNetwork","nodes":{"meshPhysical_CLOTH":{"type":"meshPhysicalBuilder","nodes":{"globals1":{"type":"globals"},"output1":{"type":"output","inputs":[{"index":0,"inputName":"position","node":"clothSolverPosition1","output":"position"},null,{"index":2,"inputName":"color","node":"mix1","output":"mix"}]},"clothSolverPosition1":{"type":"clothSolverPosition","params":{"id":{"overriden_options":{}}},"inputs":[{"index":0,"inputName":"id","node":"attribute1","output":"val"}]},"attribute1":{"type":"attribute","params":{"name":"id"},"connection_points":{"in":[],"out":[{"name":"val","type":"float"}]}},"attribute2":{"type":"attribute","params":{"name":"restP","type":2},"connection_points":{"in":[],"out":[{"name":"val","type":"vec3"}]}},"mix1":{"type":"mix","params":{"value0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false,"computeOnDirty":true,"dependentOnFoundParam":false}},"value1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false,"computeOnDirty":true,"dependentOnFoundParam":false}},"blend":{"type":"float","default_value":0.5,"options":{"spare":true,"editable":false,"computeOnDirty":true,"dependentOnFoundParam":false}}},"inputs":[{"index":0,"inputName":"value0","node":"constant2","output":"val"},{"index":1,"inputName":"value1","node":"constant1","output":"val"},{"index":2,"inputName":"blend","node":"mult2","output":"product"}],"connection_points":{"in":[{"name":"value0","type":"vec3"},{"name":"value1","type":"vec3"},{"name":"blend","type":"float"}],"out":[{"name":"mix","type":"vec3"}]}},"constant1":{"type":"constant","params":{"type":4,"color":[1,1,1],"asColor":true},"connection_points":{"in":[],"out":[{"name":"val","type":"vec3"}]}},"constant2":{"type":"constant","params":{"type":4,"color":[0.07036009568874305,0.5906188409113381,0.06662593863608139],"asColor":true},"connection_points":{"in":[],"out":[{"name":"val","type":"vec3"}]}},"vec3ToFloat1":{"type":"vec3ToFloat","params":{"vec":{"overriden_options":{}}},"inputs":[{"index":0,"inputName":"vec","node":"attribute2","output":"val"}]},"floatToVec2_1":{"type":"floatToVec2","params":{"x":{"overriden_options":{}},"y":{"overriden_options":{}}},"inputs":[{"index":0,"inputName":"x","node":"vec3ToFloat1","output":"y"},{"index":1,"inputName":"y","node":"vec3ToFloat1","output":"z"}]},"vec3ToFloat2":{"type":"vec3ToFloat","params":{"vec":{"overriden_options":{}}},"inputs":[{"index":0,"inputName":"vec","node":"attribute2","output":"val"}]},"floatToVec2_2":{"type":"floatToVec2","params":{"x":{"overriden_options":{}},"y":{"overriden_options":{}}},"inputs":[{"index":0,"inputName":"x","node":"vec3ToFloat2","output":"x"},{"index":1,"inputName":"y","node":"vec3ToFloat2","output":"y"}]},"grid1":{"type":"grid","params":{"uv":{"overriden_options":{}},"lineWidth":{"overriden_options":{}},"freq":{"overriden_options":{}},"freqMult":{"raw_input":5.9,"overriden_options":{}}},"inputs":[{"index":0,"inputName":"uv","node":"floatToVec2_1","output":"vec2"},null,null,{"index":3,"inputName":"freqMult","node":"constant3","output":"val"}]},"constant3":{"type":"constant","params":{"float":5},"connection_points":{"in":[],"out":[{"name":"val","type":"float"}]}},"grid2":{"type":"grid","params":{"uv":{"overriden_options":{}},"lineWidth":{"overriden_options":{}},"freq":{"overriden_options":{}},"freqMult":{"raw_input":5.9,"overriden_options":{}}},"inputs":[{"index":0,"inputName":"uv","node":"floatToVec2_2","output":"vec2"},null,null,{"index":3,"inputName":"freqMult","node":"constant3","output":"val"}]},"mult2":{"type":"mult","params":{"mult0":{"type":"float","default_value":1,"options":{"spare":true,"editable":false,"computeOnDirty":true,"dependentOnFoundParam":false}},"mult1":{"type":"float","default_value":1,"options":{"spare":true,"editable":false,"computeOnDirty":true,"dependentOnFoundParam":false}},"mult2":{"type":"float","default_value":1,"options":{"spare":true,"editable":true,"computeOnDirty":true,"dependentOnFoundParam":false}}},"maxInputsCount":3,"inputs":[{"index":0,"inputName":"mult0","node":"grid1","output":"grid"},{"index":1,"inputName":"mult1","node":"grid2","output":"grid"}],"connection_points":{"in":[{"name":"mult0","type":"float"},{"name":"mult1","type":"float"},{"name":"mult2","type":"float"}],"out":[{"name":"product","type":"float"}]}}},"params":{"tSize":{"type":"vector2","default_value":[1,1],"options":{"spare":true,"computeOnDirty":true,"cook":false,"dependentOnFoundNode":true},"overriden_options":{"callback":"{}"}},"tPosition0":{"type":"node_path","default_value":"","options":{"spare":true,"computeOnDirty":true,"cook":false,"dependentOnFoundNode":true,"nodeSelection":{"context":"cop"}},"overriden_options":{"callback":"{}"}},"tPosition1":{"type":"node_path","default_value":"","options":{"spare":true,"computeOnDirty":true,"cook":false,"dependentOnFoundNode":true,"nodeSelection":{"context":"cop"}},"overriden_options":{"callback":"{}"}},"tNormal":{"type":"node_path","default_value":"","options":{"spare":true,"computeOnDirty":true,"cook":false,"dependentOnFoundNode":true,"nodeSelection":{"context":"cop"}},"overriden_options":{"callback":"{}"}}},"persisted_config":{"material":{"metadata":{"version":4.6,"type":"Material","generator":"Material.toJSON"},"uuid":"/geo1/MAT/meshPhysical_CLOTH-main","type":"MeshPhysicalMaterial","color":16777215,"roughness":1,"metalness":0,"sheen":0,"sheenColor":0,"sheenRoughness":1,"emissive":0,"specularIntensity":1,"specularColor":16777215,"clearcoat":0,"clearcoatRoughness":0,"iridescence":0,"iridescenceIOR":1.3,"iridescenceThicknessRange":[100,400],"anisotropy":0,"anisotropyRotation":0,"envMapIntensity":1,"reflectivity":0.49999999999999983,"transmission":0,"thickness":0.01,"attenuationDistance":100,"attenuationColor":16777215,"blendColor":0,"fog":false},"onBeforeCompileDataJSONWithoutShaders":{"paramConfigs":[{"type":"vector2","name":"tSize","defaultValue":[1,1],"uniformName":"v_POLY_param_tSize"},{"type":"node_path","name":"tPosition0","defaultValue":"","uniformName":"v_POLY_texture_tPosition0"},{"type":"node_path","name":"tPosition1","defaultValue":"","uniformName":"v_POLY_texture_tPosition1"},{"type":"node_path","name":"tNormal","defaultValue":"","uniformName":"v_POLY_texture_tNormal"}],"timeDependent":false,"resolutionDependent":false,"raymarchingLightsWorldCoordsDependent":false},"customMaterials":{"customDepthMaterial":{"material":{"metadata":{"version":4.6,"type":"Material","generator":"Material.toJSON"},"uuid":"/geo1/MAT/meshPhysical_CLOTH-customDepthMaterial","type":"MeshDepthMaterial","name":"customDepthMaterial","side":1,"blendColor":0,"depthPacking":3201},"onBeforeCompileDataJSONWithoutShaders":{"paramConfigs":[{"type":"vector2","name":"tSize","defaultValue":[1,1],"uniformName":"v_POLY_param_tSize"},{"type":"node_path","name":"tPosition0","defaultValue":"","uniformName":"v_POLY_texture_tPosition0"},{"type":"node_path","name":"tPosition1","defaultValue":"","uniformName":"v_POLY_texture_tPosition1"},{"type":"node_path","name":"tNormal","defaultValue":"","uniformName":"v_POLY_texture_tNormal"}],"timeDependent":false,"resolutionDependent":false,"raymarchingLightsWorldCoordsDependent":false}},"customDistanceMaterial":{"material":{"metadata":{"version":4.6,"type":"Material","generator":"Material.toJSON"},"uuid":"/geo1/MAT/meshPhysical_CLOTH-customDistanceMaterial","type":"MeshDistanceMaterial","name":"customDistanceMaterial","blendColor":0},"onBeforeCompileDataJSONWithoutShaders":{"paramConfigs":[{"type":"vector2","name":"tSize","defaultValue":[1,1],"uniformName":"v_POLY_param_tSize"},{"type":"node_path","name":"tPosition0","defaultValue":"","uniformName":"v_POLY_texture_tPosition0"},{"type":"node_path","name":"tPosition1","defaultValue":"","uniformName":"v_POLY_texture_tPosition1"},{"type":"node_path","name":"tNormal","defaultValue":"","uniformName":"v_POLY_texture_tNormal"}],"timeDependent":false,"resolutionDependent":false,"raymarchingLightsWorldCoordsDependent":false}},"customDepthDOFMaterial":{"material":{"metadata":{"version":4.6,"type":"Material","generator":"Material.toJSON"},"uuid":"/geo1/MAT/meshPhysical_CLOTH-customDepthDOFMaterial","type":"MeshDepthMaterial","name":"customDepthDOFMaterial","blendColor":0,"depthPacking":3200},"onBeforeCompileDataJSONWithoutShaders":{"paramConfigs":[{"type":"vector2","name":"tSize","defaultValue":[1,1],"uniformName":"v_POLY_param_tSize"},{"type":"node_path","name":"tPosition0","defaultValue":"","uniformName":"v_POLY_texture_tPosition0"},{"type":"node_path","name":"tPosition1","defaultValue":"","uniformName":"v_POLY_texture_tPosition1"},{"type":"node_path","name":"tNormal","defaultValue":"","uniformName":"v_POLY_texture_tNormal"}],"timeDependent":false,"resolutionDependent":false,"raymarchingLightsWorldCoordsDependent":false}}}}}}},"actor_clothSolver1":{"type":"actor","nodes":{"onScenePause1":{"type":"onScenePause"},"onTick1":{"type":"onTick"},"clothSolverReset1":{"type":"clothSolverReset","inputs":[{"index":0,"inputName":"trigger","node":"onScenePause1","output":"trigger"}]},"clothSolverStepSimulation1":{"type":"clothSolverStepSimulation","maxInputsCount":6,"inputs":[{"index":0,"inputName":"trigger","node":"onTick1","output":"trigger"}]},"clothSolverUpdateMaterial1":{"type":"clothSolverUpdateMaterial","maxInputsCount":10,"inputs":[{"index":0,"inputName":"trigger","node":"clothSolverStepSimulation1","output":"trigger"},null,{"index":2,"inputName":"tSize","node":"clothSolverStepSimulation1","output":"tSize"},{"index":3,"inputName":"tPosition0","node":"clothSolverStepSimulation1","output":"tPosition0"},{"index":4,"inputName":"tPosition1","node":"clothSolverStepSimulation1","output":"tPosition1"},{"index":5,"inputName":"tNormal","node":"clothSolverStepSimulation1","output":"tNormal"}]},"onObjectPointerdown1":{"type":"onObjectPointerdown","params":{"traverseChildren":false},"maxInputsCount":10},"GetIntersectionAttribute1":{"type":"getIntersectionAttribute","params":{"type":3,"interpolated":false,"attribName":{"type":"string","default_value":"","options":{"spare":true,"editable":true,"computeOnDirty":true,"dependentOnFoundParam":false},"raw_input":"id"},"notFoundValue":{"type":"integer","default_value":-1,"options":{"spare":true,"editable":true,"computeOnDirty":true,"dependentOnFoundParam":false}}},"maxInputsCount":3,"inputs":[{"index":0,"inputName":"Intersection","node":"onObjectPointerdown1","output":"Intersection"}],"connection_points":{"in":[{"name":"Intersection","type":"Intersection","isArray":false},{"name":"attribName","type":"string","isArray":false},{"name":"notFoundValue","type":"int","isArray":false}],"out":[{"name":"val","type":"int","isArray":false}]}},"clothSolverSetSelectedVertexPosition1":{"type":"setClothConstraintPosition","params":{"position":{"overriden_options":{}},"lerp":{"overriden_options":{}}},"maxInputsCount":4,"inputs":[{"index":0,"inputName":"trigger","node":"anyTrigger1","output":"trigger"},null,{"index":2,"inputName":"position","node":"null1","output":"out"}]},"constant2":{"type":"constant","params":{"float":-0.68},"connection_points":{"in":[],"out":[{"name":"val","type":"float","isArray":false}]}},"null1":{"type":"null","params":{"in":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false,"computeOnDirty":true,"dependentOnFoundParam":false}}},"inputs":[{"index":0,"inputName":"in","node":"rayIntersectPlane1","output":"position"}],"connection_points":{"in":[{"name":"in","type":"Vector3","isArray":false}],"out":[{"name":"out","type":"Vector3","isArray":false}]}},"plane1":{"type":"plane","params":{"normal":{"raw_input":[0,0,1],"overriden_options":{}},"constant":{"overriden_options":{}}},"inputs":[null,{"index":1,"inputName":"constant","node":"constant2","output":"val"}]},"rayFromCursor1":{"type":"rayFromCursor","params":{"element":1}},"rayIntersectPlane1":{"type":"rayIntersectPlane","inputs":[{"index":0,"inputName":"Ray","node":"rayFromCursor1","output":"Ray"},{"index":1,"inputName":"Plane","node":"plane1","output":"Plane"}]},"anyTrigger1":{"type":"anyTrigger","maxInputsCount":3,"inputs":[{"index":0,"inputName":"trigger0","node":"onTick1","output":"trigger"},{"index":1,"inputName":"trigger1","node":"createClothConstraint1","output":"trigger"}],"connection_points":{"in":[{"name":"trigger0","type":"trigger","isArray":false},{"name":"trigger1","type":"trigger","isArray":false},{"name":"trigger2","type":"trigger","isArray":false}],"out":[{"name":"trigger","type":"trigger","isArray":false}]}},"onPointerup1":{"type":"onPointerup","params":{"element":1}},"createClothConstraint1":{"type":"createClothConstraint","params":{"index":{"overriden_options":{}}},"maxInputsCount":3,"inputs":[{"index":0,"inputName":"trigger","node":"onObjectPointerdown1","output":"trigger"},null,{"index":2,"inputName":"index","node":"GetIntersectionAttribute1","output":"val"}]},"deleteClothConstraint1":{"type":"deleteClothConstraint","inputs":[{"index":0,"inputName":"trigger","node":"onPointerup1","output":"trigger"}]}},"inputs":["clothPrepare1"],"persisted_config":{"variableNames":["VAR__plane1_normal","VAR__plane1__1","VAR__rayIntersectPlane1_","VAR__null1_in","VAR__clothSolverSetSelectedVertexPosition1_position"],"variables":[{"type":"Vector3","data":[0,0,0]},{"type":"Plane","data":{"normal":[1,0,0],"constant":0}},{"type":"Vector3","data":[0,0,0]},{"type":"Vector3","data":[0,0,0]},{"type":"Vector3","data":[0,0,0]}],"functionNames":["globalsRayFromCursor","getIntersectionAttributeNumberNearest","planeSet","rayIntersectPlane","globalsTime","globalsTimeDelta","addObjectToObjectPointerdownCheck","addObjectToPointerupCheck","clothSolverReset","clothSolverStepSimulation","clothSolverUpdateMaterial","clothConstraintSetPosition","clothCreateConstraint","clothDeleteConstraint"],"serializedParamConfigs":[],"eventDatas":[{"type":"pointerdown","emitter":"canvas","jsType":"onObjectPointerdown"},{"type":"pointermove","emitter":"document","jsType":"rayFromCursor"},{"type":"touchmove","emitter":"document","jsType":"rayFromCursor"},{"type":"touchend","emitter":"document","jsType":"onPointerup"}]}},"restAttributes1":{"type":"restAttributes","inputs":["switch_CHARACTER"]},"fileOBJ1":{"type":"fileOBJ","params":{"url":"https://raw.githubusercontent.com/polygonjs/polygonjs-assets/master/models/cloth/cloth_character_01.obj"}},"hierarchy1":{"type":"hierarchy","params":{"mode":1},"inputs":["fileOBJ1"]},"transform1":{"type":"transform","params":{"scale":2},"inputs":["hierarchy1"]},"objectProperties1":{"type":"objectProperties","params":{"tcastShadow":true},"inputs":["transform1"]},"switch_CHARACTER":{"type":"switch","inputs":["icosahedron1","objectProperties1"]}},"params":{"CADLinearTolerance":{"overriden_options":{"callback":"{}"}},"CADAngularTolerance":{"overriden_options":{"callback":"{}"}},"CADCurveAbscissa":{"overriden_options":{"callback":"{}"}},"CADCurveTolerance":{"overriden_options":{"callback":"{}"}},"CADDisplayEdges":{"overriden_options":{"callback":"{}"}},"CADEdgesColor":{"overriden_options":{"callback":"{}"}},"CADDisplayMeshes":{"overriden_options":{"callback":"{}"}},"CADMeshesColor":{"overriden_options":{"callback":"{}"}},"CADWireframe":{"overriden_options":{"callback":"{}"}},"CSGFacetAngle":{"overriden_options":{"callback":"{}"}},"CSGLinesColor":{"overriden_options":{"callback":"{}"}},"CSGMeshesColor":{"overriden_options":{"callback":"{}"}},"CSGWireframe":{"overriden_options":{"callback":"{}"}},"QUADTriangles":{"overriden_options":{"callback":"{}"}},"QUADWireframe":{"overriden_options":{"callback":"{}"}},"TetScale":{"overriden_options":{"callback":"{}"}},"TetDisplayLines":{"overriden_options":{"callback":"{}"}},"TetDisplaySharedFaces":{"overriden_options":{"callback":"{}"}},"TetDisplayPoints":{"overriden_options":{"callback":"{}"}},"TetDisplayCenter":{"overriden_options":{"callback":"{}"}},"TetDisplaySphere":{"overriden_options":{"callback":"{}"}}},"flags":{"display":true}},"ground":{"type":"geo","nodes":{"material1":{"type":"material","params":{"material":"../MAT/meshStandardBuilder1"},"inputs":["box1"],"flags":{"display":true}},"MAT":{"type":"materialsNetwork","nodes":{"meshStandardBuilder1":{"type":"meshStandardBuilder","nodes":{"globals1":{"type":"globals"},"output1":{"type":"output","inputs":[null,null,{"index":2,"inputName":"color","node":"mix1","output":"mix"}]},"vec3ToFloat1":{"type":"vec3ToFloat","params":{"vec":{"overriden_options":{}}},"inputs":[{"index":0,"inputName":"vec","node":"globals1","output":"position"}]},"floatToVec2_1":{"type":"floatToVec2","params":{"x":{"overriden_options":{}},"y":{"overriden_options":{}}},"inputs":[{"index":0,"inputName":"x","node":"vec3ToFloat1","output":"x"},{"index":1,"inputName":"y","node":"vec3ToFloat1","output":"z"}]},"checkers1":{"type":"checkers","params":{"uv":{"overriden_options":{}},"freq":{"overriden_options":{}},"freqMult":{"overriden_options":{}}},"inputs":[{"index":0,"inputName":"uv","node":"floatToVec2_1","output":"vec2"}]},"mix1":{"type":"mix","params":{"value0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"value1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"blend":{"type":"float","default_value":0.5,"options":{"spare":true,"editable":false}}},"inputs":[{"index":0,"inputName":"value0","node":"constant1","output":"val"},{"index":1,"inputName":"value1","node":"constant2","output":"val"},{"index":2,"inputName":"blend","node":"checkers1","output":"checker"}],"connection_points":{"in":[{"name":"value0","type":"vec3"},{"name":"value1","type":"vec3"},{"name":"blend","type":"float"}],"out":[{"name":"mix","type":"vec3"}]}},"constant1":{"type":"constant","params":{"type":4,"color":[0.24313725490196078,0.5098039215686274,0.8549019607843137],"asColor":true},"connection_points":{"in":[],"out":[{"name":"val","type":"vec3"}]}},"constant2":{"type":"constant","params":{"type":4,"color":[0.047058823529411764,0.10196078431372549,0.17647058823529413],"asColor":true},"connection_points":{"in":[],"out":[{"name":"val","type":"vec3"}]}}},"persisted_config":{"material":{"metadata":{"version":4.6,"type":"Material","generator":"Material.toJSON"},"uuid":"/ground/MAT/meshStandardBuilder1-main","type":"MeshStandardMaterial","color":16777215,"roughness":1,"metalness":0,"emissive":0,"envMapIntensity":1,"blendColor":0,"fog":false},"onBeforeCompileDataJSONWithoutShaders":{"paramConfigs":[],"timeDependent":false,"resolutionDependent":false,"raymarchingLightsWorldCoordsDependent":false},"customMaterials":{"customDepthMaterial":{"material":{"metadata":{"version":4.6,"type":"Material","generator":"Material.toJSON"},"uuid":"/ground/MAT/meshStandardBuilder1-customDepthMaterial","type":"MeshDepthMaterial","name":"customDepthMaterial","side":1,"blendColor":0,"depthPacking":3201},"onBeforeCompileDataJSONWithoutShaders":{"paramConfigs":[],"timeDependent":false,"resolutionDependent":false,"raymarchingLightsWorldCoordsDependent":false}},"customDistanceMaterial":{"material":{"metadata":{"version":4.6,"type":"Material","generator":"Material.toJSON"},"uuid":"/ground/MAT/meshStandardBuilder1-customDistanceMaterial","type":"MeshDistanceMaterial","name":"customDistanceMaterial","blendColor":0},"onBeforeCompileDataJSONWithoutShaders":{"paramConfigs":[],"timeDependent":false,"resolutionDependent":false,"raymarchingLightsWorldCoordsDependent":false}},"customDepthDOFMaterial":{"material":{"metadata":{"version":4.6,"type":"Material","generator":"Material.toJSON"},"uuid":"/ground/MAT/meshStandardBuilder1-customDepthDOFMaterial","type":"MeshDepthMaterial","name":"customDepthDOFMaterial","blendColor":0,"depthPacking":3200},"onBeforeCompileDataJSONWithoutShaders":{"paramConfigs":[],"timeDependent":false,"resolutionDependent":false,"raymarchingLightsWorldCoordsDependent":false}}}}}}},"box1":{"type":"box","params":{"sizes":[9.98,1,9.98],"center":[0,-1.5,0]}}},"params":{"CADLinearTolerance":{"overriden_options":{"callback":"{}"}},"CADAngularTolerance":{"overriden_options":{"callback":"{}"}},"CADCurveAbscissa":{"overriden_options":{"callback":"{}"}},"CADCurveTolerance":{"overriden_options":{"callback":"{}"}},"CADDisplayEdges":{"overriden_options":{"callback":"{}"}},"CADEdgesColor":{"overriden_options":{"callback":"{}"}},"CADDisplayMeshes":{"overriden_options":{"callback":"{}"}},"CADMeshesColor":{"overriden_options":{"callback":"{}"}},"CADWireframe":{"overriden_options":{"callback":"{}"}},"CSGFacetAngle":{"overriden_options":{"callback":"{}"}},"CSGLinesColor":{"overriden_options":{"callback":"{}"}},"CSGMeshesColor":{"overriden_options":{"callback":"{}"}},"CSGWireframe":{"overriden_options":{"callback":"{}"}},"QUADTriangles":{"overriden_options":{"callback":"{}"}},"QUADWireframe":{"overriden_options":{"callback":"{}"}},"TetScale":{"overriden_options":{"callback":"{}"}},"TetDisplayLines":{"overriden_options":{"callback":"{}"}},"TetDisplaySharedFaces":{"overriden_options":{"callback":"{}"}},"TetDisplayPoints":{"overriden_options":{"callback":"{}"}},"TetDisplayCenter":{"overriden_options":{"callback":"{}"}},"TetDisplaySphere":{"overriden_options":{"callback":"{}"}}},"flags":{"display":true}},"lights":{"type":"geo","nodes":{"hemisphereLight1":{"type":"hemisphereLight","params":{"intensity":0.52}},"spotLight1":{"type":"spotLight","params":{"decay":0.1,"distance":10,"castShadow":true}},"polarTransform1":{"type":"polarTransform","params":{"center":[0,0.7,0],"latitude":25.2,"depth":3},"inputs":["spotLight1"]},"merge1":{"type":"merge","inputs":["hemisphereLight1","polarTransform1"],"flags":{"display":true}}},"params":{"CADLinearTolerance":{"overriden_options":{"callback":"{}"}},"CADAngularTolerance":{"overriden_options":{"callback":"{}"}},"CADCurveAbscissa":{"overriden_options":{"callback":"{}"}},"CADCurveTolerance":{"overriden_options":{"callback":"{}"}},"CADDisplayEdges":{"overriden_options":{"callback":"{}"}},"CADEdgesColor":{"overriden_options":{"callback":"{}"}},"CADDisplayMeshes":{"overriden_options":{"callback":"{}"}},"CADMeshesColor":{"overriden_options":{"callback":"{}"}},"CADWireframe":{"overriden_options":{"callback":"{}"}},"CSGFacetAngle":{"overriden_options":{"callback":"{}"}},"CSGLinesColor":{"overriden_options":{"callback":"{}"}},"CSGMeshesColor":{"overriden_options":{"callback":"{}"}},"CSGWireframe":{"overriden_options":{"callback":"{}"}},"QUADTriangles":{"overriden_options":{"callback":"{}"}},"QUADWireframe":{"overriden_options":{"callback":"{}"}},"TetScale":{"overriden_options":{"callback":"{}"}},"TetDisplayLines":{"overriden_options":{"callback":"{}"}},"TetDisplaySharedFaces":{"overriden_options":{"callback":"{}"}},"TetDisplayPoints":{"overriden_options":{"callback":"{}"}},"TetDisplayCenter":{"overriden_options":{"callback":"{}"}},"TetDisplaySphere":{"overriden_options":{"callback":"{}"}}},"flags":{"display":true}},"cameras":{"type":"geo","nodes":{"cameraControls1":{"type":"cameraControls","nodes":{"cameraOrbitControls1":{"type":"cameraOrbitControls","params":{"target":[-0.48148989880391097,-0.29222906804685,0.3218829791777303]}}},"params":{"node":"cameraOrbitControls1"},"inputs":["perspectiveCamera_DEBUG"]},"perspectiveCamera_DEBUG":{"type":"perspectiveCamera","params":{"position":[1.608706467168788,1.554179582392217,5.848803064387538],"rotation":[-18.473177623517042,19.732503241606356,6.435389783988498]}},"perspectiveCamera_MAIN":{"type":"perspectiveCamera","params":{"position":[3.3,3.3,3.3]}},"polarTransform1":{"type":"polarTransform","params":{"latitude":7.2,"depth":5.7},"inputs":["perspectiveCamera_MAIN"]},"merge1":{"type":"merge","inputs":["cameraControls1","polarTransform1"],"flags":{"display":true}}},"params":{"CADLinearTolerance":{"overriden_options":{"callback":"{}"}},"CADAngularTolerance":{"overriden_options":{"callback":"{}"}},"CADCurveAbscissa":{"overriden_options":{"callback":"{}"}},"CADCurveTolerance":{"overriden_options":{"callback":"{}"}},"CADDisplayEdges":{"overriden_options":{"callback":"{}"}},"CADEdgesColor":{"overriden_options":{"callback":"{}"}},"CADDisplayMeshes":{"overriden_options":{"callback":"{}"}},"CADMeshesColor":{"overriden_options":{"callback":"{}"}},"CADWireframe":{"overriden_options":{"callback":"{}"}},"CSGFacetAngle":{"overriden_options":{"callback":"{}"}},"CSGLinesColor":{"overriden_options":{"callback":"{}"}},"CSGMeshesColor":{"overriden_options":{"callback":"{}"}},"CSGWireframe":{"overriden_options":{"callback":"{}"}},"QUADTriangles":{"overriden_options":{"callback":"{}"}},"QUADWireframe":{"overriden_options":{"callback":"{}"}},"TetScale":{"overriden_options":{"callback":"{}"}},"TetDisplayLines":{"overriden_options":{"callback":"{}"}},"TetDisplaySharedFaces":{"overriden_options":{"callback":"{}"}},"TetDisplayPoints":{"overriden_options":{"callback":"{}"}},"TetDisplayCenter":{"overriden_options":{"callback":"{}"}},"TetDisplaySphere":{"overriden_options":{"callback":"{}"}}},"flags":{"display":true}},"text":{"type":"geo","nodes":{"text1":{"type":"text","params":{"text":"PULL & STRETCH","type":1,"size":0.42,"justifyMode":2}},"transform1":{"type":"transform","params":{"t":[0,2.1263014458517997,-3]},"inputs":["text1"]},"material1":{"type":"material","params":{"material":"../MAT/meshBasic1"},"inputs":["transform1"],"flags":{"display":true}},"MAT":{"type":"materialsNetwork","nodes":{"meshBasic1":{"type":"meshBasic"}}}},"params":{"CADLinearTolerance":{"overriden_options":{"callback":"{}"}},"CADAngularTolerance":{"overriden_options":{"callback":"{}"}},"CADCurveAbscissa":{"overriden_options":{"callback":"{}"}},"CADCurveTolerance":{"overriden_options":{"callback":"{}"}},"CADDisplayEdges":{"overriden_options":{"callback":"{}"}},"CADEdgesColor":{"overriden_options":{"callback":"{}"}},"CADDisplayMeshes":{"overriden_options":{"callback":"{}"}},"CADMeshesColor":{"overriden_options":{"callback":"{}"}},"CADWireframe":{"overriden_options":{"callback":"{}"}},"CSGFacetAngle":{"overriden_options":{"callback":"{}"}},"CSGLinesColor":{"overriden_options":{"callback":"{}"}},"CSGMeshesColor":{"overriden_options":{"callback":"{}"}},"CSGWireframe":{"overriden_options":{"callback":"{}"}},"QUADTriangles":{"overriden_options":{"callback":"{}"}},"QUADWireframe":{"overriden_options":{"callback":"{}"}},"TetScale":{"overriden_options":{"callback":"{}"}},"TetDisplayLines":{"overriden_options":{"callback":"{}"}},"TetDisplaySharedFaces":{"overriden_options":{"callback":"{}"}},"TetDisplayPoints":{"overriden_options":{"callback":"{}"}},"TetDisplayCenter":{"overriden_options":{"callback":"{}"}},"TetDisplaySphere":{"overriden_options":{"callback":"{}"}}},"flags":{"display":true}}},"params":{"mainCameraPath":"/cameras/cameras:sopGroup/perspectiveCamera_MAIN"}},"ui":{"nodes":{"geo1":{"pos":[-50,-350],"selection":["icosahedron1","clothSolver1","clothPrepare1","material1","MAT","actor_clothSolver1","restAttributes1","fileOBJ1","hierarchy1","transform1","objectProperties1","switch_CHARACTER"],"nodes":{"icosahedron1":{"pos":[-50,-900]},"clothSolver1":{"pos":[50,650],"comment":"This is the solver. You can add more nodes inside it to add specific movements in area of the input geometry. This can be useful for more precise tweaking, like vibrations.","nodes":{"globals1":{"pos":[-400,0]},"output1":{"pos":[200,0]}}},"clothPrepare1":{"pos":[50,150],"comment":"the clothPrepare node adds some attributes, like id, to your geometry."},"material1":{"pos":[50,950],"comment":"This assigns the [material](../MAT/meshPhysical_CLOTH), which is necessary to display the result of the simulation."},"MAT":{"pos":[-150,650],"nodes":{"meshPhysical_CLOTH":{"pos":[0,0],"nodes":{"globals1":{"pos":[-400,0]},"output1":{"pos":[400,0]},"clothSolverPosition1":{"pos":[100,0]},"attribute1":{"pos":[-100,0]},"attribute2":{"pos":[-900,550]},"mix1":{"pos":[250,300]},"constant1":{"pos":[-100,300]},"constant2":{"pos":[-100,200]},"vec3ToFloat1":{"pos":[-750,450]},"floatToVec2_1":{"pos":[-550,450]},"vec3ToFloat2":{"pos":[-750,650]},"floatToVec2_2":{"pos":[-550,650]},"grid1":{"pos":[-250,500]},"constant3":{"pos":[-550,800]},"grid2":{"pos":[-250,650]},"mult2":{"pos":[-100,550]}}}}},"actor_clothSolver1":{"pos":[50,400],"comment":"most of the logic of how the cloth solver will behave is inside [this node](.)","selection":["deleteClothConstraint1"],"nodes":{"onScenePause1":{"pos":[-100,-300]},"onTick1":{"pos":[-100,0]},"clothSolverReset1":{"pos":[100,-300],"comment":"when the scene pauses, the cloth solver will reset. Unplug the onScenePause node if you do not want this behavior."},"clothSolverStepSimulation1":{"pos":[100,0],"comment":"this needs to be triggered every frame, using the onTick node, in order to simulate the cloth"},"clothSolverUpdateMaterial1":{"pos":[450,0],"comment":"The result of the simulation is stored in textures. This node makes sure that the material is given those textures, so that we can display the result of the sim."},"onObjectPointerdown1":{"pos":[-600,650],"comment":"when we click on the object, we create a constraint used by the cloth solver.\\n\\nThe constraint is created using the `id` attribute found under the cursor."},"GetIntersectionAttribute1":{"pos":[-300,800]},"clothSolverSetSelectedVertexPosition1":{"pos":[1400,400],"comment":"Here we set the position of the constraint created by the nodes on the left.\\nThe position is set by sending a ray from the camera to the cursor, and seeing where it intersects on a plane."},"constant2":{"pos":[550,900]},"null1":{"pos":[1150,800]},"plane1":{"pos":[750,900]},"rayFromCursor1":{"pos":[750,750]},"rayIntersectPlane1":{"pos":[900,800]},"anyTrigger1":{"pos":[100,400]},"onPointerup1":{"pos":[-600,1050],"comment":"when the user releases the cursor, we delete the contraint"},"createClothConstraint1":{"pos":[-100,650]},"deleteClothConstraint1":{"pos":[-50,1050]}}},"restAttributes1":{"pos":[50,-50],"comment":"the rest attribute is only used in the [material](../MAT/meshPhysical_CLOTH), and is not necessary for the simulation itself."},"fileOBJ1":{"pos":[250,-1150],"comment":"the geometry imported in this node has been created with Houdini. You can use any modeling tool in Houdini to create your character, as long as you make sure to use a remesh node at the end, to have evenly spread out triangles.\\n\\nYou can look at [the houdini scene used for this character](https://github.com/polygonjs/polygonjs-assets/tree/master/houdini/scenes)"},"hierarchy1":{"pos":[250,-800]},"transform1":{"pos":[250,-700]},"objectProperties1":{"pos":[250,-600]},"switch_CHARACTER":{"pos":[50,-450],"comment":"The switch allows to test different inputs for the cloth solver.\\n- left input is a simple icosahedron (which is like a sphere, but with the triangles laid out evenly, which is necessary for the cloth solver)\\n- right input is an imported geometry, created with Houdini"}}},"ground":{"pos":[-50,-450],"nodes":{"material1":{"pos":[0,300]},"MAT":{"pos":[-200,300],"nodes":{"meshStandardBuilder1":{"pos":[0,200],"nodes":{"globals1":{"pos":[-450,0]},"output1":{"pos":[400,0]},"vec3ToFloat1":{"pos":[-200,200]},"floatToVec2_1":{"pos":[-100,200]},"checkers1":{"pos":[50,200]},"mix1":{"pos":[250,0]},"constant1":{"pos":[50,-150]},"constant2":{"pos":[0,0]}}}}},"box1":{"pos":[0,100]}}},"lights":{"pos":[-50,-250],"selection":["hemisphereLight1"],"nodes":{"hemisphereLight1":{"pos":[50,-50]},"spotLight1":{"pos":[300,-50]},"polarTransform1":{"pos":[300,150]},"merge1":{"pos":[100,300]}}},"cameras":{"pos":[-50,-150],"selection":["polarTransform1"],"nodes":{"cameraControls1":{"pos":[0,150],"nodes":{"cameraOrbitControls1":{"pos":[0,0]}}},"perspectiveCamera_DEBUG":{"pos":[0,-50]},"perspectiveCamera_MAIN":{"pos":[350,-50]},"polarTransform1":{"pos":[350,150]},"merge1":{"pos":[150,350]}}},"text":{"pos":[100,-350],"selection":["text1"],"nodes":{"text1":{"pos":[-200,-100]},"transform1":{"pos":[-200,50]},"material1":{"pos":[-200,200]},"MAT":{"pos":[-400,200],"nodes":{"meshBasic1":{"pos":[-150,0]}}}}}}},"shaders":{"/geo1/clothSolver1":{"position":"precision highp float;\nprecision highp sampler2D;\n\nuniform vec2 tSize;\nuniform float order;\nuniform sampler2D tOriginal;\nuniform sampler2D tPrevious0;\nuniform sampler2D tPrevious1;\nuniform sampler2D tPosition0;\nuniform sampler2D tPosition1;\nuniform sampler2D tViscositySpring;\nuniform float time;\nuniform float timeDelta;\nuniform float viscosity;\nuniform float spring;\n\n// removed:\n//// INSERT DEFINE\n\n// *** ADD COMMON ***\n\nvoid main() {\n\n\tvec2 particleUv = gl_FragCoord.xy / tSize.xy;\n\n\tvec3 original = texture2D( tOriginal, particleUv ).xyz;\n\tvec3 previous = ( texture2D( tPrevious0, particleUv ).xyz + texture2D( tPrevious1, particleUv ).xyz ) / 1024.0;\n\tvec3 position = ( texture2D( tPosition0, particleUv ).xyz + texture2D( tPosition1, particleUv ).xyz ) / 1024.0;\n\tvec3 viscositySpring = texture2D( tViscositySpring, particleUv ).xyz;\n\tfloat viscosityMult = viscosity * viscositySpring.x;\n\tfloat springMult = spring * viscositySpring.y;\n\n// removed:\n//\t// INSERT BODY\n\n\n\n\t// /geo1/clothSolver1/globals1\n\tvec3 v_POLY_globals1_position = position;\n\t\n\t// /geo1/clothSolver1/output1\n\tposition.xyz = v_POLY_globals1_position;\n\n\n\n\n\tvec3 offset = ( original - position ) * timeDelta * springMult;\n\tvec3 disp = ( position - previous ) * ( 1.0 - viscosityMult ) + position;\n\n\tgl_FragColor = vec4( unpackPosition( disp + offset, order ), 1.0 );\n\n}\n"},"/geo1/MAT/meshPhysical_CLOTH":{"vertex":"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_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\n\n\n// /geo1/MAT/meshPhysical_CLOTH/clothSolverPosition1\n// get vec2 tex coordinate from index\nvec2 getClothSolverUV( float id, vec2 textureSize ) { \n\n\tvec2 coords = vec2(\n\t\tfloor( mod( ( id + 0.5 ), textureSize.x ) ),\n\t\tfloor( ( id + 0.5 ) / textureSize.x )\n\t) + 0.5;\n\n\treturn coords / textureSize;\n\n}\n\n\nvec3 clothSolverPosition(sampler2D tPosition0, sampler2D tPosition1, vec2 clothSolverUv) {\n\treturn ( texture2D( tPosition0, clothSolverUv ).xyz + texture2D( tPosition1, clothSolverUv ).xyz ) / 1024.0;\n}\nvec3 clothSolverNormal(sampler2D tNormal, vec2 clothSolverUv) {\n\treturn normalize( texture2D( tNormal, clothSolverUv ).xyz );\n}\n\n\n\n\n\n\n\n// /geo1/MAT/meshPhysical_CLOTH/clothSolverPosition1\nuniform vec2 v_POLY_param_tSize;\nuniform sampler2D v_POLY_texture_tPosition0;\nuniform sampler2D v_POLY_texture_tPosition1;\nuniform sampler2D v_POLY_texture_tNormal;\n\n// /geo1/MAT/meshPhysical_CLOTH/attribute2\nvarying vec3 v_POLY_attribute_restP;\n\n// /geo1/MAT/meshPhysical_CLOTH/attribute1\nattribute float id;\n\n// /geo1/MAT/meshPhysical_CLOTH/attribute2\nattribute vec3 restP;\n\n\n\n\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 <color_vertex>\n\n\n\n\t// /geo1/MAT/meshPhysical_CLOTH/attribute1\n\tfloat v_POLY_attribute1_val = id;\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/attribute2\n\tv_POLY_attribute_restP = vec3(restP);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/clothSolverPosition1\n\tvec2 v_POLY_clothSolverPosition1_clothSolverUv = getClothSolverUV(v_POLY_attribute1_val, v_POLY_param_tSize);\n\tvec3 v_POLY_clothSolverPosition1_position = clothSolverPosition(v_POLY_texture_tPosition0, v_POLY_texture_tPosition1, v_POLY_clothSolverPosition1_clothSolverUv);\n\tvec3 v_POLY_clothSolverPosition1_normal = clothSolverNormal(v_POLY_texture_tNormal, v_POLY_clothSolverPosition1_clothSolverUv);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/output1\n\tvec3 transformed = v_POLY_clothSolverPosition1_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\t#include <batching_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}","fragment":"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_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 USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n\n\n\n// /geo1/MAT/meshPhysical_CLOTH/grid1\n// https://www.shadertoy.com/view/XtBfzz\n// https://iquilezles.org/articles/checkerfiltering/\n\nfloat gridTextureGradBox( in vec2 p, in float lineWidth, in vec2 ddx, in vec2 ddy )\n{\n\t// filter kernel\n\tvec2 w = max(abs(ddx), abs(ddy)) + 0.01;\n\n\t// analytic (box) filtering\n\tvec2 a = p + 0.5*w;\n\tvec2 b = p - 0.5*w;\n\tvec2 i = (floor(a)+min(fract(a)/lineWidth,1.0)-\n\t\t\t\tfloor(b)-min(fract(b)/lineWidth,1.0))/(w/lineWidth);\n\t//pattern\n\treturn (1.0-i.x)*(1.0-i.y);\n}\n\nfloat grid( in vec2 p, in float lineWidth )\n{\n // coordinates\n vec2 i = step( fract(p), vec2(1.0*lineWidth) );\n //pattern\n return (1.0-i.x)*(1.0-i.y); // grid (N=10)\n \n // other possible patterns are these\n //return 1.0-i.x*i.y; // squares (N=4)\n //return 1.0-i.x-i.y+2.0*i.x*i.y; // checker (N=2)\n}\n\n\n\n\n\n\n\n// /geo1/MAT/meshPhysical_CLOTH/attribute2\nvarying vec3 v_POLY_attribute_restP;\n\n\n\n\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <iridescence_fragment>\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 <iridescence_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 vec3 geometryNormal,\n\tconst in vec3 geometryViewDir,\n\tconst in SSSModel sssModel,\n\tinout ReflectedLight reflectedLight\n\t){\n\tvec3 scatteringHalf = normalize(directLight.direction + (geometryNormal * sssModel.distortion));\n\tfloat scatteringDot = pow(saturate(dot(geometryViewDir, -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/meshPhysical_CLOTH/constant2\n\tvec3 v_POLY_constant2_val = vec3(0.07036009568874305, 0.5906188409113381, 0.06662593863608139);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/constant1\n\tvec3 v_POLY_constant1_val = vec3(1.0, 1.0, 1.0);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/attribute2\n\tvec3 v_POLY_attribute2_val = v_POLY_attribute_restP;\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/constant3\n\tfloat v_POLY_constant3_val = 5.0;\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/vec3ToFloat1\n\tfloat v_POLY_vec3ToFloat1_y = v_POLY_attribute2_val.y;\n\tfloat v_POLY_vec3ToFloat1_z = v_POLY_attribute2_val.z;\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/vec3ToFloat2\n\tfloat v_POLY_vec3ToFloat2_x = v_POLY_attribute2_val.x;\n\tfloat v_POLY_vec3ToFloat2_y = v_POLY_attribute2_val.y;\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/floatToVec2_1\n\tvec2 v_POLY_floatToVec2_1_vec2 = vec2(v_POLY_vec3ToFloat1_y, v_POLY_vec3ToFloat1_z);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/floatToVec2_2\n\tvec2 v_POLY_floatToVec2_2_vec2 = vec2(v_POLY_vec3ToFloat2_x, v_POLY_vec3ToFloat2_y);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/grid1\n\tvec2 v_POLY_grid1_coord = v_POLY_floatToVec2_1_vec2*vec2(1.0, 1.0)*v_POLY_constant3_val;\n\tfloat v_POLY_grid1_grid = gridTextureGradBox(v_POLY_grid1_coord, 0.1, dFdx(v_POLY_grid1_coord), dFdy(v_POLY_grid1_coord));\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/grid2\n\tvec2 v_POLY_grid2_coord = v_POLY_floatToVec2_2_vec2*vec2(1.0, 1.0)*v_POLY_constant3_val;\n\tfloat v_POLY_grid2_grid = gridTextureGradBox(v_POLY_grid2_coord, 0.1, dFdx(v_POLY_grid2_coord), dFdy(v_POLY_grid2_coord));\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/mult2\n\tfloat v_POLY_mult2_product = (v_POLY_grid1_grid * v_POLY_grid2_grid * 1.0);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/mix1\n\tvec3 v_POLY_mix1_mix = mix(v_POLY_constant2_val, v_POLY_constant1_val, v_POLY_mult2_product);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/output1\n\tdiffuseColor.xyz = v_POLY_mix1_mix;\n\tfloat POLY_metalness = 1.0;\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\t#include <alphahash_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, geometryNormal, geometryViewDir, 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\tmaterial.transmission = transmission * POLY_transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness * POLY_thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\n\t#ifdef USE_TRANSMISSIONMAP\n\n\t\tmaterial.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n\n\t#endif\n\n\t#ifdef USE_THICKNESSMAP\n\n\t\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).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 transmitted = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n\n\ttotalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n\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 + sheenSpecularDirect + sheenSpecularIndirect;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\n\t#endif\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}","customDepthMaterial.vertex":"#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n\n\n\n// /geo1/MAT/meshPhysical_CLOTH/clothSolverPosition1\n// get vec2 tex coordinate from index\nvec2 getClothSolverUV( float id, vec2 textureSize ) { \n\n\tvec2 coords = vec2(\n\t\tfloor( mod( ( id + 0.5 ), textureSize.x ) ),\n\t\tfloor( ( id + 0.5 ) / textureSize.x )\n\t) + 0.5;\n\n\treturn coords / textureSize;\n\n}\n\n\nvec3 clothSolverPosition(sampler2D tPosition0, sampler2D tPosition1, vec2 clothSolverUv) {\n\treturn ( texture2D( tPosition0, clothSolverUv ).xyz + texture2D( tPosition1, clothSolverUv ).xyz ) / 1024.0;\n}\nvec3 clothSolverNormal(sampler2D tNormal, vec2 clothSolverUv) {\n\treturn normalize( texture2D( tNormal, clothSolverUv ).xyz );\n}\n\n\n\n\n\n\n\n// /geo1/MAT/meshPhysical_CLOTH/clothSolverPosition1\nuniform vec2 v_POLY_param_tSize;\nuniform sampler2D v_POLY_texture_tPosition0;\nuniform sampler2D v_POLY_texture_tPosition1;\nuniform sampler2D v_POLY_texture_tNormal;\n\n// /geo1/MAT/meshPhysical_CLOTH/attribute2\nvarying vec3 v_POLY_attribute_restP;\n\n// /geo1/MAT/meshPhysical_CLOTH/attribute1\nattribute float id;\n\n// /geo1/MAT/meshPhysical_CLOTH/attribute2\nattribute vec3 restP;\n\n\n\n\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_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/meshPhysical_CLOTH/attribute1\n\tfloat v_POLY_attribute1_val = id;\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/attribute2\n\tv_POLY_attribute_restP = vec3(restP);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/clothSolverPosition1\n\tvec2 v_POLY_clothSolverPosition1_clothSolverUv = getClothSolverUV(v_POLY_attribute1_val, v_POLY_param_tSize);\n\tvec3 v_POLY_clothSolverPosition1_position = clothSolverPosition(v_POLY_texture_tPosition0, v_POLY_texture_tPosition1, v_POLY_clothSolverPosition1_clothSolverUv);\n\tvec3 v_POLY_clothSolverPosition1_normal = clothSolverNormal(v_POLY_texture_tNormal, v_POLY_clothSolverPosition1_clothSolverUv);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/output1\n\tvec3 transformed = v_POLY_clothSolverPosition1_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}","customDepthMaterial.fragment":"\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/meshPhysical_CLOTH/grid1\n// https://www.shadertoy.com/view/XtBfzz\n// https://iquilezles.org/articles/checkerfiltering/\n\nfloat gridTextureGradBox( in vec2 p, in float lineWidth, in vec2 ddx, in vec2 ddy )\n{\n\t// filter kernel\n\tvec2 w = max(abs(ddx), abs(ddy)) + 0.01;\n\n\t// analytic (box) filtering\n\tvec2 a = p + 0.5*w;\n\tvec2 b = p - 0.5*w;\n\tvec2 i = (floor(a)+min(fract(a)/lineWidth,1.0)-\n\t\t\t\tfloor(b)-min(fract(b)/lineWidth,1.0))/(w/lineWidth);\n\t//pattern\n\treturn (1.0-i.x)*(1.0-i.y);\n}\n\nfloat grid( in vec2 p, in float lineWidth )\n{\n // coordinates\n vec2 i = step( fract(p), vec2(1.0*lineWidth) );\n //pattern\n return (1.0-i.x)*(1.0-i.y); // grid (N=10)\n \n // other possible patterns are these\n //return 1.0-i.x*i.y; // squares (N=4)\n //return 1.0-i.x-i.y+2.0*i.x*i.y; // checker (N=2)\n}\n\n\n\n\n\n\n\n// /geo1/MAT/meshPhysical_CLOTH/attribute2\nvarying vec3 v_POLY_attribute_restP;\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 vec3 geometryNormal,\n\tconst in vec3 geometryViewDir,\n\tconst in SSSModel sssModel,\n\tinout ReflectedLight reflectedLight\n\t){\n\tvec3 scatteringHalf = normalize(directLight.direction + (geometryNormal * sssModel.distortion));\n\tfloat scatteringDot = pow(saturate(dot(geometryViewDir, -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/meshPhysical_CLOTH/constant2\n\tvec3 v_POLY_constant2_val = vec3(0.07036009568874305, 0.5906188409113381, 0.06662593863608139);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/constant1\n\tvec3 v_POLY_constant1_val = vec3(1.0, 1.0, 1.0);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/attribute2\n\tvec3 v_POLY_attribute2_val = v_POLY_attribute_restP;\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/constant3\n\tfloat v_POLY_constant3_val = 5.0;\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/vec3ToFloat1\n\tfloat v_POLY_vec3ToFloat1_y = v_POLY_attribute2_val.y;\n\tfloat v_POLY_vec3ToFloat1_z = v_POLY_attribute2_val.z;\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/vec3ToFloat2\n\tfloat v_POLY_vec3ToFloat2_x = v_POLY_attribute2_val.x;\n\tfloat v_POLY_vec3ToFloat2_y = v_POLY_attribute2_val.y;\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/floatToVec2_1\n\tvec2 v_POLY_floatToVec2_1_vec2 = vec2(v_POLY_vec3ToFloat1_y, v_POLY_vec3ToFloat1_z);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/floatToVec2_2\n\tvec2 v_POLY_floatToVec2_2_vec2 = vec2(v_POLY_vec3ToFloat2_x, v_POLY_vec3ToFloat2_y);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/grid1\n\tvec2 v_POLY_grid1_coord = v_POLY_floatToVec2_1_vec2*vec2(1.0, 1.0)*v_POLY_constant3_val;\n\tfloat v_POLY_grid1_grid = gridTextureGradBox(v_POLY_grid1_coord, 0.1, dFdx(v_POLY_grid1_coord), dFdy(v_POLY_grid1_coord));\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/grid2\n\tvec2 v_POLY_grid2_coord = v_POLY_floatToVec2_2_vec2*vec2(1.0, 1.0)*v_POLY_constant3_val;\n\tfloat v_POLY_grid2_grid = gridTextureGradBox(v_POLY_grid2_coord, 0.1, dFdx(v_POLY_grid2_coord), dFdy(v_POLY_grid2_coord));\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/mult2\n\tfloat v_POLY_mult2_product = (v_POLY_grid1_grid * v_POLY_grid2_grid * 1.0);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/mix1\n\tvec3 v_POLY_mix1_mix = mix(v_POLY_constant2_val, v_POLY_constant1_val, v_POLY_mult2_product);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/output1\n\tdiffuseColor.xyz = v_POLY_mix1_mix;\n\tfloat POLY_metalness = 1.0;\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","customDistanceMaterial.vertex":"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n\n\n\n// /geo1/MAT/meshPhysical_CLOTH/clothSolverPosition1\n// get vec2 tex coordinate from index\nvec2 getClothSolverUV( float id, vec2 textureSize ) { \n\n\tvec2 coords = vec2(\n\t\tfloor( mod( ( id + 0.5 ), textureSize.x ) ),\n\t\tfloor( ( id + 0.5 ) / textureSize.x )\n\t) + 0.5;\n\n\treturn coords / textureSize;\n\n}\n\n\nvec3 clothSolverPosition(sampler2D tPosition0, sampler2D tPosition1, vec2 clothSolverUv) {\n\treturn ( texture2D( tPosition0, clothSolverUv ).xyz + texture2D( tPosition1, clothSolverUv ).xyz ) / 1024.0;\n}\nvec3 clothSolverNormal(sampler2D tNormal, vec2 clothSolverUv) {\n\treturn normalize( texture2D( tNormal, clothSolverUv ).xyz );\n}\n\n\n\n\n\n\n\n// /geo1/MAT/meshPhysical_CLOTH/clothSolverPosition1\nuniform vec2 v_POLY_param_tSize;\nuniform sampler2D v_POLY_texture_tPosition0;\nuniform sampler2D v_POLY_texture_tPosition1;\nuniform sampler2D v_POLY_texture_tNormal;\n\n// /geo1/MAT/meshPhysical_CLOTH/attribute2\nvarying vec3 v_POLY_attribute_restP;\n\n// /geo1/MAT/meshPhysical_CLOTH/attribute1\nattribute float id;\n\n// /geo1/MAT/meshPhysical_CLOTH/attribute2\nattribute vec3 restP;\n\n\n\n\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_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/meshPhysical_CLOTH/attribute1\n\tfloat v_POLY_attribute1_val = id;\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/attribute2\n\tv_POLY_attribute_restP = vec3(restP);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/clothSolverPosition1\n\tvec2 v_POLY_clothSolverPosition1_clothSolverUv = getClothSolverUV(v_POLY_attribute1_val, v_POLY_param_tSize);\n\tvec3 v_POLY_clothSolverPosition1_position = clothSolverPosition(v_POLY_texture_tPosition0, v_POLY_texture_tPosition1, v_POLY_clothSolverPosition1_clothSolverUv);\n\tvec3 v_POLY_clothSolverPosition1_normal = clothSolverNormal(v_POLY_texture_tNormal, v_POLY_clothSolverPosition1_clothSolverUv);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/output1\n\tvec3 transformed = v_POLY_clothSolverPosition1_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}","customDistanceMaterial.fragment":"\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/meshPhysical_CLOTH/grid1\n// https://www.shadertoy.com/view/XtBfzz\n// https://iquilezles.org/articles/checkerfiltering/\n\nfloat gridTextureGradBox( in vec2 p, in float lineWidth, in vec2 ddx, in vec2 ddy )\n{\n\t// filter kernel\n\tvec2 w = max(abs(ddx), abs(ddy)) + 0.01;\n\n\t// analytic (box) filtering\n\tvec2 a = p + 0.5*w;\n\tvec2 b = p - 0.5*w;\n\tvec2 i = (floor(a)+min(fract(a)/lineWidth,1.0)-\n\t\t\t\tfloor(b)-min(fract(b)/lineWidth,1.0))/(w/lineWidth);\n\t//pattern\n\treturn (1.0-i.x)*(1.0-i.y);\n}\n\nfloat grid( in vec2 p, in float lineWidth )\n{\n // coordinates\n vec2 i = step( fract(p), vec2(1.0*lineWidth) );\n //pattern\n return (1.0-i.x)*(1.0-i.y); // grid (N=10)\n \n // other possible patterns are these\n //return 1.0-i.x*i.y; // squares (N=4)\n //return 1.0-i.x-i.y+2.0*i.x*i.y; // checker (N=2)\n}\n\n\n\n\n\n\n\n// /geo1/MAT/meshPhysical_CLOTH/attribute2\nvarying vec3 v_POLY_attribute_restP;\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 vec3 geometryNormal,\n\tconst in vec3 geometryViewDir,\n\tconst in SSSModel sssModel,\n\tinout ReflectedLight reflectedLight\n\t){\n\tvec3 scatteringHalf = normalize(directLight.direction + (geometryNormal * sssModel.distortion));\n\tfloat scatteringDot = pow(saturate(dot(geometryViewDir, -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/meshPhysical_CLOTH/constant2\n\tvec3 v_POLY_constant2_val = vec3(0.07036009568874305, 0.5906188409113381, 0.06662593863608139);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/constant1\n\tvec3 v_POLY_constant1_val = vec3(1.0, 1.0, 1.0);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/attribute2\n\tvec3 v_POLY_attribute2_val = v_POLY_attribute_restP;\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/constant3\n\tfloat v_POLY_constant3_val = 5.0;\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/vec3ToFloat1\n\tfloat v_POLY_vec3ToFloat1_y = v_POLY_attribute2_val.y;\n\tfloat v_POLY_vec3ToFloat1_z = v_POLY_attribute2_val.z;\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/vec3ToFloat2\n\tfloat v_POLY_vec3ToFloat2_x = v_POLY_attribute2_val.x;\n\tfloat v_POLY_vec3ToFloat2_y = v_POLY_attribute2_val.y;\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/floatToVec2_1\n\tvec2 v_POLY_floatToVec2_1_vec2 = vec2(v_POLY_vec3ToFloat1_y, v_POLY_vec3ToFloat1_z);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/floatToVec2_2\n\tvec2 v_POLY_floatToVec2_2_vec2 = vec2(v_POLY_vec3ToFloat2_x, v_POLY_vec3ToFloat2_y);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/grid1\n\tvec2 v_POLY_grid1_coord = v_POLY_floatToVec2_1_vec2*vec2(1.0, 1.0)*v_POLY_constant3_val;\n\tfloat v_POLY_grid1_grid = gridTextureGradBox(v_POLY_grid1_coord, 0.1, dFdx(v_POLY_grid1_coord), dFdy(v_POLY_grid1_coord));\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/grid2\n\tvec2 v_POLY_grid2_coord = v_POLY_floatToVec2_2_vec2*vec2(1.0, 1.0)*v_POLY_constant3_val;\n\tfloat v_POLY_grid2_grid = gridTextureGradBox(v_POLY_grid2_coord, 0.1, dFdx(v_POLY_grid2_coord), dFdy(v_POLY_grid2_coord));\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/mult2\n\tfloat v_POLY_mult2_product = (v_POLY_grid1_grid * v_POLY_grid2_grid * 1.0);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/mix1\n\tvec3 v_POLY_mix1_mix = mix(v_POLY_constant2_val, v_POLY_constant1_val, v_POLY_mult2_product);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/output1\n\tdiffuseColor.xyz = v_POLY_mix1_mix;\n\tfloat POLY_metalness = 1.0;\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","customDepthDOFMaterial.vertex":"#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n\n\n\n// /geo1/MAT/meshPhysical_CLOTH/clothSolverPosition1\n// get vec2 tex coordinate from index\nvec2 getClothSolverUV( float id, vec2 textureSize ) { \n\n\tvec2 coords = vec2(\n\t\tfloor( mod( ( id + 0.5 ), textureSize.x ) ),\n\t\tfloor( ( id + 0.5 ) / textureSize.x )\n\t) + 0.5;\n\n\treturn coords / textureSize;\n\n}\n\n\nvec3 clothSolverPosition(sampler2D tPosition0, sampler2D tPosition1, vec2 clothSolverUv) {\n\treturn ( texture2D( tPosition0, clothSolverUv ).xyz + texture2D( tPosition1, clothSolverUv ).xyz ) / 1024.0;\n}\nvec3 clothSolverNormal(sampler2D tNormal, vec2 clothSolverUv) {\n\treturn normalize( texture2D( tNormal, clothSolverUv ).xyz );\n}\n\n\n\n\n\n\n\n// /geo1/MAT/meshPhysical_CLOTH/clothSolverPosition1\nuniform vec2 v_POLY_param_tSize;\nuniform sampler2D v_POLY_texture_tPosition0;\nuniform sampler2D v_POLY_texture_tPosition1;\nuniform sampler2D v_POLY_texture_tNormal;\n\n// /geo1/MAT/meshPhysical_CLOTH/attribute2\nvarying vec3 v_POLY_attribute_restP;\n\n// /geo1/MAT/meshPhysical_CLOTH/attribute1\nattribute float id;\n\n// /geo1/MAT/meshPhysical_CLOTH/attribute2\nattribute vec3 restP;\n\n\n\n\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_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/meshPhysical_CLOTH/attribute1\n\tfloat v_POLY_attribute1_val = id;\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/attribute2\n\tv_POLY_attribute_restP = vec3(restP);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/clothSolverPosition1\n\tvec2 v_POLY_clothSolverPosition1_clothSolverUv = getClothSolverUV(v_POLY_attribute1_val, v_POLY_param_tSize);\n\tvec3 v_POLY_clothSolverPosition1_position = clothSolverPosition(v_POLY_texture_tPosition0, v_POLY_texture_tPosition1, v_POLY_clothSolverPosition1_clothSolverUv);\n\tvec3 v_POLY_clothSolverPosition1_normal = clothSolverNormal(v_POLY_texture_tNormal, v_POLY_clothSolverPosition1_clothSolverUv);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/output1\n\tvec3 transformed = v_POLY_clothSolverPosition1_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}","customDepthDOFMaterial.fragment":"\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/meshPhysical_CLOTH/grid1\n// https://www.shadertoy.com/view/XtBfzz\n// https://iquilezles.org/articles/checkerfiltering/\n\nfloat gridTextureGradBox( in vec2 p, in float lineWidth, in vec2 ddx, in vec2 ddy )\n{\n\t// filter kernel\n\tvec2 w = max(abs(ddx), abs(ddy)) + 0.01;\n\n\t// analytic (box) filtering\n\tvec2 a = p + 0.5*w;\n\tvec2 b = p - 0.5*w;\n\tvec2 i = (floor(a)+min(fract(a)/lineWidth,1.0)-\n\t\t\t\tfloor(b)-min(fract(b)/lineWidth,1.0))/(w/lineWidth);\n\t//pattern\n\treturn (1.0-i.x)*(1.0-i.y);\n}\n\nfloat grid( in vec2 p, in float lineWidth )\n{\n // coordinates\n vec2 i = step( fract(p), vec2(1.0*lineWidth) );\n //pattern\n return (1.0-i.x)*(1.0-i.y); // grid (N=10)\n \n // other possible patterns are these\n //return 1.0-i.x*i.y; // squares (N=4)\n //return 1.0-i.x-i.y+2.0*i.x*i.y; // checker (N=2)\n}\n\n\n\n\n\n\n\n// /geo1/MAT/meshPhysical_CLOTH/attribute2\nvarying vec3 v_POLY_attribute_restP;\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 vec3 geometryNormal,\n\tconst in vec3 geometryViewDir,\n\tconst in SSSModel sssModel,\n\tinout ReflectedLight reflectedLight\n\t){\n\tvec3 scatteringHalf = normalize(directLight.direction + (geometryNormal * sssModel.distortion));\n\tfloat scatteringDot = pow(saturate(dot(geometryViewDir, -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/meshPhysical_CLOTH/constant2\n\tvec3 v_POLY_constant2_val = vec3(0.07036009568874305, 0.5906188409113381, 0.06662593863608139);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/constant1\n\tvec3 v_POLY_constant1_val = vec3(1.0, 1.0, 1.0);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/attribute2\n\tvec3 v_POLY_attribute2_val = v_POLY_attribute_restP;\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/constant3\n\tfloat v_POLY_constant3_val = 5.0;\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/vec3ToFloat1\n\tfloat v_POLY_vec3ToFloat1_y = v_POLY_attribute2_val.y;\n\tfloat v_POLY_vec3ToFloat1_z = v_POLY_attribute2_val.z;\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/vec3ToFloat2\n\tfloat v_POLY_vec3ToFloat2_x = v_POLY_attribute2_val.x;\n\tfloat v_POLY_vec3ToFloat2_y = v_POLY_attribute2_val.y;\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/floatToVec2_1\n\tvec2 v_POLY_floatToVec2_1_vec2 = vec2(v_POLY_vec3ToFloat1_y, v_POLY_vec3ToFloat1_z);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/floatToVec2_2\n\tvec2 v_POLY_floatToVec2_2_vec2 = vec2(v_POLY_vec3ToFloat2_x, v_POLY_vec3ToFloat2_y);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/grid1\n\tvec2 v_POLY_grid1_coord = v_POLY_floatToVec2_1_vec2*vec2(1.0, 1.0)*v_POLY_constant3_val;\n\tfloat v_POLY_grid1_grid = gridTextureGradBox(v_POLY_grid1_coord, 0.1, dFdx(v_POLY_grid1_coord), dFdy(v_POLY_grid1_coord));\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/grid2\n\tvec2 v_POLY_grid2_coord = v_POLY_floatToVec2_2_vec2*vec2(1.0, 1.0)*v_POLY_constant3_val;\n\tfloat v_POLY_grid2_grid = gridTextureGradBox(v_POLY_grid2_coord, 0.1, dFdx(v_POLY_grid2_coord), dFdy(v_POLY_grid2_coord));\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/mult2\n\tfloat v_POLY_mult2_product = (v_POLY_grid1_grid * v_POLY_grid2_grid * 1.0);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/mix1\n\tvec3 v_POLY_mix1_mix = mix(v_POLY_constant2_val, v_POLY_constant1_val, v_POLY_mult2_product);\n\t\n\t// /geo1/MAT/meshPhysical_CLOTH/output1\n\tdiffuseColor.xyz = v_POLY_mix1_mix;\n\tfloat POLY_metalness = 1.0;\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"},"/ground/MAT/meshStandardBuilder1":{"vertex":"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_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\n\n\n// /ground/MAT/meshStandardBuilder1/globals1\nvarying vec3 v_POLY_globals1_position;\n\n\n\n\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 <color_vertex>\n\n\n\n\t// /ground/MAT/meshStandardBuilder1/globals1\n\tv_POLY_globals1_position = vec3(position);\n\t\n\t// /ground/MAT/meshStandardBuilder1/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\t#include <batching_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}","fragment":"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_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 USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n\n\n\n// /ground/MAT/meshStandardBuilder1/checkers1\n// https://iquilezles.org/articles/checkerfiltering/\nfloat checkers(vec2 p) {\n\tvec2 s = sign(fract(p*.5)-.5);\n\treturn .5 - .5*s.x*s.y;\n}\nfloat checkersGrad( in vec2 p, in vec2 ddx, in vec2 ddy )\n{\n // filter kernel\n vec2 w = max(abs(ddx), abs(ddy)) + 0.01;\n // analytical integral (box filter)\n vec2 i = 2.0*(abs(fract((p-0.5*w)/2.0)-0.5)-abs(fract((p+0.5*w)/2.0)-0.5))/w;\n // xor pattern\n return 0.5 - 0.5*i.x*i.y;\n}\n\n\n\n\n\n\n\n\n// /ground/MAT/meshStandardBuilder1/globals1\nvarying vec3 v_POLY_globals1_position;\n\n\n\n\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <iridescence_fragment>\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 <iridescence_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 vec3 geometryNormal,\n\tconst in vec3 geometryViewDir,\n\tconst in SSSModel sssModel,\n\tinout ReflectedLight reflectedLight\n\t){\n\tvec3 scatteringHalf = normalize(directLight.direction + (geometryNormal * sssModel.distortion));\n\tfloat scatteringDot = pow(saturate(dot(geometryViewDir, -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// /ground/MAT/meshStandardBuilder1/constant1\n\tvec3 v_POLY_constant1_val = vec3(0.24313725490196078, 0.5098039215686274, 0.8549019607843137);\n\t\n\t// /ground/MAT/meshStandardBuilder1/constant2\n\tvec3 v_POLY_constant2_val = vec3(0.047058823529411764, 0.10196078431372549, 0.17647058823529413);\n\t\n\t// /ground/MAT/meshStandardBuilder1/vec3ToFloat1\n\tfloat v_POLY_vec3ToFloat1_x = v_POLY_globals1_position.x;\n\tfloat v_POLY_vec3ToFloat1_z = v_POLY_globals1_position.z;\n\t\n\t// /ground/MAT/meshStandardBuilder1/floatToVec2_1\n\tvec2 v_POLY_floatToVec2_1_vec2 = vec2(v_POLY_vec3ToFloat1_x, v_POLY_vec3ToFloat1_z);\n\t\n\t// /ground/MAT/meshStandardBuilder1/checkers1\n\tvec2 v_POLY_checkers1_coord = v_POLY_floatToVec2_1_vec2*vec2(1.0, 1.0)*1.0;\n\tfloat v_POLY_checkers1_checker = checkersGrad(v_POLY_checkers1_coord, dFdx(v_POLY_checkers1_coord), dFdy(v_POLY_checkers1_coord));\n\t\n\t// /ground/MAT/meshStandardBuilder1/mix1\n\tvec3 v_POLY_mix1_mix = mix(v_POLY_constant1_val, v_POLY_constant2_val, v_POLY_checkers1_checker);\n\t\n\t// /ground/MAT/meshStandardBuilder1/output1\n\tdiffuseColor.xyz = v_POLY_mix1_mix;\n\tfloat POLY_metalness = 1.0;\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\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\t#include <alphahash_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, geometryNormal, geometryViewDir, 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#include <transmission_fragment>\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 + sheenSpecularDirect + sheenSpecularIndirect;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\n\t#endif\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}","customDepthMaterial.vertex":"#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n\n\n\n// /ground/MAT/meshStandardBuilder1/globals1\nvarying vec3 v_POLY_globals1_position;\n\n\n\n\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_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// /ground/MAT/meshStandardBuilder1/globals1\n\tv_POLY_globals1_position = vec3(position);\n\t\n\t// /ground/MAT/meshStandardBuilder1/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}","customDepthMaterial.fragment":"\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// /ground/MAT/meshStandardBuilder1/checkers1\n// https://iquilezles.org/articles/checkerfiltering/\nfloat checkers(vec2 p) {\n\tvec2 s = sign(fract(p*.5)-.5);\n\treturn .5 - .5*s.x*s.y;\n}\nfloat checkersGrad( in vec2 p, in vec2 ddx, in vec2 ddy )\n{\n // filter kernel\n vec2 w = max(abs(ddx), abs(ddy)) + 0.01;\n // analytical integral (box filter)\n vec2 i = 2.0*(abs(fract((p-0.5*w)/2.0)-0.5)-abs(fract((p+0.5*w)/2.0)-0.5))/w;\n // xor pattern\n return 0.5 - 0.5*i.x*i.y;\n}\n\n\n\n\n\n\n\n\n// /ground/MAT/meshStandardBuilder1/globals1\nvarying vec3 v_POLY_globals1_position;\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 vec3 geometryNormal,\n\tconst in vec3 geometryViewDir,\n\tconst in SSSModel sssModel,\n\tinout ReflectedLight reflectedLight\n\t){\n\tvec3 scatteringHalf = normalize(directLight.direction + (geometryNormal * sssModel.distortion));\n\tfloat scatteringDot = pow(saturate(dot(geometryViewDir, -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// /ground/MAT/meshStandardBuilder1/constant1\n\tvec3 v_POLY_constant1_val = vec3(0.24313725490196078, 0.5098039215686274, 0.8549019607843137);\n\t\n\t// /ground/MAT/meshStandardBuilder1/constant2\n\tvec3 v_POLY_constant2_val = vec3(0.047058823529411764, 0.10196078431372549, 0.17647058823529413);\n\t\n\t// /ground/MAT/meshStandardBuilder1/vec3ToFloat1\n\tfloat v_POLY_vec3ToFloat1_x = v_POLY_globals1_position.x;\n\tfloat v_POLY_vec3ToFloat1_z = v_POLY_globals1_position.z;\n\t\n\t// /ground/MAT/meshStandardBuilder1/floatToVec2_1\n\tvec2 v_POLY_floatToVec2_1_vec2 = vec2(v_POLY_vec3ToFloat1_x, v_POLY_vec3ToFloat1_z);\n\t\n\t// /ground/MAT/meshStandardBuilder1/checkers1\n\tvec2 v_POLY_checkers1_coord = v_POLY_floatToVec2_1_vec2*vec2(1.0, 1.0)*1.0;\n\tfloat v_POLY_checkers1_checker = checkersGrad(v_POLY_checkers1_coord, dFdx(v_POLY_checkers1_coord), dFdy(v_POLY_checkers1_coord));\n\t\n\t// /ground/MAT/meshStandardBuilder1/mix1\n\tvec3 v_POLY_mix1_mix = mix(v_POLY_constant1_val, v_POLY_constant2_val, v_POLY_checkers1_checker);\n\t\n\t// /ground/MAT/meshStandardBuilder1/output1\n\tdiffuseColor.xyz = v_POLY_mix1_mix;\n\tfloat POLY_metalness = 1.0;\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\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","customDistanceMaterial.vertex":"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n\n\n\n// /ground/MAT/meshStandardBuilder1/globals1\nvarying vec3 v_POLY_globals1_position;\n\n\n\n\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_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// /ground/MAT/meshStandardBuilder1/globals1\n\tv_POLY_globals1_position = vec3(position);\n\t\n\t// /ground/MAT/meshStandardBuilder1/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}","customDistanceMaterial.fragment":"\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// /ground/MAT/meshStandardBuilder1/checkers1\n// https://iquilezles.org/articles/checkerfiltering/\nfloat checkers(vec2 p) {\n\tvec2 s = sign(fract(p*.5)-.5);\n\treturn .5 - .5*s.x*s.y;\n}\nfloat checkersGrad( in vec2 p, in vec2 ddx, in vec2 ddy )\n{\n // filter kernel\n vec2 w = max(abs(ddx), abs(ddy)) + 0.01;\n // analytical integral (box filter)\n vec2 i = 2.0*(abs(fract((p-0.5*w)/2.0)-0.5)-abs(fract((p+0.5*w)/2.0)-0.5))/w;\n // xor pattern\n return 0.5 - 0.5*i.x*i.y;\n}\n\n\n\n\n\n\n\n\n// /ground/MAT/meshStandardBuilder1/globals1\nvarying vec3 v_POLY_globals1_position;\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 vec3 geometryNormal,\n\tconst in vec3 geometryViewDir,\n\tconst in SSSModel sssModel,\n\tinout ReflectedLight reflectedLight\n\t){\n\tvec3 scatteringHalf = normalize(directLight.direction + (geometryNormal * sssModel.distortion));\n\tfloat scatteringDot = pow(saturate(dot(geometryViewDir, -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// /ground/MAT/meshStandardBuilder1/constant1\n\tvec3 v_POLY_constant1_val = vec3(0.24313725490196078, 0.5098039215686274, 0.8549019607843137);\n\t\n\t// /ground/MAT/meshStandardBuilder1/constant2\n\tvec3 v_POLY_constant2_val = vec3(0.047058823529411764, 0.10196078431372549, 0.17647058823529413);\n\t\n\t// /ground/MAT/meshStandardBuilder1/vec3ToFloat1\n\tfloat v_POLY_vec3ToFloat1_x = v_POLY_globals1_position.x;\n\tfloat v_POLY_vec3ToFloat1_z = v_POLY_globals1_position.z;\n\t\n\t// /ground/MAT/meshStandardBuilder1/floatToVec2_1\n\tvec2 v_POLY_floatToVec2_1_vec2 = vec2(v_POLY_vec3ToFloat1_x, v_POLY_vec3ToFloat1_z);\n\t\n\t// /ground/MAT/meshStandardBuilder1/checkers1\n\tvec2 v_POLY_checkers1_coord = v_POLY_floatToVec2_1_vec2*vec2(1.0, 1.0)*1.0;\n\tfloat v_POLY_checkers1_checker = checkersGrad(v_POLY_checkers1_coord, dFdx(v_POLY_checkers1_coord), dFdy(v_POLY_checkers1_coord));\n\t\n\t// /ground/MAT/meshStandardBuilder1/mix1\n\tvec3 v_POLY_mix1_mix = mix(v_POLY_constant1_val, v_POLY_constant2_val, v_POLY_checkers1_checker);\n\t\n\t// /ground/MAT/meshStandardBuilder1/output1\n\tdiffuseColor.xyz = v_POLY_mix1_mix;\n\tfloat POLY_metalness = 1.0;\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\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","customDepthDOFMaterial.vertex":"#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n\n\n\n// /ground/MAT/meshStandardBuilder1/globals1\nvarying vec3 v_POLY_globals1_position;\n\n\n\n\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_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// /ground/MAT/meshStandardBuilder1/globals1\n\tv_POLY_globals1_position = vec3(position);\n\t\n\t// /ground/MAT/meshStandardBuilder1/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}","customDepthDOFMaterial.fragment":"\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// /ground/MAT/meshStandardBuilder1/checkers1\n// https://iquilezles.org/articles/checkerfiltering/\nfloat checkers(vec2 p) {\n\tvec2 s = sign(fract(p*.5)-.5);\n\treturn .5 - .5*s.x*s.y;\n}\nfloat checkersGrad( in vec2 p, in vec2 ddx, in vec2 ddy )\n{\n // filter kernel\n vec2 w = max(abs(ddx), abs(ddy)) + 0.01;\n // analytical integral (box filter)\n vec2 i = 2.0*(abs(fract((p-0.5*w)/2.0)-0.5)-abs(fract((p+0.5*w)/2.0)-0.5))/w;\n // xor pattern\n return 0.5 - 0.5*i.x*i.y;\n}\n\n\n\n\n\n\n\n\n// /ground/MAT/meshStandardBuilder1/globals1\nvarying vec3 v_POLY_globals1_position;\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 vec3 geometryNormal,\n\tconst in vec3 geometryViewDir,\n\tconst in SSSModel sssModel,\n\tinout ReflectedLight reflectedLight\n\t){\n\tvec3 scatteringHalf = normalize(directLight.direction + (geometryNormal * sssModel.distortion));\n\tfloat scatteringDot = pow(saturate(dot(geometryViewDir, -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// /ground/MAT/meshStandardBuilder1/constant1\n\tvec3 v_POLY_constant1_val = vec3(0.24313725490196078, 0.5098039215686274, 0.8549019607843137);\n\t\n\t// /ground/MAT/meshStandardBuilder1/constant2\n\tvec3 v_POLY_constant2_val = vec3(0.047058823529411764, 0.10196078431372549, 0.17647058823529413);\n\t\n\t// /ground/MAT/meshStandardBuilder1/vec3ToFloat1\n\tfloat v_POLY_vec3ToFloat1_x = v_POLY_globals1_position.x;\n\tfloat v_POLY_vec3ToFloat1_z = v_POLY_globals1_position.z;\n\t\n\t// /ground/MAT/meshStandardBuilder1/floatToVec2_1\n\tvec2 v_POLY_floatToVec2_1_vec2 = vec2(v_POLY_vec3ToFloat1_x, v_POLY_vec3ToFloat1_z);\n\t\n\t// /ground/MAT/meshStandardBuilder1/checkers1\n\tvec2 v_POLY_checkers1_coord = v_POLY_floatToVec2_1_vec2*vec2(1.0, 1.0)*1.0;\n\tfloat v_POLY_checkers1_checker = checkersGrad(v_POLY_checkers1_coord, dFdx(v_POLY_checkers1_coord), dFdy(v_POLY_checkers1_coord));\n\t\n\t// /ground/MAT/meshStandardBuilder1/mix1\n\tvec3 v_POLY_mix1_mix = mix(v_POLY_constant1_val, v_POLY_constant2_val, v_POLY_checkers1_checker);\n\t\n\t// /ground/MAT/meshStandardBuilder1/output1\n\tdiffuseColor.xyz = v_POLY_mix1_mix;\n\tfloat POLY_metalness = 1.0;\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\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"}},"jsFunctionBodies":{"/geo1/actor_clothSolver1":"// insert defines\nclass CustomActorEvaluator extends ActorEvaluator {\n\t// insert members\n\n\t// /geo1/actor_clothSolver1/rayFromCursor1\n\tv_POLY_rayFromCursor1_Ray = computed(() => globalsRayFromCursor());\n\n\t// /geo1/actor_clothSolver1/GetIntersectionAttribute1\n\tv_POLY_GetIntersectionAttribute1_val = computed(() =>\n\t\tgetIntersectionAttributeNumberNearest(this.v_POLY_onObjectPointerdown1_Intersection.value, \"id\", -1.0)\n\t);\n\n\t// /geo1/actor_clothSolver1/plane1\n\tv_POLY_plane1_Plane = computed(() =>\n\t\tplaneSet(VAR__plane1_normal.set(0, 0, 1), this.v_POLY_constant2_val.value, VAR__plane1__1)\n\t);\n\n\t// /geo1/actor_clothSolver1/rayIntersectPlane1\n\tv_POLY_rayIntersectPlane1_position = computed(() =>\n\t\trayIntersectPlane(this.v_POLY_rayFromCursor1_Ray.value, this.v_POLY_plane1_Plane.value, VAR__rayIntersectPlane1_)\n\t);\n\n\t// /geo1/actor_clothSolver1/null1\n\tv_POLY_null1_out = computed(() => VAR__null1_in.copy(this.v_POLY_rayIntersectPlane1_position.value));\n\n\t// /geo1/actor_clothSolver1/onTick1\n\tv_POLY_onTick1_time = computed(() => globalsTime());\n\tv_POLY_onTick1_delta = computed(() => globalsTimeDelta());\n\n\t// /geo1/actor_clothSolver1/constant2\n\tv_POLY_constant2_val = { value: -0.68 };\n\n\t// /geo1/actor_clothSolver1/clothSolverStepSimulation1\n\tv_POLY_clothSolverStepSimulation1_tSize = { value: null };\n\tv_POLY_clothSolverStepSimulation1_tPosition0 = { value: null };\n\tv_POLY_clothSolverStepSimulation1_tPosition1 = { value: null };\n\tv_POLY_clothSolverStepSimulation1_tNormal = { value: null };\n\tv_POLY_clothSolverStepSimulation1_tOriginalRT = { value: null };\n\tv_POLY_clothSolverStepSimulation1_tViscositySpringT = { value: null };\n\tv_POLY_clothSolverStepSimulation1_tPreviousRT0 = { value: null };\n\tv_POLY_clothSolverStepSimulation1_tPreviousRT1 = { value: null };\n\tv_POLY_clothSolverStepSimulation1_targetRT0 = { value: null };\n\tv_POLY_clothSolverStepSimulation1_targetRT1 = { value: null };\n\tv_POLY_clothSolverStepSimulation1_tNormalsRT = { value: null };\n\tv_POLY_clothSolverStepSimulation1_tPositionRT0 = { value: null };\n\tv_POLY_clothSolverStepSimulation1_tPositionRT1 = { value: null };\n\tv_POLY_clothSolverStepSimulation1_tAdjacentsRT0 = { value: null };\n\tv_POLY_clothSolverStepSimulation1_tAdjacentsRT1 = { value: null };\n\tv_POLY_clothSolverStepSimulation1_tDistanceRT0 = { value: null };\n\tv_POLY_clothSolverStepSimulation1_tDistanceRT1 = { value: null };\n\tv_POLY_clothSolverStepSimulation1_integrationMat = { value: null };\n\n\t// /geo1/actor_clothSolver1/onObjectPointerdown1\n\tv_POLY_onObjectPointerdown1_Intersection = ref(null);\n\n\tconstructor(node, object3D) {\n\t\tsuper(node, object3D);\n\t\t// insert after constructor\n\n\t\t// /geo1/actor_clothSolver1/onObjectPointerdown1\n\t\taddObjectToObjectPointerdownCheck(this.object3D, this, {\n\t\t\tpriority: { blockObjectsBehind: true, skipIfObjectsInFront: false },\n\t\t\tcpu: {\n\t\t\t\ttraverseChildren: false,\n\t\t\t\tpointsThreshold: 0.1,\n\t\t\t\tlineThreshold: 0.1,\n\t\t\t\tintersectionRef: this.v_POLY_onObjectPointerdown1_Intersection,\n\t\t\t},\n\t\t\tpointerdown: { callback: this.onObjectPointerdown1.bind(this) },\n\t\t\tconfig: { button: { left: true, middle: true, right: true }, modifier: { ctrl: 1.0, shift: 1.0, alt: 1.0 } },\n\t\t});\n\n\t\t// /geo1/actor_clothSolver1/onPointerup1\n\t\taddObjectToPointerupCheck(this.object3D, this, { pointerup: { callback: this.onPointerup1.bind(this) } });\n\t}\n\t// insert body\n\n\tonObjectPointerdown() {\n\t\tthis.onObjectPointerdown1();\n\t}\n\tonScenePause() {\n\t\tthis.onScenePause1();\n\t}\n\tonTick() {\n\t\tthis.onTick1();\n\t}\n\tonPointerup() {\n\t\tthis.onPointerup1();\n\t}\n\t// /geo1/actor_clothSolver1/onObjectPointerdown1\n\tonObjectPointerdown1() {\n\t\tthis.createClothConstraint1(0);\n\t}\n\n\t// /geo1/actor_clothSolver1/onScenePause1\n\tonScenePause1() {\n\t\tthis.clothSolverReset1(0);\n\t}\n\n\t// /geo1/actor_clothSolver1/onTick1\n\tonTick1() {\n\t\tthis.clothSolverStepSimulation1(0);\n\t\tthis.anyTrigger1(0);\n\t}\n\n\t// /geo1/actor_clothSolver1/onPointerup1\n\tonPointerup1() {\n\t\tthis.deleteClothConstraint1(0);\n\t}\n\n\t// /geo1/actor_clothSolver1/clothSolverReset1\n\tclothSolverReset1() {\n\t\tclothSolverReset(this.object3D);\n\t}\n\n\t// /geo1/actor_clothSolver1/clothSolverStepSimulation1\n\tclothSolverStepSimulation1() {\n\t\tclothSolverStepSimulation(this.object3D, 40.0, 0.1, 0.1, 1.0, {\n\t\t\ttSize: this.v_POLY_clothSolverStepSimulation1_tSize,\n\t\t\ttPosition0: this.v_POLY_clothSolverStepSimulation1_tPosition0,\n\t\t\ttPosition1: this.v_POLY_clothSolverStepSimulation1_tPosition1,\n\t\t\ttNormal: this.v_POLY_clothSolverStepSimulation1_tNormal,\n\t\t\ttOriginalRT: this.v_POLY_clothSolverStepSimulation1_tOriginalRT,\n\t\t\ttViscositySpringT: this.v_POLY_clothSolverStepSimulation1_tViscositySpringT,\n\t\t\ttPreviousRT0: this.v_POLY_clothSolverStepSimulation1_tPreviousRT0,\n\t\t\ttPreviousRT1: this.v_POLY_clothSolverStepSimulation1_tPreviousRT1,\n\t\t\ttTargetRT0: this.v_POLY_clothSolverStepSimulation1_targetRT0,\n\t\t\ttTargetRT1: this.v_POLY_clothSolverStepSimulation1_targetRT1,\n\t\t\ttNormalsRT: this.v_POLY_clothSolverStepSimulation1_tNormalsRT,\n\t\t\ttPositionRT0: this.v_POLY_clothSolverStepSimulation1_tPositionRT0,\n\t\t\ttPositionRT1: this.v_POLY_clothSolverStepSimulation1_tPositionRT1,\n\t\t\ttAdjacentsRT0: this.v_POLY_clothSolverStepSimulation1_tAdjacentsRT0,\n\t\t\ttAdjacentsRT1: this.v_POLY_clothSolverStepSimulation1_tAdjacentsRT1,\n\t\t\ttDistanceRT0: this.v_POLY_clothSolverStepSimulation1_tDistanceRT0,\n\t\t\ttDistanceRT1: this.v_POLY_clothSolverStepSimulation1_tDistanceRT1,\n\t\t\tintegrationMat: this.v_POLY_clothSolverStepSimulation1_integrationMat,\n\t\t});\n\t\tthis.clothSolverUpdateMaterial1(0);\n\t}\n\n\t// /geo1/actor_clothSolver1/clothSolverUpdateMaterial1\n\tclothSolverUpdateMaterial1() {\n\t\tclothSolverUpdateMaterial(\n\t\t\tthis.object3D.material,\n\t\t\t\"tSize\",\n\t\t\t\"tPosition0\",\n\t\t\t\"tPosition1\",\n\t\t\t\"tNormal\",\n\t\t\tthis.v_POLY_clothSolverStepSimulation1_tSize.value,\n\t\t\tthis.v_POLY_clothSolverStepSimulation1_tPosition0.value,\n\t\t\tthis.v_POLY_clothSolverStepSimulation1_tPosition1.value,\n\t\t\tthis.v_POLY_clothSolverStepSimulation1_tNormal.value\n\t\t);\n\t}\n\n\t// /geo1/actor_clothSolver1/anyTrigger1\n\tanyTrigger1() {\n\t\tthis.clothSolverSetSelectedVertexPosition1(0);\n\t}\n\n\t// /geo1/actor_clothSolver1/clothSolverSetSelectedVertexPosition1\n\tclothSolverSetSelectedVertexPosition1() {\n\t\tclothConstraintSetPosition(\n\t\t\tthis.object3D,\n\t\t\tVAR__clothSolverSetSelectedVertexPosition1_position.copy(this.v_POLY_null1_out.value),\n\t\t\t1.0\n\t\t);\n\t}\n\n\t// /geo1/actor_clothSolver1/createClothConstraint1\n\tcreateClothConstraint1() {\n\t\tclothCreateConstraint(this.object3D, this.v_POLY_GetIntersectionAttribute1_val.value);\n\t\tthis.anyTrigger1(1);\n\t}\n\n\t// /geo1/actor_clothSolver1/deleteClothConstraint1\n\tdeleteClothConstraint1() {\n\t\tclothDeleteConstraint(this.object3D);\n\t}\n}\nreturn CustomActorEvaluator;\n"}}
Code editor
{"multiple_panel":{"split_ratio":0.5,"split_panel0":{"split_ratio":0.5,"split_panel0":{"panelTypes":["viewer","params","network"],"currentPanelIndex":0,"panel_data":{"camera":"/cameras/cameras:sopGroup/perspectiveCamera_MAIN","isViewerInitLayoutData":true,"linkIndex":1,"overlayedNetwork":{"allowed":false,"displayed":false}}},"split_panel1":{"panelTypes":["viewer","params","network"],"currentPanelIndex":1,"panel_data":{"active_folder":null,"linkIndex":1}},"split_mode":"vertical"},"split_panel1":{"panelTypes":["viewer","params","network"],"currentPanelIndex":2,"panel_data":{"camera":{"position":{"x":0,"y":0},"zoom":0.5},"history":{},"paramsDisplayed":false,"linkIndex":1}},"split_mode":"horizontal"},"currentNodes":["/geo1","/geo1","/geo1","/geo1","/geo1","/geo1","/geo1","/geo1"],"navigationHistory":{"nodePaths":{"1":["/geo1"],"2":["/geo1"],"3":["/geo1"],"4":["/geo1"],"5":["/geo1"],"6":["/geo1"],"7":["/geo1"],"8":["/geo1"]},"index":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0}},"fullscreenPanelId":null,"saveOptions":{"checkRemoteAssetsUse":true,"minimizeFilesCount":false},"paramsModal":[]}
Used nodes
event/cameraOrbitControls;mat/meshBasic;mat/meshPhysicalBuilder;mat/meshStandardBuilder;obj/geo;sop/actor;sop/box;sop/cameraControls;sop/clothPrepare;sop/clothSolver;sop/fileOBJ;sop/hemisphereLight;sop/hierarchy;sop/icosahedron;sop/material;sop/materialsNetwork;sop/merge;sop/objectProperties;sop/perspectiveCamera;sop/polarTransform;sop/restAttributes;sop/spotLight;sop/switch;sop/text;sop/transform
Used operations
Used modules
Used assemblers
GL_CLOTH;GL_MESH_PHYSICAL;GL_MESH_STANDARD;JS_ACTOR
Used integrations
[]
Used assets
Nodes map
{"/geo1":"obj/geo","/geo1/icosahedron1":"sop/icosahedron","/geo1/clothSolver1":"sop/clothSolver","/geo1/clothPrepare1":"sop/clothPrepare","/geo1/material1":"sop/material","/geo1/MAT":"sop/materialsNetwork","/geo1/MAT/meshPhysical_CLOTH":"mat/meshPhysicalBuilder","/geo1/actor_clothSolver1":"sop/actor","/geo1/restAttributes1":"sop/restAttributes","/geo1/fileOBJ1":"sop/fileOBJ","/geo1/hierarchy1":"sop/hierarchy","/geo1/transform1":"sop/transform","/geo1/objectProperties1":"sop/objectProperties","/geo1/switch_CHARACTER":"sop/switch","/ground":"obj/geo","/ground/material1":"sop/material","/ground/MAT":"sop/materialsNetwork","/ground/MAT/meshStandardBuilder1":"mat/meshStandardBuilder","/ground/box1":"sop/box","/lights":"obj/geo","/lights/hemisphereLight1":"sop/hemisphereLight","/lights/spotLight1":"sop/spotLight","/lights/polarTransform1":"sop/polarTransform","/lights/merge1":"sop/merge","/cameras":"obj/geo","/cameras/cameraControls1":"sop/cameraControls","/cameras/cameraControls1/cameraOrbitControls1":"event/cameraOrbitControls","/cameras/perspectiveCamera_DEBUG":"sop/perspectiveCamera","/cameras/perspectiveCamera_MAIN":"sop/perspectiveCamera","/cameras/polarTransform1":"sop/polarTransform","/cameras/merge1":"sop/merge","/text":"obj/geo","/text/text1":"sop/text","/text/transform1":"sop/transform","/text/material1":"sop/material","/text/MAT":"sop/materialsNetwork","/text/MAT/meshBasic1":"mat/meshBasic"}
Js version
Editor version
Engine version
Logout
0%
There was a problem displaying your scene:
view scene source