How image statistics drive shape-from-texture and shape-from-specularity