Solar Tools for PlayCanvas
  • Overview
  • Installation
  • Uranus SDK Systems
    • Uranus GPU Instancer
      • Get started with instancing
      • Working with LODs
      • Working with Cells
      • Working with Data
    • Uranus Material Effects
      • Get started with effects
      • Working with Skybox
  • Changelog
Powered by GitBook
On this page
  1. Uranus SDK Systems
  2. Uranus GPU Instancer

Working with Data

PreviousWorking with CellsNextUranus Material Effects

Last updated 2 years ago

In larger projects with thousands of objects added in a single scene the traditional approach of adding a PlayCanvas entity for each object can't easily scale.

After a few thousands of entities are added to your project the update time required by the PlayCanvas engine to process these entities on each frame can be significant and can result in a large frame rate drop.

Uranus GPU Instancer provides an alternative way of adding objects to your project using an advanced data parser.

How it works?

The uranus-instancer-data.js script can receive raw input with the minimum information required to spawn these objects directly in the instancing vertex buffers, without adding separate entities to your scene.

That way you can add thousands of objects to your scene while keep both the scene size small and the update time short. It's a great system for adding static objects to your scene like vegetation, cliffs, rocks, buildings etc.

The data consumed by this script can be provided by:

  • A JSON file that includes a single flat array with the required data (instance id, position, rotation etc.). The Uranus Editor Painter generates a file like that but it can also be generated manually.

  • A terrain distributor can feed its data directly to this script and easily add its objects to the instancer.

Solar Island Demo, by Solar Games: included in the Uranus Tools for PlayCanvas
uranus-instancer-data.js, in editor script attributes
uranus-instancer-data.js, sample JSON data file