How can I make grab Shader similar to https://docs.unity3d.com/Manual/SL-GrabPass.html in GLSL.
The idea, is that you grab exact pixels from background (ex. from composited renderTarget) and put on rendered object. So it's like 100% transparency, because it always has the pixels right behind. Later if you disort the pixels, can give very cool effects like https://www.shadertoy.com/view/Mdc3Rl.
SO far I have texture of background (plane to renderTarget), and object cube right before it. My vertex shader for cube is
gl_Position = WVP * spos; and I have no idea how do the frag shader to copy the pixels from background. Any help appreciated.