Name
*
Code
{"properties":{"frame":0,"maxFrame":600,"maxFrameLocked":false,"realtimeState":true,"mainCameraPath":"/perspectiveCamera1","versions":{"polygonjs":"1.1.261"}},"root":{"type":"root","nodes":{"hemisphereLight1":{"type":"hemisphereLight","flags":{"display":true}},"perspectiveCamera1":{"type":"perspectiveCamera","nodes":{"events1":{"type":"eventsNetwork","nodes":{"cameraOrbitControls1":{"type":"cameraOrbitControls"}},"selection":["cameraOrbitControls1"]}},"params":{"t":[0,0,5.314738208647524],"r":[-22.723127930556515,44.66532130223666,16.403892417511617],"controls":"./events1/cameraOrbitControls1"},"flags":{"display":true}},"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"]}}},"particles":{"type":"geo","nodes":{"text1":{"type":"text","params":{"font":"https://raw.githubusercontent.com/polygonjs/polygonjs-assets/master/fonts/SourceCodePro-Black.ttf","type":1,"justifyMode":2}},"scatter1":{"type":"scatter","params":{"pointsCount":1024},"inputs":["text1"]},"restAttributes1":{"type":"restAttributes","params":{"tnormal":0},"inputs":["scatter1"]},"attribCreate1":{"type":"attribCreate","params":{"name":"mass","value1":10},"inputs":["restAttributes1"]},"noise1":{"type":"noise","params":{"amplitude":9,"attribName":"mass"},"inputs":["attribCreate1"]},"particlesSystemGpu1":{"type":"particlesSystemGpu","nodes":{"globals1":{"type":"globals"},"output1":{"type":"output","inputs":[{"index":0,"node":"acceleration1","output":"position"},{"index":1,"node":"acceleration1","output":"velocity"}]},"acceleration1":{"type":"acceleration","params":{"position":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false},"overriden_options":{}},"velocity":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false},"overriden_options":{}},"mass":{"type":"float","default_value":1,"options":{"spare":true,"editable":false},"raw_input":20,"overriden_options":{}},"force":{"type":"vector3","default_value":[0,-9.8,0],"options":{"spare":true,"editable":false},"raw_input":[0,0,0],"overriden_options":{}}},"inputs":[{"index":0,"node":"globals1","output":"position"},{"index":1,"node":"multScalar3","output":"val"},{"index":2,"node":"max1","output":"val"},{"index":3,"node":"add2","output":"sum"}],"connection_points":{"in":[{"name":"position","type":"vec3"},{"name":"velocity","type":"vec3"},{"name":"mass","type":"float"},{"name":"force","type":"vec3"}],"out":[{"name":"position","type":"vec3"},{"name":"velocity","type":"vec3"}]}},"param1":{"type":"param","params":{"name":"cursor","type":4},"connection_points":{"in":[],"out":[{"name":"val","type":"vec3"}]}},"subtract1":{"type":"subtract","params":{"sub0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"sub1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"sub2":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":true}}},"maxInputsCount":3,"inputs":[{"index":0,"node":"globals1","output":"position"},{"index":1,"node":"param1","output":"val"}],"connection_points":{"in":[{"name":"sub0","type":"vec3"},{"name":"sub1","type":"vec3"},{"name":"sub2","type":"vec3"}],"out":[{"name":"subtract","type":"vec3"}]}},"length1":{"type":"length","params":{"x":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}}},"inputs":[{"index":0,"node":"subtract1","output":"subtract"}],"connection_points":{"in":[{"name":"x","type":"vec3"}],"out":[{"name":"val","type":"float"}]}},"complement1":{"type":"complement","params":{"in":{"type":"float","default_value":0,"options":{"spare":true,"editable":false},"overriden_options":{}}},"inputs":[{"index":0,"node":"length1","output":"val"}],"connection_points":{"in":[{"name":"in","type":"float"}],"out":[{"name":"val","type":"float"}]}},"multScalar1":{"type":"multScalar","params":{"value":{"type":"vector3","default_value":[1,1,1],"options":{"spare":true,"editable":false},"overriden_options":{}},"mult":{"type":"float","default_value":1,"options":{"spare":true,"editable":false},"overriden_options":{}}},"inputs":[{"index":0,"node":"subtract1","output":"subtract"},{"index":1,"node":"clamp1","output":"val"}],"connection_points":{"in":[{"name":"value","type":"vec3"},{"name":"mult","type":"float"}],"out":[{"name":"val","type":"vec3"}]}},"clamp1":{"type":"clamp","params":{"value":{"type":"float","default_value":0,"options":{"spare":true,"editable":false},"overriden_options":{}},"min":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}},"max":{"type":"float","default_value":1,"options":{"spare":true,"editable":true}}},"inputs":[{"index":0,"node":"complement1","output":"val"}],"connection_points":{"in":[{"name":"value","type":"float"},{"name":"min","type":"float"},{"name":"max","type":"float"}],"out":[{"name":"val","type":"float"}]}},"attribute1":{"type":"attribute","params":{"name":"restP","type":2,"texportWhenConnected":1,"in":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":true}}},"maxInputsCount":1,"connection_points":{"in":[{"name":"in","type":"vec3"}],"out":[{"name":"val","type":"vec3"}]}},"subtract2":{"type":"subtract","params":{"sub0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"sub1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"sub2":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":true}}},"maxInputsCount":3,"inputs":[{"index":0,"node":"attribute1","output":"val"},{"index":1,"node":"globals1","output":"position"}],"connection_points":{"in":[{"name":"sub0","type":"vec3"},{"name":"sub1","type":"vec3"},{"name":"sub2","type":"vec3"}],"out":[{"name":"subtract","type":"vec3"}]}},"add2":{"type":"add","params":{"add0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"add1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"add2":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":true}}},"maxInputsCount":3,"inputs":[{"index":0,"node":"multScalar5","output":"val"},{"index":1,"node":"multScalar4","output":"val"}],"connection_points":{"in":[{"name":"add0","type":"vec3"},{"name":"add1","type":"vec3"},{"name":"add2","type":"vec3"}],"out":[{"name":"sum","type":"vec3"}]}},"multScalar3":{"type":"multScalar","params":{"value":{"type":"vector3","default_value":[1,1,1],"options":{"spare":true,"editable":false},"overriden_options":{}},"mult":{"type":"float","default_value":1,"options":{"spare":true,"editable":true},"raw_input":0.98}},"inputs":[{"index":0,"node":"globals1","output":"velocity"}],"connection_points":{"in":[{"name":"value","type":"vec3"},{"name":"mult","type":"float"}],"out":[{"name":"val","type":"vec3"}]}},"multScalar4":{"type":"multScalar","params":{"value":{"type":"vector3","default_value":[1,1,1],"options":{"spare":true,"editable":false},"overriden_options":{}},"mult":{"type":"float","default_value":1,"options":{"spare":true,"editable":true},"raw_input":2}},"inputs":[{"index":0,"node":"maxLength1","output":"val"}],"connection_points":{"in":[{"name":"value","type":"vec3"},{"name":"mult","type":"float"}],"out":[{"name":"val","type":"vec3"}]}},"maxLength1":{"type":"maxLength","params":{"val":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false},"overriden_options":{}},"max":{"type":"float","default_value":1,"options":{"spare":true,"editable":true}}},"inputs":[{"index":0,"node":"subtract2","output":"subtract"}],"connection_points":{"in":[{"name":"val","type":"vec3"},{"name":"max","type":"float"}],"out":[{"name":"val","type":"vec3"}]}},"attribute2":{"type":"attribute","params":{"name":"mass","texportWhenConnected":1,"in":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}}},"maxInputsCount":1,"connection_points":{"in":[{"name":"in","type":"float"}],"out":[{"name":"val","type":"float"}]}},"multScalar5":{"type":"multScalar","params":{"value":{"type":"vector3","default_value":[1,1,1],"options":{"spare":true,"editable":false},"overriden_options":{}},"mult":{"type":"float","default_value":1,"options":{"spare":true,"editable":true},"raw_input":10}},"inputs":[{"index":0,"node":"multScalar1","output":"val"}],"connection_points":{"in":[{"name":"value","type":"vec3"},{"name":"mult","type":"float"}],"out":[{"name":"val","type":"vec3"}]}},"max1":{"type":"max","params":{"in0":{"type":"float","default_value":0,"options":{"spare":true,"editable":false},"overriden_options":{}},"in1":{"type":"float","default_value":0,"options":{"spare":true,"editable":true},"raw_input":0.001}},"inputs":[{"index":0,"node":"attribute2","output":"val"}],"connection_points":{"in":[{"name":"in0","type":"float"},{"name":"in1","type":"float"}],"out":[{"name":"val","type":"float"}]}}},"params":{"material":"../MAT/pointsParticles","cursor":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"computeOnDirty":true,"cook":false,"dependentOnFoundNode":true},"raw_input":[10.133424310329652,0.5838678453900471,0],"overriden_options":{"callback":"{}"}}},"inputs":["noise1"],"flags":{"display":true},"persisted_config":{"shaders_by_name":{"velocity":"#include <common>\n\n// removed:\n//// INSERT DEFINE\n\n\n\n// /geo1/particlesSystemGpu1/maxLength1\n//\n//\n// CLAMP_LENGTH\n//\n//\nfloat maxLength(float val, float max_l){\n\treturn min(val, max_l);\n}\nvec2 maxLength(vec2 val, float max_l){\n\tfloat vec_length = length(val);\n\tif(vec_length == 0.0){\n\t\treturn val;\n\t} else {\n\t\tfloat new_length = min(vec_length, max_l);\n\t\treturn new_length * normalize(val);\n\t}\n}\nvec3 maxLength(vec3 val, float max_l){\n\tfloat vec_length = length(val);\n\tif(vec_length == 0.0){\n\t\treturn val;\n\t} else {\n\t\tfloat new_length = min(vec_length, max_l);\n\t\treturn new_length * normalize(val);\n\t}\n}\nvec4 maxLength(vec4 val, float max_l){\n\tfloat vec_length = length(val);\n\tif(vec_length == 0.0){\n\t\treturn val;\n\t} else {\n\t\tfloat new_length = min(vec_length, max_l);\n\t\treturn new_length * normalize(val);\n\t}\n}\n\n\n// /geo1/particlesSystemGpu1/complement1\nfloat complement(float x){return 1.0-x;}\nvec2 complement(vec2 x){return vec2(1.0-x.x, 1.0-x.y);}\nvec3 complement(vec3 x){return vec3(1.0-x.x, 1.0-x.y, 1.0-x.z);}\nvec4 complement(vec4 x){return vec4(1.0-x.x, 1.0-x.y, 1.0-x.z, 1.0-x.w);}\n\n\n// /geo1/particlesSystemGpu1/acceleration1\nfloat velFromAccel(float vel, float force, float mass, float time_delta){\n\tfloat impulse = (time_delta * mass) * force;\n\treturn vel + impulse;\n}\nvec2 velFromAccel(vec2 vel, vec2 force, float mass, float time_delta){\n\tvec2 impulse = (time_delta * mass) * force;\n\treturn vel + impulse;\n}\nvec3 velFromAccel(vec3 vel, vec3 force, float mass, float time_delta){\n\tvec3 impulse = (time_delta * mass) * force;\n\treturn vel + impulse;\n}\nvec4 velFromAccel(vec4 vel, vec4 force, float mass, float time_delta){\n\tvec4 impulse = (time_delta * mass) * force;\n\treturn vel + impulse;\n}\nfloat posFromVel(float position, float velocity, float time_delta){\n\treturn position + (time_delta * velocity);\n}\nvec2 posFromVel(vec2 position, vec2 velocity, float time_delta){\n\treturn position + (time_delta * velocity);\n}\nvec3 posFromVel(vec3 position, vec3 velocity, float time_delta){\n\treturn position + (time_delta * velocity);\n}\nvec4 posFromVel(vec4 position, vec4 velocity, float time_delta){\n\treturn position + (time_delta * velocity);\n}\n\n\n\n\n\n\n\n// /geo1/particlesSystemGpu1/globals1\nuniform sampler2D texture_position;\nuniform sampler2D texture_velocity;\n\n// /geo1/particlesSystemGpu1/attribute2\nuniform sampler2D texture_restP_SEPARATOR_mass;\n\n// /geo1/particlesSystemGpu1/param1\nuniform vec3 v_POLY_param_cursor;\n\n// /geo1/particlesSystemGpu1/acceleration1\nuniform float delta_time;\n\n\n\n\n\nvoid main() {\n\n\tvec2 particleUV = (gl_FragCoord.xy / resolution.xy);\n\n// removed:\n//\t// INSERT BODY\n\n\n\n\t// /geo1/particlesSystemGpu1/globals1\n\tvec3 v_POLY_globals1_position = texture2D( texture_position, particleUV ).xyz;\n\tvec3 v_POLY_globals1_velocity = texture2D( texture_velocity, particleUV ).xyz;\n\t\n\t// /geo1/particlesSystemGpu1/attribute2\n\tfloat v_POLY_attribute2_val = texture2D( texture_restP_SEPARATOR_mass, particleUV ).w;\n\t\n\t// /geo1/particlesSystemGpu1/param1\n\tvec3 v_POLY_param1_val = v_POLY_param_cursor;\n\t\n\t// /geo1/particlesSystemGpu1/attribute1\n\tvec3 v_POLY_attribute1_val = texture2D( texture_restP_SEPARATOR_mass, particleUV ).xyz;\n\t\n\t// /geo1/particlesSystemGpu1/multScalar3\n\tvec3 v_POLY_multScalar3_val = (0.98*v_POLY_globals1_velocity);\n\t\n\t// /geo1/particlesSystemGpu1/subtract1\n\tvec3 v_POLY_subtract1_subtract = (v_POLY_globals1_position - v_POLY_param1_val - vec3(0.0, 0.0, 0.0));\n\t\n\t// /geo1/particlesSystemGpu1/subtract2\n\tvec3 v_POLY_subtract2_subtract = (v_POLY_attribute1_val - v_POLY_globals1_position - vec3(0.0, 0.0, 0.0));\n\t\n\t// /geo1/particlesSystemGpu1/max1\n\tfloat v_POLY_max1_val = max(v_POLY_attribute2_val, 0.001);\n\t\n\t// /geo1/particlesSystemGpu1/length1\n\tfloat v_POLY_length1_val = length(v_POLY_subtract1_subtract);\n\t\n\t// /geo1/particlesSystemGpu1/maxLength1\n\tvec3 v_POLY_maxLength1_val = maxLength(v_POLY_subtract2_subtract, 1.0);\n\t\n\t// /geo1/particlesSystemGpu1/complement1\n\tfloat v_POLY_complement1_val = complement(v_POLY_length1_val);\n\t\n\t// /geo1/particlesSystemGpu1/multScalar4\n\tvec3 v_POLY_multScalar4_val = (2.0*v_POLY_maxLength1_val);\n\t\n\t// /geo1/particlesSystemGpu1/clamp1\n\tfloat v_POLY_clamp1_val = clamp(v_POLY_complement1_val, 0.0, 1.0);\n\t\n\t// /geo1/particlesSystemGpu1/multScalar1\n\tvec3 v_POLY_multScalar1_val = (v_POLY_clamp1_val*v_POLY_subtract1_subtract);\n\t\n\t// /geo1/particlesSystemGpu1/multScalar5\n\tvec3 v_POLY_multScalar5_val = (10.0*v_POLY_multScalar1_val);\n\t\n\t// /geo1/particlesSystemGpu1/add2\n\tvec3 v_POLY_add2_sum = (v_POLY_multScalar5_val + v_POLY_multScalar4_val + vec3(0.0, 0.0, 0.0));\n\t\n\t// /geo1/particlesSystemGpu1/acceleration1\n\tvec3 v_POLY_acceleration1_velocity = velFromAccel(v_POLY_multScalar3_val, v_POLY_add2_sum, v_POLY_max1_val, delta_time);\n\tvec3 v_POLY_acceleration1_position = posFromVel(v_POLY_globals1_position, v_POLY_acceleration1_velocity, delta_time);\n\t\n\t// /geo1/particlesSystemGpu1/output1\n\tgl_FragColor.xyz = v_POLY_acceleration1_velocity;\n\n\n\n\n}","position":"#include <common>\n\n// removed:\n//// INSERT DEFINE\n\n\n\n// /geo1/particlesSystemGpu1/maxLength1\n//\n//\n// CLAMP_LENGTH\n//\n//\nfloat maxLength(float val, float max_l){\n\treturn min(val, max_l);\n}\nvec2 maxLength(vec2 val, float max_l){\n\tfloat vec_length = length(val);\n\tif(vec_length == 0.0){\n\t\treturn val;\n\t} else {\n\t\tfloat new_length = min(vec_length, max_l);\n\t\treturn new_length * normalize(val);\n\t}\n}\nvec3 maxLength(vec3 val, float max_l){\n\tfloat vec_length = length(val);\n\tif(vec_length == 0.0){\n\t\treturn val;\n\t} else {\n\t\tfloat new_length = min(vec_length, max_l);\n\t\treturn new_length * normalize(val);\n\t}\n}\nvec4 maxLength(vec4 val, float max_l){\n\tfloat vec_length = length(val);\n\tif(vec_length == 0.0){\n\t\treturn val;\n\t} else {\n\t\tfloat new_length = min(vec_length, max_l);\n\t\treturn new_length * normalize(val);\n\t}\n}\n\n\n// /geo1/particlesSystemGpu1/complement1\nfloat complement(float x){return 1.0-x;}\nvec2 complement(vec2 x){return vec2(1.0-x.x, 1.0-x.y);}\nvec3 complement(vec3 x){return vec3(1.0-x.x, 1.0-x.y, 1.0-x.z);}\nvec4 complement(vec4 x){return vec4(1.0-x.x, 1.0-x.y, 1.0-x.z, 1.0-x.w);}\n\n\n// /geo1/particlesSystemGpu1/acceleration1\nfloat velFromAccel(float vel, float force, float mass, float time_delta){\n\tfloat impulse = (time_delta * mass) * force;\n\treturn vel + impulse;\n}\nvec2 velFromAccel(vec2 vel, vec2 force, float mass, float time_delta){\n\tvec2 impulse = (time_delta * mass) * force;\n\treturn vel + impulse;\n}\nvec3 velFromAccel(vec3 vel, vec3 force, float mass, float time_delta){\n\tvec3 impulse = (time_delta * mass) * force;\n\treturn vel + impulse;\n}\nvec4 velFromAccel(vec4 vel, vec4 force, float mass, float time_delta){\n\tvec4 impulse = (time_delta * mass) * force;\n\treturn vel + impulse;\n}\nfloat posFromVel(float position, float velocity, float time_delta){\n\treturn position + (time_delta * velocity);\n}\nvec2 posFromVel(vec2 position, vec2 velocity, float time_delta){\n\treturn position + (time_delta * velocity);\n}\nvec3 posFromVel(vec3 position, vec3 velocity, float time_delta){\n\treturn position + (time_delta * velocity);\n}\nvec4 posFromVel(vec4 position, vec4 velocity, float time_delta){\n\treturn position + (time_delta * velocity);\n}\n\n\n\n\n\n\n\n// /geo1/particlesSystemGpu1/globals1\nuniform sampler2D texture_position;\nuniform sampler2D texture_velocity;\n\n// /geo1/particlesSystemGpu1/attribute2\nuniform sampler2D texture_restP_SEPARATOR_mass;\n\n// /geo1/particlesSystemGpu1/param1\nuniform vec3 v_POLY_param_cursor;\n\n// /geo1/particlesSystemGpu1/acceleration1\nuniform float delta_time;\n\n\n\n\n\nvoid main() {\n\n\tvec2 particleUV = (gl_FragCoord.xy / resolution.xy);\n\n// removed:\n//\t// INSERT BODY\n\n\n\n\t// /geo1/particlesSystemGpu1/globals1\n\tvec3 v_POLY_globals1_position = texture2D( texture_position, particleUV ).xyz;\n\tvec3 v_POLY_globals1_velocity = texture2D( texture_velocity, particleUV ).xyz;\n\t\n\t// /geo1/particlesSystemGpu1/attribute2\n\tfloat v_POLY_attribute2_val = texture2D( texture_restP_SEPARATOR_mass, particleUV ).w;\n\t\n\t// /geo1/particlesSystemGpu1/param1\n\tvec3 v_POLY_param1_val = v_POLY_param_cursor;\n\t\n\t// /geo1/particlesSystemGpu1/attribute1\n\tvec3 v_POLY_attribute1_val = texture2D( texture_restP_SEPARATOR_mass, particleUV ).xyz;\n\t\n\t// /geo1/particlesSystemGpu1/multScalar3\n\tvec3 v_POLY_multScalar3_val = (0.98*v_POLY_globals1_velocity);\n\t\n\t// /geo1/particlesSystemGpu1/subtract1\n\tvec3 v_POLY_subtract1_subtract = (v_POLY_globals1_position - v_POLY_param1_val - vec3(0.0, 0.0, 0.0));\n\t\n\t// /geo1/particlesSystemGpu1/subtract2\n\tvec3 v_POLY_subtract2_subtract = (v_POLY_attribute1_val - v_POLY_globals1_position - vec3(0.0, 0.0, 0.0));\n\t\n\t// /geo1/particlesSystemGpu1/max1\n\tfloat v_POLY_max1_val = max(v_POLY_attribute2_val, 0.001);\n\t\n\t// /geo1/particlesSystemGpu1/length1\n\tfloat v_POLY_length1_val = length(v_POLY_subtract1_subtract);\n\t\n\t// /geo1/particlesSystemGpu1/maxLength1\n\tvec3 v_POLY_maxLength1_val = maxLength(v_POLY_subtract2_subtract, 1.0);\n\t\n\t// /geo1/particlesSystemGpu1/complement1\n\tfloat v_POLY_complement1_val = complement(v_POLY_length1_val);\n\t\n\t// /geo1/particlesSystemGpu1/multScalar4\n\tvec3 v_POLY_multScalar4_val = (2.0*v_POLY_maxLength1_val);\n\t\n\t// /geo1/particlesSystemGpu1/clamp1\n\tfloat v_POLY_clamp1_val = clamp(v_POLY_complement1_val, 0.0, 1.0);\n\t\n\t// /geo1/particlesSystemGpu1/multScalar1\n\tvec3 v_POLY_multScalar1_val = (v_POLY_clamp1_val*v_POLY_subtract1_subtract);\n\t\n\t// /geo1/particlesSystemGpu1/multScalar5\n\tvec3 v_POLY_multScalar5_val = (10.0*v_POLY_multScalar1_val);\n\t\n\t// /geo1/particlesSystemGpu1/add2\n\tvec3 v_POLY_add2_sum = (v_POLY_multScalar5_val + v_POLY_multScalar4_val + vec3(0.0, 0.0, 0.0));\n\t\n\t// /geo1/particlesSystemGpu1/acceleration1\n\tvec3 v_POLY_acceleration1_velocity = velFromAccel(v_POLY_multScalar3_val, v_POLY_add2_sum, v_POLY_max1_val, delta_time);\n\tvec3 v_POLY_acceleration1_position = posFromVel(v_POLY_globals1_position, v_POLY_acceleration1_velocity, delta_time);\n\t\n\t// /geo1/particlesSystemGpu1/output1\n\tgl_FragColor.xyz = v_POLY_acceleration1_position;\n\n\n\n\n}"},"texture_allocations":{"writable":[{"velocity":[{"name":"velocity","size":3,"nodes":["/particles/particlesSystemGpu1/output1"]}]},{"position":[{"name":"position","size":3,"nodes":["/particles/particlesSystemGpu1/output1","/particles/particlesSystemGpu1/globals1"]}]}],"readonly":[{"restP_SEPARATOR_mass":[{"name":"restP","size":3,"nodes":["/particles/particlesSystemGpu1/attribute1"]},{"name":"mass","size":1,"nodes":["/particles/particlesSystemGpu1/attribute2"]}]}]},"param_uniform_pairs":[["cursor","v_POLY_param_cursor"]],"uniforms_owner":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/particles/particlesSystemGpu1-main","type":"ShaderMaterial","depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"glslVersion":null,"uniforms":{"v_POLY_param_cursor":{"type":"v3","value":[10.133424310329652,0.5838678453900471,0]}},"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}}},"MAT":{"type":"materialsNetwork","nodes":{"pointsParticles":{"type":"pointsBuilder","nodes":{"output1":{"type":"output","inputs":[null,null,null,null,null,{"index":5,"node":"constant_point_size","output":"val"}]},"globals1":{"type":"globals"},"constant_point_size":{"type":"constant","params":{"float":0.004},"maxInputsCount":0,"connection_points":{"in":[],"out":[{"name":"val","type":"float"}]}}},"selection":["constant_point_size"],"persisted_config":{"material":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/particles/MAT/pointsParticles-main","type":"PointsMaterial","name":"/geo1/MAT/pointsParticles","color":16777215,"size":1,"sizeAttenuation":true,"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":"uniform float size;\nuniform float scale;\n#include <common>\n\n\n\n// /particles/MAT/pointsParticles/output1\nuniform sampler2D texture_position;\n\n// /particles/MAT/pointsParticles/output1\nvarying vec2 particles_sim_uv_varying;\n\n// /particles/MAT/pointsParticles/output1\nattribute vec2 particles_sim_uv_attrib;\n\n\n\n\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\n\n\n\t// /particles/MAT/pointsParticles/constant_point_size\n\tfloat v_POLY_constant_point_size_val = 0.004;\n\t\n\t// /particles/MAT/pointsParticles/output1\n\tparticles_sim_uv_varying = particles_sim_uv_attrib;\n\tvec3 transformed = texture2D( texture_position, particles_sim_uv_varying ).xyz;\n\tvec3 objectNormal = normal;\n\t#ifdef USE_TANGENT\n\t\tvec3 objectTangent = vec3( tangent.xyz );\n\t#endif\n\tgl_PointSize = v_POLY_constant_point_size_val * size * 10.0;\n\n\n\n\t#include <morphcolor_vertex>\n// removed:\n//\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n// removed:\n//\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}","fragmentShader":"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n\n\n\n// /particles/MAT/pointsParticles/output1\nvarying vec2 particles_sim_uv_varying;\n\n\n\n\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}","timeDependent":false,"resolutionDependent":false,"paramConfigs":[]},"customMaterials":{"customDistanceMaterial":{"material":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/particles/MAT/pointsParticles-customDistanceMaterial","type":"ShaderMaterial","name":"customDistanceMaterial","depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"glslVersion":null,"uniforms":{"diffuse":{"type":"c","value":16777215},"opacity":{"value":1},"map":{"value":null},"uvTransform":{"type":"m3","value":[1,0,0,0,1,0,0,0,1]},"uv2Transform":{"type":"m3","value":[1,0,0,0,1,0,0,0,1]},"alphaMap":{"value":null},"alphaTest":{"value":0},"displacementMap":{"value":null},"displacementScale":{"value":1},"displacementBias":{"value":0},"size":{"value":1},"scale":{"value":1}},"defines":{"USE_SIZEATTENUATION":1,"DEPTH_PACKING":3200},"vertexShader":"\nuniform float size;\nuniform float scale;\n#include <common>\n#include <clipping_planes_pars_vertex>\nvarying float vViewZDepth;\n\n// INSERT DEFINES\n\n\n// vHighPrecisionZW is added to match CustomMeshDepth.frag\n// which is itself taken from threejs\nvarying vec2 vHighPrecisionZW;\n\nvoid main() {\n\n\t// INSERT BODY\n\n\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\n\tvViewZDepth = - mvPosition.z;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\n\tvHighPrecisionZW = gl_Position.zw;\n\n}\n","fragmentShader":"\n// INSERT DEFINES\n\n\n#if DEPTH_PACKING == 3200\n\n\tuniform float opacity;\n\n#endif\n\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvarying vec2 vHighPrecisionZW;\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( 1.0 );\n\n\t#if DEPTH_PACKING == 3200\n\n\t\tdiffuseColor.a = opacity;\n\n\t#endif\n\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\n\t// INSERT BODY\n\t// the new body lines should be added before the alphatest_fragment\n\t// so that alpha is set before (which is really how it would be set if the alphamap_fragment above was used by the material node parameters)\n\n\t#include <alphatest_fragment>\n\n\t#include <logdepthbuf_fragment>\n\n\n\t// Higher precision equivalent of gl_FragCoord.z. This assumes depthRange has been left to its default values.\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\n\t#if DEPTH_PACKING == 3200\n\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), diffuseColor.a );\n\n\t#elif DEPTH_PACKING == 3201\n\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\n\t#endif\n\n}\n","lights":false},"onBeforeCompileDataJSON":{"vertexShader":"\nuniform float size;\nuniform float scale;\n#include <common>\n#include <clipping_planes_pars_vertex>\nvarying float vViewZDepth;\n\n// INSERT DEFINES\n\n\n\n// /particles/MAT/pointsParticles/output1\nuniform sampler2D texture_position;\n\n// /particles/MAT/pointsParticles/output1\nvarying vec2 particles_sim_uv_varying;\n\n// /particles/MAT/pointsParticles/output1\nattribute vec2 particles_sim_uv_attrib;\n\n\n\n\n\n\n// vHighPrecisionZW is added to match CustomMeshDepth.frag\n// which is itself taken from threejs\nvarying vec2 vHighPrecisionZW;\n\nvoid main() {\n\n\t// INSERT BODY\n\n\n\n\t// /particles/MAT/pointsParticles/constant_point_size\n\tfloat v_POLY_constant_point_size_val = 0.004;\n\t\n\t// /particles/MAT/pointsParticles/output1\n\tparticles_sim_uv_varying = particles_sim_uv_attrib;\n\tvec3 transformed = texture2D( texture_position, particles_sim_uv_varying ).xyz;\n\tvec3 objectNormal = normal;\n\t#ifdef USE_TANGENT\n\t\tvec3 objectTangent = vec3( tangent.xyz );\n\t#endif\n\tgl_PointSize = v_POLY_constant_point_size_val * size * 10.0;\n\n\n\n\n\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\n\tvViewZDepth = - mvPosition.z;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\n\tvHighPrecisionZW = gl_Position.zw;\n\n}\n","fragmentShader":"\n// INSERT DEFINES\n\n\n\n// /particles/MAT/pointsParticles/output1\nvarying vec2 particles_sim_uv_varying;\n\n\n\n\n\n\n#if DEPTH_PACKING == 3200\n\n\tuniform float opacity;\n\n#endif\n\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvarying vec2 vHighPrecisionZW;\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( 1.0 );\n\n\t#if DEPTH_PACKING == 3200\n\n\t\tdiffuseColor.a = opacity;\n\n\t#endif\n\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\n\t// INSERT BODY\n\t// the new body lines should be added before the alphatest_fragment\n\t// so that alpha is set before (which is really how it would be set if the alphamap_fragment above was used by the material node parameters)\n\n\t#include <alphatest_fragment>\n\n\t#include <logdepthbuf_fragment>\n\n\n\t// Higher precision equivalent of gl_FragCoord.z. This assumes depthRange has been left to its default values.\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\n\t#if DEPTH_PACKING == 3200\n\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), diffuseColor.a );\n\n\t#elif DEPTH_PACKING == 3201\n\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\n\t#endif\n\n}\n","timeDependent":false,"resolutionDependent":false,"paramConfigs":[]}},"customDepthMaterial":{"material":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/particles/MAT/pointsParticles-customDepthMaterial","type":"ShaderMaterial","name":"customDepthMaterial","depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"glslVersion":null,"uniforms":{"diffuse":{"type":"c","value":16777215},"opacity":{"value":1},"map":{"value":null},"uvTransform":{"type":"m3","value":[1,0,0,0,1,0,0,0,1]},"uv2Transform":{"type":"m3","value":[1,0,0,0,1,0,0,0,1]},"alphaMap":{"value":null},"alphaTest":{"value":0},"displacementMap":{"value":null},"displacementScale":{"value":1},"displacementBias":{"value":0},"size":{"value":1},"scale":{"value":1}},"defines":{"USE_SIZEATTENUATION":1,"DEPTH_PACKING":3201},"vertexShader":"\nuniform float size;\nuniform float scale;\n#include <common>\n#include <clipping_planes_pars_vertex>\nvarying float vViewZDepth;\n\n// INSERT DEFINES\n\n\n// vHighPrecisionZW is added to match CustomMeshDepth.frag\n// which is itself taken from threejs\nvarying vec2 vHighPrecisionZW;\n\nvoid main() {\n\n\t// INSERT BODY\n\n\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\n\tvViewZDepth = - mvPosition.z;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\n\tvHighPrecisionZW = gl_Position.zw;\n\n}\n","fragmentShader":"\n// INSERT DEFINES\n\n\n#if DEPTH_PACKING == 3200\n\n\tuniform float opacity;\n\n#endif\n\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvarying vec2 vHighPrecisionZW;\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( 1.0 );\n\n\t#if DEPTH_PACKING == 3200\n\n\t\tdiffuseColor.a = opacity;\n\n\t#endif\n\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\n\t// INSERT BODY\n\t// the new body lines should be added before the alphatest_fragment\n\t// so that alpha is set before (which is really how it would be set if the alphamap_fragment above was used by the material node parameters)\n\n\t#include <alphatest_fragment>\n\n\t#include <logdepthbuf_fragment>\n\n\n\t// Higher precision equivalent of gl_FragCoord.z. This assumes depthRange has been left to its default values.\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\n\t#if DEPTH_PACKING == 3200\n\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), diffuseColor.a );\n\n\t#elif DEPTH_PACKING == 3201\n\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\n\t#endif\n\n}\n","lights":false},"onBeforeCompileDataJSON":{"vertexShader":"\nuniform float size;\nuniform float scale;\n#include <common>\n#include <clipping_planes_pars_vertex>\nvarying float vViewZDepth;\n\n// INSERT DEFINES\n\n\n\n// /particles/MAT/pointsParticles/output1\nuniform sampler2D texture_position;\n\n// /particles/MAT/pointsParticles/output1\nvarying vec2 particles_sim_uv_varying;\n\n// /particles/MAT/pointsParticles/output1\nattribute vec2 particles_sim_uv_attrib;\n\n\n\n\n\n\n// vHighPrecisionZW is added to match CustomMeshDepth.frag\n// which is itself taken from threejs\nvarying vec2 vHighPrecisionZW;\n\nvoid main() {\n\n\t// INSERT BODY\n\n\n\n\t// /particles/MAT/pointsParticles/constant_point_size\n\tfloat v_POLY_constant_point_size_val = 0.004;\n\t\n\t// /particles/MAT/pointsParticles/output1\n\tparticles_sim_uv_varying = particles_sim_uv_attrib;\n\tvec3 transformed = texture2D( texture_position, particles_sim_uv_varying ).xyz;\n\tvec3 objectNormal = normal;\n\t#ifdef USE_TANGENT\n\t\tvec3 objectTangent = vec3( tangent.xyz );\n\t#endif\n\tgl_PointSize = v_POLY_constant_point_size_val * size * 10.0;\n\n\n\n\n\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\n\tvViewZDepth = - mvPosition.z;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\n\tvHighPrecisionZW = gl_Position.zw;\n\n}\n","fragmentShader":"\n// INSERT DEFINES\n\n\n\n// /particles/MAT/pointsParticles/output1\nvarying vec2 particles_sim_uv_varying;\n\n\n\n\n\n\n#if DEPTH_PACKING == 3200\n\n\tuniform float opacity;\n\n#endif\n\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvarying vec2 vHighPrecisionZW;\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( 1.0 );\n\n\t#if DEPTH_PACKING == 3200\n\n\t\tdiffuseColor.a = opacity;\n\n\t#endif\n\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\n\t// INSERT BODY\n\t// the new body lines should be added before the alphatest_fragment\n\t// so that alpha is set before (which is really how it would be set if the alphamap_fragment above was used by the material node parameters)\n\n\t#include <alphatest_fragment>\n\n\t#include <logdepthbuf_fragment>\n\n\n\t// Higher precision equivalent of gl_FragCoord.z. This assumes depthRange has been left to its default values.\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\n\t#if DEPTH_PACKING == 3200\n\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), diffuseColor.a );\n\n\t#elif DEPTH_PACKING == 3201\n\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\n\t#endif\n\n}\n","timeDependent":false,"resolutionDependent":false,"paramConfigs":[]}},"customDepthDOFMaterial":{"material":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/particles/MAT/pointsParticles-customDepthDOFMaterial","type":"ShaderMaterial","name":"customDepthDOFMaterial","depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"glslVersion":null,"uniforms":{"size":{"value":1},"scale":{"value":1},"mNear":{"value":0},"mFar":{"value":10}},"defines":{"USE_SIZEATTENUATION":1},"vertexShader":"\nuniform float size;\nuniform float scale;\n#include <common>\n\nvarying float vViewZDepth;\n\n// INSERT DEFINES\n\n\n\nvoid main() {\n\n\t// INSERT BODY\n\n\n\t#include <project_vertex>\n\n\tvViewZDepth = - mvPosition.z;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\n}\n","fragmentShader":"\nuniform float mNear;\nuniform float mFar;\n\nvarying float vViewZDepth;\n\n// INSERT DEFINES\n\nvoid main() {\n\n\tfloat color = 1.0 - smoothstep( mNear, mFar, vViewZDepth );\n\tgl_FragColor = vec4( vec3( color ), 1.0 );\n\tvec4 diffuseColor = gl_FragColor;\n\n\t// INSERT BODY\n\n\tgl_FragColor.a = diffuseColor.a;\n}\n","lights":false},"onBeforeCompileDataJSON":{"vertexShader":"\nuniform float size;\nuniform float scale;\n#include <common>\n\nvarying float vViewZDepth;\n\n// INSERT DEFINES\n\n\n\n// /particles/MAT/pointsParticles/output1\nuniform sampler2D texture_position;\n\n// /particles/MAT/pointsParticles/output1\nvarying vec2 particles_sim_uv_varying;\n\n// /particles/MAT/pointsParticles/output1\nattribute vec2 particles_sim_uv_attrib;\n\n\n\n\n\n\n\nvoid main() {\n\n\t// INSERT BODY\n\n\n\n\t// /particles/MAT/pointsParticles/constant_point_size\n\tfloat v_POLY_constant_point_size_val = 0.004;\n\t\n\t// /particles/MAT/pointsParticles/output1\n\tparticles_sim_uv_varying = particles_sim_uv_attrib;\n\tvec3 transformed = texture2D( texture_position, particles_sim_uv_varying ).xyz;\n\tvec3 objectNormal = normal;\n\t#ifdef USE_TANGENT\n\t\tvec3 objectTangent = vec3( tangent.xyz );\n\t#endif\n\tgl_PointSize = v_POLY_constant_point_size_val * size * 10.0;\n\n\n\n\n\n\t#include <project_vertex>\n\n\tvViewZDepth = - mvPosition.z;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\n}\n","fragmentShader":"\nuniform float mNear;\nuniform float mFar;\n\nvarying float vViewZDepth;\n\n// INSERT DEFINES\n\nvoid main() {\n\n\tfloat color = 1.0 - smoothstep( mNear, mFar, vViewZDepth );\n\tgl_FragColor = vec4( vec3( color ), 1.0 );\n\tvec4 diffuseColor = gl_FragColor;\n\n\t// INSERT BODY\n\n\tgl_FragColor.a = diffuseColor.a;\n}\n","timeDependent":false,"resolutionDependent":false,"paramConfigs":[]}}}}}}},"eventsNetwork1":{"type":"eventsNetwork","nodes":{"raycast1":{"type":"raycast","params":{"mouse":[0.8958333333333333,0.09341032608695654],"intersectWith":1,"planeDirection":[0,0,1],"tpositionTarget":1,"position":[-0.13051180813728092,-1.5915603980079505,0],"positionTarget":"/particles/particlesSystemGpu1/cursor"},"inputs":[{"index":0,"node":"pointer1","output":"pointermove"}]},"pointer1":{"type":"pointer","params":{"pointerdown":0,"pointermove":1}}}}},"flags":{"display":true},"selection":["text1"]}},"params":{"mainCameraPath":"/perspectiveCamera1"}},"ui":{"nodes":{"hemisphereLight1":{"pos":[150,100]},"perspectiveCamera1":{"pos":[-200,100],"nodes":{"events1":{"pos":[-200,50],"nodes":{"cameraOrbitControls1":{"pos":[150,50]}}}}},"COP":{"pos":[-200,200],"nodes":{"imageEnv":{"pos":[50,100]},"imageUv":{"pos":[-100,100]},"envMap":{"pos":[50,200]}}},"particles":{"pos":[-50,-150],"nodes":{"text1":{"pos":[-200,-400]},"scatter1":{"pos":[-200,-250],"comment":"this sets the number of points. A number that is a power of 2 allow us to maximize the texture that is used internally to simulate.\\n\\nIn this case 1024 is a good start, even though you may want to increase that number. You can then go with 2048, 4096, 8192 and so on."},"restAttributes1":{"pos":[-200,50],"comment":"This creates the rest position, which is used by the particles to go back to their initial position."},"attribCreate1":{"pos":[-200,300],"comment":"This creates the mass for each particle. The mass defines how quickly or how slowly particles will react to forces applied to them."},"noise1":{"pos":[-200,500],"comment":"Here we add variation to the mass.\\n\\nMake sure to check which values are then set to each particles by opening up the spreadsheet panel."},"particlesSystemGpu1":{"pos":[-200,850],"comment":"Dive inside the node to see how the forces are applied to the particles.","nodes":{"globals1":{"pos":[-1500,0]},"output1":{"pos":[550,0]},"acceleration1":{"pos":[250,0]},"param1":{"pos":[-1250,400]},"subtract1":{"pos":[-1100,300]},"length1":{"pos":[-950,400]},"complement1":{"pos":[-850,400]},"multScalar1":{"pos":[-600,300]},"clamp1":{"pos":[-750,400]},"attribute1":{"pos":[-1200,750]},"subtract2":{"pos":[-950,700]},"add2":{"pos":[-250,300],"comment":"this node adds the 2 forces that are applied to the particles:\\n1 - the force that moves the particles away from the cursor.\\n2 - the force that makes the particles go back to their initial position.\\n\\nYou could try and remove the second input to see how the particles will behave (make sure to restart at the first frame to see the changes)\\n"},"multScalar3":{"pos":[-900,50],"comment":"This nodes multiplies the velocity set in the previous frame by a value below 1. This is what adds some drag to the particles.\\n\\nWithout it, they would behave in a more \"jiggly\" way.\\n\\nFeel free to modify this value, or disconnect this node, to see how that affects the simulation."},"multScalar4":{"pos":[-750,700],"comment":"this node and the ones before define how the particles go back to their initial position.\\n\\nAll we do is subtract the particles current position from the restP (which is set at the level above this node), and make sure this vector's length is never too high using the maxLength.\\n"},"maxLength1":{"pos":[-850,700]},"attribute2":{"pos":[-200,100]},"multScalar5":{"pos":[-500,300],"comment":"this node and the ones on the left of it define how the particles will be moved away from the cursor.\\n\\nWe basically subtract the particle current position from the xyz position under the vector, then do a complement (which is a function that does 1-x), which then allow us to have the force high when the particles are close to the cursor, and low when they are away."},"max1":{"pos":[-50,100],"comment":"Here we take the mass that we created at the level above.\\nWe also make sure it is never below 0."}}},"MAT":{"pos":[-500,850],"comment":"This contains the material applied to the points. In our case, we have a simple point material where we only change the point size.","nodes":{"pointsParticles":{"pos":[0,0],"nodes":{"output1":{"pos":[200,0]},"globals1":{"pos":[-200,0]},"constant_point_size":{"pos":[0,0]}}}}},"eventsNetwork1":{"pos":[-500,1050],"comment":"Inside the eventsNetwork, we have a raycast which will find the xyz position under our cursor. That position is then given to the \"cursor\" parameter of the particles system.","nodes":{"raycast1":{"pos":[-100,-50]},"pointer1":{"pos":[-350,-50]}}}}}}}}
Code editor
{"multiple_panel":{"split_ratio":0.5,"split_panel0":{"split_ratio":0.5,"split_panel0":{"panelTypes":["viewer"],"currentPanelIndex":0,"panel_data":{"camera":"/perspectiveCamera1","linkIndex":1}},"split_panel1":{"panelTypes":["params","spreadsheet"],"currentPanelIndex":0,"panel_data":{"active_folder":81,"linkIndex":1}},"split_mode":"vertical"},"split_panel1":{"panelTypes":["network","params","viewer"],"currentPanelIndex":0,"panel_data":{"camera":{"position":{"x":-48,"y":-22},"zoom":0.55},"history":{"2":{"position":{"x":-48,"y":-22},"zoom":0.55},"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":47.23891197047291,"y":140.75603577254316},"zoom":0.7680000000000002},"75":{"position":{"x":200,"y":-50},"zoom":0.55},"131":{"position":{"x":-59.04899999999998,"y":-65.1854},"zoom":0.8467543904215146},"234":{"position":{"x":-150,"y":-50},"zoom":0.55},"473":{"position":{"x":515.0197936124029,"y":-433.2064840936587},"zoom":0.43499999999999994},"499":{"position":{"x":0,"y":0},"zoom":0.8677777777777781},"502":{"position":{"x":-190.78104993597944,"y":16.645326504481428},"zoom":0.7810000000000002},"667":{"position":{"x":-69.72477064220182,"y":33.94495412844036},"zoom":1.0900000000000003}},"linkIndex":1}},"split_mode":"horizontal"},"currentNodes":["/","/","/","/","/","/","/","/"],"navigationHistory":{"nodePaths":{"1":["/","/particles","/particles/MAT","/particles/MAT/pointsParticles","/particles/MAT","/particles","/particles/particlesSystemGpu1","/particles","/particles/eventsNetwork1","/particles","/particles/particlesSystemGpu1","/particles","/particles/eventsNetwork1","/particles","/particles/eventsNetwork1","/particles","/particles/particlesSystemGpu1","/particles","/particles/particlesSystemGpu1","/particles","/particles/particlesSystemGpu1","/particles","/particles/particlesSystemGpu1","/particles","/particles/particlesSystemGpu1","/particles","/particles/particlesSystemGpu1","/particles","/","/particles","/particles/particlesSystemGpu1","/particles","/particles/particlesSystemGpu1","/particles","/","/perspectiveCamera1/events1","/perspectiveCamera1","/","/particles","/","/perspectiveCamera1/events1","/perspectiveCamera1","/"],"2":["/"],"3":["/"],"4":["/"],"5":["/"],"6":["/"],"7":["/"],"8":["/"]},"index":{"1":42,"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/pointer;event/raycast;mat/pointsBuilder;obj/copNetwork;obj/geo;obj/hemisphereLight;obj/perspectiveCamera;sop/attribCreate;sop/eventsNetwork;sop/materialsNetwork;sop/noise;sop/particlesSystemGpu;sop/restAttributes;sop/scatter;sop/text
Used operations
Used modules
Used assemblers
GL_PARTICLES;GL_POINTS
Used integrations
[]
Used assets
Nodes map
{"/hemisphereLight1":"obj/hemisphereLight","/perspectiveCamera1":"obj/perspectiveCamera","/perspectiveCamera1/events1":"sop/eventsNetwork","/perspectiveCamera1/events1/cameraOrbitControls1":"event/cameraOrbitControls","/COP":"obj/copNetwork","/COP/imageEnv":"cop/imageEXR","/COP/imageUv":"cop/image","/COP/envMap":"cop/envMap","/particles":"obj/geo","/particles/text1":"sop/text","/particles/scatter1":"sop/scatter","/particles/restAttributes1":"sop/restAttributes","/particles/attribCreate1":"sop/attribCreate","/particles/noise1":"sop/noise","/particles/particlesSystemGpu1":"sop/particlesSystemGpu","/particles/MAT":"sop/materialsNetwork","/particles/MAT/pointsParticles":"mat/pointsBuilder","/particles/eventsNetwork1":"sop/eventsNetwork","/particles/eventsNetwork1/raycast1":"event/raycast","/particles/eventsNetwork1/pointer1":"event/pointer"}
Js version
Editor version
Engine version
Name
*
Code
{"properties":{"frame":0,"maxFrame":600,"maxFrameLocked":false,"realtimeState":true,"mainCameraPath":"/perspectiveCamera1","versions":{"polygonjs":"1.1.261"}},"root":{"type":"root","nodes":{"hemisphereLight1":{"type":"hemisphereLight","flags":{"display":true}},"perspectiveCamera1":{"type":"perspectiveCamera","nodes":{"events1":{"type":"eventsNetwork","nodes":{"cameraOrbitControls1":{"type":"cameraOrbitControls"}},"selection":["cameraOrbitControls1"]}},"params":{"t":[0,0,5.314738208647524],"r":[-22.723127930556515,44.66532130223666,16.403892417511617],"controls":"./events1/cameraOrbitControls1"},"flags":{"display":true}},"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"]}}},"particles":{"type":"geo","nodes":{"text1":{"type":"text","params":{"font":"https://raw.githubusercontent.com/polygonjs/polygonjs-assets/master/fonts/SourceCodePro-Black.ttf","type":1,"justifyMode":2}},"scatter1":{"type":"scatter","params":{"pointsCount":1024},"inputs":["text1"]},"restAttributes1":{"type":"restAttributes","params":{"tnormal":0},"inputs":["scatter1"]},"attribCreate1":{"type":"attribCreate","params":{"name":"mass","value1":10},"inputs":["restAttributes1"]},"noise1":{"type":"noise","params":{"amplitude":9,"attribName":"mass"},"inputs":["attribCreate1"]},"particlesSystemGpu1":{"type":"particlesSystemGpu","nodes":{"globals1":{"type":"globals"},"output1":{"type":"output","inputs":[{"index":0,"node":"acceleration1","output":"position"},{"index":1,"node":"acceleration1","output":"velocity"}]},"acceleration1":{"type":"acceleration","params":{"position":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false},"overriden_options":{}},"velocity":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false},"overriden_options":{}},"mass":{"type":"float","default_value":1,"options":{"spare":true,"editable":false},"raw_input":20,"overriden_options":{}},"force":{"type":"vector3","default_value":[0,-9.8,0],"options":{"spare":true,"editable":false},"raw_input":[0,0,0],"overriden_options":{}}},"inputs":[{"index":0,"node":"globals1","output":"position"},{"index":1,"node":"multScalar3","output":"val"},{"index":2,"node":"max1","output":"val"},{"index":3,"node":"add2","output":"sum"}],"connection_points":{"in":[{"name":"position","type":"vec3"},{"name":"velocity","type":"vec3"},{"name":"mass","type":"float"},{"name":"force","type":"vec3"}],"out":[{"name":"position","type":"vec3"},{"name":"velocity","type":"vec3"}]}},"param1":{"type":"param","params":{"name":"cursor","type":4},"connection_points":{"in":[],"out":[{"name":"val","type":"vec3"}]}},"subtract1":{"type":"subtract","params":{"sub0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"sub1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"sub2":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":true}}},"maxInputsCount":3,"inputs":[{"index":0,"node":"globals1","output":"position"},{"index":1,"node":"param1","output":"val"}],"connection_points":{"in":[{"name":"sub0","type":"vec3"},{"name":"sub1","type":"vec3"},{"name":"sub2","type":"vec3"}],"out":[{"name":"subtract","type":"vec3"}]}},"length1":{"type":"length","params":{"x":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}}},"inputs":[{"index":0,"node":"subtract1","output":"subtract"}],"connection_points":{"in":[{"name":"x","type":"vec3"}],"out":[{"name":"val","type":"float"}]}},"complement1":{"type":"complement","params":{"in":{"type":"float","default_value":0,"options":{"spare":true,"editable":false},"overriden_options":{}}},"inputs":[{"index":0,"node":"length1","output":"val"}],"connection_points":{"in":[{"name":"in","type":"float"}],"out":[{"name":"val","type":"float"}]}},"multScalar1":{"type":"multScalar","params":{"value":{"type":"vector3","default_value":[1,1,1],"options":{"spare":true,"editable":false},"overriden_options":{}},"mult":{"type":"float","default_value":1,"options":{"spare":true,"editable":false},"overriden_options":{}}},"inputs":[{"index":0,"node":"subtract1","output":"subtract"},{"index":1,"node":"clamp1","output":"val"}],"connection_points":{"in":[{"name":"value","type":"vec3"},{"name":"mult","type":"float"}],"out":[{"name":"val","type":"vec3"}]}},"clamp1":{"type":"clamp","params":{"value":{"type":"float","default_value":0,"options":{"spare":true,"editable":false},"overriden_options":{}},"min":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}},"max":{"type":"float","default_value":1,"options":{"spare":true,"editable":true}}},"inputs":[{"index":0,"node":"complement1","output":"val"}],"connection_points":{"in":[{"name":"value","type":"float"},{"name":"min","type":"float"},{"name":"max","type":"float"}],"out":[{"name":"val","type":"float"}]}},"attribute1":{"type":"attribute","params":{"name":"restP","type":2,"texportWhenConnected":1,"in":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":true}}},"maxInputsCount":1,"connection_points":{"in":[{"name":"in","type":"vec3"}],"out":[{"name":"val","type":"vec3"}]}},"subtract2":{"type":"subtract","params":{"sub0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"sub1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"sub2":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":true}}},"maxInputsCount":3,"inputs":[{"index":0,"node":"attribute1","output":"val"},{"index":1,"node":"globals1","output":"position"}],"connection_points":{"in":[{"name":"sub0","type":"vec3"},{"name":"sub1","type":"vec3"},{"name":"sub2","type":"vec3"}],"out":[{"name":"subtract","type":"vec3"}]}},"add2":{"type":"add","params":{"add0":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"add1":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false}},"add2":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":true}}},"maxInputsCount":3,"inputs":[{"index":0,"node":"multScalar5","output":"val"},{"index":1,"node":"multScalar4","output":"val"}],"connection_points":{"in":[{"name":"add0","type":"vec3"},{"name":"add1","type":"vec3"},{"name":"add2","type":"vec3"}],"out":[{"name":"sum","type":"vec3"}]}},"multScalar3":{"type":"multScalar","params":{"value":{"type":"vector3","default_value":[1,1,1],"options":{"spare":true,"editable":false},"overriden_options":{}},"mult":{"type":"float","default_value":1,"options":{"spare":true,"editable":true},"raw_input":0.98}},"inputs":[{"index":0,"node":"globals1","output":"velocity"}],"connection_points":{"in":[{"name":"value","type":"vec3"},{"name":"mult","type":"float"}],"out":[{"name":"val","type":"vec3"}]}},"multScalar4":{"type":"multScalar","params":{"value":{"type":"vector3","default_value":[1,1,1],"options":{"spare":true,"editable":false},"overriden_options":{}},"mult":{"type":"float","default_value":1,"options":{"spare":true,"editable":true},"raw_input":2}},"inputs":[{"index":0,"node":"maxLength1","output":"val"}],"connection_points":{"in":[{"name":"value","type":"vec3"},{"name":"mult","type":"float"}],"out":[{"name":"val","type":"vec3"}]}},"maxLength1":{"type":"maxLength","params":{"val":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"editable":false},"overriden_options":{}},"max":{"type":"float","default_value":1,"options":{"spare":true,"editable":true}}},"inputs":[{"index":0,"node":"subtract2","output":"subtract"}],"connection_points":{"in":[{"name":"val","type":"vec3"},{"name":"max","type":"float"}],"out":[{"name":"val","type":"vec3"}]}},"attribute2":{"type":"attribute","params":{"name":"mass","texportWhenConnected":1,"in":{"type":"float","default_value":0,"options":{"spare":true,"editable":true}}},"maxInputsCount":1,"connection_points":{"in":[{"name":"in","type":"float"}],"out":[{"name":"val","type":"float"}]}},"multScalar5":{"type":"multScalar","params":{"value":{"type":"vector3","default_value":[1,1,1],"options":{"spare":true,"editable":false},"overriden_options":{}},"mult":{"type":"float","default_value":1,"options":{"spare":true,"editable":true},"raw_input":10}},"inputs":[{"index":0,"node":"multScalar1","output":"val"}],"connection_points":{"in":[{"name":"value","type":"vec3"},{"name":"mult","type":"float"}],"out":[{"name":"val","type":"vec3"}]}},"max1":{"type":"max","params":{"in0":{"type":"float","default_value":0,"options":{"spare":true,"editable":false},"overriden_options":{}},"in1":{"type":"float","default_value":0,"options":{"spare":true,"editable":true},"raw_input":0.001}},"inputs":[{"index":0,"node":"attribute2","output":"val"}],"connection_points":{"in":[{"name":"in0","type":"float"},{"name":"in1","type":"float"}],"out":[{"name":"val","type":"float"}]}}},"params":{"material":"../MAT/pointsParticles","cursor":{"type":"vector3","default_value":[0,0,0],"options":{"spare":true,"computeOnDirty":true,"cook":false,"dependentOnFoundNode":true},"raw_input":[10.133424310329652,0.5838678453900471,0],"overriden_options":{"callback":"{}"}}},"inputs":["noise1"],"flags":{"display":true},"persisted_config":{"shaders_by_name":{"velocity":"#include <common>\n\n// removed:\n//// INSERT DEFINE\n\n\n\n// /geo1/particlesSystemGpu1/maxLength1\n//\n//\n// CLAMP_LENGTH\n//\n//\nfloat maxLength(float val, float max_l){\n\treturn min(val, max_l);\n}\nvec2 maxLength(vec2 val, float max_l){\n\tfloat vec_length = length(val);\n\tif(vec_length == 0.0){\n\t\treturn val;\n\t} else {\n\t\tfloat new_length = min(vec_length, max_l);\n\t\treturn new_length * normalize(val);\n\t}\n}\nvec3 maxLength(vec3 val, float max_l){\n\tfloat vec_length = length(val);\n\tif(vec_length == 0.0){\n\t\treturn val;\n\t} else {\n\t\tfloat new_length = min(vec_length, max_l);\n\t\treturn new_length * normalize(val);\n\t}\n}\nvec4 maxLength(vec4 val, float max_l){\n\tfloat vec_length = length(val);\n\tif(vec_length == 0.0){\n\t\treturn val;\n\t} else {\n\t\tfloat new_length = min(vec_length, max_l);\n\t\treturn new_length * normalize(val);\n\t}\n}\n\n\n// /geo1/particlesSystemGpu1/complement1\nfloat complement(float x){return 1.0-x;}\nvec2 complement(vec2 x){return vec2(1.0-x.x, 1.0-x.y);}\nvec3 complement(vec3 x){return vec3(1.0-x.x, 1.0-x.y, 1.0-x.z);}\nvec4 complement(vec4 x){return vec4(1.0-x.x, 1.0-x.y, 1.0-x.z, 1.0-x.w);}\n\n\n// /geo1/particlesSystemGpu1/acceleration1\nfloat velFromAccel(float vel, float force, float mass, float time_delta){\n\tfloat impulse = (time_delta * mass) * force;\n\treturn vel + impulse;\n}\nvec2 velFromAccel(vec2 vel, vec2 force, float mass, float time_delta){\n\tvec2 impulse = (time_delta * mass) * force;\n\treturn vel + impulse;\n}\nvec3 velFromAccel(vec3 vel, vec3 force, float mass, float time_delta){\n\tvec3 impulse = (time_delta * mass) * force;\n\treturn vel + impulse;\n}\nvec4 velFromAccel(vec4 vel, vec4 force, float mass, float time_delta){\n\tvec4 impulse = (time_delta * mass) * force;\n\treturn vel + impulse;\n}\nfloat posFromVel(float position, float velocity, float time_delta){\n\treturn position + (time_delta * velocity);\n}\nvec2 posFromVel(vec2 position, vec2 velocity, float time_delta){\n\treturn position + (time_delta * velocity);\n}\nvec3 posFromVel(vec3 position, vec3 velocity, float time_delta){\n\treturn position + (time_delta * velocity);\n}\nvec4 posFromVel(vec4 position, vec4 velocity, float time_delta){\n\treturn position + (time_delta * velocity);\n}\n\n\n\n\n\n\n\n// /geo1/particlesSystemGpu1/globals1\nuniform sampler2D texture_position;\nuniform sampler2D texture_velocity;\n\n// /geo1/particlesSystemGpu1/attribute2\nuniform sampler2D texture_restP_SEPARATOR_mass;\n\n// /geo1/particlesSystemGpu1/param1\nuniform vec3 v_POLY_param_cursor;\n\n// /geo1/particlesSystemGpu1/acceleration1\nuniform float delta_time;\n\n\n\n\n\nvoid main() {\n\n\tvec2 particleUV = (gl_FragCoord.xy / resolution.xy);\n\n// removed:\n//\t// INSERT BODY\n\n\n\n\t// /geo1/particlesSystemGpu1/globals1\n\tvec3 v_POLY_globals1_position = texture2D( texture_position, particleUV ).xyz;\n\tvec3 v_POLY_globals1_velocity = texture2D( texture_velocity, particleUV ).xyz;\n\t\n\t// /geo1/particlesSystemGpu1/attribute2\n\tfloat v_POLY_attribute2_val = texture2D( texture_restP_SEPARATOR_mass, particleUV ).w;\n\t\n\t// /geo1/particlesSystemGpu1/param1\n\tvec3 v_POLY_param1_val = v_POLY_param_cursor;\n\t\n\t// /geo1/particlesSystemGpu1/attribute1\n\tvec3 v_POLY_attribute1_val = texture2D( texture_restP_SEPARATOR_mass, particleUV ).xyz;\n\t\n\t// /geo1/particlesSystemGpu1/multScalar3\n\tvec3 v_POLY_multScalar3_val = (0.98*v_POLY_globals1_velocity);\n\t\n\t// /geo1/particlesSystemGpu1/subtract1\n\tvec3 v_POLY_subtract1_subtract = (v_POLY_globals1_position - v_POLY_param1_val - vec3(0.0, 0.0, 0.0));\n\t\n\t// /geo1/particlesSystemGpu1/subtract2\n\tvec3 v_POLY_subtract2_subtract = (v_POLY_attribute1_val - v_POLY_globals1_position - vec3(0.0, 0.0, 0.0));\n\t\n\t// /geo1/particlesSystemGpu1/max1\n\tfloat v_POLY_max1_val = max(v_POLY_attribute2_val, 0.001);\n\t\n\t// /geo1/particlesSystemGpu1/length1\n\tfloat v_POLY_length1_val = length(v_POLY_subtract1_subtract);\n\t\n\t// /geo1/particlesSystemGpu1/maxLength1\n\tvec3 v_POLY_maxLength1_val = maxLength(v_POLY_subtract2_subtract, 1.0);\n\t\n\t// /geo1/particlesSystemGpu1/complement1\n\tfloat v_POLY_complement1_val = complement(v_POLY_length1_val);\n\t\n\t// /geo1/particlesSystemGpu1/multScalar4\n\tvec3 v_POLY_multScalar4_val = (2.0*v_POLY_maxLength1_val);\n\t\n\t// /geo1/particlesSystemGpu1/clamp1\n\tfloat v_POLY_clamp1_val = clamp(v_POLY_complement1_val, 0.0, 1.0);\n\t\n\t// /geo1/particlesSystemGpu1/multScalar1\n\tvec3 v_POLY_multScalar1_val = (v_POLY_clamp1_val*v_POLY_subtract1_subtract);\n\t\n\t// /geo1/particlesSystemGpu1/multScalar5\n\tvec3 v_POLY_multScalar5_val = (10.0*v_POLY_multScalar1_val);\n\t\n\t// /geo1/particlesSystemGpu1/add2\n\tvec3 v_POLY_add2_sum = (v_POLY_multScalar5_val + v_POLY_multScalar4_val + vec3(0.0, 0.0, 0.0));\n\t\n\t// /geo1/particlesSystemGpu1/acceleration1\n\tvec3 v_POLY_acceleration1_velocity = velFromAccel(v_POLY_multScalar3_val, v_POLY_add2_sum, v_POLY_max1_val, delta_time);\n\tvec3 v_POLY_acceleration1_position = posFromVel(v_POLY_globals1_position, v_POLY_acceleration1_velocity, delta_time);\n\t\n\t// /geo1/particlesSystemGpu1/output1\n\tgl_FragColor.xyz = v_POLY_acceleration1_velocity;\n\n\n\n\n}","position":"#include <common>\n\n// removed:\n//// INSERT DEFINE\n\n\n\n// /geo1/particlesSystemGpu1/maxLength1\n//\n//\n// CLAMP_LENGTH\n//\n//\nfloat maxLength(float val, float max_l){\n\treturn min(val, max_l);\n}\nvec2 maxLength(vec2 val, float max_l){\n\tfloat vec_length = length(val);\n\tif(vec_length == 0.0){\n\t\treturn val;\n\t} else {\n\t\tfloat new_length = min(vec_length, max_l);\n\t\treturn new_length * normalize(val);\n\t}\n}\nvec3 maxLength(vec3 val, float max_l){\n\tfloat vec_length = length(val);\n\tif(vec_length == 0.0){\n\t\treturn val;\n\t} else {\n\t\tfloat new_length = min(vec_length, max_l);\n\t\treturn new_length * normalize(val);\n\t}\n}\nvec4 maxLength(vec4 val, float max_l){\n\tfloat vec_length = length(val);\n\tif(vec_length == 0.0){\n\t\treturn val;\n\t} else {\n\t\tfloat new_length = min(vec_length, max_l);\n\t\treturn new_length * normalize(val);\n\t}\n}\n\n\n// /geo1/particlesSystemGpu1/complement1\nfloat complement(float x){return 1.0-x;}\nvec2 complement(vec2 x){return vec2(1.0-x.x, 1.0-x.y);}\nvec3 complement(vec3 x){return vec3(1.0-x.x, 1.0-x.y, 1.0-x.z);}\nvec4 complement(vec4 x){return vec4(1.0-x.x, 1.0-x.y, 1.0-x.z, 1.0-x.w);}\n\n\n// /geo1/particlesSystemGpu1/acceleration1\nfloat velFromAccel(float vel, float force, float mass, float time_delta){\n\tfloat impulse = (time_delta * mass) * force;\n\treturn vel + impulse;\n}\nvec2 velFromAccel(vec2 vel, vec2 force, float mass, float time_delta){\n\tvec2 impulse = (time_delta * mass) * force;\n\treturn vel + impulse;\n}\nvec3 velFromAccel(vec3 vel, vec3 force, float mass, float time_delta){\n\tvec3 impulse = (time_delta * mass) * force;\n\treturn vel + impulse;\n}\nvec4 velFromAccel(vec4 vel, vec4 force, float mass, float time_delta){\n\tvec4 impulse = (time_delta * mass) * force;\n\treturn vel + impulse;\n}\nfloat posFromVel(float position, float velocity, float time_delta){\n\treturn position + (time_delta * velocity);\n}\nvec2 posFromVel(vec2 position, vec2 velocity, float time_delta){\n\treturn position + (time_delta * velocity);\n}\nvec3 posFromVel(vec3 position, vec3 velocity, float time_delta){\n\treturn position + (time_delta * velocity);\n}\nvec4 posFromVel(vec4 position, vec4 velocity, float time_delta){\n\treturn position + (time_delta * velocity);\n}\n\n\n\n\n\n\n\n// /geo1/particlesSystemGpu1/globals1\nuniform sampler2D texture_position;\nuniform sampler2D texture_velocity;\n\n// /geo1/particlesSystemGpu1/attribute2\nuniform sampler2D texture_restP_SEPARATOR_mass;\n\n// /geo1/particlesSystemGpu1/param1\nuniform vec3 v_POLY_param_cursor;\n\n// /geo1/particlesSystemGpu1/acceleration1\nuniform float delta_time;\n\n\n\n\n\nvoid main() {\n\n\tvec2 particleUV = (gl_FragCoord.xy / resolution.xy);\n\n// removed:\n//\t// INSERT BODY\n\n\n\n\t// /geo1/particlesSystemGpu1/globals1\n\tvec3 v_POLY_globals1_position = texture2D( texture_position, particleUV ).xyz;\n\tvec3 v_POLY_globals1_velocity = texture2D( texture_velocity, particleUV ).xyz;\n\t\n\t// /geo1/particlesSystemGpu1/attribute2\n\tfloat v_POLY_attribute2_val = texture2D( texture_restP_SEPARATOR_mass, particleUV ).w;\n\t\n\t// /geo1/particlesSystemGpu1/param1\n\tvec3 v_POLY_param1_val = v_POLY_param_cursor;\n\t\n\t// /geo1/particlesSystemGpu1/attribute1\n\tvec3 v_POLY_attribute1_val = texture2D( texture_restP_SEPARATOR_mass, particleUV ).xyz;\n\t\n\t// /geo1/particlesSystemGpu1/multScalar3\n\tvec3 v_POLY_multScalar3_val = (0.98*v_POLY_globals1_velocity);\n\t\n\t// /geo1/particlesSystemGpu1/subtract1\n\tvec3 v_POLY_subtract1_subtract = (v_POLY_globals1_position - v_POLY_param1_val - vec3(0.0, 0.0, 0.0));\n\t\n\t// /geo1/particlesSystemGpu1/subtract2\n\tvec3 v_POLY_subtract2_subtract = (v_POLY_attribute1_val - v_POLY_globals1_position - vec3(0.0, 0.0, 0.0));\n\t\n\t// /geo1/particlesSystemGpu1/max1\n\tfloat v_POLY_max1_val = max(v_POLY_attribute2_val, 0.001);\n\t\n\t// /geo1/particlesSystemGpu1/length1\n\tfloat v_POLY_length1_val = length(v_POLY_subtract1_subtract);\n\t\n\t// /geo1/particlesSystemGpu1/maxLength1\n\tvec3 v_POLY_maxLength1_val = maxLength(v_POLY_subtract2_subtract, 1.0);\n\t\n\t// /geo1/particlesSystemGpu1/complement1\n\tfloat v_POLY_complement1_val = complement(v_POLY_length1_val);\n\t\n\t// /geo1/particlesSystemGpu1/multScalar4\n\tvec3 v_POLY_multScalar4_val = (2.0*v_POLY_maxLength1_val);\n\t\n\t// /geo1/particlesSystemGpu1/clamp1\n\tfloat v_POLY_clamp1_val = clamp(v_POLY_complement1_val, 0.0, 1.0);\n\t\n\t// /geo1/particlesSystemGpu1/multScalar1\n\tvec3 v_POLY_multScalar1_val = (v_POLY_clamp1_val*v_POLY_subtract1_subtract);\n\t\n\t// /geo1/particlesSystemGpu1/multScalar5\n\tvec3 v_POLY_multScalar5_val = (10.0*v_POLY_multScalar1_val);\n\t\n\t// /geo1/particlesSystemGpu1/add2\n\tvec3 v_POLY_add2_sum = (v_POLY_multScalar5_val + v_POLY_multScalar4_val + vec3(0.0, 0.0, 0.0));\n\t\n\t// /geo1/particlesSystemGpu1/acceleration1\n\tvec3 v_POLY_acceleration1_velocity = velFromAccel(v_POLY_multScalar3_val, v_POLY_add2_sum, v_POLY_max1_val, delta_time);\n\tvec3 v_POLY_acceleration1_position = posFromVel(v_POLY_globals1_position, v_POLY_acceleration1_velocity, delta_time);\n\t\n\t// /geo1/particlesSystemGpu1/output1\n\tgl_FragColor.xyz = v_POLY_acceleration1_position;\n\n\n\n\n}"},"texture_allocations":{"writable":[{"velocity":[{"name":"velocity","size":3,"nodes":["/particles/particlesSystemGpu1/output1"]}]},{"position":[{"name":"position","size":3,"nodes":["/particles/particlesSystemGpu1/output1","/particles/particlesSystemGpu1/globals1"]}]}],"readonly":[{"restP_SEPARATOR_mass":[{"name":"restP","size":3,"nodes":["/particles/particlesSystemGpu1/attribute1"]},{"name":"mass","size":1,"nodes":["/particles/particlesSystemGpu1/attribute2"]}]}]},"param_uniform_pairs":[["cursor","v_POLY_param_cursor"]],"uniforms_owner":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/particles/particlesSystemGpu1-main","type":"ShaderMaterial","depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"glslVersion":null,"uniforms":{"v_POLY_param_cursor":{"type":"v3","value":[10.133424310329652,0.5838678453900471,0]}},"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}}},"MAT":{"type":"materialsNetwork","nodes":{"pointsParticles":{"type":"pointsBuilder","nodes":{"output1":{"type":"output","inputs":[null,null,null,null,null,{"index":5,"node":"constant_point_size","output":"val"}]},"globals1":{"type":"globals"},"constant_point_size":{"type":"constant","params":{"float":0.004},"maxInputsCount":0,"connection_points":{"in":[],"out":[{"name":"val","type":"float"}]}}},"selection":["constant_point_size"],"persisted_config":{"material":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/particles/MAT/pointsParticles-main","type":"PointsMaterial","name":"/geo1/MAT/pointsParticles","color":16777215,"size":1,"sizeAttenuation":true,"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":"uniform float size;\nuniform float scale;\n#include <common>\n\n\n\n// /particles/MAT/pointsParticles/output1\nuniform sampler2D texture_position;\n\n// /particles/MAT/pointsParticles/output1\nvarying vec2 particles_sim_uv_varying;\n\n// /particles/MAT/pointsParticles/output1\nattribute vec2 particles_sim_uv_attrib;\n\n\n\n\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\n\n\n\t// /particles/MAT/pointsParticles/constant_point_size\n\tfloat v_POLY_constant_point_size_val = 0.004;\n\t\n\t// /particles/MAT/pointsParticles/output1\n\tparticles_sim_uv_varying = particles_sim_uv_attrib;\n\tvec3 transformed = texture2D( texture_position, particles_sim_uv_varying ).xyz;\n\tvec3 objectNormal = normal;\n\t#ifdef USE_TANGENT\n\t\tvec3 objectTangent = vec3( tangent.xyz );\n\t#endif\n\tgl_PointSize = v_POLY_constant_point_size_val * size * 10.0;\n\n\n\n\t#include <morphcolor_vertex>\n// removed:\n//\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n// removed:\n//\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}","fragmentShader":"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n\n\n\n// /particles/MAT/pointsParticles/output1\nvarying vec2 particles_sim_uv_varying;\n\n\n\n\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}","timeDependent":false,"resolutionDependent":false,"paramConfigs":[]},"customMaterials":{"customDistanceMaterial":{"material":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/particles/MAT/pointsParticles-customDistanceMaterial","type":"ShaderMaterial","name":"customDistanceMaterial","depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"glslVersion":null,"uniforms":{"diffuse":{"type":"c","value":16777215},"opacity":{"value":1},"map":{"value":null},"uvTransform":{"type":"m3","value":[1,0,0,0,1,0,0,0,1]},"uv2Transform":{"type":"m3","value":[1,0,0,0,1,0,0,0,1]},"alphaMap":{"value":null},"alphaTest":{"value":0},"displacementMap":{"value":null},"displacementScale":{"value":1},"displacementBias":{"value":0},"size":{"value":1},"scale":{"value":1}},"defines":{"USE_SIZEATTENUATION":1,"DEPTH_PACKING":3200},"vertexShader":"\nuniform float size;\nuniform float scale;\n#include <common>\n#include <clipping_planes_pars_vertex>\nvarying float vViewZDepth;\n\n// INSERT DEFINES\n\n\n// vHighPrecisionZW is added to match CustomMeshDepth.frag\n// which is itself taken from threejs\nvarying vec2 vHighPrecisionZW;\n\nvoid main() {\n\n\t// INSERT BODY\n\n\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\n\tvViewZDepth = - mvPosition.z;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\n\tvHighPrecisionZW = gl_Position.zw;\n\n}\n","fragmentShader":"\n// INSERT DEFINES\n\n\n#if DEPTH_PACKING == 3200\n\n\tuniform float opacity;\n\n#endif\n\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvarying vec2 vHighPrecisionZW;\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( 1.0 );\n\n\t#if DEPTH_PACKING == 3200\n\n\t\tdiffuseColor.a = opacity;\n\n\t#endif\n\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\n\t// INSERT BODY\n\t// the new body lines should be added before the alphatest_fragment\n\t// so that alpha is set before (which is really how it would be set if the alphamap_fragment above was used by the material node parameters)\n\n\t#include <alphatest_fragment>\n\n\t#include <logdepthbuf_fragment>\n\n\n\t// Higher precision equivalent of gl_FragCoord.z. This assumes depthRange has been left to its default values.\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\n\t#if DEPTH_PACKING == 3200\n\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), diffuseColor.a );\n\n\t#elif DEPTH_PACKING == 3201\n\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\n\t#endif\n\n}\n","lights":false},"onBeforeCompileDataJSON":{"vertexShader":"\nuniform float size;\nuniform float scale;\n#include <common>\n#include <clipping_planes_pars_vertex>\nvarying float vViewZDepth;\n\n// INSERT DEFINES\n\n\n\n// /particles/MAT/pointsParticles/output1\nuniform sampler2D texture_position;\n\n// /particles/MAT/pointsParticles/output1\nvarying vec2 particles_sim_uv_varying;\n\n// /particles/MAT/pointsParticles/output1\nattribute vec2 particles_sim_uv_attrib;\n\n\n\n\n\n\n// vHighPrecisionZW is added to match CustomMeshDepth.frag\n// which is itself taken from threejs\nvarying vec2 vHighPrecisionZW;\n\nvoid main() {\n\n\t// INSERT BODY\n\n\n\n\t// /particles/MAT/pointsParticles/constant_point_size\n\tfloat v_POLY_constant_point_size_val = 0.004;\n\t\n\t// /particles/MAT/pointsParticles/output1\n\tparticles_sim_uv_varying = particles_sim_uv_attrib;\n\tvec3 transformed = texture2D( texture_position, particles_sim_uv_varying ).xyz;\n\tvec3 objectNormal = normal;\n\t#ifdef USE_TANGENT\n\t\tvec3 objectTangent = vec3( tangent.xyz );\n\t#endif\n\tgl_PointSize = v_POLY_constant_point_size_val * size * 10.0;\n\n\n\n\n\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\n\tvViewZDepth = - mvPosition.z;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\n\tvHighPrecisionZW = gl_Position.zw;\n\n}\n","fragmentShader":"\n// INSERT DEFINES\n\n\n\n// /particles/MAT/pointsParticles/output1\nvarying vec2 particles_sim_uv_varying;\n\n\n\n\n\n\n#if DEPTH_PACKING == 3200\n\n\tuniform float opacity;\n\n#endif\n\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvarying vec2 vHighPrecisionZW;\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( 1.0 );\n\n\t#if DEPTH_PACKING == 3200\n\n\t\tdiffuseColor.a = opacity;\n\n\t#endif\n\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\n\t// INSERT BODY\n\t// the new body lines should be added before the alphatest_fragment\n\t// so that alpha is set before (which is really how it would be set if the alphamap_fragment above was used by the material node parameters)\n\n\t#include <alphatest_fragment>\n\n\t#include <logdepthbuf_fragment>\n\n\n\t// Higher precision equivalent of gl_FragCoord.z. This assumes depthRange has been left to its default values.\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\n\t#if DEPTH_PACKING == 3200\n\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), diffuseColor.a );\n\n\t#elif DEPTH_PACKING == 3201\n\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\n\t#endif\n\n}\n","timeDependent":false,"resolutionDependent":false,"paramConfigs":[]}},"customDepthMaterial":{"material":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/particles/MAT/pointsParticles-customDepthMaterial","type":"ShaderMaterial","name":"customDepthMaterial","depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"glslVersion":null,"uniforms":{"diffuse":{"type":"c","value":16777215},"opacity":{"value":1},"map":{"value":null},"uvTransform":{"type":"m3","value":[1,0,0,0,1,0,0,0,1]},"uv2Transform":{"type":"m3","value":[1,0,0,0,1,0,0,0,1]},"alphaMap":{"value":null},"alphaTest":{"value":0},"displacementMap":{"value":null},"displacementScale":{"value":1},"displacementBias":{"value":0},"size":{"value":1},"scale":{"value":1}},"defines":{"USE_SIZEATTENUATION":1,"DEPTH_PACKING":3201},"vertexShader":"\nuniform float size;\nuniform float scale;\n#include <common>\n#include <clipping_planes_pars_vertex>\nvarying float vViewZDepth;\n\n// INSERT DEFINES\n\n\n// vHighPrecisionZW is added to match CustomMeshDepth.frag\n// which is itself taken from threejs\nvarying vec2 vHighPrecisionZW;\n\nvoid main() {\n\n\t// INSERT BODY\n\n\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\n\tvViewZDepth = - mvPosition.z;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\n\tvHighPrecisionZW = gl_Position.zw;\n\n}\n","fragmentShader":"\n// INSERT DEFINES\n\n\n#if DEPTH_PACKING == 3200\n\n\tuniform float opacity;\n\n#endif\n\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvarying vec2 vHighPrecisionZW;\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( 1.0 );\n\n\t#if DEPTH_PACKING == 3200\n\n\t\tdiffuseColor.a = opacity;\n\n\t#endif\n\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\n\t// INSERT BODY\n\t// the new body lines should be added before the alphatest_fragment\n\t// so that alpha is set before (which is really how it would be set if the alphamap_fragment above was used by the material node parameters)\n\n\t#include <alphatest_fragment>\n\n\t#include <logdepthbuf_fragment>\n\n\n\t// Higher precision equivalent of gl_FragCoord.z. This assumes depthRange has been left to its default values.\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\n\t#if DEPTH_PACKING == 3200\n\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), diffuseColor.a );\n\n\t#elif DEPTH_PACKING == 3201\n\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\n\t#endif\n\n}\n","lights":false},"onBeforeCompileDataJSON":{"vertexShader":"\nuniform float size;\nuniform float scale;\n#include <common>\n#include <clipping_planes_pars_vertex>\nvarying float vViewZDepth;\n\n// INSERT DEFINES\n\n\n\n// /particles/MAT/pointsParticles/output1\nuniform sampler2D texture_position;\n\n// /particles/MAT/pointsParticles/output1\nvarying vec2 particles_sim_uv_varying;\n\n// /particles/MAT/pointsParticles/output1\nattribute vec2 particles_sim_uv_attrib;\n\n\n\n\n\n\n// vHighPrecisionZW is added to match CustomMeshDepth.frag\n// which is itself taken from threejs\nvarying vec2 vHighPrecisionZW;\n\nvoid main() {\n\n\t// INSERT BODY\n\n\n\n\t// /particles/MAT/pointsParticles/constant_point_size\n\tfloat v_POLY_constant_point_size_val = 0.004;\n\t\n\t// /particles/MAT/pointsParticles/output1\n\tparticles_sim_uv_varying = particles_sim_uv_attrib;\n\tvec3 transformed = texture2D( texture_position, particles_sim_uv_varying ).xyz;\n\tvec3 objectNormal = normal;\n\t#ifdef USE_TANGENT\n\t\tvec3 objectTangent = vec3( tangent.xyz );\n\t#endif\n\tgl_PointSize = v_POLY_constant_point_size_val * size * 10.0;\n\n\n\n\n\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\n\tvViewZDepth = - mvPosition.z;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\n\tvHighPrecisionZW = gl_Position.zw;\n\n}\n","fragmentShader":"\n// INSERT DEFINES\n\n\n\n// /particles/MAT/pointsParticles/output1\nvarying vec2 particles_sim_uv_varying;\n\n\n\n\n\n\n#if DEPTH_PACKING == 3200\n\n\tuniform float opacity;\n\n#endif\n\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvarying vec2 vHighPrecisionZW;\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( 1.0 );\n\n\t#if DEPTH_PACKING == 3200\n\n\t\tdiffuseColor.a = opacity;\n\n\t#endif\n\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\n\t// INSERT BODY\n\t// the new body lines should be added before the alphatest_fragment\n\t// so that alpha is set before (which is really how it would be set if the alphamap_fragment above was used by the material node parameters)\n\n\t#include <alphatest_fragment>\n\n\t#include <logdepthbuf_fragment>\n\n\n\t// Higher precision equivalent of gl_FragCoord.z. This assumes depthRange has been left to its default values.\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\n\t#if DEPTH_PACKING == 3200\n\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), diffuseColor.a );\n\n\t#elif DEPTH_PACKING == 3201\n\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\n\t#endif\n\n}\n","timeDependent":false,"resolutionDependent":false,"paramConfigs":[]}},"customDepthDOFMaterial":{"material":{"metadata":{"version":4.5,"type":"Material","generator":"Material.toJSON"},"uuid":"/particles/MAT/pointsParticles-customDepthDOFMaterial","type":"ShaderMaterial","name":"customDepthDOFMaterial","depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"glslVersion":null,"uniforms":{"size":{"value":1},"scale":{"value":1},"mNear":{"value":0},"mFar":{"value":10}},"defines":{"USE_SIZEATTENUATION":1},"vertexShader":"\nuniform float size;\nuniform float scale;\n#include <common>\n\nvarying float vViewZDepth;\n\n// INSERT DEFINES\n\n\n\nvoid main() {\n\n\t// INSERT BODY\n\n\n\t#include <project_vertex>\n\n\tvViewZDepth = - mvPosition.z;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\n}\n","fragmentShader":"\nuniform float mNear;\nuniform float mFar;\n\nvarying float vViewZDepth;\n\n// INSERT DEFINES\n\nvoid main() {\n\n\tfloat color = 1.0 - smoothstep( mNear, mFar, vViewZDepth );\n\tgl_FragColor = vec4( vec3( color ), 1.0 );\n\tvec4 diffuseColor = gl_FragColor;\n\n\t// INSERT BODY\n\n\tgl_FragColor.a = diffuseColor.a;\n}\n","lights":false},"onBeforeCompileDataJSON":{"vertexShader":"\nuniform float size;\nuniform float scale;\n#include <common>\n\nvarying float vViewZDepth;\n\n// INSERT DEFINES\n\n\n\n// /particles/MAT/pointsParticles/output1\nuniform sampler2D texture_position;\n\n// /particles/MAT/pointsParticles/output1\nvarying vec2 particles_sim_uv_varying;\n\n// /particles/MAT/pointsParticles/output1\nattribute vec2 particles_sim_uv_attrib;\n\n\n\n\n\n\n\nvoid main() {\n\n\t// INSERT BODY\n\n\n\n\t// /particles/MAT/pointsParticles/constant_point_size\n\tfloat v_POLY_constant_point_size_val = 0.004;\n\t\n\t// /particles/MAT/pointsParticles/output1\n\tparticles_sim_uv_varying = particles_sim_uv_attrib;\n\tvec3 transformed = texture2D( texture_position, particles_sim_uv_varying ).xyz;\n\tvec3 objectNormal = normal;\n\t#ifdef USE_TANGENT\n\t\tvec3 objectTangent = vec3( tangent.xyz );\n\t#endif\n\tgl_PointSize = v_POLY_constant_point_size_val * size * 10.0;\n\n\n\n\n\n\t#include <project_vertex>\n\n\tvViewZDepth = - mvPosition.z;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\n}\n","fragmentShader":"\nuniform float mNear;\nuniform float mFar;\n\nvarying float vViewZDepth;\n\n// INSERT DEFINES\n\nvoid main() {\n\n\tfloat color = 1.0 - smoothstep( mNear, mFar, vViewZDepth );\n\tgl_FragColor = vec4( vec3( color ), 1.0 );\n\tvec4 diffuseColor = gl_FragColor;\n\n\t// INSERT BODY\n\n\tgl_FragColor.a = diffuseColor.a;\n}\n","timeDependent":false,"resolutionDependent":false,"paramConfigs":[]}}}}}}},"eventsNetwork1":{"type":"eventsNetwork","nodes":{"raycast1":{"type":"raycast","params":{"mouse":[0.8958333333333333,0.09341032608695654],"intersectWith":1,"planeDirection":[0,0,1],"tpositionTarget":1,"position":[-0.13051180813728092,-1.5915603980079505,0],"positionTarget":"/particles/particlesSystemGpu1/cursor"},"inputs":[{"index":0,"node":"pointer1","output":"pointermove"}]},"pointer1":{"type":"pointer","params":{"pointerdown":0,"pointermove":1}}}}},"flags":{"display":true},"selection":["text1"]}},"params":{"mainCameraPath":"/perspectiveCamera1"}},"ui":{"nodes":{"hemisphereLight1":{"pos":[150,100]},"perspectiveCamera1":{"pos":[-200,100],"nodes":{"events1":{"pos":[-200,50],"nodes":{"cameraOrbitControls1":{"pos":[150,50]}}}}},"COP":{"pos":[-200,200],"nodes":{"imageEnv":{"pos":[50,100]},"imageUv":{"pos":[-100,100]},"envMap":{"pos":[50,200]}}},"particles":{"pos":[-50,-150],"nodes":{"text1":{"pos":[-200,-400]},"scatter1":{"pos":[-200,-250],"comment":"this sets the number of points. A number that is a power of 2 allow us to maximize the texture that is used internally to simulate.\\n\\nIn this case 1024 is a good start, even though you may want to increase that number. You can then go with 2048, 4096, 8192 and so on."},"restAttributes1":{"pos":[-200,50],"comment":"This creates the rest position, which is used by the particles to go back to their initial position."},"attribCreate1":{"pos":[-200,300],"comment":"This creates the mass for each particle. The mass defines how quickly or how slowly particles will react to forces applied to them."},"noise1":{"pos":[-200,500],"comment":"Here we add variation to the mass.\\n\\nMake sure to check which values are then set to each particles by opening up the spreadsheet panel."},"particlesSystemGpu1":{"pos":[-200,850],"comment":"Dive inside the node to see how the forces are applied to the particles.","nodes":{"globals1":{"pos":[-1500,0]},"output1":{"pos":[550,0]},"acceleration1":{"pos":[250,0]},"param1":{"pos":[-1250,400]},"subtract1":{"pos":[-1100,300]},"length1":{"pos":[-950,400]},"complement1":{"pos":[-850,400]},"multScalar1":{"pos":[-600,300]},"clamp1":{"pos":[-750,400]},"attribute1":{"pos":[-1200,750]},"subtract2":{"pos":[-950,700]},"add2":{"pos":[-250,300],"comment":"this node adds the 2 forces that are applied to the particles:\\n1 - the force that moves the particles away from the cursor.\\n2 - the force that makes the particles go back to their initial position.\\n\\nYou could try and remove the second input to see how the particles will behave (make sure to restart at the first frame to see the changes)\\n"},"multScalar3":{"pos":[-900,50],"comment":"This nodes multiplies the velocity set in the previous frame by a value below 1. This is what adds some drag to the particles.\\n\\nWithout it, they would behave in a more \"jiggly\" way.\\n\\nFeel free to modify this value, or disconnect this node, to see how that affects the simulation."},"multScalar4":{"pos":[-750,700],"comment":"this node and the ones before define how the particles go back to their initial position.\\n\\nAll we do is subtract the particles current position from the restP (which is set at the level above this node), and make sure this vector's length is never too high using the maxLength.\\n"},"maxLength1":{"pos":[-850,700]},"attribute2":{"pos":[-200,100]},"multScalar5":{"pos":[-500,300],"comment":"this node and the ones on the left of it define how the particles will be moved away from the cursor.\\n\\nWe basically subtract the particle current position from the xyz position under the vector, then do a complement (which is a function that does 1-x), which then allow us to have the force high when the particles are close to the cursor, and low when they are away."},"max1":{"pos":[-50,100],"comment":"Here we take the mass that we created at the level above.\\nWe also make sure it is never below 0."}}},"MAT":{"pos":[-500,850],"comment":"This contains the material applied to the points. In our case, we have a simple point material where we only change the point size.","nodes":{"pointsParticles":{"pos":[0,0],"nodes":{"output1":{"pos":[200,0]},"globals1":{"pos":[-200,0]},"constant_point_size":{"pos":[0,0]}}}}},"eventsNetwork1":{"pos":[-500,1050],"comment":"Inside the eventsNetwork, we have a raycast which will find the xyz position under our cursor. That position is then given to the \"cursor\" parameter of the particles system.","nodes":{"raycast1":{"pos":[-100,-50]},"pointer1":{"pos":[-350,-50]}}}}}}}}
Code editor
{"multiple_panel":{"split_ratio":0.5,"split_panel0":{"split_ratio":0.5,"split_panel0":{"panelTypes":["viewer"],"currentPanelIndex":0,"panel_data":{"camera":"/perspectiveCamera1","linkIndex":1}},"split_panel1":{"panelTypes":["params","spreadsheet"],"currentPanelIndex":0,"panel_data":{"active_folder":81,"linkIndex":1}},"split_mode":"vertical"},"split_panel1":{"panelTypes":["network","params","viewer"],"currentPanelIndex":0,"panel_data":{"camera":{"position":{"x":-48,"y":-22},"zoom":0.55},"history":{"2":{"position":{"x":-48,"y":-22},"zoom":0.55},"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":47.23891197047291,"y":140.75603577254316},"zoom":0.7680000000000002},"75":{"position":{"x":200,"y":-50},"zoom":0.55},"131":{"position":{"x":-59.04899999999998,"y":-65.1854},"zoom":0.8467543904215146},"234":{"position":{"x":-150,"y":-50},"zoom":0.55},"473":{"position":{"x":515.0197936124029,"y":-433.2064840936587},"zoom":0.43499999999999994},"499":{"position":{"x":0,"y":0},"zoom":0.8677777777777781},"502":{"position":{"x":-190.78104993597944,"y":16.645326504481428},"zoom":0.7810000000000002},"667":{"position":{"x":-69.72477064220182,"y":33.94495412844036},"zoom":1.0900000000000003}},"linkIndex":1}},"split_mode":"horizontal"},"currentNodes":["/","/","/","/","/","/","/","/"],"navigationHistory":{"nodePaths":{"1":["/","/particles","/particles/MAT","/particles/MAT/pointsParticles","/particles/MAT","/particles","/particles/particlesSystemGpu1","/particles","/particles/eventsNetwork1","/particles","/particles/particlesSystemGpu1","/particles","/particles/eventsNetwork1","/particles","/particles/eventsNetwork1","/particles","/particles/particlesSystemGpu1","/particles","/particles/particlesSystemGpu1","/particles","/particles/particlesSystemGpu1","/particles","/particles/particlesSystemGpu1","/particles","/particles/particlesSystemGpu1","/particles","/particles/particlesSystemGpu1","/particles","/","/particles","/particles/particlesSystemGpu1","/particles","/particles/particlesSystemGpu1","/particles","/","/perspectiveCamera1/events1","/perspectiveCamera1","/","/particles","/","/perspectiveCamera1/events1","/perspectiveCamera1","/"],"2":["/"],"3":["/"],"4":["/"],"5":["/"],"6":["/"],"7":["/"],"8":["/"]},"index":{"1":42,"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/pointer;event/raycast;mat/pointsBuilder;obj/copNetwork;obj/geo;obj/hemisphereLight;obj/perspectiveCamera;sop/attribCreate;sop/eventsNetwork;sop/materialsNetwork;sop/noise;sop/particlesSystemGpu;sop/restAttributes;sop/scatter;sop/text
Used operations
Used modules
Used assemblers
GL_PARTICLES;GL_POINTS
Used integrations
[]
Used assets
Nodes map
{"/hemisphereLight1":"obj/hemisphereLight","/perspectiveCamera1":"obj/perspectiveCamera","/perspectiveCamera1/events1":"sop/eventsNetwork","/perspectiveCamera1/events1/cameraOrbitControls1":"event/cameraOrbitControls","/COP":"obj/copNetwork","/COP/imageEnv":"cop/imageEXR","/COP/imageUv":"cop/image","/COP/envMap":"cop/envMap","/particles":"obj/geo","/particles/text1":"sop/text","/particles/scatter1":"sop/scatter","/particles/restAttributes1":"sop/restAttributes","/particles/attribCreate1":"sop/attribCreate","/particles/noise1":"sop/noise","/particles/particlesSystemGpu1":"sop/particlesSystemGpu","/particles/MAT":"sop/materialsNetwork","/particles/MAT/pointsParticles":"mat/pointsBuilder","/particles/eventsNetwork1":"sop/eventsNetwork","/particles/eventsNetwork1/raycast1":"event/raycast","/particles/eventsNetwork1/pointer1":"event/pointer"}
Js version
Editor version
Engine version
Logout
0%
There was a problem displaying your scene:
view scene source