Wish: Add sorting vector to PRTs if they are sorted.
Seems like a float32[3], taking 12 bytes, stored in the header could be used to define a point or vector describing the sorting of a PRT. If no vector is supplied (as we have in current PRT’s) then the PRT is assumed unsorted.
At rendertime, compare the light or camera to the PRT sort vector (transformed by the PRT Loader TM), and if they are the same, skip that sorting step.
Why? Well, let’s say we’re rendering a whole buncha passes. Each pass will involve sorting to the camera, which may happen say 20 times per frame. If we pre-sorted the PRT’s once to a PRT sequence, we could save all those other sorting operations.
Edit: Of course any deforming modifier or KCM writing to the position channel would turn off the sort flag, but that’s ok. We’d just recache to another PRT sequence.
- Chad