
1. Next-Generation Rendering in Thief 75
Figure 1.6. Reflection blending without sorting (left) and with sorting (right). [Image
courtesy Square Enix Ltd.]
However, this approach causes certain problems in cases when a transparent
IBR proxy is in front of the object that could be potentially reflected with SSR.
Figure 1.6 shows the issue. To address this problem, instead of simply blending
SSR and IBR, we perform layer sorting beforehand. We create a small (three to
four entries) array of reflection layers in the IBR shader and inject SSR results
into it as the first element. The array is kept sorted when we add every subsequent
IBR trace result. Thus,