Attempted to optimize the calculation by combining multiple steps, though it didn't actually help at all.
Started some skeleton code to do tone mapping.