Talus:可在浏览器中运行的小型地形扩散模型
Show HN: Talus, a small terrain diffusion model that runs in the browser
Talus 是一个可在浏览器中运行的小型扩散模型,能生成 4 km 游戏高度图,首次运行需下载约 54 MB,权重与运行时随后缓存在浏览器中,生成的地图不会离开用户设备。
Talus is a small diffusion model that draws 4 km heightmaps for games, right here in your browser.
Make a map
Pick a terrain type, set what matters to you and leave the rest on Auto.
Stored sample. The first run downloads about 54 MB.
Islands, seed 209
64 x 64 cells, 4,096 m across
Weights and runtime stay in your browser's cache after the first run. The maps you make never leave your device.
From noise to terrain in 25 steps
Every map starts as random noise. At each step Talus predicts the clean terrain under the noise, and the sampler keeps a little more of that prediction. Above is the island from the generator at six of its 25 steps.
We trained the 23M-parameter network from scratch on 45,000 maps from our own procedural generator: layered noise, rivers cutting valleys, and loose rock sliding down to its resting angle. That pile of rock at the foot of a slope is called talus.
Here, ONNX Runtime runs the network on WebGPU, or on the CPU when WebGPU is missing. The same seed and settings give the same map.
80.3
Talus-3's average over nine scores on held-out test maps. A score of 100 would mean its maps can't be told apart from the procedural terrain it learned from.
- Playability
- 99.9
- Walkable routes as often as real maps.
- Clean detail
- 99.4
- No excess pits or bumps.
- Control
- 92.1
- Measured relief, slope and water stay close to what you asked for.
- Realism
- 66.2
- 25 terrain statistics compared with real maps.
- Spectrum
- 11.0
- Fine detail is off: too smooth on mountains, too grainy on plains. This is the next fix.
Take it into your engine
Every map comes with a JSON file that gives its size and height range. For hundreds of maps, run Talus locally with the Python tool.
git clone https://github.com/osfv/talus
cd talus && pip install -e .
gh release download v3.0.0 -R osfv/talus -p talus-3.pt -D checkpoints
nullscape sample --checkpoint talus-3 --archetype ridges \
--n 64 --formats png16,r16,obj --unity- Unity
- Terrain, Import Raw: 65 x 65, 16-bit, Windows byte order. Set the terrain to 4,032 m wide and 1,200 m high.
- Unreal and Godot
- Use the 16-bit PNG as a landscape or terrain heightmap and scale its height to 1,200 m.
- Blender
- Import the OBJ. It is in meters with Y up.
来源:Hacker News · talus.tersa.tech