A 72-year-old man with a history of hypertension and diabetes presents with confusion and fluctuating attention after a pneumonia admission. He is disorientated and has visual hallucinations. Which feature best distinguishes delirium from dementia in this context?