Here’s a corrected PG using RefractionTexture
:
Roughness can be simulated by using a blur pass, as in PBR Refraction roughness (blurriness) - #8 by Evgeni_Popov.
Regarding your last question, it’s a “by-product” of the technique we use, unfortunately: it renders all the opaque objects and use the texture as the refraction texture. You can try to remove the objects you don’t want in the opaque texture, as in:
However, you would have to reconstruct the render list it on each frame, if your camera can move. In the PG above, I simply remove the box from the refraction texture, so if you turn the camera so that the box is behind the amber block, the box won’t be refracted and will disappear.