some shadowmap code