From dfc6b2b98755fa583286395c2bf6a08b30bfa56f Mon Sep 17 00:00:00 2001 From: Malfurious Date: Wed, 14 Sep 2022 04:38:20 -0400 Subject: Extend water area to 10km x 10km Horizon LOS in water should be typically around 5km, so extend the dimentions of the water to allow 5km in any direction. With regard to the wave shader, we extend the original MeshInstance to 2000x2000 using a reasonable tradeoff of virtex subdivisions. The remainder of the area is covered by another water plane, subdivided to a much lower level of detail. The area at the center of the large 'outer' water plane is subtracted so that the two do not overlap. Co-authored-by: dusoleil --- water/Water.tscn | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'water') diff --git a/water/Water.tscn b/water/Water.tscn index 0cf4a50..3724e82 100644 --- a/water/Water.tscn +++ b/water/Water.tscn @@ -1,10 +1,10 @@ -[gd_scene load_steps=7 format=2] +[gd_scene load_steps=9 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 ) +size = Vector2( 2000, 2000 ) subdivide_width = 500 subdivide_depth = 500 @@ -29,6 +29,14 @@ shader_param/foam_amount = 0.6 shader_param/murkiness = 4.0 shader_param/noise = SubResource( 18 ) +[sub_resource type="PlaneMesh" id=19] +size = Vector2( 10000, 10000 ) +subdivide_width = 100 +subdivide_depth = 100 + +[sub_resource type="PlaneMesh" id=20] +size = Vector2( 2000, 2000 ) + [node name="Water" type="Spatial"] [node name="MeshInstance" type="MeshInstance" parent="."] @@ -44,3 +52,11 @@ wave2_direction = Vector2( 1, 0.6 ) wave3_steepness = 0.25 wave3_wavelength = 18.0 wave3_direction = Vector2( 1, 1.3 ) + +[node name="CSGMesh" type="CSGMesh" parent="."] +mesh = SubResource( 19 ) +material = SubResource( 11 ) + +[node name="CSGMesh" type="CSGMesh" parent="CSGMesh"] +operation = 2 +mesh = SubResource( 20 ) -- cgit v1.2.3