I guess thats simply programming.
The blocks notice when another block gets "attached" and then
get exchanged by full grid blocks.

(not shaders... )

Very well made though.