Commit graph

30 commits

Author SHA1 Message Date
Kelsi
14d305a477 feat(editor): rotate terrain 90 degrees clockwise
- Rotate 90 CW button in Mirror/Rotate section
- Snapshots outer vertex heights into 129x129 grid, rotates in-place,
  writes back with inner vertices averaged from surrounding outers
- Useful for reorienting terrain features or creating rotational
  symmetry (rotate + mirror for 4-way symmetric arenas)
2026-05-05 08:32:59 -07:00
Kelsi
3504e57f75 feat(editor): detail noise for adding small-scale terrain roughness
- Detail Noise: adds high-frequency roughness to existing terrain
  without destroying the overall shape (amplitude 0.5-10, freq 0.01-0.5)
- Useful after smooth/generate to break up unnaturally smooth surfaces
- Workflow: generate → smooth → detail noise for natural look
- Separate seed from main noise generator for independent control
2026-05-05 08:20:54 -07:00
Kelsi
6277800773 feat(editor): edge ramp tool for seamless multi-tile connections
- Edge Ramp: smoothly transitions tile borders to a target height
  so adjacent tiles can connect seamlessly
- Configurable target height and ramp width (how far in from the edge)
- Quadratic blend for smooth start from edge → interior
- Essential for multi-tile zone creation: ramp each tile's edges to
  match its neighbor's border height
2026-05-05 08:13:04 -07:00
Kelsi
426863f19a feat(editor): smooth beaches tool for natural water-land transitions
- Smooth Beaches button in Water panel: creates gentle beach slopes
  near water level by blending terrain toward waterline height
- Configurable beach width (15 units default)
- Quadratic falloff creates natural concave beach profile
- Use after filling water to soften harsh land-water edges
- Workflow: sculpt → fill water → smooth beaches → paint sand
2026-05-05 08:06:20 -07:00
Kelsi
b113c218bd feat(editor): voronoi cell noise for organic terrain patterns
- Voronoi noise generator: creates cell-like terrain patterns with
  ridge features at cell boundaries (F2-F1 distance field)
- Configurable cell count (5-100) and amplitude
- Toggle between Value noise and Voronoi in the noise generator section
- Creates interesting mesa/plateau formations and organic shapes
- Random cell centers with per-cell height variation
2026-05-05 07:59:10 -07:00
Kelsi
5f9bf5c924 feat(editor): height offset tool for shifting entire terrain up/down
- Offset Heights: shifts all terrain heights by a constant amount
  (-100 to +100 range with Apply button)
- Useful for raising terrain above water level or sinking below
- Slider + Apply button in the Noise Generator section
2026-05-05 07:53:01 -07:00
Kelsi
825939db3b feat(editor): invert heights, fill entire tile with water, remove all water
- Invert Heights: flips terrain upside-down around midpoint (mountains
  become valleys and vice versa)
- Fill Entire Tile with Water: one-click fills all 256 chunks at the
  configured water height and liquid type
- Remove ALL Water: clears water from every chunk instantly
- Water panel now has three water operations: fill tile, remove under
  brush, remove all
- fillWater() and invertHeights() methods on TerrainEditor
2026-05-05 07:49:48 -07:00
Kelsi
2d5692d5ad 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
2026-05-05 07:45:16 -07:00
Kelsi
9be32a6634 feat(editor): terrain terrace/step generator for layered landscapes
- Terrace tool: quantizes terrain heights into N flat shelves
  (like rice paddies, cliff shelves, or stepped pyramids)
- Configurable step count (2-20)
- Finds actual height range and divides evenly
- Auto-stitches chunk edges after terracing
- Useful for creating tiered arenas, agricultural zones, or
  stylized Meso-American terrain
2026-05-05 07:43:10 -07:00
Kelsi
f3846919a4 feat(editor): winding canyon generator with seeded sine-wave path
- Canyon Generator: carves a winding canyon across the entire tile
  using layered sine waves for natural serpentine shape
- Configurable width, depth, and seed for different canyon shapes
- Quadratic falloff at edges for smooth cliff walls
- Random seed button for quick shape exploration
- Fill with Water mode for instant river canyon
2026-05-05 07:37:27 -07:00
Kelsi
7971fd7989 feat(editor): island terrain generator with beach falloff
- Island Generator: creates raised center terrain dropping to edges
  with configurable center height and edge drop depth
- Flat interior plateau → gradual beach slope → steep underwater drop
- Preserves existing noise detail at 30% blend for natural variation
- Add water around the island for instant ocean environment
- Workflow: New Terrain → Island → Noise → Smooth → Auto-paint
2026-05-05 07:35:18 -07:00
Kelsi
1c58911da0 feat(editor): ridge/mountain range generator between two points
- Ridge Generator: creates mountain ranges by setting start and end
  points, with configurable width and height
- Cross-section uses quadratic falloff, along-axis uses sqrt taper
  for natural mountain range silhouette (wider at center, tapering
  at both ends)
- Same start/end workflow as river/road tools
2026-05-05 07:00:05 -07:00
Kelsi
d6c58b5dc9 feat(editor): hill/valley generator with smooth bell curve shape
- Hill Generator: creates smooth bell-curve hills at cursor position
  with configurable radius and height
- Valley mode: same shape inverted, creates natural depressions
- Uses (1-t^2)^2 falloff for very smooth natural-looking slopes
- Two buttons: "Create Hill" and "Create Valley" for quick terrain
  shaping without switching brush modes
2026-05-05 06:57:18 -07:00
Kelsi
88416bbb1d fix(editor): NPC markers always on top, mesa generator, terrain tools
- NPC markers now render with NO depth test (via gizmo pipeline) so
  they're always visible even on sloped/rough terrain
- Mesa/Plateau generator: creates raised flat areas with steep cliff
  edges — configurable radius, height, and edge steepness
- NPC markers drawn after gizmo in the render pipeline to guarantee
  they appear on top of everything
- Fixes NPC visibility on non-flat terrain
2026-05-05 06:55:04 -07:00
Kelsi
1502c2ed85 feat(editor): crater generator for lakes, arenas, impact sites
- Crater Generator in Sculpt panel: creates a bowl-shaped depression
  with configurable radius, depth, and raised rim height
- Parabolic bowl interior with sinusoidal rim and smooth outer falloff
- Perfect for creating lakes (fill with Water mode), arenas, or
  impact craters for volcanic zones
- One click at cursor position, uses brush position for center
2026-05-05 06:50:24 -07:00
Kelsi
f593606251 feat(editor): reset-to-flat button for terrain, consolidation
- "Reset to Flat" button in Noise Generator section: zeroes all heights
  across entire tile for starting over without creating a new terrain
- Useful workflow: reset → noise → smooth → scale → clamp → auto-paint
2026-05-05 06:40:26 -07:00
Kelsi
3ac40d27ad feat(editor): road flattener tool alongside river carver
- River/Road Carver section now has two modes:
  - River: carves a channel below terrain (existing)
  - Road: flattens terrain to interpolated height between start/end
- Road mode smoothly transitions height along the path with quadratic
  falloff at edges for natural embankment shape
- Set Start → Set End + Apply workflow works for both modes
- Roads follow terrain slope by interpolating between start/end heights
- Pair with Paint mode to add cobblestone/dirt texture on the road
2026-05-05 06:37:54 -07:00
Kelsi
d573f3a678 feat(editor): river/path carver tool for terrain channels
- River Carver in Sculpt panel: carves a channel between two points
  with configurable width and depth
- Set Start at cursor, then Set End + Carve to create the channel
- Smooth quadratic falloff at edges for natural riverbank shape
- Works by projecting each terrain vertex onto the line segment and
  lowering height based on distance from center
- Auto-stitches chunk edges after carving
- Pair with Water mode to fill the carved channel with liquid
2026-05-05 06:30:26 -07:00
Kelsi
dd2b9294b5 feat(editor): terrain mirror X/Y for symmetric zone design
- Mirror X: copies left half of terrain to right half (mirrored)
- Mirror Y: copies top half to bottom half (mirrored)
- Useful for creating symmetric zones, arenas, or balanced landscapes
- Auto-stitches all chunk edges after mirror for seamless results
- UI buttons in Sculpt panel under "Mirror Terrain" section
2026-05-05 06:24:28 -07:00
Kelsi
1ba1a50112 feat(editor): terrain stamp/clone tool for replicating terrain features
- Copy Stamp: captures all vertex heights within brush radius at cursor
  position, storing relative offsets from center
- Paste Stamp: applies the copied height pattern at a new location,
  finding nearest vertices and setting their heights
- Stamp status shown in panel ("Stamp ready" / "No stamp copied")
- Auto-stitches chunk edges after paste for seamless results
- Useful for replicating hills, craters, or other terrain features
2026-05-05 06:15:33 -07:00
Kelsi
9322d37b81 feat(editor): height scale tool for terrain relief control
- Scale Heights: multiply all terrain heights by a factor (0.1x - 5.0x)
- >1.0 exaggerates relief (deeper valleys, taller peaks)
- <1.0 flattens terrain toward base height
- Re-stitches all chunk edges after scaling for seamless results
- Workflow: noise → smooth → scale → clamp for precise control
2026-05-05 05:55:05 -07:00
Kelsi
d59d69b0c5 feat(editor): height clamp tool for controlled terrain range
- Clamp Heights: sets min/max height bounds across entire tile
  (DragFloatRange2 slider for min/max, -500 to 2000 range)
- Useful workflow: Generate noise → Smooth → Clamp to desired range
- Prevents terrain from going underground or too high
- All affected chunks marked dirty for mesh regeneration
2026-05-05 05:51:03 -07:00
Kelsi
9bc05fae87 feat(editor): smooth entire tile, snap-to-ground toggle, object list improvements
- Smooth Entire Tile: global smoothing pass with configurable iterations
  (1-10). Smooths across chunk boundaries for seamless results. Updates
  inner vertices from smoothed outer grid. Great after noise generation.
- Snap to Ground checkbox: on by default, objects placed at terrain
  surface. Disable for floating/airborne objects.
- Random Rotation + Snap Ground checkboxes side-by-side for fast setup
- Toast notifications on noise apply and smooth operations
- Smooth pass uses cross-chunk neighbor averaging for edge continuity
2026-05-05 05:00:31 -07:00
Kelsi
89312120f4 feat(editor): heightmap export, help overlay, keyboard reference
- Export Heightmap: File > Export Heightmap saves terrain as 16-bit
  RAW grayscale (129x129) for use in external terrain editors or
  as a backup. Configurable max height scale.
- Help overlay (F1 or Help menu): lists all keyboard shortcuts
  organized by category (navigation, editing, object transform, view)
- Round-trip heightmap workflow: import → edit → export
2026-05-05 04:52:36 -07:00
Kelsi
2f96f112bd feat(editor): heightmap import, toast notifications, workflow polish
- Import Heightmap: File > Import Heightmap loads RAW 8/16-bit grayscale
  files (129x129 or 257x257) and maps to terrain heights with configurable
  scale. Supports standard terrain editor heightmap formats.
- Toast notifications: non-intrusive green popup at bottom center for
  user feedback (save confirmations, import results, errors)
- Toasts fade out after 3 seconds with alpha animation
- Auto-save now shows toast on save
- Quick-save (Ctrl+S) shows toast confirmation
2026-05-05 04:49:43 -07:00
Kelsi
a91233a6ec feat(editor): erosion brush, NPC load, auto-save
- Erode brush mode: simulates water erosion by moving height downhill
  based on slope, creating natural drainage patterns and gullies
- NPC JSON loader: File > Load NPCs parses saved creatures.json back
  into the spawn list (round-trip save/load now works)
- Auto-save: every 5 minutes when unsaved changes exist, exports the
  full zone (ADT + WDT + creatures) to the output directory
- Sculpt mode now has 6 brush types: Raise/Lower/Smooth/Flatten/Level/Erode
2026-05-05 04:44:54 -07:00
Kelsi
42749e9b58 feat(editor): procedural noise generator, sky presets, viewport lighting
- Noise Generator in Sculpt panel: applies procedural value noise
  with configurable frequency, amplitude, octaves, and seed
  to create hills/valleys across entire tile instantly
- Sky/Lighting presets: View > Sky menu with Day (blue sky, high sun),
  Dusk (orange, low sun), Night (dark blue, moonlight)
- Viewport clear color and light direction now configurable at runtime
- Noise uses smoothstep interpolation with octave fractal layering
2026-05-05 04:40:37 -07:00
Kelsi
f5fe9a0101 feat(editor): terrain holes, recent textures, sculpt panel polish
- Punch Hole / Fill Hole buttons in Sculpt panel: creates terrain
  holes (4x4 bitmask) for cave entrances, mine shafts, etc.
  Uses brush radius to determine affected area.
- Recent Textures: paint panel shows last 6 used textures as quick-
  select buttons (no need to re-search the full list)
- Holes saved in ADT format (MCNK holes field) and respected by
  the mesh generator (triangles skipped at hole positions)
2026-05-05 04:34:03 -07:00
Kelsi
ba96de7138 fix(editor): normal recalculation after sculpt, mode switch cleanup
- Terrain normals recalculated after height changes (smooth lighting
  on sculpted terrain instead of flat-shaded appearance)
- Ghost preview and brush indicator cleared when switching modes
  (prevents stale model instances or circles persisting)
- File > Clear All resets undo history and selections
- Normal computation uses finite differences from neighbor heights,
  handles both outer (9x9) and inner (8x8) vertex grid positions
2026-05-05 04:24:20 -07:00
Kelsi
2980ca83e7 feat(editor): add standalone world editor (rough/WIP)
Standalone wowee_editor tool for creating custom WoW zones.
This is a rough initial implementation — many features work but
M2/WMO rendering still has issues (frame sync, texture layout
transitions) and needs further polish.

Terrain:
- Create new blank terrain with 10 biome types (Grassland, Forest,
  Jungle, Desert, Barrens, Snow, Swamp, Rocky, Beach, Volcanic)
- Load existing ADT tiles from extracted game data
- Sculpt brushes: Raise, Lower, Smooth, Flatten, Level
- Chunk edge stitching prevents seams between tiles
- Undo/redo (100-deep stack, Ctrl+Z/Ctrl+Shift+Z)
- Save to WoW ADT/WDT format

Texture Painting:
- Paint/Erase/Replace Base modes
- Full tileset texture browser (1285 textures from manifest)
- Per-zone directory filtering and search
- Alpha map editing with 4-layer limit (auto-replaces weakest)

Object Placement:
- M2 and WMO model placement with full manifest browser (11k M2s, 2k WMOs)
- M2Renderer + WMORenderer integrated (loads .skin files for WotLK)
- Ghost preview follows cursor before placing
- Ctrl+click selection, right-click context menu
- Transform gizmo (Move/Rotate/Scale with axis constraints)
- Position/rotation/scale editing in properties panel

NPC/Monster System:
- 631 creature presets scanned from manifest, categorized
  (Critters, Beasts, Humanoids, Undead, Demons, etc.)
- Stats editor: level, health, mana, damage, armor, faction
- Behavior: Stationary, Patrol, Wander, Scripted
- Aggro/leash radius, respawn time, flags (hostile/vendor/etc.)
- Save creature spawns to JSON

Water:
- Place water at configurable height per chunk
- Liquid types: Water, Ocean, Magma, Slime
- Rendered as translucent colored quads
- Saved in ADT MH2O format

Infrastructure:
- Free-fly camera (WASD/QE, right-drag look, scroll speed)
- 5-mode toolbar: Sculpt | Paint | Objects | Water | NPCs
- Asset browser indexes full manifest on startup
- Editor water/marker shaders (pos+color vertex format)
- forceNoCull added to M2Renderer for editor use
- AssetManifest::getEntries() and AssetManager::getManifest() exposed

Known issues:
- M2/WMO rendering may not display on first placement (frame index
  sync between update/render was misaligned — now fixed but untested
  end-to-end)
- Validation layer errors on shutdown (resource cleanup ordering)
- Object placement on steep terrain can miss raycast
- No undo for texture painting or object placement yet
2026-05-05 03:47:03 -07:00