mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +00:00
Implement comprehensive taxi flight optimizations and proper spline paths
Major improvements: - Load TaxiPathNode.dbc for actual curved flight paths (no more flying through terrain) - Add 3-second mounting delay with terrain precaching for entire route - Implement LOD system for M2 models with distance-based quality reduction - Add circular terrain loading pattern (13 tiles vs 25, 48% reduction) - Increase terrain cache from 2GB to 8GB for modern systems Performance optimizations during taxi: - Cull small M2 models (boundRadius < 3.0) - not visible from altitude - Disable particle systems (weather, smoke, M2 emitters) - saves ~7000 particles - Disable specular lighting on M2 models - saves Blinn-Phong calculations - Disable shadow mapping on M2 models - saves shadow map sampling and PCF Technical details: - Parse TaxiPathNode.dbc spline waypoints for curved paths around terrain - Build full path from node pairs using TaxiPathEdge lookup - Precache callback triggers during mounting delay for smooth takeoff - Circular tile loading uses Euclidean distance check (dx²+dy² <= r²) - LOD fallback to base mesh when higher LODs unavailable Result: Buttery smooth taxi flights with no terrain clipping or performance hitches
This commit is contained in:
parent
941dac446d
commit
536b3cea48
9 changed files with 249 additions and 32 deletions
|
|
@ -1161,6 +1161,11 @@ void TerrainManager::streamTiles() {
|
|||
continue;
|
||||
}
|
||||
|
||||
// Circular pattern: skip corner tiles beyond radius (Euclidean distance)
|
||||
if (dx*dx + dy*dy > loadRadius*loadRadius) {
|
||||
continue;
|
||||
}
|
||||
|
||||
TileCoord coord = {tileX, tileY};
|
||||
|
||||
// Skip if already loaded, pending, or failed
|
||||
|
|
@ -1183,11 +1188,11 @@ void TerrainManager::streamTiles() {
|
|||
for (const auto& pair : loadedTiles) {
|
||||
const TileCoord& coord = pair.first;
|
||||
|
||||
int dx = std::abs(coord.x - currentTile.x);
|
||||
int dy = std::abs(coord.y - currentTile.y);
|
||||
int dx = coord.x - currentTile.x;
|
||||
int dy = coord.y - currentTile.y;
|
||||
|
||||
// Chebyshev distance
|
||||
if (dx > unloadRadius || dy > unloadRadius) {
|
||||
// Circular pattern: unload beyond radius (Euclidean distance)
|
||||
if (dx*dx + dy*dy > unloadRadius*unloadRadius) {
|
||||
tilesToUnload.push_back(coord);
|
||||
}
|
||||
}
|
||||
|
|
@ -1210,5 +1215,24 @@ void TerrainManager::streamTiles() {
|
|||
}
|
||||
}
|
||||
|
||||
void TerrainManager::precacheTiles(const std::vector<std::pair<int, int>>& tiles) {
|
||||
std::lock_guard<std::mutex> lock(queueMutex);
|
||||
|
||||
for (const auto& [x, y] : tiles) {
|
||||
TileCoord coord = {x, y};
|
||||
|
||||
// Skip if already loaded, pending, or failed
|
||||
if (loadedTiles.find(coord) != loadedTiles.end()) continue;
|
||||
if (pendingTiles.find(coord) != pendingTiles.end()) continue;
|
||||
if (failedTiles.find(coord) != failedTiles.end()) continue;
|
||||
|
||||
loadQueue.push(coord);
|
||||
pendingTiles[coord] = true;
|
||||
}
|
||||
|
||||
// Notify workers to start loading
|
||||
queueCV.notify_all();
|
||||
}
|
||||
|
||||
} // namespace rendering
|
||||
} // namespace wowee
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue