To use a shader to do it you'll need two things:
1. A effect to do it
2. To store the result of the effect into a texture so it can be used for the next frame.
I'll start with 2 since that's somewhat simpler. You'll need the paster object to do this. Ideally you could have the effect on the paster object and paste it to itself every frame, but you can't paste an object onto itself. So instead you'll need two pasters with the effect and you'll need to alternate the object you're pasting from and pasting to.
So basically the first time do this:
Paster1: disable effect
Paster2: enable effect
Paster1: paste paster2
Second time do this:
Paster1: enable effect
Paster2: disable effect
Paster2: paste paster1
And repeat from the start.
As far as the effect there isn't really a good reference. My thought is you could do it with two effects.
One to move the sand down. It's logic would look like this:
If pixel=white and pixel below is black
Then set result to black
If pixel=black and pixel below is white
Then set result to white
Then the second would shift even or odd scanlines left or right.
So the effects run for one frame could be:
This really cries for a test, but webgl doesn't work on my computer.