If you've been surprised by Mr Bean appearing on the rooftops of ancient China, you may not have noticed that the midnight world around him and his Kung Fu adversaries was completely CG.

The latest advert in Snickers' 'You're not you when you're hungry' campaign, created by and directed by Rattling Stick's Danny Kleinman, saw Framestore completely build the environment, invisibly fusing live-action elements shot at Shepperton Studios with a beautiful moonlit city crafted in post.

"We needed to build an environment that didn't just provide a backdrop, but somewhere with the right atmosphere in which to set the action and tell the story," explained VFX Supervisor William Bartlett.

Rowan Atkinson plays Cheung, a hungry Kung Fu master transformed into calamitous Mr Bean by his hunger. Framestore created his trail of mishaps as he wobbles over the rooftops - adding in toppling tiles, startled birds and clouds of debris as he crashes through the roof - and did face replacements for his stunt double when necessary.

The initial previs and planning stages saw Framestore work closely with production designer John Ebden to see how to recreate his set drawings for the spot's often fully CG shots. In the opening wide shots, everything was created by Framestore - from the digital matte paintings for the sky and the distant mountains, to detailed foreground populated with houses, streets and soldiers created by the 3D team.

For the street level shots, Framestore had to integrate another detailed all-CG environment dressed with lights, lanterns, flags, trees, doors, even a fish pond in the courtyard with a few live-action elements. A foreground soldier and men scaling the wall behind him were shot on green screen and then composited into the otherwise CG scene.

The acrobatics were shot on partial rooftops, which the Framestore team extended in every direction and sometimes replaced fully to create a stage for the action to play out on. The stunts were done on wires, meaning there was a considerable volume of removal to be done before the plate elements could be composited in, followed by a lot of hair-work to replace the detail that was lost during the process.

The spot, which was colour graded at Framestore by Stef Perry, made its TV debut during The X Factor and will be gracing the big screen across the UK cinemas in the run up to Christmas. There are also four Mr Bean Kung Fu training sketches available through social channels and a takeover of 'The X Factor' app.