summaryrefslogtreecommitdiffstats
path: root/world/obstacles
diff options
context:
space:
mode:
authordusoleil <howcansocksbereal@gmail.com>2022-09-19 06:28:21 -0400
committerdusoleil <howcansocksbereal@gmail.com>2022-09-19 06:28:21 -0400
commit9bc2a0767e15d4dde7fd6231b07882d6456af71e (patch)
tree1cc9b88eadf86c7df16ed01418cf64d0c8b92d3b /world/obstacles
parent354287265bda1448935c05e76455cff18d57f5da (diff)
downloadgodot_wildjam_49-9bc2a0767e15d4dde7fd6231b07882d6456af71e.tar.gz
godot_wildjam_49-9bc2a0767e15d4dde7fd6231b07882d6456af71e.zip
Use MultiMesh to dramatically increase performance of generated world
Diffstat (limited to '')
-rw-r--r--world/obstacles/Rock.tscn33
-rw-r--r--world/obstacles/Rock_mat.tres21
-rw-r--r--world/obstacles/Rock_mesh.tres4
3 files changed, 31 insertions, 27 deletions
diff --git a/world/obstacles/Rock.tscn b/world/obstacles/Rock.tscn
index 3b50ff3..819e9a8 100644
--- a/world/obstacles/Rock.tscn
+++ b/world/obstacles/Rock.tscn
@@ -1,34 +1,13 @@
-[gd_scene load_steps=10 format=2]
+[gd_scene load_steps=7 format=2]
[ext_resource path="res://world/obstacles/Rock.gd" type="Script" id=1]
[ext_resource path="res://world/chunk/helper/ChunkedMeshInstance.gd" type="Script" id=2]
+[ext_resource path="res://world/obstacles/Rock_mesh.tres" type="PrismMesh" id=3]
+[ext_resource path="res://world/obstacles/Rock_mat.tres" type="Material" id=4]
[sub_resource type="ConvexPolygonShape" id=2]
points = PoolVector3Array( 2.5, -5, 2.5, 2.5, -5, -2.5, -2.5, -5, -2.5, -2.5, -5, 2.5, 0, 5, 2.5, 0, 5, -2.5 )
-[sub_resource type="OpenSimplexNoise" id=3]
-octaves = 4
-period = 32.0
-
-[sub_resource type="NoiseTexture" id=4]
-noise = SubResource( 3 )
-
-[sub_resource type="NoiseTexture" id=5]
-seamless = true
-as_normalmap = true
-bump_strength = 32.0
-noise = SubResource( 3 )
-
-[sub_resource type="SpatialMaterial" id=6]
-albedo_color = Color( 0.231373, 0.231373, 0.231373, 1 )
-albedo_texture = SubResource( 4 )
-normal_enabled = true
-normal_scale = 1.0
-normal_texture = SubResource( 5 )
-
-[sub_resource type="PrismMesh" id=1]
-size = Vector3( 5, 10, 5 )
-
[sub_resource type="CubeMesh" id=9]
size = Vector3( 5, 10, 5 )
@@ -42,12 +21,12 @@ shape = SubResource( 2 )
[node name="MeshInstance" type="MeshInstance" parent="."]
visible = false
-material_override = SubResource( 6 )
+material_override = ExtResource( 4 )
script = ExtResource( 2 )
-_mesh = SubResource( 1 )
+_mesh = ExtResource( 3 )
[node name="MeshInstance2" type="MeshInstance" parent="."]
visible = false
-material_override = SubResource( 6 )
+material_override = ExtResource( 4 )
script = ExtResource( 2 )
_mesh = SubResource( 9 )
diff --git a/world/obstacles/Rock_mat.tres b/world/obstacles/Rock_mat.tres
new file mode 100644
index 0000000..8547487
--- /dev/null
+++ b/world/obstacles/Rock_mat.tres
@@ -0,0 +1,21 @@
+[gd_resource type="SpatialMaterial" load_steps=4 format=2]
+
+[sub_resource type="OpenSimplexNoise" id=3]
+octaves = 4
+period = 32.0
+
+[sub_resource type="NoiseTexture" id=4]
+noise = SubResource( 3 )
+
+[sub_resource type="NoiseTexture" id=5]
+seamless = true
+as_normalmap = true
+bump_strength = 32.0
+noise = SubResource( 3 )
+
+[resource]
+albedo_color = Color( 0.231373, 0.231373, 0.231373, 1 )
+albedo_texture = SubResource( 4 )
+normal_enabled = true
+normal_scale = 1.0
+normal_texture = SubResource( 5 )
diff --git a/world/obstacles/Rock_mesh.tres b/world/obstacles/Rock_mesh.tres
new file mode 100644
index 0000000..bced5b6
--- /dev/null
+++ b/world/obstacles/Rock_mesh.tres
@@ -0,0 +1,4 @@
+[gd_resource type="PrismMesh" format=2]
+
+[resource]
+size = Vector3( 5, 10, 5 )