Home

Awesome

Unity3DTiles

Unity3DTiles is a Unity based implementation of the 3DTiles open format for streaming and rendering large static models such as those generated by photogrammetry pipelines. The benefit of the 3D Tiles specification is that it allows one generic rendering implementation to support datasets tiled using a number of different data structures such as binary, quad, or oct trees. It also supports sparse data representations so it can adapt well to datasets with variable detail density.

Implementation Details

Reference information about the object model and tree traversal algorithm can be found here.

Supported Features

Please note that since initial development completed, the 3d-tiles specification has evolved. The tileset.json schema use is now modestly out of date and should be updated in the near future.

Tile Format Support

Tileset Feature Support

Dependencies

Scenes

This project contains several sample scenes.

To import into your own project, simply copy the following folders

Configuration

To get started, simply add a TilesetBehaviour to an empty game object. You can configure the TilesetBehaviour renderer using the SceneOptions and TilesetOptions objects. The Url parameter is typically an HTTP url but in the examples we have added a script to convert a StreamingAsset relative path to a full path at runtime so that the example assets can be included along with the code.

Scene Options

Tileset Options

The Generic Web Scene

A generic web build configuration is available which reads the tileset to load at runtime based on a URL parameter. Options may also be overridden by URL parameters.

Building the Generic Web Scene

  1. Configure the Unity build for the WebGL platform and enable only the "GenericWeb" scene
  2. Click Build (or Build and Run if you want to test locally), and select the folder Unity3DTilesWeb for output.

Using the Generic Web Scene

The generic web build recognizes the following URL parameters:

Tileset is ignored if Scene is specified.

When combined with Scene, TilesetOptions overrides per-tileset options in the scene manifest, if any.

When running in the Unity editor use the SceneOptions and SceneUrl inspectors instead of the SceneOptions and Scene URL parameters. Also, any tilesets pre-populated in the TilesetOptions list inspector will be loaded at start.

URLs starting with "data://" will be loaded from the Unity StreamingAssets folder.

When running in a web browser (not the Unity editor):

Examples:

http://uri.to/generic/web/deployment/index.html?Tileset=data://SampleTileset/tileset.json

http://uri.to/generic/web/deployment/index.html?Tileset=http://uri.to/tileset.json&TilesetOptions=http://uri.to/tileset_options.json&SceneOptions=http://uri.to/scene_options.json&ExtraParam1=foo&ExtraParam2=bar

http://uri.to/generic/web/deployment/index.html?Tileset=../tileset/tileset.json&TilesetOptions=../tileset/options.json&SceneOptions=../scene_options.json

http://uri.to/generic/web/deployment/index.html?Scene=../scene.json&TilesetOptions=../tileset_options.json&SceneOptions=../scene_options.json

Generic Web Scene User Interface

Upon load the generic web build will place the camera at a default position (which can be overriden in the scene options). There will be a heads up display (HUD) with some info in the upper left. Several keyboard and mouse interactions are implemented. The HUD will show a summary of the available actions.

Two navigation modes are included: mouse orbit and mouse fly. The initial navigation mode is orbit. Drag the mouse to rotate the model, and use the mouse wheel to move in and out. Drag the right mouse button to roll the camera. Click on the model and press "c" to change the orbit center. Hit "f" to fit the view to the model, and hit "v" to reset to the default viewpoint.

Hit "n" to switch to fly navigation (and hit "n" again to toggle back to orbit). In fly mode drag the mouse to re-orient the camera. Use the right mouse button to roll the camera. Hit w/s/a/d/q/e to translate fwd/back/left/right/up/down.

When you click on the model the HUD will show info about the clicked tile. You can show the bounding box of the tile and optionally its parent by hitting 'b'. Hit 'x' to show the axes of the tileset. Hit 'i' to hide the tileset, and 'o' to show the last-hidden tileset. You can also use the number keys to hide/show individual tilesets.