Continuing with the engine series, I’ve coded environment map support. I think it’s vertically inverted, but it’s late and maybe I can’t see properly. Calculating the environment map, has been easy. I’ve simply had to compute average normal vector for each vertex and transform it appropriately to view camera space. The resulting transformed vector, will be used to address texture space by converting vectors x and y coordinates to texture space. This process, it not much more expensive in cpu time than simply texturing triangles.
Environment Map live demo:
As usual, chrome will be the preferred browser to watch at EnvironmentMap demo.
Thank you for stopping by.