To add the Voxel Farm Unity3D plugin to a new project, select “Assets > Import Package > Import Custom Package…” from the Unity3D editor menu. In the file selection dialog that appears, browser to the “<SDKRoot>\Client.Unity\Plugin” folder and select the file “VoxelFarmClient.unitypackage”.


Make sure all items are checked in the import package dialog that appears next and select “Import”:


 

When the package import operation completes, you should see a folder named “Voxel Farm Cloud” in the project’s Assets folder:


 

Next, you must create a VoxelFarmRuntime object. This object configures how many background threads will be used in the project. To create this object, right-click somewhere inside your project’s Assets folder and select “Create > Voxel Farm Runtime” from the right click menu:


 

Select the newly created Voxel Farm Runtime object and set the desired number of background threads in the object’s property inspector.


Next, right click on the Hierarchy panel to create a new scene object. From the right click menu select “Voxel Farm > View”. This will add a node labelled “New Voxel Farm View” to the scene hierarchy. Select this object and make sure its properties are visible in the object Inspector interface.


Assign the new Voxel Farm Runtime object to the “Voxel Farm Runtime” property in the view object.


Before the view can work, its connection to the server must be configured. Enter the proper settings for the Server URL and streaming port. If the server uses encryption for streaming, make sure “Streaming SSL” is checked.


At this point you should also supply the ID of one of the projects in the server. Once these settings are entered, click on “Load Project” from the inspector‘s UI. This will load the available pre-defined views in the project. Select the view you want to start with from the “Selected View” dropdown:



Making the view selection will cause the client to connect to the server and to request a full scene for the view. Look into the “Stats” section for the view object to verify the server is actually sending information.


After the view loads, you can move the camera at will within the scene. The Voxel Farm content will adapt its resolution based on the position of the editor’s camera.


Also consider adjusting the main light and ambient light intensity if the scene appears over-exposed at the start.



If you click “Play” in this state, you will realize the contents of the view will not appear. This is because there is no camera or other point of view associated to the Voxel Farm view object.


The Voxel Farm Unity3D client includes a special camera controller that is designed for browsing large spans of detailed content. To add this component, select a standard Unity3D camera (like the default Main Camera in the scene) and click on “Add Component” in its inspector panel. Search for “Voxel Farm” among the available components and select “Voxel Farm Unity Camera Controller”:


 

Once the component is created, make sure its “Voxel Farm View” property links to the “New Voxel Farm View” object in the scene. If you press “Play” now in Unity3D, the contents of the Voxel Farm view will appear. Again, keep an eye on the Stats sections to make sure there is an actual communication with the servers:



Voxel Farm content showing in Play Mode


The last step is optional and is about setting up a basic UI for your scene while it is in play mode. The Voxel Farm plugin includes a basic UI overlay can be is very useful in the early stages of the application’s development. To add this UI, right click on the Scene Hierarchy panel and select “Voxel Farm > Basic View UI”.


This will add a new object to the scene named “New Voxel Farm UI”. Select the object and make sure its “View” property points to the “New Voxel Farm View” object in the scene. You also configure UI settings like logos, icons and fonts. If you do not configure any of these, you will see the default UI when you enter Play mode: