This is a sample Unity3D project to view quadtree tiled terrain models. It also contains some sample tools to pack tile models into asset bundles in order to increase runtime performance.
- Clone this repository:
git clone git@github.com:wara-ps/quadtree-map-unity.git
. - Download the Gränsö tileset from here and unzip somewhere on your machine.
- Open the src folder as a project in Unity3D (tested with version 2019.3.7f).
- Open the sample scene Assets/Scenes/SampleScene.unity.
- Locate the GransoWorld object in the Hierarchy view and set the Base Url field to
file:///<path to tileset>
. Replace <path to tileset> with the absolute path to the unzipped folder, containing the file metadata.xml. - Press play (
CTRL + P
). - Right click in the Game view to capture the mouse. The camera is controlled by looking around with the mouse, and flying using the WASD keys. Right click again to uncapture the mouse.
Unity cannot read large models in open file formats (.obj, .fbx, etc.) at runtime in a very performant way. Therefore this tile engine requires the tileset to be processed in Unity first and then packed as asset bundles. This way the runtime loading performance is greatly increased.
Given that you have a 3D terrain model structured as a QuadTree already, there is functionality included in this repository to generate metadata and asset bundle files which can be loaded by this tile engine. You will probably have to modify the code somewhat, though.