feat(editor): thermal erosion simulation for natural terrain aging

- Thermal Erosion: physically-based material transfer where steep
  slopes shed material to neighbors based on angle of repose
- Configurable iterations (1-50) and talus angle (10-80 degrees)
- Lower talus angle = more aggressive erosion (sandy terrain)
- Higher angle = less erosion (rocky terrain holds steep slopes)
- Creates natural talus fans at cliff bases and rounded hilltops
- Workflow: sculpt/generate → thermal erosion → smooth → auto-paint
This commit is contained in:
Kelsi 2026-05-05 07:45:16 -07:00
parent 9be32a6634
commit 2d5692d5ad
3 changed files with 52 additions and 0 deletions

View file

@ -603,6 +603,19 @@ void EditorUI::renderBrushPanel(EditorApp& app) {
ImGui::TextColored(ImVec4(0.6f, 0.6f, 0.6f, 1), "No stamp copied");
}
if (ImGui::CollapsingHeader("Thermal Erosion")) {
static int erosionIters = 10;
static float talusAngle = 40.0f;
ImGui::SliderInt("Iterations##therm", &erosionIters, 1, 50);
ImGui::SliderFloat("Talus Angle##therm", &talusAngle, 10.0f, 80.0f, "%.0f deg");
if (ImGui::Button("Apply Thermal Erosion", ImVec2(-1, 0))) {
app.getTerrainEditor().thermalErosion(erosionIters, talusAngle);
app.showToast("Thermal erosion applied");
}
ImGui::TextColored(ImVec4(0.6f, 0.6f, 0.6f, 1),
"Material slides downhill. Lower angle = more erosion.");
}
if (ImGui::CollapsingHeader("Terrace / Steps")) {
static int terraceSteps = 6;
ImGui::SliderInt("Steps##terrace", &terraceSteps, 2, 20);