Commit Graph

54 Commits

Author SHA1 Message Date
Kelsi
ce105ced9f Add unlit rendering for M2 glow/additive batches
Batches with the M2 unlit material flag (0x01) or additive blend modes
(3+) now skip lighting, shadows, and fog, emitting texture color directly.
Fixes lantern glow quads appearing as dull transparent circles.
2026-02-06 03:28:21 -08:00
Kelsi
ce4299fe51 Parse M2 render flags and apply per-batch blend modes
Water/lava batches in fountain and Ironforge M2 models use non-opaque
blend modes (alpha, additive) defined in the M2 material table. Without
parsing these, they rendered as solid surfaces extending visibly beyond
their containers. Now each batch looks up its blend mode from the
material array and sets the appropriate GL blend function.
2026-02-06 01:54:25 -08:00
Kelsi
b83ec336b6 Implement M2 texture animation (UV scrolling) for fountain water
Parse M2TextureTransform entries and texture transform lookups from the
M2 binary, then apply per-batch UV offsets in the vertex shader using
the existing animation time base and global sequence durations.
2026-02-06 01:49:27 -08:00
Kelsi
c48af4926a Fix NPC hair/geoset rendering using DBC lookups
Use CharHairGeosets.dbc to map (race, sex, hairStyleId) to the correct
group 0 scalp mesh instead of the broken 101+hairStyleId formula. Filter
group 0 submeshes so only the body base and correct hair mesh render
(prevents overlapping scalp variants). Fix ItemDisplayInfo.dbc column
indices (5→7) and geoset formulas for equipment. Add CharSections.dbc
hair texture lookup and CharacterFacialHairStyles.dbc support.
2026-02-06 01:02:35 -08:00
Kelsi
961ddb187e Simplify wall collision and add intro camera pan
- Remove complex ramp/edge filtering that was skipping building walls
- Simpler wall detection: any vertical geometry above step height
- Add intro camera pan on game start
2026-02-05 18:12:27 -08:00
Kelsi
9828eb2880 Add one-time spawn camera pan 2026-02-05 18:06:52 -08:00
Kelsi
697c4b8218 Persist single-player settings and add defaults 2026-02-05 17:40:15 -08:00
Kelsi
46939808ad Use zone-specific floor cache files
Save/load floor cache per map (e.g., cache/wmo_floor_Azeroth.bin) instead
of a single global file. Saves current zone's cache before teleporting,
loads target zone's cache after terrain streaming completes.
2026-02-05 17:35:17 -08:00
Kelsi
7060c80b81 Add audio volume controls to settings 2026-02-05 17:32:21 -08:00
Kelsi
f5185c08cf Automate WMO floor cache pre-computation
Add precomputeFloorCache() method that samples all WMO bounds at load time
and populates the persistent floor height grid. Called after terrain
streaming completes (initial spawn and teleport) when cache is empty.
2026-02-05 17:30:08 -08:00
Kelsi
01de332d4c Optimize WMO rendering and collision performance
- Add texture-sorted batch merging with glMultiDrawElements to reduce draw calls
- Pre-compute merged batches at load time instead of per-frame
- Add persistent floor height cache with disk save/load (cache/wmo_floor_cache.bin)
- Reduce collision focus radius and sweep steps for faster collision checks
- Add floor cache size to performance HUD
- Reduce WMO group distance culling to 80 units
2026-02-05 17:20:30 -08:00
Kelsi
528f645350 Add shadow toggle (F4) and distance-based WMO group culling
Shadow toggle allows disabling shadow pass for performance testing.
Distance culling skips WMO groups beyond 200 units. Occlusion queries
disabled by default as overhead outweighs benefits in dense scenes.
2026-02-05 16:11:24 -08:00
Kelsi
b758f45a9f Add GPU occlusion query culling for WMO groups
Renders bounding boxes in depth-only pre-pass and queries GPU for
visibility. Groups fully occluded in previous frame are skipped.
Significantly improves performance in dense areas like Stormwind.
2026-02-05 15:51:08 -08:00
Kelsi
b05089aa3f Play tavern music file on login screen 2026-02-05 15:44:42 -08:00
Kelsi
02f8328747 Play looping MP4 behind auth screen 2026-02-05 15:34:29 -08:00
Kelsi
41ac8f646e Add WMO portal culling infrastructure and fix single-player character flow
Portal-based visibility culling for WMO rendering (disabled by default,
needs debugging for complex WMOs like Stormwind). Skip character creation
screen when characters already exist in single-player mode.
2026-02-05 15:31:00 -08:00
Kelsi
060f2bbb9f Add 3D character model preview to character creation screen
Render an animated M2 character model in the creation screen using a
dedicated CharacterRenderer with an offscreen FBO. Preview updates on
race/gender/appearance changes, supports mouse-drag rotation, and
composites skin, face, hair scalp, and underwear textures from
CharSections.dbc. Extracts getPlayerModelPath() to a shared free
function in game/character.
2026-02-05 14:58:45 -08:00
Kelsi
3ca8944ced Emulate server loot/xp and combat feedback in single-player 2026-02-05 14:01:26 -08:00
Kelsi
affcfcfce1 Add interactive world map with continent/zone navigation 2026-02-04 22:27:45 -08:00
Kelsi
47945451be Rewrite minimap to use pre-baked BLP tile textures from MPQ archives
Replace the 3D top-down rendered minimap with WoW's native pre-rendered
BLP tile textures loaded via md5translate.trs. Tiles are composited into
a 3x3 grid FBO with proper axis transposition matching the ADT terrain
convention. The screen shader provides camera-rotation, circular mask,
directional player arrow, and 20% transparency. Minimap is now on by
default with the N toggle key removed.
2026-02-04 20:06:27 -08:00
Kelsi
6690910712 Unify coordinate systems with canonical WoW world coordinates
Centralizes all coordinate conversions in core/coordinates.hpp with
proper canonical WoW coords (+X=North, +Y=West, +Z=Up). Fixes critical
tile calculation bug that was loading wrong surrounding tiles during
terrain streaming, and fixes position sync sending ADT-raw format
instead of canonical coordinates to the server.
2026-02-04 17:37:28 -08:00
Kelsi
ee9efa3478 Stabilize player shadows and improve foot contact 2026-02-04 16:41:40 -08:00
Kelsi
54eac50c4d Add player character shadow casting in shadow pass 2026-02-04 16:36:03 -08:00
Kelsi
ab4cb878ea Improve shadow stability and reduce foliage pop-in 2026-02-04 16:30:24 -08:00
Kelsi
979c0b5592 Stabilize shadows and soften foliage shadow casting 2026-02-04 16:22:18 -08:00
Kelsi
f17b15395d Implement shadow mapping pipeline for terrain and models 2026-02-04 16:08:35 -08:00
Kelsi
1f672e1d73 Add HDR post-process FBO pipeline with 4x MSAA
Render the world into an off-screen MSAA RGBA16F framebuffer, resolve
to a regular texture, then blit to screen via a fullscreen quad shader.
This sets up the infrastructure for future HDR tonemapping and SSAO
(depth texture preserved for sampling). Currently a passthrough until
HDR light sources are added. Login screen bypasses the FBO and renders
directly to the default framebuffer.
2026-02-04 15:21:04 -08:00
Kelsi
aeccddddeb Add centralized anisotropic filtering, fog, and Blinn-Phong specular to all renderers
Anisotropic filtering now queries GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT once
and applies via a single applyAnisotropicFiltering() utility, replacing
hardcoded calls across all renderers. Fog (sky horizon color, 100-600
range) and Blinn-Phong specular highlights are added to WMO, M2, and
character shaders for visual parity with terrain. Shadow sampling
plumbing (sampler2DShadow with 3x3 PCF) is wired into all three shaders
gated by uShadowEnabled, ready for a future shadow map pass.
2026-02-04 15:05:46 -08:00
Kelsi
c9adcd3d96 Add smoke particle emitters with ember sparks and enable 4x MSAA
Replace UV scroll workaround for chimney smoke with proper GL_POINTS
particle system. Smoke particles rise, expand, drift, and fade over
4-7 seconds. One in eight particles spawns as a bright orange/red
ember spark. Enable 4x multisample antialiasing for smoother edges
on player models, fences, and foliage.
2026-02-04 14:37:32 -08:00
Kelsi
11a4958e84 Add M2 global sequence animation, smoke UV scroll, and fix WMO floor detection
- Parse global sequence durations from M2 binary and use them in bone
  interpolation so torches, candles, and other env doodads animate.
- Add UV scroll shader effect for smoke models (HouseSmoke, SmokeStack)
  as a workaround for unimplemented M2 particle emitters.
- Tighten WMO floor probe heights to prevent multi-story buildings from
  returning the wrong floor, fixing player clipping through inn floors
  and camera locking onto the second floor.
- Use player ground level as reference for camera orbit floor collision
  so the camera doesn't fight upper floors in buildings.
2026-02-04 14:06:59 -08:00
Kelsi
6ca9e9024a Add loading screen, fix tree/foliage collision, jump buffering, and fence rotation
- Loading screen stays visible until all terrain tiles finish streaming;
  character spawns only after terrain is loaded and Z-snapped to ground
- Reduce tree trunk collision bounds (5% of canopy, capped at 5.0) and
  make all small/medium trees, bushes, lily pads, and foliage walkthrough
- Add jump input buffering (150ms) and coyote time (100ms) for responsive jumps
- Fix fence orientation by adding +180° heading rotation
- Increase terrain load radius from 1 to 2 (5x5 tile grid)
- Add hearthstone callback for single-player camera reset
2026-02-04 13:29:27 -08:00
Kelsi
f7cd871895 Add M2 idle animation variations, dedup instances, fix terrain textures
- Add idle variation system: creatures randomly play Stand variations
  (stretch, flap, look around) every 4-10s, then return to idle loop
- Deduplicate M2 instances at same position (was hidden before animation
  made duplicates visible with different random start times)
- Adaptive M2 render distance: 350 units in open terrain, 180 in cities
- Restore terrain sampler-to-unit uniform bindings lost during texture
  bind optimization (roads were invisible under grass)
- Safety: clamp bone count to 128, validate sequence indices, sanitize scale
2026-02-04 11:50:18 -08:00
Kelsi
15fa055726 Add M2 skeletal animation and fix terrain texture layers
- Implement GPU bone skinning for M2 doodads/creatures (gryphons, birds)
- Store bone hierarchy and animation keyframes per model
- Compute bone matrices per-instance with keyframe interpolation
- Upload bone weights/indices in vertex buffer, skinning in vertex shader
- Fix terrain texture rendering: restore sampler-to-unit uniform bindings
  removed during texture bind optimization (roads were invisible)
2026-02-04 11:40:00 -08:00
Kelsi
4bc5064515 Add spellbook, fix WMO floor clipping, and polish UI/visuals
- Add spellbook screen (P key) with Spell.dbc name lookup and action bar assignment
- Default Attack and Hearthstone spells available in single player
- Fix WMO floor clipping (gryphon roost) by tightening ceiling rejection threshold
- Darken ocean water, increase wave motion and opacity
- Add M2 model distance fade-in to prevent pop-in
- Reposition chat window, add slash/enter key focus
- Remove debug key commands (keep only F1 perf HUD, N minimap)
- Performance: return chat history by const ref, use deque for O(1) pop_front
2026-02-04 11:31:08 -08:00
Kelsi
c49bb58e47 Add gameplay systems: combat, spells, groups, loot, vendors, and UI
Implement ~70 new protocol opcodes across 5 phases while maintaining
full 3.3.5a private server compatibility:

- Phase 1: Server-aware targeting (CMSG_SET_SELECTION), player/creature
  name queries, CMSG_SET_ACTIVE_MOVER after login
- Phase 2: Auto-attack, melee/spell damage parsing, health/mana/power
  tracking from UPDATE_OBJECT fields, floating combat text
- Phase 3: Spell casting, action bar (12 slots, keys 1-=), cast bar,
  cooldown tracking, aura/buff system with cancellation
- Phase 4: Group invite/accept/decline/leave, party frames UI,
  /invite chat command
- Phase 5: Loot window, NPC gossip dialog, vendor buy/sell interface

Also: disable debug HUD/panels by default, gate 3D rendering to
IN_GAME state only, fix window resize not updating UI positions.
2026-02-04 10:31:03 -08:00
Kelsi
d0dac0df07 Refine water rendering, swimming, and underwater visuals 2026-02-03 20:40:59 -08:00
Kelsi
8bc50818a9 Implement activity SFX and decouple camera orbit from movement facing 2026-02-03 19:49:56 -08:00
Kelsi
dfc29cad10 Add intent-driven strafe animation selection and movement state hooks 2026-02-03 19:29:11 -08:00
Kelsi
871172d63e Tune collision behavior for ramps, props, and structural walls 2026-02-03 19:10:22 -08:00
Kelsi
f00d13bfc0 Improve performance and tune ramp/planter collision behavior 2026-02-03 17:21:04 -08:00
Kelsi
f43e6bf834 Tune planter curb collision and reduce foliage pushback 2026-02-03 16:51:25 -08:00
Kelsi
75046afe47 Add stepped fountain collision for parkour-style climbing 2026-02-03 16:28:33 -08:00
Kelsi
baca09828e Optimize collision queries with spatial grid and improve movement CCD 2026-02-03 16:21:48 -08:00
Kelsi
a3f351f395 Fix camera occlusion and stabilize WMO/M2 collision behavior 2026-02-03 16:04:21 -08:00
Kelsi
d03ff5ee4c Tune collision feel and align M2 movement/camera behavior 2026-02-03 15:17:54 -08:00
Kelsi
dfb1f3cfdc Add WoW-style footsteps and improve third-person movement/collision 2026-02-03 14:55:32 -08:00
Kelsi
54dc27c2ec Add WoW-style camera system with collision and first-person mode
- Implement orbit camera with smooth zoom and collision detection
- Add 50° slope limiting with sliding (prevents mountain climbing)
- Add first-person mode that hides player model and weapons
- Add floor clearance check to prevent camera clipping through ground
- Improve WMO wall collision with proper height range checks
- Add two-sided floor collision detection for WMO geometry
- Increase M2 render distance slightly for better visibility
2026-02-03 14:26:08 -08:00
Kelsi
3e792af3e5 Reduce render distances for better performance
- Terrain load radius: 2 tiles (was 6) - 25 tiles max vs 169
- WMO render distance: 500 units (was 3000)
- M2 doodad distance: 300 units (was 1000)
2026-02-03 13:37:52 -08:00
Kelsi
01bf3b4c08 Add loading screen with random WOWEE splash images
- Add loading screen system with stb_image for JPEG loading
- Two loading screen images (orc and dwarf) randomly selected
- Display loading screen while terrain data loads
- Cache WMO inverse matrices to reduce per-frame computation
- Stub WMO liquid rendering (needs coordinate system fix)
- Update spawn point to Stormwind Trade District
2026-02-03 13:33:31 -08:00
Kelsi
a9dd685398 Fix terrain collision by correcting spawn coordinates
- Spawn position changed to (-9080, -100, 100) which is on actual terrain
- The terrain mesh uses WoW coordinates from ADT files directly
- Camera/spawn position must use same coordinate system as terrain
- Cleaned up getHeightAt comments to clarify coordinate system
- Removed debug logging from WMO floor detection
2026-02-02 23:36:49 -08:00