implement internal changes for multi-pass and shadow mapping.