amélioration du rendu

pull/18/head
Valentin Stark 3 years ago
parent 7fd1e9557e
commit c6e93b0062
  1. 5
      world/World3d.gd
  2. 5
      world/game.gd
  3. 2
      world/game.tscn
  4. BIN
      world/world.material
  5. 2
      world/world.tres

@ -29,7 +29,7 @@ func draw_world():
st.add_vertex(Vector3(point.point3d().x, triangle.get_elevation(), point.point3d().z) * factor) st.add_vertex(Vector3(point.point3d().x, triangle.get_elevation(), point.point3d().z) * factor)
st.generate_normals() st.generate_normals()
st.generate_tangents() # st.generate_tangents()
st.index() st.index()
# Commit to a mesh. # Commit to a mesh.
var mesh = st.commit() var mesh = st.commit()
@ -42,8 +42,11 @@ func draw_world():
mi.cast_shadow = GeometryInstance.SHADOW_CASTING_SETTING_ON mi.cast_shadow = GeometryInstance.SHADOW_CASTING_SETTING_ON
print(mi) print(mi)
add_child(mi) add_child(mi)
Global.print_debug(OS.get_ticks_msec() / 1000.0)
func _on_Game_world_loaded(game_terrain): func _on_Game_world_loaded(game_terrain):
terrain = game_terrain terrain = game_terrain
draw_world() draw_world()
# 18 - 42
# 4 - 9

@ -23,7 +23,7 @@ func _ready():
noise.seed = rng.randi() noise.seed = rng.randi()
noise.octaves = octaves noise.octaves = octaves
var terrain_name="bonjour" var terrain_name="bonjour90"
terrain = Terrain.new() terrain = Terrain.new()
print(terrain.list()) print(terrain.list())
@ -36,6 +36,7 @@ func _ready():
if terrain.is_created() or terrain.is_loaded(): if terrain.is_created() or terrain.is_loaded():
init_data() init_data()
add_trees() add_trees()
Global.print_debug(OS.get_ticks_msec() / 1000.0)
emit_signal("world_loaded", terrain) emit_signal("world_loaded", terrain)
else: else:
Global.print_debug("Pas de terrain, pas de construction ...") Global.print_debug("Pas de terrain, pas de construction ...")
@ -178,7 +179,7 @@ func triangle_find_elevation(triangle):
return elevation return elevation
func triangle_is_water(triangle): func triangle_is_water(triangle):
if triangle.get_elevation() <= 0: if triangle.get_elevation() < 0:
return true return true
return false return false

@ -43,7 +43,7 @@ fov = 55.0
zoom_sensibility = 1.436 zoom_sensibility = 1.436
[node name="DirectionalLight" type="DirectionalLight" parent="World3d"] [node name="DirectionalLight" type="DirectionalLight" parent="World3d"]
transform = Transform( 1, 0, 0, 0, 0.641744, 0.766919, 0, -0.766919, 0.641744, 0, 1.41623, 0 ) transform = Transform( 0.971628, 0.168947, -0.16552, 0, 0.699825, 0.714314, 0.236516, -0.694047, 0.67997, 0, 1.41623, 14.8745 )
light_energy = 0.1 light_energy = 0.1
shadow_enabled = true shadow_enabled = true

Binary file not shown.

@ -1,4 +1,4 @@
[gd_resource type="SpatialMaterial" format=2] [gd_resource type="SpatialMaterial" format=2]
[resource] [resource]
albedo_color = Color( 0.109804, 0.305882, 0.0745098, 1 ) albedo_color = Color( 0.125, 0.5, 0.275, 1 )

Loading…
Cancel
Save