diff --git a/assets/wahooney.itch.io/brown_grid_triplanar.tres b/assets/wahooney.itch.io/brown_grid_triplanar.tres index e6825e55..03f70129 100644 --- a/assets/wahooney.itch.io/brown_grid_triplanar.tres +++ b/assets/wahooney.itch.io/brown_grid_triplanar.tres @@ -1,8 +1,8 @@ -[gd_resource type="StandardMaterial3D" load_steps=2 format=2] +[gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://bv2a25s3juvpq"] -[ext_resource path="res://assets/wahooney.itch.io/brown_grid.png" type="Texture2D" id=1] +[ext_resource type="Texture2D" uid="uid://bskwc0drdadnd" path="res://assets/wahooney.itch.io/brown_grid.png" id="1"] [resource] -albedo_texture = ExtResource( 1 ) -uv1_scale = Vector3( 0.5, 0.5, 0.5 ) +albedo_texture = ExtResource("1") +uv1_scale = Vector3(0.25, 0.25, 0.25) uv1_triplanar = true diff --git a/assets/wahooney.itch.io/white_grid_triplanar.tres b/assets/wahooney.itch.io/white_grid_triplanar.tres new file mode 100644 index 00000000..66a52b94 --- /dev/null +++ b/assets/wahooney.itch.io/white_grid_triplanar.tres @@ -0,0 +1,10 @@ +[gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://df8n6yyq0iq8r"] + +[ext_resource type="Texture2D" uid="uid://cqgdloakbawp" path="res://assets/wahooney.itch.io/white_grid.png" id="1_hsc4y"] + +[resource] +diffuse_mode = 1 +albedo_texture = ExtResource("1_hsc4y") +roughness = 0.8 +uv1_scale = Vector3(0.25, 0.25, 0.25) +uv1_triplanar = true diff --git a/scenes/main_menu/main_menu_level.tscn b/scenes/main_menu/main_menu_level.tscn index a4dfa4da..6c2a6c0c 100644 --- a/scenes/main_menu/main_menu_level.tscn +++ b/scenes/main_menu/main_menu_level.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=53 format=3 uid="uid://037lluf8eoy6"] +[gd_scene load_steps=54 format=3 uid="uid://037lluf8eoy6"] [ext_resource type="PackedScene" uid="uid://qbmx03iibuuu" path="res://addons/godot-xr-tools/staging/scene_base.tscn" id="1"] [ext_resource type="Script" path="res://scenes/main_menu/main_menu_level.gd" id="2_taoax"] @@ -40,66 +40,67 @@ [ext_resource type="Texture2D" uid="uid://v4807nasx1dc" path="res://scenes/sprinting_demo/sprinting_demo.png" id="29_h1jn0"] [ext_resource type="Texture2D" uid="uid://cr1l4g7btdyht" path="res://scenes/origin_gravity_demo/origin_gravity_demo.png" id="32_c4n1q"] [ext_resource type="Texture2D" uid="uid://dhd30j0xpcxoi" path="res://scenes/sphere_world_demo/sphere_world_demo.png" id="34_xw8ig"] +[ext_resource type="Texture2D" uid="uid://dd2u7l7q2de65" path="res://scenes/swim_demo/swim demo.png" id="40_i3riy"] -[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_sj2ko"] +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_rnrm6"] animation = &"Grip" -[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_6aaih"] +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_ntjp1"] animation = &"Grip" -[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_brcrv"] +[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_50hdn"] filter_enabled = true filters = ["Armature/Skeleton3D:Little_Distal_L", "Armature/Skeleton3D:Little_Intermediate_L", "Armature/Skeleton3D:Little_Metacarpal_L", "Armature/Skeleton3D:Little_Proximal_L", "Armature/Skeleton3D:Middle_Distal_L", "Armature/Skeleton3D:Middle_Intermediate_L", "Armature/Skeleton3D:Middle_Metacarpal_L", "Armature/Skeleton3D:Middle_Proximal_L", "Armature/Skeleton3D:Ring_Distal_L", "Armature/Skeleton3D:Ring_Intermediate_L", "Armature/Skeleton3D:Ring_Metacarpal_L", "Armature/Skeleton3D:Ring_Proximal_L", "Armature/Skeleton3D:Thumb_Distal_L", "Armature/Skeleton3D:Thumb_Metacarpal_L", "Armature/Skeleton3D:Thumb_Proximal_L", "Armature/Skeleton:Little_Distal_L", "Armature/Skeleton:Little_Intermediate_L", "Armature/Skeleton:Little_Proximal_L", "Armature/Skeleton:Middle_Distal_L", "Armature/Skeleton:Middle_Intermediate_L", "Armature/Skeleton:Middle_Proximal_L", "Armature/Skeleton:Ring_Distal_L", "Armature/Skeleton:Ring_Intermediate_L", "Armature/Skeleton:Ring_Proximal_L", "Armature/Skeleton:Thumb_Distal_L", "Armature/Skeleton:Thumb_Proximal_L"] -[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_248ms"] +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_3biqj"] animation = &"Grip 5" -[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_2gkw7"] +[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_8rubf"] filter_enabled = true filters = ["Armature/Skeleton3D:Index_Distal_L", "Armature/Skeleton3D:Index_Intermediate_L", "Armature/Skeleton3D:Index_Metacarpal_L", "Armature/Skeleton3D:Index_Proximal_L", "Armature/Skeleton:Index_Distal_L", "Armature/Skeleton:Index_Intermediate_L", "Armature/Skeleton:Index_Proximal_L"] -[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_mh5hs"] +[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_yarx7"] graph_offset = Vector2(-536, 11) -nodes/ClosedHand1/node = SubResource("AnimationNodeAnimation_sj2ko") +nodes/ClosedHand1/node = SubResource("AnimationNodeAnimation_rnrm6") nodes/ClosedHand1/position = Vector2(-600, 300) -nodes/ClosedHand2/node = SubResource("AnimationNodeAnimation_6aaih") +nodes/ClosedHand2/node = SubResource("AnimationNodeAnimation_ntjp1") nodes/ClosedHand2/position = Vector2(-360, 300) -nodes/Grip/node = SubResource("AnimationNodeBlend2_brcrv") +nodes/Grip/node = SubResource("AnimationNodeBlend2_50hdn") nodes/Grip/position = Vector2(0, 20) -nodes/OpenHand/node = SubResource("AnimationNodeAnimation_248ms") +nodes/OpenHand/node = SubResource("AnimationNodeAnimation_3biqj") nodes/OpenHand/position = Vector2(-600, 100) -nodes/Trigger/node = SubResource("AnimationNodeBlend2_2gkw7") +nodes/Trigger/node = SubResource("AnimationNodeBlend2_8rubf") nodes/Trigger/position = Vector2(-360, 20) node_connections = [&"Grip", 0, &"Trigger", &"Grip", 1, &"ClosedHand2", &"Trigger", 0, &"OpenHand", &"Trigger", 1, &"ClosedHand1", &"output", 0, &"Grip"] -[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_s4vic"] +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_43aej"] animation = &"Grip" -[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_70e5h"] +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_an6p5"] animation = &"Grip" -[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_6pk6s"] +[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_gs88d"] filter_enabled = true filters = ["Armature/Skeleton3D:Little_Distal_R", "Armature/Skeleton3D:Little_Intermediate_R", "Armature/Skeleton3D:Little_Metacarpal_R", "Armature/Skeleton3D:Little_Proximal_R", "Armature/Skeleton3D:Middle_Distal_R", "Armature/Skeleton3D:Middle_Intermediate_R", "Armature/Skeleton3D:Middle_Metacarpal_R", "Armature/Skeleton3D:Middle_Proximal_R", "Armature/Skeleton3D:Ring_Distal_R", "Armature/Skeleton3D:Ring_Intermediate_R", "Armature/Skeleton3D:Ring_Metacarpal_R", "Armature/Skeleton3D:Ring_Proximal_R", "Armature/Skeleton3D:Thumb_Distal_R", "Armature/Skeleton3D:Thumb_Metacarpal_R", "Armature/Skeleton3D:Thumb_Proximal_R", "Armature/Skeleton:Little_Distal_R", "Armature/Skeleton:Little_Intermediate_R", "Armature/Skeleton:Little_Proximal_R", "Armature/Skeleton:Middle_Distal_R", "Armature/Skeleton:Middle_Intermediate_R", "Armature/Skeleton:Middle_Proximal_R", "Armature/Skeleton:Ring_Distal_R", "Armature/Skeleton:Ring_Intermediate_R", "Armature/Skeleton:Ring_Proximal_R", "Armature/Skeleton:Thumb_Distal_R", "Armature/Skeleton:Thumb_Proximal_R"] -[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_85bwh"] +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_nbjvw"] animation = &"Grip 5" -[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_uijff"] +[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_x4asf"] filter_enabled = true filters = ["Armature/Skeleton3D:Index_Distal_R", "Armature/Skeleton3D:Index_Intermediate_R", "Armature/Skeleton3D:Index_Metacarpal_R", "Armature/Skeleton3D:Index_Proximal_R", "Armature/Skeleton:Index_Distal_R", "Armature/Skeleton:Index_Intermediate_R", "Armature/Skeleton:Index_Proximal_R"] -[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_nh6hc"] +[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_dpxq4"] graph_offset = Vector2(-552.664, 107.301) -nodes/ClosedHand1/node = SubResource("AnimationNodeAnimation_s4vic") +nodes/ClosedHand1/node = SubResource("AnimationNodeAnimation_43aej") nodes/ClosedHand1/position = Vector2(-600, 300) -nodes/ClosedHand2/node = SubResource("AnimationNodeAnimation_70e5h") +nodes/ClosedHand2/node = SubResource("AnimationNodeAnimation_an6p5") nodes/ClosedHand2/position = Vector2(-360, 300) -nodes/Grip/node = SubResource("AnimationNodeBlend2_6pk6s") +nodes/Grip/node = SubResource("AnimationNodeBlend2_gs88d") nodes/Grip/position = Vector2(0, 40) -nodes/OpenHand/node = SubResource("AnimationNodeAnimation_85bwh") +nodes/OpenHand/node = SubResource("AnimationNodeAnimation_nbjvw") nodes/OpenHand/position = Vector2(-600, 100) -nodes/Trigger/node = SubResource("AnimationNodeBlend2_uijff") +nodes/Trigger/node = SubResource("AnimationNodeBlend2_x4asf") nodes/Trigger/position = Vector2(-360, 40) node_connections = [&"Grip", 0, &"Trigger", &"Grip", 1, &"ClosedHand2", &"Trigger", 0, &"OpenHand", &"Trigger", 1, &"ClosedHand1", &"output", 0, &"Grip"] @@ -146,7 +147,7 @@ transform = Transform3D(0.999999, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0) [node name="AnimationTree" parent="XROrigin3D/LeftHand/LeftHand" index="1"] root_node = NodePath("../Hand_low_L") -tree_root = SubResource("AnimationNodeBlendTree_mh5hs") +tree_root = SubResource("AnimationNodeBlendTree_yarx7") [node name="FunctionPoseDetector" parent="XROrigin3D/LeftHand" index="1" instance=ExtResource("5_xgcrx")] @@ -193,7 +194,7 @@ transform = Transform3D(0.999999, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0) [node name="AnimationTree" parent="XROrigin3D/RightHand/RightHand" index="1"] root_node = NodePath("../Hand_low_R") -tree_root = SubResource("AnimationNodeBlendTree_nh6hc") +tree_root = SubResource("AnimationNodeBlendTree_dpxq4") [node name="FunctionPoseDetector" parent="XROrigin3D/RightHand" index="1" instance=ExtResource("5_xgcrx")] @@ -232,70 +233,75 @@ scene = "res://scenes/basic_movement_demo/basic_movement_demo.tscn" title = ExtResource("10") [node name="ToAudioDemo" parent="Demos" index="1" instance=ExtResource("9")] -transform = Transform3D(0.900969, 0, 0.433884, 0, 1, 0, -0.433884, 0, 0.900969, -4.33884, 0, -9.00969) +transform = Transform3D(0.913545, 0, 0.406737, 0, 1, 0, -0.406737, 0, 0.913545, -4.06737, 0, -9.13545) scene = "res://scenes/audio_demo/audio_demo.tscn" title = ExtResource("14_gocl4") [node name="ToTeleportDemo" parent="Demos" index="2" instance=ExtResource("9")] -transform = Transform3D(0.62349, 0, 0.781832, 0, 1, 0, -0.781832, 0, 0.62349, -7.81832, 0, -6.2349) +transform = Transform3D(0.669131, 0, 0.743145, 0, 1, 0, -0.743145, 0, 0.669131, -7.43145, 0, -6.69131) scene = "res://scenes/teleport_demo/teleport_demo.tscn" title = ExtResource("12") [node name="ToWorldGrabDemo" parent="Demos" index="3" instance=ExtResource("9")] -transform = Transform3D(0.222521, 0, 0.974928, 0, 1, 0, -0.974928, 0, 0.222521, -9.74928, 0, -2.22521) +transform = Transform3D(0.309017, 0, 0.951057, 0, 1, 0, -0.951057, 0, 0.309017, -9.51057, 0, -3.09017) scene = "res://scenes/world_grab_demo/world_grab_demo.tscn" title = ExtResource("19_atnye") [node name="ToClimbingGlidingDemo" parent="Demos" index="4" instance=ExtResource("9")] -transform = Transform3D(-0.222521, 0, 0.974928, 0, 1, 0, -0.974928, 0, -0.222521, -9.74928, 0, 2.22521) +transform = Transform3D(-0.104529, 0, 0.994522, 0, 1, 0, -0.994522, 0, -0.104529, -9.94522, 0, 1.04529) scene = "res://scenes/climbing_gliding_demo/climbing_gliding_demo.tscn" title = ExtResource("13") [node name="ToGrapplingDemo" parent="Demos" index="5" instance=ExtResource("9")] -transform = Transform3D(-0.62349, 0, 0.781832, 0, 1, 0, -0.781832, 0, -0.62349, -7.81832, 0, 6.2349) +transform = Transform3D(-0.5, 0, 0.866025, 0, 1, 0, -0.866025, 0, -0.5, -8.66025, 0, 5) scene = "res://scenes/grappling_demo/grappling_demo.tscn" title = ExtResource("16") [node name="ToInteractablesDemo" parent="Demos" index="6" instance=ExtResource("9")] -transform = Transform3D(-0.900969, 0, 0.433884, 0, 1, 0, -0.433884, 0, -0.900969, -4.33884, 0, 9.00969) +transform = Transform3D(-0.809017, 0, 0.587785, 0, 1, 0, -0.587785, 0, -0.809017, -5.87785, 0, 8.09017) scene = "res://scenes/interactables_demo/interactables_demo.tscn" title = ExtResource("17") [node name="ToPointerDemo" parent="Demos" index="7" instance=ExtResource("9")] -transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 8.74228e-07, 0, 10) +transform = Transform3D(-0.978148, 0, 0.207912, 0, 1, 0, -0.207912, 0, -0.978148, -2.07912, 0, 9.78148) scene = "res://scenes/pointer_demo/pointer_demo.tscn" title = ExtResource("20") [node name="ToPickableDemo" parent="Demos" index="8" instance=ExtResource("9")] -transform = Transform3D(-0.900969, 0, -0.433884, 0, 1, 0, 0.433884, 0, -0.900969, 4.33884, 0, 9.00969) +transform = Transform3D(-0.978148, 0, -0.207912, 0, 1, 0, 0.207912, 0, -0.978148, 2.07912, 0, 9.78148) scene = "res://scenes/pickable_demo/pickable_demo.tscn" title = ExtResource("22") [node name="ToPokeDemo" parent="Demos" index="9" instance=ExtResource("9")] -transform = Transform3D(-0.62349, 0, -0.781832, 0, 1, 0, 0.781832, 0, -0.62349, 7.81832, 0, 6.2349) +transform = Transform3D(-0.809017, 0, -0.587785, 0, 1, 0, 0.587785, 0, -0.809017, 5.87785, 0, 8.09017) scene = "res://scenes/poke_demo/poke_demo.tscn" title = ExtResource("25_rg3rn") [node name="ToRumbleDemo" parent="Demos" index="10" instance=ExtResource("9")] -transform = Transform3D(-0.222521, 0, -0.974928, 0, 1, 0, 0.974928, 0, -0.222521, 9.74928, 0, 2.22521) +transform = Transform3D(-0.5, 0, -0.866025, 0, 1, 0, 0.866025, 0, -0.5, 8.66025, 0, 5) scene = "res://scenes/rumble_demo/rumble_demo.tscn" title = ExtResource("26_sg1pa") [node name="ToSprintDemo" parent="Demos" index="11" instance=ExtResource("9")] -transform = Transform3D(0.222521, 0, -0.974928, 0, 1, 0, 0.974928, 0, 0.222521, 9.74928, 0, -2.22521) +transform = Transform3D(-0.104528, 0, -0.994522, 0, 1, 0, 0.994522, 0, -0.104528, 9.94522, 0, 1.04528) scene = "res://scenes/sprinting_demo/sprinting_demo.tscn" title = ExtResource("29_h1jn0") [node name="ToOriginGravityDemo" parent="Demos" index="12" instance=ExtResource("9")] -transform = Transform3D(0.62349, 0, -0.781832, 0, 1, 0, 0.781832, 0, 0.62349, 7.81832, 0, -6.2349) +transform = Transform3D(0.309017, 0, -0.951056, 0, 1, 0, 0.951056, 0, 0.309017, 9.51056, 0, -3.09017) scene = "res://scenes/origin_gravity_demo/origin_gravity_demo.tscn" title = ExtResource("32_c4n1q") [node name="ToSphereWorldDemo" parent="Demos" index="13" instance=ExtResource("9")] -transform = Transform3D(0.900969, 0, -0.433884, 0, 1, 0, 0.433884, 0, 0.900969, 4.33884, 0, -9.00969) +transform = Transform3D(0.669131, 0, -0.743145, 0, 1, 0, 0.743145, 0, 0.669131, 7.43145, 0, -6.69131) scene = "res://scenes/sphere_world_demo/sphere_world_demo.tscn" title = ExtResource("34_xw8ig") +[node name="ToSwimmingDemo" parent="Demos" index="14" instance=ExtResource("9")] +transform = Transform3D(0.913546, 0, -0.406736, 0, 1, 0, 0.406736, 0, 0.913546, 4.06736, 0, -9.13546) +scene = "res://scenes/swim_demo/swim_demo.tscn" +title = ExtResource("40_i3riy") + [node name="SettingsUI" parent="." index="3" instance=ExtResource("26_0uyxa")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -1.5) diff --git a/scenes/swim_demo/objects/instructions.tscn b/scenes/swim_demo/objects/instructions.tscn new file mode 100644 index 00000000..27dca639 --- /dev/null +++ b/scenes/swim_demo/objects/instructions.tscn @@ -0,0 +1,24 @@ +[gd_scene load_steps=5 format=3 uid="uid://cap4i60th5v7v"] + +[ext_resource type="PackedScene" uid="uid://clujaf3u776a3" path="res://addons/godot-xr-tools/objects/viewport_2d_in_3d.tscn" id="1_ppayj"] +[ext_resource type="PackedScene" uid="uid://b45jxqo2nss1h" path="res://scenes/swim_demo/objects/instructions_2d.tscn" id="2_m8jyc"] +[ext_resource type="Material" path="res://assets/wahooney.itch.io/brown_grid_triplanar.tres" id="3_corps"] + +[sub_resource type="BoxMesh" id="1"] +material = ExtResource("3_corps") +size = Vector3(4.2, 2.7, 0.1) + +[node name="Instructions" type="Node3D"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 4, -4) + +[node name="Viewport2Din3D" parent="." instance=ExtResource("1_ppayj")] +screen_size = Vector2(4, 2.5) +viewport_size = Vector2(400, 250) +unshaded = true +scene = ExtResource("2_m8jyc") +update_mode = 0 +collision_layer = 0 + +[node name="MeshInstance" type="MeshInstance3D" parent="."] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.1) +mesh = SubResource("1") diff --git a/scenes/swim_demo/objects/instructions_2d.tscn b/scenes/swim_demo/objects/instructions_2d.tscn new file mode 100644 index 00000000..276326bf --- /dev/null +++ b/scenes/swim_demo/objects/instructions_2d.tscn @@ -0,0 +1,36 @@ +[gd_scene format=3 uid="uid://b45jxqo2nss1h"] + +[node name="Instructions" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="ColorRect" type="ColorRect" parent="."] +layout_mode = 1 +offset_right = 400.0 +offset_bottom = 250.0 +color = Color(0, 0, 0, 0.87451) + +[node name="Description" type="RichTextLabel" parent="."] +layout_mode = 0 +offset_left = 10.0 +offset_top = 10.0 +offset_right = 390.0 +offset_bottom = 240.0 +theme_override_constants/line_separation = -3 +theme_override_font_sizes/normal_font_size = 12 +text = "Swim Demo + +This scene demonstrates example swimming. Advanced rendering options such as Volume Fog can be added based on the choice of renderer. + + > Left Controller: + - Direct Movement: U/D/L/R Joystick + - Flight Movement: U/D/L/R Joystick + + > Right Controller: + - Direct Movement: U/D Joystick + - Turning: L/R Joystick +" diff --git a/scenes/swim_demo/objects/pool.glb b/scenes/swim_demo/objects/pool.glb new file mode 100644 index 00000000..badb8480 Binary files /dev/null and b/scenes/swim_demo/objects/pool.glb differ diff --git a/scenes/swim_demo/objects/pool.glb.import b/scenes/swim_demo/objects/pool.glb.import new file mode 100644 index 00000000..200a83d1 --- /dev/null +++ b/scenes/swim_demo/objects/pool.glb.import @@ -0,0 +1,34 @@ +[remap] + +importer="scene" +importer_version=1 +type="PackedScene" +uid="uid://dlqc6gt45lgbe" +path="res://.godot/imported/pool.glb-ecae400b9491d3660f646a7fb6541e7f.scn" + +[deps] + +source_file="res://scenes/swim_demo/objects/pool.glb" +dest_files=["res://.godot/imported/pool.glb-ecae400b9491d3660f646a7fb6541e7f.scn"] + +[params] + +nodes/root_type="" +nodes/root_name="" +nodes/apply_root_scale=true +nodes/root_scale=1.0 +meshes/ensure_tangents=true +meshes/generate_lods=true +meshes/create_shadow_meshes=true +meshes/light_baking=1 +meshes/lightmap_texel_size=0.2 +meshes/force_disable_compression=false +skins/use_named_skins=true +animation/import=true +animation/fps=30 +animation/trimming=false +animation/remove_immutable_tracks=true +import_script/path="" +_subresources={} +gltf/naming_version=1 +gltf/embedded_image_handling=0 diff --git a/scenes/swim_demo/objects/swim_area.gd b/scenes/swim_demo/objects/swim_area.gd new file mode 100644 index 00000000..7c7a8108 --- /dev/null +++ b/scenes/swim_demo/objects/swim_area.gd @@ -0,0 +1,16 @@ +extends Area3D + +func _on_body_entered(body): + if body is XRToolsPlayerBody: + if !body.get_parent().has_node("MovementFlight"): + printerr("Flight Area tried to find MovementFlight, but it could not...") + return + body.get_parent().get_node("MovementFlight").set_flying(true) + + +func _on_body_exited(body): + if body is XRToolsPlayerBody: + if !body.get_parent().has_node("MovementFlight"): + printerr("Flight Area tried to find MovementFlight, but it could not...") + return + body.get_parent().get_node("MovementFlight").set_flying(false) diff --git a/scenes/swim_demo/objects/swim_map.tscn b/scenes/swim_demo/objects/swim_map.tscn new file mode 100644 index 00000000..8d7c2fa2 --- /dev/null +++ b/scenes/swim_demo/objects/swim_map.tscn @@ -0,0 +1,79 @@ +[gd_scene load_steps=7 format=3 uid="uid://bjuel0yobnb7l"] + +[ext_resource type="Material" uid="uid://cewxwlcx1csqy" path="res://assets/wahooney.itch.io/green_grid_triplanar.tres" id="1_isyto"] +[ext_resource type="Material" uid="uid://bv2a25s3juvpq" path="res://assets/wahooney.itch.io/brown_grid_triplanar.tres" id="2_bp8ee"] +[ext_resource type="PackedScene" uid="uid://dlqc6gt45lgbe" path="res://scenes/swim_demo/objects/pool.glb" id="3_pw4d0"] +[ext_resource type="Material" uid="uid://df8n6yyq0iq8r" path="res://assets/wahooney.itch.io/white_grid_triplanar.tres" id="4_k7u7d"] + +[sub_resource type="QuadMesh" id="8"] +size = Vector2(96, 16) + +[sub_resource type="BoxShape3D" id="4"] +size = Vector3(100, 16, 2) + +[node name="SwimMap" type="Node3D"] + +[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."] +transform = Transform3D(0.866025, -0.321394, 0.383022, 0, 0.766044, 0.642788, -0.5, -0.55667, 0.663414, 0, 5, 0) +light_energy = 0.8 + +[node name="Wall1" type="StaticBody3D" parent="."] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -48) + +[node name="MeshInstance3D" type="MeshInstance3D" parent="Wall1"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 8, 0) +mesh = SubResource("8") +skeleton = NodePath("../..") +surface_material_override/0 = ExtResource("1_isyto") + +[node name="CollisionShape3D" type="CollisionShape3D" parent="Wall1"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 8, -1) +shape = SubResource("4") + +[node name="Wall2" type="StaticBody3D" parent="."] +transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 48, 0, 0) + +[node name="MeshInstance3D" type="MeshInstance3D" parent="Wall2"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 8, 0) +mesh = SubResource("8") +skeleton = NodePath("../..") +surface_material_override/0 = ExtResource("1_isyto") + +[node name="CollisionShape3D" type="CollisionShape3D" parent="Wall2"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 8, -1) +shape = SubResource("4") + +[node name="Wall3" type="StaticBody3D" parent="."] +transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, 48) + +[node name="MeshInstance3D" type="MeshInstance3D" parent="Wall3"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 8, 0) +mesh = SubResource("8") +skeleton = NodePath("../..") +surface_material_override/0 = ExtResource("1_isyto") + +[node name="CollisionShape3D" type="CollisionShape3D" parent="Wall3"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 8, -1) +shape = SubResource("4") + +[node name="Wall4" type="StaticBody3D" parent="."] +transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -48, 0, 0) + +[node name="MeshInstance3D" type="MeshInstance3D" parent="Wall4"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 8, 0) +mesh = SubResource("8") +skeleton = NodePath("../..") +surface_material_override/0 = ExtResource("1_isyto") + +[node name="CollisionShape3D" type="CollisionShape3D" parent="Wall4"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 8, -1) +shape = SubResource("4") + +[node name="pool" parent="." instance=ExtResource("3_pw4d0")] + +[node name="Pool" parent="pool" index="4"] +surface_material_override/0 = ExtResource("1_isyto") +surface_material_override/1 = ExtResource("4_k7u7d") +surface_material_override/2 = ExtResource("2_bp8ee") + +[editable path="pool"] diff --git a/scenes/swim_demo/objects/water_shader.gdshader b/scenes/swim_demo/objects/water_shader.gdshader new file mode 100644 index 00000000..1e92fc9f --- /dev/null +++ b/scenes/swim_demo/objects/water_shader.gdshader @@ -0,0 +1,42 @@ +shader_type spatial; +render_mode cull_disabled; + +// Water material properties +uniform vec3 albedo : source_color = vec3(0.0, 0.0, 0.4); +uniform float metallic : hint_range(0.0, 1.0) = 0.0; +uniform float roughness : hint_range(0.0, 1.0) = 0.02; +uniform float alpha = 0.7; + +// Noise scale and texture +uniform float scale = 0.05; +uniform sampler2D normal_texture; +uniform sampler2D wave_texture; + +void vertex() { + // Get the world X/Z coordinates + vec2 world = (MODEL_MATRIX * vec4(VERTEX, 1.0)).xz; + float noise = texture(wave_texture, world + TIME / 5.0).r; + + VERTEX.y += noise * 0.2; +} + +void fragment() { + // Get the world X/Z coordinates + vec2 world = (INV_VIEW_MATRIX * vec4(VERTEX, 1.0)).xz * scale; + + // Calculate two time-varying offsets to the noise texture + vec2 offset1 = vec2(0.05, 0.0) * sin(TIME / 5.0 * PI); + vec2 offset2 = vec2(0.0, 0.05) * cos(TIME / 5.0 * PI); + + // Sample the noise texture at the two offsets and blend + vec3 normal1v = texture(normal_texture, world + offset1).rgb; + vec3 normal2v = texture(normal_texture, world + offset2).rgb; + vec3 normal = mix(normal1v, normal2v, 0.5); + + // Set the outputs + ALBEDO = albedo; + METALLIC = metallic; + ROUGHNESS = roughness; + NORMAL_MAP = normal; + ALPHA = alpha; +} \ No newline at end of file diff --git a/scenes/swim_demo/swim demo.png b/scenes/swim_demo/swim demo.png new file mode 100644 index 00000000..c7abecc2 Binary files /dev/null and b/scenes/swim_demo/swim demo.png differ diff --git a/scenes/swim_demo/swim demo.png.import b/scenes/swim_demo/swim demo.png.import new file mode 100644 index 00000000..c0edcaa0 --- /dev/null +++ b/scenes/swim_demo/swim demo.png.import @@ -0,0 +1,36 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dd2u7l7q2de65" +path.s3tc="res://.godot/imported/swim demo.png-68e418131c0f315222da038696c9d228.s3tc.ctex" +path.etc2="res://.godot/imported/swim demo.png-68e418131c0f315222da038696c9d228.etc2.ctex" +metadata={ +"imported_formats": ["s3tc_bptc", "etc2_astc"], +"vram_texture": true +} + +[deps] + +source_file="res://scenes/swim_demo/swim demo.png" +dest_files=["res://.godot/imported/swim demo.png-68e418131c0f315222da038696c9d228.s3tc.ctex", "res://.godot/imported/swim demo.png-68e418131c0f315222da038696c9d228.etc2.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/scenes/swim_demo/swim_demo.tscn b/scenes/swim_demo/swim_demo.tscn new file mode 100644 index 00000000..705096f3 --- /dev/null +++ b/scenes/swim_demo/swim_demo.tscn @@ -0,0 +1,125 @@ +[gd_scene load_steps=25 format=3 uid="uid://cup0itbt0cr3a"] + +[ext_resource type="PackedScene" uid="uid://qbmx03iibuuu" path="res://addons/godot-xr-tools/staging/scene_base.tscn" id="1_hh5kg"] +[ext_resource type="Script" path="res://scenes/demo_scene_base.gd" id="2_oyddf"] +[ext_resource type="PackedScene" uid="uid://b4kad2kuba1yn" path="res://addons/godot-xr-tools/hands/scenes/lowpoly/left_hand_low.tscn" id="3_pllxu"] +[ext_resource type="PackedScene" uid="uid://bl2nuu3qhlb5k" path="res://addons/godot-xr-tools/functions/movement_direct.tscn" id="4_nrdle"] +[ext_resource type="PackedScene" uid="uid://c2q5phg8w08o" path="res://addons/godot-xr-tools/functions/movement_jump.tscn" id="5_fq8ff"] +[ext_resource type="PackedScene" uid="uid://clt88d5d1dje4" path="res://addons/godot-xr-tools/functions/movement_crouch.tscn" id="6_7hgaq"] +[ext_resource type="PackedScene" uid="uid://l2n30mpbkdyw" path="res://addons/godot-xr-tools/hands/scenes/lowpoly/right_hand_low.tscn" id="7_4gmht"] +[ext_resource type="PackedScene" uid="uid://b6bk2pj8vbj28" path="res://addons/godot-xr-tools/functions/movement_turn.tscn" id="8_0mkhw"] +[ext_resource type="PackedScene" uid="uid://diyu06cw06syv" path="res://addons/godot-xr-tools/player/player_body.tscn" id="9_8t4w8"] +[ext_resource type="PackedScene" uid="uid://bjuel0yobnb7l" path="res://scenes/swim_demo/objects/swim_map.tscn" id="10_1enq8"] +[ext_resource type="PackedScene" uid="uid://kyhaogt0a4q8" path="res://addons/godot-xr-tools/functions/movement_flight.tscn" id="10_a44gs"] +[ext_resource type="PackedScene" uid="uid://3a6wjr3a13vd" path="res://assets/meshes/teleport/teleport.tscn" id="11_2rbjy"] +[ext_resource type="Texture2D" uid="uid://ckw6nliyayo6a" path="res://scenes/main_menu/return to main menu.png" id="12_qpg8h"] +[ext_resource type="PackedScene" uid="uid://cap4i60th5v7v" path="res://scenes/swim_demo/objects/instructions.tscn" id="14_eqdep"] +[ext_resource type="Script" path="res://scenes/swim_demo/objects/swim_area.gd" id="15_pjwfr"] +[ext_resource type="Shader" path="res://scenes/swim_demo/objects/water_shader.gdshader" id="16_k8nhe"] +[ext_resource type="Environment" uid="uid://c75hc5t2ml5re" path="res://demo_env.tres" id="17_sr5p1"] + +[sub_resource type="BoxShape3D" id="BoxShape3D_nkslp"] +size = Vector3(58, 6, 58) + +[sub_resource type="PlaneMesh" id="PlaneMesh_26y0g"] +size = Vector2(58, 58) +subdivide_width = 10 +subdivide_depth = 10 + +[sub_resource type="FastNoiseLite" id="FastNoiseLite_kifw3"] +noise_type = 3 +frequency = 0.005 +fractal_type = 2 + +[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_jc332"] +generate_mipmaps = false +seamless = true +as_normal_map = true +bump_strength = 1.5 +noise = SubResource("FastNoiseLite_kifw3") + +[sub_resource type="FastNoiseLite" id="FastNoiseLite_a1mja"] +frequency = 0.001 + +[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_g0i0a"] +seamless = true +noise = SubResource("FastNoiseLite_a1mja") + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_u86hi"] +render_priority = 0 +shader = ExtResource("16_k8nhe") +shader_parameter/albedo = Color(0, 0, 0.4, 1) +shader_parameter/metallic = 0.0 +shader_parameter/roughness = 0.02 +shader_parameter/alpha = 0.7 +shader_parameter/scale = 0.2 +shader_parameter/normal_texture = SubResource("NoiseTexture2D_jc332") +shader_parameter/wave_texture = SubResource("NoiseTexture2D_g0i0a") + +[node name="SwimDemo" instance=ExtResource("1_hh5kg")] +script = ExtResource("2_oyddf") + +[node name="XROrigin3D" parent="." index="0"] +transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, -32, 0, 0) + +[node name="LeftHand" parent="XROrigin3D/LeftHand" index="0" instance=ExtResource("3_pllxu")] + +[node name="MovementDirect" parent="XROrigin3D/LeftHand" index="1" instance=ExtResource("4_nrdle")] +strafe = true + +[node name="MovementJump" parent="XROrigin3D/LeftHand" index="2" instance=ExtResource("5_fq8ff")] +jump_button_action = "ax_button" + +[node name="MovementCrouch" parent="XROrigin3D/LeftHand" index="3" instance=ExtResource("6_7hgaq")] +crouch_height = 1.3 +crouch_button_action = "by_button" + +[node name="RightHand" parent="XROrigin3D/RightHand" index="0" instance=ExtResource("7_4gmht")] + +[node name="MovementDirect" parent="XROrigin3D/RightHand" index="1" instance=ExtResource("4_nrdle")] + +[node name="MovementTurn" parent="XROrigin3D/RightHand" index="2" instance=ExtResource("8_0mkhw")] + +[node name="MovementJump" parent="XROrigin3D/RightHand" index="3" instance=ExtResource("5_fq8ff")] +jump_button_action = "ax_button" + +[node name="MovementCrouch" parent="XROrigin3D/RightHand" index="4" instance=ExtResource("6_7hgaq")] +crouch_height = 1.3 +crouch_button_action = "by_button" +crouch_type = 1 + +[node name="PlayerBody" parent="XROrigin3D" index="3" instance=ExtResource("9_8t4w8")] + +[node name="MovementFlight" parent="XROrigin3D" index="4" instance=ExtResource("10_a44gs")] +flight_button = "none" +speed_scale = 3.0 + +[node name="SwimMap" parent="." index="1" instance=ExtResource("10_1enq8")] + +[node name="MainMenuTeleport" parent="." index="2" instance=ExtResource("11_2rbjy")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -36, 0, 0) +title = ExtResource("12_qpg8h") + +[node name="Instructions" parent="." index="3" instance=ExtResource("14_eqdep")] +transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, -26, 4, 0) + +[node name="SwimArea" type="Area3D" parent="." index="4"] +collision_layer = 0 +collision_mask = 524288 +monitorable = false +script = ExtResource("15_pjwfr") + +[node name="CollisionShape3D" type="CollisionShape3D" parent="SwimArea" index="0"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -3.2, 0) +shape = SubResource("BoxShape3D_nkslp") + +[node name="WaterPlane" type="MeshInstance3D" parent="." index="5"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.3, 0) +mesh = SubResource("PlaneMesh_26y0g") +surface_material_override/0 = SubResource("ShaderMaterial_u86hi") + +[node name="WorldEnvironment" type="WorldEnvironment" parent="." index="6"] +environment = ExtResource("17_sr5p1") + +[connection signal="body_entered" from="SwimArea" to="SwimArea" method="_on_body_entered"] +[connection signal="body_exited" from="SwimArea" to="SwimArea" method="_on_body_exited"]