Mike0021 commited on
Commit
293cfcd
·
verified ·
1 Parent(s): ad9366e

Terrain: winter preset for snowy mountains with trees

Browse files
Files changed (2) hide show
  1. app/llms.txt +2 -2
  2. projtex/terrain.py +18 -0
app/llms.txt CHANGED
@@ -202,8 +202,8 @@ Request (JSON; only the ground and a prompt are required):
202
  in fixed directions, so describe surfaces, not structures with a direction: "packed gravel", not "a lane with two
203
  ruts and a grass strip" (paths get an even surface automatically). "from_above" (optional) says how a layer looks
204
  in the colour map when that differs from its close-up; forests and woods default to their tree crowns. Presets
205
- (when layers is omitted, chosen from the prompt's words): alpine, temperate, desert, arctic, volcanic (GET /api
206
- lists them).
207
  - uv: planar (default: terrain.glb gets top-down UVs) | keep (the colour map is baked into your own UVs).
208
  - backend: qwen-turbo (default) | qwen-space | mock (free dry run). Cost: layers + 1 + tiles images (2048: about
209
  15 images, ~2 min of GPU quota and ~2-3 min in all; 4096: ~31 images).
 
202
  in fixed directions, so describe surfaces, not structures with a direction: "packed gravel", not "a lane with two
203
  ruts and a grass strip" (paths get an even surface automatically). "from_above" (optional) says how a layer looks
204
  in the colour map when that differs from its close-up; forests and woods default to their tree crowns. Presets
205
+ (when layers is omitted, chosen from the prompt's words): alpine, temperate, desert, arctic, winter, volcanic (GET
206
+ /api lists them).
207
  - uv: planar (default: terrain.glb gets top-down UVs) | keep (the colour map is baked into your own UVs).
208
  - backend: qwen-turbo (default) | qwen-space | mock (free dry run). Cost: layers + 1 + tiles images (2048: about
209
  15 images, ~2 min of GPU quota and ~2-3 min in all; 4096: ~31 images).
projtex/terrain.py CHANGED
@@ -805,6 +805,17 @@ PRESETS: dict[str, dict] = {
805
  "where": {"slope": [22, None], "curvature": [0.1, None]}, "tile_m": 4},
806
  {"name": "rock", "prompt": "dark grey rock with snow caught in the cracks",
807
  "where": {"slope": [34, None]}, "tile_m": 6}]},
 
 
 
 
 
 
 
 
 
 
 
808
  "volcanic": {"about": "volcanic land: ash plains, black lava flows, basalt cliffs, moss",
809
  "layers": [
810
  {"name": "ash", "prompt": "dark grey volcanic ash and fine cinders", "tile_m": 4},
@@ -823,8 +834,15 @@ MAX_LAYERS = 8
823
 
824
 
825
  def choose_preset(prompt: str) -> str:
 
 
826
  import re
827
 
 
 
 
 
 
828
  for name, pat in _PRESET_WORDS:
829
  if re.search(pat, prompt or "", re.I):
830
  return name
 
805
  "where": {"slope": [22, None], "curvature": [0.1, None]}, "tile_m": 4},
806
  {"name": "rock", "prompt": "dark grey rock with snow caught in the cracks",
807
  "where": {"slope": [34, None]}, "tile_m": 6}]},
808
+ "winter": {"about": "snowy mountains: deep snow, snow-dusted conifer forest on the lower slopes, scree and dark "
809
+ "rock on the steep faces",
810
+ "layers": [
811
+ {"name": "snow", "prompt": "deep white snow with soft wind ripples", "tile_m": 6},
812
+ {"name": "forest", "prompt": "snow on a conifer forest floor with fallen needles and small twigs",
813
+ "from_above": "snow-dusted dark green conifer tree crowns",
814
+ "where": {"height": [None, 0.5], "slope": [8, 36]}, "tile_m": 4},
815
+ {"name": "scree", "prompt": "grey scree half buried in snow",
816
+ "where": {"slope": [26, None], "curvature": [0.15, None], "height": [0.2, None]}, "tile_m": 4},
817
+ {"name": "rock", "prompt": "dark grey rock with snow caught in the cracks",
818
+ "where": {"slope": [36, None]}, "tile_m": 6}]},
819
  "volcanic": {"about": "volcanic land: ash plains, black lava flows, basalt cliffs, moss",
820
  "layers": [
821
  {"name": "ash", "prompt": "dark grey volcanic ash and fine cinders", "tile_m": 4},
 
834
 
835
 
836
  def choose_preset(prompt: str) -> str:
837
+ """The preset a prompt's words point to. A snowy mountain with trees (a ski area in winter) is "winter": the
838
+ arctic preset has no forest and paints its stream beds as blue ice (round 29)."""
839
  import re
840
 
841
+ if (re.search(r"\b(?:mid)?winter|\bsnowy|\bsnow-covered|\bski(?:s|ing)?\b", prompt or "", re.I)
842
+ and re.search(r"\b(?:alpine|alps|mountains?|peaks?|ski|forests?|woods|spruces?|pines?|firs?|conifers?|trees)\b",
843
+ prompt or "", re.I)
844
+ and not re.search(r"arctic|antarctic|polar|tundra|glacier", prompt or "", re.I)):
845
+ return "winter"
846
  for name, pat in _PRESET_WORDS:
847
  if re.search(pat, prompt or "", re.I):
848
  return name