Smarter window materials can control light, energy