It's all in the eyes, they say.

Doubly so when those eyes belong to a soldier. From the determined light brown eyes of three Afghani officers training for life after the British handover of Camp Bastion to the thousand-yard stares of a troop of exhausted soldiers returning from a three-week patrol in the hinterland, this powerful exhibition records the last days of the latest British military operation in Afghanistan. It is the work of Robert Wilson, a photographer who made his name in high-profile advertising campaigns but last year became one of Britain's Official War Artists.

Wilson's first sortie to Afghanistan came in 2009, after a friendship with an amateur photographer who happened to be a soldier led to a commission from the man's Commander to accompany the regiment on their next tour to Afghanistan. The result was the exhibition and book, Helmand: Faces Of Conflict. Helmand Return is the follow-up, the record of the packing up of Camp Bastion and all British military points Afghani, an operation whose sheer scale is evidenced in Wilson's insightful photographs.

The walls of the National War Museum exhibition space are divided into clusters of people, scrap and places, a curatorial neatness that echoes the army's own methodical division and redivision of the material detritus of conflict. Wilson carefully records it all, from a vista of wire baskets containing rocket launchers here, and spent cartridges there, to the tangle of wire mesh and canvas that represents the result when the stuffing - earth, largely - is taken out of the bomb-proof walls.

It is the quality of light that often strikes in these images. This is the light of the desert, harsh, unforgiving, but stunning too. The colour palette is wide but muted, from the yellows and browns of sand, dust and camouflage to the blues of the skies or a soldier's eyes. The destruction of conflict is writ large on the landscape, not least in Perimeter Fence, Bastion, a luminous image of a striking landscape harrowed by the logistics of war. Impromptu roads are carved into the sandy-coloured ground, tracks gouged by the off-roading Warthogs, the military's formidable all-terrain armoured vehicles. Beyond, the mountains: stark, remote, their tops disappearing in the mist. The theatre of war.

Inside the camp, in barracks surrounded by concrete-blast walls, Wilson captures images of soldiers relaxing in their bunks, guns standing easy on piles of laundry or beds, always within reach. Each space is a personalised microcosm of man and home, from a jaunty rug or duvet cover to pictures of family. Wilson works in juxtaposition, from a soldier lying on his bed staring into the distance beneath family photos to the soldier in the bed next door, ear-plugged into his laptop.

Then, too, there is the informal diptych of Camp Souter, Kabul. The first image is a view of an empty machine gun placement, a 'sangar'. The second is the view where the gun is pointing - a barren field beyond a razor-wire fence where children are playing football. Surveillance is the defining factor, from the multiple screens inside the armoured Foxhunter vehicles depicting the view from all sides to the inadvertently emu-like face of a surveillance pod attached under the wing of a Tornado.

And with this last, too, Wilson shows his eye for the absurd. It is there, again, in a scrap engine which has a comically po-face, an anthropomorphic image of a Boeing 747 with its nose cone up to load - or 'eat' - cargo, the perfectly symmetrical 'eye' of a tornado jet engine, or the bordello-red curtains that cover the doorway to Sangar No 17.

The role of Official War Artist has been used for many purposes since the post was invented in 1916, from propaganda to reflection and document. For Robert Wilson, one feels, it is about portraiture, not simply of people engaged in war, but of a moment in time.

Helmand Return, National War Museum, Edinburgh Castle (www.nms.ac.uk) until March 31, daily 9.45am-4.45pm. Free with entry to Edinburgh Castle