diff --git a/asset/art/gif/c01_孤儿院围墙/frames.tres b/asset/art/gif/c01_孤儿院围墙/frames.tres index 5a4097f4..c0141043 100644 --- a/asset/art/gif/c01_孤儿院围墙/frames.tres +++ b/asset/art/gif/c01_孤儿院围墙/frames.tres @@ -158,12 +158,12 @@ [ext_resource type="Texture2D" uid="uid://cilhlpr4vqjl3" path="res://asset/art/gif/c01_孤儿院围墙/桌椅正常/4.png" id="119_dhwcn"] [ext_resource type="Texture2D" uid="uid://coqjruq7na8xx" path="res://asset/art/gif/c01_孤儿院围墙/桌椅正常/5.png" id="120_sd6qg"] [ext_resource type="Texture2D" uid="uid://dcnpi27by0mf2" path="res://asset/art/gif/c01_孤儿院围墙/桌椅正常/6.png" id="121_nyj10"] -[ext_resource type="Texture2D" uid="uid://dn7ke7k6fa56a" path="res://asset/art/gif/c01_孤儿院围墙/桌椅翻倒/0.png" id="122_3fesm"] -[ext_resource type="Texture2D" uid="uid://bxt0s6yl5u663" path="res://asset/art/gif/c01_孤儿院围墙/桌椅翻倒/1.png" id="123_4ypet"] -[ext_resource type="Texture2D" uid="uid://bvfp6qahl5wf1" path="res://asset/art/gif/c01_孤儿院围墙/桌椅翻倒/2.png" id="124_ajrma"] -[ext_resource type="Texture2D" uid="uid://80d7y4mh7wke" path="res://asset/art/gif/c01_孤儿院围墙/桌椅翻倒/3.png" id="125_j0esh"] -[ext_resource type="Texture2D" uid="uid://bhv5gcebvkmql" path="res://asset/art/gif/c01_孤儿院围墙/桌椅翻倒/4.png" id="126_rcm44"] -[ext_resource type="Texture2D" uid="uid://yyyj4ibmrvhx" path="res://asset/art/gif/c01_孤儿院围墙/桌椅翻倒/5.png" id="127_xhrct"] +[ext_resource type="Texture2D" uid="uid://jnfhjlkact1l" path="res://asset/art/gif/c01_孤儿院围墙/桌椅翻倒/0.png" id="122_3fesm"] +[ext_resource type="Texture2D" uid="uid://d2i34qfbmn6hx" path="res://asset/art/gif/c01_孤儿院围墙/桌椅翻倒/1.png" id="123_4ypet"] +[ext_resource type="Texture2D" uid="uid://ywxfras0u1f1" path="res://asset/art/gif/c01_孤儿院围墙/桌椅翻倒/2.png" id="124_ajrma"] +[ext_resource type="Texture2D" uid="uid://cfooxyqwxhte8" path="res://asset/art/gif/c01_孤儿院围墙/桌椅翻倒/3.png" id="125_j0esh"] +[ext_resource type="Texture2D" uid="uid://et4hhies65uy" path="res://asset/art/gif/c01_孤儿院围墙/桌椅翻倒/4.png" id="126_rcm44"] +[ext_resource type="Texture2D" uid="uid://c43pr71tf8ea" path="res://asset/art/gif/c01_孤儿院围墙/桌椅翻倒/5.png" id="127_xhrct"] [ext_resource type="Texture2D" uid="uid://30e5snyr1o4l" path="res://asset/art/gif/c01_孤儿院围墙/摔倒隐藏小孩.png" id="134_1pcyy"] [resource] diff --git a/asset/art/gif/c01_孤儿院围墙/【桌椅】抖动.gif.import b/asset/art/gif/c01_孤儿院围墙/【桌椅】抖动.gif.import deleted file mode 100644 index 54fc84d7..00000000 --- a/asset/art/gif/c01_孤儿院围墙/【桌椅】抖动.gif.import +++ /dev/null @@ -1,14 +0,0 @@ -[remap] - -importer="gif.animated.texture.plugin" -type="SpriteFrames" -uid="uid://ckiikbnfwvqt3" -path="res://.godot/imported/【桌椅】抖动.gif-4e7000400e31306039b3a172d9208201.tres" - -[deps] - -source_file="res://asset/art/gif/c01_孤儿院围墙/【桌椅】抖动.gif" -dest_files=["res://.godot/imported/【桌椅】抖动.gif-4e7000400e31306039b3a172d9208201.tres"] - -[params] - diff --git a/asset/art/gif/c01_孤儿院围墙/【桌椅】掉落.gif.import b/asset/art/gif/c01_孤儿院围墙/【桌椅】掉落.gif.import deleted file mode 100644 index b7c407eb..00000000 --- a/asset/art/gif/c01_孤儿院围墙/【桌椅】掉落.gif.import +++ /dev/null @@ -1,14 +0,0 @@ -[remap] - -importer="gif.animated.texture.plugin" -type="SpriteFrames" -uid="uid://cnpfd1b6iy5dc" -path="res://.godot/imported/【桌椅】掉落.gif-a563a9f821674b4efce1be8f97ff374e.tres" - -[deps] - -source_file="res://asset/art/gif/c01_孤儿院围墙/【桌椅】掉落.gif" -dest_files=["res://.godot/imported/【桌椅】掉落.gif-a563a9f821674b4efce1be8f97ff374e.tres"] - -[params] - diff --git a/asset/art/gif/c01_孤儿院围墙/桌椅翻倒.gif b/asset/art/gif/c01_孤儿院围墙/桌椅翻倒.gif index ee2f8126..89beb00f 100755 Binary files a/asset/art/gif/c01_孤儿院围墙/桌椅翻倒.gif and b/asset/art/gif/c01_孤儿院围墙/桌椅翻倒.gif differ diff --git a/asset/art/gif/c01_孤儿院围墙/桌椅翻倒/0.png b/asset/art/gif/c01_孤儿院围墙/桌椅翻倒/0.png index 5e02b467..1a8505c4 100644 Binary files a/asset/art/gif/c01_孤儿院围墙/桌椅翻倒/0.png and b/asset/art/gif/c01_孤儿院围墙/桌椅翻倒/0.png differ diff --git a/asset/art/gif/c01_孤儿院围墙/桌椅翻倒/0.png.import b/asset/art/gif/c01_孤儿院围墙/桌椅翻倒/0.png.import index 5fa86dfb..17f8e1e3 100644 --- a/asset/art/gif/c01_孤儿院围墙/桌椅翻倒/0.png.import +++ b/asset/art/gif/c01_孤儿院围墙/桌椅翻倒/0.png.import @@ -2,7 +2,7 @@ importer="texture" type="CompressedTexture2D" -uid="uid://dn7ke7k6fa56a" +uid="uid://jnfhjlkact1l" path="res://.godot/imported/0.png-58a28801e924c44e2181115a1c21f09c.ctex" metadata={ "vram_texture": false diff --git a/asset/art/gif/c01_孤儿院围墙/桌椅翻倒/1.png b/asset/art/gif/c01_孤儿院围墙/桌椅翻倒/1.png index 693514fb..2e409a93 100644 Binary files a/asset/art/gif/c01_孤儿院围墙/桌椅翻倒/1.png and b/asset/art/gif/c01_孤儿院围墙/桌椅翻倒/1.png differ diff --git a/asset/art/gif/c01_孤儿院围墙/桌椅翻倒/1.png.import b/asset/art/gif/c01_孤儿院围墙/桌椅翻倒/1.png.import index 39ede4c0..8432b1e0 100644 --- a/asset/art/gif/c01_孤儿院围墙/桌椅翻倒/1.png.import +++ b/asset/art/gif/c01_孤儿院围墙/桌椅翻倒/1.png.import @@ -2,7 +2,7 @@ importer="texture" type="CompressedTexture2D" -uid="uid://bxt0s6yl5u663" +uid="uid://d2i34qfbmn6hx" path="res://.godot/imported/1.png-cf42cd74ae52ca67f68d4a8dfa155e93.ctex" metadata={ "vram_texture": false diff --git a/asset/art/gif/c01_孤儿院围墙/桌椅翻倒/2.png b/asset/art/gif/c01_孤儿院围墙/桌椅翻倒/2.png index a1d8b3b4..e491bfe8 100644 Binary files a/asset/art/gif/c01_孤儿院围墙/桌椅翻倒/2.png and b/asset/art/gif/c01_孤儿院围墙/桌椅翻倒/2.png differ diff --git a/asset/art/gif/c01_孤儿院围墙/桌椅翻倒/2.png.import b/asset/art/gif/c01_孤儿院围墙/桌椅翻倒/2.png.import index fb961d74..f4ff62e2 100644 --- a/asset/art/gif/c01_孤儿院围墙/桌椅翻倒/2.png.import +++ b/asset/art/gif/c01_孤儿院围墙/桌椅翻倒/2.png.import @@ -2,7 +2,7 @@ importer="texture" type="CompressedTexture2D" -uid="uid://bvfp6qahl5wf1" +uid="uid://ywxfras0u1f1" path="res://.godot/imported/2.png-12ebb48715ea5ba7869f08319659b248.ctex" metadata={ "vram_texture": false diff --git a/asset/art/gif/c01_孤儿院围墙/桌椅翻倒/3.png b/asset/art/gif/c01_孤儿院围墙/桌椅翻倒/3.png index 95cb38e8..083a65b6 100644 Binary files a/asset/art/gif/c01_孤儿院围墙/桌椅翻倒/3.png and b/asset/art/gif/c01_孤儿院围墙/桌椅翻倒/3.png differ diff --git a/asset/art/gif/c01_孤儿院围墙/桌椅翻倒/3.png.import b/asset/art/gif/c01_孤儿院围墙/桌椅翻倒/3.png.import index 7ef79ca1..97a008b1 100644 --- a/asset/art/gif/c01_孤儿院围墙/桌椅翻倒/3.png.import +++ b/asset/art/gif/c01_孤儿院围墙/桌椅翻倒/3.png.import @@ -2,7 +2,7 @@ importer="texture" type="CompressedTexture2D" -uid="uid://80d7y4mh7wke" +uid="uid://cfooxyqwxhte8" path="res://.godot/imported/3.png-bf8ba387c58d38fdd0073f5f65ae13e2.ctex" metadata={ "vram_texture": false diff --git a/asset/art/gif/c01_孤儿院围墙/桌椅翻倒/4.png b/asset/art/gif/c01_孤儿院围墙/桌椅翻倒/4.png index 8aa7dfbd..70c2ae87 100644 Binary files a/asset/art/gif/c01_孤儿院围墙/桌椅翻倒/4.png and b/asset/art/gif/c01_孤儿院围墙/桌椅翻倒/4.png differ diff --git a/asset/art/gif/c01_孤儿院围墙/桌椅翻倒/4.png.import b/asset/art/gif/c01_孤儿院围墙/桌椅翻倒/4.png.import index d3b944d0..d5a90231 100644 --- a/asset/art/gif/c01_孤儿院围墙/桌椅翻倒/4.png.import +++ b/asset/art/gif/c01_孤儿院围墙/桌椅翻倒/4.png.import @@ -2,7 +2,7 @@ importer="texture" type="CompressedTexture2D" -uid="uid://bhv5gcebvkmql" +uid="uid://et4hhies65uy" path="res://.godot/imported/4.png-7b6d3d1da36af1d00e3114b12876215a.ctex" metadata={ "vram_texture": false diff --git a/asset/art/gif/c01_孤儿院围墙/桌椅翻倒/5.png b/asset/art/gif/c01_孤儿院围墙/桌椅翻倒/5.png index b88e07e8..7a5884f1 100644 Binary files a/asset/art/gif/c01_孤儿院围墙/桌椅翻倒/5.png and b/asset/art/gif/c01_孤儿院围墙/桌椅翻倒/5.png differ diff --git a/asset/art/gif/c01_孤儿院围墙/桌椅翻倒/5.png.import b/asset/art/gif/c01_孤儿院围墙/桌椅翻倒/5.png.import index dce2cae1..779a02b7 100644 --- a/asset/art/gif/c01_孤儿院围墙/桌椅翻倒/5.png.import +++ b/asset/art/gif/c01_孤儿院围墙/桌椅翻倒/5.png.import @@ -2,7 +2,7 @@ importer="texture" type="CompressedTexture2D" -uid="uid://yyyj4ibmrvhx" +uid="uid://c43pr71tf8ea" path="res://.godot/imported/5.png-405617bd4aa342c8bed5d1257cd55ac6.ctex" metadata={ "vram_texture": false diff --git a/asset/art/gif/c01_孤儿院长廊/fg_花圃.gif b/asset/art/gif/c01_孤儿院长廊/fg_花圃.gif deleted file mode 100644 index 55d3d47c..00000000 Binary files a/asset/art/gif/c01_孤儿院长廊/fg_花圃.gif and /dev/null differ diff --git a/asset/art/gif/c01_孤儿院长廊/fg_花圃.gif.import b/asset/art/gif/c01_孤儿院长廊/fg_花圃.gif.import deleted file mode 100644 index 7016aba3..00000000 --- a/asset/art/gif/c01_孤儿院长廊/fg_花圃.gif.import +++ /dev/null @@ -1,14 +0,0 @@ -[remap] - -importer="gif.animated.texture.plugin" -type="SpriteFrames" -uid="uid://bx3c8r31cvo8n" -path="res://.godot/imported/fg_花圃.gif-8e47e904a5d6d15fcb774edb0eb2cf9e.tres" - -[deps] - -source_file="res://asset/art/gif/c01_孤儿院长廊/fg_花圃.gif" -dest_files=["res://.godot/imported/fg_花圃.gif-8e47e904a5d6d15fcb774edb0eb2cf9e.tres"] - -[params] - diff --git a/asset/art/gif/c01_孤儿院长廊/fg_花圃/0.png b/asset/art/gif/c01_孤儿院长廊/fg_花圃/0.png deleted file mode 100644 index 4e02f341..00000000 Binary files a/asset/art/gif/c01_孤儿院长廊/fg_花圃/0.png and /dev/null differ diff --git a/asset/art/gif/c01_孤儿院长廊/fg_花圃/1.png b/asset/art/gif/c01_孤儿院长廊/fg_花圃/1.png deleted file mode 100644 index f0377d90..00000000 Binary files a/asset/art/gif/c01_孤儿院长廊/fg_花圃/1.png and /dev/null differ diff --git a/asset/art/gif/c01_孤儿院长廊/frames.tres b/asset/art/gif/c01_孤儿院长廊/frames.tres index a809e720..df2237ef 100644 --- a/asset/art/gif/c01_孤儿院长廊/frames.tres +++ b/asset/art/gif/c01_孤儿院长廊/frames.tres @@ -1,7 +1,5 @@ -[gd_resource type="SpriteFrames" load_steps=74 format=3 uid="uid://cc0ea1he2nfc2"] +[gd_resource type="SpriteFrames" load_steps=72 format=3 uid="uid://cc0ea1he2nfc2"] -[ext_resource type="Texture2D" uid="uid://b1fc664q3a6uc" path="res://asset/art/gif/c01_孤儿院长廊/fg_花圃/0.png" id="1_p7b7k"] -[ext_resource type="Texture2D" uid="uid://p38d24qbqiw8" path="res://asset/art/gif/c01_孤儿院长廊/fg_花圃/1.png" id="2_gs1di"] [ext_resource type="Texture2D" uid="uid://deebi18wyq1wj" path="res://asset/art/gif/c01_孤儿院长廊/中蓝衣小孩呼吸/0.png" id="3_17qjt"] [ext_resource type="Texture2D" uid="uid://d3lbtcx6p8acv" path="res://asset/art/gif/c01_孤儿院长廊/中蓝衣小孩呼吸/1.png" id="4_8o0lb"] [ext_resource type="Texture2D" uid="uid://chcpy0ijod33k" path="res://asset/art/gif/c01_孤儿院长廊/中蓝衣小孩呼吸/2.png" id="5_8k42r"] @@ -77,17 +75,6 @@ [resource] animations = [{ "frames": [{ -"duration": 15.0, -"texture": ExtResource("1_p7b7k") -}, { -"duration": 15.0, -"texture": ExtResource("2_gs1di") -}], -"loop": true, -"name": &"fg_花圃", -"speed": 30.0 -}, { -"frames": [{ "duration": 6.0, "texture": ExtResource("3_17qjt") }, { diff --git a/asset/art/scene/c01/s06_孤儿院长廊围墙/bg_院子长背景.png b/asset/art/scene/c01/s06_孤儿院长廊围墙/bg_院子长背景.png index a5c191c5..5c2cd198 100755 Binary files a/asset/art/scene/c01/s06_孤儿院长廊围墙/bg_院子长背景.png and b/asset/art/scene/c01/s06_孤儿院长廊围墙/bg_院子长背景.png differ diff --git a/asset/art/scene/c01/s06_孤儿院长廊围墙/fg_花圃.gif b/asset/art/scene/c01/s06_孤儿院长廊围墙/fg_花圃.gif index 55d3d47c..ba6efca6 100755 Binary files a/asset/art/scene/c01/s06_孤儿院长廊围墙/fg_花圃.gif and b/asset/art/scene/c01/s06_孤儿院长廊围墙/fg_花圃.gif differ diff --git a/asset/art/scene/c01/s06_孤儿院长廊围墙/fog_mask.png b/asset/art/scene/c01/s06_孤儿院长廊围墙/fog_mask.png new file mode 100644 index 00000000..3cf683bf Binary files /dev/null and b/asset/art/scene/c01/s06_孤儿院长廊围墙/fog_mask.png differ diff --git a/asset/art/gif/c01_孤儿院长廊/fg_花圃/0.png.import b/asset/art/scene/c01/s06_孤儿院长廊围墙/fog_mask.png.import similarity index 66% rename from asset/art/gif/c01_孤儿院长廊/fg_花圃/0.png.import rename to asset/art/scene/c01/s06_孤儿院长廊围墙/fog_mask.png.import index 9549cd13..c883410b 100644 --- a/asset/art/gif/c01_孤儿院长廊/fg_花圃/0.png.import +++ b/asset/art/scene/c01/s06_孤儿院长廊围墙/fog_mask.png.import @@ -2,16 +2,16 @@ importer="texture" type="CompressedTexture2D" -uid="uid://b1fc664q3a6uc" -path="res://.godot/imported/0.png-9b63a554440389d99780ccb5f68869a7.ctex" +uid="uid://c0ntr31be3s3y" +path="res://.godot/imported/fog_mask.png-1158c1c09f95d40f038e4ae1896d4849.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://asset/art/gif/c01_孤儿院长廊/fg_花圃/0.png" -dest_files=["res://.godot/imported/0.png-9b63a554440389d99780ccb5f68869a7.ctex"] +source_file="res://asset/art/scene/c01/s06_孤儿院长廊围墙/fog_mask.png" +dest_files=["res://.godot/imported/fog_mask.png-1158c1c09f95d40f038e4ae1896d4849.ctex"] [params] diff --git a/asset/art/scene/c01/s06_孤儿院长廊围墙/l_长廊光.png b/asset/art/scene/c01/s06_孤儿院长廊围墙/l_长廊光.png index c7409c45..6f33fb9a 100755 Binary files a/asset/art/scene/c01/s06_孤儿院长廊围墙/l_长廊光.png and b/asset/art/scene/c01/s06_孤儿院长廊围墙/l_长廊光.png differ diff --git a/asset/art/scene/c01/s06_孤儿院长廊围墙/【桌椅】 上层遮挡部分.png b/asset/art/scene/c01/s06_孤儿院长廊围墙/【桌椅】 上层遮挡部分.png new file mode 100755 index 00000000..418efa34 Binary files /dev/null and b/asset/art/scene/c01/s06_孤儿院长廊围墙/【桌椅】 上层遮挡部分.png differ diff --git a/asset/art/gif/c01_孤儿院长廊/fg_花圃/1.png.import b/asset/art/scene/c01/s06_孤儿院长廊围墙/【桌椅】 上层遮挡部分.png.import similarity index 60% rename from asset/art/gif/c01_孤儿院长廊/fg_花圃/1.png.import rename to asset/art/scene/c01/s06_孤儿院长廊围墙/【桌椅】 上层遮挡部分.png.import index 2baa8d49..e2c62b17 100644 --- a/asset/art/gif/c01_孤儿院长廊/fg_花圃/1.png.import +++ b/asset/art/scene/c01/s06_孤儿院长廊围墙/【桌椅】 上层遮挡部分.png.import @@ -2,16 +2,16 @@ importer="texture" type="CompressedTexture2D" -uid="uid://p38d24qbqiw8" -path="res://.godot/imported/1.png-03964e8fef09e95a495106256b392161.ctex" +uid="uid://f6xl83h8g5mo" +path="res://.godot/imported/【桌椅】 上层遮挡部分.png-fe8523e1a03d3d529198c743a2cc92ca.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://asset/art/gif/c01_孤儿院长廊/fg_花圃/1.png" -dest_files=["res://.godot/imported/1.png-03964e8fef09e95a495106256b392161.ctex"] +source_file="res://asset/art/scene/c01/s06_孤儿院长廊围墙/【桌椅】 上层遮挡部分.png" +dest_files=["res://.godot/imported/【桌椅】 上层遮挡部分.png-fe8523e1a03d3d529198c743a2cc92ca.ctex"] [params] diff --git a/asset/art/tool/fog_mask_generator.gd b/asset/art/tool/fog_mask_generator.gd new file mode 100644 index 00000000..b3e9bf5a --- /dev/null +++ b/asset/art/tool/fog_mask_generator.gd @@ -0,0 +1,29 @@ +extends Sprite2D + +@export var export_path := "" +@export var height := 300 +@export var l_ease_in_x := 500.0 +@export var mid := 1000.0 +@export var r_ease_out_x := 500.0 + + +func _ready() -> void: + if export_path: + var width := (l_ease_in_x + mid + r_ease_out_x) as int + var image = Image.create_empty(width, height, false, Image.FORMAT_RGBA8) + # convert to transparent BG point light image + for y in range(height): + for x in range(width): + var color = Color(1.0, 1.0, 1.0, 1.0) + if x < l_ease_in_x: + # color.a = smoothstep(0.0, 1.0, x / l_ease_in_x) + color.a = x / l_ease_in_x + elif x > l_ease_in_x + mid: + # color.a = smoothstep(1.0, 0.0, (x - l_ease_in_x - mid) / r_ease_out_x) + color.a = 1.0 - (x - l_ease_in_x - mid) / r_ease_out_x + image.set_pixel(x, y, color) + image.save_png(export_path) + texture = ImageTexture.create_from_image(image) + print("Exported to: " + export_path) + else: + print("No export path found") diff --git a/asset/art/tool/fog_mask_generator.tscn b/asset/art/tool/fog_mask_generator.tscn new file mode 100644 index 00000000..46624de0 --- /dev/null +++ b/asset/art/tool/fog_mask_generator.tscn @@ -0,0 +1,14 @@ +[gd_scene load_steps=3 format=3 uid="uid://rf5i1eqpefj4"] + +[ext_resource type="Script" path="res://asset/art/tool/fog_mask_generator.gd" id="1_48e0h"] +[ext_resource type="Texture2D" uid="uid://c0ntr31be3s3y" path="res://asset/art/scene/c01/s06_孤儿院长廊围墙/fog_mask.png" id="1_t82x4"] + +[node name="MaskGenerator" type="Sprite2D"] +position = Vector2(294, 145) +scale = Vector2(0.2, 0.2) +texture = ExtResource("1_t82x4") +script = ExtResource("1_48e0h") +export_path = "res://asset/art/scene/c01/s06_孤儿院长廊围墙/fog_mask.png" +l_ease_in_x = 1200.0 +mid = 350.0 +r_ease_out_x = 550.0 diff --git a/asset/shader/fog.gdshader b/asset/shader/fog.gdshader index bec467a7..69660413 100644 --- a/asset/shader/fog.gdshader +++ b/asset/shader/fog.gdshader @@ -1,20 +1,18 @@ +// fog.shader 构造 fog 效果 +// noise 为配置好的噪音取样纹理 +// texture 为蒙版 mask,用于控制雾气浓度 shader_type canvas_item; - uniform sampler2D noise: repeat_enable; -//uniform vec4 base_color : source_color; -//uniform float location_fade; void fragment() { - //vec3 fog_color_1 = texture(TEXTURE, vec2(UV.x * 0.5 + TIME * 0.006, UV.y * 0.25 - TIME * 0.01)).rgb; - //vec3 fog_color_2 = texture(TEXTURE, vec2(UV.x * 0.5 + 0.5 + TIME * 0.010, UV.y * 0.25 + 0.5 - TIME / 160.0)).rgb; - //vec3 fog_color_3 = texture(TEXTURE, vec2(UV.x * 0.5 + 0.25 + TIME * 0.024, UV.y * 0.25 - 0.25 - TIME / 160.0)).rgb; - //vec3 fog_color = mix(fog_color_3, mix(fog_color_1, fog_color_2, 0.5), 0.7); float fog_alpha_1 = texture(noise, vec2(UV.x / 2.0 + TIME /100.0, UV.y / 4.0 - TIME / 100.0)).r; float fog_alpha_2 = texture(noise, vec2(UV.x / 2.0 + 0.5 + TIME /50.0, UV.y / 4.0 + 0.5 - TIME / 160.0)).r; float fog_alpha_3 = texture(noise, vec2(UV.x / 2.0 + 0.25 + TIME /25.0, UV.y / 4.0 - 0.25 - TIME / 160.0)).r; float fog_alpha = mix(fog_alpha_3, mix(fog_alpha_1, fog_alpha_2, 0.5), 0.7); - COLOR.a *= fog_alpha * 1.5; - //COLOR.rgb = base_color.rgb; - //COLOR.rgb = fog_color * base_color.rgb; - //COLOR.rgb *= location_fade; + // COLOR.a 越接近 1.0, factor 越接近 1.0;COLOR.a 越接近 0.0, factor 越接近 0.0 + float factor = pow(COLOR.a, 2); + float strength = smoothstep(.0, .2, COLOR.a); + // factor 越靠近 1, fog_alpha 也靠近 1; factor 越靠近 0.,fog_alpha 越靠近自己 + //COLOR.a = mix(fog_alpha, 1., factor); + COLOR.a = mix(fog_alpha, 1., factor) * strength; } \ No newline at end of file diff --git a/project.godot b/project.godot index bef2fc38..792df5d9 100644 --- a/project.godot +++ b/project.godot @@ -175,6 +175,10 @@ locale/fallback="zh" [layer_names] +2d_render/layer_1="default" +2d_render/layer_2="场景人物" +2d_render/layer_3="场景物体" +2d_render/layer_4="玩家角色" 2d_physics/layer_1="player" 2d_physics/layer_2="wall" 2d_physics/layer_3="interactable" diff --git a/scene/ground/ground_loader.gd b/scene/ground/ground_loader.gd index cf18cbbc..babce121 100644 --- a/scene/ground/ground_loader.gd +++ b/scene/ground/ground_loader.gd @@ -96,10 +96,10 @@ func transition_to_scene(scene_name: String, portal: String, immediately: bool) if not immediately: # 转场效果,在 _load_ground_node 之前播放 var tween = _toggle_mask(true) - tween.tween_callback(_do_transition.bind(scene_name)) + tween.tween_callback(call_deferred.bind("_do_transition", scene_name)) tween.tween_callback(_toggle_mask.bind(false)) else: - _do_transition(scene_name) + call_deferred("_do_transition", scene_name) else: print("Scene not found: " + scene_name) @@ -114,8 +114,7 @@ func _do_transition(scene_name: String): ground = get_node_or_null("Ground") as Ground2D if ground: # 防止命名冲突 - ground.name = "removed_ground" - call_deferred("remove_child", ground) + remove_child(ground) ground.queue_free() # 先设置 ground,再添加到场景中 # 因为 ground 在 enter_tree 时会用到 SceneManager 的方法 diff --git a/scene/ground/scene/c01/s06_animation.gd b/scene/ground/scene/c01/s06_animation.gd index ad06b069..36def7b3 100644 --- a/scene/ground/scene/c01/s06_animation.gd +++ b/scene/ground/scene/c01/s06_animation.gd @@ -46,6 +46,7 @@ func _on_ground_ready() -> void: standing_kid3 = $"../DeployLayer/【站立小孩-3】" game_kid = $"../DeployLayer/【胖小孩背着残疾小孩】" obstacles = $"../DeployLayer/游戏中途桌椅" + obstacles.get_node("z7").visible = false interactable_obstacles = $"../DeployLayer/Interactable桌椅" interactable_obstacles.interacted.connect(_on_push_obstacles) cat_rat_game_fail_ambush = $"../DeployLayer/【胖小孩背着残疾小孩】/【单残疾小孩】/猫鼠游戏失败ambush" @@ -102,7 +103,7 @@ func _game_counting_down(_res = null): get_tree().create_timer(2.5).timeout.connect(_kids_start_run) cat.visible = true cat.play("【墙上黑猫】跑步") - SceneManager.get_shading_layer().show_default_fog(10.0) + # SceneManager.get_shading_layer().show_default_fog(10.0) func _kids_start_run(): @@ -152,6 +153,7 @@ func _on_cat_rat_game_obstacles_triggered(): func _on_kid_fall_finished(): + obstacles.get_node("z7").visible = true game_kid_limp.modulate.a = 1 game_kid.play("【胖小孩背着残疾小孩】胖子独自呼吸") game_kid_limp.play("【单残疾小孩】爬行") @@ -233,13 +235,13 @@ func transport_player_to_next_scene(win: bool): _show_next_scene(true) SceneManager.pop_debug_dialog_info("音效", "猫鼠游戏胜利,无缝转场") else: - SceneManager.get_shading_layer().tween_fog( - ShadingLayer.FOG_FRAME_MAX, - ShadingLayer.FOG_COLOR_BLACK, - ShadingLayer.FOG_OFFSET_DEFAULT, - 1.0, - true - ) + # SceneManager.get_shading_layer().tween_fog( + # ShadingLayer.FOG_FRAME_MAX, + # ShadingLayer.FOG_COLOR_BLACK, + # ShadingLayer.FOG_OFFSET_DEFAULT, + # 1.0, + # true + # ) get_tree().create_timer(0.7).timeout.connect(_show_next_scene.bind(false)) SceneManager.pop_debug_dialog_info("音效", "猫鼠游戏失败,传送下一场景") diff --git a/scene/ground/scene/c01/s06_孤儿院长廊围墙.tscn b/scene/ground/scene/c01/s06_孤儿院长廊围墙.tscn index 2010aa8a..6288b59d 100644 --- a/scene/ground/scene/c01/s06_孤儿院长廊围墙.tscn +++ b/scene/ground/scene/c01/s06_孤儿院长廊围墙.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=23 format=3 uid="uid://bx16c8nn32f40"] +[gd_scene load_steps=32 format=3 uid="uid://bx16c8nn32f40"] [ext_resource type="PackedScene" uid="uid://dayyx4jerj7io" path="res://scene/ground/ground.tscn" id="1_bitx7"] [ext_resource type="Script" path="res://scene/ground/scene/c01/s06_animation.gd" id="2_fkfhi"] @@ -6,15 +6,20 @@ [ext_resource type="Texture2D" uid="uid://bptk6i6rnolir" path="res://asset/art/scene/c01/s06_孤儿院长廊围墙/bg_院子长背景.png" id="2_ow3ya"] [ext_resource type="Texture2D" uid="uid://h536hwonbrut" path="res://asset/art/scene/c01/s06_孤儿院长廊围墙/e_院长周围凳子.png" id="3_su6aw"] [ext_resource type="Texture2D" uid="uid://c40gmvqw3vd88" path="res://asset/art/scene/c01/s06_孤儿院长廊围墙/l_长廊光.png" id="4_6ffae"] -[ext_resource type="SpriteFrames" uid="uid://cemn2bnebsfko" path="res://asset/art/scene/c01/s06_孤儿院长廊围墙/全局参考.gif" id="4_8hecq"] [ext_resource type="Texture2D" uid="uid://bllt2wycchkp2" path="res://asset/art/scene/c01/s06_孤儿院长廊围墙/e_红柱子.png" id="4_dtycx"] [ext_resource type="PackedScene" uid="uid://cpc5037mesjl7" path="res://scene/ground/script/c01/s06_踢球男孩.tscn" id="5_erliv"] [ext_resource type="SpriteFrames" uid="uid://c6okvaeemoodq" path="res://asset/art/gif/c01_孤儿院围墙/frames.tres" id="7_dsj2r"] [ext_resource type="PackedScene" uid="uid://b50n0hvs4yh75" path="res://addons/property-inspector/pro_animation_sprite2d/pro_animated_sprite.tscn" id="8_ouldg"] [ext_resource type="PackedScene" uid="uid://cyobva6ppmapr" path="res://scene/entity/general/sfx2d.tscn" id="10_brjgh"] +[ext_resource type="Texture2D" uid="uid://f6xl83h8g5mo" path="res://asset/art/scene/c01/s06_孤儿院长廊围墙/【桌椅】 上层遮挡部分.png" id="11_q3ypm"] [ext_resource type="PackedScene" uid="uid://bnf3lkcbpx1ar" path="res://scene/entity/ambush.tscn" id="11_tudob"] [ext_resource type="PackedScene" uid="uid://jr1yd46wm5je" path="res://scene/entity/note.tscn" id="12_28t76"] [ext_resource type="PackedScene" uid="uid://cw3q5pvciumil" path="res://scene/entity/interactable.tscn" id="12_idjp0"] +[ext_resource type="PackedScene" uid="uid://bicuc35kbn8hd" path="res://scene/shading/fog.tscn" id="14_d5def"] +[ext_resource type="Shader" path="res://asset/shader/fog.gdshader" id="15_22a7a"] +[ext_resource type="Texture2D" uid="uid://b7gyapghy3tsy" path="res://asset/art/neutral_point_light.png" id="15_q7j0p"] +[ext_resource type="SpriteFrames" uid="uid://o5poucsu57l7" path="res://asset/art/scene/c01/s06_孤儿院长廊围墙/fg_花圃.gif" id="15_wtosl"] +[ext_resource type="Texture2D" uid="uid://c0ntr31be3s3y" path="res://asset/art/scene/c01/s06_孤儿院长廊围墙/fog_mask.png" id="15_xque7"] [sub_resource type="Animation" id="Animation_723yg"] length = 0.001 @@ -72,6 +77,33 @@ size = Vector2(20, 50) resource_local_to_scene = true size = Vector2(30, 70) +[sub_resource type="FastNoiseLite" id="FastNoiseLite_jw18h"] +noise_type = 2 +fractal_type = 2 + +[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_qmfti"] +width = 800 +height = 800 +seamless = true +seamless_blend_skirt = 0.25 +noise = SubResource("FastNoiseLite_jw18h") + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_xf6rb"] +resource_local_to_scene = true +shader = ExtResource("15_22a7a") +shader_parameter/noise = SubResource("NoiseTexture2D_qmfti") + +[sub_resource type="SpriteFrames" id="SpriteFrames_vduqs"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": ExtResource("15_xque7") +}], +"loop": false, +"name": &"default", +"speed": 5.0 +}] + [node name="S06" type="Node2D"] metadata/_edit_horizontal_guides_ = [158.0, 91.0] @@ -198,6 +230,12 @@ action_configs = Array[Dictionary]([{ "animation_next": "桌椅翻倒" }]) +[node name="z7" type="Sprite2D" parent="Ground/DeployLayer/游戏中途桌椅"] +visible = false +z_index = 7 +position = Vector2(-60, 117) +texture = ExtResource("11_q3ypm") + [node name="Interactable桌椅" parent="Ground/DeployLayer" index="10" instance=ExtResource("12_idjp0")] position = Vector2(2135, 49) @@ -344,7 +382,7 @@ action_configs = Array[Dictionary]([{ "animation_next": "【墙上小孩猫影子】猫影跑步", "animation_wait_time": 1.0 }]) -light_energy = -0.05 +light_energy = -0.2 [node name="中途Trigger" type="Area2D" parent="Ground/DeployLayer/【胖小孩背着残疾小孩】/【单残疾小孩】"] position = Vector2(29, 12) @@ -380,7 +418,8 @@ texture = ExtResource("4_6ffae") offset = Vector2(601.5, -0.5) [node name="MainPlayer" parent="Ground" index="5"] -position = Vector2(1775, 91) +modulate = Color(0.931897, 0.931897, 0.931897, 1) +position = Vector2(1575, 91) character = "小小蝶" [node name="院长凳子" type="Sprite2D" parent="Ground/ParallaxForeground/BGParallaxLayer" index="0"] @@ -406,6 +445,7 @@ sprite_frames = ExtResource("2_l4axy") animation = &"右绿衣男孩呼吸" [node name="门口_红衣姑娘" parent="Ground/ParallaxForeground/BGParallaxLayer" index="4" instance=ExtResource("8_ouldg")] +light_mask = 2 position = Vector2(333, 9.5) sprite_frames = ExtResource("2_l4axy") animation = &"红衣姑娘呼吸" @@ -414,6 +454,15 @@ action_configs = Array[Dictionary]([{ "animation_next": "红衣姑娘呼吸" }]) +[node name="PointLight2D" type="PointLight2D" parent="Ground/ParallaxForeground/BGParallaxLayer/门口_红衣姑娘"] +position = Vector2(10, 63.5) +energy = 0.35 +range_layer_min = 2 +range_layer_max = 2 +range_item_cull_mask = 2 +texture = ExtResource("15_q7j0p") +texture_scale = 0.5 + [node name="门口_院长" parent="Ground/ParallaxForeground/BGParallaxLayer" index="5" instance=ExtResource("8_ouldg")] position = Vector2(301, 8.5) sprite_frames = ExtResource("2_l4axy") @@ -437,6 +486,14 @@ sprite_frames = ExtResource("2_l4axy") animation = &"左一绿衣男呼吸" flip_h = true +[node name="Fog" parent="Ground/ParallaxForeground/BGParallaxLayer" index="8" instance=ExtResource("14_d5def")] +z_index = 5 +material = SubResource("ShaderMaterial_xf6rb") +position = Vector2(3003, -51) +sprite_frames = SubResource("SpriteFrames_vduqs") +animation = &"default" +frame = 0 + [node name="FGSprite2D" parent="Ground/ParallaxForeground/FGParallaxLayer" index="0"] visible = false texture = null @@ -444,8 +501,9 @@ texture = null [node name="动态前景" parent="Ground/ParallaxForeground/FGParallaxLayer" index="1" instance=ExtResource("8_ouldg")] position = Vector2(7.10543e-15, 23) scale = Vector2(0.8, 0.8) -sprite_frames = ExtResource("2_l4axy") -animation = &"fg_花圃" +sprite_frames = ExtResource("15_wtosl") +animation = &"gif" +autoplay = "gif" centered = false offset = Vector2(0, -159) @@ -455,15 +513,6 @@ points = PackedVector2Array(37, 150, 3200, 150) [node name="DirectionalLight2D" parent="Ground" index="9"] visible = false -[node name="参考" type="AnimatedSprite2D" parent="Ground"] -visible = false -modulate = Color(1, 1, 1, 0.384314) -sprite_frames = ExtResource("4_8hecq") -animation = &"gif" -autoplay = "gif" -centered = false -offset = Vector2(0, -159) - [editable path="Ground"] [editable path="Ground/DeployLayer/Interactable桌椅"] [editable path="Ground/DeployLayer/Interactable桌椅/Sign"] diff --git a/scene/main.tscn b/scene/main.tscn index 8fcd933f..3052b7b7 100644 --- a/scene/main.tscn +++ b/scene/main.tscn @@ -22,6 +22,7 @@ current_scene = "c01_s05" entrance_portal = "right" [node name="ShadingLayer" parent="." instance=ExtResource("2_d1re1")] +fog_modulate = Color(0.8, 0.8, 0.8, 0.8) [node name="PropInspector" parent="." instance=ExtResource("5_ux0rw")] unique_name_in_owner = true diff --git a/scene/player/main_player.tscn b/scene/player/main_player.tscn index a1514c64..f4b4300c 100644 --- a/scene/player/main_player.tscn +++ b/scene/player/main_player.tscn @@ -93,6 +93,7 @@ seconds_per_pause_step = 0.15 [node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] unique_name_in_owner = true +light_mask = 9 scale = Vector2(0.6, 0.6) sprite_frames = ExtResource("2_3w63u") animation = &"c00_吕萍_idle_right" diff --git a/scene/shading/fog.gd b/scene/shading/fog.gd new file mode 100644 index 00000000..cc74b5e8 --- /dev/null +++ b/scene/shading/fog.gd @@ -0,0 +1,50 @@ +extends AnimatedSprite2D + +const FOG_COLOR_DEFAULT = Color(0.8, 0.8, 0.8, 0.8) +const FOG_COLOR_WHITE = Color(1, 1, 1, 1) +const FOG_COLOR_BLACK = Color(0, 0, 0, 1) +const FOG_COLOR_GRAY = Color(0.5, 0.5, 0.5, 1) +const FOG_COLOR_DARK_GRAY = Color(0.2, 0.2, 0.2, 1) + +var FOG_FRAME_MIN = 0 +var FOG_FRAME_MAX +var FOG_FRAME_DEFAULT + +const FOG_OFFSET_DEFAULT = Vector2(0, 50) + + +func _ready() -> void: + FOG_FRAME_MAX = sprite_frames.get_frame_count(animation) - 1 + FOG_FRAME_DEFAULT = FOG_FRAME_MAX + + +var _fog_tween: Tween + + +func tween_fog( + end_frame := frame, + end_modulate := modulate, + end_offset := offset, + duration := 0.8, + close_at_end := false +) -> void: + if not is_node_ready(): + return + if GlobalConfig.DEBUG: + print( + "Tween fog to frame: ", end_frame, " modulate: ", end_modulate, " offset: ", end_offset + ) + if not visible: + # 如果没有开启 fog,先开启,并且设置为透明 + visible = true + modulate = Color.TRANSPARENT + if _fog_tween and _fog_tween.is_valid(): + _fog_tween.kill() + _fog_tween = create_tween() + _fog_tween.tween_property(self, "frame", end_frame, duration) + if end_modulate != modulate: + _fog_tween.parallel().tween_property(self, "self_modulate", end_modulate, duration) + if end_offset != offset: + _fog_tween.parallel().tween_property(self, "offset", end_offset, duration) + if close_at_end: + _fog_tween.tween_callback(hide) diff --git a/scene/shading/fog.tscn b/scene/shading/fog.tscn new file mode 100644 index 00000000..7b691e03 --- /dev/null +++ b/scene/shading/fog.tscn @@ -0,0 +1,136 @@ +[gd_scene load_steps=31 format=3 uid="uid://bicuc35kbn8hd"] + +[ext_resource type="Shader" path="res://asset/shader/fog.gdshader" id="1_b8eb0"] +[ext_resource type="Texture2D" uid="uid://bmlhwa80lywa3" path="res://asset/art/ui/inverted_point_light_masks/000.png" id="2_04yrb"] +[ext_resource type="Texture2D" uid="uid://42trxuhnubhw" path="res://asset/art/ui/inverted_point_light_masks/001.png" id="3_0bm30"] +[ext_resource type="Texture2D" uid="uid://cadj4kbscfani" path="res://asset/art/ui/inverted_point_light_masks/002.png" id="4_01roq"] +[ext_resource type="Texture2D" uid="uid://3sml8l5k0wpe" path="res://asset/art/ui/inverted_point_light_masks/003.png" id="5_r175g"] +[ext_resource type="Texture2D" uid="uid://dxcdwhem7hp4m" path="res://asset/art/ui/inverted_point_light_masks/004.png" id="6_mfinv"] +[ext_resource type="Texture2D" uid="uid://cku06prhx2v36" path="res://asset/art/ui/inverted_point_light_masks/006.png" id="7_l6i25"] +[ext_resource type="Texture2D" uid="uid://cy62xq8rhoj3f" path="res://asset/art/ui/inverted_point_light_masks/007.png" id="8_c3qc6"] +[ext_resource type="Texture2D" uid="uid://b87hfcnkn05h4" path="res://asset/art/ui/inverted_point_light_masks/008.png" id="9_4h02j"] +[ext_resource type="Texture2D" uid="uid://qtgxbebqaj1e" path="res://asset/art/ui/inverted_point_light_masks/005.png" id="10_cnlt1"] +[ext_resource type="Texture2D" uid="uid://r3dm28fc0e83" path="res://asset/art/ui/inverted_point_light_masks/009.png" id="11_d5hm6"] +[ext_resource type="Texture2D" uid="uid://b3supcynj63qx" path="res://asset/art/ui/inverted_point_light_masks/010.png" id="12_xhq8m"] +[ext_resource type="Texture2D" uid="uid://brfiay0goejgl" path="res://asset/art/ui/inverted_point_light_masks/011.png" id="13_83dkb"] +[ext_resource type="Texture2D" uid="uid://bac4uqqp1ktki" path="res://asset/art/ui/inverted_point_light_masks/012.png" id="14_5p0cj"] +[ext_resource type="Texture2D" uid="uid://h1mdv3ygc6dd" path="res://asset/art/ui/inverted_point_light_masks/013.png" id="15_wgxcx"] +[ext_resource type="Texture2D" uid="uid://br4ry5glivh5g" path="res://asset/art/ui/inverted_point_light_masks/014.png" id="16_w6431"] +[ext_resource type="Texture2D" uid="uid://x7nvm37rxo62" path="res://asset/art/ui/inverted_point_light_masks/015.png" id="17_ewt2a"] +[ext_resource type="Texture2D" uid="uid://cmhqnt63xsw27" path="res://asset/art/ui/inverted_point_light_masks/016.png" id="18_pyfui"] +[ext_resource type="Texture2D" uid="uid://bpktur1e0dtb1" path="res://asset/art/ui/inverted_point_light_masks/017.png" id="19_u0b51"] +[ext_resource type="Texture2D" uid="uid://b62a8q5e4foo" path="res://asset/art/ui/inverted_point_light_masks/018.png" id="20_p2goc"] +[ext_resource type="Texture2D" uid="uid://cdcgyjj1w3j8o" path="res://asset/art/ui/inverted_point_light_masks/019.png" id="21_xecmh"] +[ext_resource type="Texture2D" uid="uid://dqwvsbj2savhv" path="res://asset/art/ui/inverted_point_light_masks/020.png" id="22_tgn13"] +[ext_resource type="Texture2D" uid="uid://dy488fl2ijtb4" path="res://asset/art/ui/inverted_point_light_masks/021.png" id="23_t66ls"] +[ext_resource type="Texture2D" uid="uid://bo2ee2uhsp6l2" path="res://asset/art/ui/inverted_point_light_masks/022.png" id="24_1ylis"] +[ext_resource type="Texture2D" uid="uid://gxl7kkkkq5vd" path="res://asset/art/ui/inverted_point_light_masks/023.png" id="25_dvr6b"] +[ext_resource type="Script" path="res://scene/shading/fog.gd" id="26_wm1nd"] + +[sub_resource type="FastNoiseLite" id="FastNoiseLite_jw18h"] +noise_type = 2 +fractal_type = 2 + +[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_qmfti"] +width = 800 +height = 800 +seamless = true +seamless_blend_skirt = 0.25 +noise = SubResource("FastNoiseLite_jw18h") + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_fv2fx"] +resource_local_to_scene = true +shader = ExtResource("1_b8eb0") +shader_parameter/noise = SubResource("NoiseTexture2D_qmfti") + +[sub_resource type="SpriteFrames" id="SpriteFrames_xeqgs"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": ExtResource("2_04yrb") +}, { +"duration": 1.0, +"texture": ExtResource("3_0bm30") +}, { +"duration": 1.0, +"texture": ExtResource("4_01roq") +}, { +"duration": 1.0, +"texture": ExtResource("5_r175g") +}, { +"duration": 1.0, +"texture": ExtResource("6_mfinv") +}, { +"duration": 1.0, +"texture": ExtResource("7_l6i25") +}, { +"duration": 1.0, +"texture": ExtResource("8_c3qc6") +}, { +"duration": 1.0, +"texture": ExtResource("9_4h02j") +}, { +"duration": 1.0, +"texture": ExtResource("10_cnlt1") +}, { +"duration": 1.0, +"texture": ExtResource("11_d5hm6") +}, { +"duration": 1.0, +"texture": ExtResource("12_xhq8m") +}, { +"duration": 1.0, +"texture": ExtResource("13_83dkb") +}, { +"duration": 1.0, +"texture": ExtResource("14_5p0cj") +}, { +"duration": 1.0, +"texture": ExtResource("15_wgxcx") +}, { +"duration": 1.0, +"texture": ExtResource("16_w6431") +}, { +"duration": 1.0, +"texture": ExtResource("17_ewt2a") +}, { +"duration": 1.0, +"texture": ExtResource("18_pyfui") +}, { +"duration": 1.0, +"texture": ExtResource("19_u0b51") +}, { +"duration": 1.0, +"texture": ExtResource("20_p2goc") +}, { +"duration": 1.0, +"texture": ExtResource("21_xecmh") +}, { +"duration": 1.0, +"texture": ExtResource("22_tgn13") +}, { +"duration": 1.0, +"texture": ExtResource("23_t66ls") +}, { +"duration": 1.0, +"texture": ExtResource("24_1ylis") +}, { +"duration": 1.0, +"texture": ExtResource("25_dvr6b") +}], +"loop": false, +"name": &"inverted_point_light_masks", +"speed": 12.0 +}] + +[node name="Fog" type="AnimatedSprite2D"] +material = SubResource("ShaderMaterial_fv2fx") +position = Vector2(286, 161) +sprite_frames = SubResource("SpriteFrames_xeqgs") +animation = &"inverted_point_light_masks" +frame = 23 +offset = Vector2(0, 50) +script = ExtResource("26_wm1nd") + +[node name="BackBufferCopy" type="BackBufferCopy" parent="."] +copy_mode = 2 diff --git a/scene/shading/shading_layer.gd b/scene/shading/shading_layer.gd index 1920d9e7..537feede 100644 --- a/scene/shading/shading_layer.gd +++ b/scene/shading/shading_layer.gd @@ -18,6 +18,7 @@ var mode: Array[String] = ["vignette"] as Array[String]: if is_node_ready(): %Vignette.material.set("shader_parameter/vignette_intensity", new_val) @export_group("Fog", "fog_") +const fog_frame_count = 24 # 0-23 @export var fog_offset := FOG_OFFSET_DEFAULT: set(new_val): fog_offset = new_val @@ -129,7 +130,7 @@ func add_mode(mode_name: String) -> void: #### Tween fog #### -const FOG_COLOR_DEFAULT = Color(0.8, 0.8, 0.8, 0.8) +const FOG_COLOR_DEFAULT = Color(0.8, 0.8, 0.8, 0.5) const FOG_COLOR_WHITE = Color(1, 1, 1, 1) const FOG_COLOR_BLACK = Color(0, 0, 0, 1) const FOG_COLOR_GRAY = Color(0.5, 0.5, 0.5, 1) diff --git a/scene/shading/shading_layer.tscn b/scene/shading/shading_layer.tscn index 305e4254..545f36e7 100644 --- a/scene/shading/shading_layer.tscn +++ b/scene/shading/shading_layer.tscn @@ -7,6 +7,7 @@ [ext_resource type="Shader" path="res://asset/shader/palette.gdshader" id="4_n5nu8"] [ext_resource type="Shader" path="res://asset/shader/fog.gdshader" id="4_sglhm"] [ext_resource type="Texture2D" uid="uid://36k1j0qw66tm" path="res://asset/shader/palette/bloodmoon21-1x.png" id="5_ios50"] +[ext_resource type="PackedScene" uid="uid://bicuc35kbn8hd" path="res://scene/shading/fog.tscn" id="7_7084x"] [ext_resource type="Material" uid="uid://7wllwmfkfvsb" path="res://asset/shader/cloud.tres" id="7_cmfij"] [ext_resource type="Shader" path="res://asset/shader/chromatic_abberation.gdshader" id="8_b0unx"] [ext_resource type="Texture2D" uid="uid://bmlhwa80lywa3" path="res://asset/art/ui/inverted_point_light_masks/000.png" id="8_v5h2g"] @@ -62,90 +63,11 @@ seamless = true seamless_blend_skirt = 0.25 noise = SubResource("FastNoiseLite_jw18h") -[sub_resource type="ShaderMaterial" id="ShaderMaterial_fv2fx"] +[sub_resource type="ShaderMaterial" id="ShaderMaterial_iyc4r"] +resource_local_to_scene = true shader = ExtResource("4_sglhm") shader_parameter/noise = SubResource("NoiseTexture2D_qmfti") -[sub_resource type="SpriteFrames" id="SpriteFrames_xeqgs"] -animations = [{ -"frames": [{ -"duration": 1.0, -"texture": ExtResource("8_v5h2g") -}, { -"duration": 1.0, -"texture": ExtResource("9_l3wcl") -}, { -"duration": 1.0, -"texture": ExtResource("10_gxxjv") -}, { -"duration": 1.0, -"texture": ExtResource("11_yxk17") -}, { -"duration": 1.0, -"texture": ExtResource("12_k6v1x") -}, { -"duration": 1.0, -"texture": ExtResource("14_yy2gj") -}, { -"duration": 1.0, -"texture": ExtResource("15_dp8m6") -}, { -"duration": 1.0, -"texture": ExtResource("16_86yqr") -}, { -"duration": 1.0, -"texture": ExtResource("13_kjyug") -}, { -"duration": 1.0, -"texture": ExtResource("17_5psqe") -}, { -"duration": 1.0, -"texture": ExtResource("18_kqi2m") -}, { -"duration": 1.0, -"texture": ExtResource("19_0iov5") -}, { -"duration": 1.0, -"texture": ExtResource("20_nuwxf") -}, { -"duration": 1.0, -"texture": ExtResource("21_e2710") -}, { -"duration": 1.0, -"texture": ExtResource("22_a2ogd") -}, { -"duration": 1.0, -"texture": ExtResource("23_0fxxa") -}, { -"duration": 1.0, -"texture": ExtResource("24_wh31r") -}, { -"duration": 1.0, -"texture": ExtResource("25_ur5f1") -}, { -"duration": 1.0, -"texture": ExtResource("26_scw75") -}, { -"duration": 1.0, -"texture": ExtResource("27_kg4a3") -}, { -"duration": 1.0, -"texture": ExtResource("28_1rgfo") -}, { -"duration": 1.0, -"texture": ExtResource("29_aklg4") -}, { -"duration": 1.0, -"texture": ExtResource("30_3pvg6") -}, { -"duration": 1.0, -"texture": ExtResource("31_53o1k") -}], -"loop": false, -"name": &"inverted_point_light_masks", -"speed": 12.0 -}] - [sub_resource type="SpriteFrames" id="SpriteFrames_sypgq"] animations = [{ "frames": [{ @@ -284,19 +206,11 @@ mouse_filter = 1 [node name="BackBufferCopy" type="BackBufferCopy" parent="GlitchEffect"] copy_mode = 2 -[node name="Fog" type="AnimatedSprite2D" parent="."] +[node name="Fog" parent="." instance=ExtResource("7_7084x")] unique_name_in_owner = true visible = false -self_modulate = Color(0.8, 0.8, 0.8, 0.8) -material = SubResource("ShaderMaterial_fv2fx") -position = Vector2(286, 161) -sprite_frames = SubResource("SpriteFrames_xeqgs") -animation = &"inverted_point_light_masks" -frame = 23 -offset = Vector2(0, 50) - -[node name="BackBufferCopy" type="BackBufferCopy" parent="Fog"] -copy_mode = 2 +self_modulate = Color(0.8, 0.8, 0.8, 0.5) +material = SubResource("ShaderMaterial_iyc4r") [node name="Cloud" type="AnimatedSprite2D" parent="."] unique_name_in_owner = true