diff --git a/levels/prop_test/prop_test.tscn b/levels/prop_test/prop_test.tscn index eb8ac72..a29d8bf 100644 --- a/levels/prop_test/prop_test.tscn +++ b/levels/prop_test/prop_test.tscn @@ -241,6 +241,7 @@ skeleton = NodePath("../..") [node name="StaticTrashCan" parent="Props" instance=ExtResource("21_wgtci")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 42, 0.5, -12) skeleton = NodePath("../..") +surface_material_override/0 = null [node name="PhysTrashCan" parent="Props" instance=ExtResource("25_8eukv")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 42.9, 0.5, -10.8) diff --git a/levels/sandbox/sandbox.tscn b/levels/sandbox/sandbox.tscn index cba107e..257c6eb 100644 --- a/levels/sandbox/sandbox.tscn +++ b/levels/sandbox/sandbox.tscn @@ -1,10 +1,9 @@ -[gd_scene load_steps=65 format=4 uid="uid://16ds4fvv72xk"] +[gd_scene load_steps=64 format=4 uid="uid://16ds4fvv72xk"] [ext_resource type="Environment" uid="uid://bkvij3ljl5ox3" path="res://levels/ghost_ship/environment_3.tres" id="1_fk1xc"] [ext_resource type="PackedScene" uid="uid://bwe2jdmvinhqd" path="res://src/player/player.tscn" id="1_h436a"] [ext_resource type="Texture2D" uid="uid://8cm835h4gxwe" path="res://assets/debug_mask.png" id="2_2roq2"] [ext_resource type="PackedScene" uid="uid://cdi5sl60mw1po" path="res://src/world/gunkable/gunkable.tscn" id="2_aj57l"] -[ext_resource type="Script" uid="uid://co0g2klfmor48" path="res://src/world/gunkable/gunkable.gd" id="3_nnn8o"] [ext_resource type="Shader" uid="uid://ckxc0ngd37rtk" path="res://src/shaders/gunk.gdshader" id="5_rdjtm"] [ext_resource type="FastNoiseLite" uid="uid://cnlvdtx68giv6" path="res://assets/materials/gunk_noise.tres" id="6_l64ek"] [ext_resource type="ArrayMesh" uid="uid://cqd0a7ousx01n" path="res://assets/level/hallway/hallway_1.mesh" id="7_fk1xc"] @@ -88,7 +87,7 @@ seamless = true seamless_blend_skirt = 0.5 noise = ExtResource("6_l64ek") -[sub_resource type="ShaderMaterial" id="ShaderMaterial_tq6jb"] +[sub_resource type="ShaderMaterial" id="ShaderMaterial_2l4r6"] resource_local_to_scene = true render_priority = 0 shader = ExtResource("5_rdjtm") @@ -168,7 +167,7 @@ seamless = true seamless_blend_skirt = 0.5 noise = ExtResource("6_l64ek") -[sub_resource type="ShaderMaterial" id="ShaderMaterial_tmxet"] +[sub_resource type="ShaderMaterial" id="ShaderMaterial_aj57l"] resource_local_to_scene = true render_priority = 0 shader = ExtResource("5_rdjtm") @@ -230,7 +229,7 @@ shadow_mesh = SubResource("ArrayMesh_i3ihq") [sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_0qjrr"] data = PackedVector3Array(-4, 4, 4, -4, -4, 4, -4, 4, -4, -4, 4, -4, -4, -4, 4, -4, -4, -4, -4, 4, -4, -4, -4, -4, 4, 4, -4, 4, 4, -4, -4, -4, -4, 4, -4, -4, 4, 4, -4, 4, -4, -4, 4, 4, 4, 4, 4, 4, 4, -4, -4, 4, -4, 4, 4, 4, 4, 4, -4, 4, -4, 4, 4, -4, 4, 4, 4, -4, 4, -4, -4, 4, 4, -4, -4, -4, -4, -4, 4, -4, 4, 4, -4, 4, -4, -4, -4, -4, -4, 4, -4, 4, -4, 4, 4, -4, -4, 4, 4, -4, 4, 4, 4, 4, -4, 4, 4, 4) -[sub_resource type="ShaderMaterial" id="ShaderMaterial_ct1gt"] +[sub_resource type="ShaderMaterial" id="ShaderMaterial_nnn8o"] resource_local_to_scene = true render_priority = 0 shader = ExtResource("5_rdjtm") @@ -294,7 +293,7 @@ shadow_mesh = SubResource("ArrayMesh_jllhp") [sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_6ood3"] data = PackedVector3Array(-0.0001, 6, -4, -0.0001, -6, -4, 0.7803, 6, -3.9232, 0.7803, 6, -3.9232, -0.0001, -6, -4, 0.7803, -6, -3.9232, 0.7803, 6, -3.9232, 0.7803, -6, -3.9232, 1.5307, 6, -3.6956, 1.5307, 6, -3.6956, 0.7803, -6, -3.9232, 1.5307, -6, -3.6956, 1.5307, 6, -3.6956, 1.5307, -6, -3.6956, 2.2223, 6, -3.3259, 2.2223, 6, -3.3259, 1.5307, -6, -3.6956, 2.2223, -6, -3.3259, 2.2223, 6, -3.3259, 2.2223, -6, -3.3259, 2.8284, 6, -2.8285, 2.8284, 6, -2.8285, 2.2223, -6, -3.3259, 2.8284, -6, -2.8285, 2.8284, 6, -2.8285, 2.8284, -6, -2.8285, 3.3258, 6, -2.2224, 3.3258, 6, -2.2224, 2.8284, -6, -2.8285, 3.3258, -6, -2.2224, 3.3258, 6, -2.2224, 3.3258, -6, -2.2224, 3.6954, 6, -1.5308, 3.6954, 6, -1.5308, 3.3258, -6, -2.2224, 3.6954, -6, -1.5308, 3.6954, 6, -1.5308, 3.6954, -6, -1.5308, 3.9231, 6, -0.7805, 3.9231, 6, -0.7805, 3.6954, -6, -1.5308, 3.9231, -6, -0.7805, 3.9231, 6, -0.7805, 3.9231, -6, -0.7805, 4, 6, -0.0001, 4, 6, -0.0001, 3.9231, -6, -0.7805, 4, -6, -0.0001, 4, 6, -0.0001, 4, -6, -0.0001, 3.9231, 6, 0.7803, 3.9231, 6, 0.7803, 4, -6, -0.0001, 3.9231, -6, 0.7803, 3.9231, 6, 0.7803, 3.9231, -6, 0.7803, 3.6954, 6, 1.5307, 3.6954, 6, 1.5307, 3.9231, -6, 0.7803, 3.6954, -6, 1.5307, 3.6954, 6, 1.5307, 3.6954, -6, 1.5307, 3.3258, 6, 2.2223, 3.3258, 6, 2.2223, 3.6954, -6, 1.5307, 3.3258, -6, 2.2223, 3.3258, 6, 2.2223, 3.3258, -6, 2.2223, 2.8284, 6, 2.8284, 2.8284, 6, 2.8284, 3.3258, -6, 2.2223, 2.8284, -6, 2.8284, 2.8284, 6, 2.8284, 2.8284, -6, 2.8284, 2.2223, 6, 3.3258, 2.2223, 6, 3.3258, 2.8284, -6, 2.8284, 2.2223, -6, 3.3258, 2.2223, 6, 3.3258, 2.2223, -6, 3.3258, 1.5307, 6, 3.6954, 1.5307, 6, 3.6954, 2.2223, -6, 3.3258, 1.5307, -6, 3.6954, 1.5307, 6, 3.6954, 1.5307, -6, 3.6954, 0.7803, 6, 3.9231, 0.7803, 6, 3.9231, 1.5307, -6, 3.6954, 0.7803, -6, 3.9231, 0.7803, 6, 3.9231, 0.7803, -6, 3.9231, -0.0001, 6, 4, -0.0001, 6, 4, 0.7803, -6, 3.9231, -0.0001, -6, 4, -0.0001, 6, 4, -0.0001, -6, 4, -0.7805, 6, 3.9231, -0.7805, 6, 3.9231, -0.0001, -6, 4, -0.7805, -6, 3.9231, -0.7805, 6, 3.9231, -0.7805, -6, 3.9231, -1.5308, 6, 3.6954, -1.5308, 6, 3.6954, -0.7805, -6, 3.9231, -1.5308, -6, 3.6954, -1.5308, 6, 3.6954, -1.5308, -6, 3.6954, -2.2224, 6, 3.3258, -2.2224, 6, 3.3258, -1.5308, -6, 3.6954, -2.2224, -6, 3.3258, -2.2224, 6, 3.3258, -2.2224, -6, 3.3258, -2.8285, 6, 2.8284, -2.8285, 6, 2.8284, -2.2224, -6, 3.3258, -2.8285, -6, 2.8284, -2.8285, 6, 2.8284, -2.8285, -6, 2.8284, -3.3259, 6, 2.2223, -3.3259, 6, 2.2223, -2.8285, -6, 2.8284, -3.3259, -6, 2.2223, -3.3259, 6, 2.2223, -3.3259, -6, 2.2223, -3.6956, 6, 1.5307, -3.6956, 6, 1.5307, -3.3259, -6, 2.2223, -3.6956, -6, 1.5307, -3.6956, 6, 1.5307, -3.6956, -6, 1.5307, -3.9232, 6, 0.7803, -3.9232, 6, 0.7803, -3.6956, -6, 1.5307, -3.9232, -6, 0.7803, -3.9232, 6, 0.7803, -3.9232, -6, 0.7803, -4, 6, -0.0001, -4, 6, -0.0001, -3.9232, -6, 0.7803, -4, -6, -0.0001, -4, 6, -0.0001, -4, -6, -0.0001, -3.9232, 6, -0.7805, -3.9232, 6, -0.7805, -4, -6, -0.0001, -3.9232, -6, -0.7805, -3.9232, 6, -0.7805, -3.9232, -6, -0.7805, -3.6956, 6, -1.5308, -3.6956, 6, -1.5308, -3.9232, -6, -0.7805, -3.6956, -6, -1.5308, -3.6956, 6, -1.5308, -3.6956, -6, -1.5308, -3.3259, 6, -2.2224, -3.3259, 6, -2.2224, -3.6956, -6, -1.5308, -3.3259, -6, -2.2224, -3.3259, 6, -2.2224, -3.3259, -6, -2.2224, -2.8285, 6, -2.8285, -2.8285, 6, -2.8285, -3.3259, -6, -2.2224, -2.8285, -6, -2.8285, -2.8285, 6, -2.8285, -2.8285, -6, -2.8285, -2.2224, 6, -3.3259, -2.2224, 6, -3.3259, -2.8285, -6, -2.8285, -2.2224, -6, -3.3259, -2.2224, 6, -3.3259, -2.2224, -6, -3.3259, -1.5308, 6, -3.6956, -1.5308, 6, -3.6956, -2.2224, -6, -3.3259, -1.5308, -6, -3.6956, -0.0001, 6, -4, 0.7803, 6, -3.9232, -0.7805, 6, -3.9232, -0.7805, 6, -3.9232, 0.7803, 6, -3.9232, -1.5308, 6, -3.6956, -1.5308, 6, -3.6956, 0.7803, 6, -3.9232, -2.2224, 6, -3.3259, -2.2224, 6, -3.3259, 0.7803, 6, -3.9232, -2.8285, 6, -2.8285, -2.8285, 6, -2.8285, 0.7803, 6, -3.9232, -3.3259, 6, -2.2224, -3.3259, 6, -2.2224, 0.7803, 6, -3.9232, -3.6956, 6, -1.5308, -3.6956, 6, -1.5308, 0.7803, 6, -3.9232, -3.9232, 6, -0.7805, -3.9232, 6, -0.7805, 0.7803, 6, -3.9232, -4, 6, -0.0001, -4, 6, -0.0001, 0.7803, 6, -3.9232, -3.9232, 6, 0.7803, -3.9232, 6, 0.7803, 0.7803, 6, -3.9232, -3.6956, 6, 1.5307, -3.6956, 6, 1.5307, 0.7803, 6, -3.9232, -3.3259, 6, 2.2223, -3.3259, 6, 2.2223, 0.7803, 6, -3.9232, -2.8285, 6, 2.8284, -2.8285, 6, 2.8284, 0.7803, 6, -3.9232, -2.2224, 6, 3.3258, -2.2224, 6, 3.3258, 0.7803, 6, -3.9232, -1.5308, 6, 3.6954, -1.5308, 6, 3.6954, 0.7803, 6, -3.9232, -0.7805, 6, 3.9231, -0.7805, 6, 3.9231, 0.7803, 6, -3.9232, -0.0001, 6, 4, -0.0001, 6, 4, 0.7803, 6, -3.9232, 0.7803, 6, 3.9231, 0.7803, 6, 3.9231, 0.7803, 6, -3.9232, 1.5307, 6, 3.6954, 1.5307, 6, 3.6954, 0.7803, 6, -3.9232, 2.2223, 6, 3.3258, 2.2223, 6, 3.3258, 0.7803, 6, -3.9232, 2.8284, 6, 2.8284, 2.8284, 6, 2.8284, 0.7803, 6, -3.9232, 3.3258, 6, 2.2223, 3.3258, 6, 2.2223, 0.7803, 6, -3.9232, 3.6954, 6, 1.5307, 3.6954, 6, 1.5307, 0.7803, 6, -3.9232, 3.9231, 6, 0.7803, 3.9231, 6, 0.7803, 0.7803, 6, -3.9232, 4, 6, -0.0001, 4, 6, -0.0001, 0.7803, 6, -3.9232, 3.9231, 6, -0.7805, 3.9231, 6, -0.7805, 0.7803, 6, -3.9232, 3.6954, 6, -1.5308, 3.6954, 6, -1.5308, 0.7803, 6, -3.9232, 3.3258, 6, -2.2224, 3.3258, 6, -2.2224, 0.7803, 6, -3.9232, 2.8284, 6, -2.8285, 2.8284, 6, -2.8285, 0.7803, 6, -3.9232, 2.2223, 6, -3.3259, 2.2223, 6, -3.3259, 0.7803, 6, -3.9232, 1.5307, 6, -3.6956, -1.5308, 6, -3.6956, -1.5308, -6, -3.6956, -0.7805, 6, -3.9232, -0.7805, 6, -3.9232, -1.5308, -6, -3.6956, -0.7805, -6, -3.9232, -0.7805, 6, -3.9232, -0.7805, -6, -3.9232, -0.0001, 6, -4, -0.0001, 6, -4, -0.7805, -6, -3.9232, -0.0001, -6, -4, 0.7803, -6, -3.9232, -0.0001, -6, -4, 1.5307, -6, -3.6956, 1.5307, -6, -3.6956, -0.0001, -6, -4, 2.2223, -6, -3.3259, 2.2223, -6, -3.3259, -0.0001, -6, -4, 2.8284, -6, -2.8285, 2.8284, -6, -2.8285, -0.0001, -6, -4, 3.3258, -6, -2.2224, 3.3258, -6, -2.2224, -0.0001, -6, -4, 3.6954, -6, -1.5308, 3.6954, -6, -1.5308, -0.0001, -6, -4, 3.9231, -6, -0.7805, 3.9231, -6, -0.7805, -0.0001, -6, -4, 4, -6, -0.0001, 4, -6, -0.0001, -0.0001, -6, -4, 3.9231, -6, 0.7803, 3.9231, -6, 0.7803, -0.0001, -6, -4, 3.6954, -6, 1.5307, 3.6954, -6, 1.5307, -0.0001, -6, -4, 3.3258, -6, 2.2223, 3.3258, -6, 2.2223, -0.0001, -6, -4, 2.8284, -6, 2.8284, 2.8284, -6, 2.8284, -0.0001, -6, -4, 2.2223, -6, 3.3258, 2.2223, -6, 3.3258, -0.0001, -6, -4, 1.5307, -6, 3.6954, 1.5307, -6, 3.6954, -0.0001, -6, -4, 0.7803, -6, 3.9231, 0.7803, -6, 3.9231, -0.0001, -6, -4, -0.0001, -6, 4, -0.0001, -6, 4, -0.0001, -6, -4, -0.7805, -6, 3.9231, -0.7805, -6, 3.9231, -0.0001, -6, -4, -1.5308, -6, 3.6954, -1.5308, -6, 3.6954, -0.0001, -6, -4, -2.2224, -6, 3.3258, -2.2224, -6, 3.3258, -0.0001, -6, -4, -2.8285, -6, 2.8284, -2.8285, -6, 2.8284, -0.0001, -6, -4, -3.3259, -6, 2.2223, -3.3259, -6, 2.2223, -0.0001, -6, -4, -3.6956, -6, 1.5307, -3.6956, -6, 1.5307, -0.0001, -6, -4, -3.9232, -6, 0.7803, -3.9232, -6, 0.7803, -0.0001, -6, -4, -4, -6, -0.0001, -4, -6, -0.0001, -0.0001, -6, -4, -3.9232, -6, -0.7805, -3.9232, -6, -0.7805, -0.0001, -6, -4, -3.6956, -6, -1.5308, -3.6956, -6, -1.5308, -0.0001, -6, -4, -3.3259, -6, -2.2224, -3.3259, -6, -2.2224, -0.0001, -6, -4, -2.8285, -6, -2.8285, -2.8285, -6, -2.8285, -0.0001, -6, -4, -2.2224, -6, -3.3259, -2.2224, -6, -3.3259, -0.0001, -6, -4, -1.5308, -6, -3.6956, -1.5308, -6, -3.6956, -0.0001, -6, -4, -0.7805, -6, -3.9232) -[sub_resource type="ShaderMaterial" id="ShaderMaterial_6lnam"] +[sub_resource type="ShaderMaterial" id="ShaderMaterial_tq6jb"] resource_local_to_scene = true render_priority = 0 shader = ExtResource("5_rdjtm") @@ -322,7 +321,7 @@ shader_parameter/overlay_emission_scale = 1.0 [sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_p1wtp"] data = PackedVector3Array(-1.5, 0, -6, -1.5, 0, 6, -1.5, 3, -6, -1.5, 3, -6, -1.5, 0, 6, -1.5, 3, 6, 1.5, 0, 6, 1.5, 0, -6, 1.5, 3, 6, 1.5, 3, 6, 1.5, 0, -6, 1.5, 3, -6, -1.5, 0, 6, -1.5, 0, -6, 1.5, 0, 6, 1.5, 0, 6, -1.5, 0, -6, 1.5, 0, -6, 1.5, 3, 6, 1.5, 3, -6, -1.5, 3, 6, -1.5, 3, 6, 1.5, 3, -6, -1.5, 3, -6) -[sub_resource type="ShaderMaterial" id="ShaderMaterial_lorhs"] +[sub_resource type="ShaderMaterial" id="ShaderMaterial_tmxet"] resource_local_to_scene = true render_priority = 0 shader = ExtResource("5_rdjtm") @@ -350,7 +349,7 @@ shader_parameter/overlay_emission_scale = 1.0 [sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_2l4r6"] data = PackedVector3Array(-1.5, 0, -6, -1.5, 0, 6, -1.5, 3, -6, -1.5, 3, -6, -1.5, 0, 6, -1.5, 3, 6, 1.5, 0, 6, 1.5, 0, -6, 1.5, 3, 6, 1.5, 3, 6, 1.5, 0, -6, 1.5, 3, -6, -1.5, 0, 6, -1.5, 0, -6, 1.5, 0, 6, 1.5, 0, 6, -1.5, 0, -6, 1.5, 0, -6, 1.5, 3, 6, 1.5, 3, -6, -1.5, 3, 6, -1.5, 3, 6, 1.5, 3, -6, -1.5, 3, -6) -[sub_resource type="ShaderMaterial" id="ShaderMaterial_v2ya2"] +[sub_resource type="ShaderMaterial" id="ShaderMaterial_ct1gt"] resource_local_to_scene = true render_priority = 0 shader = ExtResource("5_rdjtm") @@ -378,7 +377,7 @@ shader_parameter/overlay_emission_scale = 1.0 [sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_tmxet"] data = PackedVector3Array(-1.5, 0, -6, -1.5, 0, 6, -1.5, 3, -6, -1.5, 3, -6, -1.5, 0, 6, -1.5, 3, 6, 1.5, 0, 6, 1.5, 0, -6, 1.5, 3, 6, 1.5, 3, 6, 1.5, 0, -6, 1.5, 3, -6, -1.5, 0, 6, -1.5, 0, -6, 1.5, 0, 6, 1.5, 0, 6, -1.5, 0, -6, 1.5, 0, -6, 1.5, 3, 6, 1.5, 3, -6, -1.5, 3, 6, -1.5, 3, 6, 1.5, 3, -6, -1.5, 3, -6) -[sub_resource type="ShaderMaterial" id="ShaderMaterial_60cnp"] +[sub_resource type="ShaderMaterial" id="ShaderMaterial_6lnam"] resource_local_to_scene = true render_priority = 0 shader = ExtResource("5_rdjtm") @@ -500,19 +499,16 @@ collision_mask = 0 [node name="CollisionShape3D" type="CollisionShape3D" parent="Geometry/Icosahedron/StaticBody3D"] shape = SubResource("ConcavePolygonShape3D_nxc47") -[node name="Gunkable" type="Node" parent="Geometry/Icosahedron/StaticBody3D" node_paths=PackedStringArray("body", "mesh_instance") groups=["Persistent"] instance=ExtResource("2_aj57l")] -script = ExtResource("3_nnn8o") +[node name="Gunkable" parent="Geometry/Icosahedron/StaticBody3D" node_paths=PackedStringArray("body", "mesh_instance") instance=ExtResource("2_aj57l")] mask_dim = 128 body = NodePath("..") mesh_instance = NodePath("../..") initial_mask = ExtResource("2_2roq2") -source_gunk_material = SubResource("ShaderMaterial_tq6jb") -metadata/_custom_type_script = "uid://co0g2klfmor48" +source_gunk_material = SubResource("ShaderMaterial_2l4r6") [node name="Monkey" type="MeshInstance3D" parent="Geometry"] transform = Transform3D(-0.616239, 0, 0.787559, 0, 1, 0, -0.787559, 0, -0.616239, -2.22512, 1.41158, 2.88581) mesh = SubResource("ArrayMesh_hrvvi") -skeleton = NodePath("") [node name="StaticBody3D" type="StaticBody3D" parent="Geometry/Monkey"] collision_layer = 5 @@ -521,13 +517,11 @@ collision_mask = 0 [node name="CollisionShape3D" type="CollisionShape3D" parent="Geometry/Monkey/StaticBody3D"] shape = SubResource("ConcavePolygonShape3D_hvf6a") -[node name="Gunkable" type="Node" parent="Geometry/Monkey/StaticBody3D" node_paths=PackedStringArray("body", "mesh_instance") groups=["Persistent"] instance=ExtResource("2_aj57l")] -script = ExtResource("3_nnn8o") +[node name="Gunkable" parent="Geometry/Monkey/StaticBody3D" node_paths=PackedStringArray("body", "mesh_instance") instance=ExtResource("2_aj57l")] mask_dim = 128 body = NodePath("..") mesh_instance = NodePath("../..") -source_gunk_material = SubResource("ShaderMaterial_tmxet") -metadata/_custom_type_script = "uid://co0g2klfmor48" +source_gunk_material = SubResource("ShaderMaterial_aj57l") [node name="Cube" type="MeshInstance3D" parent="Geometry"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 8, 4, 0) @@ -542,13 +536,11 @@ collision_mask = 0 [node name="CollisionShape3D" type="CollisionShape3D" parent="Geometry/Cube/StaticBody3D"] shape = SubResource("ConcavePolygonShape3D_0qjrr") -[node name="Gunkable" type="Node" parent="Geometry/Cube/StaticBody3D" node_paths=PackedStringArray("body", "mesh_instance") groups=["Persistent"] instance=ExtResource("2_aj57l")] -script = ExtResource("3_nnn8o") +[node name="Gunkable" parent="Geometry/Cube/StaticBody3D" node_paths=PackedStringArray("body", "mesh_instance") instance=ExtResource("2_aj57l")] mask_dim = 512 body = NodePath("..") mesh_instance = NodePath("../..") -source_gunk_material = SubResource("ShaderMaterial_ct1gt") -metadata/_custom_type_script = "uid://co0g2klfmor48" +source_gunk_material = SubResource("ShaderMaterial_nnn8o") [node name="Cylinder" type="MeshInstance3D" parent="Geometry"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.33738, 6, -7.18125) @@ -562,13 +554,11 @@ collision_mask = 0 [node name="CollisionShape3D" type="CollisionShape3D" parent="Geometry/Cylinder/StaticBody3D"] shape = SubResource("ConcavePolygonShape3D_6ood3") -[node name="Gunkable" type="Node" parent="Geometry/Cylinder/StaticBody3D" node_paths=PackedStringArray("body", "mesh_instance") groups=["Persistent"] instance=ExtResource("2_aj57l")] -script = ExtResource("3_nnn8o") +[node name="Gunkable" parent="Geometry/Cylinder/StaticBody3D" node_paths=PackedStringArray("body", "mesh_instance") instance=ExtResource("2_aj57l")] mask_dim = 512 body = NodePath("..") mesh_instance = NodePath("../..") -source_gunk_material = SubResource("ShaderMaterial_6lnam") -metadata/_custom_type_script = "uid://co0g2klfmor48" +source_gunk_material = SubResource("ShaderMaterial_tq6jb") [node name="WallSwitch" parent="Geometry" instance=ExtResource("9_p27ol")] transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 3.9, 1.50699, 2.45659) @@ -588,12 +578,10 @@ collision_mask = 0 [node name="CollisionShape3D" type="CollisionShape3D" parent="LevelTiles/Hallway1/StaticBody3D"] shape = SubResource("ConcavePolygonShape3D_p1wtp") -[node name="Gunkable" type="Node" parent="LevelTiles/Hallway1/StaticBody3D" node_paths=PackedStringArray("body", "mesh_instance") groups=["Persistent"] instance=ExtResource("2_aj57l")] -script = ExtResource("3_nnn8o") +[node name="Gunkable" parent="LevelTiles/Hallway1/StaticBody3D" node_paths=PackedStringArray("body", "mesh_instance") instance=ExtResource("2_aj57l")] body = NodePath("..") mesh_instance = NodePath("../..") -source_gunk_material = SubResource("ShaderMaterial_lorhs") -metadata/_custom_type_script = "uid://co0g2klfmor48" +source_gunk_material = SubResource("ShaderMaterial_tmxet") [node name="Hallway2" type="MeshInstance3D" parent="LevelTiles"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 18) @@ -607,12 +595,10 @@ collision_mask = 0 [node name="CollisionShape3D" type="CollisionShape3D" parent="LevelTiles/Hallway2/StaticBody3D"] shape = SubResource("ConcavePolygonShape3D_2l4r6") -[node name="Gunkable" type="Node" parent="LevelTiles/Hallway2/StaticBody3D" node_paths=PackedStringArray("body", "mesh_instance") groups=["Persistent"] instance=ExtResource("2_aj57l")] -script = ExtResource("3_nnn8o") +[node name="Gunkable" parent="LevelTiles/Hallway2/StaticBody3D" node_paths=PackedStringArray("body", "mesh_instance") instance=ExtResource("2_aj57l")] body = NodePath("..") mesh_instance = NodePath("../..") -source_gunk_material = SubResource("ShaderMaterial_v2ya2") -metadata/_custom_type_script = "uid://co0g2klfmor48" +source_gunk_material = SubResource("ShaderMaterial_ct1gt") [node name="Hallway3" type="MeshInstance3D" parent="LevelTiles"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 30) @@ -626,12 +612,10 @@ collision_mask = 0 [node name="CollisionShape3D" type="CollisionShape3D" parent="LevelTiles/Hallway3/StaticBody3D"] shape = SubResource("ConcavePolygonShape3D_tmxet") -[node name="Gunkable" type="Node" parent="LevelTiles/Hallway3/StaticBody3D" node_paths=PackedStringArray("body", "mesh_instance") groups=["Persistent"] instance=ExtResource("2_aj57l")] -script = ExtResource("3_nnn8o") +[node name="Gunkable" parent="LevelTiles/Hallway3/StaticBody3D" node_paths=PackedStringArray("body", "mesh_instance") instance=ExtResource("2_aj57l")] body = NodePath("..") mesh_instance = NodePath("../..") -source_gunk_material = SubResource("ShaderMaterial_60cnp") -metadata/_custom_type_script = "uid://co0g2klfmor48" +source_gunk_material = SubResource("ShaderMaterial_6lnam") [node name="GrunkNodule" parent="." instance=ExtResource("10_2roq2")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -6, 1, -1) diff --git a/src/player/interact_ray.gd b/src/player/interact_ray.gd index baff71f..0056f99 100644 --- a/src/player/interact_ray.gd +++ b/src/player/interact_ray.gd @@ -3,14 +3,23 @@ extends RayCast3D @onready var parent := owner as Player +var _selected: Object + func _process(_delta: float) -> void: var collider := self.get_collider() if not collider: + if _selected and is_instance_valid(_selected): + _selected.emit_signal(Interactive.DESELECT_SIGNAL) + _selected = null return if collider.has_user_signal(Interactive.SELECT_SIGNAL): - collider.emit_signal(Interactive.SELECT_SIGNAL) + if collider != _selected: + if not _selected and is_instance_valid(_selected): + _selected.emit_signal(Interactive.DESELECT_SIGNAL) + _selected = collider + collider.emit_signal(Interactive.SELECT_SIGNAL) if ( parent.activity_enabled diff --git a/src/props/interactive.gd b/src/props/interactive.gd index 3a0d81d..bb42271 100644 --- a/src/props/interactive.gd +++ b/src/props/interactive.gd @@ -4,6 +4,7 @@ class_name Interactive extends Node signal activated const SELECT_SIGNAL := "selected" +const DESELECT_SIGNAL := "deselected" const ACTIVATE_SIGNAL := "activated" @export var enabled := false @@ -18,6 +19,8 @@ func _ready() -> void: controller = get_parent() controller.add_user_signal(SELECT_SIGNAL) controller.connect(SELECT_SIGNAL, select) + controller.add_user_signal(DESELECT_SIGNAL) + controller.connect(DESELECT_SIGNAL, deselect) controller.add_user_signal(ACTIVATE_SIGNAL) controller.connect(ACTIVATE_SIGNAL, activate) @@ -26,6 +29,10 @@ func select() -> void: Player.instance.hud.interact_hud.set_interactive(self) +func deselect() -> void: + Player.instance.hud.interact_hud.set_interactive(null) + + func activate() -> void: if enabled: activated.emit() diff --git a/src/props/physics/holdable.gd b/src/props/physics/holdable.gd index 52e5959..ef6da1d 100644 --- a/src/props/physics/holdable.gd +++ b/src/props/physics/holdable.gd @@ -7,19 +7,29 @@ class_name Holdable extends Node func _ready() -> void: if not controller: - controller = get_parent() as RigidBody3D - assert(controller, "Holdable %s must be a child of a RigidBody3D" % str(self)) + controller = _default_controller() + assert(controller, "Holdable %s has no valid controller!" % str(self)) controller.add_user_signal(Interactive.SELECT_SIGNAL) controller.connect(Interactive.SELECT_SIGNAL, select) + controller.add_user_signal(Interactive.DESELECT_SIGNAL) + controller.connect(Interactive.DESELECT_SIGNAL, deselect) controller.add_user_signal(Interactive.ACTIVATE_SIGNAL) controller.connect(Interactive.ACTIVATE_SIGNAL, activate) +func _default_controller() -> RigidBody3D: + return get_parent() as RigidBody3D + + func select() -> void: Player.instance.hud.hold_hud.select_prop() +func deselect() -> void: + Player.instance.hud.hold_hud.deselect() + + func activate() -> void: if not Player.instance.hold_component.holding_object(): Player.instance.hold_component.attach(controller, hold_distance) diff --git a/src/ui/hud/hold_hud.gd b/src/ui/hud/hold_hud.gd index 09a35f3..2d6bf4a 100644 --- a/src/ui/hud/hold_hud.gd +++ b/src/ui/hud/hold_hud.gd @@ -7,7 +7,6 @@ enum State { } var state := State.NONE -var _selected_this_frame := false @onready var open_hand: Label = %OpenHand @onready var closed_hand: Label = %ClosedHand @@ -41,7 +40,6 @@ func reset() -> void: func select_prop() -> void: - _selected_this_frame = true if state == State.NONE: prop_selected() @@ -49,10 +47,3 @@ func select_prop() -> void: func deselect() -> void: if state == State.SELECTED: reset() - - -func _process(_delta: float) -> void: - if not _selected_this_frame: - deselect() - - _selected_this_frame = false diff --git a/src/ui/hud/interact_hud.gd b/src/ui/hud/interact_hud.gd index dd1aecb..6c71165 100644 --- a/src/ui/hud/interact_hud.gd +++ b/src/ui/hud/interact_hud.gd @@ -7,9 +7,6 @@ const COLOR_VISIBLE := Color("#ffffffee") const COLOR_DISABLED := Color("#cccccc44") const COLOR_INVISIBLE := Color("#ffffff00") -var _current_interactive: Interactive -var _set_this_frame := false - @onready var interact_name: Label = %InteractName @onready var interact_verb: Label = %InteractVerb @@ -37,13 +34,6 @@ func _to_invisible() -> void: func set_interactive(prop: Interactive) -> void: - if prop != _current_interactive: - _set_new_interactive(prop) - _set_this_frame = true - - -func _set_new_interactive(prop: Interactive) -> void: - _current_interactive = prop if prop: interact_name.text = prop.label interact_verb.text = prop.verb @@ -53,10 +43,3 @@ func _set_new_interactive(prop: Interactive) -> void: _to_disabled() else: _to_invisible() - - -func _process(_delta: float) -> void: - if not _set_this_frame: - set_interactive(null) - - _set_this_frame = false diff --git a/src/ui/hud/player_hud.tscn b/src/ui/hud/player_hud.tscn index 0c3b16a..b0713ca 100644 --- a/src/ui/hud/player_hud.tscn +++ b/src/ui/hud/player_hud.tscn @@ -427,10 +427,10 @@ anchor_left = 0.5 anchor_top = 0.5 anchor_right = 0.5 anchor_bottom = 0.5 -offset_left = -19.5065 -offset_top = -22.2032 -offset_right = -19.5065 -offset_bottom = -22.2032 +offset_left = -17.6994 +offset_top = -20.4734 +offset_right = -17.6994 +offset_bottom = -20.4734 grow_horizontal = 2 grow_vertical = 2 script = ExtResource("4_ud8na") diff --git a/src/world/gunkable/gunkable.gd b/src/world/gunkable/gunkable.gd index dd4032b..8ee635c 100644 --- a/src/world/gunkable/gunkable.gd +++ b/src/world/gunkable/gunkable.gd @@ -61,6 +61,8 @@ func _ready() -> void: # Set material gunk mask to our mask viewport texture mat_instance.set_shader_parameter("gunk_mask", mask_viewport.get_texture()) # Overlay mesh with gunk material + if mesh_instance.material_overlay: + mat_instance.next_pass = mesh_instance.material_overlay mesh_instance.material_overlay = mat_instance _deferred_init.call_deferred()