update 3d render

pull/7/head
Valentin Stark 3 years ago
parent 8b7788fe49
commit 85a5520013
  1. 4
      world/World.gd
  2. 2
      world/game.gd
  3. 6
      world/game.tscn
  4. BIN
      world/world.material

@ -13,7 +13,7 @@ func draw_world():
st.add_smooth_group(true) st.add_smooth_group(true)
for triangle in terrain.get_triangles(): for triangle in terrain.get_triangles():
for point in triangle.points(): for point in triangle.points():
st.add_vertex(point.point3d()) st.add_vertex(point.point3d() * Vector3(1, 24*5, 1))
st.generate_normals() st.generate_normals()
st.generate_tangents() st.generate_tangents()
@ -23,7 +23,7 @@ func draw_world():
var mi = MeshInstance.new() var mi = MeshInstance.new()
mi.mesh = mesh mi.mesh = mesh
var material = load("res://world/world.tres") var material = load("res://world/world.material")
mi.set_surface_material(0, material) mi.set_surface_material(0, material)
mi.create_trimesh_collision() mi.create_trimesh_collision()
mi.cast_shadow = GeometryInstance.SHADOW_CASTING_SETTING_ON mi.cast_shadow = GeometryInstance.SHADOW_CASTING_SETTING_ON

@ -121,7 +121,7 @@ func point_find_elevation(point):
elevation = min(elevation, 1) elevation = min(elevation, 1)
# elevation = elevation * terraces elevation = round(elevation * terraces) / terraces
return elevation return elevation
func point_is_water(point): func point_is_water(point):

@ -21,7 +21,7 @@ scale = Vector2( 0.25, 0.25 )
script = ExtResource( 4 ) script = ExtResource( 4 )
[node name="Water" type="MeshInstance" parent="World"] [node name="Water" type="MeshInstance" parent="World"]
visible = false transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 1000, 0, 1000 )
mesh = SubResource( 1 ) mesh = SubResource( 1 )
[node name="WorldEnvironment" type="WorldEnvironment" parent="World"] [node name="WorldEnvironment" type="WorldEnvironment" parent="World"]
@ -29,6 +29,10 @@ environment = ExtResource( 3 )
[node name="CamBase" parent="World" instance=ExtResource( 5 )] [node name="CamBase" parent="World" instance=ExtResource( 5 )]
[node name="DirectionalLight" type="DirectionalLight" parent="World"]
transform = Transform( 1, 0, 0, 0, 0.41636, 0.9092, 0, -0.9092, 0.41636, 0, 1.41623, 0 )
light_energy = 0.1
[connection signal="world_loaded" from="." to="UI/Map" method="_on_Game_world_loaded"] [connection signal="world_loaded" from="." to="UI/Map" method="_on_Game_world_loaded"]
[connection signal="world_loaded" from="." to="World" method="_on_Game_world_loaded"] [connection signal="world_loaded" from="." to="World" method="_on_Game_world_loaded"]

Binary file not shown.
Loading…
Cancel
Save