Skip to content

Commit

Permalink
add config to disable landlab
Browse files Browse the repository at this point in the history
  • Loading branch information
mazeyu authored and pvl-bot committed Sep 27, 2024
1 parent f033891 commit 85db7b5
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 9 deletions.
27 changes: 23 additions & 4 deletions infinigen/terrain/elements/landtiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,24 @@ def none_to_0(x):
return 0
return x

@gin.configurable
def get_land_process(land_processes, land_process_probs=None, snowfall_enabled=True):
if not isinstance(land_processes, list):
land_processes = [land_processes]
land_process_probs = [1]
if not snowfall_enabled:
land_processes_ = []
land_process_probs_ = []
for land_process, prob in zip(land_processes, land_process_probs):
if land_process != Process.Snowfall:
land_processes_.append(land_process)
land_process_probs_.append(prob)
else:
land_processes_ = land_processes
land_process_probs_ = land_process_probs
if land_processes_ == []:
return None
return rg(("choice", land_processes_, land_process_probs_))

@gin.configurable
class LandTiles(Element):
Expand All @@ -53,7 +71,8 @@ def __init__(
attribute_distance_range=1e9,
island_probability=0,
tile_heights=[-0.1],
land_process=("choice", [Process.Erosion, None], [0.65, 0.35]),
land_processes=[Process.Erosion, None],
land_process_probs=[0.65, 0.35],
height_modification_start=None,
height_modification_end=None,
attribute_modification_start_height=None,
Expand Down Expand Up @@ -83,7 +102,7 @@ def __init__(
)
self.smooth = smooth
self.aux_names = []
land_process = rg(land_process)
land_process = get_land_process(land_processes, land_process_probs)
sharpen = 0
mask_random_freq = 0
if land_process == Process.Snowfall:
Expand Down Expand Up @@ -252,7 +271,7 @@ def __init__(
tile_density=tile_density,
attribute_probability=0.5,
attribute_distance_range=150,
land_process=Process.Eruption,
land_processes=Process.Eruption,
height_modification_start=-0.5,
height_modification_end=-1.5,
attribute_modification_start_height=None,
Expand Down Expand Up @@ -282,7 +301,7 @@ def __init__(
tiles=[LandTile.Mesa],
tile_density=tile_density,
tile_heights=[-12.15],
land_process=Process.IceErosion,
land_processes=Process.IceErosion,
transparency=Transparency.CollectiveTransparent,
height_modification_start=None,
height_modification_end=None,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
scene.upsidedown_mountains_chance = 0
ant_landscape_asset.snowfall = 0
multi_mountains_asset.snowfall = 0
coast_asset.snowfall = 0
get_land_process.snowfall_enabled = 0
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ populate_scene.cactus_fire_on_the_fly_chance = 0.1
compose_nature.glowing_rocks_chance = 0.0

compose_nature.cached_fire = False
LandTiles.land_process = None
LandTiles.land_processes = None
#scene.voronoi_rocks_chance = 1
#animate_cameras.follow_poi_chance=0

Expand Down
2 changes: 1 addition & 1 deletion infinigen_examples/configs_nature/scene_types/arctic.gin
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ LandTiles.transparency = "CollectiveTransparent"
VoronoiRocks.transparency = "CollectiveTransparent"

LandTiles.randomness = 1
LandTiles.land_process = "ice_erosion"
LandTiles.land_processes = "ice_erosion"
LandTiles.tiles = ["Mesa"]
LandTiles.tile_heights = [-2.75]
LandTiles.tile_density = 0.4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ compose_nature.snow_particles_chance = 0.5

shader_atmosphere.density = 0
nishita_lighting.sun_elevation = ("spherical_sample", 10, 30)
LandTiles.land_process = "snowfall"
LandTiles.land_processes = "snowfall"
scene.waterbody_chance = 0
scene.caves_chance = 0
scene.ground_chance = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ camera_pose_proposal.roll = 180
camera_pose_proposal.yaw = -178

boulder.create_placeholder.boulder_scale = 1
LandTiles.land_process = None
LandTiles.land_processes = None

render.hide_water = True
compute_base_views.min_candidates_ratio = 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ camera_pose_proposal.pitch = -110
compose_nature.tilted_river_enabled = True

boulder.create_placeholder.boulder_scale = 3
LandTiles.land_process = None
LandTiles.land_processes = None

render.hide_water = True
compute_base_views.min_candidates_ratio = 1
Expand Down

0 comments on commit 85db7b5

Please sign in to comment.