I wrote a new article, this time exploring a bit how some games handle refraction.
I discovered quite a few interesting tricks !
The easy part is done, time to tackle the more complex one: realistically (but approximately) render refraction in my own engine.
There is definitely some extra stuff I need to have refraction make sense on my objects (like taking Fresnel into account).
@froyok nice write-up! I wonder if it might be worth it to copy the back-buffer before the first person hands/weapon are/is drawn, to avoid it bleeding into the refraction. (obviously this can cause mayor complications, depending on your setup)
@logicalerror As far I could saw, many game already render the weapon early on during the depth prepass to discard all the pixels that will be covered by the hands.
So not sure there is any point in the rendering pipeline to fill something else in there.
Discarding samples based on near depth seems easier I feel.
@froyok yeah it would complicate the pipeline too
I guess the sample rejection part would be similar to taa sample rejection techniques