Spatial Acceleration
Spatial acceleration (added in 3.0) uses a spatial hash grid to make revealer and hider queries fast, so the system scales to large worlds and many objects. It is enabled by default.
Settings
On the Fog Of War World component:
| Property | Type | Default | Description |
|---|---|---|---|
| Use Spatial Acceleration | bool | true | Enables the spatial hash grid. |
| Spatial Hash Grid Size | int | 32 | The size of each spatial hash bucket, in world units. |
| Num Spatial Hash Buckets | int | 1024 | How many buckets the hash table can hold. More buckets = fewer collisions. |
Tuning Grid Size
The ideal Grid Size is roughly 2× your average revealer's radius (including its soften distance).
Tuning Bucket Count
The bucket count is the maximum number of grid buckets the system creates.
- If the count is too low, different parts of the world can share the same grid hash ID ("collisions"). This still works correctly but can hurt performance.
- A higher count uses more memory.
- The larger your world (or the smaller your grid size), the more buckets you need.
You can toggle spatial acceleration at runtime with SwitchSpatialAccelerationMode.