Nanophotonics for polarization control and thermal management