When a ray is cast from an emitter, it bounces multiple times around the environment. Data about each bounce is stored in a `Trail` class.
The amount of bounces in a trail is equal to the largest bounce count among:
- `ReverbBounceCount`
- `OcclusionBounceCount`
- `PermeationBounceCount`
- `AmbientPermeationBounceCount`
For example with `ReverbBounceCount=8` and `OcclusionBounceCount=4`, the trail will consist of 8 bounces. Reverb rays will fire back towards the emitter on every bounce, but occlusion rays will only be cast on the first 4 bounces.
Trails are cached and only updated when primitives or emitters move. This cache is an important optimisation that enables raytracing to run in real time in complex scenes.
There are a few scenarios to be aware of that will clear this cache:
- teleporting an emitter large distances
- moving/resizing the world bounds
- changing ray/bounce counts
- updating/creating materials