I was playing with UV offsets, figured out a shader that does a simple refraction (not depth-dependent) with chromatic aberration.
It works best with convex surfaces, and it’ll look odd if you use it for a window, but it works for jewels, crystal balls and the like.
The basic idea is to refract based on the surface normal and spread the colours into a spectrum as you do so.
Here the cube shows the 5 colour spread:
Here’s how I calculate the refraction and aberration (note: I ping-pong the screen-space UVs to stop them going out of range):
Then I mask and combine the spectrum proportionally to get the final result:
They layer up quite nicely, sorting by object distance:
Enjoy, and let me know if you can make it better