Ok, i'll do it when i have time, though not today, i'm still chilling after that hard week, i'll try tomorrow.
And sculpting related stuff works using same principle as deforming snow in modern games. Basically, i have camera that renders depth from below the table, and using that depth information i can detect shape of things above mask.
For this implementation i use 4 256x256 depth buffers (though it could be done more efficiently, i didn't have time for optimizations) and 3 mask buffers - actual depth buffer (1 channel, never shown), postprocessed depth buffer (1 channel, used for mask height) and color buffer (4 channels, used for mask paint).
- deformation - Everything drawn here will lower mask height, if rendered pixel height is lower than mask height. Stick renders here when held straight.
- smooth - Everything drawn here will blur mask in that region. Stick renders here when held sideways
- paint - Everything drawn here will fill color buffer with specific pixel color. Stick renders here when coated in paint.
- postprocess - Renders whole visible scene above mask (including hands and other stuff, if there were other stuff) and additively applies this to existing deformation, then blurs whole image and lerps postprocessed buffer with this result for smooth height change during deformation.
Everything is done on GPU side, so it should be very fast.