Added environment mapping code.