particles.tscn 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. [gd_scene load_steps=6 format=2]
  2. [ext_resource path="res://icon.png" type="Texture" id=1]
  3. [sub_resource type="Shader" id=4]
  4. code = "// NOTE: Shader automatically converted from Godot Engine 3.4.4.stable's CanvasItemMaterial.
  5. shader_type canvas_item;
  6. render_mode blend_mix;
  7. uniform float pixmod = 1.0;
  8. float circle(vec2 position, float radius, float feather)
  9. {
  10. return smoothstep(radius, radius + feather, length(position - vec2(0.5)));
  11. }
  12. void fragment(){
  13. float pixelsize = SCREEN_PIXEL_SIZE.x * pixmod;
  14. vec4 COLbuff = COLOR;
  15. COLOR = ( ( 1.0-vec4( circle(UV, 0.2, pixelsize) ) ) - ( 1.0-vec4( circle(UV, 0.2-pixelsize, pixelsize) ) ) ) * COLbuff;
  16. }"
  17. [sub_resource type="ShaderMaterial" id=5]
  18. shader = SubResource( 4 )
  19. shader_param/pixmod = 8.0
  20. [sub_resource type="Curve" id=6]
  21. _data = [ Vector2( 0, 1 ), 0.0, 0.0, 0, 0, Vector2( 1, 0 ), 0.0, 0.0, 0, 0 ]
  22. [sub_resource type="Gradient" id=7]
  23. offsets = PoolRealArray( 0.0730769, 0.457692, 0.980769 )
  24. colors = PoolColorArray( 0.897509, 1, 0.841463, 0.158537, 0.386719, 1, 0.396301, 1, 1, 1, 1, 0 )
  25. [node name="particles" type="CPUParticles2D"]
  26. material = SubResource( 5 )
  27. z_index = -3
  28. amount = 16
  29. lifetime = 1.5
  30. local_coords = false
  31. texture = ExtResource( 1 )
  32. gravity = Vector2( 0, 0 )
  33. scale_amount = 2.0
  34. scale_amount_curve = SubResource( 6 )
  35. color_ramp = SubResource( 7 )