Skip to content

Commit

Permalink
Fix the terrain missing bug by increasing the chunk size (#536)
Browse files Browse the repository at this point in the history
format
  • Loading branch information
QuanyiLi committed Oct 28, 2023
1 parent f09148d commit 2ac7bcb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
4 changes: 4 additions & 0 deletions metadrive/engine/core/terrain.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,10 @@ def _generate_mesh_vis_terrain(

# Set the target triangle width.
self._mesh_terrain_node.target_triangle_width = target_triangle_width
self._mesh_terrain_node.setTargetTriangleWidth(target_triangle_width)
# self._mesh_terrain_node.setUpdateEnabled(False)
self._mesh_terrain_node.setChunkSize(128)
# self._mesh_terrain_node.setChunkSize(64)

# Generate the terrain
self._mesh_terrain_node.generate()
Expand Down
12 changes: 7 additions & 5 deletions metadrive/tests/vis_env/vis_metadrive_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,20 @@
"start_seed": 74,
# "_disable_detector_mask":True,
# "debug_physics_world": True,
"debug": True,
"debug": False,
# "global_light": False,
# "debug_static_world": True,
"pstats": True,
"static_traffic_object": False,
"show_interface": True,
"random_agent_model": True,
"cull_scene": False,
"random_spawn_lane_index": False,
"random_lane_width": False,
# "image_observation": True,
# "controller": "joystick",
# "show_coordinates": True,
"random_agent_model": False,
# "random_agent_model": False,
"manual_control": True,
"use_render": True,
"plane_terrain": False,
Expand All @@ -42,12 +43,12 @@
# "show_terrain"
# "show_skybox": False,
"show_fps": False,
"render_pipeline": False,
"render_pipeline": True,
# "camera_dist": 8,
"window_size": (1200, 800),
"camera_dist": 9,
"camera_dist": 13,
# "camera_pitch": 30,
# "camera_height": 1,
"camera_height": 3,
# "camera_smooth": False,
# "camera_height": -1,
"vehicle_config": {
Expand Down Expand Up @@ -101,6 +102,7 @@ def lift_terrain():
start = time.time()

o, _ = env.reset()
env.engine.accept("~", env.engine.terrain.reload_terrain_shader)
if env.config["render_pipeline"]:
env.engine.accept("5", env.engine.render_pipeline.reload_shaders)
env.engine.accept("7", acc_speed)
Expand Down

0 comments on commit 2ac7bcb

Please sign in to comment.