Name
*
Code
{"properties":{"frame":2531,"maxFrame":600,"maxFrameLocked":false,"realtimeState":true,"mainCameraPath":"/perspectiveCamera_MAIN","versions":{"polygonjs":"1.1.262"}},"root":{"type":"root","nodes":{"COP":{"type":"copNetwork","nodes":{"imageEnv":{"type":"imageEXR","params":{"url":"https://raw.githubusercontent.com/polygonjs/polygonjs-assets/master/textures/piz_compressed.exr"}},"imageUv":{"type":"image","params":{"url":"https://raw.githubusercontent.com/polygonjs/polygonjs-assets/master/textures/uv.jpg","tflipY":true}},"envMap":{"type":"envMap","inputs":["imageEnv"]}}},"background_wall":{"type":"geo","nodes":{"plane1":{"type":"plane","params":{"size":[23,23],"direction":[0,0,1],"center":[0,0,-0.4]}},"material1":{"type":"material","params":{"material":"../MAT/meshStandard1"},"inputs":["plane1"],"flags":{"display":true}},"MAT":{"type":"materialsNetwork","nodes":{"meshStandard1":{"type":"meshStandard","params":{"metalness":0,"roughness":1}}}}},"flags":{"display":true},"selection":["MAT"]},"metaballs":{"type":"geo","nodes":{"sphere1":{"type":"sphere","params":{"radius":0.49}},"scatter1":{"type":"scatter","params":{"pointsCount":12,"seed":3},"inputs":["sphere1"]},"attribCreate1":{"type":"attribCreate","params":{"name":"pscale","value1":"0.5+0.4*(0.5-rand(@ptnum))"},"inputs":["scatter1"],"cloned_state_overriden":true},"metaball1":{"type":"metaball","inputs":["transform1"]},"transform1":{"type":"transform","params":{"scale":"1.5-ch(\"../eventsNetwork1/scrollTrigger1/progress\")"},"inputs":["noise1"]},"material1":{"type":"material","params":{"material":"../MAT/meshPhysicalBuilder1"},"inputs":["metaball1"],"flags":{"display":true},"cloned_state_overriden":true},"MAT":{"type":"materialsNetwork","nodes":{"meshStandard1":{"type":"meshStandard"},"meshPhysicalBuilder1":{"type":"meshPhysicalBuilder","nodes":{"globals1":{"type":"globals"},"output1":{"type":"output","inputs":[null,null,{"index":2,"node":"mix1","output":"mix"}]},"param1":{"type":"param","params":{"name":"color1","type":4,"asColor":1},"connection_points":{"in":[],"out":[{"name":"val","type":"vec3"}]}},"param2":{"type":"param","params":{"name":"color2","type":4,"asColor":true},"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}},"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,"node":"param1","output":"val"},{"index":1,"node":"param2","output":"val"},{"index":2,"node":"smoothstep1","output":"val"}],"connection_points":{"in":[{"name":"value0","type":"vec3"},{"name":"value1","type":"vec3"},{"name":"blend","type":"float"}],"out":[{"name":"mix","type":"vec3"}]}},"param3":{"type":"param","params":{"name":"center","type":4},"connection_points":{"in":[],"out":[{"name":"val","type":"vec3"}]}},"distance1":{"type":"distance","params":{"p0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"p1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}}},"inputs":[{"index":0,"node":"globals1","output":"position"},{"index":1,"node":"param3","output":"val"}],"connection_points":{"in":[{"name":"p0","type":"vec3"},{"name":"p1","type":"vec3"}],"out":[{"name":"val","type":"float"}]}},"smoothstep1":{"type":"smoothstep","params":{"edge0":{"type":"float","default_value":0,"options":{"spare":true,"editable":false}},"edge1":{"type":"float","default_value":1,"options":{"spare":true,"editable":false}},"x":{"type":"float","default_value":0,"options":{"spare":true,"editable":false}}},"inputs":[{"index":0,"node":"param4","output":"val"},{"index":1,"node":"param5","output":"val"},{"index":2,"node":"distance1","output":"val"}],"connection_points":{"in":[{"name":"edge0","type":"float"},{"name":"edge1","type":"float"},{"name":"x","type":"float"}],"out":[{"name":"val","type":"float"}]}},"param4":{"type":"param","params":{"name":"dist1"},"connection_points":{"in":[],"out":[{"name":"val","type":"float"}]}},"param5":{"type":"param","params":{"name":"dist2"},"connection_points":{"in":[],"out":[{"name":"val","type":"float"}]}}},"params":{"metalness":0,"roughness":1,"clearcoatRoughness":0.47,"color1":{"type":"color","default_value":[0,0,0],"options":{"spare":true,"computeOnDirty":true,"cook":false,"dependentOnFoundNode":true},"raw_input":[0.6352941176470588,0.8784313725490196,0.984313725490196],"overriden_options":{"callback":"{}"}},"color2":{"type":"color","default_value":[0,0,0],"options":{"spare":true,"computeOnDirty":true,"cook":false,"dependentOnFoundNode":true},"raw_input":[0.38823529411764707,0.20392156862745098,0.8980392156862745],"overriden_options":{"callback":"{}"}},"center":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"computeOnDirty":true,"cook":false,"dependentOnFoundNode":true},"raw_input":[0,-0.7,0],"overriden_options":{"callback":"{}"}},"dist1":{"type":"float","default_value":0,"options":{"spare":true,"computeOnDirty":true,"cook":false,"dependentOnFoundNode":true},"overriden_options":{"callback":"{}"}},"dist2":{"type":"float","default_value":0,"options":{"spare":true,"computeOnDirty":true,"cook":false,"dependentOnFoundNode":true},"raw_input":2,"overriden_options":{"callback":"{}"}}},"selection":["param5"],"persisted_config":{"material":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/metaballs/MAT/meshPhysicalBuilder1-main","type":"MeshPhysicalMaterial","name":"/metaballs/MAT/meshPhysicalBuilder1","color":16777215,"roughness":1,"metalness":0,"sheen":0,"sheenColor":0,"sheenRoughness":1,"emissive":0,"specularIntensity":1,"specularColor":16777215,"clearcoat":0,"clearcoatRoughness":0.47,"envMapIntensity":1,"reflectivity":0.49999999999999983,"transmission":0,"thickness":0.01,"attenuationDistance":0,"attenuationColor":16777215,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},"onBeforeCompileDataJSON":{"vertexShader":"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n\n\n\n// /metaballs/MAT/meshPhysicalBuilder1/globals1\nvarying vec3 v_POLY_globals1_position;\n\n\n\n\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\n\n\n\t// /metaballs/MAT/meshPhysicalBuilder1/globals1\n\tv_POLY_globals1_position = vec3(position);\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/output1\n\tvec3 transformed = position;\n\tvec3 objectNormal = normal;\n\t#ifdef USE_TANGENT\n\t\tvec3 objectTangent = vec3( tangent.xyz );\n\t#endif\n\n\n\n\t#include <morphcolor_vertex>\n// removed:\n//\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n// removed:\n//\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}","fragmentShader":"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULARINTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n\t#ifdef USE_SPECULARCOLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEENCOLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n\n\n\n// /metaballs/MAT/meshPhysicalBuilder1/param1\nuniform vec3 v_POLY_param_color1;\n\n// /metaballs/MAT/meshPhysicalBuilder1/param2\nuniform vec3 v_POLY_param_color2;\n\n// /metaballs/MAT/meshPhysicalBuilder1/param4\nuniform float v_POLY_param_dist1;\n\n// /metaballs/MAT/meshPhysicalBuilder1/param5\nuniform float v_POLY_param_dist2;\n\n// /metaballs/MAT/meshPhysicalBuilder1/param3\nuniform vec3 v_POLY_param_center;\n\n// /metaballs/MAT/meshPhysicalBuilder1/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 <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nstruct SSSModel {\n\tbool isActive;\n\tvec3 color;\n\tfloat thickness;\n\tfloat power;\n\tfloat scale;\n\tfloat distortion;\n\tfloat ambient;\n\tfloat attenuation;\n};\n\nvoid RE_Direct_Scattering(\n\tconst in IncidentLight directLight,\n\tconst in GeometricContext geometry,\n\tconst in SSSModel sssModel,\n\tinout ReflectedLight reflectedLight\n\t){\n\tvec3 scatteringHalf = normalize(directLight.direction + (geometry.normal * sssModel.distortion));\n\tfloat scatteringDot = pow(saturate(dot(geometry.viewDir, -scatteringHalf)), sssModel.power) * sssModel.scale;\n\tvec3 scatteringIllu = (scatteringDot + sssModel.ambient) * (sssModel.color * (1.0-sssModel.thickness));\n\treflectedLight.directDiffuse += scatteringIllu * sssModel.attenuation * directLight.color;\n}\n\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\n\n\t// /metaballs/MAT/meshPhysicalBuilder1/param1\n\tvec3 v_POLY_param1_val = v_POLY_param_color1;\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/param2\n\tvec3 v_POLY_param2_val = v_POLY_param_color2;\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/param4\n\tfloat v_POLY_param4_val = v_POLY_param_dist1;\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/param5\n\tfloat v_POLY_param5_val = v_POLY_param_dist2;\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/param3\n\tvec3 v_POLY_param3_val = v_POLY_param_center;\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/distance1\n\tfloat v_POLY_distance1_val = distance(v_POLY_globals1_position, v_POLY_param3_val);\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/smoothstep1\n\tfloat v_POLY_smoothstep1_val = smoothstep(v_POLY_param4_val, v_POLY_param5_val, v_POLY_distance1_val);\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/mix1\n\tvec3 v_POLY_mix1_mix = mix(v_POLY_param1_val, v_POLY_param2_val, v_POLY_smoothstep1_val);\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/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\tfloat roughnessFactor = roughness * POLY_roughness;\n\n#ifdef USE_ROUGHNESSMAP\n\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\n\t// reads channel G, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\n\troughnessFactor *= texelRoughness.g;\n\n#endif\n\n\tfloat metalnessFactor = metalness * POLY_metalness;\n\n#ifdef USE_METALNESSMAP\n\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\n\t// reads channel B, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\n\tmetalnessFactor *= texelMetalness.b;\n\n#endif\n\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\nif(POLY_SSSModel.isActive){\n\tRE_Direct_Scattering(directLight, geometry, POLY_SSSModel, reflectedLight);\n}\n\n\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t\n#ifdef USE_TRANSMISSION\n\n\tfloat transmissionAlpha = 1.0;\nfloat transmissionFactor = transmission * POLY_transmission;\nfloat thicknessFactor = thickness * POLY_thickness;\n\n\t#ifdef USE_TRANSMISSIONMAP\n\n\t\ttransmissionFactor *= texture2D( transmissionMap, vUv ).r;\n\n\t#endif\n\n\t#ifdef USE_THICKNESSMAP\n\n\t\tthicknessFactor *= texture2D( thicknessMap, vUv ).g;\n\n\t#endif\n\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\n\tvec4 transmission = getIBLVolumeRefraction(\n\t\tn, v, roughnessFactor, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor,\n\t\tattenuationColor, attenuationDistance );\n\n\ttotalDiffuse = mix( totalDiffuse, transmission.rgb, transmissionFactor );\n\ttransmissionAlpha = mix( transmissionAlpha, transmission.a, transmissionFactor );\n#endif\n\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;\n\t#endif\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}","timeDependent":false,"resolutionDependent":false,"paramConfigs":[{"type":"color","name":"color1","defaultValue":[0,0,0],"uniformName":"v_POLY_param_color1"},{"type":"color","name":"color2","defaultValue":[0,0,0],"uniformName":"v_POLY_param_color2"},{"type":"vector3","name":"center","defaultValue":[0,0,0],"uniformName":"v_POLY_param_center"},{"type":"float","name":"dist1","defaultValue":0,"uniformName":"v_POLY_param_dist1"},{"type":"float","name":"dist2","defaultValue":0,"uniformName":"v_POLY_param_dist2"}]},"customMaterials":{"customDepthMaterial":{"material":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/metaballs/MAT/meshPhysicalBuilder1-customDepthMaterial","type":"MeshDepthMaterial","name":"customDepthMaterial","depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"depthPacking":3201},"onBeforeCompileDataJSON":{"vertexShader":"#include <common>\n\n\n\n// /metaballs/MAT/meshPhysicalBuilder1/globals1\nvarying vec3 v_POLY_globals1_position;\n\n\n\n\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n// removed:\n//\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n// removed:\n//\t#include <begin_vertex>\n\n\n\n\t// /metaballs/MAT/meshPhysicalBuilder1/globals1\n\tv_POLY_globals1_position = vec3(position);\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/output1\n\tvec3 transformed = position;\n\tvec3 objectNormal = normal;\n\t#ifdef USE_TANGENT\n\t\tvec3 objectTangent = vec3( tangent.xyz );\n\t#endif\n\n\n\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}","fragmentShader":"\n// INSERT DEFINES\n\n\n#if DEPTH_PACKING == 3200\n\n\tuniform float opacity;\n\n#endif\n\n#include <common>\n\n\n\n// /metaballs/MAT/meshPhysicalBuilder1/param1\nuniform vec3 v_POLY_param_color1;\n\n// /metaballs/MAT/meshPhysicalBuilder1/param2\nuniform vec3 v_POLY_param_color2;\n\n// /metaballs/MAT/meshPhysicalBuilder1/param4\nuniform float v_POLY_param_dist1;\n\n// /metaballs/MAT/meshPhysicalBuilder1/param5\nuniform float v_POLY_param_dist2;\n\n// /metaballs/MAT/meshPhysicalBuilder1/param3\nuniform vec3 v_POLY_param_center;\n\n// /metaballs/MAT/meshPhysicalBuilder1/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 GeometricContext geometry,\n\tconst in SSSModel sssModel,\n\tinout ReflectedLight reflectedLight\n\t){\n\tvec3 scatteringHalf = normalize(directLight.direction + (geometry.normal * sssModel.distortion));\n\tfloat scatteringDot = pow(saturate(dot(geometry.viewDir, -scatteringHalf)), sssModel.power) * sssModel.scale;\n\tvec3 scatteringIllu = (scatteringDot + sssModel.ambient) * (sssModel.color * (1.0-sssModel.thickness));\n\treflectedLight.directDiffuse += scatteringIllu * sssModel.attenuation * directLight.color;\n}\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( 1.0 );\n\n\t#if DEPTH_PACKING == 3200\n\n\t\tdiffuseColor.a = opacity;\n\n\t#endif\n\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\n\n\n\t// /metaballs/MAT/meshPhysicalBuilder1/param1\n\tvec3 v_POLY_param1_val = v_POLY_param_color1;\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/param2\n\tvec3 v_POLY_param2_val = v_POLY_param_color2;\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/param4\n\tfloat v_POLY_param4_val = v_POLY_param_dist1;\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/param5\n\tfloat v_POLY_param5_val = v_POLY_param_dist2;\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/param3\n\tvec3 v_POLY_param3_val = v_POLY_param_center;\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/distance1\n\tfloat v_POLY_distance1_val = distance(v_POLY_globals1_position, v_POLY_param3_val);\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/smoothstep1\n\tfloat v_POLY_smoothstep1_val = smoothstep(v_POLY_param4_val, v_POLY_param5_val, v_POLY_distance1_val);\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/mix1\n\tvec3 v_POLY_mix1_mix = mix(v_POLY_param1_val, v_POLY_param2_val, v_POLY_smoothstep1_val);\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/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","timeDependent":false,"resolutionDependent":false,"paramConfigs":[{"type":"color","name":"color1","defaultValue":[0,0,0],"uniformName":"v_POLY_param_color1"},{"type":"color","name":"color2","defaultValue":[0,0,0],"uniformName":"v_POLY_param_color2"},{"type":"vector3","name":"center","defaultValue":[0,0,0],"uniformName":"v_POLY_param_center"},{"type":"float","name":"dist1","defaultValue":0,"uniformName":"v_POLY_param_dist1"},{"type":"float","name":"dist2","defaultValue":0,"uniformName":"v_POLY_param_dist2"}]}},"customDistanceMaterial":{"material":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/metaballs/MAT/meshPhysicalBuilder1-customDistanceMaterial","type":"MeshDistanceMaterial","name":"customDistanceMaterial","depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},"onBeforeCompileDataJSON":{"vertexShader":"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n\n\n\n// /metaballs/MAT/meshPhysicalBuilder1/globals1\nvarying vec3 v_POLY_globals1_position;\n\n\n\n\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n// removed:\n//\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n// removed:\n//\t#include <begin_vertex>\n\n\n\n\t// /metaballs/MAT/meshPhysicalBuilder1/globals1\n\tv_POLY_globals1_position = vec3(position);\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/output1\n\tvec3 transformed = position;\n\tvec3 objectNormal = normal;\n\t#ifdef USE_TANGENT\n\t\tvec3 objectTangent = vec3( tangent.xyz );\n\t#endif\n\n\n\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}","fragmentShader":"\n// INSERT DEFINES\n\n#define DISTANCE\n\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n\n#include <common>\n\n\n\n// /metaballs/MAT/meshPhysicalBuilder1/param1\nuniform vec3 v_POLY_param_color1;\n\n// /metaballs/MAT/meshPhysicalBuilder1/param2\nuniform vec3 v_POLY_param_color2;\n\n// /metaballs/MAT/meshPhysicalBuilder1/param4\nuniform float v_POLY_param_dist1;\n\n// /metaballs/MAT/meshPhysicalBuilder1/param5\nuniform float v_POLY_param_dist2;\n\n// /metaballs/MAT/meshPhysicalBuilder1/param3\nuniform vec3 v_POLY_param_center;\n\n// /metaballs/MAT/meshPhysicalBuilder1/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 GeometricContext geometry,\n\tconst in SSSModel sssModel,\n\tinout ReflectedLight reflectedLight\n\t){\n\tvec3 scatteringHalf = normalize(directLight.direction + (geometry.normal * sssModel.distortion));\n\tfloat scatteringDot = pow(saturate(dot(geometry.viewDir, -scatteringHalf)), sssModel.power) * sssModel.scale;\n\tvec3 scatteringIllu = (scatteringDot + sssModel.ambient) * (sssModel.color * (1.0-sssModel.thickness));\n\treflectedLight.directDiffuse += scatteringIllu * sssModel.attenuation * directLight.color;\n}\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( 1.0 );\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\n\n\n\t// /metaballs/MAT/meshPhysicalBuilder1/param1\n\tvec3 v_POLY_param1_val = v_POLY_param_color1;\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/param2\n\tvec3 v_POLY_param2_val = v_POLY_param_color2;\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/param4\n\tfloat v_POLY_param4_val = v_POLY_param_dist1;\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/param5\n\tfloat v_POLY_param5_val = v_POLY_param_dist2;\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/param3\n\tvec3 v_POLY_param3_val = v_POLY_param_center;\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/distance1\n\tfloat v_POLY_distance1_val = distance(v_POLY_globals1_position, v_POLY_param3_val);\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/smoothstep1\n\tfloat v_POLY_smoothstep1_val = smoothstep(v_POLY_param4_val, v_POLY_param5_val, v_POLY_distance1_val);\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/mix1\n\tvec3 v_POLY_mix1_mix = mix(v_POLY_param1_val, v_POLY_param2_val, v_POLY_smoothstep1_val);\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/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","timeDependent":false,"resolutionDependent":false,"paramConfigs":[{"type":"color","name":"color1","defaultValue":[0,0,0],"uniformName":"v_POLY_param_color1"},{"type":"color","name":"color2","defaultValue":[0,0,0],"uniformName":"v_POLY_param_color2"},{"type":"vector3","name":"center","defaultValue":[0,0,0],"uniformName":"v_POLY_param_center"},{"type":"float","name":"dist1","defaultValue":0,"uniformName":"v_POLY_param_dist1"},{"type":"float","name":"dist2","defaultValue":0,"uniformName":"v_POLY_param_dist2"}]}},"customDepthDOFMaterial":{"material":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/metaballs/MAT/meshPhysicalBuilder1-customDepthDOFMaterial","type":"MeshDepthMaterial","name":"customDepthDOFMaterial","depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"depthPacking":3200},"onBeforeCompileDataJSON":{"vertexShader":"#include <common>\n\n\n\n// /metaballs/MAT/meshPhysicalBuilder1/globals1\nvarying vec3 v_POLY_globals1_position;\n\n\n\n\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n// removed:\n//\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n// removed:\n//\t#include <begin_vertex>\n\n\n\n\t// /metaballs/MAT/meshPhysicalBuilder1/globals1\n\tv_POLY_globals1_position = vec3(position);\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/output1\n\tvec3 transformed = position;\n\tvec3 objectNormal = normal;\n\t#ifdef USE_TANGENT\n\t\tvec3 objectTangent = vec3( tangent.xyz );\n\t#endif\n\n\n\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}","fragmentShader":"\n// INSERT DEFINES\n\n\n#if DEPTH_PACKING == 3200\n\n\tuniform float opacity;\n\n#endif\n\n#include <common>\n\n\n\n// /metaballs/MAT/meshPhysicalBuilder1/param1\nuniform vec3 v_POLY_param_color1;\n\n// /metaballs/MAT/meshPhysicalBuilder1/param2\nuniform vec3 v_POLY_param_color2;\n\n// /metaballs/MAT/meshPhysicalBuilder1/param4\nuniform float v_POLY_param_dist1;\n\n// /metaballs/MAT/meshPhysicalBuilder1/param5\nuniform float v_POLY_param_dist2;\n\n// /metaballs/MAT/meshPhysicalBuilder1/param3\nuniform vec3 v_POLY_param_center;\n\n// /metaballs/MAT/meshPhysicalBuilder1/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 GeometricContext geometry,\n\tconst in SSSModel sssModel,\n\tinout ReflectedLight reflectedLight\n\t){\n\tvec3 scatteringHalf = normalize(directLight.direction + (geometry.normal * sssModel.distortion));\n\tfloat scatteringDot = pow(saturate(dot(geometry.viewDir, -scatteringHalf)), sssModel.power) * sssModel.scale;\n\tvec3 scatteringIllu = (scatteringDot + sssModel.ambient) * (sssModel.color * (1.0-sssModel.thickness));\n\treflectedLight.directDiffuse += scatteringIllu * sssModel.attenuation * directLight.color;\n}\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( 1.0 );\n\n\t#if DEPTH_PACKING == 3200\n\n\t\tdiffuseColor.a = opacity;\n\n\t#endif\n\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\n\n\n\t// /metaballs/MAT/meshPhysicalBuilder1/param1\n\tvec3 v_POLY_param1_val = v_POLY_param_color1;\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/param2\n\tvec3 v_POLY_param2_val = v_POLY_param_color2;\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/param4\n\tfloat v_POLY_param4_val = v_POLY_param_dist1;\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/param5\n\tfloat v_POLY_param5_val = v_POLY_param_dist2;\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/param3\n\tvec3 v_POLY_param3_val = v_POLY_param_center;\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/distance1\n\tfloat v_POLY_distance1_val = distance(v_POLY_globals1_position, v_POLY_param3_val);\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/smoothstep1\n\tfloat v_POLY_smoothstep1_val = smoothstep(v_POLY_param4_val, v_POLY_param5_val, v_POLY_distance1_val);\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/mix1\n\tvec3 v_POLY_mix1_mix = mix(v_POLY_param1_val, v_POLY_param2_val, v_POLY_smoothstep1_val);\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/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","timeDependent":false,"resolutionDependent":false,"paramConfigs":[{"type":"color","name":"color1","defaultValue":[0,0,0],"uniformName":"v_POLY_param_color1"},{"type":"color","name":"color2","defaultValue":[0,0,0],"uniformName":"v_POLY_param_color2"},{"type":"vector3","name":"center","defaultValue":[0,0,0],"uniformName":"v_POLY_param_center"},{"type":"float","name":"dist1","defaultValue":0,"uniformName":"v_POLY_param_dist1"},{"type":"float","name":"dist2","defaultValue":0,"uniformName":"v_POLY_param_dist2"}]}}}}}}},"eventsNetwork1":{"type":"eventsNetwork","nodes":{"scene1":{"type":"scene"},"scrollTrigger1":{"type":"scrollTrigger","params":{"element":".scene-player-container","tprogress":true,"progress":0.5},"inputs":[{"index":0,"node":"scene1","output":"sceneLoaded"}]}}},"noise1":{"type":"noise","params":{"amplitude":0.17,"offset":[0,"$T*0.1",0],"useNormals":1},"inputs":["attribCreate1"]}},"flags":{"display":true}},"perspectiveCamera_MAIN":{"type":"perspectiveCamera","nodes":{"events1":{"type":"eventsNetwork","nodes":{"cameraOrbitControls1":{"type":"cameraOrbitControls","params":{"target":[-0.010163239137097537,0.18525291669906754,-0.17316874704305452]}}},"selection":["cameraOrbitControls1"]}},"params":{"t":[0,0,2.814738208647524],"controls":"./events1/cameraOrbitControls1"},"flags":{"display":true}},"perspectiveCamera_DEBUG":{"type":"perspectiveCamera","nodes":{"events1":{"type":"eventsNetwork","nodes":{"cameraOrbitControls1":{"type":"cameraOrbitControls"}},"selection":["cameraOrbitControls1"]}},"params":{"t":[3.0161526633531355,1.1787657307191874,2.814738208647524],"r":[-22.723127930556515,44.66532130223666,16.403892417511617],"controls":"./events1/cameraOrbitControls1"},"flags":{"display":true}},"lights":{"type":"geo","nodes":{"hemisphereLight1":{"type":"hemisphereLight"},"spotLight1":{"type":"spotLight","params":{"penumbra":0.76}},"areaLight1":{"type":"areaLight","params":{"width":1.6,"showHelper":true}},"polarTransform1":{"type":"polarTransform","params":{"longitude":64.8,"latitude":36,"depth":2.8},"inputs":["spotLight1"]},"polarTransform2":{"type":"polarTransform","params":{"longitude":295.2,"latitude":-72,"depth":2.5},"inputs":["areaLight1"]},"merge1":{"type":"merge","inputs":["polarTransform1","polarTransform2","hemisphereLight1"],"flags":{"display":true}}},"flags":{"display":true}}},"params":{"bgColor":[0.8509803921568627,0.8509803921568627,0.8509803921568627],"mainCameraPath":"/perspectiveCamera_MAIN"}},"ui":{"nodes":{"COP":{"pos":[-400,200],"nodes":{"imageEnv":{"pos":[50,100]},"imageUv":{"pos":[-100,100]},"envMap":{"pos":[50,200]}}},"background_wall":{"pos":[-50,-300],"nodes":{"plane1":{"pos":[0,-150]},"material1":{"pos":[0,-50]},"MAT":{"pos":[-200,-50],"nodes":{"meshStandard1":{"pos":[0,0]}}}}},"metaballs":{"pos":[-50,-200],"nodes":{"sphere1":{"pos":[0,-100]},"scatter1":{"pos":[0,0],"comment":"here we scatter some points on the sphere\\n"},"attribCreate1":{"pos":[0,200],"comment":"We add a pscale attribute on the points, which is set to vary between 0.1 and 0.9. This will define the size of the metaballs."},"metaball1":{"pos":[0,800],"comment":"This creates the metaballs using the input points\\n"},"transform1":{"pos":[0,650],"comment":"The transform scale parameter is driven by the scroll event node (inside the eventsNetwork1 node)\\n"},"material1":{"pos":[0,950]},"MAT":{"pos":[-250,450],"nodes":{"meshStandard1":{"pos":[0,0]},"meshPhysicalBuilder1":{"pos":[0,100],"nodes":{"globals1":{"pos":[-650,0]},"output1":{"pos":[200,0]},"param1":{"pos":[-250,-500]},"param2":{"pos":[-250,-350]},"mix1":{"pos":[-50,-300]},"param3":{"pos":[-500,200]},"distance1":{"pos":[-450,0]},"smoothstep1":{"pos":[-150,-50]},"param4":{"pos":[-350,-250]},"param5":{"pos":[-350,-100]}}}}},"eventsNetwork1":{"pos":[-250,600],"nodes":{"scene1":{"pos":[-100,0]},"scrollTrigger1":{"pos":[150,0]}}},"noise1":{"pos":[0,450],"comment":"The noise animated the metaballs when we are not scrolling\\n"}}},"perspectiveCamera_MAIN":{"pos":[-400,100],"nodes":{"events1":{"pos":[-200,50],"nodes":{"cameraOrbitControls1":{"pos":[150,50]}}}}},"perspectiveCamera_DEBUG":{"pos":[-400,0],"nodes":{"events1":{"pos":[-200,50],"nodes":{"cameraOrbitControls1":{"pos":[150,50]}}}}},"lights":{"pos":[-50,-100],"nodes":{"hemisphereLight1":{"pos":[100,-100]},"spotLight1":{"pos":[-300,-100]},"areaLight1":{"pos":[-100,-100]},"polarTransform1":{"pos":[-300,50]},"polarTransform2":{"pos":[-100,50]},"merge1":{"pos":[-100,250]}}}}}}
Code editor
{"multiple_panel":{"split_ratio":0.5,"split_panel0":{"split_ratio":0.5,"split_panel0":{"panelTypes":["viewer"],"currentPanelIndex":0,"panel_data":{"camera":"/perspectiveCamera_MAIN","linkIndex":1}},"split_panel1":{"panelTypes":["params","spreadsheet"],"currentPanelIndex":0,"panel_data":{"active_folder":128,"linkIndex":1}},"split_mode":"vertical"},"split_panel1":{"panelTypes":["network","params","viewer"],"currentPanelIndex":0,"panel_data":{"camera":{"position":{"x":-176.91375566051653,"y":-425.54274832877945},"zoom":0.6498710562414267},"history":{"2":{"position":{"x":-99.63723271293463,"y":13.73540316604992},"zoom":0.6510000000000001},"3":{"position":{"x":-48,"y":-22},"zoom":0.5},"6":{"position":{"x":11.339999999999996,"y":-96.49999999999999},"zoom":0.6172839506172841},"9":{"position":{"x":-32,"y":-88},"zoom":0.5},"33":{"position":{"x":-319.66200000000003,"y":-614.5219999999999},"zoom":0.6868710562414267},"79":{"position":{"x":-176.91375566051653,"y":-425.54274832877945},"zoom":0.6498710562414267},"131":{"position":{"x":-59.04899999999998,"y":-65.1854},"zoom":0.8467543904215146},"475":{"position":{"x":-403.86599999999993,"y":52.487999999999985},"zoom":0.6858710562414267},"578":{"position":{"x":39.95509273174094,"y":3.8666218772652527},"zoom":0.7758710562414268},"742":{"position":{"x":0,"y":0},"zoom":0.5},"821":{"position":{"x":0,"y":0},"zoom":0.5},"1059":{"position":{"x":-76.80491551459292,"y":3.0721966205837177},"zoom":0.6510000000000001},"1279":{"position":{"x":-427.07429265752455,"y":58.40332207282387},"zoom":0.8218710562414269}},"linkIndex":1}},"split_mode":"horizontal"},"currentNodes":["/metaballs","/","/","/","/","/","/","/"],"navigationHistory":{"nodePaths":{"1":["/","/metaballs","/","/metaballs","/metaballs/MAT","/metaballs","/","/background_wall","/background_wall/MAT","/background_wall","/","/metaballs","/metaballs/MAT","/metaballs","/metaballs/MAT","/metaballs/MAT/meshPhysicalBuilder1","/metaballs/MAT","/metaballs","/metaballs/MAT","/metaballs/MAT/meshPhysicalBuilder1","/metaballs/MAT","/metaballs","/metaballs/MAT","/metaballs/MAT/meshPhysicalBuilder1","/metaballs/MAT","/metaballs","/metaballs/MAT","/metaballs","/metaballs/MAT","/metaballs","/","/metaballs","/metaballs/eventsNetwork1","/metaballs","/","/lights","/","/lights","/","/lights","/","/lights","/","/lights","/","/lights","/","/lights","/","/lights","/","/metaballs"],"2":["/"],"3":["/"],"4":["/"],"5":["/"],"6":["/"],"7":["/"],"8":["/"]},"index":{"1":51,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0}},"fullscreenPanelId":null,"saveOptions":{"createExport":true,"compressJs":true,"publishToIntegrations":false},"paramsModal":[]}
Used nodes
cop/envMap;cop/image;cop/imageEXR;event/cameraOrbitControls;event/scene;event/scrollTrigger;mat/meshPhysicalBuilder;mat/meshStandard;obj/copNetwork;obj/geo;obj/perspectiveCamera;sop/areaLight;sop/attribCreate;sop/eventsNetwork;sop/hemisphereLight;sop/material;sop/materialsNetwork;sop/merge;sop/metaball;sop/noise;sop/plane;sop/polarTransform;sop/scatter;sop/sphere;sop/spotLight;sop/transform
Used operations
Used modules
Used assemblers
GL_MESH_PHYSICAL
Used integrations
[]
Used assets
Nodes map
{"/COP":"obj/copNetwork","/COP/imageEnv":"cop/imageEXR","/COP/imageUv":"cop/image","/COP/envMap":"cop/envMap","/background_wall":"obj/geo","/background_wall/plane1":"sop/plane","/background_wall/material1":"sop/material","/background_wall/MAT":"sop/materialsNetwork","/background_wall/MAT/meshStandard1":"mat/meshStandard","/metaballs":"obj/geo","/metaballs/sphere1":"sop/sphere","/metaballs/scatter1":"sop/scatter","/metaballs/attribCreate1":"sop/attribCreate","/metaballs/metaball1":"sop/metaball","/metaballs/transform1":"sop/transform","/metaballs/material1":"sop/material","/metaballs/MAT":"sop/materialsNetwork","/metaballs/MAT/meshStandard1":"mat/meshStandard","/metaballs/MAT/meshPhysicalBuilder1":"mat/meshPhysicalBuilder","/metaballs/eventsNetwork1":"sop/eventsNetwork","/metaballs/eventsNetwork1/scene1":"event/scene","/metaballs/eventsNetwork1/scrollTrigger1":"event/scrollTrigger","/metaballs/noise1":"sop/noise","/perspectiveCamera_MAIN":"obj/perspectiveCamera","/perspectiveCamera_MAIN/events1":"sop/eventsNetwork","/perspectiveCamera_MAIN/events1/cameraOrbitControls1":"event/cameraOrbitControls","/perspectiveCamera_DEBUG":"obj/perspectiveCamera","/perspectiveCamera_DEBUG/events1":"sop/eventsNetwork","/perspectiveCamera_DEBUG/events1/cameraOrbitControls1":"event/cameraOrbitControls","/lights":"obj/geo","/lights/hemisphereLight1":"sop/hemisphereLight","/lights/spotLight1":"sop/spotLight","/lights/areaLight1":"sop/areaLight","/lights/polarTransform1":"sop/polarTransform","/lights/polarTransform2":"sop/polarTransform","/lights/merge1":"sop/merge"}
Js version
Editor version
Engine version
Name
*
Code
{"properties":{"frame":2531,"maxFrame":600,"maxFrameLocked":false,"realtimeState":true,"mainCameraPath":"/perspectiveCamera_MAIN","versions":{"polygonjs":"1.1.262"}},"root":{"type":"root","nodes":{"COP":{"type":"copNetwork","nodes":{"imageEnv":{"type":"imageEXR","params":{"url":"https://raw.githubusercontent.com/polygonjs/polygonjs-assets/master/textures/piz_compressed.exr"}},"imageUv":{"type":"image","params":{"url":"https://raw.githubusercontent.com/polygonjs/polygonjs-assets/master/textures/uv.jpg","tflipY":true}},"envMap":{"type":"envMap","inputs":["imageEnv"]}}},"background_wall":{"type":"geo","nodes":{"plane1":{"type":"plane","params":{"size":[23,23],"direction":[0,0,1],"center":[0,0,-0.4]}},"material1":{"type":"material","params":{"material":"../MAT/meshStandard1"},"inputs":["plane1"],"flags":{"display":true}},"MAT":{"type":"materialsNetwork","nodes":{"meshStandard1":{"type":"meshStandard","params":{"metalness":0,"roughness":1}}}}},"flags":{"display":true},"selection":["MAT"]},"metaballs":{"type":"geo","nodes":{"sphere1":{"type":"sphere","params":{"radius":0.49}},"scatter1":{"type":"scatter","params":{"pointsCount":12,"seed":3},"inputs":["sphere1"]},"attribCreate1":{"type":"attribCreate","params":{"name":"pscale","value1":"0.5+0.4*(0.5-rand(@ptnum))"},"inputs":["scatter1"],"cloned_state_overriden":true},"metaball1":{"type":"metaball","inputs":["transform1"]},"transform1":{"type":"transform","params":{"scale":"1.5-ch(\"../eventsNetwork1/scrollTrigger1/progress\")"},"inputs":["noise1"]},"material1":{"type":"material","params":{"material":"../MAT/meshPhysicalBuilder1"},"inputs":["metaball1"],"flags":{"display":true},"cloned_state_overriden":true},"MAT":{"type":"materialsNetwork","nodes":{"meshStandard1":{"type":"meshStandard"},"meshPhysicalBuilder1":{"type":"meshPhysicalBuilder","nodes":{"globals1":{"type":"globals"},"output1":{"type":"output","inputs":[null,null,{"index":2,"node":"mix1","output":"mix"}]},"param1":{"type":"param","params":{"name":"color1","type":4,"asColor":1},"connection_points":{"in":[],"out":[{"name":"val","type":"vec3"}]}},"param2":{"type":"param","params":{"name":"color2","type":4,"asColor":true},"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}},"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,"node":"param1","output":"val"},{"index":1,"node":"param2","output":"val"},{"index":2,"node":"smoothstep1","output":"val"}],"connection_points":{"in":[{"name":"value0","type":"vec3"},{"name":"value1","type":"vec3"},{"name":"blend","type":"float"}],"out":[{"name":"mix","type":"vec3"}]}},"param3":{"type":"param","params":{"name":"center","type":4},"connection_points":{"in":[],"out":[{"name":"val","type":"vec3"}]}},"distance1":{"type":"distance","params":{"p0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"p1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}}},"inputs":[{"index":0,"node":"globals1","output":"position"},{"index":1,"node":"param3","output":"val"}],"connection_points":{"in":[{"name":"p0","type":"vec3"},{"name":"p1","type":"vec3"}],"out":[{"name":"val","type":"float"}]}},"smoothstep1":{"type":"smoothstep","params":{"edge0":{"type":"float","default_value":0,"options":{"spare":true,"editable":false}},"edge1":{"type":"float","default_value":1,"options":{"spare":true,"editable":false}},"x":{"type":"float","default_value":0,"options":{"spare":true,"editable":false}}},"inputs":[{"index":0,"node":"param4","output":"val"},{"index":1,"node":"param5","output":"val"},{"index":2,"node":"distance1","output":"val"}],"connection_points":{"in":[{"name":"edge0","type":"float"},{"name":"edge1","type":"float"},{"name":"x","type":"float"}],"out":[{"name":"val","type":"float"}]}},"param4":{"type":"param","params":{"name":"dist1"},"connection_points":{"in":[],"out":[{"name":"val","type":"float"}]}},"param5":{"type":"param","params":{"name":"dist2"},"connection_points":{"in":[],"out":[{"name":"val","type":"float"}]}}},"params":{"metalness":0,"roughness":1,"clearcoatRoughness":0.47,"color1":{"type":"color","default_value":[0,0,0],"options":{"spare":true,"computeOnDirty":true,"cook":false,"dependentOnFoundNode":true},"raw_input":[0.6352941176470588,0.8784313725490196,0.984313725490196],"overriden_options":{"callback":"{}"}},"color2":{"type":"color","default_value":[0,0,0],"options":{"spare":true,"computeOnDirty":true,"cook":false,"dependentOnFoundNode":true},"raw_input":[0.38823529411764707,0.20392156862745098,0.8980392156862745],"overriden_options":{"callback":"{}"}},"center":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"computeOnDirty":true,"cook":false,"dependentOnFoundNode":true},"raw_input":[0,-0.7,0],"overriden_options":{"callback":"{}"}},"dist1":{"type":"float","default_value":0,"options":{"spare":true,"computeOnDirty":true,"cook":false,"dependentOnFoundNode":true},"overriden_options":{"callback":"{}"}},"dist2":{"type":"float","default_value":0,"options":{"spare":true,"computeOnDirty":true,"cook":false,"dependentOnFoundNode":true},"raw_input":2,"overriden_options":{"callback":"{}"}}},"selection":["param5"],"persisted_config":{"material":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/metaballs/MAT/meshPhysicalBuilder1-main","type":"MeshPhysicalMaterial","name":"/metaballs/MAT/meshPhysicalBuilder1","color":16777215,"roughness":1,"metalness":0,"sheen":0,"sheenColor":0,"sheenRoughness":1,"emissive":0,"specularIntensity":1,"specularColor":16777215,"clearcoat":0,"clearcoatRoughness":0.47,"envMapIntensity":1,"reflectivity":0.49999999999999983,"transmission":0,"thickness":0.01,"attenuationDistance":0,"attenuationColor":16777215,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},"onBeforeCompileDataJSON":{"vertexShader":"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n\n\n\n// /metaballs/MAT/meshPhysicalBuilder1/globals1\nvarying vec3 v_POLY_globals1_position;\n\n\n\n\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\n\n\n\t// /metaballs/MAT/meshPhysicalBuilder1/globals1\n\tv_POLY_globals1_position = vec3(position);\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/output1\n\tvec3 transformed = position;\n\tvec3 objectNormal = normal;\n\t#ifdef USE_TANGENT\n\t\tvec3 objectTangent = vec3( tangent.xyz );\n\t#endif\n\n\n\n\t#include <morphcolor_vertex>\n// removed:\n//\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n// removed:\n//\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}","fragmentShader":"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULARINTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n\t#ifdef USE_SPECULARCOLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEENCOLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n\n\n\n// /metaballs/MAT/meshPhysicalBuilder1/param1\nuniform vec3 v_POLY_param_color1;\n\n// /metaballs/MAT/meshPhysicalBuilder1/param2\nuniform vec3 v_POLY_param_color2;\n\n// /metaballs/MAT/meshPhysicalBuilder1/param4\nuniform float v_POLY_param_dist1;\n\n// /metaballs/MAT/meshPhysicalBuilder1/param5\nuniform float v_POLY_param_dist2;\n\n// /metaballs/MAT/meshPhysicalBuilder1/param3\nuniform vec3 v_POLY_param_center;\n\n// /metaballs/MAT/meshPhysicalBuilder1/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 <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nstruct SSSModel {\n\tbool isActive;\n\tvec3 color;\n\tfloat thickness;\n\tfloat power;\n\tfloat scale;\n\tfloat distortion;\n\tfloat ambient;\n\tfloat attenuation;\n};\n\nvoid RE_Direct_Scattering(\n\tconst in IncidentLight directLight,\n\tconst in GeometricContext geometry,\n\tconst in SSSModel sssModel,\n\tinout ReflectedLight reflectedLight\n\t){\n\tvec3 scatteringHalf = normalize(directLight.direction + (geometry.normal * sssModel.distortion));\n\tfloat scatteringDot = pow(saturate(dot(geometry.viewDir, -scatteringHalf)), sssModel.power) * sssModel.scale;\n\tvec3 scatteringIllu = (scatteringDot + sssModel.ambient) * (sssModel.color * (1.0-sssModel.thickness));\n\treflectedLight.directDiffuse += scatteringIllu * sssModel.attenuation * directLight.color;\n}\n\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\n\n\t// /metaballs/MAT/meshPhysicalBuilder1/param1\n\tvec3 v_POLY_param1_val = v_POLY_param_color1;\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/param2\n\tvec3 v_POLY_param2_val = v_POLY_param_color2;\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/param4\n\tfloat v_POLY_param4_val = v_POLY_param_dist1;\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/param5\n\tfloat v_POLY_param5_val = v_POLY_param_dist2;\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/param3\n\tvec3 v_POLY_param3_val = v_POLY_param_center;\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/distance1\n\tfloat v_POLY_distance1_val = distance(v_POLY_globals1_position, v_POLY_param3_val);\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/smoothstep1\n\tfloat v_POLY_smoothstep1_val = smoothstep(v_POLY_param4_val, v_POLY_param5_val, v_POLY_distance1_val);\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/mix1\n\tvec3 v_POLY_mix1_mix = mix(v_POLY_param1_val, v_POLY_param2_val, v_POLY_smoothstep1_val);\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/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\tfloat roughnessFactor = roughness * POLY_roughness;\n\n#ifdef USE_ROUGHNESSMAP\n\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\n\t// reads channel G, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\n\troughnessFactor *= texelRoughness.g;\n\n#endif\n\n\tfloat metalnessFactor = metalness * POLY_metalness;\n\n#ifdef USE_METALNESSMAP\n\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\n\t// reads channel B, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\n\tmetalnessFactor *= texelMetalness.b;\n\n#endif\n\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\nif(POLY_SSSModel.isActive){\n\tRE_Direct_Scattering(directLight, geometry, POLY_SSSModel, reflectedLight);\n}\n\n\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t\n#ifdef USE_TRANSMISSION\n\n\tfloat transmissionAlpha = 1.0;\nfloat transmissionFactor = transmission * POLY_transmission;\nfloat thicknessFactor = thickness * POLY_thickness;\n\n\t#ifdef USE_TRANSMISSIONMAP\n\n\t\ttransmissionFactor *= texture2D( transmissionMap, vUv ).r;\n\n\t#endif\n\n\t#ifdef USE_THICKNESSMAP\n\n\t\tthicknessFactor *= texture2D( thicknessMap, vUv ).g;\n\n\t#endif\n\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\n\tvec4 transmission = getIBLVolumeRefraction(\n\t\tn, v, roughnessFactor, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor,\n\t\tattenuationColor, attenuationDistance );\n\n\ttotalDiffuse = mix( totalDiffuse, transmission.rgb, transmissionFactor );\n\ttransmissionAlpha = mix( transmissionAlpha, transmission.a, transmissionFactor );\n#endif\n\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;\n\t#endif\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}","timeDependent":false,"resolutionDependent":false,"paramConfigs":[{"type":"color","name":"color1","defaultValue":[0,0,0],"uniformName":"v_POLY_param_color1"},{"type":"color","name":"color2","defaultValue":[0,0,0],"uniformName":"v_POLY_param_color2"},{"type":"vector3","name":"center","defaultValue":[0,0,0],"uniformName":"v_POLY_param_center"},{"type":"float","name":"dist1","defaultValue":0,"uniformName":"v_POLY_param_dist1"},{"type":"float","name":"dist2","defaultValue":0,"uniformName":"v_POLY_param_dist2"}]},"customMaterials":{"customDepthMaterial":{"material":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/metaballs/MAT/meshPhysicalBuilder1-customDepthMaterial","type":"MeshDepthMaterial","name":"customDepthMaterial","depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"depthPacking":3201},"onBeforeCompileDataJSON":{"vertexShader":"#include <common>\n\n\n\n// /metaballs/MAT/meshPhysicalBuilder1/globals1\nvarying vec3 v_POLY_globals1_position;\n\n\n\n\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n// removed:\n//\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n// removed:\n//\t#include <begin_vertex>\n\n\n\n\t// /metaballs/MAT/meshPhysicalBuilder1/globals1\n\tv_POLY_globals1_position = vec3(position);\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/output1\n\tvec3 transformed = position;\n\tvec3 objectNormal = normal;\n\t#ifdef USE_TANGENT\n\t\tvec3 objectTangent = vec3( tangent.xyz );\n\t#endif\n\n\n\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}","fragmentShader":"\n// INSERT DEFINES\n\n\n#if DEPTH_PACKING == 3200\n\n\tuniform float opacity;\n\n#endif\n\n#include <common>\n\n\n\n// /metaballs/MAT/meshPhysicalBuilder1/param1\nuniform vec3 v_POLY_param_color1;\n\n// /metaballs/MAT/meshPhysicalBuilder1/param2\nuniform vec3 v_POLY_param_color2;\n\n// /metaballs/MAT/meshPhysicalBuilder1/param4\nuniform float v_POLY_param_dist1;\n\n// /metaballs/MAT/meshPhysicalBuilder1/param5\nuniform float v_POLY_param_dist2;\n\n// /metaballs/MAT/meshPhysicalBuilder1/param3\nuniform vec3 v_POLY_param_center;\n\n// /metaballs/MAT/meshPhysicalBuilder1/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 GeometricContext geometry,\n\tconst in SSSModel sssModel,\n\tinout ReflectedLight reflectedLight\n\t){\n\tvec3 scatteringHalf = normalize(directLight.direction + (geometry.normal * sssModel.distortion));\n\tfloat scatteringDot = pow(saturate(dot(geometry.viewDir, -scatteringHalf)), sssModel.power) * sssModel.scale;\n\tvec3 scatteringIllu = (scatteringDot + sssModel.ambient) * (sssModel.color * (1.0-sssModel.thickness));\n\treflectedLight.directDiffuse += scatteringIllu * sssModel.attenuation * directLight.color;\n}\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( 1.0 );\n\n\t#if DEPTH_PACKING == 3200\n\n\t\tdiffuseColor.a = opacity;\n\n\t#endif\n\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\n\n\n\t// /metaballs/MAT/meshPhysicalBuilder1/param1\n\tvec3 v_POLY_param1_val = v_POLY_param_color1;\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/param2\n\tvec3 v_POLY_param2_val = v_POLY_param_color2;\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/param4\n\tfloat v_POLY_param4_val = v_POLY_param_dist1;\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/param5\n\tfloat v_POLY_param5_val = v_POLY_param_dist2;\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/param3\n\tvec3 v_POLY_param3_val = v_POLY_param_center;\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/distance1\n\tfloat v_POLY_distance1_val = distance(v_POLY_globals1_position, v_POLY_param3_val);\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/smoothstep1\n\tfloat v_POLY_smoothstep1_val = smoothstep(v_POLY_param4_val, v_POLY_param5_val, v_POLY_distance1_val);\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/mix1\n\tvec3 v_POLY_mix1_mix = mix(v_POLY_param1_val, v_POLY_param2_val, v_POLY_smoothstep1_val);\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/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","timeDependent":false,"resolutionDependent":false,"paramConfigs":[{"type":"color","name":"color1","defaultValue":[0,0,0],"uniformName":"v_POLY_param_color1"},{"type":"color","name":"color2","defaultValue":[0,0,0],"uniformName":"v_POLY_param_color2"},{"type":"vector3","name":"center","defaultValue":[0,0,0],"uniformName":"v_POLY_param_center"},{"type":"float","name":"dist1","defaultValue":0,"uniformName":"v_POLY_param_dist1"},{"type":"float","name":"dist2","defaultValue":0,"uniformName":"v_POLY_param_dist2"}]}},"customDistanceMaterial":{"material":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/metaballs/MAT/meshPhysicalBuilder1-customDistanceMaterial","type":"MeshDistanceMaterial","name":"customDistanceMaterial","depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},"onBeforeCompileDataJSON":{"vertexShader":"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n\n\n\n// /metaballs/MAT/meshPhysicalBuilder1/globals1\nvarying vec3 v_POLY_globals1_position;\n\n\n\n\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n// removed:\n//\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n// removed:\n//\t#include <begin_vertex>\n\n\n\n\t// /metaballs/MAT/meshPhysicalBuilder1/globals1\n\tv_POLY_globals1_position = vec3(position);\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/output1\n\tvec3 transformed = position;\n\tvec3 objectNormal = normal;\n\t#ifdef USE_TANGENT\n\t\tvec3 objectTangent = vec3( tangent.xyz );\n\t#endif\n\n\n\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}","fragmentShader":"\n// INSERT DEFINES\n\n#define DISTANCE\n\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n\n#include <common>\n\n\n\n// /metaballs/MAT/meshPhysicalBuilder1/param1\nuniform vec3 v_POLY_param_color1;\n\n// /metaballs/MAT/meshPhysicalBuilder1/param2\nuniform vec3 v_POLY_param_color2;\n\n// /metaballs/MAT/meshPhysicalBuilder1/param4\nuniform float v_POLY_param_dist1;\n\n// /metaballs/MAT/meshPhysicalBuilder1/param5\nuniform float v_POLY_param_dist2;\n\n// /metaballs/MAT/meshPhysicalBuilder1/param3\nuniform vec3 v_POLY_param_center;\n\n// /metaballs/MAT/meshPhysicalBuilder1/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 GeometricContext geometry,\n\tconst in SSSModel sssModel,\n\tinout ReflectedLight reflectedLight\n\t){\n\tvec3 scatteringHalf = normalize(directLight.direction + (geometry.normal * sssModel.distortion));\n\tfloat scatteringDot = pow(saturate(dot(geometry.viewDir, -scatteringHalf)), sssModel.power) * sssModel.scale;\n\tvec3 scatteringIllu = (scatteringDot + sssModel.ambient) * (sssModel.color * (1.0-sssModel.thickness));\n\treflectedLight.directDiffuse += scatteringIllu * sssModel.attenuation * directLight.color;\n}\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( 1.0 );\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\n\n\n\t// /metaballs/MAT/meshPhysicalBuilder1/param1\n\tvec3 v_POLY_param1_val = v_POLY_param_color1;\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/param2\n\tvec3 v_POLY_param2_val = v_POLY_param_color2;\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/param4\n\tfloat v_POLY_param4_val = v_POLY_param_dist1;\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/param5\n\tfloat v_POLY_param5_val = v_POLY_param_dist2;\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/param3\n\tvec3 v_POLY_param3_val = v_POLY_param_center;\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/distance1\n\tfloat v_POLY_distance1_val = distance(v_POLY_globals1_position, v_POLY_param3_val);\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/smoothstep1\n\tfloat v_POLY_smoothstep1_val = smoothstep(v_POLY_param4_val, v_POLY_param5_val, v_POLY_distance1_val);\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/mix1\n\tvec3 v_POLY_mix1_mix = mix(v_POLY_param1_val, v_POLY_param2_val, v_POLY_smoothstep1_val);\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/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","timeDependent":false,"resolutionDependent":false,"paramConfigs":[{"type":"color","name":"color1","defaultValue":[0,0,0],"uniformName":"v_POLY_param_color1"},{"type":"color","name":"color2","defaultValue":[0,0,0],"uniformName":"v_POLY_param_color2"},{"type":"vector3","name":"center","defaultValue":[0,0,0],"uniformName":"v_POLY_param_center"},{"type":"float","name":"dist1","defaultValue":0,"uniformName":"v_POLY_param_dist1"},{"type":"float","name":"dist2","defaultValue":0,"uniformName":"v_POLY_param_dist2"}]}},"customDepthDOFMaterial":{"material":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/metaballs/MAT/meshPhysicalBuilder1-customDepthDOFMaterial","type":"MeshDepthMaterial","name":"customDepthDOFMaterial","depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"depthPacking":3200},"onBeforeCompileDataJSON":{"vertexShader":"#include <common>\n\n\n\n// /metaballs/MAT/meshPhysicalBuilder1/globals1\nvarying vec3 v_POLY_globals1_position;\n\n\n\n\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n// removed:\n//\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n// removed:\n//\t#include <begin_vertex>\n\n\n\n\t// /metaballs/MAT/meshPhysicalBuilder1/globals1\n\tv_POLY_globals1_position = vec3(position);\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/output1\n\tvec3 transformed = position;\n\tvec3 objectNormal = normal;\n\t#ifdef USE_TANGENT\n\t\tvec3 objectTangent = vec3( tangent.xyz );\n\t#endif\n\n\n\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}","fragmentShader":"\n// INSERT DEFINES\n\n\n#if DEPTH_PACKING == 3200\n\n\tuniform float opacity;\n\n#endif\n\n#include <common>\n\n\n\n// /metaballs/MAT/meshPhysicalBuilder1/param1\nuniform vec3 v_POLY_param_color1;\n\n// /metaballs/MAT/meshPhysicalBuilder1/param2\nuniform vec3 v_POLY_param_color2;\n\n// /metaballs/MAT/meshPhysicalBuilder1/param4\nuniform float v_POLY_param_dist1;\n\n// /metaballs/MAT/meshPhysicalBuilder1/param5\nuniform float v_POLY_param_dist2;\n\n// /metaballs/MAT/meshPhysicalBuilder1/param3\nuniform vec3 v_POLY_param_center;\n\n// /metaballs/MAT/meshPhysicalBuilder1/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 GeometricContext geometry,\n\tconst in SSSModel sssModel,\n\tinout ReflectedLight reflectedLight\n\t){\n\tvec3 scatteringHalf = normalize(directLight.direction + (geometry.normal * sssModel.distortion));\n\tfloat scatteringDot = pow(saturate(dot(geometry.viewDir, -scatteringHalf)), sssModel.power) * sssModel.scale;\n\tvec3 scatteringIllu = (scatteringDot + sssModel.ambient) * (sssModel.color * (1.0-sssModel.thickness));\n\treflectedLight.directDiffuse += scatteringIllu * sssModel.attenuation * directLight.color;\n}\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( 1.0 );\n\n\t#if DEPTH_PACKING == 3200\n\n\t\tdiffuseColor.a = opacity;\n\n\t#endif\n\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\n\n\n\t// /metaballs/MAT/meshPhysicalBuilder1/param1\n\tvec3 v_POLY_param1_val = v_POLY_param_color1;\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/param2\n\tvec3 v_POLY_param2_val = v_POLY_param_color2;\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/param4\n\tfloat v_POLY_param4_val = v_POLY_param_dist1;\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/param5\n\tfloat v_POLY_param5_val = v_POLY_param_dist2;\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/param3\n\tvec3 v_POLY_param3_val = v_POLY_param_center;\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/distance1\n\tfloat v_POLY_distance1_val = distance(v_POLY_globals1_position, v_POLY_param3_val);\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/smoothstep1\n\tfloat v_POLY_smoothstep1_val = smoothstep(v_POLY_param4_val, v_POLY_param5_val, v_POLY_distance1_val);\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/mix1\n\tvec3 v_POLY_mix1_mix = mix(v_POLY_param1_val, v_POLY_param2_val, v_POLY_smoothstep1_val);\n\t\n\t// /metaballs/MAT/meshPhysicalBuilder1/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","timeDependent":false,"resolutionDependent":false,"paramConfigs":[{"type":"color","name":"color1","defaultValue":[0,0,0],"uniformName":"v_POLY_param_color1"},{"type":"color","name":"color2","defaultValue":[0,0,0],"uniformName":"v_POLY_param_color2"},{"type":"vector3","name":"center","defaultValue":[0,0,0],"uniformName":"v_POLY_param_center"},{"type":"float","name":"dist1","defaultValue":0,"uniformName":"v_POLY_param_dist1"},{"type":"float","name":"dist2","defaultValue":0,"uniformName":"v_POLY_param_dist2"}]}}}}}}},"eventsNetwork1":{"type":"eventsNetwork","nodes":{"scene1":{"type":"scene"},"scrollTrigger1":{"type":"scrollTrigger","params":{"element":".scene-player-container","tprogress":true,"progress":0.5},"inputs":[{"index":0,"node":"scene1","output":"sceneLoaded"}]}}},"noise1":{"type":"noise","params":{"amplitude":0.17,"offset":[0,"$T*0.1",0],"useNormals":1},"inputs":["attribCreate1"]}},"flags":{"display":true}},"perspectiveCamera_MAIN":{"type":"perspectiveCamera","nodes":{"events1":{"type":"eventsNetwork","nodes":{"cameraOrbitControls1":{"type":"cameraOrbitControls","params":{"target":[-0.010163239137097537,0.18525291669906754,-0.17316874704305452]}}},"selection":["cameraOrbitControls1"]}},"params":{"t":[0,0,2.814738208647524],"controls":"./events1/cameraOrbitControls1"},"flags":{"display":true}},"perspectiveCamera_DEBUG":{"type":"perspectiveCamera","nodes":{"events1":{"type":"eventsNetwork","nodes":{"cameraOrbitControls1":{"type":"cameraOrbitControls"}},"selection":["cameraOrbitControls1"]}},"params":{"t":[3.0161526633531355,1.1787657307191874,2.814738208647524],"r":[-22.723127930556515,44.66532130223666,16.403892417511617],"controls":"./events1/cameraOrbitControls1"},"flags":{"display":true}},"lights":{"type":"geo","nodes":{"hemisphereLight1":{"type":"hemisphereLight"},"spotLight1":{"type":"spotLight","params":{"penumbra":0.76}},"areaLight1":{"type":"areaLight","params":{"width":1.6,"showHelper":true}},"polarTransform1":{"type":"polarTransform","params":{"longitude":64.8,"latitude":36,"depth":2.8},"inputs":["spotLight1"]},"polarTransform2":{"type":"polarTransform","params":{"longitude":295.2,"latitude":-72,"depth":2.5},"inputs":["areaLight1"]},"merge1":{"type":"merge","inputs":["polarTransform1","polarTransform2","hemisphereLight1"],"flags":{"display":true}}},"flags":{"display":true}}},"params":{"bgColor":[0.8509803921568627,0.8509803921568627,0.8509803921568627],"mainCameraPath":"/perspectiveCamera_MAIN"}},"ui":{"nodes":{"COP":{"pos":[-400,200],"nodes":{"imageEnv":{"pos":[50,100]},"imageUv":{"pos":[-100,100]},"envMap":{"pos":[50,200]}}},"background_wall":{"pos":[-50,-300],"nodes":{"plane1":{"pos":[0,-150]},"material1":{"pos":[0,-50]},"MAT":{"pos":[-200,-50],"nodes":{"meshStandard1":{"pos":[0,0]}}}}},"metaballs":{"pos":[-50,-200],"nodes":{"sphere1":{"pos":[0,-100]},"scatter1":{"pos":[0,0],"comment":"here we scatter some points on the sphere\\n"},"attribCreate1":{"pos":[0,200],"comment":"We add a pscale attribute on the points, which is set to vary between 0.1 and 0.9. This will define the size of the metaballs."},"metaball1":{"pos":[0,800],"comment":"This creates the metaballs using the input points\\n"},"transform1":{"pos":[0,650],"comment":"The transform scale parameter is driven by the scroll event node (inside the eventsNetwork1 node)\\n"},"material1":{"pos":[0,950]},"MAT":{"pos":[-250,450],"nodes":{"meshStandard1":{"pos":[0,0]},"meshPhysicalBuilder1":{"pos":[0,100],"nodes":{"globals1":{"pos":[-650,0]},"output1":{"pos":[200,0]},"param1":{"pos":[-250,-500]},"param2":{"pos":[-250,-350]},"mix1":{"pos":[-50,-300]},"param3":{"pos":[-500,200]},"distance1":{"pos":[-450,0]},"smoothstep1":{"pos":[-150,-50]},"param4":{"pos":[-350,-250]},"param5":{"pos":[-350,-100]}}}}},"eventsNetwork1":{"pos":[-250,600],"nodes":{"scene1":{"pos":[-100,0]},"scrollTrigger1":{"pos":[150,0]}}},"noise1":{"pos":[0,450],"comment":"The noise animated the metaballs when we are not scrolling\\n"}}},"perspectiveCamera_MAIN":{"pos":[-400,100],"nodes":{"events1":{"pos":[-200,50],"nodes":{"cameraOrbitControls1":{"pos":[150,50]}}}}},"perspectiveCamera_DEBUG":{"pos":[-400,0],"nodes":{"events1":{"pos":[-200,50],"nodes":{"cameraOrbitControls1":{"pos":[150,50]}}}}},"lights":{"pos":[-50,-100],"nodes":{"hemisphereLight1":{"pos":[100,-100]},"spotLight1":{"pos":[-300,-100]},"areaLight1":{"pos":[-100,-100]},"polarTransform1":{"pos":[-300,50]},"polarTransform2":{"pos":[-100,50]},"merge1":{"pos":[-100,250]}}}}}}
Code editor
{"multiple_panel":{"split_ratio":0.5,"split_panel0":{"split_ratio":0.5,"split_panel0":{"panelTypes":["viewer"],"currentPanelIndex":0,"panel_data":{"camera":"/perspectiveCamera_MAIN","linkIndex":1}},"split_panel1":{"panelTypes":["params","spreadsheet"],"currentPanelIndex":0,"panel_data":{"active_folder":128,"linkIndex":1}},"split_mode":"vertical"},"split_panel1":{"panelTypes":["network","params","viewer"],"currentPanelIndex":0,"panel_data":{"camera":{"position":{"x":-176.91375566051653,"y":-425.54274832877945},"zoom":0.6498710562414267},"history":{"2":{"position":{"x":-99.63723271293463,"y":13.73540316604992},"zoom":0.6510000000000001},"3":{"position":{"x":-48,"y":-22},"zoom":0.5},"6":{"position":{"x":11.339999999999996,"y":-96.49999999999999},"zoom":0.6172839506172841},"9":{"position":{"x":-32,"y":-88},"zoom":0.5},"33":{"position":{"x":-319.66200000000003,"y":-614.5219999999999},"zoom":0.6868710562414267},"79":{"position":{"x":-176.91375566051653,"y":-425.54274832877945},"zoom":0.6498710562414267},"131":{"position":{"x":-59.04899999999998,"y":-65.1854},"zoom":0.8467543904215146},"475":{"position":{"x":-403.86599999999993,"y":52.487999999999985},"zoom":0.6858710562414267},"578":{"position":{"x":39.95509273174094,"y":3.8666218772652527},"zoom":0.7758710562414268},"742":{"position":{"x":0,"y":0},"zoom":0.5},"821":{"position":{"x":0,"y":0},"zoom":0.5},"1059":{"position":{"x":-76.80491551459292,"y":3.0721966205837177},"zoom":0.6510000000000001},"1279":{"position":{"x":-427.07429265752455,"y":58.40332207282387},"zoom":0.8218710562414269}},"linkIndex":1}},"split_mode":"horizontal"},"currentNodes":["/metaballs","/","/","/","/","/","/","/"],"navigationHistory":{"nodePaths":{"1":["/","/metaballs","/","/metaballs","/metaballs/MAT","/metaballs","/","/background_wall","/background_wall/MAT","/background_wall","/","/metaballs","/metaballs/MAT","/metaballs","/metaballs/MAT","/metaballs/MAT/meshPhysicalBuilder1","/metaballs/MAT","/metaballs","/metaballs/MAT","/metaballs/MAT/meshPhysicalBuilder1","/metaballs/MAT","/metaballs","/metaballs/MAT","/metaballs/MAT/meshPhysicalBuilder1","/metaballs/MAT","/metaballs","/metaballs/MAT","/metaballs","/metaballs/MAT","/metaballs","/","/metaballs","/metaballs/eventsNetwork1","/metaballs","/","/lights","/","/lights","/","/lights","/","/lights","/","/lights","/","/lights","/","/lights","/","/lights","/","/metaballs"],"2":["/"],"3":["/"],"4":["/"],"5":["/"],"6":["/"],"7":["/"],"8":["/"]},"index":{"1":51,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0}},"fullscreenPanelId":null,"saveOptions":{"createExport":true,"compressJs":true,"publishToIntegrations":false},"paramsModal":[]}
Used nodes
cop/envMap;cop/image;cop/imageEXR;event/cameraOrbitControls;event/scene;event/scrollTrigger;mat/meshPhysicalBuilder;mat/meshStandard;obj/copNetwork;obj/geo;obj/perspectiveCamera;sop/areaLight;sop/attribCreate;sop/eventsNetwork;sop/hemisphereLight;sop/material;sop/materialsNetwork;sop/merge;sop/metaball;sop/noise;sop/plane;sop/polarTransform;sop/scatter;sop/sphere;sop/spotLight;sop/transform
Used operations
Used modules
Used assemblers
GL_MESH_PHYSICAL
Used integrations
[]
Used assets
Nodes map
{"/COP":"obj/copNetwork","/COP/imageEnv":"cop/imageEXR","/COP/imageUv":"cop/image","/COP/envMap":"cop/envMap","/background_wall":"obj/geo","/background_wall/plane1":"sop/plane","/background_wall/material1":"sop/material","/background_wall/MAT":"sop/materialsNetwork","/background_wall/MAT/meshStandard1":"mat/meshStandard","/metaballs":"obj/geo","/metaballs/sphere1":"sop/sphere","/metaballs/scatter1":"sop/scatter","/metaballs/attribCreate1":"sop/attribCreate","/metaballs/metaball1":"sop/metaball","/metaballs/transform1":"sop/transform","/metaballs/material1":"sop/material","/metaballs/MAT":"sop/materialsNetwork","/metaballs/MAT/meshStandard1":"mat/meshStandard","/metaballs/MAT/meshPhysicalBuilder1":"mat/meshPhysicalBuilder","/metaballs/eventsNetwork1":"sop/eventsNetwork","/metaballs/eventsNetwork1/scene1":"event/scene","/metaballs/eventsNetwork1/scrollTrigger1":"event/scrollTrigger","/metaballs/noise1":"sop/noise","/perspectiveCamera_MAIN":"obj/perspectiveCamera","/perspectiveCamera_MAIN/events1":"sop/eventsNetwork","/perspectiveCamera_MAIN/events1/cameraOrbitControls1":"event/cameraOrbitControls","/perspectiveCamera_DEBUG":"obj/perspectiveCamera","/perspectiveCamera_DEBUG/events1":"sop/eventsNetwork","/perspectiveCamera_DEBUG/events1/cameraOrbitControls1":"event/cameraOrbitControls","/lights":"obj/geo","/lights/hemisphereLight1":"sop/hemisphereLight","/lights/spotLight1":"sop/spotLight","/lights/areaLight1":"sop/areaLight","/lights/polarTransform1":"sop/polarTransform","/lights/polarTransform2":"sop/polarTransform","/lights/merge1":"sop/merge"}
Js version
Editor version
Engine version
Logout
0%
There was a problem displaying your scene:
view scene source