In the extended edition of Two Towers they show him in a flashback of Gondor retaking Osgiliath.
It's not a particularly flattering portrayal- the military success is shown as belonging to Boromir more than Denethor- but at least it shows him sane.