diff --git a/levels/ghost_ship/ghost_ship.tscn b/levels/ghost_ship/ghost_ship.tscn index 5a79e25..5a5e1d6 100644 --- a/levels/ghost_ship/ghost_ship.tscn +++ b/levels/ghost_ship/ghost_ship.tscn @@ -20,6 +20,7 @@ glow_bloom = 0.1 fog_enabled = true fog_light_color = Color(0, 0, 0, 1) fog_density = 0.2 +fog_depth_begin = 0.0 [node name="GhostShip" type="Node3D"] @@ -41,37 +42,31 @@ omni_range = 10.0 [node name="OmniLight3D4" type="OmniLight3D" parent="GhostShipLevel"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3, 0.1, -7.6) light_energy = 8.0 -shadow_enabled = true omni_range = 10.0 [node name="OmniLight3D5" type="OmniLight3D" parent="GhostShipLevel"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3, 0.1, -28.6) light_energy = 8.0 -shadow_enabled = true omni_range = 10.0 [node name="OmniLight3D6" type="OmniLight3D" parent="GhostShipLevel"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3, 0.1, -31.6) light_energy = 8.0 -shadow_enabled = true omni_range = 10.0 [node name="OmniLight3D7" type="OmniLight3D" parent="GhostShipLevel"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -24, 0.1, -31.6) light_energy = 8.0 -shadow_enabled = true omni_range = 10.0 [node name="OmniLight3D8" type="OmniLight3D" parent="GhostShipLevel"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -24, 0.1, -28.6) light_energy = 8.0 -shadow_enabled = true omni_range = 10.0 [node name="OmniLight3D3" type="OmniLight3D" parent="GhostShipLevel"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3, 0.1, -7.6) light_energy = 8.0 -shadow_enabled = true omni_range = 10.0 [node name="Player" parent="." instance=ExtResource("2_0ef5p")] diff --git a/levels/ghost_ship/player_ship/player_ship.tscn b/levels/ghost_ship/player_ship/player_ship.tscn index 4dc606e..daf4897 100644 --- a/levels/ghost_ship/player_ship/player_ship.tscn +++ b/levels/ghost_ship/player_ship/player_ship.tscn @@ -21,6 +21,7 @@ data = PackedVector3Array(2.5, 1, 5.5, 2.5, 1, -4.5001, 2.5, 2, 5.5, 2.5, 2, 5.5 [node name="PlayerShip" type="Node3D"] [node name="StaticBody3D" type="StaticBody3D" parent="."] +collision_layer = 5 [node name="MeshInstance3D" type="MeshInstance3D" parent="StaticBody3D"] mesh = ExtResource("1_nafoa") diff --git a/project.godot b/project.godot index 78691ff..c245b01 100644 --- a/project.godot +++ b/project.godot @@ -114,6 +114,7 @@ interact={ 3d_render/layer_2="HUD" 3d_physics/layer_1="Physics" 3d_physics/layer_2="Interactive" +3d_physics/layer_3="Grunkable" [rendering] diff --git a/src/effects/floating_dust.tscn b/src/effects/floating_dust.tscn new file mode 100644 index 0000000..a7e5bfd --- /dev/null +++ b/src/effects/floating_dust.tscn @@ -0,0 +1,66 @@ +[gd_scene load_steps=10 format=3 uid="uid://30o8ltnnxpxo"] + +[sub_resource type="Curve" id="Curve_w3xaq"] +_limits = [0.0, 0.4, 0.0, 1.0] +_data = [Vector2(0, 0), 0.0, 0.0, 0, 0, Vector2(0.3, 0.4), 0.0, 0.0, 0, 0, Vector2(0.7, 0.4), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0] +point_count = 4 + +[sub_resource type="CurveTexture" id="CurveTexture_ty63v"] +curve = SubResource("Curve_w3xaq") + +[sub_resource type="Gradient" id="Gradient_yfel2"] +offsets = PackedFloat32Array(0, 0.1, 0.4, 0.6, 1) +colors = PackedColorArray(0.15, 0.15, 0.15, 1, 0.355313, 0.355314, 0.355313, 1, 0.356863, 0.356863, 0.356863, 1, 0.647059, 0.647059, 0.647059, 1, 0.15, 0.15, 0.15, 1) + +[sub_resource type="GradientTexture1D" id="GradientTexture1D_w3xaq"] +gradient = SubResource("Gradient_yfel2") + +[sub_resource type="Curve" id="Curve_yfel2"] +_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(0.746094, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0] +point_count = 3 + +[sub_resource type="CurveTexture" id="CurveTexture_w3xaq"] +curve = SubResource("Curve_yfel2") + +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_ty63v"] +emission_shape = 6 +emission_ring_axis = Vector3(0, 1, 0) +emission_ring_height = 3.0 +emission_ring_radius = 8.0 +emission_ring_inner_radius = 0.0 +emission_ring_cone_angle = 90.0 +direction = Vector3(0, -1, 0) +spread = 100.0 +initial_velocity_min = 0.05 +initial_velocity_max = 0.15 +gravity = Vector3(0, 0, 0) +scale_curve = SubResource("CurveTexture_w3xaq") +color_ramp = SubResource("GradientTexture1D_w3xaq") +alpha_curve = SubResource("CurveTexture_ty63v") +turbulence_enabled = true +turbulence_noise_strength = 0.1 +turbulence_noise_scale = 0.3 +turbulence_influence_min = 0.0 + +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_qc6xg"] +transparency = 1 +vertex_color_use_as_albedo = true +texture_filter = 2 +billboard_mode = 3 +billboard_keep_scale = true +particles_anim_h_frames = 1 +particles_anim_v_frames = 1 +particles_anim_loop = false + +[sub_resource type="QuadMesh" id="QuadMesh_d5bw0"] +material = SubResource("StandardMaterial3D_qc6xg") +size = Vector2(0.02, 0.02) + +[node name="FloatingDust" type="GPUParticles3D"] +amount = 32 +lifetime = 12.0 +fixed_fps = 8 +interpolate = false +fract_delta = false +process_material = SubResource("ParticleProcessMaterial_ty63v") +draw_pass_1 = SubResource("QuadMesh_d5bw0") diff --git a/src/equipment/laser_cast/laser_cast.tscn b/src/equipment/laser_cast/laser_cast.tscn index 179056d..c295a05 100644 --- a/src/equipment/laser_cast/laser_cast.tscn +++ b/src/equipment/laser_cast/laser_cast.tscn @@ -5,6 +5,7 @@ [node name="LaserCast" type="RayCast3D"] target_position = Vector3(0, 0, -2) +collision_mask = 4 script = ExtResource("1_xntcr") [node name="LaserDust" parent="." instance=ExtResource("2_m5xmf")] diff --git a/src/player/player.tscn b/src/player/player.tscn index f8d7ab7..df8f82e 100644 --- a/src/player/player.tscn +++ b/src/player/player.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=9 format=3 uid="uid://bwe2jdmvinhqd"] +[gd_scene load_steps=10 format=3 uid="uid://bwe2jdmvinhqd"] [ext_resource type="Script" uid="uid://buwh0g1ga2aka" path="res://src/player/player.gd" id="1_npueo"] [ext_resource type="Script" uid="uid://cx1yt0drthpw3" path="res://src/player/camera_controller.gd" id="2_veeqv"] @@ -6,11 +6,13 @@ [ext_resource type="PackedScene" uid="uid://d2hnxr5l6w2x4" path="res://src/equipment/wide_spray/wide_spray.tscn" id="3_ibq07"] [ext_resource type="Script" uid="uid://b274q7uvn0cvp" path="res://src/ui/rumbler_3d.gd" id="5_ipd7g"] [ext_resource type="PackedScene" uid="uid://dq1x21tq06dud" path="res://src/ui/hud/player_hud.tscn" id="5_jvafu"] +[ext_resource type="PackedScene" uid="uid://30o8ltnnxpxo" path="res://src/effects/floating_dust.tscn" id="7_o822w"] [sub_resource type="BoxMesh" id="BoxMesh_ua7a2"] size = Vector3(0.05, 0.05, 0.3) [sub_resource type="CapsuleShape3D" id="CapsuleShape3D_s7f0r"] +height = 1.9 [node name="Player" type="CharacterBody3D"] script = ExtResource("1_npueo") @@ -50,7 +52,10 @@ target_position = Vector3(0, 0, -1.5) collision_mask = 2 [node name="CollisionShape3D" type="CollisionShape3D" parent="."] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.05, 0) shape = SubResource("CapsuleShape3D_s7f0r") [node name="PlayerHUD" parent="." instance=ExtResource("5_jvafu")] unique_name_in_owner = true + +[node name="FloatingDust" parent="." instance=ExtResource("7_o822w")] diff --git a/src/props/bulkhead/bulkhead.tscn b/src/props/bulkhead/bulkhead.tscn index 5d1256a..0082fd2 100644 --- a/src/props/bulkhead/bulkhead.tscn +++ b/src/props/bulkhead/bulkhead.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=5 format=3 uid="uid://dvma1hufsl6mc"] +[gd_scene load_steps=7 format=3 uid="uid://dvma1hufsl6mc"] [ext_resource type="PackedScene" uid="uid://bopvgd18a1dl0" path="res://assets/props/bulkhead/bulkhead.gltf" id="1_77udb"] [ext_resource type="Script" uid="uid://rjygr6ybnl30" path="res://src/props/bulkhead/bulkhead.gd" id="2_hknvo"] @@ -9,15 +9,39 @@ data = PackedVector3Array(-1.5, 0, 0.225, -1.5, 3, -0.225, -1.5, 3, 0.225, -1.5, [sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_88qrs"] data = PackedVector3Array(-1.4, 0.1, 0.14, -1.4, 2.9, -0.14, -1.4, 2.9, 0.14, -1.4, 0.1, 0.14, -1.4, 0.1, -0.14, -1.4, 2.9, -0.14, -1.4, 0.1, -0.14, 1.4, 2.9, -0.14, -1.4, 2.9, -0.14, -1.4, 0.1, -0.14, 1.4, 0.1, -0.14, 1.4, 2.9, -0.14, 1.4, 0.1, -0.14, 1.4, 2.9, 0.14, 1.4, 2.9, -0.14, 1.4, 0.1, -0.14, 1.4, 0.1, 0.14, 1.4, 2.9, 0.14, 1.4, 0.1, 0.14, -1.4, 2.9, 0.14, 1.4, 2.9, 0.14, 1.4, 0.1, 0.14, -1.4, 0.1, 0.14, -1.4, 2.9, 0.14, -1.4, 0.1, -0.14, 1.4, 0.1, 0.14, 1.4, 0.1, -0.14, -1.4, 0.1, -0.14, -1.4, 0.1, 0.14, 1.4, 0.1, 0.14, 1.4, 2.9, -0.14, -1.4, 2.9, 0.14, -1.4, 2.9, -0.14, 1.4, 2.9, -0.14, 1.4, 2.9, 0.14, -1.4, 2.9, 0.14) +[sub_resource type="PrismMesh" id="PrismMesh_hknvo"] +left_to_right = 1.0 +size = Vector3(0.2, 0.2, 3) + +[sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_w7oba"] +data = PackedVector3Array(0.1, 0.1, 1.5, 0.1, -0.1, 1.5, -0.1, -0.1, 1.5, 0.1, 0.1, -1.5, -0.1, -0.1, -1.5, 0.1, -0.1, -1.5, 0.1, 0.1, 1.5, 0.1, 0.1, -1.5, 0.1, -0.1, 1.5, 0.1, 0.1, -1.5, 0.1, -0.1, -1.5, 0.1, -0.1, 1.5, 0.1, 0.1, -1.5, 0.1, 0.1, 1.5, -0.1, -0.1, -1.5, 0.1, 0.1, 1.5, -0.1, -0.1, 1.5, -0.1, -0.1, -1.5, -0.1, -0.1, 1.5, 0.1, -0.1, 1.5, -0.1, -0.1, -1.5, 0.1, -0.1, 1.5, 0.1, -0.1, -1.5, -0.1, -0.1, -1.5) + [node name="Bulkhead" instance=ExtResource("1_77udb")] script = ExtResource("2_hknvo") [node name="StaticBody3D" type="StaticBody3D" parent="Frame" index="0"] +collision_layer = 5 [node name="CollisionShape3D" type="CollisionShape3D" parent="Frame/StaticBody3D" index="0"] shape = SubResource("ConcavePolygonShape3D_hknvo") [node name="StaticBody3D" type="StaticBody3D" parent="Door" index="0"] +collision_layer = 5 [node name="CollisionShape3D" type="CollisionShape3D" parent="Door/StaticBody3D" index="0"] shape = SubResource("ConcavePolygonShape3D_88qrs") + +[node name="Ramp" type="StaticBody3D" parent="." index="3"] + +[node name="MeshInstance3D" type="MeshInstance3D" parent="Ramp" index="0"] +transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 0, 0.1, 0.325) +visible = false +mesh = SubResource("PrismMesh_hknvo") + +[node name="CollisionShape3D" type="CollisionShape3D" parent="Ramp" index="1"] +transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 0, 0.1, 0.325) +shape = SubResource("ConcavePolygonShape3D_w7oba") + +[node name="CollisionShape3D2" type="CollisionShape3D" parent="Ramp" index="2"] +transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 0, 0.1, -0.325) +shape = SubResource("ConcavePolygonShape3D_w7oba") diff --git a/src/world/gunk_body/gunk_body.gd b/src/world/gunk_body/gunk_body.gd index 91131d6..cd27d9a 100644 --- a/src/world/gunk_body/gunk_body.gd +++ b/src/world/gunk_body/gunk_body.gd @@ -58,7 +58,11 @@ func _ready() -> void: # Set material gunk mask to our mask viewport texture mat_instance.set_shader_parameter("gunk_mask", mask_viewport.get_texture()) # Set gunk material as the next-pass material of the base surface material - mesh_instance.mesh.surface_get_material(material_surface).next_pass = mat_instance + # Iterate through material passes to the end + var base_mat := mesh_instance.mesh.surface_get_material(material_surface) + while base_mat.next_pass: + base_mat = base_mat.next_pass + base_mat.next_pass = mat_instance if initial_mask: mask_texture.texture = initial_mask diff --git a/src/world/gunk_body/gunk_body.tscn b/src/world/gunk_body/gunk_body.tscn index 27afda2..91bcaeb 100644 --- a/src/world/gunk_body/gunk_body.tscn +++ b/src/world/gunk_body/gunk_body.tscn @@ -6,6 +6,8 @@ [ext_resource type="Script" uid="uid://ba7480ara8eo" path="res://levels/sandbox/debug_draw.gd" id="3_m8wx4"] [node name="GunkBody" type="StaticBody3D"] +collision_layer = 5 +collision_mask = 0 script = ExtResource("1_qqbpr") source_gunk_material = ExtResource("2_hrldx")