Experimenting with this a little further, I feel like I am missing a step somewhere.
I have set up two Karma outputs, the first produces a beauty pass with the HDRI set to be hidden from camera & refraction rays:
![](/forum/attachment/52df13d22347c8af9449cea723431f6ae24e9dbe/)
Edit: I had the wrong image here when I initially posted -- it has been updated.
The second output disables the Dome Light & places a background plane behind the scene with a ST map projected from the camera to a surface shader. All but the refract component is disabled on the rendersettings prim, and this is the result:
![](/forum/attachment/7a9442223f990c6605278e51017816196a9d994f/)
In Nuke I'm using the same image HDRI in the background to make comparison easier, and there are two obvious problems:
![](/forum/attachment/67633df427e2359075443f1708245a241310c2b2/)
First: compared to the in-engine render of the Dome Light through the glass, the refraction is significantly deflecting the angle of the light. This is probably caused by what appears to be a drop in values for areas seen through the glass. I'm not sure why this is, as the glass shader does not have absorption or roughness.
Second: because black is a valid coordinate on an st map, we get whatever color happens to be in the bottom-left corner of the source image mapped to any dark areas in the refraction pass render, which leads to the plus operation adding value to areas on the torus that should not be affected by refraction.
Any thoughts on this? I have only employed this trick of using an st map to distort an environment into single-layer things like raindrops or water on a lens, etc. so I feel like I'm missing something doing it in a scene that has multiple layers of objects.
Thanks for your help, it is an educational exercise at this point, as much as anything else...