02561 - Computer Graphics - Worksheet 7, Part 2

5

The reason we want to carry out the transformation from clip space to world space is because we want to get the viewing direction without actually translating the skybox. We do this by finding the inverse of our MVP (P * V) and then finding the matrix multiplication of that inverse and the fragment position. Additionally, we remove the translation from the view matrix since the direction.