I previously discussed the use of Hierarchical Triangular Mesh (HTM) geometry with a Tessellated Octahedral Adaptive Subdivision Transform (TOAST) projection, and a geometry based on latitude and longitude with an Equirectangular projection. Currently the project is using the following:
- HTM for background stars (both for spatial indexing and deciding which cells to render).
- Equirectangular projections for texturing on planetary bodies.
I thought it would be useful to discuss the combination of geometry and projection with respect to the following:
- Polar Distortion
- Tile Distribution
- Virtual Textures
- Normal Mapping
- Texture Scaling
- Cloud Shadowing
Polar distortion
TOAST projections have the advantage of suffering less distortion than equirectangular projections near to the poles. Currently it appears to be easier to find data in equirectangular projection. The Sphere TOASTER tool for WorldWide Telescope allows re-projection from equirectangular to TOAST. However, since the source maps already suffer from polar distortion, the resultant TOAST projections also have poor resolution in polar regions. Finding undistorted data would solve this issue.
Tile Distribution
Spatial mapping using grid cells based on HTM has a more even distribution than cells based on latitude and longitude. I am therefore using HTM for background stars. This gives an even spatial index, and a more even number of cells to render with respect to camera orientation.
Virtual Textures
It is easy to generate level-of-detail tiles from an equirectangular source maps using a simple tool. Generating tiles for a TOAST projection from an equirectangular projeciton is possible using the Sphere TOASTER tool for WorldWide Telescope.
Normal mapping
Normal mapping using equirectangular projections is straightforward, however leads to texture seams when using TOAST. Since I wanted to use normal mapping for specular lighting, equirectangular maps were more appropriate.
Texture scaling
While waiting for virtual texture tiles to load from a cache, I take a parent tile and divide and scale it accordingly to give a lower-resoultion texture. In the case of an equirectangular projection this is a simple algorithm.
Cloud shadowing
I also wanted to cast shadows from clouds. In the case of an equirectangular projection, there is simple algorithm in the pixel shader for converting between texture and model space.