dirRenderer will be passed into this function instead of being defined inside of it.