Render roads directly as part of the tile texture in shaders/simple.frag

This commit is contained in:
2026-11-09 21:11:06 +01:00
parent d266715418
commit a8841f59d9
6 changed files with 184 additions and 50 deletions
+1 -15
View File
@@ -3079,25 +3079,11 @@ void QSceneRenderer::paintGL()
}
}
// 2. Render 3D Roads (above terrain elevation, writes depth so units and cities render on top)
// 2. Render 3D Units & Cities (Cylinders & Bastions; roads are rendered directly in the tile shader texture)
float fSunAngle = 45.0f;
QVector3D vSunPos(-sin(fSunAngle * PI / 180.0f), -cos(fSunAngle * PI / 180.0f), 0.6f);
vSunPos.normalize();
m_unitRenderer.renderRoads(
GameManager::instance().getTileRoads(),
GameManager::instance().roadConfigs(),
m_point,
m_numPoints05,
Projection,
vMatrix,
vSunPos,
cityViewRadius,
cityView ? cityView->tileX : -1,
cityView ? cityView->tileY : -1
);
// 3. Render 3D Units & Cities (Cylinders & Bastions)
Unit *selected = GameManager::instance().getSelectedUnit();
m_unitRenderer.renderUnits(
GameManager::instance().getUnits(),