Log inGet started
Package

sunfall.package

Newest version

This package holds more than this page lists. See all of its files in its world.

README.md

ground (module)

Reads Sunfall Ridge's baked landscape straight from terrain/ridge.terrainData, so the dressing can be placed in edit mode, at build time and at start without a live Terrain: the height texture (rgba32f, R metres) and the two control textures that say which surface covers each 5 m texel, in the graph's layer order (fields, forest, grass, meadow; rock, scree, gravel, snow). Trees, rocks and grass therefore stand exactly where the ground draws their surfaces.

  • height(x, z) bilinear metres; slope(x, z) degrees; normal(x, z) three numbers
  • weight(layer, x, z) and weights(x, z) the surfaces' 0..1 coverage (renormalise by their sum)
  • reload() decodes the textures again after a re-cook (about 0.2 s; done lazily once per session)
  • setFocus(x, y, z) / focus() the point the forest, rocks and grass sort their detail round instead of the active camera (set it before a capture from a fixed position, clear it with no arguments)
  • meshReady(handle) whether a runtime mesh has been resident long enough to be named in an instanced draw

Used by sunfall.dressing.build, Forest, Rocks and Meadow.