by building a subtree for each unique mesh light.
The top-level light tree contains two types of emitters: lamps (local or distant) and mesh lights (emissive objects). Each unique mesh light, regardless of whether it's instanced or not, has a subtree. The leaf node of such subtrees only contain triangles. During traversal, we first traverse the top-level tree until we pick an emitter. If this emitter is a mesh light, we transform it to its local space and continue traversing its subtree until we pick a triangle.