An eye-opening exhibition shows how scientific breakthroughs shaped modern art