This page guides you through the three options available for using VIVERSE Polygon Streaming with PlayCanvas: with the VIVERSE PlayCanvas Extension, as standalone, or with HTML scripting.
Start by opening your PlayCanvas project and setup using the VIVERSE Extension. Once the extension is setup and you’re logged in, you are ready to add special components. To add a Polygon Streaming component to the scene, add an Empty component to the scene and give a name like "Streaming Model".
With the new component selected, click on EDIT VIVERSE EXTENSION. Choose a Media type of plugin, select the module PolygonStreaming and click the plus + symbol. Now you just added a Polygon Streaming component to your scene.
Paste the Asset ID of your streaming model into the Polygon Streaming URL field. Once you added the URL in the field, the object will preview inside your scene. This is just a preview; once Published, the streaming model will start actively streaming from the cloud.
That’s all you need to stream your models inside your VIVERSE Scene. You can also modify the Polygon Streaming Parameters going to Viverse Scene Settings / Polygon Streaming and change the parameters according to your preferences. You can check the Supported Parameters list below in this documentation.
After you published your VIVERSE World scene, the Streaming Model will automatically start to stream inside the scene.
Once you have the Polygon Streaming main script imported to your project. Start by creating a new empty entity into your scene. Give it the name "StreamController" and add a Script component to the entity.
Choose the StreamController script option and that will open all the options to control your streaming models inside your project. You can check detailed information on these parameters in the Stream Controller section of this guide.
Create a new empty entity and this time give the name "Streamable Model". Add a new Script component to the entity and this time choose the "streamableModel" script option. This will create the component to stream your model inside the scene.
Paste the URL address of your streaming model into the "Path or url to model" field. Once you added the URL in the field, the object will already preview inside your scene. This is just a preview, once the scene is Launched or Published, the streaming model will start actively streaming from the cloud.
After you published your VIVERSE World scene, the Streaming Model will automatically start to stream inside your scene.
In this section, we're going to go through how to implement PlayCanvas Plugin directly in HTML.
After then you need to define a new Entity, add it to the root and define the parameters (described in PlayCanvas Editor Plugin Documentation | Polygon Streaming Settings )