Uploaded June 2019 | Updated November 2026, 1 week ago
This is a showcase of rendering algorithm that I created for Path of Exile. It allows to relatively accurately simulate subsurface effects such as refraction and scattering in O(1) complexity. O(1) complexity means that the algorithm always runs in 1 iteration, there are no loops and overall rendering cost of this crystal is approximately the same as that of our generic fireball.
The algorithm uses medium refraction index to calculate inner refracted ray, which is then used to calculate UV offset from TBN basis (similar to how parallax mapping works but in O(1)) and then it uses a precalculated texture for evaluating how much light is inscattered, outscattered and transmitted for this ray.
In order to simulate light diffusion, I used mipmaps of subsurface texture to create varying degrees of its blur based on light path optical density. Basically just use higher mips in murkier crystals to create blurrier subsurface image. That relatively accurately approximates nice diffusion for free.
Result shader allows simulation of various materials such as gems, eye pupils, water, etc. Its earlier iteration in used in Path of Exile: Legion to render obelisk crystals and crystalline effects on enemies.
This is a showcase of rendering algorithm that I created for Path of Exile. It allows to relatively accurately simulate subsurface effects such as refraction and scattering in O(1) complexity. O(1) complexity means that the algorithm always runs in 1 iteration, there are no loops and overall rendering cost of this crystal is approximately the same as that of our generic fireball.
The algorithm uses medium refraction index to calculate inner refracted ray, which is then used to calculate UV offset from TBN basis (similar to how parallax mapping works but in O(1)) and then it uses a precalculated texture for evaluating how much light is inscattered, outscattered and transmitted for this ray.
In order to simulate light diffusion, I used mipmaps of subsurface texture to create varying degrees of its blur based on light path optical density. Basically just use higher mips in murkier crystals to create blurrier subsurface image. That relatively accurately approximates nice diffusion for free.
Result shader allows simulation of various materials such as gems, eye pupils, water, etc. Its earlier iteration in used in Path of Exile: Legion to render obelisk crystals and crystalline effects on enemies.










