The 2nd solution is not practical:
https://playground.babylonjs.com/#CUH660#2
I did not finish the implementation because calling readPixels
on the RenderTargetTexture
each frame is a performance killer. So you should really use the shader solution.