## Unity
Pointcaster integration for [the Unity game engine](https://unity.com/) ships as a package you can include directly from Unity's package manager.
This package supports Unity 2021.3 onwards and is compatible with both URP and the built-in render pipeline. Native libraries are included for Windows x64 and Android (`armeabi-v7a` and `arm64-v8a`).

Open the Package Manager window inside Unity and add a new package from the following git URL:
```
https://github.com/matth-av/pointcaster-unity.git
```

### Pointreceiver Mesh Host
The quickest way to get a point cloud into a scene is to drag the **Pointreceiver Mesh Host** prefab from the package into your scene. It connects to Pointcaster and creates a child object with a mesh for each point cloud channel it receives. Points are drawn as camera-facing quads.

- **Point Caster Address / Point Cloud Port**: the Pointcaster instance to connect to. The port defaults to `9992`.
- **Subscription**: receive all channels, or only the channel matching **Address**.
- **Point Size**: the width of each point, in world units or screen pixels depending on **Size Mode**.
- **Point Scale Multiplier**: scales per-point sizes sent by Pointcaster (e.g. from a PLY file's attributes). Only applies in world units.
- **Shape**: draw points as squares (cheapest) or disks.
- **Tint**: a colour multiplied with each point's colour.

To change hosts at runtime, call `SetAddress(address, port)`, or call `Reconnect()` after changing the address fields directly.

### VFX Graph
For use with the Visual Effect Graph, add a **Pointreceiver Host** to the scene, then add a **PointCloudBinder** to your Visual Effect (under _VFX/Property Binders_). Set its **Channel Address** to the channel to draw. The binder exposes the cloud to the graph as `Positions` and `Colors` textures and a `PointCount` integer.
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9