Skip to content

Commit

Permalink
feat: glow terraBladeBeam
Browse files Browse the repository at this point in the history
  • Loading branch information
wlywlywlywly committed Aug 23, 2024
1 parent d602592 commit 6a2c279
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
1 change: 1 addition & 0 deletions project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,4 @@ locale/translations_pot_files=PackedStringArray("res://scenes/multi_game.tscn")
[rendering]

textures/canvas_textures/default_texture_filter=0
viewport/hdr_2d=true
12 changes: 12 additions & 0 deletions scenes/bullets/terra_blade/TerraBladeBeam.gdshader
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
shader_type canvas_item;

void fragment() {
vec4 original_color = texture(TEXTURE, UV);
vec4 color = original_color + original_color + original_color;
COLOR = mix(color, original_color, 1.0 - original_color.a);
}

//void light() {
// Called for every pixel for every light affecting the CanvasItem.
// Uncomment to replace the default light processing function with this one.
//}
14 changes: 13 additions & 1 deletion scenes/bullets/terra_blade/TerraBladeBeam.tscn
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
[gd_scene load_steps=4 format=3 uid="uid://1megnlcsse45"]
[gd_scene load_steps=7 format=3 uid="uid://1megnlcsse45"]

[ext_resource type="Script" path="res://scenes/bullets/terra_blade/terra_blade_beam.gd" id="1_va6li"]
[ext_resource type="Shader" path="res://scenes/bullets/terra_blade/TerraBladeBeam.gdshader" id="2_aqn2b"]
[ext_resource type="Texture2D" uid="uid://co2n6okllm0tl" path="res://scenes/bullets/terra_blade/terra_blade_beam.png" id="2_n1wh2"]

[sub_resource type="ShaderMaterial" id="ShaderMaterial_awmjb"]
shader = ExtResource("2_aqn2b")

[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_1ieue"]
radius = 8.48517
height = 86.9787

[sub_resource type="Environment" id="Environment_jcpgb"]
background_mode = 3
glow_enabled = true

[node name="TerraBladeBeam" type="Area2D"]
position = Vector2(600, 384)
script = ExtResource("1_va6li")
metadata/_edit_group_ = true

[node name="Sprite2D" type="Sprite2D" parent="."]
material = SubResource("ShaderMaterial_awmjb")
rotation = 0.785398
scale = Vector2(1.5, 1.5)
texture = ExtResource("2_n1wh2")
Expand All @@ -23,4 +32,7 @@ shape = SubResource("CapsuleShape2D_1ieue")

[node name="OutScreen" type="VisibleOnScreenNotifier2D" parent="."]

[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = SubResource("Environment_jcpgb")

[connection signal="screen_exited" from="OutScreen" to="." method="_on_out_screen_screen_exited"]

0 comments on commit 6a2c279

Please sign in to comment.