https://github.com/ralith/planetmap
Streaming planetary terrain mapping
https://github.com/ralith/planetmap
Last synced: 12 months ago
JSON representation
Streaming planetary terrain mapping
- Host: GitHub
- URL: https://github.com/ralith/planetmap
- Owner: Ralith
- Created: 2019-02-24T23:23:57.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2025-01-10T13:15:00.000Z (over 1 year ago)
- Last Synced: 2025-04-10T05:04:34.844Z (over 1 year ago)
- Language: Rust
- Size: 231 KB
- Stars: 59
- Watchers: 4
- Forks: 6
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Planetmap
Planetmap is a library for processing lazily evaluated radial
functions with dynamic level-of-detail.
## Screenshots



## Terrain Rendering
Planetmap is motivated by the desire to model to-scale planetary
terrain in real time on commodity hardware. To accomplish this, it
addresses multiple challenges:
- Dynamic level of detail
- Streaming larger-than-memory or procedural heightmap data
- Addressing the surface of the sphere without singularities
- Maintaining numerical stability over massive distances
This is accomplished by organizing data into a 6 virtual quadtrees,
each corresponding to one face of a cubemap. Each node in a quadtree,
referred to as a `Chunk`, can be associated with a square grid of
height samples, each of which represents the altitude relative to sea
level along a ray originating at the center of a planet. Streaming and
level of detail can then be implemented with a `CacheManager`
associated with GPU-resident buffers.
When generating geometry to be displaced by the heightmap, care must
be taken to ensure numerical stability and avoid hairline cracks
between neighboring chunks. One effective tactic is to upload the
corners of each chunk from the CPU, then find interior points using
interpolation in a vertex shader.
## Features
- `parry` exposes helpers for rapier-compatible collision
detection against the surface of a radial heightmap
- `simd` exposes `simdeez`-based iterators for data-parallel
computation of sample coordinates within a `Chunk` or
`chunk::Coord`, useful for fast noise sampling