feat(editor): auto-paint by slope for natural cliff texturing

- Auto-Paint by Slope: paints rock texture on steep terrain surfaces
  with configurable slope threshold (0.1 - 0.9)
- Uses per-vertex normal Z component to detect steepness
- Alpha blending based on slope gradient for smooth transitions
- Workflow: sculpt terrain → recalc normals → auto-paint slope → rock
  appears naturally on cliffs while flat areas keep their biome texture
This commit is contained in:
Kelsi 2026-05-05 07:19:05 -07:00
parent 8aee357a34
commit 59c6dab2b3
3 changed files with 53 additions and 0 deletions

View file

@ -756,6 +756,17 @@ void EditorUI::renderTexturePaintPanel(EditorApp& app) {
selectedTexture_.c_str());
// Auto-paint by height
if (ImGui::CollapsingHeader("Auto-Paint by Slope")) {
static float slopeThresh = 0.4f;
ImGui::SliderFloat("Slope Threshold", &slopeThresh, 0.1f, 0.9f);
ImGui::TextColored(ImVec4(0.6f,0.6f,0.6f,1), "Paints rock on steep slopes");
if (ImGui::Button("Apply Slope Paint", ImVec2(-1, 0))) {
app.getTexturePainter().autoPaintBySlope(slopeThresh,
"Tileset\\Barrens\\BarrensRock01.blp");
app.showToast("Slope paint applied");
}
}
if (ImGui::CollapsingHeader("Auto-Paint by Height")) {
ImGui::TextColored(ImVec4(0.6f, 0.6f, 0.6f, 1),
"Sets base texture per chunk based on average height");