summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--Float.gd2
-rw-r--r--Main.tscn47
-rw-r--r--project.godot2
-rw-r--r--water/Water.gd (renamed from Water.gd)0
-rw-r--r--water/Water.tscn46
-rw-r--r--water/Wave.gd (renamed from Wave.gd)0
-rw-r--r--water/Wave.gdshader (renamed from Wave.gdshader)0
7 files changed, 52 insertions, 45 deletions
diff --git a/Float.gd b/Float.gd
index 7855bea..4cf7dda 100644
--- a/Float.gd
+++ b/Float.gd
@@ -5,7 +5,7 @@ var angular_drag = 0.5
func _physics_process(_delta):
var parent = get_parent()
- var water = get_node("/root/Main/Water")
+ var water = get_node("/root/Main/Water/MeshInstance")
#self.global_transform.origin.y = water.height(self.global_transform.origin)
var height = self.global_transform.origin.y
var wave_height = water.height(self.global_transform.origin)
diff --git a/Main.tscn b/Main.tscn
index 2906276..1c1c29b 100644
--- a/Main.tscn
+++ b/Main.tscn
@@ -1,10 +1,9 @@
-[gd_scene load_steps=19 format=2]
+[gd_scene load_steps=14 format=2]
[ext_resource path="res://character/fps_controller/fps_controller.tscn" type="PackedScene" id=1]
[ext_resource path="res://icon.png" type="Texture" id=2]
+[ext_resource path="res://water/Water.tscn" type="PackedScene" id=3]
[ext_resource path="res://Float.tscn" type="PackedScene" id=4]
-[ext_resource path="res://Water.gd" type="Script" id=5]
-[ext_resource path="res://Wave.gdshader" type="Shader" id=7]
[sub_resource type="BoxShape" id=1]
extents = Vector3( 5, 0.5, 5 )
@@ -16,32 +15,6 @@ size = Vector3( 10, 1, 10 )
albedo_texture = ExtResource( 2 )
uv1_triplanar = true
-[sub_resource type="PlaneMesh" id=9]
-size = Vector2( 500, 500 )
-subdivide_width = 500
-subdivide_depth = 500
-
-[sub_resource type="OpenSimplexNoise" id=17]
-
-[sub_resource type="NoiseTexture" id=18]
-seamless = true
-as_normalmap = true
-noise = SubResource( 17 )
-
-[sub_resource type="ShaderMaterial" id=11]
-shader = ExtResource( 7 )
-shader_param/wave1 = Quat( 0.25, 0.10472, 2.38732, 509.65 )
-shader_param/wave1_dir = Vector2( 1, 1 )
-shader_param/wave2 = Quat( 0.25, 0.202683, 1.23345, 366.334 )
-shader_param/wave2_dir = Vector2( 1, 0.6 )
-shader_param/wave3 = Quat( 0.25, 0.349066, 0.716197, 279.147 )
-shader_param/wave3_dir = Vector2( 1, 1.3 )
-shader_param/water_colour = Color( 0.694118, 0.945098, 0.941176, 0.368627 )
-shader_param/deep_water_colour = Color( 0.25098, 0.623529, 0.788235, 0.54902 )
-shader_param/foam_amount = 0.6
-shader_param/murkiness = 4.0
-shader_param/noise = SubResource( 18 )
-
[sub_resource type="BoxShape" id=19]
extents = Vector3( 250, 1, 250 )
@@ -96,20 +69,8 @@ transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -5.0045, 0, 5.02626 )
[node name="DirectionalLight" type="DirectionalLight" parent="."]
transform = Transform( 0.863334, 0.0994421, -0.494738, 0, 0.980392, 0.197058, 0.504633, -0.170127, 0.846406, -12.2908, 5.96757, 0 )
-[node name="Water" type="MeshInstance" parent="."]
-transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00538254, -1.02502, 0.0534515 )
-mesh = SubResource( 9 )
-material/0 = SubResource( 11 )
-script = ExtResource( 5 )
-wave1_steepness = 0.25
-wave1_wavelength = 60.0
-wave1_direction = Vector2( 1, 1 )
-wave2_steepness = 0.25
-wave2_wavelength = 31.0
-wave2_direction = Vector2( 1, 0.6 )
-wave3_steepness = 0.25
-wave3_wavelength = 18.0
-wave3_direction = Vector2( 1, 1.3 )
+[node name="Water" parent="." instance=ExtResource( 3 )]
+transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1, 0 )
[node name="Ground" type="StaticBody" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -10, 0 )
diff --git a/project.godot b/project.godot
index 75d4b3d..fea7a33 100644
--- a/project.godot
+++ b/project.godot
@@ -12,7 +12,7 @@ _global_script_classes=[ {
"base": "Resource",
"class": "Wave",
"language": "GDScript",
-"path": "res://Wave.gd"
+"path": "res://water/Wave.gd"
} ]
_global_script_class_icons={
"Wave": ""
diff --git a/Water.gd b/water/Water.gd
index da7666c..da7666c 100644
--- a/Water.gd
+++ b/water/Water.gd
diff --git a/water/Water.tscn b/water/Water.tscn
new file mode 100644
index 0000000..0cf4a50
--- /dev/null
+++ b/water/Water.tscn
@@ -0,0 +1,46 @@
+[gd_scene load_steps=7 format=2]
+
+[ext_resource path="res://water/Wave.gdshader" type="Shader" id=1]
+[ext_resource path="res://water/Water.gd" type="Script" id=2]
+
+[sub_resource type="PlaneMesh" id=9]
+size = Vector2( 500, 500 )
+subdivide_width = 500
+subdivide_depth = 500
+
+[sub_resource type="OpenSimplexNoise" id=17]
+
+[sub_resource type="NoiseTexture" id=18]
+seamless = true
+as_normalmap = true
+noise = SubResource( 17 )
+
+[sub_resource type="ShaderMaterial" id=11]
+shader = ExtResource( 1 )
+shader_param/wave1 = Quat( 0.25, 0.10472, 2.38732, 2652.57 )
+shader_param/wave1_dir = Vector2( 1, 1 )
+shader_param/wave2 = Quat( 0.25, 0.202683, 1.23345, 1906.65 )
+shader_param/wave2_dir = Vector2( 1, 0.6 )
+shader_param/wave3 = Quat( 0.25, 0.349066, 0.716197, 1452.87 )
+shader_param/wave3_dir = Vector2( 1, 1.3 )
+shader_param/water_colour = Color( 0.694118, 0.945098, 0.941176, 0.368627 )
+shader_param/deep_water_colour = Color( 0.25098, 0.623529, 0.788235, 0.54902 )
+shader_param/foam_amount = 0.6
+shader_param/murkiness = 4.0
+shader_param/noise = SubResource( 18 )
+
+[node name="Water" type="Spatial"]
+
+[node name="MeshInstance" type="MeshInstance" parent="."]
+mesh = SubResource( 9 )
+material/0 = SubResource( 11 )
+script = ExtResource( 2 )
+wave1_steepness = 0.25
+wave1_wavelength = 60.0
+wave1_direction = Vector2( 1, 1 )
+wave2_steepness = 0.25
+wave2_wavelength = 31.0
+wave2_direction = Vector2( 1, 0.6 )
+wave3_steepness = 0.25
+wave3_wavelength = 18.0
+wave3_direction = Vector2( 1, 1.3 )
diff --git a/Wave.gd b/water/Wave.gd
index c876831..c876831 100644
--- a/Wave.gd
+++ b/water/Wave.gd
diff --git a/Wave.gdshader b/water/Wave.gdshader
index 9e4aff3..9e4aff3 100644
--- a/Wave.gdshader
+++ b/water/Wave.gdshader