Skip to content

NML converter

Jaak Laineste edited this page Nov 30, 2017 · 1 revision

Instructions how to convert KMZ files for different platforms and how to convert existing databases

Download

The converter can be found from here: https://bitbucket.org/nutiteq/nlm

For Android Java-based SDK:

#!sh
kmz2db --compress-rgb=etc1 --compress-rgba=etc1 --compress-lodtree-meshes=0 --freeze --kmz2sqlite=XXX.nmldb --add-all XXX.kmz
  • SDK starting from 2.3.1 supports mesh compression, so --compress-lodtree-meshes=0 is NOT required if SDK 2.3.1+ is targeted.
  • For some models, --compress-rgba=etc1 should be replaced with --compress-rgba=raw (if model contains transparent textures)
  • conversion of legacy .nmldb files is not required.
  • PVRTC textures are NOT supported!

For Android C++-based SDK:

#!sh
kmz2db --compress-rgb=etc1 --compress-rgba=etc1 --compress-lodtree-meshes=1 --freeze --kmz2sqlite=XXX.nmldb --add-all XXX.kmz
  • --compress-lodtree-meshes=1 option turns on mesh compression. It takes more time while converting, but produces smaller .nmldb files and makes runtime faster.
  • For some models, --compress-rgba=etc1 should be replaced with --compress-rgba=raw (if model contains transparent textures)
  • C++ SDK supports PVRTC textures, but they have to be uncompressed before use. This results in textures that take as much memory as raw textures but quality is considerably worse.
  • older .nmldb files may need to be converted for C++ SDK: in sqlite shell execute the command: ALTER TABLE ModelLODTreeMeshes ADD nmlmeshop BLOB NULL

For iOS C++-based SDK:

#!sh
kmz2db --compress-rgb=pvrtc1_4bpp --compress-rgba=pvrtc1_4bpp --compress-lodtree-meshes=1 --square-texture-atlas=1 --freeze --kmz2sqlite=XXX.nmldb --add-all XXX.kmz
  • --compress-lodtree-meshes=1 option turns on mesh compression. It takes more time while converting, but produces smaller .nmldb files and makes runtime faster.
  • --square-texture-atlas=1 turns on square-shaped texture atlas generation (iOS requires compressed textures to be squares)
  • --compress-rgb=pvrtc1_4bpp and --compress-rgba=pvrtc1_4bpp options can be replaced with --compress-rgb=pvrtc1_2bpp and --compress-rgba=pvrtc1_2bpp. Output files are up to 2 times smaller but quality is worse.
  • iOS SDK supports ETC1 textures, but they have to be uncompressed before use. This results in textures that take as much memory as raw textures but quality is considerably worse.
  • older .nmldb files may need to be converted for C++ SDK: in sqlite shell execute the command: ALTER TABLE ModelLODTreeNodeMeshes ADD nmlmeshop BLOB NULL

For WP8 C++-based SDK:

#!sh
kmz2db --compress-rgb=dxtc1 --compress-rgba=dxtc3 --compress-lodtree-meshes=1 --freeze --kmz2sqlite=XXX.nmldb --add-all XXX.kmz
  • --compress-lodtree-meshes=1 option turns on mesh compression. It takes more time while converting, but produces smaller .nmldb files and makes runtime faster.
  • older .nmldb files may need to be converted for C++ SDK: in sqlite shell execute the command: ALTER TABLE ModelLODTreeMeshes ADD nmlmeshop BLOB NULL

Converting DAE files

In general same comments regarding --compress-* options apply to dae2nml also, for example PVRTC is not supported in Android Java SDK. Also --square-texture-atlas option should be used when converting models for iOS.