Ok, I see that there is a TileManager::Render() and a TileRenderMgr class. Which actually takes care of rendering a tile on a sphere patch ?
Is TileShadowMgr required specifically for terrain ? I dont think tiles normally casts shadows in Orbiter.
What is TextureMgr used for ? Doesnt TileManager already manage textures for tiles ? Is TextureMgr used for the other textures, like for vessels and bases, caching stuff and moving them in or out of GPU memory as needed ?
Exactly where is the cylindrical projection calculation done ? Is it while rendering tiles on sphere patches ? So the calculation would go into TileManager::Render() ?
The following classes are specific to Terrain ? :
- TerrainManager
- TerrainManager_render
- TerrainManager_loading
- TerrainCollisionMgr
So they are not used if terrain is disabled ?
Is GDIPad used anymore ?
There is this large section from Line 29 to Line 65 in TileManager which seems pretty important in understanding how tile rendering works :
https://bitbucket.org/asmi/ovp/src/...11Client/TileManager.cpp?at=D3D11Client#cl-29
patchidx{} contains the cumulative sums of the number of textures used in each level as we discussed before.
/* Tile meshes. */
TILEMESH TileManager::TPL_1;
TILEMESH TileManager::TPL_2;
TILEMESH TileManager::TPL_3;
TILEMESH TileManager::TPL_4[2];
TILEMESH TileManager::TPL_5;
TILEMESH TileManager::TPL_6[2];
TILEMESH TileManager::TPL_7[4];
TILEMESH TileManager::TPL_8[8];
TILEMESH TileManager::TPL_9[16];
TILEMESH TileManager::TPL_10[32];
TILEMESH TileManager::TPL_11[64];
TILEMESH TileManager::TPL_12[128];
TILEMESH TileManager::TPL_13[256];
TILEMESH TileManager::TPL_14[512];
TILEMESH *TileManager::TPL[15] = { NULL, &TPL_1, &TPL_2, &TPL_3, TPL_4, &TPL_5,
TPL_6, TPL_7, TPL_8,
TPL_9, TPL_10, TPL_11, TPL_12, TPL_13,
TPL_14
};
So TPL[15] contains template meshes for tiles. In each of its elements it has either a TILEMESH* or a TILEMESH
Now coming to the code above that, I can understand TILEMESH TileManager::TPL_4[2]; as level 4 requires 2 meshes, one for each west to east hemisphere. So we need 2 TILEMESHes
But then we also have TILEMESH TileManager::TPL_6[2]; So Level 6 also needs 2 meshes, one for each hemisphere ? But then why does Level 5 also not need the same and make do with only 1 TILEMESH ?
Does int TileManager::NLAT[9] = { 0, 1, 1, 1, 1, 1, 2, 4, 8 }; specify the number of latitude divisions for each level upto level 9 ?