Fix window resizing; optimize dynamic shadows