L3DT development blog
Large 3D terrain generator

New heightfield format

Hello All,

I was inspired to do some code tinkering by a recent discussion over at TMS regarding the lack of a suitable compressed format for storing heightfields. That tinkering worked out pretty well, and consequently we have a new heightfield format - creatively entitled HFZ - that will probably replace HFF as L3DT's default format after the release of version 2.5. I've included a beta-release of the HFZ plugin with L3DT v2.5 RC3, which was uploaded earlier today.

The big change in HFZ is the inclusion of variable-precision difference and gzip encoding. This allows you to have high-precision files that are large, high-compression files that are less precise, or any combination in between. The compression rate depends on the noise level in your map and on the level of vertical precision you require. For a noisy fractal heightfield, a figure of 50% relative to TER/HFF was achieved with a vertical precision of 0.05m (~2in). For that map, the precision corresponded to a maximum vertical error of 0.008% of the map height range, or alternatively 0.5% of the horizontal scaling of the map.

If you're interested in trying it out, the compiled plugin for is in RC3 (as mentioned above). If you're a developer interested in implementing support for this format, there is simple C library code for reading/writing these files on the LibHFZ page, an example of its usage is in the L3DTio_HFZ plugin source, and the format specification is on the HF2/HFZ spec page.

Feedback, either on v2.5 RC3 or on HFZ specifically, would be greatly appreciated.

Cheers, Aaron.

Update 1 – 2007/03/05

Fixed two bugs in LibHFZ. We're on on v1.0.1 now. I've also updated the L3DTio_HFZ plugin.

l3dt/2007/mar/04.txt · Last modified: 2017/08/31 05:20 (external edit)
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Share Alike 3.0 Unported
L3DT Development Blog RSS Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki