curtains.js black hole effect in fragment shader

44 Views Asked by At

i am trying to get a kind of a black hole effect where the chessboard gets sucked into the middle of the frame, like in the image below:

enter image description here

In the main FS function I have this:

vec4 mapEffect = texture2D(displacementTexture1, vTextureCoord);
vec4 finalColor = texture2D(sourceImage, vDisplacedTextureCoord + mapEffect.xy);
gl_FragColor = finalColor;

But i only get this no matter how i tweak the values and the operators.

enter image description here

I would appreciate a small hint on how to proceed :)

0

There are 0 best solutions below