mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-06 00:53:52 +00:00
feat(editor): one-click Generate Complete Zone pipeline
- File > Generate Complete Zone: runs the full procedural pipeline in one click: noise → smooth (3 passes) → recalc normals → height-based auto-paint (sand/grass/rock/snow) → slope-based cliff paint (rock on steep faces) - Creates a fully textured, natural-looking zone from flat terrain - Removed stale quickGenerate checkbox from New Terrain dialog
This commit is contained in:
parent
59c6dab2b3
commit
e516c3c71f
3 changed files with 39 additions and 5 deletions
|
|
@ -816,6 +816,41 @@ void EditorApp::flyToSelected() {
|
|||
}
|
||||
}
|
||||
|
||||
void EditorApp::generateCompleteZone() {
|
||||
if (!terrain_.isLoaded()) return;
|
||||
showToast("Generating zone...");
|
||||
|
||||
// Step 1: Apply noise
|
||||
terrainEditor_.applyNoise(0.005f, 30.0f, 4, 42);
|
||||
|
||||
// Step 2: Smooth
|
||||
terrainEditor_.smoothEntireTile(3);
|
||||
|
||||
// Step 3: Recalc normals for slope paint
|
||||
std::vector<int> allChunks;
|
||||
for (int i = 0; i < 256; i++) allChunks.push_back(i);
|
||||
terrainEditor_.recalcNormals(allChunks);
|
||||
|
||||
// Step 4: Auto-paint by height
|
||||
std::vector<TexturePainter::HeightBand> bands = {
|
||||
{90.0f, "Tileset\\Tanaris\\TanarisSandBase01.blp"},
|
||||
{110.0f, "Tileset\\Elwynn\\ElwynnGrassBase.blp"},
|
||||
{140.0f, "Tileset\\Barrens\\BarrensRock01.blp"},
|
||||
{99999.0f, "Tileset\\Expansion02\\Dragonblight\\DragonblightFreshSmoothSnowA.blp"}
|
||||
};
|
||||
texturePainter_.autoPaintByHeight(bands);
|
||||
|
||||
// Step 5: Slope paint (rock on cliffs)
|
||||
texturePainter_.autoPaintBySlope(0.4f, "Tileset\\Desolace\\DesolaceRock01.blp");
|
||||
|
||||
// Refresh
|
||||
auto mesh = terrainEditor_.regenerateMesh();
|
||||
viewport_.clearTerrain();
|
||||
viewport_.loadTerrain(mesh, terrain_.textures, loadedTileX_, loadedTileY_);
|
||||
|
||||
showToast("Zone generated!");
|
||||
}
|
||||
|
||||
void EditorApp::clearAllObjects() {
|
||||
vkDeviceWaitIdle(window_->getVkContext()->getDevice());
|
||||
objectPlacer_.clearAll();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue